diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index e5908c26ac0..00000000000 --- a/.dockerignore +++ /dev/null @@ -1,16 +0,0 @@ -build -build.xml -ChangeLog -composer.json -CONTRIBUTING.md -COPYING -COPYRIGHT -dev -doc -Dockerfile -INSTALL -README-FR.md -README.md -robots.txt -scripts -test \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index db0f3196cf8..bac020e13c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,19 +2,15 @@ # from Dolibarr GitHub repository. # For syntax, see http://about.travis-ci.org/docs/user/languages/php/ +# We use dist: precise to have php 5.3 available dist: precise sudo: required language: php -php: -- '5.3' -- '5.4' -- '5.5' -- '5.6.29' -- '7.0' -- '7.1' -- nightly +# Start on every boot +services: +- memcached addons: mariadb: '10.0' @@ -33,10 +29,16 @@ addons: - libapache2-mod-fastcgi # We need pgloader for import mysql database into pgsql - pgloader - -# Start on every boot -services: -- memcached + +php: +- '5.3' +- '5.4' +- '5.5' +- '5.6' +- '7.0' +- '7.1' +#- hhvm only with dist: trusty +- nightly env: global: @@ -57,11 +59,22 @@ env: matrix: fast_finish: true allow_failures: - - php: 7.1 + - php: hhvm - php: nightly - #- env: DB=postgresql - # TODO - #- env: DB=sqlite + # We exclude some combinations not usefull to save Travis CPU + exclude: + - php: '5.4' + env: DB=postgresql + - php: '5.5' + env: DB=postgresql + - php: '5.6' + env: DB=postgresql + - php: '7.0' + env: DB=postgresql + - php: hhvm + env: DB=postgresql + - php: nightly + env: DB=postgresql notifications: email: @@ -305,6 +318,9 @@ script: php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade500600-2.log php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log + php upgrade.php 6.0.0 7.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade600700.log + php upgrade2.php 6.0.0 7.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade600700-2.log + php step5.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-3.log cd - set +e echo diff --git a/COPYRIGHT b/COPYRIGHT index 04f0358a655..427784a1552 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -53,6 +53,7 @@ jQuery Tiptip 1.3 GPL and MIT License Yes jsGanttImproved 1.7.5.2 BSD License Yes JS library (to build Gantt reports) JsTimezoneDetect 1.0.6 MIT License Yes JS library to detect user timezone SwaggerUI 2.0.24 GPL-2+ Yes JS library to offer the REST API explorer +Ace 1.2.8 BSD Yes JS library to get code syntaxique coloration in a textarea. For licenses compatibility informations: http://www.gnu.org/licenses/licenses.en.html diff --git a/ChangeLog b/ChangeLog index ace6c60c0c0..c64bec0d881 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,12 +2,139 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 7.0.0 compared to 6.0.* ***** + +WARNING: + +Following changes may create regression for some external modules, but were necessary to make Dolibarr better: +* The methode "cloture" on contact were renamed into "closeAll". + + + ***** ChangeLog for 6.0.0 compared to 5.0.* ***** +NEW: Add experimental BlockeLog module (to log business events in a non reversible log file). +NEW: Add a payment module for Stripe. +NEW: Add module "Product variant" (like red, blue for the product shoes) +NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC) +NEW: Add a tracking id into mass emailing. +NEW: Tax system more compatible with the new tax rollout in India (IGST / CGST / SGST). +NEW: Add calculation function for Loan schedule +NEW: Add "depends on" and "required by" into module informations +NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO +NEW: Add key __USERID__ and __ENTITYID__ as key for dynamic filters. +NEW: Add last activation author and ip of modules +NEW: Add mass actions (pdf merge and delete) for interventions +NEW: Add module resources import/export +NEW: Add option PROJECT_THIRDPARTY_REQUIRED +NEW: Add page statistics for project tasks +NEW: add property to show warnings when activating modules +NEW: add rapport file for supplier paiement +NEW: Add statistics on supplier tab. +NEW: Add tooltip help on shipment weight and volume calculation +NEW: An external module can hook and add mass actions. +NEW: Better reponsive design +NEW: Bookmarks are into a combo list. +NEW: Bulk actions available on supplier orders +NEW: Can add a background image on login page +NEW: Can change customer from POS +NEW: Can clone expense report on another user +NEW: Can control constants values into file integrity checker +NEW: Can define default values for create forms. +NEW: Can define default filters for list pages. +NEW: Can define default sort order for list pages. +NEW: Can deploy an external module from the module setup area. +NEW: Can disable all overwrote translations in one click. +NEW: Can edit background color for odd and even lines in tables +NEW: Can filter on code in dictionnaries +NEW: Can filter on year and product tags on the product statistic page +NEW: Can import users +NEW: Can read time spent of others (hierarchy only or all if granted) +NEW: Can send an email to a user from its card. +NEW: Can send email to multiple destinaries from the mailform combo list. +NEW: Can set margins of PDFs +NEW: Can set number of dump to keep with job "local database backup" +NEW: Can sort customer balance summary on date. +NEW: Can sort thumbs visible on product card. +NEW: Can use a credit note into a "down payment/deposit". +NEW: Can use dol_fiche_end without showing bottom border. +NEW: Can use translations into all substitutions (watermark, freetext...) +NEW: Change to allow a specific numbering rule for invoice with POS module. +NEW: convert exceiss received to reduc +NEW: custom dir is enabled dy default on first install. +NEW: Description of feature of a module visible into a dedicated popup. +NEW: Direct open of card after a search if one record only found. +NEW: download button +NEW: Enable bulk actions delete on supplier invoices. +NEW: Extrafields support formulas to be computed using PHP expressions. +NEW: Feature to crop/resize images available on user and expense reports. +NEW: Filechecker can include custom dir and report added files. +NEW: fix listview class and add a demo for product list +NEW: [FP17] Accountancy - Add select field in list of accounts +NEW: get amount base on hourly rate for ficheinter +NEW: hidden Easter egg to display commitstrip strip on login page +NEW: Include an hourglass icon when we click on online payment button +NEW: Index upload files into database. +NEW: Introduce mass action on product list ('delete' for the moment) +NEW: Introduce mass actions on contacts +NEW: Introduce option MAIN_HTTP_CONTENT_SECURITY_POLICY +NEW: It's easier to switch between sandbox and live for paypal +NEW: Mass action delete available on project and tasks +NEW: Move login information on home page into a widget +NEW: new demo entry page +NEW: No external check of version without explicit click in about page. +NEW: ODT docs for USER USERGROUP CONTRACT and PRODUCT class +NEW: odt usergroup +NEW: On invoices generated by template, we save if invoice come from a source template. +NEW: option to copy into attachement files of events, files send by mail (with auto event creation) +NEW: PDF with numbertoword +NEW: Permit multiple file upload in linked documents +NEW: PHP 7.1 compatibility +NEW: Reduce memory usage by removing deprecated constant loading. +NEW: Report page and menu for suppliers paiements +NEW: Show by default README.md file found into root dir of ext module. +NEW: Show company into combo list of projects +NEW: show files in the bank statement + download +NEW: Show local taxes in facture list +NEW: Show local taxes in supplier facture list +NEW: Small PDF template for products +NEW: Option SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT +NEW: The substitution keys available for emailing edition are now visible into a popup. +NEW: Uniformize behaviour: Action to make order is an action button. +NEW: Use autocompletion on the "Add widget list". +NEW: Use html5 type "number" on select field for year and duration. +NEW: Can use pdktk to concat mass pdf because tcpdf generate avoid to split large file into multiple smaller file (all have same size) encounter issue with mailer provider virtual delivery service +NEW: Default theme of v6 is cleaner. +NEW: When down payment is entered, discount to reuse into final invoice is automatically created. This save one click into invoice workflow. +NEW: Add UI to configure MEMBER_NEWFORM_FORCETYPE +NEW: #2763 Go to document block after clicking in Generate document button +NEW: #6280: Generate PDF after creating an invoice from a customer order +NEW: #6915 Simplest change. +NEW: Uniformize the look and feel with v6 new look. + For developers: NEW: Add a lot of API REST: dictionaryevents, memberstypes, ... NEW: Big refactorization of multicompany transverse mode. NEW: getEntity function use true $shared value by default. +NEW: Add font-awesome css. +NEW: Add function ajax_autoselect +NEW: Add function dolMd2Html +NEW: Add hook doUpgrade2 +NEW: Add hook "formatNotificationMessage" +NEW: Add index and constraints keys on supplier proposal detail table +NEW: Add phpunit to check the engine is defined into sql create files. +NEW: Add project and Hook to Loan +NEW: Add REST API to push a file. +NEW: Allow extrafields list select to be dependands on other standard list and not only other extrafields list +NEW: Architecture to manage search criteria persistance (using save_lastsearch_values=1 on exit links and restore_lastsearch_values=1 in entry links) +NEW: data files are now also parsed by phpunit for sql syntax +NEW: Hook to allow inserting custom product head #6001 +NEW: Introduce fields that can be computed during export in export profiles. +NEW: Introduce function dol_compress_dir +NEW: Removed commande_pdf_create, contract_pdf_create,expedition_pdf_create, facture_pdf_create, delivery_order_pdf_create, task_pdf_create, project_pdf_create, propale_pdf_create, supplier_invoice_pdf_create, supplier_order_pdf_create, supplier_proposal_pdf_create deprecated functions +NEW: tooltip can be on hover or on click with textwithpicto function. +NEW: Upgrade jquery to 3.3.1 and jquery-ui to 1.12 WARNING: @@ -25,16 +152,61 @@ Following changes may create regression for some external modules, but were nece * Removed Societe::set_commnucation_level (was deprecated in 4.0). Was not used. * Removed the trigger file of PAYPAL module that stored data that was not used by Dolibarr. The trigger event still exists, but if an external module need action on it, it must provides itself its trigger file. -* Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode +* Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode. So, if you set var + $multicompany_transverse_mode to 1 into your conf file, you must remove this line and a new key into + the Home - setup - other admin page. * Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx') +* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can + retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1. * The hook formObjectOptions was not implemented correctly in previous version. Sometimes, you had to return output content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow hook specifications so you must return output into "resprint". +***** ChangeLog for 5.0.6 compared to 5.0.5 ***** +FIX: Removed a bad symbolic link into custom directory. +FIX: Renaming a resource ref rename also the directory of attached files. + +***** ChangeLog for 5.0.5 compared to 5.0.4 ***** +FIX: #7075 : bad path for document +FIX: #7156 +FIX: #7173 +FIX: #7224 +FIX: #7226 +FIX: #7239 +FIX: add supplierproposaldet without price (new product) +FIX: amount overlap other amount when a pagebreak is done due to an image at the bottom of page. +FIX: Bad tax calculation with expense report +FIX: Best buy price calculation +FIX: Buying prices must always be in positive value. +FIX: calculate correct remain to pay for planned bank transactions +FIX: delete linked element on facture rec +FIX: edit sociale was emptying label +FIX: Error when updating thirdparty not returned +FIX: holidays with postgresql like on rowid integer +FIX: id of user not saved when making a payment of expense report +FIX: invoice page list +FIX: invoice situation VAT total rounding into PDF crabe +FIX: PgSQL compatibility. +FIX: remove order rights on invoice page +FIX: status were wrong on product referent list +FIX: supplier id was not passed to hooks +FIX: Support of vat code when using price per customer +FIX: User id correction on holiday request +FIX: value of user id filled to 0 in llx_bank_url when recording an expense report. +FIX: we have to check if contact doesn't already exist on add_contact() function +FIX: We should be able to insert data with value '0' into const +FIX: install process with DoliWamp + ***** ChangeLog for 5.0.4 compared to 5.0.3 ***** -FIX: #6880 -FIX: #6925 +FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances +FIX: #6541 since 4.0.4 to 5.0.0 autofill zip/town not working +FIX: #6880 #6925 +FIX: #6885 FIX: #6926 +FIX: #7003 +FIX: #7012 +FIX: #7040 +FIX: #7048 #6075 FIX: Can set supplier invoice to billed. FIX: Can't create invoice if PO disapproved FIX: contratligne update @@ -46,6 +218,7 @@ FIX: Redirect to payment page from member subscription page failed if a unique s FIX: REST api to get project when user has permission to read all. FIX: situation_progress param default value must be 100 and not 0 FIX: SQL injection on user/index.php parameter search_statut. +FIX: vat code not saved during product creation. FIX: Warnings ***** ChangeLog for 5.0.3 compared to 5.0.2 ***** @@ -528,7 +701,7 @@ NEW: Disabled users are striked. NEW: Enhance navigation of project module NEW: fichinter lines ordered by rang AND DATE NEW: hidden conf to use input file multiple from mail form -NEW: hidden feature: SUPPLIERORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined +NEW: hidden feature: SUPPLIER_ORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined NEW: Hidden option MAIN_LANDING_PAGE to choose the first page to show after login works as a "global" option (llx_const) and as a "per user" option (llx_user_param). NEW: Holiday is a now a RH module. All RH module provides by default visilibity on users of its hierarchy. NEW: If error is reported during migration process, you can ignore it to avoid to be locked. diff --git a/README.md b/README.md index fbbbdddf665..3d9ba75f1f5 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) -Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...). +Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). -It's an Open Source software (wrote in PHP language) designed for small, medium or large companies, foundations and freelances. +It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelances. You can freely use, study, modify or distribute it according to its Free Software licence. @@ -29,18 +29,25 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git Releases can be downloaded from [official website](https://www.dolibarr.org/). ### Install from composer -If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands: +If you do not already have Composer installed, you may do so by following the instructions at [getcomposer.org](https://getcomposer.org/). On Linux and macOS, you may run the following commands: + +```bash curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer +``` -On Windows, you'll download and run https://getcomposer.org/Composer-Setup.exe +On Windows, you can download and run https://getcomposer.org/Composer-Setup.exe +You can then create a new project + +```bash composer create-project dolibarr/dolibarr erp +``` ### Simple setup -If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions: +If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: - DoliWamp for Windows - DoliDeb for Debian or Ubuntu @@ -48,11 +55,11 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM ### Advanced setup -You can use a Web server and a supported database (MariaDb, MySql or Postgresql) to install the standard version. +You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version. - Uncompress the downloaded archive -- Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator) -- Create an empty file "htdocs/conf/conf.php" and set permissions for your web server user (write permissions will be removed once install is finished) +- Copy the "dolibarr" directory and all its files inside your web server root or anywhere you'd like and set up your web server to use "*dolibarr/htdocs*" as root for a new web server virtual host (second choice need to be server administrator) +- Create an empty `htdocs/conf/conf.php` file and set permissions for your web server user (*write* permissions will be removed once install is finished) - From your browser, go to the dolibarr "install/" page The URL will depends on choices made in the first step: @@ -73,10 +80,10 @@ You can use a Web server and a supported database (MariaDb, MySql or Postgresql) ## UPGRADING - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. -- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process. - If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents"). +- At first next access, Dolibarr will redirect your to the "install/" page to follow the upgrade process. +  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). -*Note: migration process can safely be done multiple times by calling the page /install/index.php* +*Note: migration process can be safely done multiple times by calling the `/install/index.php` page* ## WHAT'S NEW @@ -172,7 +179,7 @@ Administrator, user, developer and translator's documentations are available alo ## CONTRIBUTING -See file [CONTRIBUTING](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md) +See [CONTRIBUTING](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md) file ## CREDITS diff --git a/build/docker/.dockerignore b/build/docker/.dockerignore new file mode 100644 index 00000000000..e345920fb8c --- /dev/null +++ b/build/docker/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +README.md +docker-compose.yml diff --git a/Dockerfile b/build/docker/Dockerfile similarity index 72% rename from Dockerfile rename to build/docker/Dockerfile index 00a5d0ef567..caa7b0c436a 100644 --- a/Dockerfile +++ b/build/docker/Dockerfile @@ -1,4 +1,7 @@ -FROM php:5.6-apache +FROM php:7.0-apache + +ENV HOST_USER_ID 33 +ENV PHP_INI_DATE_TIMEZONE 'UTC' RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \ && rm -rf /var/lib/apt/lists/* \ @@ -9,11 +12,9 @@ RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \ && docker-php-ext-install mysqli \ && apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev -COPY htdocs/ /var/www/html/ - -RUN chown -hR www-data:www-data /var/www/html - -VOLUME /var/www/html/conf -VOLUME /var/www/html/documents +COPY docker-run.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/docker-run.sh EXPOSE 80 + +ENTRYPOINT ["docker-run.sh"] diff --git a/build/docker/README.md b/build/docker/README.md new file mode 100644 index 00000000000..5a0997cf121 --- /dev/null +++ b/build/docker/README.md @@ -0,0 +1,25 @@ +# How to use it ? + +The docker-compose.yml file is used to build and run Dolibarr in the current workspace. + +Before build/run, define the variable HOST_USER_ID as following: + + export HOST_USER_ID=$(id -u) + +Go in repository build/docker : + + cd build/docker + +And then, you can run : + + docker-compose up + +This will run 3 container Docker : Dolibarr, MariaDB and PhpMyAdmin. + +The URL to go to the Dolibarr is : + + http://0.0.0.0 + +The URL to go to PhpMyAdmin is (login/password is root/root) : + + http://0.0.0.0:8080 diff --git a/build/docker/docker-compose.yml b/build/docker/docker-compose.yml new file mode 100644 index 00000000000..a2017335197 --- /dev/null +++ b/build/docker/docker-compose.yml @@ -0,0 +1,25 @@ +mariadb: + image: mariadb:latest + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: dolibarr + +phpmyadmin: + image: phpmyadmin/phpmyadmin + environment: + PMA_HOST: mariadb + links: + - mariadb + ports: + - "8080:80" + +web: + build: . + environment: + HOST_USER_ID: $HOST_USER_ID + volumes: + - ../../htdocs:/var/www/html + links: + - mariadb + ports: + - "80:80" diff --git a/build/docker/docker-run.sh b/build/docker/docker-run.sh new file mode 100644 index 00000000000..c151e1c3cab --- /dev/null +++ b/build/docker/docker-run.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +usermod -u $HOST_USER_ID www-data +groupmod -g $HOST_USER_ID www-data + +chown -hR www-data:www-data /var/www + +if [ ! -f /usr/local/etc/php/php.ini ]; then + cat < /usr/local/etc/php/php.ini +date.timezone = $PHP_INI_DATE_TIMEZONE +display_errors = On +EOF +fi + +exec apache2-foreground diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 34757a5123a..2ef8ab32f22 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -353,10 +353,12 @@ begin begin // TODO Copy file or ask to install package ? //CustomMessage('YouWillInstallDoliWamp')+#13#13 - MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 then restart DoliWamp installation/upgrade.',mbInformation,MB_OK); + MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 then restart DoliWamp installation/upgrade.',mbInformation,MB_OK); end; - - + // Pb seems similar with msvcp110.dll + //vcredist_x64.exe + + // If we have a new database version, we should only copy old my.ini file into new directory // and change only all basedir= strings to use new version. Like this, data dir is still correct. // Install of service and stop/start scripts are already rebuild by installer. diff --git a/build/exe/doliwamp/install.forced.php.install b/build/exe/doliwamp/install.forced.php.install index fd98dbf3984..5b186c17268 100644 --- a/build/exe/doliwamp/install.forced.php.install +++ b/build/exe/doliwamp/install.forced.php.install @@ -5,7 +5,7 @@ // during install process to be used. // // -$force_install_noedit=2; +$force_install_noedit=2; // 1=To block vars specific to distrib, 2 to block all technical parameters $force_install_message='KeepDefaultValuesWamp'; $force_install_main_data_root='WAMPROOT/dolibarr_documents'; $force_install_type='mysqli'; diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 94df2206579..0d3d90d54d4 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -49,6 +49,8 @@ if (empty($argv[1])) print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; exit -1; } +parse_str($argv[1]); + $i=0; while ($i < $argc) { @@ -98,9 +100,9 @@ foreach ($includeconstants as $countrycode => $tmp) print "\n"; //$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml'; -$outputdir=dirname(__FILE__).'/../htdocs/install'; -print 'Delete current files '.$outputdir.'/filelist-'.$release.'.xml'."\n"; -dol_delete_file($outputdir.'/filelist-'.$release.'.xml',0,1,1); +$outputdir=dirname(dirname(__FILE__)).'/htdocs/install'; +print 'Delete current files '.$outputdir.'/filelist*.xml'."\n"; +dol_delete_file($outputdir.'/filelist*.xml',0,1,1); $checksumconcat=array(); diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c2d983653cb..80cc9b0856c 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -334,7 +334,7 @@ foreach my $target (sort keys %CHOOSEDTARGET) { } foreach my $target (sort keys %CHOOSEDPUBLISH) { if ($CHOOSEDPUBLISH{$target} < 0) { next; } - if ($target eq 'ASSO') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; } + if ($target eq 'ASSO') { $nbofpublishneedchangelog++; } if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; } $nboftargetok++; } @@ -592,6 +592,8 @@ if ($nboftargetok) { print "Remove subdir of custom dir\n"; print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n"; $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files + print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n"; + $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files } # Build package for each target @@ -972,9 +974,11 @@ if ($nboftargetok) { $ret=`$cmd`; $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/actions_mymodule.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_myobject.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject_api_class.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindex.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`; $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/myobject.php`; diff --git a/build/perl/virtualmin/README b/build/perl/virtualmin/README index 22db444a31f..6da04e5f0b8 100644 --- a/build/perl/virtualmin/README +++ b/build/perl/virtualmin/README @@ -1,8 +1,10 @@ README (English) ################################################## -Install script for Virtualmin Pro +Install script for Virtualmin Professional / GPL ################################################## -This script will install automatically Dolibarr from Virtualmin Pro -http://www.virtualmin.com +This script will install automatically Dolibarr from Virtualmin. +(Included in the professional version and can be added in the GPL version) + +https://www.virtualmin.com http://www.webmin.com/virtualmin.html \ No newline at end of file diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 32324d28e42..08d02e8b2b8 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -1,7 +1,7 @@ #---------------------------------------------------------------------------- # \file dolibarr.pl # \brief Dolibarr script install for Virtualmin Pro -# \author (c)2009-2015 Regis Houssin +# \author (c)2009-2017 Regis Houssin #---------------------------------------------------------------------------- @@ -30,7 +30,12 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.8.1", "3.7.1", "3.6.4", "3.5.7" ); +return ( "5.0.4", "4.0.6", "3.9.4" ); +} + +sub script_dolibarr_release +{ +return 2; # for mysqli fix } sub script_dolibarr_category @@ -177,9 +182,9 @@ if ($opts->{'newdb'} && !$upgrade) { local ($dbtype, $dbname) = split(/_/, $opts->{'db'}, 2); local $dbuser = $dbtype eq "mysql" ? &mysql_user($d) : &postgres_user($d); local $dbpass = $dbtype eq "mysql" ? &mysql_pass($d) : &postgres_pass($d, 1); -local $dbphptype = $dbtype eq "mysql" && $version >= 3.6 ? "mysql" : +local $dbphptype = $dbtype eq "mysql" && $version < 3.6 ? "mysql" : $dbtype eq "mysql" ? "mysqli" : "pgsql"; -local $dbhost = &get_database_host($dbtype); +local $dbhost = &get_database_host($dbtype, $d); local $dberr = &check_script_db_connection($dbtype, $dbname, $dbuser, $dbpass); return (0, "Database connection failed : $dberr") if ($dberr); @@ -206,9 +211,6 @@ $pgcharset = $tmpl->{'postgres_encoding'}; $charset = $dbtype eq "mysql" ? $mycharset : $pgcharset; $collate = $dbtype eq "mysql" ? $mycollate : "C"; -# Install filename -local $step = $version >= 3.8 ? "step" : "etape"; - $path = &script_path_url($d, $opts); if ($path =~ /^https:/ || $d->{'ssl'}) { $url = "https://$d->{'dom'}"; @@ -222,15 +224,11 @@ if ($opts->{'path'} =~ /\w/) { if (!$upgrade) { local $cdef = "$opts->{'dir'}/conf/conf.php.example"; - &run_as_domain_user($d, "cp ".quotemeta($cdef)." ".quotemeta($cfile)); + ©_source_dest_as_domain_user($d, $cdef, $cfile); &set_permissions_as_domain_user($d, 0777, $cfiledir); - &set_permissions_as_domain_user($d, 0666, $cfile); + ©_source_dest_as_domain_user($d, $cfile); &run_as_domain_user($d, "mkdir ".quotemeta($docdir)); &set_permissions_as_domain_user($d, 0777, $docdir); - if (!$version >= 3.7.2) { - &run_as_domain_user($d, "mkdir ".quotemeta($altdir)); - &set_permissions_as_domain_user($d, 0777, $altdir); - } } else { # Preserve old config file, documents and custom directory @@ -266,7 +264,8 @@ if ($upgrade) { [ "versionfrom", $upgrade->{'version'} ], [ "versionto", $ver ], ); - local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts); + local $p = $ver >= 3.8 ? "step5" : "etape5"; + local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Remove the installation directory. @@ -289,15 +288,17 @@ else { [ "main_force_https", $opts->{'forcehttps'} ], [ "dolibarr_main_db_character_set", $charset ], [ "dolibarr_main_db_collation", $collate ], - [ "main_use_alt_dir", "1" ], + [ "usealternaterootdir", "1" ], [ "main_alt_dir_name", "custom" ], ); - local $err = &call_dolibarr_wizard_page(\@params, $step."1", $d, $opts); + local $p = $ver >= 3.8 ? "step1" : "etape1"; + local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Second page (Populate database) local @params = ( [ "action", "set" ] ); - local $err = &call_dolibarr_wizard_page(\@params, $step."2", $d, $opts); + local $p = $ver >= 3.8 ? "step2" : "etape2"; + local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Third page (Add administrator account) @@ -306,7 +307,8 @@ else { [ "pass", $dompass ], [ "pass_verif", $dompass ], ); - local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts); + local $p = $ver >= 3.8 ? "step5" : "etape5"; + local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Remove the installation directory and protect config file. @@ -384,7 +386,10 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", - $ver >= 3.8 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" : + $ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" : + $ver >= 4.0 ? "dolibarr\\-(4\\.0\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.9 ? "dolibarr\\-(3\\.9\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.8 ? "dolibarr\\-(3\\.8\\.[0-9\\.]+)\\.tgz" : $ver >= 3.7 ? "dolibarr\\-(3\\.7\\.[0-9\\.]+)\\.tgz" : $ver >= 3.6 ? "dolibarr\\-(3\\.6\\.[0-9\\.]+)\\.tgz" : $ver >= 3.5 ? "dolibarr\\-(3\\.5\\.[0-9\\.]+)\\.tgz" : diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 33dc951309d..55898481691 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -162,6 +162,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/api %_datadir/dolibarr/htdocs/asterisk %_datadir/dolibarr/htdocs/barcode +%_datadir/dolibarr/htdocs/blockedlog %_datadir/dolibarr/htdocs/bookmarks %_datadir/dolibarr/htdocs/cashdesk %_datadir/dolibarr/htdocs/categories diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 42a89675abf..e5b346278ab 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -242,6 +242,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/api %_datadir/dolibarr/htdocs/asterisk %_datadir/dolibarr/htdocs/barcode +%_datadir/dolibarr/htdocs/blockedlog %_datadir/dolibarr/htdocs/bookmarks %_datadir/dolibarr/htdocs/cashdesk %_datadir/dolibarr/htdocs/categories diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 9dd2100b02c..3c8a5097c0e 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -159,9 +159,11 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/api %_datadir/dolibarr/htdocs/asterisk %_datadir/dolibarr/htdocs/barcode +%_datadir/dolibarr/htdocs/blockedlog %_datadir/dolibarr/htdocs/bookmarks %_datadir/dolibarr/htdocs/cashdesk %_datadir/dolibarr/htdocs/categories +%_datadir/dolibarr/htdocs/collab %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande %_datadir/dolibarr/htdocs/compta diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index d780c47da99..c77661fe420 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -170,6 +170,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/api %_datadir/dolibarr/htdocs/asterisk %_datadir/dolibarr/htdocs/barcode +%_datadir/dolibarr/htdocs/blockedlog %_datadir/dolibarr/htdocs/bookmarks %_datadir/dolibarr/htdocs/cashdesk %_datadir/dolibarr/htdocs/categories diff --git a/build/rpm/install.forced.php.fedora b/build/rpm/install.forced.php.fedora index 108455a9403..a8db3e25c9e 100644 --- a/build/rpm/install.forced.php.fedora +++ b/build/rpm/install.forced.php.fedora @@ -1,7 +1,7 @@ à laurent@destailleur.fr.\nSujet du mail: Envoi facture FA1007-0001\nCorps du mail:\nVeuillez trouver ci-joint la facture FA1007-0001\r\n\r\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\r\n\r\nhttp://localhost/dolibarrnew/public/paypal/newpayment.php?source=invoice&ref=FA1007-0001&securekey=50c82fab36bb3b6aa83e2a50691803b2\r\n\r\nCordialement',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(123,NULL,1,'2013-01-06 13:13:57','2013-01-06 13:13:57',40,NULL,'Facture 16 validée dans Dolibarr','2013-01-06 13:13:57','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture 16 validée dans Dolibarr\nAuteur: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(124,NULL,1,'2013-01-12 12:23:05','2013-01-12 12:23:05',40,NULL,'Patient aaa ajouté','2013-01-12 12:23:05','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient aaa ajouté\nAuteur: admin',19,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(125,NULL,1,'2013-01-12 12:52:20','2013-01-12 12:52:20',40,NULL,'Patient pppoo ajouté','2013-01-12 12:52:20','2014-12-21 12:50:33',1,NULL,NULL,20,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pppoo ajouté\nAuteur: admin',20,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(127,NULL,1,'2013-01-19 18:22:48','2013-01-19 18:22:48',40,NULL,'Facture FS1301-0001 validée dans Dolibarr','2013-01-19 18:22:48','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0001 validée dans Dolibarr\nAuteur: admin',148,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(128,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',40,NULL,'Facture FA6801-0010 validée dans Dolibarr','2013-01-19 18:31:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 validée dans Dolibarr\nAuteur: admin',150,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(129,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',40,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr','2013-01-19 18:31:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr\nAuteur: admin',150,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(130,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',40,NULL,'Facture FS1301-0002 validée dans Dolibarr','2013-01-19 18:31:58','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 validée dans Dolibarr\nAuteur: admin',151,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(131,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',40,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr','2013-01-19 18:31:58','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr\nAuteur: admin',151,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(132,NULL,1,'2013-01-23 15:07:54','2013-01-23 15:07:54',50,NULL,'Consultation 24 saisie (aaa)','2013-01-23 15:07:54','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Consultation 24 saisie (aaa)\nAuteur: admin',24,'cabinetmed_cons',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,NULL,1,'2013-01-23 16:56:58','2013-01-23 16:56:58',40,NULL,'Patient pa ajouté','2013-01-23 16:56:58','2014-12-21 12:50:33',1,NULL,NULL,21,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pa ajouté\nAuteur: admin',21,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(134,NULL,1,'2013-01-23 17:34:00',NULL,50,NULL,'bbcv','2013-01-23 17:35:21','2013-01-23 16:35:21',1,NULL,1,2,NULL,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,NULL,1,'2013-02-12 15:54:00','2013-02-12 15:54:00',40,NULL,'Facture FA1212-0011 validée dans Dolibarr','2013-02-12 15:54:37','2014-12-21 12:50:33',1,1,NULL,7,NULL,0,1,NULL,1,0,0,1,50,NULL,NULL,NULL,'Facture FA1212-0011 validée dans Dolibarr
\r\nAuteur: admin',13,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(136,NULL,1,'2013-02-12 17:06:51','2013-02-12 17:06:51',40,NULL,'Commande CO1107-0003 validée','2013-02-12 17:06:51','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0003 validée\nAuteur: admin',2,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(137,NULL,1,'2013-02-17 16:22:10','2013-02-17 16:22:10',40,NULL,'Proposition PR1302-0009 validée','2013-02-17 16:22:10','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0009 validée\nAuteur: admin',9,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(138,NULL,1,'2013-02-17 16:27:00','2013-02-17 16:27:00',40,NULL,'Facture FA1302-0012 validée dans Dolibarr','2013-02-17 16:27:00','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1302-0012 validée dans Dolibarr\nAuteur: admin',152,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(139,NULL,1,'2013-02-17 16:27:29','2013-02-17 16:27:29',40,NULL,'Proposition PR1302-0010 validée','2013-02-17 16:27:29','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0010 validée\nAuteur: admin',11,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(140,NULL,1,'2013-02-17 18:27:56','2013-02-17 18:27:56',40,NULL,'Commande CO1107-0004 validée','2013-02-17 18:27:56','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0004 validée\nAuteur: admin',3,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(141,NULL,1,'2013-02-17 18:38:14','2013-02-17 18:38:14',40,NULL,'Commande CO1302-0005 validée','2013-02-17 18:38:14','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1302-0005 validée\nAuteur: admin',7,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(142,NULL,1,'2013-02-26 22:57:50','2013-02-26 22:57:50',40,NULL,'Company pppp added into Dolibarr','2013-02-26 22:57:50','2014-12-21 12:50:33',1,NULL,NULL,22,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company pppp added into Dolibarr\nAuthor: admin',22,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(143,NULL,1,'2013-02-26 22:58:13','2013-02-26 22:58:13',40,NULL,'Company ttttt added into Dolibarr','2013-02-26 22:58:13','2014-12-21 12:50:33',1,NULL,NULL,23,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ttttt added into Dolibarr\nAuthor: admin',23,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(144,NULL,1,'2013-02-27 10:00:00','2013-02-27 19:20:00',5,NULL,'Rendez-vous','2013-02-27 19:20:53','2013-02-27 18:20:53',1,NULL,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,'',33600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(145,NULL,1,'2013-02-27 19:28:00',NULL,2,NULL,'fdsfsd','2013-02-27 19:28:48','2013-02-27 18:29:53',1,1,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(146,NULL,1,'2013-03-06 10:05:07','2013-03-06 10:05:07',40,NULL,'Contrat (PROV3) validé dans Dolibarr','2013-03-06 10:05:07','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Contrat (PROV3) validé dans Dolibarr\nAuteur: admin',3,'contract',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(147,NULL,1,'2013-03-06 16:43:37','2013-03-06 16:43:37',40,NULL,'Facture FA1307-0013 validée dans Dolibarr','2013-03-06 16:43:37','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée dans Dolibarr\nAuteur: admin',158,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(148,NULL,1,'2013-03-06 16:44:12','2013-03-06 16:44:12',40,NULL,'Facture FA1407-0014 validée dans Dolibarr','2013-03-06 16:44:12','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1407-0014 validée dans Dolibarr\nAuteur: admin',159,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(149,NULL,1,'2013-03-06 16:47:48','2013-03-06 16:47:48',40,NULL,'Facture FA1507-0015 validée dans Dolibarr','2013-03-06 16:47:48','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1507-0015 validée dans Dolibarr\nAuteur: admin',160,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(150,NULL,1,'2013-03-06 16:48:16','2013-03-06 16:48:16',40,NULL,'Facture FA1607-0016 validée dans Dolibarr','2013-03-06 16:48:16','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1607-0016 validée dans Dolibarr\nAuteur: admin',161,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(151,NULL,1,'2013-03-06 17:13:59','2013-03-06 17:13:59',40,NULL,'Société smith smith ajoutée dans Dolibarr','2013-03-06 17:13:59','2014-12-21 12:50:33',1,NULL,NULL,24,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Société smith smith ajoutée dans Dolibarr\nAuteur: admin',24,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(152,NULL,1,'2013-03-08 10:02:22','2013-03-08 10:02:22',40,NULL,'Proposition (PROV12) validée dans Dolibarr','2013-03-08 10:02:22','2014-12-21 12:50:33',1,NULL,NULL,23,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition (PROV12) validée dans Dolibarr\nAuteur: admin',12,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(203,NULL,1,'2013-03-09 19:39:27','2013-03-09 19:39:27',40,'AC_ORDER_SUPPLIER_VALIDATE','Commande CF1303-0004 validée','2013-03-09 19:39:27','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CF1303-0004 validée\nAuteur: admin',13,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(204,NULL,1,'2013-03-10 15:47:37','2013-03-10 15:47:37',40,'AC_COMPANY_CREATE','Patient créé','2013-03-10 15:47:37','2014-12-21 12:50:33',1,NULL,NULL,25,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuteur: admin',25,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(205,NULL,1,'2013-03-10 15:57:32','2013-03-10 15:57:32',40,'AC_COMPANY_CREATE','Tiers créé','2013-03-10 15:57:32','2014-12-21 12:50:33',1,NULL,NULL,26,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Tiers créé\nAuteur: admin',26,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(206,NULL,1,'2013-03-10 15:58:28','2013-03-10 15:58:28',40,'AC_BILL_VALIDATE','Facture FA1303-0017 validée','2013-03-10 15:58:28','2014-12-21 12:50:33',1,NULL,NULL,26,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0017 validée\nAuteur: admin',208,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(207,NULL,1,'2013-03-19 09:38:10','2013-03-19 09:38:10',40,'AC_BILL_VALIDATE','Facture FA1303-0018 validée','2013-03-19 09:38:10','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0018 validée\nAuteur: admin',209,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(208,NULL,1,'2013-03-20 14:30:11','2013-03-20 14:30:11',40,'AC_BILL_VALIDATE','Facture FA1107-0019 validée','2013-03-20 14:30:11','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1107-0019 validée\nAuteur: admin',210,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(209,NULL,1,'2013-03-22 09:40:25','2013-03-22 09:40:25',40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-22 09:40:25','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(210,NULL,1,'2013-03-23 17:16:25','2013-03-23 17:16:25',40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-23 17:16:25','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(211,NULL,1,'2013-03-23 18:08:27','2013-03-23 18:08:27',40,'AC_BILL_VALIDATE','Facture FA1307-0013 validée','2013-03-23 18:08:27','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée\nAuteur: admin',158,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(212,NULL,1,'2013-03-24 15:54:00','2013-03-24 15:54:00',40,'AC_BILL_VALIDATE','Facture FA1212-0021 validée','2013-03-24 15:54:00','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0021 validée\nAuteur: admin',32,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(213,NULL,1,'2013-11-07 01:02:39','2013-11-07 01:02:39',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:02:39','2014-12-21 12:50:33',1,NULL,NULL,27,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',27,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(214,NULL,1,'2013-11-07 01:05:22','2013-11-07 01:05:22',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:05:22','2014-12-21 12:50:33',1,NULL,NULL,28,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',28,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(215,NULL,1,'2013-11-07 01:07:07','2013-11-07 01:07:07',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:07','2014-12-21 12:50:33',1,NULL,NULL,29,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',29,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(216,NULL,1,'2013-11-07 01:07:58','2013-11-07 01:07:58',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:58','2014-12-21 12:50:33',1,NULL,NULL,30,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',30,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(217,NULL,1,'2013-11-07 01:10:09','2013-11-07 01:10:09',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:10:09','2014-12-21 12:50:33',1,NULL,NULL,31,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',31,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(218,NULL,1,'2013-11-07 01:15:57','2013-11-07 01:15:57',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:15:57','2014-12-21 12:50:33',1,NULL,NULL,32,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',32,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(219,NULL,1,'2013-11-07 01:16:51','2013-11-07 01:16:51',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:16:51','2014-12-21 12:50:33',1,NULL,NULL,33,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',33,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(220,NULL,1,'2014-03-02 17:24:04','2014-03-02 17:24:04',40,'AC_BILL_VALIDATE','Invoice FA1302-0022 validated','2014-03-02 17:24:04','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1302-0022 validated\nAuthor: admin',157,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(221,NULL,1,'2014-03-02 17:24:28','2014-03-02 17:24:28',40,'AC_BILL_VALIDATE','Invoice FA1303-0020 validated','2014-03-02 17:24:28','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 validated\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(222,NULL,1,'2014-03-05 10:00:00','2014-03-05 10:00:00',5,NULL,'RDV John','2014-03-02 19:54:48','2014-03-02 18:55:29',1,1,NULL,NULL,NULL,0,1,0,NULL,0,0,1,-1,NULL,NULL,NULL,'gfdgdfgdf',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(223,NULL,1,'2014-03-13 10:00:00','2014-03-17 00:00:00',50,NULL,'Congress','2014-03-02 19:55:11','2014-03-02 18:55:11',1,NULL,NULL,NULL,NULL,0,1,0,NULL,0,0,1,-1,'',309600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(224,NULL,1,'2014-03-14 10:00:00',NULL,1,NULL,'Call john','2014-03-02 19:55:56','2014-03-02 18:55:56',1,NULL,NULL,NULL,NULL,0,1,0,NULL,0,0,1,0,'',NULL,NULL,'tttt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(225,NULL,1,'2014-03-02 20:11:31','2014-03-02 20:11:31',40,'AC_BILL_UNVALIDATE','Invoice FA1303-0020 go back to draft status','2014-03-02 20:11:31','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 go back to draft status\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(226,NULL,1,'2014-03-02 20:13:39','2014-03-02 20:13:39',40,'AC_BILL_VALIDATE','Invoice FA1303-0020 validated','2014-03-02 20:13:39','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 validated\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(227,NULL,1,'2014-03-03 19:20:10','2014-03-03 19:20:10',40,'AC_BILL_VALIDATE','Invoice FA1212-0023 validated','2014-03-03 19:20:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1212-0023 validated\nAuthor: admin',33,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(228,NULL,1,'2014-03-03 19:20:25','2014-03-03 19:20:25',40,'AC_BILL_CANCEL','Invoice FA1212-0023 canceled in Dolibarr','2014-03-03 19:20:25','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1212-0023 canceled in Dolibarr\nAuthor: admin',33,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(229,NULL,1,'2014-03-03 19:20:56','2014-03-03 19:20:56',40,'AC_BILL_VALIDATE','Invoice AV1403-0003 validated','2014-03-03 19:20:56','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1403-0003 validated\nAuthor: admin',212,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(230,NULL,1,'2014-03-03 19:21:29','2014-03-03 19:21:29',40,'AC_BILL_UNVALIDATE','Invoice AV1403-0003 go back to draft status','2014-03-03 19:21:29','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1403-0003 go back to draft status\nAuthor: admin',212,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(231,NULL,1,'2014-03-03 19:22:16','2014-03-03 19:22:16',40,'AC_BILL_VALIDATE','Invoice AV1303-0003 validated','2014-03-03 19:22:16','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1303-0003 validated\nAuthor: admin',213,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(232,NULL,1,'2016-01-22 18:54:39','2016-01-22 18:54:39',40,'AC_OTH_AUTO','Invoice 16 validated','2016-01-22 18:54:39','2016-01-22 17:54:39',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice 16 validated\nAuthor: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(233,NULL,1,'2016-01-22 18:54:46','2016-01-22 18:54:46',40,'AC_OTH_AUTO','Invoice 16 validated','2016-01-22 18:54:46','2016-01-22 17:54:46',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice 16 validated\nAuthor: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(234,NULL,1,'2016-07-05 10:00:00','2016-07-05 11:19:00',5,'AC_RDV','Meeting with my boss','2016-07-31 18:19:48','2016-07-31 14:19:48',12,NULL,NULL,NULL,NULL,0,12,1,NULL,0,0,1,-1,'',4740,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(235,NULL,1,'2016-07-13 00:00:00','2016-07-14 23:59:59',50,'AC_OTH','Trip at Las Vegas','2016-07-31 18:20:36','2016-07-31 14:20:36',12,NULL,4,NULL,2,0,12,1,NULL,0,1,1,-1,'',172799,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(236,NULL,1,'2016-07-29 10:00:00',NULL,4,'AC_EMAIL','Remind to send an email','2016-07-31 18:21:04','2016-07-31 14:21:04',12,NULL,NULL,NULL,NULL,0,4,0,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(237,NULL,1,'2016-07-01 10:00:00',NULL,1,'AC_TEL','Phone call with Mr Vaalen','2016-07-31 18:22:04','2016-07-31 14:22:04',12,NULL,6,4,NULL,0,13,0,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(238,NULL,1,'2016-08-02 10:00:00','2016-08-02 12:00:00',5,'AC_RDV','Meeting on radium','2016-08-01 01:15:50','2016-07-31 21:15:50',12,NULL,8,10,10,0,12,1,NULL,0,0,1,-1,'',7200,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(239,NULL,1,'2017-01-29 21:49:33','2017-01-29 21:49:33',40,'AC_OTH_AUTO','Proposal PR1302-0007 validated','2017-01-29 21:49:33','2017-01-29 17:49:33',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1302-0007 validated\nAuthor: admin',7,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(240,NULL,1,'2017-01-31 20:52:00',NULL,1,'AC_TEL','Call the boss','2017-01-31 20:52:10','2017-01-31 16:52:25',12,12,6,NULL,NULL,0,12,1,NULL,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(242,NULL,1,'2017-02-01 18:52:04','2017-02-01 18:52:04',40,'AC_OTH_AUTO','Order CF1007-0001 validated','2017-02-01 18:52:04','2017-02-01 14:52:04',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CF1007-0001 validated\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(243,NULL,1,'2017-02-01 18:52:04','2017-02-01 18:52:04',40,'AC_OTH_AUTO','Order CF1007-0001 approved','2017-02-01 18:52:04','2017-02-01 14:52:04',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CF1007-0001 approved\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(245,NULL,1,'2017-02-01 18:52:32','2017-02-01 18:52:32',40,'AC_OTH_AUTO','Supplier order CF1007-0001 submited','2017-02-01 18:52:32','2017-02-01 14:52:32',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Supplier order CF1007-0001 submited\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(249,NULL,1,'2017-02-01 18:54:01','2017-02-01 18:54:01',40,'AC_OTH_AUTO','Supplier order CF1007-0001 received','2017-02-01 18:54:01','2017-02-01 14:54:01',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Supplier order CF1007-0001 received \nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(250,NULL,1,'2017-02-01 18:54:42','2017-02-01 18:54:42',40,'AC_OTH_AUTO','Email sent by MyBigCompany To mycustomer@example.com','2017-02-01 18:54:42','2017-02-01 14:54:42',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Sender: MyBigCompany <myemail@mybigcompany.com>
\nReceiver(s): mycustomer@example.com
\nEMail topic: Submission of order CF1007-0001
\nEmail body:
\nYou will find here our order CF1007-0001
\r\n
\r\nSincerely
\n
\nAttached files and documents: CF1007-0001.pdf',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(251,NULL,1,'2017-02-01 19:02:21','2017-02-01 19:02:21',40,'AC_OTH_AUTO','Invoice SI1702-0001 validated','2017-02-01 19:02:21','2017-02-01 15:02:21',12,NULL,5,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice SI1702-0001 validated\nAuthor: admin',20,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(252,NULL,1,'2017-02-12 23:17:04','2017-02-12 23:17:04',40,'AC_OTH_AUTO','Patient créé','2017-02-12 23:17:04','2017-02-12 19:17:04',12,NULL,NULL,26,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuthor: admin',26,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(253,NULL,1,'2017-02-12 23:18:33','2017-02-12 23:18:33',40,'AC_OTH_AUTO','Consultation 2 recorded (aaa)','2017-02-12 23:18:33','2017-02-12 19:18:33',12,NULL,NULL,NULL,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Consultation 2 recorded (aaa)\nAuthor: admin',2,'cabinetmed_cons',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(254,NULL,1,'2017-02-15 23:28:41','2017-02-15 23:28:41',40,'AC_OTH_AUTO','Order CO7001-0005 validated','2017-02-15 23:28:41','2017-02-15 22:28:41',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0005 validated\nAuthor: admin',7,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(255,NULL,1,'2017-02-15 23:28:56','2017-02-15 23:28:56',40,'AC_OTH_AUTO','Order CO7001-0006 validated','2017-02-15 23:28:56','2017-02-15 22:28:56',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0006 validated\nAuthor: admin',8,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(256,NULL,1,'2017-02-15 23:34:33','2017-02-15 23:34:33',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:34:33','2017-02-15 22:34:33',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',9,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,NULL,1,'2017-02-15 23:35:03','2017-02-15 23:35:03',40,'AC_OTH_AUTO','Order CO7001-0008 validated','2017-02-15 23:35:03','2017-02-15 22:35:03',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0008 validated\nAuthor: admin',10,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(263,NULL,1,'2017-02-15 23:50:34','2017-02-15 23:50:34',40,'AC_OTH_AUTO','Order CO7001-0005 validated','2017-02-15 23:50:34','2017-02-15 22:50:34',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0005 validated\nAuthor: admin',17,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(264,NULL,1,'2017-02-15 23:51:23','2017-02-15 23:51:23',40,'AC_OTH_AUTO','Order CO7001-0006 validated','2017-02-15 23:51:23','2017-02-15 22:51:23',12,NULL,NULL,7,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0006 validated\nAuthor: admin',18,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(265,NULL,1,'2017-02-15 23:54:51','2017-02-15 23:54:51',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:54:51','2017-02-15 22:54:51',12,NULL,NULL,17,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',19,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(266,NULL,1,'2017-02-15 23:55:52','2017-02-15 23:55:52',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:55:52','2017-02-15 22:55:52',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',20,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(267,NULL,1,'2017-02-16 00:03:44','2017-02-16 00:03:44',40,'AC_OTH_AUTO','Order CO7001-0008 validated','2017-02-16 00:03:44','2017-02-15 23:03:44',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0008 validated\nAuthor: admin',29,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(268,NULL,1,'2017-02-16 00:05:01','2017-02-16 00:05:01',40,'AC_OTH_AUTO','Order CO7001-0009 validated','2017-02-16 00:05:01','2017-02-15 23:05:01',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0009 validated\nAuthor: admin',34,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(269,NULL,1,'2017-02-16 00:05:01','2017-02-16 00:05:01',40,'AC_OTH_AUTO','Order CO7001-0010 validated','2017-02-16 00:05:01','2017-02-15 23:05:01',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0010 validated\nAuthor: admin',38,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(270,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0011 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0011 validated\nAuthor: admin',40,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(271,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0012 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,10,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0012 validated\nAuthor: admin',43,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(272,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0013 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0013 validated\nAuthor: admin',47,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0014 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0014 validated\nAuthor: admin',48,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(274,NULL,1,'2017-02-16 00:05:26','2017-02-16 00:05:26',40,'AC_OTH_AUTO','Order CO7001-0015 validated','2017-02-16 00:05:26','2017-02-15 23:05:26',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0015 validated\nAuthor: admin',50,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(275,NULL,1,'2017-02-16 00:05:26','2017-02-16 00:05:26',40,'AC_OTH_AUTO','Order CO7001-0016 validated','2017-02-16 00:05:26','2017-02-15 23:05:26',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0016 validated\nAuthor: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(277,NULL,1,'2017-02-16 00:05:35','2017-02-16 00:05:35',40,'AC_OTH_AUTO','Order CO7001-0018 validated','2017-02-16 00:05:35','2017-02-15 23:05:35',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0018 validated\nAuthor: admin',62,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(278,NULL,1,'2017-02-16 00:05:35','2017-02-16 00:05:35',40,'AC_OTH_AUTO','Order CO7001-0019 validated','2017-02-16 00:05:35','2017-02-15 23:05:35',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0019 validated\nAuthor: admin',68,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(279,NULL,1,'2017-02-16 00:05:36','2017-02-16 00:05:36',40,'AC_OTH_AUTO','Order CO7001-0020 validated','2017-02-16 00:05:36','2017-02-15 23:05:36',12,NULL,NULL,6,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0020 validated\nAuthor: admin',72,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(281,NULL,1,'2017-02-16 00:05:37','2017-02-16 00:05:37',40,'AC_OTH_AUTO','Order CO7001-0022 validated','2017-02-16 00:05:37','2017-02-15 23:05:37',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0022 validated\nAuthor: admin',78,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(282,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0023 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0023 validated\nAuthor: admin',81,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(283,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0024 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,26,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0024 validated\nAuthor: admin',83,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(284,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0025 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,2,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0025 validated\nAuthor: admin',84,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(285,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0026 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0026 validated\nAuthor: admin',85,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(286,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0027 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,10,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0027 validated\nAuthor: admin',88,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(287,NULL,1,'2017-02-16 03:05:56','2017-02-16 03:05:56',40,'AC_OTH_AUTO','Commande CO7001-0016 classée Livrée','2017-02-16 03:05:56','2017-02-15 23:05:56',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0016 classée Livrée\nAuteur: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(288,NULL,1,'2017-02-16 03:06:01','2017-02-16 03:06:01',40,'AC_OTH_AUTO','Commande CO7001-0016 classée Facturée','2017-02-16 03:06:01','2017-02-15 23:06:01',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0016 classée Facturée\nAuteur: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(294,NULL,1,'2017-02-16 03:53:04','2017-02-16 03:53:04',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 03:53:04','2017-02-15 23:53:04',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(295,NULL,1,'2017-02-16 03:58:08','2017-02-16 03:58:08',40,'AC_OTH_AUTO','Expédition SH1702-0002 validée','2017-02-16 03:58:08','2017-02-15 23:58:08',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Expédition SH1702-0002 validée\nAuteur: admin',3,'shipping',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(296,NULL,1,'2017-02-16 04:12:29','2017-02-16 04:12:29',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 04:12:29','2017-02-16 00:12:29',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(297,NULL,1,'2017-02-16 04:14:20','2017-02-16 04:14:20',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 04:14:20','2017-02-16 00:14:20',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(298,NULL,1,'2017-02-16 01:44:58','2017-02-16 01:44:58',40,'AC_OTH_AUTO','Proposal PR1702-0009 validated','2017-02-16 01:44:58','2017-02-16 00:44:58',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0009 validated\nAuthor: aeinstein',11,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(299,NULL,1,'2017-02-16 01:45:44','2017-02-16 01:45:44',40,'AC_OTH_AUTO','Proposal PR1702-0010 validated','2017-02-16 01:45:44','2017-02-16 00:45:44',2,NULL,NULL,7,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0010 validated\nAuthor: demo',12,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(300,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0011 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0011 validated\nAuthor: aeinstein',13,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(301,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0012 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,3,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0012 validated\nAuthor: demo',14,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(302,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0013 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,26,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0013 validated\nAuthor: demo',15,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(303,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0014 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0014 validated\nAuthor: demo',16,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(304,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0015 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0015 validated\nAuthor: aeinstein',17,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(305,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0016 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,26,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0016 validated\nAuthor: demo',18,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(306,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0017 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,12,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0017 validated\nAuthor: demo',19,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(307,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0018 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0018 validated\nAuthor: aeinstein',20,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(308,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0019 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0019 validated\nAuthor: aeinstein',21,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(309,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0020 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0020 validated\nAuthor: aeinstein',22,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(310,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0021 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',2,NULL,NULL,12,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0021 validated\nAuthor: demo',23,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(311,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0022 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',2,NULL,NULL,7,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0022 validated\nAuthor: demo',24,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(312,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0023 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',1,NULL,NULL,3,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0023 validated\nAuthor: aeinstein',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(313,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0024 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0024 validated\nAuthor: demo',26,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(314,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0025 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',1,NULL,NULL,6,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0025 validated\nAuthor: aeinstein',27,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(315,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0026 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,19,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0026 validated\nAuthor: demo',28,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(316,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0027 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0027 validated\nAuthor: demo',29,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(317,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0028 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0028 validated\nAuthor: demo',30,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(318,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0029 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',1,NULL,NULL,11,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0029 validated\nAuthor: aeinstein',31,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(319,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0030 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,19,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0030 validated\nAuthor: demo',32,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(320,NULL,1,'2017-02-16 04:46:31','2017-02-16 04:46:31',40,'AC_OTH_AUTO','Proposition PR1702-0026 signée','2017-02-16 04:46:31','2017-02-16 00:46:31',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0026 signée\nAuteur: admin',28,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(321,NULL,1,'2017-02-16 04:46:37','2017-02-16 04:46:37',40,'AC_OTH_AUTO','Proposition PR1702-0027 signée','2017-02-16 04:46:37','2017-02-16 00:46:37',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0027 signée\nAuteur: admin',29,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(322,NULL,1,'2017-02-16 04:46:42','2017-02-16 04:46:42',40,'AC_OTH_AUTO','Proposition PR1702-0028 refusée','2017-02-16 04:46:42','2017-02-16 00:46:42',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0028 refusée\nAuteur: admin',30,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(323,NULL,1,'2017-02-16 04:47:09','2017-02-16 04:47:09',40,'AC_OTH_AUTO','Proposition PR1702-0019 validée','2017-02-16 04:47:09','2017-02-16 00:47:09',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0019 validée\nAuteur: admin',21,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(324,NULL,1,'2017-02-16 04:47:25','2017-02-16 04:47:25',40,'AC_OTH_AUTO','Proposition PR1702-0023 signée','2017-02-16 04:47:25','2017-02-16 00:47:25',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0023 signée\nAuteur: admin',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(325,NULL,1,'2017-02-16 04:47:29','2017-02-16 04:47:29',40,'AC_OTH_AUTO','Proposition PR1702-0023 classée payée','2017-02-16 04:47:29','2017-02-16 00:47:29',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0023 classée payée\nAuteur: admin',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(326,NULL,1,'2017-02-17 16:07:18','2017-02-17 16:07:18',40,'AC_OTH_AUTO','Proposition PR1702-0021 validée','2017-02-17 16:07:18','2017-02-17 12:07:18',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0021 validée\nAuteur: admin',23,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(327,NULL,1,'2017-05-12 13:53:44','2017-05-12 13:53:44',40,'AC_OTH_AUTO','Email sent by MyBigCompany To Einstein','2017-05-12 13:53:44','2017-05-12 09:53:44',12,NULL,NULL,11,12,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Sender: MyBigCompany <myemail@mybigcompany.com>
\nReceiver(s): Einstein <genius@example.com>
\nBcc: Einstein <genius@example.com>
\nEMail topic: Test
\nEmail body:
\nTest\nAuthor: admin',11,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(328,NULL,1,'2017-08-29 22:39:09','2017-08-29 22:39:09',40,'AC_OTH_AUTO','Invoice FA1601-0024 validated','2017-08-29 22:39:09','2017-08-29 18:39:09',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice FA1601-0024 validated\nAuthor: admin',149,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_actioncomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_actioncomm_extrafields` +-- + +DROP TABLE IF EXISTS `llx_actioncomm_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_actioncomm_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_actioncomm_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_actioncomm_extrafields` +-- + +LOCK TABLES `llx_actioncomm_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_actioncomm_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_actioncomm_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_actioncomm_resources` +-- + +DROP TABLE IF EXISTS `llx_actioncomm_resources`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_actioncomm_resources` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_actioncomm` int(11) NOT NULL, + `element_type` varchar(50) NOT NULL, + `fk_element` int(11) NOT NULL, + `answer_status` varchar(50) DEFAULT NULL, + `mandatory` smallint(6) DEFAULT NULL, + `transparency` smallint(6) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_actioncomm_resources` (`fk_actioncomm`,`element_type`,`fk_element`), + KEY `idx_actioncomm_resources_fk_element` (`fk_element`) +) ENGINE=InnoDB AUTO_INCREMENT=212 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_actioncomm_resources` +-- + +LOCK TABLES `llx_actioncomm_resources` WRITE; +/*!40000 ALTER TABLE `llx_actioncomm_resources` DISABLE KEYS */; +INSERT INTO `llx_actioncomm_resources` VALUES (1,1,'user',1,NULL,NULL,1),(2,2,'user',1,NULL,NULL,1),(3,3,'user',1,NULL,NULL,1),(4,4,'user',1,NULL,NULL,1),(5,5,'user',1,NULL,NULL,1),(6,6,'user',1,NULL,NULL,1),(7,7,'user',1,NULL,NULL,1),(8,8,'user',1,NULL,NULL,1),(9,9,'user',1,NULL,NULL,1),(10,10,'user',1,NULL,NULL,1),(11,11,'user',1,NULL,NULL,1),(12,12,'user',1,NULL,NULL,1),(13,13,'user',1,NULL,NULL,1),(14,14,'user',1,NULL,NULL,1),(15,15,'user',1,NULL,NULL,1),(16,16,'user',1,NULL,NULL,1),(17,17,'user',1,NULL,NULL,1),(18,18,'user',1,NULL,NULL,1),(19,19,'user',1,NULL,NULL,1),(20,20,'user',1,NULL,NULL,1),(21,21,'user',1,NULL,NULL,1),(22,22,'user',1,NULL,NULL,1),(23,23,'user',1,NULL,NULL,1),(24,24,'user',1,NULL,NULL,1),(25,25,'user',1,NULL,NULL,1),(26,26,'user',1,NULL,NULL,1),(27,27,'user',1,NULL,NULL,1),(28,28,'user',1,NULL,NULL,1),(29,29,'user',1,NULL,NULL,1),(30,30,'user',1,NULL,NULL,1),(31,31,'user',1,NULL,NULL,1),(32,38,'user',1,NULL,NULL,1),(33,40,'user',1,NULL,NULL,1),(34,41,'user',1,NULL,NULL,1),(35,42,'user',1,NULL,NULL,1),(36,43,'user',1,NULL,NULL,1),(37,44,'user',1,NULL,NULL,1),(38,45,'user',1,NULL,NULL,1),(39,46,'user',1,NULL,NULL,1),(40,47,'user',1,NULL,NULL,1),(41,48,'user',1,NULL,NULL,1),(42,49,'user',1,NULL,NULL,1),(43,50,'user',1,NULL,NULL,1),(44,51,'user',1,NULL,NULL,1),(45,52,'user',1,NULL,NULL,1),(46,53,'user',1,NULL,NULL,1),(47,54,'user',1,NULL,NULL,1),(48,55,'user',1,NULL,NULL,1),(49,56,'user',1,NULL,NULL,1),(50,121,'user',3,NULL,NULL,1),(51,122,'user',1,NULL,NULL,1),(52,123,'user',1,NULL,NULL,1),(53,124,'user',1,NULL,NULL,1),(54,125,'user',1,NULL,NULL,1),(55,127,'user',1,NULL,NULL,1),(56,128,'user',1,NULL,NULL,1),(57,129,'user',1,NULL,NULL,1),(58,130,'user',1,NULL,NULL,1),(59,131,'user',1,NULL,NULL,1),(60,132,'user',1,NULL,NULL,1),(61,133,'user',1,NULL,NULL,1),(62,134,'user',1,NULL,NULL,1),(63,135,'user',1,NULL,NULL,1),(64,136,'user',1,NULL,NULL,1),(65,137,'user',1,NULL,NULL,1),(66,138,'user',1,NULL,NULL,1),(67,139,'user',1,NULL,NULL,1),(68,140,'user',1,NULL,NULL,1),(69,141,'user',1,NULL,NULL,1),(70,142,'user',1,NULL,NULL,1),(71,143,'user',1,NULL,NULL,1),(72,144,'user',1,NULL,NULL,1),(73,145,'user',1,NULL,NULL,1),(74,146,'user',1,NULL,NULL,1),(75,147,'user',1,NULL,NULL,1),(76,148,'user',1,NULL,NULL,1),(77,149,'user',1,NULL,NULL,1),(78,150,'user',1,NULL,NULL,1),(79,151,'user',1,NULL,NULL,1),(80,152,'user',1,NULL,NULL,1),(81,203,'user',1,NULL,NULL,1),(82,204,'user',1,NULL,NULL,1),(83,205,'user',1,NULL,NULL,1),(84,206,'user',1,NULL,NULL,1),(85,207,'user',1,NULL,NULL,1),(86,208,'user',1,NULL,NULL,1),(87,209,'user',1,NULL,NULL,1),(88,210,'user',1,NULL,NULL,1),(89,211,'user',1,NULL,NULL,1),(90,212,'user',1,NULL,NULL,1),(91,213,'user',1,NULL,NULL,1),(92,214,'user',1,NULL,NULL,1),(93,215,'user',1,NULL,NULL,1),(94,216,'user',1,NULL,NULL,1),(95,217,'user',1,NULL,NULL,1),(96,218,'user',1,NULL,NULL,1),(97,219,'user',1,NULL,NULL,1),(98,220,'user',1,NULL,NULL,1),(99,221,'user',1,NULL,NULL,1),(100,222,'user',1,NULL,NULL,1),(101,223,'user',1,NULL,NULL,1),(102,224,'user',1,NULL,NULL,1),(103,225,'user',1,NULL,NULL,1),(104,226,'user',1,NULL,NULL,1),(105,227,'user',1,NULL,NULL,1),(106,228,'user',1,NULL,NULL,1),(107,229,'user',1,NULL,NULL,1),(108,230,'user',1,NULL,NULL,1),(109,231,'user',1,NULL,NULL,1),(110,232,'user',12,'0',0,0),(111,233,'user',12,'0',0,0),(112,234,'user',12,'0',0,1),(113,235,'user',12,'0',0,1),(114,236,'user',4,'0',0,0),(115,237,'user',13,'0',0,0),(116,237,'user',16,'0',0,0),(117,237,'user',18,'0',0,0),(118,238,'user',12,'0',0,1),(119,238,'user',3,'0',0,1),(120,238,'user',10,'0',0,1),(121,239,'user',12,'0',0,0),(123,240,'user',12,'0',0,1),(125,242,'user',12,'0',0,0),(126,243,'user',12,'0',0,0),(128,245,'user',12,'0',0,0),(132,249,'user',12,'0',0,0),(133,250,'user',12,'0',0,0),(134,251,'user',12,'0',0,0),(135,252,'user',12,'0',0,0),(136,253,'user',12,'0',0,0),(137,254,'user',12,'0',0,0),(138,255,'user',12,'0',0,0),(139,256,'user',12,'0',0,0),(140,257,'user',12,'0',0,0),(146,263,'user',12,'0',0,0),(147,264,'user',12,'0',0,0),(148,265,'user',12,'0',0,0),(149,266,'user',12,'0',0,0),(150,267,'user',12,'0',0,0),(151,268,'user',12,'0',0,0),(152,269,'user',12,'0',0,0),(153,270,'user',12,'0',0,0),(154,271,'user',12,'0',0,0),(155,272,'user',12,'0',0,0),(156,273,'user',12,'0',0,0),(157,274,'user',12,'0',0,0),(158,275,'user',12,'0',0,0),(160,277,'user',12,'0',0,0),(161,278,'user',12,'0',0,0),(162,279,'user',12,'0',0,0),(164,281,'user',12,'0',0,0),(165,282,'user',12,'0',0,0),(166,283,'user',12,'0',0,0),(167,284,'user',12,'0',0,0),(168,285,'user',12,'0',0,0),(169,286,'user',12,'0',0,0),(170,287,'user',12,'0',0,0),(171,288,'user',12,'0',0,0),(177,294,'user',12,'0',0,0),(178,295,'user',12,'0',0,0),(179,296,'user',12,'0',0,0),(180,297,'user',12,'0',0,0),(181,298,'user',1,'0',0,0),(182,299,'user',2,'0',0,0),(183,300,'user',1,'0',0,0),(184,301,'user',2,'0',0,0),(185,302,'user',2,'0',0,0),(186,303,'user',2,'0',0,0),(187,304,'user',1,'0',0,0),(188,305,'user',2,'0',0,0),(189,306,'user',2,'0',0,0),(190,307,'user',1,'0',0,0),(191,308,'user',1,'0',0,0),(192,309,'user',1,'0',0,0),(193,310,'user',2,'0',0,0),(194,311,'user',2,'0',0,0),(195,312,'user',1,'0',0,0),(196,313,'user',2,'0',0,0),(197,314,'user',1,'0',0,0),(198,315,'user',2,'0',0,0),(199,316,'user',2,'0',0,0),(200,317,'user',2,'0',0,0),(201,318,'user',1,'0',0,0),(202,319,'user',2,'0',0,0),(203,320,'user',12,'0',0,0),(204,321,'user',12,'0',0,0),(205,322,'user',12,'0',0,0),(206,323,'user',12,'0',0,0),(207,324,'user',12,'0',0,0),(208,325,'user',12,'0',0,0),(209,326,'user',12,'0',0,0),(210,327,'user',12,'0',0,0),(211,328,'user',12,'0',0,0); +/*!40000 ALTER TABLE `llx_actioncomm_resources` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent` +-- + +DROP TABLE IF EXISTS `llx_adherent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `civility` varchar(6) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `login` varchar(50) DEFAULT NULL, + `pass` varchar(50) DEFAULT NULL, + `pass_crypted` varchar(128) DEFAULT NULL, + `fk_adherent_type` int(11) NOT NULL, + `morphy` varchar(3) NOT NULL, + `societe` varchar(128) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `address` text, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `state_id` int(11) DEFAULT NULL, + `country` int(11) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `phone` varchar(30) DEFAULT NULL, + `phone_perso` varchar(30) DEFAULT NULL, + `phone_mobile` varchar(30) DEFAULT NULL, + `birth` date DEFAULT NULL, + `photo` varchar(255) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `public` smallint(6) NOT NULL DEFAULT '0', + `datefin` datetime DEFAULT NULL, + `note_private` text, + `note_public` text, + `datevalid` datetime DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_adherent_login` (`login`,`entity`), + UNIQUE KEY `uk_adherent_fk_soc` (`fk_soc`), + KEY `idx_adherent_fk_adherent_type` (`fk_adherent_type`), + CONSTRAINT `adherent_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_adherent_adherent_type` FOREIGN KEY (`fk_adherent_type`) REFERENCES `llx_adherent_type` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent` +-- + +LOCK TABLES `llx_adherent` WRITE; +/*!40000 ALTER TABLE `llx_adherent` DISABLE KEYS */; +INSERT INTO `llx_adherent` VALUES (1,1,NULL,NULL,'Smith','Vick','vsmith','vsx1n8tf',NULL,2,'phy',NULL,10,NULL,NULL,NULL,NULL,102,'vsmith@email.com',NULL,NULL,NULL,NULL,'1960-07-07',NULL,1,0,'2012-07-09 00:00:00',NULL,NULL,'2010-07-10 15:12:56','2010-07-08 23:50:00','2013-03-20 13:30:11',1,1,1,NULL,NULL,NULL),(2,1,NULL,NULL,'Curie','Pierre','pcurie','pcuriedolibarr',NULL,2,'phy',NULL,12,NULL,NULL,NULL,NULL,1,'pcurie@example.com','',NULL,NULL,NULL,'1972-07-08',NULL,1,1,'2017-07-17 00:00:00',NULL,NULL,'2010-07-10 15:03:32','2010-07-10 15:03:09','2015-10-05 19:57:57',1,12,1,NULL,NULL,NULL),(3,1,NULL,NULL,'john','doe','john','8bs6gty5',NULL,2,'phy',NULL,NULL,NULL,NULL,NULL,NULL,1,'johndoe@email.com',NULL,NULL,NULL,NULL,NULL,NULL,1,0,NULL,NULL,NULL,'2011-07-18 21:28:00','2011-07-18 21:10:09','2015-10-03 09:28:46',1,1,1,NULL,NULL,NULL),(4,1,NULL,NULL,'smith','smith','Smith','s6hjp10f',NULL,2,'phy',NULL,NULL,NULL,NULL,NULL,NULL,11,'smith@email.com',NULL,NULL,NULL,NULL,NULL,NULL,1,0,NULL,NULL,NULL,'2011-07-18 21:27:52','2011-07-18 21:27:44','2015-10-03 09:40:27',1,1,1,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_adherent` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_extrafields` +-- + +DROP TABLE IF EXISTS `llx_adherent_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `zzz` varchar(125) DEFAULT NULL, + `aaa` varchar(255) DEFAULT NULL, + `sssss` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_adherent_options` (`fk_object`), + KEY `idx_adherent_extrafields` (`fk_object`) +) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_extrafields` +-- + +LOCK TABLES `llx_adherent_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_adherent_extrafields` DISABLE KEYS */; +INSERT INTO `llx_adherent_extrafields` VALUES (62,'2011-07-18 19:10:09',3,NULL,NULL,NULL,NULL),(63,'2011-07-18 19:27:44',4,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_adherent_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_type` +-- + +DROP TABLE IF EXISTS `llx_adherent_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_type` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `statut` smallint(6) NOT NULL DEFAULT '0', + `libelle` varchar(50) NOT NULL, + `subscription` varchar(3) NOT NULL DEFAULT '1', + `vote` varchar(3) NOT NULL DEFAULT 'yes', + `note` text, + `mail_valid` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_adherent_type_libelle` (`libelle`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_type` +-- + +LOCK TABLES `llx_adherent_type` WRITE; +/*!40000 ALTER TABLE `llx_adherent_type` DISABLE KEYS */; +INSERT INTO `llx_adherent_type` VALUES (1,1,'2010-07-08 21:41:55',1,'Board members','1','1','','
'),(2,1,'2010-07-08 21:41:43',1,'Standard members','1','0','','
'); +/*!40000 ALTER TABLE `llx_adherent_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_type_extrafields` +-- + +DROP TABLE IF EXISTS `llx_adherent_type_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_type_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_adherent_type_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_type_extrafields` +-- + +LOCK TABLES `llx_adherent_type_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_adherent_type_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_adherent_type_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_advtargetemailing` +-- + +DROP TABLE IF EXISTS `llx_advtargetemailing`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_advtargetemailing` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(200) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_mailing` int(11) NOT NULL, + `filtervalue` text, + `fk_user_author` int(11) NOT NULL, + `datec` datetime NOT NULL, + `fk_user_mod` int(11) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_advtargetemailing_name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_advtargetemailing` +-- + +LOCK TABLES `llx_advtargetemailing` WRITE; +/*!40000 ALTER TABLE `llx_advtargetemailing` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_advtargetemailing` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank` +-- + +DROP TABLE IF EXISTS `llx_bank`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datev` date DEFAULT NULL, + `dateo` date DEFAULT NULL, + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `label` varchar(255) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_rappro` int(11) DEFAULT NULL, + `fk_type` varchar(6) DEFAULT NULL, + `num_releve` varchar(50) DEFAULT NULL, + `num_chq` varchar(50) DEFAULT NULL, + `rappro` tinyint(4) DEFAULT '0', + `note` text, + `fk_bordereau` int(11) DEFAULT '0', + `banque` varchar(255) DEFAULT NULL, + `emetteur` varchar(255) DEFAULT NULL, + `author` varchar(40) DEFAULT NULL, + `numero_compte` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_bank_datev` (`datev`), + KEY `idx_bank_dateo` (`dateo`), + KEY `idx_bank_fk_account` (`fk_account`), + KEY `idx_bank_rappro` (`rappro`), + KEY `idx_bank_num_releve` (`num_releve`) +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank` +-- + +LOCK TABLES `llx_bank` WRITE; +/*!40000 ALTER TABLE `llx_bank` DISABLE KEYS */; +INSERT INTO `llx_bank` VALUES (1,'2010-07-08 23:56:14','2016-07-30 15:16:10','2016-07-08','2016-07-08',2000.00000000,'(Initial balance)',1,NULL,1,'SOLD','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(2,'2010-07-09 00:00:24','2016-07-30 15:16:10','2016-07-09','2016-07-09',500.00000000,'(Initial balance)',2,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(3,'2010-07-10 13:33:42','2016-07-30 15:16:10','2016-07-10','2016-07-10',0.00000000,'(Solde initial)',3,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(5,'2011-07-18 20:50:24','2016-07-30 15:16:10','2016-07-08','2016-07-08',20.00000000,'(CustomerInvoicePayment)',1,1,NULL,'CB','201107',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(6,'2011-07-18 20:50:47','2016-07-30 15:16:10','2016-07-08','2016-07-08',10.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(8,'2011-08-01 03:34:11','2016-07-30 15:21:31','2015-08-01','2015-08-01',5.63000000,'(CustomerInvoicePayment)',1,1,1,'CB','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(12,'2011-08-05 23:11:37','2016-07-30 15:21:31','2015-08-05','2015-08-05',-10.00000000,'(SocialContributionPayment)',1,1,1,'VIR','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(13,'2011-08-06 20:33:54','2016-07-30 15:21:31','2015-08-06','2015-08-06',5.98000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(14,'2011-08-08 02:53:40','2016-07-30 15:21:31','2015-08-08','2015-08-08',26.10000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(15,'2011-08-08 02:55:58','2016-07-30 15:21:31','2015-08-08','2015-08-08',26.96000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201211',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(16,'2012-12-09 15:28:44','2016-07-30 15:21:31','2015-12-09','2015-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(17,'2012-12-09 15:28:53','2016-07-30 15:21:31','2015-12-09','2015-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(18,'2012-12-09 17:35:55','2016-07-30 15:21:31','2015-12-09','2015-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(19,'2012-12-09 17:37:02','2016-07-30 15:21:31','2015-12-09','2015-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(20,'2012-12-09 18:35:07','2016-07-30 15:21:31','2015-12-09','2015-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(21,'2012-12-12 18:54:33','2016-07-30 15:21:31','2015-12-12','2015-12-12',1.00000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(22,'2013-03-06 16:48:16','2016-07-30 15:16:10','2016-03-06','2016-03-06',20.00000000,'(SubscriptionPayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(23,'2013-03-20 14:30:11','2016-07-30 15:16:10','2016-03-20','2016-03-20',10.00000000,'(SubscriptionPayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(24,'2014-03-02 19:57:58','2016-07-30 15:16:10','2016-07-09','2016-07-09',605.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'111',NULL,NULL),(26,'2014-03-02 20:01:39','2016-07-30 15:16:10','2016-03-19','2016-03-19',500.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(27,'2014-03-02 20:02:06','2016-07-30 15:16:10','2016-03-21','2016-03-21',400.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'ABC and Co',NULL,NULL),(28,'2014-03-03 19:22:32','2016-07-30 15:21:31','2015-10-03','2015-10-03',-400.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(29,'2014-03-03 19:23:16','2016-07-30 15:16:10','2016-03-10','2016-03-10',-300.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(30,'2016-01-22 18:56:34','2016-01-22 17:56:34','2016-01-22','2016-01-22',-900.00000000,'(SupplierInvoicePayment)',1,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(31,'2016-07-30 22:42:14','2016-07-30 14:42:14','2016-07-30','2016-07-30',0.00000000,'(Initial balance)',4,0,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(32,'2017-02-01 19:02:44','2017-02-01 15:02:44','2017-02-01','2017-02-01',-200.00000000,'(SupplierInvoicePayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(33,'2017-02-06 08:10:24','2017-02-06 04:12:05','2016-03-22','2016-03-22',150.00000000,'(CustomerInvoicePayment)',1,12,NULL,'CHQ',NULL,NULL,0,NULL,2,NULL,'Magic Food Store',NULL,NULL),(34,'2017-02-06 08:10:50','2017-02-06 04:10:50','2016-03-25','2016-03-25',140.00000000,'(CustomerInvoicePayment)',1,12,NULL,'PRE',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(35,'2017-02-12 23:18:33','2017-02-12 19:18:33','2017-02-12','2017-02-12',50.00000000,'Patient payment',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'aaa',NULL,NULL),(36,'2017-02-16 02:22:09','2017-02-15 22:22:09','2017-02-16','2017-02-16',-1.00000000,'(ExpenseReportPayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(37,'2017-02-21 16:07:43','2017-02-21 12:07:43','2017-02-21','2017-02-21',50.00000000,'(WithdrawalPayment)',1,12,NULL,'PRE',NULL,'T170201',0,NULL,0,NULL,NULL,NULL,NULL),(38,'2017-09-06 20:08:36','2017-09-06 16:08:36','2017-09-06','2017-09-06',10.00000000,'(DonationPayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,''); +/*!40000 ALTER TABLE `llx_bank` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_account` +-- + +DROP TABLE IF EXISTS `llx_bank_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_account` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(12) NOT NULL, + `label` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `bank` varchar(60) DEFAULT NULL, + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `bic` varchar(11) DEFAULT NULL, + `iban_prefix` varchar(34) DEFAULT NULL, + `country_iban` varchar(2) DEFAULT NULL, + `cle_iban` varchar(2) DEFAULT NULL, + `domiciliation` varchar(255) DEFAULT NULL, + `state_id` int(11) DEFAULT NULL, + `fk_pays` int(11) NOT NULL, + `proprio` varchar(60) DEFAULT NULL, + `owner_address` text, + `courant` smallint(6) NOT NULL DEFAULT '0', + `clos` smallint(6) NOT NULL DEFAULT '0', + `rappro` smallint(6) DEFAULT '1', + `url` varchar(128) DEFAULT NULL, + `account_number` varchar(32) DEFAULT NULL, + `accountancy_journal` varchar(16) DEFAULT NULL, + `currency_code` varchar(3) NOT NULL, + `min_allowed` int(11) DEFAULT '0', + `min_desired` int(11) DEFAULT '0', + `comment` text, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_accountancy_journal` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bank_account_label` (`label`,`entity`), + KEY `idx_fk_accountancy_journal` (`fk_accountancy_journal`), + CONSTRAINT `fk_bank_account_accountancy_journal` FOREIGN KEY (`fk_accountancy_journal`) REFERENCES `llx_accounting_journal` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_account` +-- + +LOCK TABLES `llx_bank_account` WRITE; +/*!40000 ALTER TABLE `llx_bank_account` DISABLE KEYS */; +INSERT INTO `llx_bank_account` VALUES (1,'2010-07-08 23:56:14','2016-07-30 14:45:12','SWIBAC','Swiss bank account',1,'Switz Gold Bank','','','123456789','','','NL39RABO0314043352',NULL,NULL,'21 jum street',NULL,6,'Mac Golder','11 big road,\r\nZurich',1,0,1,NULL,'','','EUR',1500,1500,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'2010-07-09 00:00:24','2016-07-30 15:17:18','SWIBAC2','Swiss bank account old',1,'Switz Silver Bank','','','','','','NL07SNSB0908534915',NULL,NULL,'Road bankrupt\r\nZurich',NULL,6,'','',1,1,1,NULL,'','','EUR',200,400,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'2010-07-10 13:33:42','2017-08-27 13:29:05','ACCOUNTCASH','Account for cash',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,1,NULL,NULL,2,0,1,NULL,'','OD','EUR',0,0,'
',NULL,NULL,NULL,NULL,NULL,NULL,4),(4,'2016-07-30 18:42:14','2016-07-30 14:44:45','LUXBAC','Luxemburg Bank Account',1,'Lux Platinuium Bank','','','','','','NL46INGB0687674581',NULL,NULL,'',NULL,140,'','',1,0,1,NULL,'','','EUR',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_bank_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_account_extrafields` +-- + +DROP TABLE IF EXISTS `llx_bank_account_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_account_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_bank_account_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_account_extrafields` +-- + +LOCK TABLES `llx_bank_account_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_bank_account_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_bank_account_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_categ` +-- + +DROP TABLE IF EXISTS `llx_bank_categ`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_categ` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_categ` +-- + +LOCK TABLES `llx_bank_categ` WRITE; +/*!40000 ALTER TABLE `llx_bank_categ` DISABLE KEYS */; +INSERT INTO `llx_bank_categ` VALUES (1,'Bank category one',1),(2,'Bank category two',1); +/*!40000 ALTER TABLE `llx_bank_categ` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_class` +-- + +DROP TABLE IF EXISTS `llx_bank_class`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_class` ( + `lineid` int(11) NOT NULL, + `fk_categ` int(11) NOT NULL, + UNIQUE KEY `uk_bank_class_lineid` (`lineid`,`fk_categ`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_class` +-- + +LOCK TABLES `llx_bank_class` WRITE; +/*!40000 ALTER TABLE `llx_bank_class` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_bank_class` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_url` +-- + +DROP TABLE IF EXISTS `llx_bank_url`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_url` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_bank` int(11) DEFAULT NULL, + `url_id` int(11) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `type` varchar(24) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bank_url` (`fk_bank`,`type`) +) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_url` +-- + +LOCK TABLES `llx_bank_url` WRITE; +/*!40000 ALTER TABLE `llx_bank_url` DISABLE KEYS */; +INSERT INTO `llx_bank_url` VALUES (3,5,2,'/compta/paiement/card.php?id=','(paiement)','payment'),(4,5,2,'/comm/card.php?socid=','Belin SARL','company'),(5,6,3,'/compta/paiement/card.php?id=','(paiement)','payment'),(6,6,2,'/comm/card.php?socid=','Belin SARL','company'),(9,8,5,'/compta/paiement/card.php?id=','(paiement)','payment'),(10,8,7,'/comm/card.php?socid=','Generic customer','company'),(17,12,4,'/compta/payment_sc/card.php?id=','(paiement)','payment_sc'),(18,12,4,'/compta/charges.php?id=','Assurance Chomage (fff)','sc'),(19,13,6,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(20,13,7,'/dolibarrnew/comm/card.php?socid=','Generic customer','company'),(21,14,8,'/compta/paiement/card.php?id=','(paiement)','payment'),(22,14,2,'/comm/card.php?socid=','Belin SARL','company'),(23,15,9,'/compta/paiement/card.php?id=','(paiement)','payment'),(24,15,10,'/comm/card.php?socid=','Smith Vick','company'),(25,16,17,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(26,16,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(27,17,18,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(28,17,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(29,18,19,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(30,18,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(31,19,20,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(32,19,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(33,20,21,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(34,20,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(35,21,23,'/compta/paiement/card.php?id=','(paiement)','payment'),(36,21,1,'/comm/card.php?socid=','ABC and Co','company'),(37,22,24,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(38,22,12,'/dolibarrnew/comm/card.php?socid=','Dupont Alain','company'),(39,23,25,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(40,23,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(41,24,26,'/compta/paiement/card.php?id=','(paiement)','payment'),(42,24,1,'/comm/card.php?socid=','ABC and Co','company'),(45,26,29,'/compta/paiement/card.php?id=','(paiement)','payment'),(46,26,1,'/comm/card.php?socid=','ABC and Co','company'),(47,27,30,'/compta/paiement/card.php?id=','(paiement)','payment'),(48,27,1,'/comm/card.php?socid=','ABC and Co','company'),(49,28,32,'/dolibarr_new/compta/paiement/card.php?id=','(paiement)','payment'),(50,28,1,'/dolibarr_new/comm/card.php?socid=','ABC and Co','company'),(51,29,33,'/dolibarr_new/compta/paiement/card.php?id=','(paiement)','payment'),(52,29,1,'/dolibarr_new/comm/card.php?socid=','ABC and Co','company'),(53,30,1,'/dolibarr_3.8/htdocs/fourn/paiement/card.php?id=','(paiement)','payment_supplier'),(54,30,1,'/dolibarr_3.8/htdocs/fourn/card.php?socid=','Indian SAS','company'),(55,32,2,'/dolibarr_5.0/htdocs/fourn/paiement/card.php?id=','(paiement)','payment_supplier'),(56,32,13,'/dolibarr_5.0/htdocs/fourn/card.php?socid=','Company Corp 2','company'),(57,33,34,'/dolibarr_5.0/htdocs/compta/paiement/card.php?id=','(paiement)','payment'),(58,33,19,'/dolibarr_5.0/htdocs/comm/card.php?socid=','Magic Food Store','company'),(59,34,35,'/dolibarr_5.0/htdocs/compta/paiement/card.php?id=','(paiement)','payment'),(60,34,19,'/dolibarr_5.0/htdocs/comm/card.php?socid=','Magic Food Store','company'),(61,35,2,'/dolibarr_5.0/htdocs/dolimed_5.0/cabinetmed/consultations.php?action=edit&socid=26&id=','Consultation','consultation'),(62,35,26,'','aaa','company'),(63,36,2,'/dolibarr_5.0/htdocs/expensereport/payment/card.php?rowid=','(paiement)','payment_expensereport'),(64,36,0,'/dolibarr_5.0/htdocs/user/card.php?id=','','user'),(65,37,36,'/dolibarr_5.0/htdocs/compta/paiement/card.php?id=','(paiement)','payment'),(66,37,1,'/dolibarr_5.0/htdocs/compta/prelevement/card.php?id=','T170201','withdraw'),(67,38,1,'/dolibarr_6.0/htdocs/don/payment/card.php?rowid=','(paiement)','payment_donation'); +/*!40000 ALTER TABLE `llx_bank_url` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_blockedlog` +-- + +DROP TABLE IF EXISTS `llx_blockedlog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_blockedlog` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `action` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `amounts` double NOT NULL, + `signature` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `signature_line` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `element` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `fk_object` int(11) DEFAULT NULL, + `ref_object` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, + `date_object` datetime DEFAULT NULL, + `object_data` text COLLATE utf8_unicode_ci, + `fk_user` int(11) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `certified` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `signature` (`signature`), + KEY `fk_object_element` (`fk_object`,`element`), + KEY `entity` (`entity`), + KEY `fk_user` (`fk_user`), + KEY `entity_action` (`entity`,`action`), + KEY `entity_action_certified` (`entity`,`action`,`certified`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_blockedlog` +-- + +LOCK TABLES `llx_blockedlog` WRITE; +/*!40000 ALTER TABLE `llx_blockedlog` DISABLE KEYS */; +INSERT INTO `llx_blockedlog` VALUES (1,'2017-08-02 08:25:58','BILL_SENTBYMAIL',6,'e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(2,'2017-08-02 08:25:58','BILL_SENTBYMAIL',20,'9723d42f5ca91f8fe37ffd8797d96f3328ad0728c9359c8408caf643cb80aefb','7b60f68f0b62bd91bdc8a3365a5e0d0b0c073efdf2af6aeb43b1862900a26c48','facture',8771,'FA1707-8565','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:16:\"Magic Food Store\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:22:\"65 holdywood boulevard\";s:3:\"zip\";s:6:\"123456\";s:4:\"town\";s:7:\"BigTown\";s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";s:4:\"0101\";s:5:\"email\";s:18:\"myemail@domain.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:10:\"10/10/2010\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"0\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1487667100;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1357978985;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1301-0008\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"en_US\";s:3:\"ref\";s:2:\"19\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:18:\"magicfoodstore.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"19\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";s:18:\"patient@cabinetmed\";s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:7:\"Espagne\";s:10:\"country_id\";s:1:\"4\";s:12:\"country_code\";s:2:\"ES\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";s:11:\"sepamandate\";s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:16:\"Magic Food Store\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:20;s:9:\"total_tva\";d:1.7;s:9:\"total_ttc\";d:20;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(3,'2017-08-02 08:36:34','BILL_SENTBYMAIL',6,'e565ad988a79df11e2de93c402175358649483cf684573da75567aa37b740488','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(4,'2017-08-02 08:36:34','BILL_SENTBYMAIL',20,'ade186d3b74ddc471fd6964e5e76e19c3a737012e9bac1ed773c21cb5061c787','7b60f68f0b62bd91bdc8a3365a5e0d0b0c073efdf2af6aeb43b1862900a26c48','facture',8771,'FA1707-8565','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:16:\"Magic Food Store\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:22:\"65 holdywood boulevard\";s:3:\"zip\";s:6:\"123456\";s:4:\"town\";s:7:\"BigTown\";s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";s:4:\"0101\";s:5:\"email\";s:18:\"myemail@domain.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:10:\"10/10/2010\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"0\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1487667100;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1357978985;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1301-0008\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"en_US\";s:3:\"ref\";s:2:\"19\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:18:\"magicfoodstore.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"19\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";s:18:\"patient@cabinetmed\";s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:7:\"Espagne\";s:10:\"country_id\";s:1:\"4\";s:12:\"country_code\";s:2:\"ES\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";s:11:\"sepamandate\";s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:16:\"Magic Food Store\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:20;s:9:\"total_tva\";d:1.7;s:9:\"total_ttc\";d:20;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(5,'2017-08-02 08:36:56','BILL_SENTBYMAIL',6,'377af8dd352bf4762dc02def97c196ae017781013652ffc1865ab0fa0c6a2ad9','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(6,'2017-08-02 08:36:56','BILL_SENTBYMAIL',20,'89411e25f74aaa70f7effe5bc30d44d9870a5bc99665d6ac8f38bdde41c7666d','7b60f68f0b62bd91bdc8a3365a5e0d0b0c073efdf2af6aeb43b1862900a26c48','facture',8771,'FA1707-8565','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:16:\"Magic Food Store\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:22:\"65 holdywood boulevard\";s:3:\"zip\";s:6:\"123456\";s:4:\"town\";s:7:\"BigTown\";s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";s:4:\"0101\";s:5:\"email\";s:18:\"myemail@domain.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:10:\"10/10/2010\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"0\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1487667100;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1357978985;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1301-0008\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"en_US\";s:3:\"ref\";s:2:\"19\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:18:\"magicfoodstore.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"19\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";s:18:\"patient@cabinetmed\";s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:7:\"Espagne\";s:10:\"country_id\";s:1:\"4\";s:12:\"country_code\";s:2:\"ES\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";s:11:\"sepamandate\";s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:16:\"Magic Food Store\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:20;s:9:\"total_tva\";d:1.7;s:9:\"total_ttc\";d:20;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(7,'2017-08-02 08:39:42','BILL_SENTBYMAIL',6,'fdd50904cc6c35f02c1a8b4bbd62c84f207f0f4fa9b6583915a1a44631d64211','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(8,'2017-08-02 08:49:45','BILL_SENTBYMAIL',6,'12378effcd936967e889b46b3683a648abe623b917ff3541e64221506d3bb5d7','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(9,'2017-08-02 09:37:50','BILL_SENTBYMAIL',6,'1de2cbe8cb5fbd857db8d0655b457dd938b512ade4b9398821ab64fe91a3db99','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(10,'2017-08-24 13:13:59','BILL_PAYED',10,'ec3ee6ad9ad246971e682ec0a6c2da6dc50edf649a82306d25094f4f6f152eca','ba692804ef75f1a9215c1d4a16a3238dcd6a9979a66b23d7cb7c33723cc6d2c9','facture',160,'FA1507-0015','2016-07-18 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:8.8900000000000006;s:9:\"total_tva\";d:1.1100000000000001;s:9:\"total_ttc\";d:10;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(11,'2017-08-24 13:13:59','PAYMENT_CUSTOMER_CREATE',10,'d85b7d157d2a9af2f558ba14361dcea164fce589176e5140e216ded42f6d975f','fc16a403f1d77c8cdbb8cdb138a84cd7e7ee5171a392a237e53fea3181e1b134','payment',41,'PAY1708-0008','2017-08-24 12:00:00','O:8:\"stdClass\":1:{s:7:\"amounts\";a:1:{i:160;s:2:\"10\";}}',12,1,0),(12,'2017-08-24 13:13:59','PAYMENT_ADD_TO_BANK',10,'b487f2db2ccfa4a90d5a7274ba82d4407c57b45c9bf18b76872af8d6d4a1a6d9','141c462de832eaa27ad97bed061d2d4161baf472f50c7ed6afa59f7379a7688c','payment',41,'PAY1708-0008','2017-08-24 12:00:00','O:8:\"stdClass\":1:{s:7:\"amounts\";a:1:{i:160;s:2:\"10\";}}',12,1,0),(13,'2017-08-24 13:14:03','BILL_UNPAYED',10,'aa00aa2d2ec2c29a14e6c6bf7a0534aefbb023e48b8ea4e8d9a6654c7225c1ff','9b4b628169f17771440fc3092ba6d374e6145f9a535c9f39209f23fa5298d097','facture',160,'FA1507-0015','2016-07-18 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:8.8900000000000006;s:9:\"total_tva\";d:1.1100000000000001;s:9:\"total_ttc\";d:10;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(14,'2017-08-24 13:16:29','PAYMENT_CUSTOMER_CREATE',10,'132b29a7eb271cf8e9c59d9b92686a33380111136328af1021c8b27acea9a7fb','fc16a403f1d77c8cdbb8cdb138a84cd7e7ee5171a392a237e53fea3181e1b134','payment',42,'PAY1708-0009','2017-08-24 12:00:00','O:8:\"stdClass\":1:{s:7:\"amounts\";a:1:{i:160;s:2:\"10\";}}',12,1,0),(15,'2017-08-24 13:16:29','PAYMENT_ADD_TO_BANK',10,'b61a6ff4c376f958b4b790aa604c2aed3fdb83754d71eb66429e15058dacba31','141c462de832eaa27ad97bed061d2d4161baf472f50c7ed6afa59f7379a7688c','payment',42,'PAY1708-0009','2017-08-24 12:00:00','O:8:\"stdClass\":1:{s:7:\"amounts\";a:1:{i:160;s:2:\"10\";}}',12,1,0),(16,'2017-08-24 13:27:51','BILL_PAYED',10,'1bcfe1a00ec383d5b1b5e00b2523f11206c11875dedf1622f946eb3356ad997b','ba692804ef75f1a9215c1d4a16a3238dcd6a9979a66b23d7cb7c33723cc6d2c9','facture',160,'FA1507-0015','2016-07-18 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:8.8900000000000006;s:9:\"total_tva\";d:1.1100000000000001;s:9:\"total_ttc\";d:10;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(17,'2017-08-24 13:30:04','BILL_UNPAYED',10,'c9cff4c7b3d71fd69d366ee8d09141dd4c21a5bf1569e70b4c09a0f06763d4fd','9b4b628169f17771440fc3092ba6d374e6145f9a535c9f39209f23fa5298d097','facture',160,'FA1507-0015','2016-07-18 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:8.8900000000000006;s:9:\"total_tva\";d:1.1100000000000001;s:9:\"total_ttc\";d:10;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(18,'2017-08-24 13:34:07','BILL_VALIDATE',-12,'25a739b8fe033e38001139c4427fcc567f6e4317c87bdf48af895172031f781e','47a479de70f03b12bdf94015e848223a3b24fcc1edef6a491a35105da9db6d37','facture',8773,'(PROV8773)','2017-08-24 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";i:1;s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:-10;s:9:\"total_tva\";d:-2;s:9:\"total_ttc\";d:-12;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0); +/*!40000 ALTER TABLE `llx_blockedlog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_blockedlog_authority` +-- + +DROP TABLE IF EXISTS `llx_blockedlog_authority`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_blockedlog_authority` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `blockchain` longtext COLLATE utf8_unicode_ci NOT NULL, + `signature` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + KEY `signature` (`signature`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_blockedlog_authority` +-- + +LOCK TABLES `llx_blockedlog_authority` WRITE; +/*!40000 ALTER TABLE `llx_blockedlog_authority` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_blockedlog_authority` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bookmark` +-- + +DROP TABLE IF EXISTS `llx_bookmark`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bookmark` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_user` int(11) NOT NULL, + `dateb` datetime DEFAULT NULL, + `url` varchar(255) NOT NULL, + `target` varchar(16) DEFAULT NULL, + `title` varchar(64) DEFAULT NULL, + `favicon` varchar(24) DEFAULT NULL, + `position` int(11) DEFAULT '0', + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bookmark_url` (`fk_user`,`url`), + UNIQUE KEY `uk_bookmark_title` (`fk_user`,`title`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bookmark` +-- + +LOCK TABLES `llx_bookmark` WRITE; +/*!40000 ALTER TABLE `llx_bookmark` DISABLE KEYS */; +INSERT INTO `llx_bookmark` VALUES (1,NULL,0,'2010-07-09 01:29:03','http://wiki.dolibarr.org','1','Online documentation','none',1,1),(2,NULL,0,'2010-07-09 01:30:15','http://www.dolibarr.org','1','Official portal','none',2,1),(3,NULL,0,'2010-07-09 01:30:53','http://www.dolistore.com','1','DoliStore','none',10,1),(4,NULL,0,'2010-07-09 01:31:35','http://asso.dolibarr.org/index.php/Main_Page','1','The foundation','none',0,1),(5,NULL,0,'2014-03-02 16:40:41','http://www.facebook.com/dolibarr','1','Facebook page','none',50,1),(6,NULL,0,'2014-03-02 16:41:12','http://www.twitter.com/dolibarr','1','Twitter channel','none',60,1),(7,NULL,0,'2014-03-02 16:42:08','http://plus.google.com/+DolibarrOrg','1','Google+ page','none',55,1); +/*!40000 ALTER TABLE `llx_bookmark` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bordereau_cheque` +-- + +DROP TABLE IF EXISTS `llx_bordereau_cheque`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bordereau_cheque` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime NOT NULL, + `date_bordereau` date DEFAULT NULL, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `amount` double(24,8) NOT NULL, + `nbcheque` smallint(6) NOT NULL, + `fk_bank_account` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `note` text, + `statut` smallint(6) NOT NULL DEFAULT '0', + `ref_ext` varchar(255) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bordereau_cheque` (`ref`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bordereau_cheque` +-- + +LOCK TABLES `llx_bordereau_cheque` WRITE; +/*!40000 ALTER TABLE `llx_bordereau_cheque` DISABLE KEYS */; +INSERT INTO `llx_bordereau_cheque` VALUES (2,'2017-02-06 08:12:05','2017-02-06','CHK1702-0001',1,150.00000000,1,1,12,NULL,1,'','2017-02-06 04:12:13'); +/*!40000 ALTER TABLE `llx_bordereau_cheque` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_boxes` +-- + +DROP TABLE IF EXISTS `llx_boxes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_boxes` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `box_id` int(11) NOT NULL, + `position` smallint(6) NOT NULL, + `box_order` varchar(3) NOT NULL, + `fk_user` int(11) NOT NULL DEFAULT '0', + `maxline` int(11) DEFAULT NULL, + `params` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_boxes` (`entity`,`box_id`,`position`,`fk_user`), + KEY `idx_boxes_boxid` (`box_id`), + KEY `idx_boxes_fk_user` (`fk_user`), + CONSTRAINT `fk_boxes_box_id` FOREIGN KEY (`box_id`) REFERENCES `llx_boxes_def` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=1120 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_boxes` +-- + +LOCK TABLES `llx_boxes` WRITE; +/*!40000 ALTER TABLE `llx_boxes` DISABLE KEYS */; +INSERT INTO `llx_boxes` VALUES (253,2,323,0,'0',0,NULL,NULL),(304,2,324,0,'0',0,NULL,NULL),(305,2,325,0,'0',0,NULL,NULL),(306,2,326,0,'0',0,NULL,NULL),(307,2,327,0,'0',0,NULL,NULL),(308,2,328,0,'0',0,NULL,NULL),(309,2,329,0,'0',0,NULL,NULL),(310,2,330,0,'0',0,NULL,NULL),(311,2,331,0,'0',0,NULL,NULL),(312,2,332,0,'0',0,NULL,NULL),(313,2,333,0,'0',0,NULL,NULL),(314,1,347,0,'A01',0,NULL,NULL),(315,1,348,0,'B18',0,NULL,NULL),(316,1,349,0,'A19',0,NULL,NULL),(317,1,350,0,'B20',0,NULL,NULL),(344,1,374,0,'A21',0,NULL,NULL),(347,1,377,0,'B22',0,NULL,NULL),(348,1,378,0,'A23',0,NULL,NULL),(358,1,388,0,'A25',0,NULL,NULL),(359,1,389,0,'B26',0,NULL,NULL),(360,1,390,0,'A27',0,NULL,NULL),(362,1,392,0,'A29',0,NULL,NULL),(363,1,393,0,'B30',0,NULL,NULL),(366,1,396,0,'A17',0,NULL,NULL),(387,1,403,0,'B16',0,NULL,NULL),(392,1,409,0,'A15',0,NULL,NULL),(393,1,410,0,'B02',0,NULL,NULL),(394,1,411,0,'A03',0,NULL,NULL),(395,1,412,0,'B04',0,NULL,NULL),(396,1,413,0,'A05',0,NULL,NULL),(397,1,414,0,'B06',0,NULL,NULL),(398,1,415,0,'A07',0,NULL,NULL),(399,1,416,0,'B08',0,NULL,NULL),(400,1,417,0,'A09',0,NULL,NULL),(401,1,418,0,'B10',0,NULL,NULL),(501,1,419,0,'A11',0,NULL,NULL),(1019,1,392,0,'A01',2,NULL,NULL),(1021,1,412,0,'A03',2,NULL,NULL),(1022,1,347,0,'A04',2,NULL,NULL),(1023,1,393,0,'A05',2,NULL,NULL),(1025,1,389,0,'A07',2,NULL,NULL),(1026,1,416,0,'A08',2,NULL,NULL),(1027,1,396,0,'B01',2,NULL,NULL),(1028,1,377,0,'B02',2,NULL,NULL),(1031,1,419,0,'B05',2,NULL,NULL),(1036,1,424,0,'0',0,NULL,NULL),(1037,1,425,0,'0',0,NULL,NULL),(1038,1,426,0,'0',0,NULL,NULL),(1039,1,427,0,'0',0,NULL,NULL),(1115,1,412,0,'A01',12,NULL,NULL),(1116,1,392,0,'A02',12,NULL,NULL),(1117,1,377,0,'A03',12,NULL,NULL),(1118,1,347,0,'A04',12,NULL,NULL),(1119,1,396,0,'B01',12,NULL,NULL); +/*!40000 ALTER TABLE `llx_boxes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_boxes_def` +-- + +DROP TABLE IF EXISTS `llx_boxes_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_boxes_def` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `file` varchar(200) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `note` varchar(130) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_boxes_def` (`file`,`entity`,`note`) +) ENGINE=InnoDB AUTO_INCREMENT=430 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_boxes_def` +-- + +LOCK TABLES `llx_boxes_def` WRITE; +/*!40000 ALTER TABLE `llx_boxes_def` DISABLE KEYS */; +INSERT INTO `llx_boxes_def` VALUES (188,'box_services_vendus.php',1,'2011-08-05 20:40:27',NULL),(323,'box_actions.php',2,'2013-03-13 15:29:19',NULL),(324,'box_clients.php',2,'2013-03-13 20:21:35',NULL),(325,'box_prospect.php',2,'2013-03-13 20:21:35',NULL),(326,'box_contacts.php',2,'2013-03-13 20:21:35',NULL),(327,'box_activity.php',2,'2013-03-13 20:21:35','(WarningUsingThisBoxSlowDown)'),(328,'box_propales.php',2,'2013-03-13 20:32:38',NULL),(329,'box_comptes.php',2,'2013-03-13 20:33:09',NULL),(330,'box_factures_imp.php',2,'2013-03-13 20:33:09',NULL),(331,'box_factures.php',2,'2013-03-13 20:33:09',NULL),(332,'box_produits.php',2,'2013-03-13 20:33:09',NULL),(333,'box_produits_alerte_stock.php',2,'2013-03-13 20:33:09',NULL),(346,'box_googlemaps@google',1,'2013-11-07 00:01:39',NULL),(347,'box_clients.php',1,'2015-11-15 22:05:57',NULL),(348,'box_prospect.php',1,'2015-11-15 22:05:57',NULL),(349,'box_contacts.php',1,'2015-11-15 22:05:57',NULL),(350,'box_activity.php',1,'2015-11-15 22:05:57','(WarningUsingThisBoxSlowDown)'),(374,'box_services_contracts.php',1,'2015-11-15 22:38:37',NULL),(377,'box_project.php',1,'2015-11-15 22:38:44',NULL),(378,'box_task.php',1,'2015-11-15 22:38:44',NULL),(388,'box_contracts.php',1,'2015-11-15 22:39:52',NULL),(389,'box_services_expired.php',1,'2015-11-15 22:39:52',NULL),(390,'box_ficheinter.php',1,'2015-11-15 22:39:56',NULL),(392,'box_graph_propales_permonth.php',1,'2015-11-15 22:41:47',NULL),(393,'box_propales.php',1,'2015-11-15 22:41:47',NULL),(396,'box_graph_product_distribution.php',1,'2015-11-15 22:41:47',NULL),(403,'box_goodcustomers.php',1,'2016-07-30 11:13:20','(WarningUsingThisBoxSlowDown)'),(404,'box_external_rss.php',1,'2016-07-30 11:15:25','1 (Dolibarr.org News)'),(409,'box_produits.php',1,'2016-07-30 13:38:11',NULL),(410,'box_produits_alerte_stock.php',1,'2016-07-30 13:38:11',NULL),(411,'box_commandes.php',1,'2016-07-30 13:38:11',NULL),(412,'box_graph_orders_permonth.php',1,'2016-07-30 13:38:11',NULL),(413,'box_graph_invoices_supplier_permonth.php',1,'2016-07-30 13:38:11',NULL),(414,'box_graph_orders_supplier_permonth.php',1,'2016-07-30 13:38:11',NULL),(415,'box_fournisseurs.php',1,'2016-07-30 13:38:11',NULL),(416,'box_factures_fourn_imp.php',1,'2016-07-30 13:38:11',NULL),(417,'box_factures_fourn.php',1,'2016-07-30 13:38:11',NULL),(418,'box_supplier_orders.php',1,'2016-07-30 13:38:11',NULL),(419,'box_actions.php',1,'2016-07-30 15:42:32',NULL),(424,'box_factures_imp.php',1,'2017-02-07 18:56:12',NULL),(425,'box_factures.php',1,'2017-02-07 18:56:12',NULL),(426,'box_graph_invoices_permonth.php',1,'2017-02-07 18:56:12',NULL),(427,'box_comptes.php',1,'2017-02-07 18:56:12',NULL),(429,'box_lastlogin.php',1,'2017-08-27 13:29:14',NULL); +/*!40000 ALTER TABLE `llx_boxes_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_budget` +-- + +DROP TABLE IF EXISTS `llx_budget`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_budget` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `label` varchar(255) NOT NULL, + `status` int(11) DEFAULT NULL, + `note` text, + `date_start` date DEFAULT NULL, + `date_end` date DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `import_key` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_budget` +-- + +LOCK TABLES `llx_budget` WRITE; +/*!40000 ALTER TABLE `llx_budget` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_budget` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_budget_lines` +-- + +DROP TABLE IF EXISTS `llx_budget_lines`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_budget_lines` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_budget` int(11) NOT NULL, + `fk_project_ids` varchar(255) NOT NULL, + `amount` double(24,8) NOT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `import_key` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_budget_lines` (`fk_budget`,`fk_project_ids`), + CONSTRAINT `fk_budget_lines_budget` FOREIGN KEY (`fk_budget`) REFERENCES `llx_budget` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_budget_lines` +-- + +LOCK TABLES `llx_budget_lines` WRITE; +/*!40000 ALTER TABLE `llx_budget_lines` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_budget_lines` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_accounting_category` +-- + +DROP TABLE IF EXISTS `llx_c_accounting_category`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_accounting_category` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `label` varchar(255) NOT NULL, + `range_account` varchar(255) NOT NULL, + `sens` tinyint(4) NOT NULL DEFAULT '0', + `category_type` tinyint(4) NOT NULL DEFAULT '0', + `formula` varchar(255) NOT NULL, + `position` int(11) DEFAULT '0', + `fk_country` int(11) DEFAULT NULL, + `active` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_accounting_category` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_accounting_category` +-- + +LOCK TABLES `llx_c_accounting_category` WRITE; +/*!40000 ALTER TABLE `llx_c_accounting_category` DISABLE KEYS */; +INSERT INTO `llx_c_accounting_category` VALUES (1,'VTE','Ventes de marchandises','707xxx',0,0,'',10,1,1),(2,'MAR','Coût d achats marchandises vendues','603xxx | 607xxx | 609xxx',0,0,'',20,1,1),(3,'MARGE','Marge commerciale','',0,1,'1 + 2',30,1,1),(4,'123','ddd','603xxx | 607xxx | 609xxx',0,0,'0',4,14,1); +/*!40000 ALTER TABLE `llx_c_accounting_category` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_action_trigger` +-- + +DROP TABLE IF EXISTS `llx_c_action_trigger`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_action_trigger` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(32) NOT NULL, + `label` varchar(128) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `elementtype` varchar(16) NOT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_action_trigger_code` (`code`), + KEY `idx_action_trigger_rang` (`rang`) +) ENGINE=InnoDB AUTO_INCREMENT=210 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_action_trigger` +-- + +LOCK TABLES `llx_c_action_trigger` WRITE; +/*!40000 ALTER TABLE `llx_c_action_trigger` DISABLE KEYS */; +INSERT INTO `llx_c_action_trigger` VALUES (131,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1),(132,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1),(133,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2),(134,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3),(135,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4),(136,'ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5),(137,'ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5),(138,'ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5),(139,'ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5),(140,'BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6),(141,'BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7),(142,'BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8),(143,'BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9),(144,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10),(145,'ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11),(146,'ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12),(147,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13),(148,'ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14),(149,'BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15),(150,'BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16),(151,'BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17),(152,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17),(153,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18),(154,'SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20),(155,'SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21),(156,'MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22),(157,'MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',23),(158,'MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24),(159,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24),(160,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25),(161,'FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19),(162,'FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19),(163,'FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19),(164,'FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19),(165,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19),(166,'PROJECT_CREATE','Project creation','Executed when a project is created','project',140),(167,'PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2),(168,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2),(169,'PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2),(170,'TASK_CREATE','Task created','Executed when a project task is created','project',35),(171,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36),(172,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37),(173,'BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15),(174,'PROJECT_MODIFY','Project modified','Executed when a project is modified','project',141),(175,'PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',142),(176,'ORDER_SUPPLIER_CREATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11),(177,'ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',12),(178,'ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',12),(179,'ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14),(180,'PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30),(181,'PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30),(182,'PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30),(183,'EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expense_report',201),(185,'EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expense_report',202),(186,'EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expense_report',203),(187,'EXPENSE_REPORT_PAYED','Expense report billed','Executed when an expense report is set as billed','expense_report',204),(192,'HOLIDAY_CREATE','Leave request created','Executed when a leave request is created','holiday',221),(193,'HOLIDAY_VALIDATE','Leave request validated','Executed when a leave request is validated','holiday',222),(194,'HOLIDAY_APPROVE','Leave request approved','Executed when a leave request is approved','holiday',223); +/*!40000 ALTER TABLE `llx_c_action_trigger` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_actioncomm` +-- + +DROP TABLE IF EXISTS `llx_c_actioncomm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_actioncomm` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `type` varchar(50) NOT NULL DEFAULT 'system', + `libelle` varchar(48) NOT NULL, + `module` varchar(16) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `todo` tinyint(4) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + `color` varchar(9) DEFAULT NULL, + `picto` varchar(48) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_actioncomm` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_actioncomm` +-- + +LOCK TABLES `llx_c_actioncomm` WRITE; +/*!40000 ALTER TABLE `llx_c_actioncomm` DISABLE KEYS */; +INSERT INTO `llx_c_actioncomm` VALUES (1,'AC_TEL','system','Phone call',NULL,1,NULL,2,NULL,NULL),(2,'AC_FAX','system','Send Fax',NULL,1,NULL,3,NULL,NULL),(4,'AC_EMAIL','system','Send Email',NULL,1,NULL,4,NULL,NULL),(5,'AC_RDV','system','Rendez-vous',NULL,1,NULL,1,NULL,NULL),(11,'AC_INT','system','Intervention on site',NULL,1,NULL,4,NULL,NULL),(40,'AC_OTH_AUTO','systemauto','Other (automatically inserted events)',NULL,1,NULL,20,NULL,NULL),(50,'AC_OTH','system','Other (manually inserted events)',NULL,1,NULL,5,NULL,NULL),(100700,'AC_CABMED','module','Send document by email','cabinetmed',0,NULL,100,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_actioncomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_availability` +-- + +DROP TABLE IF EXISTS `llx_c_availability`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_availability` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) NOT NULL, + `label` varchar(60) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_availability` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_availability` +-- + +LOCK TABLES `llx_c_availability` WRITE; +/*!40000 ALTER TABLE `llx_c_availability` DISABLE KEYS */; +INSERT INTO `llx_c_availability` VALUES (1,'AV_NOW','Immediate',1),(2,'AV_1W','1 week',1),(3,'AV_2W','2 weeks',1),(4,'AV_3W','3 weeks',1); +/*!40000 ALTER TABLE `llx_c_availability` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_barcode_type` +-- + +DROP TABLE IF EXISTS `llx_c_barcode_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_barcode_type` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `libelle` varchar(50) NOT NULL, + `coder` varchar(16) NOT NULL, + `example` varchar(16) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_barcode_type` (`code`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_barcode_type` +-- + +LOCK TABLES `llx_c_barcode_type` WRITE; +/*!40000 ALTER TABLE `llx_c_barcode_type` DISABLE KEYS */; +INSERT INTO `llx_c_barcode_type` VALUES (1,'EAN8',1,'EAN8','0','1234567'),(2,'EAN13',1,'EAN13','phpbarcode','123456789012'),(3,'UPC',1,'UPC','0','123456789012'),(4,'ISBN',1,'ISBN','0','123456789'),(5,'C39',1,'Code 39','0','1234567890'),(6,'C128',1,'Code 128','tcpdfbarcode','ABCD1234567890'),(13,'DATAMATRIX',1,'Datamatrix','0','1234567xyz'),(14,'QRCODE',1,'Qr Code','0','www.dolibarr.org'); +/*!40000 ALTER TABLE `llx_c_barcode_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_chargesociales` +-- + +DROP TABLE IF EXISTS `llx_c_chargesociales`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_chargesociales` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `libelle` varchar(80) DEFAULT NULL, + `deductible` smallint(6) NOT NULL DEFAULT '0', + `active` tinyint(4) NOT NULL DEFAULT '1', + `code` varchar(12) NOT NULL, + `fk_pays` int(11) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `accountancy_code` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4110 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_chargesociales` +-- + +LOCK TABLES `llx_c_chargesociales` WRITE; +/*!40000 ALTER TABLE `llx_c_chargesociales` DISABLE KEYS */; +INSERT INTO `llx_c_chargesociales` VALUES (1,'Allocations familiales',1,1,'TAXFAM',1,NULL,NULL),(2,'CSG Deductible',1,1,'TAXCSGD',1,NULL,NULL),(3,'CSG/CRDS NON Deductible',0,1,'TAXCSGND',1,NULL,NULL),(10,'Taxe apprentissage',0,1,'TAXAPP',1,NULL,NULL),(11,'Taxe professionnelle',0,1,'TAXPRO',1,NULL,NULL),(12,'Cotisation foncière des entreprises',0,1,'TAXCFE',1,NULL,NULL),(13,'Cotisation sur la valeur ajoutée des entreprises',0,1,'TAXCVAE',1,NULL,NULL),(20,'Impots locaux/fonciers',0,1,'TAXFON',1,NULL,NULL),(25,'Impots revenus',0,1,'TAXREV',1,NULL,NULL),(30,'Assurance Sante',0,1,'TAXSECU',1,NULL,NULL),(40,'Mutuelle',0,1,'TAXMUT',1,NULL,NULL),(50,'Assurance vieillesse',0,1,'TAXRET',1,NULL,NULL),(60,'Assurance Chomage',0,1,'TAXCHOM',1,NULL,NULL),(201,'ONSS',1,1,'TAXBEONSS',2,NULL,NULL),(210,'Precompte professionnel',1,1,'TAXBEPREPRO',2,NULL,NULL),(220,'Prime d\'existence',1,1,'TAXBEPRIEXI',2,NULL,NULL),(230,'Precompte immobilier',1,1,'TAXBEPREIMMO',2,NULL,NULL),(4101,'Krankenversicherung',1,1,'TAXATKV',41,NULL,NULL),(4102,'Unfallversicherung',1,1,'TAXATUV',41,NULL,NULL),(4103,'Pensionsversicherung',1,1,'TAXATPV',41,NULL,NULL),(4104,'Arbeitslosenversicherung',1,1,'TAXATAV',41,NULL,NULL),(4105,'Insolvenzentgeltsicherungsfond',1,1,'TAXATIESG',41,NULL,NULL),(4106,'Wohnbauförderung',1,1,'TAXATWF',41,NULL,NULL),(4107,'Arbeiterkammerumlage',1,1,'TAXATAK',41,NULL,NULL),(4108,'Mitarbeitervorsorgekasse',1,1,'TAXATMVK',41,NULL,NULL),(4109,'Familienlastenausgleichsfond',1,1,'TAXATFLAF',41,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_chargesociales` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_civility` +-- + +DROP TABLE IF EXISTS `llx_c_civility`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_civility` ( + `rowid` int(11) NOT NULL, + `code` varchar(6) NOT NULL, + `label` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_civility` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_civility` +-- + +LOCK TABLES `llx_c_civility` WRITE; +/*!40000 ALTER TABLE `llx_c_civility` DISABLE KEYS */; +INSERT INTO `llx_c_civility` VALUES (1,'MME','Madame',1,NULL),(3,'MR','Monsieur',1,NULL),(5,'MLE','Mademoiselle',1,NULL),(7,'MTRE','Maître',1,NULL),(8,'DR','Docteur',1,NULL); +/*!40000 ALTER TABLE `llx_c_civility` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_country` +-- + +DROP TABLE IF EXISTS `llx_c_country`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_country` ( + `rowid` int(11) NOT NULL, + `code` varchar(2) NOT NULL, + `code_iso` varchar(3) DEFAULT NULL, + `label` varchar(50) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `favorite` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_c_country_code` (`code`), + UNIQUE KEY `idx_c_country_label` (`label`), + UNIQUE KEY `idx_c_country_code_iso` (`code_iso`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_country` +-- + +LOCK TABLES `llx_c_country` WRITE; +/*!40000 ALTER TABLE `llx_c_country` DISABLE KEYS */; +INSERT INTO `llx_c_country` VALUES (0,'',NULL,'-',1,1),(1,'FR','FRA','France',1,0),(2,'BE','BEL','Belgium',1,0),(3,'IT','ITA','Italy',1,0),(4,'ES','ESP','Spain',1,0),(5,'DE','DEU','Germany',1,0),(6,'CH','CHE','Switzerland',1,0),(7,'GB','GBR','United Kingdom',1,0),(8,'IE','IRL','Irland',1,0),(9,'CN','CHN','China',1,0),(10,'TN','TUN','Tunisia',1,0),(11,'US','USA','United States',1,0),(12,'MA','MAR','Maroc',1,0),(13,'DZ','DZA','Algeria',1,0),(14,'CA','CAN','Canada',1,0),(15,'TG','TGO','Togo',1,0),(16,'GA','GAB','Gabon',1,0),(17,'NL','NLD','Nerderland',1,0),(18,'HU','HUN','Hongrie',1,0),(19,'RU','RUS','Russia',1,0),(20,'SE','SWE','Sweden',1,0),(21,'CI','CIV','Côte d\'Ivoire',1,0),(22,'SN','SEN','Senegal',1,0),(23,'AR','ARG','Argentine',1,0),(24,'CM','CMR','Cameroun',1,0),(25,'PT','PRT','Portugal',1,0),(26,'SA','SAU','Saudi Arabia',1,0),(27,'MC','MCO','Monaco',1,0),(28,'AU','AUS','Australia',1,0),(29,'SG','SGP','Singapour',1,0),(30,'AF','AFG','Afghanistan',1,0),(31,'AX','ALA','Iles Aland',1,0),(32,'AL','ALB','Albanie',1,0),(33,'AS','ASM','Samoa américaines',1,0),(34,'AD','AND','Andorre',1,0),(35,'AO','AGO','Angola',1,0),(36,'AI','AIA','Anguilla',1,0),(37,'AQ','ATA','Antarctique',1,0),(38,'AG','ATG','Antigua-et-Barbuda',1,0),(39,'AM','ARM','Arménie',1,0),(40,'AW','ABW','Aruba',1,0),(41,'AT','AUT','Autriche',1,0),(42,'AZ','AZE','Azerbaïdjan',1,0),(43,'BS','BHS','Bahamas',1,0),(44,'BH','BHR','Bahreïn',1,0),(45,'BD','BGD','Bangladesh',1,0),(46,'BB','BRB','Barbade',1,0),(47,'BY','BLR','Biélorussie',1,0),(48,'BZ','BLZ','Belize',1,0),(49,'BJ','BEN','Bénin',1,0),(50,'BM','BMU','Bermudes',1,0),(51,'BT','BTN','Bhoutan',1,0),(52,'BO','BOL','Bolivie',1,0),(53,'BA','BIH','Bosnie-Herzégovine',1,0),(54,'BW','BWA','Botswana',1,0),(55,'BV','BVT','Ile Bouvet',1,0),(56,'BR','BRA','Brazil',1,0),(57,'IO','IOT','Territoire britannique de l\'Océan Indien',1,0),(58,'BN','BRN','Brunei',1,0),(59,'BG','BGR','Bulgarie',1,0),(60,'BF','BFA','Burkina Faso',1,0),(61,'BI','BDI','Burundi',1,0),(62,'KH','KHM','Cambodge',1,0),(63,'CV','CPV','Cap-Vert',1,0),(64,'KY','CYM','Iles Cayman',1,0),(65,'CF','CAF','République centrafricaine',1,0),(66,'TD','TCD','Tchad',1,0),(67,'CL','CHL','Chili',1,0),(68,'CX','CXR','Ile Christmas',1,0),(69,'CC','CCK','Iles des Cocos (Keeling)',1,0),(70,'CO','COL','Colombie',1,0),(71,'KM','COM','Comores',1,0),(72,'CG','COG','Congo',1,0),(73,'CD','COD','République démocratique du Congo',1,0),(74,'CK','COK','Iles Cook',1,0),(75,'CR','CRI','Costa Rica',1,0),(76,'HR','HRV','Croatie',1,0),(77,'CU','CUB','Cuba',1,0),(78,'CY','CYP','Chypre',1,0),(79,'CZ','CZE','République Tchèque',1,0),(80,'DK','DNK','Danemark',1,0),(81,'DJ','DJI','Djibouti',1,0),(82,'DM','DMA','Dominique',1,0),(83,'DO','DOM','République Dominicaine',1,0),(84,'EC','ECU','Equateur',1,0),(85,'EG','EGY','Egypte',1,0),(86,'SV','SLV','Salvador',1,0),(87,'GQ','GNQ','Guinée Equatoriale',1,0),(88,'ER','ERI','Erythrée',1,0),(89,'EE','EST','Estonia',1,0),(90,'ET','ETH','Ethiopie',1,0),(91,'FK','FLK','Iles Falkland',1,0),(92,'FO','FRO','Iles Féroé',1,0),(93,'FJ','FJI','Iles Fidji',1,0),(94,'FI','FIN','Finlande',1,0),(95,'GF','GUF','Guyane française',1,0),(96,'PF','PYF','Polynésie française',1,0),(97,'TF','ATF','Terres australes françaises',1,0),(98,'GM','GMB','Gambie',1,0),(99,'GE','GEO','Georgia',1,0),(100,'GH','GHA','Ghana',1,0),(101,'GI','GIB','Gibraltar',1,0),(102,'GR','GRC','Greece',1,0),(103,'GL','GRL','Groenland',1,0),(104,'GD','GRD','Grenade',1,0),(106,'GU','GUM','Guam',1,0),(107,'GT','GTM','Guatemala',1,0),(108,'GN','GIN','Guinea',1,0),(109,'GW','GNB','Guinea-Bissao',1,0),(111,'HT','HTI','Haiti',1,0),(112,'HM','HMD','Iles Heard et McDonald',1,0),(113,'VA','VAT','Saint-Siège (Vatican)',1,0),(114,'HN','HND','Honduras',1,0),(115,'HK','HKG','Hong Kong',1,0),(116,'IS','ISL','Islande',1,0),(117,'IN','IND','India',1,0),(118,'ID','IDN','Indonésie',1,0),(119,'IR','IRN','Iran',1,0),(120,'IQ','IRQ','Iraq',1,0),(121,'IL','ISR','Israel',1,0),(122,'JM','JAM','Jamaïque',1,0),(123,'JP','JPN','Japon',1,0),(124,'JO','JOR','Jordanie',1,0),(125,'KZ','KAZ','Kazakhstan',1,0),(126,'KE','KEN','Kenya',1,0),(127,'KI','KIR','Kiribati',1,0),(128,'KP','PRK','North Corea',1,0),(129,'KR','KOR','South Corea',1,0),(130,'KW','KWT','Koweït',1,0),(131,'KG','KGZ','Kirghizistan',1,0),(132,'LA','LAO','Laos',1,0),(133,'LV','LVA','Lettonie',1,0),(134,'LB','LBN','Liban',1,0),(135,'LS','LSO','Lesotho',1,0),(136,'LR','LBR','Liberia',1,0),(137,'LY','LBY','Libye',1,0),(138,'LI','LIE','Liechtenstein',1,0),(139,'LT','LTU','Lituanie',1,0),(140,'LU','LUX','Luxembourg',1,0),(141,'MO','MAC','Macao',1,0),(142,'MK','MKD','ex-République yougoslave de Macédoine',1,0),(143,'MG','MDG','Madagascar',1,0),(144,'MW','MWI','Malawi',1,0),(145,'MY','MYS','Malaisie',1,0),(146,'MV','MDV','Maldives',1,0),(147,'ML','MLI','Mali',1,0),(148,'MT','MLT','Malte',1,0),(149,'MH','MHL','Iles Marshall',1,0),(151,'MR','MRT','Mauritanie',1,0),(152,'MU','MUS','Maurice',1,0),(153,'YT','MYT','Mayotte',1,0),(154,'MX','MEX','Mexique',1,0),(155,'FM','FSM','Micronésie',1,0),(156,'MD','MDA','Moldavie',1,0),(157,'MN','MNG','Mongolie',1,0),(158,'MS','MSR','Monserrat',1,0),(159,'MZ','MOZ','Mozambique',1,0),(160,'MM','MMR','Birmanie (Myanmar)',1,0),(161,'NA','NAM','Namibie',1,0),(162,'NR','NRU','Nauru',1,0),(163,'NP','NPL','Népal',1,0),(164,'AN',NULL,'Antilles néerlandaises',1,0),(165,'NC','NCL','Nouvelle-Calédonie',1,0),(166,'NZ','NZL','Nouvelle-Zélande',1,0),(167,'NI','NIC','Nicaragua',1,0),(168,'NE','NER','Niger',1,0),(169,'NG','NGA','Nigeria',1,0),(170,'NU','NIU','Nioué',1,0),(171,'NF','NFK','Ile Norfolk',1,0),(172,'MP','MNP','Mariannes du Nord',1,0),(173,'NO','NOR','Norvège',1,0),(174,'OM','OMN','Oman',1,0),(175,'PK','PAK','Pakistan',1,0),(176,'PW','PLW','Palaos',1,0),(177,'PS','PSE','Territoire Palestinien Occupé',1,0),(178,'PA','PAN','Panama',1,0),(179,'PG','PNG','Papouasie-Nouvelle-Guinée',1,0),(180,'PY','PRY','Paraguay',1,0),(181,'PE','PER','Peru',1,0),(182,'PH','PHL','Philippines',1,0),(183,'PN','PCN','Iles Pitcairn',1,0),(184,'PL','POL','Pologne',1,0),(185,'PR','PRI','Porto Rico',1,0),(186,'QA','QAT','Qatar',1,0),(188,'RO','ROU','Roumanie',1,0),(189,'RW','RWA','Rwanda',1,0),(190,'SH','SHN','Sainte-Hélène',1,0),(191,'KN','KNA','Saint-Christophe-et-Niévès',1,0),(192,'LC','LCA','Sainte-Lucie',1,0),(193,'PM','SPM','Saint-Pierre-et-Miquelon',1,0),(194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1,0),(195,'WS','WSM','Samoa',1,0),(196,'SM','SMR','Saint-Marin',1,0),(197,'ST','STP','Sao Tomé-et-Principe',1,0),(198,'RS','SRB','Serbie',1,0),(199,'SC','SYC','Seychelles',1,0),(200,'SL','SLE','Sierra Leone',1,0),(201,'SK','SVK','Slovaquie',1,0),(202,'SI','SVN','Slovénie',1,0),(203,'SB','SLB','Iles Salomon',1,0),(204,'SO','SOM','Somalie',1,0),(205,'ZA','ZAF','Afrique du Sud',1,0),(206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1,0),(207,'LK','LKA','Sri Lanka',1,0),(208,'SD','SDN','Soudan',1,0),(209,'SR','SUR','Suriname',1,0),(210,'SJ','SJM','Iles Svalbard et Jan Mayen',1,0),(211,'SZ','SWZ','Swaziland',1,0),(212,'SY','SYR','Syrie',1,0),(213,'TW','TWN','Taïwan',1,0),(214,'TJ','TJK','Tadjikistan',1,0),(215,'TZ','TZA','Tanzanie',1,0),(216,'TH','THA','Thaïlande',1,0),(217,'TL','TLS','Timor Oriental',1,0),(218,'TK','TKL','Tokélaou',1,0),(219,'TO','TON','Tonga',1,0),(220,'TT','TTO','Trinité-et-Tobago',1,0),(221,'TR','TUR','Turquie',1,0),(222,'TM','TKM','Turkménistan',1,0),(223,'TC','TCA','Iles Turks-et-Caicos',1,0),(224,'TV','TUV','Tuvalu',1,0),(225,'UG','UGA','Ouganda',1,0),(226,'UA','UKR','Ukraine',1,0),(227,'xx','ARE','Émirats arabes unishh',1,0),(228,'UM','UMI','Iles mineures éloignées des États-Unis',1,0),(229,'UY','URY','Uruguay',1,0),(230,'UZ','UZB','Ouzbékistan',1,0),(231,'VU','VUT','Vanuatu',1,0),(232,'VE','VEN','Vénézuela',1,0),(233,'VN','VNM','Viêt Nam',1,0),(234,'VG','VGB','Iles Vierges britanniques',1,0),(235,'VI','VIR','Iles Vierges américaines',1,0),(236,'WF','WLF','Wallis-et-Futuna',1,0),(237,'EH','ESH','Sahara occidental',1,0),(238,'YE','YEM','Yémen',1,0),(239,'ZM','ZMB','Zambie',1,0),(240,'ZW','ZWE','Zimbabwe',1,0),(241,'GG','GGY','Guernesey',1,0),(242,'IM','IMN','Ile de Man',1,0),(243,'JE','JEY','Jersey',1,0),(244,'ME','MNE','Monténégro',1,0),(245,'BL','BLM','Saint-Barthélemy',1,0),(246,'MF','MAF','Saint-Martin',1,0),(247,'hh',NULL,'hhh',1,0); +/*!40000 ALTER TABLE `llx_c_country` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_currencies` +-- + +DROP TABLE IF EXISTS `llx_c_currencies`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_currencies` ( + `code_iso` varchar(3) NOT NULL, + `label` varchar(64) NOT NULL, + `unicode` varchar(32) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`code_iso`), + UNIQUE KEY `uk_c_currencies_code_iso` (`code_iso`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_currencies` +-- + +LOCK TABLES `llx_c_currencies` WRITE; +/*!40000 ALTER TABLE `llx_c_currencies` DISABLE KEYS */; +INSERT INTO `llx_c_currencies` VALUES ('AED','United Arab Emirates Dirham',NULL,1),('AFN','Afghanistan Afghani','[1547]',1),('ALL','Albania Leklll','[76,101,107]',1),('ANG','Netherlands Antilles Guilder','[402]',1),('ARP','Pesos argentins',NULL,0),('ARS','Argentino Peso','[36]',1),('ATS','Shiliing autrichiens',NULL,0),('AUD','Australia Dollar','[36]',1),('AWG','Aruba Guilder','[402]',1),('AZN','Azerbaijan New Manat','[1084,1072,1085]',1),('BAM','Bosnia and Herzegovina Convertible Marka','[75,77]',1),('BBD','Barbados Dollar','[36]',1),('BEF','Francs belges',NULL,0),('BGN','Bulgaria Lev','[1083,1074]',1),('BMD','Bermuda Dollar','[36]',1),('BND','Brunei Darussalam Dollar','[36]',1),('BOB','Bolivia Boliviano','[36,98]',1),('BRL','Brazil Real','[82,36]',1),('BSD','Bahamas Dollar','[36]',1),('BWP','Botswana Pula','[80]',1),('BYR','Belarus Ruble','[112,46]',1),('BZD','Belize Dollar','[66,90,36]',1),('CAD','Canada Dollar','[36]',1),('CHF','Switzerland Franc','[67,72,70]',1),('CLP','Chile Peso','[36]',1),('CNY','China Yuan Renminbi','[165]',1),('COP','Colombia Peso','[36]',1),('CRC','Costa Rica Colon','[8353]',1),('CUP','Cuba Peso','[8369]',1),('CZK','Czech Republic Koruna','[75,269]',1),('DEM','Deutsch mark',NULL,0),('DKK','Denmark Krone','[107,114]',1),('DOP','Dominican Republic Peso','[82,68,36]',1),('DZD','Algeria Dinar',NULL,1),('EEK','Estonia Kroon','[107,114]',1),('EGP','Egypt Pound','[163]',1),('ESP','Pesete',NULL,0),('EUR','Euro Member Countries','[8364]',1),('FIM','Mark finlandais',NULL,0),('FJD','Fiji Dollar','[36]',1),('FKP','Falkland Islands (Malvinas) Pound','[163]',1),('FRF','Francs francais',NULL,0),('GBP','United Kingdom Pound','[163]',1),('GGP','Guernsey Pound','[163]',1),('GHC','Ghana Cedis','[162]',1),('GIP','Gibraltar Pound','[163]',1),('GRD','Drachme (grece)',NULL,0),('GTQ','Guatemala Quetzal','[81]',1),('GYD','Guyana Dollar','[36]',1),('hhh','ddd','[]',1),('HKD','Hong Kong Dollar','[36]',1),('HNL','Honduras Lempira','[76]',1),('HRK','Croatia Kuna','[107,110]',1),('HUF','Hungary Forint','[70,116]',1),('IDR','Indonesia Rupiah','[82,112]',1),('IEP','Livres irlandaises',NULL,0),('ILS','Israel Shekel','[8362]',1),('IMP','Isle of Man Pound','[163]',1),('INR','India Rupee',NULL,1),('IRR','Iran Rial','[65020]',1),('ISK','Iceland Krona','[107,114]',1),('ITL','Lires',NULL,0),('JEP','Jersey Pound','[163]',1),('JMD','Jamaica Dollar','[74,36]',1),('JPY','Japan Yen','[165]',1),('KES','Kenya Shilling',NULL,1),('KGS','Kyrgyzstan Som','[1083,1074]',1),('KHR','Cambodia Riel','[6107]',1),('KPW','Korea (North) Won','[8361]',1),('KRW','Korea (South) Won','[8361]',1),('KYD','Cayman Islands Dollar','[36]',1),('KZT','Kazakhstan Tenge','[1083,1074]',1),('LAK','Laos Kip','[8365]',1),('LBP','Lebanon Pound','[163]',1),('LKR','Sri Lanka Rupee','[8360]',1),('LRD','Liberia Dollar','[36]',1),('LTL','Lithuania Litas','[76,116]',1),('LUF','Francs luxembourgeois',NULL,0),('LVL','Latvia Lat','[76,115]',1),('MAD','Morocco Dirham',NULL,1),('MKD','Macedonia Denar','[1076,1077,1085]',1),('MNT','Mongolia Tughrik','[8366]',1),('MRO','Mauritania Ouguiya',NULL,1),('MUR','Mauritius Rupee','[8360]',1),('MXN','Mexico Peso','[36]',1),('MXP','Pesos Mexicans',NULL,0),('MYR','Malaysia Ringgit','[82,77]',1),('MZN','Mozambique Metical','[77,84]',1),('NAD','Namibia Dollar','[36]',1),('NGN','Nigeria Naira','[8358]',1),('NIO','Nicaragua Cordoba','[67,36]',1),('NLG','Florins',NULL,0),('NOK','Norway Krone','[107,114]',1),('NPR','Nepal Rupee','[8360]',1),('NZD','New Zealand Dollar','[36]',1),('OMR','Oman Rial','[65020]',1),('PAB','Panama Balboa','[66,47,46]',1),('PEN','Peru Nuevo Sol','[83,47,46]',1),('PHP','Philippines Peso','[8369]',1),('PKR','Pakistan Rupee','[8360]',1),('PLN','Poland Zloty','[122,322]',1),('PTE','Escudos',NULL,0),('PYG','Paraguay Guarani','[71,115]',1),('QAR','Qatar Riyal','[65020]',1),('RON','Romania New Leu','[108,101,105]',1),('RSD','Serbia Dinar','[1044,1080,1085,46]',1),('RUB','Russia Ruble','[1088,1091,1073]',1),('SAR','Saudi Arabia Riyal','[65020]',1),('SBD','Solomon Islands Dollar','[36]',1),('SCR','Seychelles Rupee','[8360]',1),('SEK','Sweden Krona','[107,114]',1),('SGD','Singapore Dollar','[36]',1),('SHP','Saint Helena Pound','[163]',1),('SKK','Couronnes slovaques',NULL,0),('SOS','Somalia Shilling','[83]',1),('SRD','Suriname Dollar','[36]',1),('SUR','Rouble',NULL,0),('SVC','El Salvador Colon','[36]',1),('SYP','Syria Pound','[163]',1),('THB','Thailand Baht','[3647]',1),('TND','Tunisia Dinar',NULL,1),('TRL','Turkey Lira','[84,76]',1),('TRY','Turkey Lira','[8356]',1),('TTD','Trinidad and Tobago Dollar','[84,84,36]',1),('TVD','Tuvalu Dollar','[36]',1),('TWD','Taiwan New Dollar','[78,84,36]',1),('UAH','Ukraine Hryvna','[8372]',1),('USD','United States Dollar','[36]',1),('UYU','Uruguay Peso','[36,85]',1),('UZS','Uzbekistan Som','[1083,1074]',1),('VEF','Venezuela Bolivar Fuerte','[66,115]',1),('VND','Viet Nam Dong','[8363]',1),('XAF','Communaute Financiere Africaine (BEAC) CFA Franc',NULL,1),('XCD','East Caribbean Dollar','[36]',1),('XEU','Ecus',NULL,0),('XOF','Communaute Financiere Africaine (BCEAO) Franc',NULL,1),('XPF','Franc pacifique (XPF)',NULL,1),('YER','Yemen Rial','[65020]',1),('ZAR','South Africa Rand','[82]',1),('ZWD','Zimbabwe Dollar','[90,36]',1); +/*!40000 ALTER TABLE `llx_c_currencies` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_departements` +-- + +DROP TABLE IF EXISTS `llx_c_departements`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_departements` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code_departement` varchar(6) NOT NULL, + `fk_region` int(11) DEFAULT NULL, + `cheflieu` varchar(50) DEFAULT NULL, + `tncc` int(11) DEFAULT NULL, + `ncc` varchar(50) DEFAULT NULL, + `nom` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_departements` (`code_departement`,`fk_region`), + KEY `idx_departements_fk_region` (`fk_region`), + CONSTRAINT `fk_departements_code_region` FOREIGN KEY (`fk_region`) REFERENCES `llx_c_regions` (`code_region`), + CONSTRAINT `fk_departements_fk_region` FOREIGN KEY (`fk_region`) REFERENCES `llx_c_regions` (`code_region`) +) ENGINE=InnoDB AUTO_INCREMENT=2066 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_departements` +-- + +LOCK TABLES `llx_c_departements` WRITE; +/*!40000 ALTER TABLE `llx_c_departements` DISABLE KEYS */; +INSERT INTO `llx_c_departements` VALUES (1,'0',0,'0',0,'-','-',1),(2,'01',82,'01053',5,'AIN','Ain',1),(3,'02',22,'02408',5,'AISNE','Aisne',1),(4,'03',83,'03190',5,'ALLIER','Allier',1),(5,'04',93,'04070',4,'ALPES-DE-HAUTE-PROVENCE','Alpes-de-Haute-Provence',1),(6,'05',93,'05061',4,'HAUTES-ALPES','Hautes-Alpes',1),(7,'06',93,'06088',4,'ALPES-MARITIMES','Alpes-Maritimes',1),(8,'07',82,'07186',5,'ARDECHE','Ardèche',1),(9,'08',21,'08105',4,'ARDENNES','Ardennes',1),(10,'09',73,'09122',5,'ARIEGE','Ariège',1),(11,'10',21,'10387',5,'AUBE','Aube',1),(12,'11',91,'11069',5,'AUDE','Aude',1),(13,'12',73,'12202',5,'AVEYRON','Aveyron',1),(14,'13',93,'13055',4,'BOUCHES-DU-RHONE','Bouches-du-Rhône',1),(15,'14',25,'14118',2,'CALVADOS','Calvados',1),(16,'15',83,'15014',2,'CANTAL','Cantal',1),(17,'16',54,'16015',3,'CHARENTE','Charente',1),(18,'17',54,'17300',3,'CHARENTE-MARITIME','Charente-Maritime',1),(19,'18',24,'18033',2,'CHER','Cher',1),(20,'19',74,'19272',3,'CORREZE','Corrèze',1),(21,'2A',94,'2A004',3,'CORSE-DU-SUD','Corse-du-Sud',1),(22,'2B',94,'2B033',3,'HAUTE-CORSE','Haute-Corse',1),(23,'21',26,'21231',3,'COTE-D\'OR','Côte-d\'Or',1),(24,'22',53,'22278',4,'COTES-D\'ARMOR','Côtes-d\'Armor',1),(25,'23',74,'23096',3,'CREUSE','Creuse',1),(26,'24',72,'24322',3,'DORDOGNE','Dordogne',1),(27,'25',43,'25056',2,'DOUBS','Doubs',1),(28,'26',82,'26362',3,'DROME','Drôme',1),(29,'27',23,'27229',5,'EURE','Eure',1),(30,'28',24,'28085',1,'EURE-ET-LOIR','Eure-et-Loir',1),(31,'29',53,'29232',2,'FINISTERE','Finistère',1),(32,'30',91,'30189',2,'GARD','Gard',1),(33,'31',73,'31555',3,'HAUTE-GARONNE','Haute-Garonne',1),(34,'32',73,'32013',2,'GERS','Gers',1),(35,'33',72,'33063',3,'GIRONDE','Gironde',1),(36,'34',91,'34172',5,'HERAULT','Hérault',1),(37,'35',53,'35238',1,'ILLE-ET-VILAINE','Ille-et-Vilaine',1),(38,'36',24,'36044',5,'INDRE','Indre',1),(39,'37',24,'37261',1,'INDRE-ET-LOIRE','Indre-et-Loire',1),(40,'38',82,'38185',5,'ISERE','Isère',1),(41,'39',43,'39300',2,'JURA','Jura',1),(42,'40',72,'40192',4,'LANDES','Landes',1),(43,'41',24,'41018',0,'LOIR-ET-CHER','Loir-et-Cher',1),(44,'42',82,'42218',3,'LOIRE','Loire',1),(45,'43',83,'43157',3,'HAUTE-LOIRE','Haute-Loire',1),(46,'44',52,'44109',3,'LOIRE-ATLANTIQUE','Loire-Atlantique',1),(47,'45',24,'45234',2,'LOIRET','Loiret',1),(48,'46',73,'46042',2,'LOT','Lot',1),(49,'47',72,'47001',0,'LOT-ET-GARONNE','Lot-et-Garonne',1),(50,'48',91,'48095',3,'LOZERE','Lozère',1),(51,'49',52,'49007',0,'MAINE-ET-LOIRE','Maine-et-Loire',1),(52,'50',25,'50502',3,'MANCHE','Manche',1),(53,'51',21,'51108',3,'MARNE','Marne',1),(54,'52',21,'52121',3,'HAUTE-MARNE','Haute-Marne',1),(55,'53',52,'53130',3,'MAYENNE','Mayenne',1),(56,'54',41,'54395',0,'MEURTHE-ET-MOSELLE','Meurthe-et-Moselle',1),(57,'55',41,'55029',3,'MEUSE','Meuse',1),(58,'56',53,'56260',2,'MORBIHAN','Morbihan',1),(59,'57',41,'57463',3,'MOSELLE','Moselle',1),(60,'58',26,'58194',3,'NIEVRE','Nièvre',1),(61,'59',31,'59350',2,'NORD','Nord',1),(62,'60',22,'60057',5,'OISE','Oise',1),(63,'61',25,'61001',5,'ORNE','Orne',1),(64,'62',31,'62041',2,'PAS-DE-CALAIS','Pas-de-Calais',1),(65,'63',83,'63113',2,'PUY-DE-DOME','Puy-de-Dôme',1),(66,'64',72,'64445',4,'PYRENEES-ATLANTIQUES','Pyrénées-Atlantiques',1),(67,'65',73,'65440',4,'HAUTES-PYRENEES','Hautes-Pyrénées',1),(68,'66',91,'66136',4,'PYRENEES-ORIENTALES','Pyrénées-Orientales',1),(69,'67',42,'67482',2,'BAS-RHIN','Bas-Rhin',1),(70,'68',42,'68066',2,'HAUT-RHIN','Haut-Rhin',1),(71,'69',82,'69123',2,'RHONE','Rhône',1),(72,'70',43,'70550',3,'HAUTE-SAONE','Haute-Saône',1),(73,'71',26,'71270',0,'SAONE-ET-LOIRE','Saône-et-Loire',1),(74,'72',52,'72181',3,'SARTHE','Sarthe',1),(75,'73',82,'73065',3,'SAVOIE','Savoie',1),(76,'74',82,'74010',3,'HAUTE-SAVOIE','Haute-Savoie',1),(77,'75',11,'75056',0,'PARIS','Paris',1),(78,'76',23,'76540',3,'SEINE-MARITIME','Seine-Maritime',1),(79,'77',11,'77288',0,'SEINE-ET-MARNE','Seine-et-Marne',1),(80,'78',11,'78646',4,'YVELINES','Yvelines',1),(81,'79',54,'79191',4,'DEUX-SEVRES','Deux-Sèvres',1),(82,'80',22,'80021',3,'SOMME','Somme',1),(83,'81',73,'81004',2,'TARN','Tarn',1),(84,'82',73,'82121',0,'TARN-ET-GARONNE','Tarn-et-Garonne',1),(85,'83',93,'83137',2,'VAR','Var',1),(86,'84',93,'84007',0,'VAUCLUSE','Vaucluse',1),(87,'85',52,'85191',3,'VENDEE','Vendée',1),(88,'86',54,'86194',3,'VIENNE','Vienne',1),(89,'87',74,'87085',3,'HAUTE-VIENNE','Haute-Vienne',1),(90,'88',41,'88160',4,'VOSGES','Vosges',1),(91,'89',26,'89024',5,'YONNE','Yonne',1),(92,'90',43,'90010',0,'TERRITOIRE DE BELFORT','Territoire de Belfort',1),(93,'91',11,'91228',5,'ESSONNE','Essonne',1),(94,'92',11,'92050',4,'HAUTS-DE-SEINE','Hauts-de-Seine',1),(95,'93',11,'93008',3,'SEINE-SAINT-DENIS','Seine-Saint-Denis',1),(96,'94',11,'94028',2,'VAL-DE-MARNE','Val-de-Marne',1),(97,'95',11,'95500',2,'VAL-D\'OISE','Val-d\'Oise',1),(98,'971',1,'97105',3,'GUADELOUPE','Guadeloupe',1),(99,'972',2,'97209',3,'MARTINIQUE','Martinique',1),(100,'973',3,'97302',3,'GUYANE','Guyane',1),(101,'974',4,'97411',3,'REUNION','Réunion',1),(102,'01',201,'',1,'ANVERS','Anvers',1),(103,'02',203,'',3,'BRUXELLES-CAPITALE','Bruxelles-Capitale',1),(104,'03',202,'',2,'BRABANT-WALLON','Brabant-Wallon',1),(105,'04',201,'',1,'BRABANT-FLAMAND','Brabant-Flamand',1),(106,'05',201,'',1,'FLANDRE-OCCIDENTALE','Flandre-Occidentale',1),(107,'06',201,'',1,'FLANDRE-ORIENTALE','Flandre-Orientale',1),(108,'07',202,'',2,'HAINAUT','Hainaut',1),(109,'08',201,'',2,'LIEGE','Liège',1),(110,'09',202,'',1,'LIMBOURG','Limbourg',1),(111,'10',202,'',2,'LUXEMBOURG','Luxembourg',1),(112,'11',201,'',2,'NAMUR','Namur',1),(113,'NSW',2801,'',1,'','New South Wales',1),(114,'VIC',2801,'',1,'','Victoria',1),(115,'QLD',2801,'',1,'','Queensland',1),(116,'SA',2801,'',1,'','South Australia',1),(117,'ACT',2801,'',1,'','Australia Capital Territory',1),(118,'TAS',2801,'',1,'','Tasmania',1),(119,'WA',2801,'',1,'','Western Australia',1),(120,'NT',2801,'',1,'','Northern Territory',1),(121,'VI',419,'',19,'ALAVA','Álava',1),(122,'AB',404,'',4,'ALBACETE','Albacete',1),(123,'A',411,'',11,'ALICANTE','Alicante',1),(124,'AL',401,'',1,'ALMERIA','Almería',1),(125,'AV',403,'',3,'AVILA','Avila',1),(126,'BA',412,'',12,'BADAJOZ','Badajoz',1),(127,'PM',414,'',14,'ISLAS BALEARES','Islas Baleares',1),(128,'B',406,'',6,'BARCELONA','Barcelona',1),(129,'BU',403,'',8,'BURGOS','Burgos',1),(130,'CC',412,'',12,'CACERES','Cáceres',1),(131,'CA',401,'',1,'CADIz','Cádiz',1),(132,'CS',411,'',11,'CASTELLON','Castellón',1),(133,'CR',404,'',4,'CIUDAD REAL','Ciudad Real',1),(134,'CO',401,'',1,'CORDOBA','Córdoba',1),(135,'C',413,'',13,'LA CORUÑA','La Coruña',1),(136,'CU',404,'',4,'CUENCA','Cuenca',1),(137,'GI',406,'',6,'GERONA','Gerona',1),(138,'GR',401,'',1,'GRANADA','Granada',1),(139,'GU',404,'',4,'GUADALAJARA','Guadalajara',1),(140,'SS',419,'',19,'GUIPUZCOA','Guipúzcoa',1),(141,'H',401,'',1,'HUELVA','Huelva',1),(142,'HU',402,'',2,'HUESCA','Huesca',1),(143,'J',401,'',1,'JAEN','Jaén',1),(144,'LE',403,'',3,'LEON','León',1),(145,'L',406,'',6,'LERIDA','Lérida',1),(146,'LO',415,'',15,'LA RIOJA','La Rioja',1),(147,'LU',413,'',13,'LUGO','Lugo',1),(148,'M',416,'',16,'MADRID','Madrid',1),(149,'MA',401,'',1,'MALAGA','Málaga',1),(150,'MU',417,'',17,'MURCIA','Murcia',1),(151,'NA',408,'',8,'NAVARRA','Navarra',1),(152,'OR',413,'',13,'ORENSE','Orense',1),(153,'O',418,'',18,'ASTURIAS','Asturias',1),(154,'P',403,'',3,'PALENCIA','Palencia',1),(155,'GC',405,'',5,'LAS PALMAS','Las Palmas',1),(156,'PO',413,'',13,'PONTEVEDRA','Pontevedra',1),(157,'SA',403,'',3,'SALAMANCA','Salamanca',1),(158,'TF',405,'',5,'STA. CRUZ DE TENERIFE','Sta. Cruz de Tenerife',1),(159,'S',410,'',10,'CANTABRIA','Cantabria',1),(160,'SG',403,'',3,'SEGOVIA','Segovia',1),(161,'SE',401,'',1,'SEVILLA','Sevilla',1),(162,'SO',403,'',3,'SORIA','Soria',1),(163,'T',406,'',6,'TARRAGONA','Tarragona',1),(164,'TE',402,'',2,'TERUEL','Teruel',1),(165,'TO',404,'',5,'TOLEDO','Toledo',1),(166,'V',411,'',11,'VALENCIA','Valencia',1),(167,'VA',403,'',3,'VALLADOLID','Valladolid',1),(168,'BI',419,'',19,'VIZCAYA','Vizcaya',1),(169,'ZA',403,'',3,'ZAMORA','Zamora',1),(170,'Z',402,'',1,'ZARAGOZA','Zaragoza',1),(171,'CE',407,'',7,'CEUTA','Ceuta',1),(172,'ML',409,'',9,'MELILLA','Melilla',1),(174,'AG',601,NULL,NULL,'ARGOVIE','Argovie',1),(175,'AI',601,NULL,NULL,'APPENZELL RHODES INTERIEURES','Appenzell Rhodes intérieures',1),(176,'AR',601,NULL,NULL,'APPENZELL RHODES EXTERIEURES','Appenzell Rhodes extérieures',1),(177,'BE',601,NULL,NULL,'BERNE','Berne',1),(178,'BL',601,NULL,NULL,'BALE CAMPAGNE','Bâle Campagne',1),(179,'BS',601,NULL,NULL,'BALE VILLE','Bâle Ville',1),(180,'FR',601,NULL,NULL,'FRIBOURG','Fribourg',1),(181,'GE',601,NULL,NULL,'GENEVE','Genève',1),(182,'GL',601,NULL,NULL,'GLARIS','Glaris',1),(183,'GR',601,NULL,NULL,'GRISONS','Grisons',1),(184,'JU',601,NULL,NULL,'JURA','Jura',1),(185,'LU',601,NULL,NULL,'LUCERNE','Lucerne',1),(186,'NE',601,NULL,NULL,'NEUCHATEL','Neuchâtel',1),(187,'NW',601,NULL,NULL,'NIDWALD','Nidwald',1),(188,'OW',601,NULL,NULL,'OBWALD','Obwald',1),(189,'SG',601,NULL,NULL,'SAINT-GALL','Saint-Gall',1),(190,'SH',601,NULL,NULL,'SCHAFFHOUSE','Schaffhouse',1),(191,'SO',601,NULL,NULL,'SOLEURE','Soleure',1),(192,'SZ',601,NULL,NULL,'SCHWYZ','Schwyz',1),(193,'TG',601,NULL,NULL,'THURGOVIE','Thurgovie',1),(194,'TI',601,NULL,NULL,'TESSIN','Tessin',1),(195,'UR',601,NULL,NULL,'URI','Uri',1),(196,'VD',601,NULL,NULL,'VAUD','Vaud',1),(197,'VS',601,NULL,NULL,'VALAIS','Valais',1),(198,'ZG',601,NULL,NULL,'ZUG','Zug',1),(199,'ZH',601,NULL,NULL,'ZURICH','Zürich',1),(200,'AL',1101,'',0,'ALABAMA','Alabama',1),(201,'AK',1101,'',0,'ALASKA','Alaska',1),(202,'AZ',1101,'',0,'ARIZONA','Arizona',1),(203,'AR',1101,'',0,'ARKANSAS','Arkansas',1),(204,'CA',1101,'',0,'CALIFORNIA','California',1),(205,'CO',1101,'',0,'COLORADO','Colorado',1),(206,'CT',1101,'',0,'CONNECTICUT','Connecticut',1),(207,'DE',1101,'',0,'DELAWARE','Delaware',1),(208,'FL',1101,'',0,'FLORIDA','Florida',1),(209,'GA',1101,'',0,'GEORGIA','Georgia',1),(210,'HI',1101,'',0,'HAWAII','Hawaii',1),(211,'ID',1101,'',0,'IDAHO','Idaho',1),(212,'IL',1101,'',0,'ILLINOIS','Illinois',1),(213,'IN',1101,'',0,'INDIANA','Indiana',1),(214,'IA',1101,'',0,'IOWA','Iowa',1),(215,'KS',1101,'',0,'KANSAS','Kansas',1),(216,'KY',1101,'',0,'KENTUCKY','Kentucky',1),(217,'LA',1101,'',0,'LOUISIANA','Louisiana',1),(218,'ME',1101,'',0,'MAINE','Maine',1),(219,'MD',1101,'',0,'MARYLAND','Maryland',1),(220,'MA',1101,'',0,'MASSACHUSSETTS','Massachusetts',1),(221,'MI',1101,'',0,'MICHIGAN','Michigan',1),(222,'MN',1101,'',0,'MINNESOTA','Minnesota',1),(223,'MS',1101,'',0,'MISSISSIPPI','Mississippi',1),(224,'MO',1101,'',0,'MISSOURI','Missouri',1),(225,'MT',1101,'',0,'MONTANA','Montana',1),(226,'NE',1101,'',0,'NEBRASKA','Nebraska',1),(227,'NV',1101,'',0,'NEVADA','Nevada',1),(228,'NH',1101,'',0,'NEW HAMPSHIRE','New Hampshire',1),(229,'NJ',1101,'',0,'NEW JERSEY','New Jersey',1),(230,'NM',1101,'',0,'NEW MEXICO','New Mexico',1),(231,'NY',1101,'',0,'NEW YORK','New York',1),(232,'NC',1101,'',0,'NORTH CAROLINA','North Carolina',1),(233,'ND',1101,'',0,'NORTH DAKOTA','North Dakota',1),(234,'OH',1101,'',0,'OHIO','Ohio',1),(235,'OK',1101,'',0,'OKLAHOMA','Oklahoma',1),(236,'OR',1101,'',0,'OREGON','Oregon',1),(237,'PA',1101,'',0,'PENNSYLVANIA','Pennsylvania',1),(238,'RI',1101,'',0,'RHODE ISLAND','Rhode Island',1),(239,'SC',1101,'',0,'SOUTH CAROLINA','South Carolina',1),(240,'SD',1101,'',0,'SOUTH DAKOTA','South Dakota',1),(241,'TN',1101,'',0,'TENNESSEE','Tennessee',1),(242,'TX',1101,'',0,'TEXAS','Texas',1),(243,'UT',1101,'',0,'UTAH','Utah',1),(244,'VT',1101,'',0,'VERMONT','Vermont',1),(245,'VA',1101,'',0,'VIRGINIA','Virginia',1),(246,'WA',1101,'',0,'WASHINGTON','Washington',1),(247,'WV',1101,'',0,'WEST VIRGINIA','West Virginia',1),(248,'WI',1101,'',0,'WISCONSIN','Wisconsin',1),(249,'WY',1101,'',0,'WYOMING','Wyoming',1),(250,'SS',8601,NULL,NULL,NULL,'San Salvador',1),(251,'SA',8603,NULL,NULL,NULL,'Santa Ana',1),(252,'AH',8603,NULL,NULL,NULL,'Ahuachapan',1),(253,'SO',8603,NULL,NULL,NULL,'Sonsonate',1),(254,'US',8602,NULL,NULL,NULL,'Usulutan',1),(255,'SM',8602,NULL,NULL,NULL,'San Miguel',1),(256,'MO',8602,NULL,NULL,NULL,'Morazan',1),(257,'LU',8602,NULL,NULL,NULL,'La Union',1),(258,'LL',8601,NULL,NULL,NULL,'La Libertad',1),(259,'CH',8601,NULL,NULL,NULL,'Chalatenango',1),(260,'CA',8601,NULL,NULL,NULL,'Cabañas',1),(261,'LP',8601,NULL,NULL,NULL,'La Paz',1),(262,'SV',8601,NULL,NULL,NULL,'San Vicente',1),(263,'CU',8601,NULL,NULL,NULL,'Cuscatlan',1),(264,'2301',2301,'',0,'CATAMARCA','Catamarca',1),(265,'2302',2301,'',0,'JUJUY','Jujuy',1),(266,'2303',2301,'',0,'TUCAMAN','Tucamán',1),(267,'2304',2301,'',0,'SANTIAGO DEL ESTERO','Santiago del Estero',1),(268,'2305',2301,'',0,'SALTA','Salta',1),(269,'2306',2302,'',0,'CHACO','Chaco',1),(270,'2307',2302,'',0,'CORRIENTES','Corrientes',1),(271,'2308',2302,'',0,'ENTRE RIOS','Entre Ríos',1),(272,'2309',2302,'',0,'FORMOSA','Formosa',1),(273,'2310',2302,'',0,'SANTA FE','Santa Fe',1),(274,'2311',2303,'',0,'LA RIOJA','La Rioja',1),(275,'2312',2303,'',0,'MENDOZA','Mendoza',1),(276,'2313',2303,'',0,'SAN JUAN','San Juan',1),(277,'2314',2303,'',0,'SAN LUIS','San Luis',1),(278,'2315',2304,'',0,'CORDOBA','Córdoba',1),(279,'2316',2304,'',0,'BUENOS AIRES','Buenos Aires',1),(280,'2317',2304,'',0,'CABA','Caba',1),(281,'2318',2305,'',0,'LA PAMPA','La Pampa',1),(282,'2319',2305,'',0,'NEUQUEN','Neuquén',1),(283,'2320',2305,'',0,'RIO NEGRO','Río Negro',1),(284,'2321',2305,'',0,'CHUBUT','Chubut',1),(285,'2322',2305,'',0,'SANTA CRUZ','Santa Cruz',1),(286,'2323',2305,'',0,'TIERRA DEL FUEGO','Tierra del Fuego',1),(287,'2324',2305,'',0,'ISLAS MALVINAS','Islas Malvinas',1),(288,'2325',2305,'',0,'ANTARTIDA','Antártida',1),(289,'AN',11701,NULL,0,'AN','Andaman & Nicobar',1),(290,'AP',11701,NULL,0,'AP','Andhra Pradesh',1),(291,'AR',11701,NULL,0,'AR','Arunachal Pradesh',1),(292,'AS',11701,NULL,0,'AS','Assam',1),(293,'BR',11701,NULL,0,'BR','Bihar',1),(294,'CG',11701,NULL,0,'CG','Chattisgarh',1),(295,'CH',11701,NULL,0,'CH','Chandigarh',1),(296,'DD',11701,NULL,0,'DD','Daman & Diu',1),(297,'DL',11701,NULL,0,'DL','Delhi',1),(298,'DN',11701,NULL,0,'DN','Dadra and Nagar Haveli',1),(299,'GA',11701,NULL,0,'GA','Goa',1),(300,'GJ',11701,NULL,0,'GJ','Gujarat',1),(301,'HP',11701,NULL,0,'HP','Himachal Pradesh',1),(302,'HR',11701,NULL,0,'HR','Haryana',1),(303,'JH',11701,NULL,0,'JH','Jharkhand',1),(304,'JK',11701,NULL,0,'JK','Jammu & Kashmir',1),(305,'KA',11701,NULL,0,'KA','Karnataka',1),(306,'KL',11701,NULL,0,'KL','Kerala',1),(307,'LD',11701,NULL,0,'LD','Lakshadweep',1),(308,'MH',11701,NULL,0,'MH','Maharashtra',1),(309,'ML',11701,NULL,0,'ML','Meghalaya',1),(310,'MN',11701,NULL,0,'MN','Manipur',1),(311,'MP',11701,NULL,0,'MP','Madhya Pradesh',1),(312,'MZ',11701,NULL,0,'MZ','Mizoram',1),(313,'NL',11701,NULL,0,'NL','Nagaland',1),(314,'OR',11701,NULL,0,'OR','Orissa',1),(315,'PB',11701,NULL,0,'PB','Punjab',1),(316,'PY',11701,NULL,0,'PY','Puducherry',1),(317,'RJ',11701,NULL,0,'RJ','Rajasthan',1),(318,'SK',11701,NULL,0,'SK','Sikkim',1),(319,'TN',11701,NULL,0,'TN','Tamil Nadu',1),(320,'TR',11701,NULL,0,'TR','Tripura',1),(321,'UL',11701,NULL,0,'UL','Uttarakhand',1),(322,'UP',11701,NULL,0,'UP','Uttar Pradesh',1),(323,'WB',11701,NULL,0,'WB','West Bengal',1),(374,'151',6715,'',0,'151','Arica',1),(375,'152',6715,'',0,'152','Parinacota',1),(376,'011',6701,'',0,'011','Iquique',1),(377,'014',6701,'',0,'014','Tamarugal',1),(378,'021',6702,'',0,'021','Antofagasa',1),(379,'022',6702,'',0,'022','El Loa',1),(380,'023',6702,'',0,'023','Tocopilla',1),(381,'031',6703,'',0,'031','Copiapó',1),(382,'032',6703,'',0,'032','Chañaral',1),(383,'033',6703,'',0,'033','Huasco',1),(384,'041',6704,'',0,'041','Elqui',1),(385,'042',6704,'',0,'042','Choapa',1),(386,'043',6704,'',0,'043','Limarí',1),(387,'051',6705,'',0,'051','Valparaíso',1),(388,'052',6705,'',0,'052','Isla de Pascua',1),(389,'053',6705,'',0,'053','Los Andes',1),(390,'054',6705,'',0,'054','Petorca',1),(391,'055',6705,'',0,'055','Quillota',1),(392,'056',6705,'',0,'056','San Antonio',1),(393,'057',6705,'',0,'057','San Felipe de Aconcagua',1),(394,'058',6705,'',0,'058','Marga Marga',1),(395,'061',6706,'',0,'061','Cachapoal',1),(396,'062',6706,'',0,'062','Cardenal Caro',1),(397,'063',6706,'',0,'063','Colchagua',1),(398,'071',6707,'',0,'071','Talca',1),(399,'072',6707,'',0,'072','Cauquenes',1),(400,'073',6707,'',0,'073','Curicó',1),(401,'074',6707,'',0,'074','Linares',1),(402,'081',6708,'',0,'081','Concepción',1),(403,'082',6708,'',0,'082','Arauco',1),(404,'083',6708,'',0,'083','Biobío',1),(405,'084',6708,'',0,'084','Ñuble',1),(406,'091',6709,'',0,'091','Cautín',1),(407,'092',6709,'',0,'092','Malleco',1),(408,'141',6714,'',0,'141','Valdivia',1),(409,'142',6714,'',0,'142','Ranco',1),(410,'101',6710,'',0,'101','Llanquihue',1),(411,'102',6710,'',0,'102','Chiloé',1),(412,'103',6710,'',0,'103','Osorno',1),(413,'104',6710,'',0,'104','Palena',1),(414,'111',6711,'',0,'111','Coihaique',1),(415,'112',6711,'',0,'112','Aisén',1),(416,'113',6711,'',0,'113','Capitán Prat',1),(417,'114',6711,'',0,'114','General Carrera',1),(418,'121',6712,'',0,'121','Magallanes',1),(419,'122',6712,'',0,'122','Antártica Chilena',1),(420,'123',6712,'',0,'123','Tierra del Fuego',1),(421,'124',6712,'',0,'124','Última Esperanza',1),(422,'131',6713,'',0,'131','Santiago',1),(423,'132',6713,'',0,'132','Cordillera',1),(424,'133',6713,'',0,'133','Chacabuco',1),(425,'134',6713,'',0,'134','Maipo',1),(426,'135',6713,'',0,'135','Melipilla',1),(427,'136',6713,'',0,'136','Talagante',1),(428,'DIF',15401,'',0,'DIF','Distrito Federal',1),(429,'AGS',15401,'',0,'AGS','Aguascalientes',1),(430,'BCN',15401,'',0,'BCN','Baja California Norte',1),(431,'BCS',15401,'',0,'BCS','Baja California Sur',1),(432,'CAM',15401,'',0,'CAM','Campeche',1),(433,'CHP',15401,'',0,'CHP','Chiapas',1),(434,'CHI',15401,'',0,'CHI','Chihuahua',1),(435,'COA',15401,'',0,'COA','Coahuila',1),(436,'COL',15401,'',0,'COL','Colima',1),(437,'DUR',15401,'',0,'DUR','Durango',1),(438,'GTO',15401,'',0,'GTO','Guanajuato',1),(439,'GRO',15401,'',0,'GRO','Guerrero',1),(440,'HGO',15401,'',0,'HGO','Hidalgo',1),(441,'JAL',15401,'',0,'JAL','Jalisco',1),(442,'MEX',15401,'',0,'MEX','México',1),(443,'MIC',15401,'',0,'MIC','Michoacán de Ocampo',1),(444,'MOR',15401,'',0,'MOR','Morelos',1),(445,'NAY',15401,'',0,'NAY','Nayarit',1),(446,'NLE',15401,'',0,'NLE','Nuevo León',1),(447,'OAX',15401,'',0,'OAX','Oaxaca',1),(448,'PUE',15401,'',0,'PUE','Puebla',1),(449,'QRO',15401,'',0,'QRO','Querétaro',1),(451,'ROO',15401,'',0,'ROO','Quintana Roo',1),(452,'SLP',15401,'',0,'SLP','San Luis Potosí',1),(453,'SIN',15401,'',0,'SIN','Sinaloa',1),(454,'SON',15401,'',0,'SON','Sonora',1),(455,'TAB',15401,'',0,'TAB','Tabasco',1),(456,'TAM',15401,'',0,'TAM','Tamaulipas',1),(457,'TLX',15401,'',0,'TLX','Tlaxcala',1),(458,'VER',15401,'',0,'VER','Veracruz',1),(459,'YUC',15401,'',0,'YUC','Yucatán',1),(460,'ZAC',15401,'',0,'ZAC','Zacatecas',1),(461,'ANT',7001,'',0,'ANT','Antioquia',1),(462,'BOL',7001,'',0,'BOL','Bolívar',1),(463,'BOY',7001,'',0,'BOY','Boyacá',1),(464,'CAL',7001,'',0,'CAL','Caldas',1),(465,'CAU',7001,'',0,'CAU','Cauca',1),(466,'CUN',7001,'',0,'CUN','Cundinamarca',1),(467,'HUI',7001,'',0,'HUI','Huila',1),(468,'LAG',7001,'',0,'LAG','La Guajira',1),(469,'MET',7001,'',0,'MET','Meta',1),(470,'NAR',7001,'',0,'NAR','Nariño',1),(471,'NDS',7001,'',0,'NDS','Norte de Santander',1),(472,'SAN',7001,'',0,'SAN','Santander',1),(473,'SUC',7001,'',0,'SUC','Sucre',1),(474,'TOL',7001,'',0,'TOL','Tolima',1),(475,'VAC',7001,'',0,'VAC','Valle del Cauca',1),(476,'RIS',7001,'',0,'RIS','Risalda',1),(477,'ATL',7001,'',0,'ATL','Atlántico',1),(478,'COR',7001,'',0,'COR','Córdoba',1),(479,'SAP',7001,'',0,'SAP','San Andrés, Providencia y Santa Catalina',1),(480,'ARA',7001,'',0,'ARA','Arauca',1),(481,'CAS',7001,'',0,'CAS','Casanare',1),(482,'AMA',7001,'',0,'AMA','Amazonas',1),(483,'CAQ',7001,'',0,'CAQ','Caquetá',1),(484,'CHO',7001,'',0,'CHO','Chocó',1),(485,'GUA',7001,'',0,'GUA','Guainía',1),(486,'GUV',7001,'',0,'GUV','Guaviare',1),(487,'PUT',7001,'',0,'PUT','Putumayo',1),(488,'QUI',7001,'',0,'QUI','Quindío',1),(489,'VAU',7001,'',0,'VAU','Vaupés',1),(490,'BOG',7001,'',0,'BOG','Bogotá',1),(491,'VID',7001,'',0,'VID','Vichada',1),(492,'CES',7001,'',0,'CES','Cesar',1),(493,'MAG',7001,'',0,'MAG','Magdalena',1),(494,'AT',11401,'',0,'AT','Atlántida',1),(495,'CH',11401,'',0,'CH','Choluteca',1),(496,'CL',11401,'',0,'CL','Colón',1),(497,'CM',11401,'',0,'CM','Comayagua',1),(498,'CO',11401,'',0,'CO','Copán',1),(499,'CR',11401,'',0,'CR','Cortés',1),(500,'EP',11401,'',0,'EP','El Paraíso',1),(501,'FM',11401,'',0,'FM','Francisco Morazán',1),(502,'GD',11401,'',0,'GD','Gracias a Dios',1),(503,'IN',11401,'',0,'IN','Intibucá',1),(504,'IB',11401,'',0,'IB','Islas de la Bahía',1),(505,'LP',11401,'',0,'LP','La Paz',1),(506,'LM',11401,'',0,'LM','Lempira',1),(507,'OC',11401,'',0,'OC','Ocotepeque',1),(508,'OL',11401,'',0,'OL','Olancho',1),(509,'SB',11401,'',0,'SB','Santa Bárbara',1),(510,'VL',11401,'',0,'VL','Valle',1),(511,'YO',11401,'',0,'YO','Yoro',1),(512,'DC',11401,'',0,'DC','Distrito Central',1),(652,'CC',4601,'Oistins',0,'CC','Christ Church',1),(655,'SA',4601,'Greenland',0,'SA','Saint Andrew',1),(656,'SG',4601,'Bulkeley',0,'SG','Saint George',1),(657,'JA',4601,'Holetown',0,'JA','Saint James',1),(658,'SJ',4601,'Four Roads',0,'SJ','Saint John',1),(659,'SB',4601,'Bathsheba',0,'SB','Saint Joseph',1),(660,'SL',4601,'Crab Hill',0,'SL','Saint Lucy',1),(661,'SM',4601,'Bridgetown',0,'SM','Saint Michael',1),(662,'SP',4601,'Speightstown',0,'SP','Saint Peter',1),(663,'SC',4601,'Crane',0,'SC','Saint Philip',1),(664,'ST',4601,'Hillaby',0,'ST','Saint Thomas',1),(777,'AG',315,NULL,NULL,NULL,'AGRIGENTO',1),(778,'AL',312,NULL,NULL,NULL,'ALESSANDRIA',1),(779,'AN',310,NULL,NULL,NULL,'ANCONA',1),(780,'AO',319,NULL,NULL,NULL,'AOSTA',1),(781,'AR',316,NULL,NULL,NULL,'AREZZO',1),(782,'AP',310,NULL,NULL,NULL,'ASCOLI PICENO',1),(783,'AT',312,NULL,NULL,NULL,'ASTI',1),(784,'AV',304,NULL,NULL,NULL,'AVELLINO',1),(785,'BA',313,NULL,NULL,NULL,'BARI',1),(786,'BT',313,NULL,NULL,NULL,'BARLETTA-ANDRIA-TRANI',1),(787,'BL',320,NULL,NULL,NULL,'BELLUNO',1),(788,'BN',304,NULL,NULL,NULL,'BENEVENTO',1),(789,'BG',309,NULL,NULL,NULL,'BERGAMO',1),(790,'BI',312,NULL,NULL,NULL,'BIELLA',1),(791,'BO',305,NULL,NULL,NULL,'BOLOGNA',1),(792,'BZ',317,NULL,NULL,NULL,'BOLZANO',1),(793,'BS',309,NULL,NULL,NULL,'BRESCIA',1),(794,'BR',313,NULL,NULL,NULL,'BRINDISI',1),(795,'CA',314,NULL,NULL,NULL,'CAGLIARI',1),(796,'CL',315,NULL,NULL,NULL,'CALTANISSETTA',1),(797,'CB',311,NULL,NULL,NULL,'CAMPOBASSO',1),(798,'CI',314,NULL,NULL,NULL,'CARBONIA-IGLESIAS',1),(799,'CE',304,NULL,NULL,NULL,'CASERTA',1),(800,'CT',315,NULL,NULL,NULL,'CATANIA',1),(801,'CZ',303,NULL,NULL,NULL,'CATANZARO',1),(802,'CH',301,NULL,NULL,NULL,'CHIETI',1),(803,'CO',309,NULL,NULL,NULL,'COMO',1),(804,'CS',303,NULL,NULL,NULL,'COSENZA',1),(805,'CR',309,NULL,NULL,NULL,'CREMONA',1),(806,'KR',303,NULL,NULL,NULL,'CROTONE',1),(807,'CN',312,NULL,NULL,NULL,'CUNEO',1),(808,'EN',315,NULL,NULL,NULL,'ENNA',1),(809,'FM',310,NULL,NULL,NULL,'FERMO',1),(810,'FE',305,NULL,NULL,NULL,'FERRARA',1),(811,'FI',316,NULL,NULL,NULL,'FIRENZE',1),(812,'FG',313,NULL,NULL,NULL,'FOGGIA',1),(813,'FC',305,NULL,NULL,NULL,'FORLI-CESENA',1),(814,'FR',307,NULL,NULL,NULL,'FROSINONE',1),(815,'GE',308,NULL,NULL,NULL,'GENOVA',1),(816,'GO',306,NULL,NULL,NULL,'GORIZIA',1),(817,'GR',316,NULL,NULL,NULL,'GROSSETO',1),(818,'IM',308,NULL,NULL,NULL,'IMPERIA',1),(819,'IS',311,NULL,NULL,NULL,'ISERNIA',1),(820,'SP',308,NULL,NULL,NULL,'LA SPEZIA',1),(821,'AQ',301,NULL,NULL,NULL,'L AQUILA',1),(822,'LT',307,NULL,NULL,NULL,'LATINA',1),(823,'LE',313,NULL,NULL,NULL,'LECCE',1),(824,'LC',309,NULL,NULL,NULL,'LECCO',1),(825,'LI',314,NULL,NULL,NULL,'LIVORNO',1),(826,'LO',309,NULL,NULL,NULL,'LODI',1),(827,'LU',316,NULL,NULL,NULL,'LUCCA',1),(828,'MC',310,NULL,NULL,NULL,'MACERATA',1),(829,'MN',309,NULL,NULL,NULL,'MANTOVA',1),(830,'MS',316,NULL,NULL,NULL,'MASSA-CARRARA',1),(831,'MT',302,NULL,NULL,NULL,'MATERA',1),(832,'VS',314,NULL,NULL,NULL,'MEDIO CAMPIDANO',1),(833,'ME',315,NULL,NULL,NULL,'MESSINA',1),(834,'MI',309,NULL,NULL,NULL,'MILANO',1),(835,'MB',309,NULL,NULL,NULL,'MONZA e BRIANZA',1),(836,'MO',305,NULL,NULL,NULL,'MODENA',1),(837,'NA',304,NULL,NULL,NULL,'NAPOLI',1),(838,'NO',312,NULL,NULL,NULL,'NOVARA',1),(839,'NU',314,NULL,NULL,NULL,'NUORO',1),(840,'OG',314,NULL,NULL,NULL,'OGLIASTRA',1),(841,'OT',314,NULL,NULL,NULL,'OLBIA-TEMPIO',1),(842,'OR',314,NULL,NULL,NULL,'ORISTANO',1),(843,'PD',320,NULL,NULL,NULL,'PADOVA',1),(844,'PA',315,NULL,NULL,NULL,'PALERMO',1),(845,'PR',305,NULL,NULL,NULL,'PARMA',1),(846,'PV',309,NULL,NULL,NULL,'PAVIA',1),(847,'PG',318,NULL,NULL,NULL,'PERUGIA',1),(848,'PU',310,NULL,NULL,NULL,'PESARO e URBINO',1),(849,'PE',301,NULL,NULL,NULL,'PESCARA',1),(850,'PC',305,NULL,NULL,NULL,'PIACENZA',1),(851,'PI',316,NULL,NULL,NULL,'PISA',1),(852,'PT',316,NULL,NULL,NULL,'PISTOIA',1),(853,'PN',306,NULL,NULL,NULL,'PORDENONE',1),(854,'PZ',302,NULL,NULL,NULL,'POTENZA',1),(855,'PO',316,NULL,NULL,NULL,'PRATO',1),(856,'RG',315,NULL,NULL,NULL,'RAGUSA',1),(857,'RA',305,NULL,NULL,NULL,'RAVENNA',1),(858,'RC',303,NULL,NULL,NULL,'REGGIO CALABRIA',1),(859,'RE',305,NULL,NULL,NULL,'REGGIO NELL EMILIA',1),(860,'RI',307,NULL,NULL,NULL,'RIETI',1),(861,'RN',305,NULL,NULL,NULL,'RIMINI',1),(862,'RM',307,NULL,NULL,NULL,'ROMA',1),(863,'RO',320,NULL,NULL,NULL,'ROVIGO',1),(864,'SA',304,NULL,NULL,NULL,'SALERNO',1),(865,'SS',314,NULL,NULL,NULL,'SASSARI',1),(866,'SV',308,NULL,NULL,NULL,'SAVONA',1),(867,'SI',316,NULL,NULL,NULL,'SIENA',1),(868,'SR',315,NULL,NULL,NULL,'SIRACUSA',1),(869,'SO',309,NULL,NULL,NULL,'SONDRIO',1),(870,'TA',313,NULL,NULL,NULL,'TARANTO',1),(871,'TE',301,NULL,NULL,NULL,'TERAMO',1),(872,'TR',318,NULL,NULL,NULL,'TERNI',1),(873,'TO',312,NULL,NULL,NULL,'TORINO',1),(874,'TP',315,NULL,NULL,NULL,'TRAPANI',1),(875,'TN',317,NULL,NULL,NULL,'TRENTO',1),(876,'TV',320,NULL,NULL,NULL,'TREVISO',1),(877,'TS',306,NULL,NULL,NULL,'TRIESTE',1),(878,'UD',306,NULL,NULL,NULL,'UDINE',1),(879,'VA',309,NULL,NULL,NULL,'VARESE',1),(880,'VE',320,NULL,NULL,NULL,'VENEZIA',1),(881,'VB',312,NULL,NULL,NULL,'VERBANO-CUSIO-OSSOLA',1),(882,'VC',312,NULL,NULL,NULL,'VERCELLI',1),(883,'VR',320,NULL,NULL,NULL,'VERONA',1),(884,'VV',303,NULL,NULL,NULL,'VIBO VALENTIA',1),(885,'VI',320,NULL,NULL,NULL,'VICENZA',1),(886,'VT',307,NULL,NULL,NULL,'VITERBO',1),(1036,'VE-L',23201,'',0,'VE-L','Mérida',1),(1037,'VE-T',23201,'',0,'VE-T','Trujillo',1),(1038,'VE-E',23201,'',0,'VE-E','Barinas',1),(1039,'VE-M',23202,'',0,'VE-M','Miranda',1),(1040,'VE-W',23202,'',0,'VE-W','Vargas',1),(1041,'VE-A',23202,'',0,'VE-A','Distrito Capital',1),(1042,'VE-D',23203,'',0,'VE-D','Aragua',1),(1043,'VE-G',23203,'',0,'VE-G','Carabobo',1),(1044,'VE-I',23204,'',0,'VE-I','Falcón',1),(1045,'VE-K',23204,'',0,'VE-K','Lara',1),(1046,'VE-U',23204,'',0,'VE-U','Yaracuy',1),(1047,'VE-F',23205,'',0,'VE-F','Bolívar',1),(1048,'VE-X',23205,'',0,'VE-X','Amazonas',1),(1049,'VE-Y',23205,'',0,'VE-Y','Delta Amacuro',1),(1050,'VE-O',23206,'',0,'VE-O','Nueva Esparta',1),(1051,'VE-Z',23206,'',0,'VE-Z','Dependencias Federales',1),(1052,'VE-C',23207,'',0,'VE-C','Apure',1),(1053,'VE-J',23207,'',0,'VE-J','Guárico',1),(1054,'VE-H',23207,'',0,'VE-H','Cojedes',1),(1055,'VE-P',23207,'',0,'VE-P','Portuguesa',1),(1056,'VE-B',23208,'',0,'VE-B','Anzoátegui',1),(1057,'VE-N',23208,'',0,'VE-N','Monagas',1),(1058,'VE-R',23208,'',0,'VE-R','Sucre',1),(1059,'VE-V',23209,'',0,'VE-V','Zulia',1),(1060,'VE-S',23209,'',0,'VE-S','Táchira',1),(1061,'66',10201,NULL,NULL,NULL,'?????',1),(1062,'00',10205,NULL,NULL,NULL,'?????',1),(1063,'01',10205,NULL,NULL,NULL,'?????',1),(1064,'02',10205,NULL,NULL,NULL,'?????',1),(1065,'03',10205,NULL,NULL,NULL,'??????',1),(1066,'04',10205,NULL,NULL,NULL,'?????',1),(1067,'05',10205,NULL,NULL,NULL,'??????',1),(1068,'06',10203,NULL,NULL,NULL,'??????',1),(1069,'07',10203,NULL,NULL,NULL,'???????????',1),(1070,'08',10203,NULL,NULL,NULL,'??????',1),(1071,'09',10203,NULL,NULL,NULL,'?????',1),(1072,'10',10203,NULL,NULL,NULL,'??????',1),(1073,'11',10203,NULL,NULL,NULL,'??????',1),(1074,'12',10203,NULL,NULL,NULL,'?????????',1),(1075,'13',10206,NULL,NULL,NULL,'????',1),(1076,'14',10206,NULL,NULL,NULL,'?????????',1),(1077,'15',10206,NULL,NULL,NULL,'????????',1),(1078,'16',10206,NULL,NULL,NULL,'???????',1),(1079,'17',10213,NULL,NULL,NULL,'???????',1),(1080,'18',10213,NULL,NULL,NULL,'????????',1),(1081,'19',10213,NULL,NULL,NULL,'??????',1),(1082,'20',10213,NULL,NULL,NULL,'???????',1),(1083,'21',10212,NULL,NULL,NULL,'????????',1),(1084,'22',10212,NULL,NULL,NULL,'??????',1),(1085,'23',10212,NULL,NULL,NULL,'????????',1),(1086,'24',10212,NULL,NULL,NULL,'???????',1),(1087,'25',10212,NULL,NULL,NULL,'????????',1),(1088,'26',10212,NULL,NULL,NULL,'???????',1),(1089,'27',10202,NULL,NULL,NULL,'??????',1),(1090,'28',10202,NULL,NULL,NULL,'?????????',1),(1091,'29',10202,NULL,NULL,NULL,'????????',1),(1092,'30',10202,NULL,NULL,NULL,'??????',1),(1093,'31',10209,NULL,NULL,NULL,'????????',1),(1094,'32',10209,NULL,NULL,NULL,'???????',1),(1095,'33',10209,NULL,NULL,NULL,'????????',1),(1096,'34',10209,NULL,NULL,NULL,'???????',1),(1097,'35',10209,NULL,NULL,NULL,'????????',1),(1098,'36',10211,NULL,NULL,NULL,'???????????????',1),(1099,'37',10211,NULL,NULL,NULL,'?????',1),(1100,'38',10211,NULL,NULL,NULL,'?????',1),(1101,'39',10207,NULL,NULL,NULL,'????????',1),(1102,'40',10207,NULL,NULL,NULL,'???????',1),(1103,'41',10207,NULL,NULL,NULL,'??????????',1),(1104,'42',10207,NULL,NULL,NULL,'?????',1),(1105,'43',10207,NULL,NULL,NULL,'???????',1),(1106,'44',10208,NULL,NULL,NULL,'??????',1),(1107,'45',10208,NULL,NULL,NULL,'??????',1),(1108,'46',10208,NULL,NULL,NULL,'??????',1),(1109,'47',10208,NULL,NULL,NULL,'?????',1),(1110,'48',10208,NULL,NULL,NULL,'????',1),(1111,'49',10210,NULL,NULL,NULL,'??????',1),(1112,'50',10210,NULL,NULL,NULL,'????',1),(1113,'51',10210,NULL,NULL,NULL,'????????',1),(1114,'52',10210,NULL,NULL,NULL,'????????',1),(1115,'53',10210,NULL,NULL,NULL,'???-??????',1),(1116,'54',10210,NULL,NULL,NULL,'??',1),(1117,'55',10210,NULL,NULL,NULL,'?????',1),(1118,'56',10210,NULL,NULL,NULL,'???????',1),(1119,'57',10210,NULL,NULL,NULL,'?????',1),(1120,'58',10210,NULL,NULL,NULL,'?????',1),(1121,'59',10210,NULL,NULL,NULL,'?????',1),(1122,'60',10210,NULL,NULL,NULL,'?????',1),(1123,'61',10210,NULL,NULL,NULL,'?????',1),(1124,'62',10204,NULL,NULL,NULL,'????????',1),(1125,'63',10204,NULL,NULL,NULL,'??????',1),(1126,'64',10204,NULL,NULL,NULL,'???????',1),(1127,'65',10204,NULL,NULL,NULL,'?????',1),(1128,'AL01',1301,'',0,'','Wilaya d\'Adrar',1),(1129,'AL02',1301,'',0,'','Wilaya de Chlef',1),(1130,'AL03',1301,'',0,'','Wilaya de Laghouat',1),(1131,'AL04',1301,'',0,'','Wilaya d\'Oum El Bouaghi',1),(1132,'AL05',1301,'',0,'','Wilaya de Batna',1),(1133,'AL06',1301,'',0,'','Wilaya de Béjaïa',1),(1134,'AL07',1301,'',0,'','Wilaya de Biskra',1),(1135,'AL08',1301,'',0,'','Wilaya de Béchar',1),(1136,'AL09',1301,'',0,'','Wilaya de Blida',1),(1137,'AL11',1301,'',0,'','Wilaya de Bouira',1),(1138,'AL12',1301,'',0,'','Wilaya de Tamanrasset',1),(1139,'AL13',1301,'',0,'','Wilaya de Tébessa',1),(1140,'AL14',1301,'',0,'','Wilaya de Tlemcen',1),(1141,'AL15',1301,'',0,'','Wilaya de Tiaret',1),(1142,'AL16',1301,'',0,'','Wilaya de Tizi Ouzou',1),(1143,'AL17',1301,'',0,'','Wilaya d\'Alger',1),(1144,'AL18',1301,'',0,'','Wilaya de Djelfa',1),(1145,'AL19',1301,'',0,'','Wilaya de Jijel',1),(1146,'AL20',1301,'',0,'','Wilaya de Sétif ',1),(1147,'AL21',1301,'',0,'','Wilaya de Saïda',1),(1148,'AL22',1301,'',0,'','Wilaya de Skikda',1),(1149,'AL23',1301,'',0,'','Wilaya de Sidi Bel Abbès',1),(1150,'AL24',1301,'',0,'','Wilaya d\'Annaba',1),(1151,'AL25',1301,'',0,'','Wilaya de Guelma',1),(1152,'AL26',1301,'',0,'','Wilaya de Constantine',1),(1153,'AL27',1301,'',0,'','Wilaya de Médéa',1),(1154,'AL28',1301,'',0,'','Wilaya de Mostaganem',1),(1155,'AL29',1301,'',0,'','Wilaya de M\'Sila',1),(1156,'AL30',1301,'',0,'','Wilaya de Mascara',1),(1157,'AL31',1301,'',0,'','Wilaya d\'Ouargla',1),(1158,'AL32',1301,'',0,'','Wilaya d\'Oran',1),(1159,'AL33',1301,'',0,'','Wilaya d\'El Bayadh',1),(1160,'AL34',1301,'',0,'','Wilaya d\'Illizi',1),(1161,'AL35',1301,'',0,'','Wilaya de Bordj Bou Arreridj',1),(1162,'AL36',1301,'',0,'','Wilaya de Boumerdès',1),(1163,'AL37',1301,'',0,'','Wilaya d\'El Tarf',1),(1164,'AL38',1301,'',0,'','Wilaya de Tindouf',1),(1165,'AL39',1301,'',0,'','Wilaya de Tissemsilt',1),(1166,'AL40',1301,'',0,'','Wilaya d\'El Oued',1),(1167,'AL41',1301,'',0,'','Wilaya de Khenchela',1),(1168,'AL42',1301,'',0,'','Wilaya de Souk Ahras',1),(1169,'AL43',1301,'',0,'','Wilaya de Tipaza',1),(1170,'AL44',1301,'',0,'','Wilaya de Mila',1),(1171,'AL45',1301,'',0,'','Wilaya d\'Aïn Defla',1),(1172,'AL46',1301,'',0,'','Wilaya de Naâma',1),(1173,'AL47',1301,'',0,'','Wilaya d\'Aïn Témouchent',1),(1174,'AL48',1301,'',0,'','Wilaya de Ghardaia',1),(1175,'AL49',1301,'',0,'','Wilaya de Relizane',1),(1176,'MA',1209,'',0,'','Province de Benslimane',1),(1177,'MA1',1209,'',0,'','Province de Berrechid',1),(1178,'MA2',1209,'',0,'','Province de Khouribga',1),(1179,'MA3',1209,'',0,'','Province de Settat',1),(1180,'MA4',1210,'',0,'','Province d\'El Jadida',1),(1181,'MA5',1210,'',0,'','Province de Safi',1),(1182,'MA6',1210,'',0,'','Province de Sidi Bennour',1),(1183,'MA7',1210,'',0,'','Province de Youssoufia',1),(1184,'MA6B',1205,'',0,'','Préfecture de Fès',1),(1185,'MA7B',1205,'',0,'','Province de Boulemane',1),(1186,'MA8',1205,'',0,'','Province de Moulay Yacoub',1),(1187,'MA9',1205,'',0,'','Province de Sefrou',1),(1188,'MA8A',1202,'',0,'','Province de Kénitra',1),(1189,'MA9A',1202,'',0,'','Province de Sidi Kacem',1),(1190,'MA10',1202,'',0,'','Province de Sidi Slimane',1),(1191,'MA11',1208,'',0,'','Préfecture de Casablanca',1),(1192,'MA12',1208,'',0,'','Préfecture de Mohammédia',1),(1193,'MA13',1208,'',0,'','Province de Médiouna',1),(1194,'MA14',1208,'',0,'','Province de Nouaceur',1),(1195,'MA15',1214,'',0,'','Province d\'Assa-Zag',1),(1196,'MA16',1214,'',0,'','Province d\'Es-Semara',1),(1197,'MA17A',1214,'',0,'','Province de Guelmim',1),(1198,'MA18',1214,'',0,'','Province de Tata',1),(1199,'MA19',1214,'',0,'','Province de Tan-Tan',1),(1200,'MA15',1215,'',0,'','Province de Boujdour',1),(1201,'MA16',1215,'',0,'','Province de Lâayoune',1),(1202,'MA17',1215,'',0,'','Province de Tarfaya',1),(1203,'MA18',1211,'',0,'','Préfecture de Marrakech',1),(1204,'MA19',1211,'',0,'','Province d\'Al Haouz',1),(1205,'MA20',1211,'',0,'','Province de Chichaoua',1),(1206,'MA21',1211,'',0,'','Province d\'El Kelâa des Sraghna',1),(1207,'MA22',1211,'',0,'','Province d\'Essaouira',1),(1208,'MA23',1211,'',0,'','Province de Rehamna',1),(1209,'MA24',1206,'',0,'','Préfecture de Meknès',1),(1210,'MA25',1206,'',0,'','Province d’El Hajeb',1),(1211,'MA26',1206,'',0,'','Province d\'Errachidia',1),(1212,'MA27',1206,'',0,'','Province d’Ifrane',1),(1213,'MA28',1206,'',0,'','Province de Khénifra',1),(1214,'MA29',1206,'',0,'','Province de Midelt',1),(1215,'MA30',1204,'',0,'','Préfecture d\'Oujda-Angad',1),(1216,'MA31',1204,'',0,'','Province de Berkane',1),(1217,'MA32',1204,'',0,'','Province de Driouch',1),(1218,'MA33',1204,'',0,'','Province de Figuig',1),(1219,'MA34',1204,'',0,'','Province de Jerada',1),(1220,'MA35',1204,'',0,'','Province de Nadorgg',1),(1221,'MA36',1204,'',0,'','Province de Taourirt',1),(1222,'MA37',1216,'',0,'','Province d\'Aousserd',1),(1223,'MA38',1216,'',0,'','Province d\'Oued Ed-Dahab',1),(1224,'MA39',1207,'',0,'','Préfecture de Rabat',1),(1225,'MA40',1207,'',0,'','Préfecture de Skhirat-Témara',1),(1226,'MA41',1207,'',0,'','Préfecture de Salé',1),(1227,'MA42',1207,'',0,'','Province de Khémisset',1),(1228,'MA43',1213,'',0,'','Préfecture d\'Agadir Ida-Outanane',1),(1229,'MA44',1213,'',0,'','Préfecture d\'Inezgane-Aït Melloul',1),(1230,'MA45',1213,'',0,'','Province de Chtouka-Aït Baha',1),(1231,'MA46',1213,'',0,'','Province d\'Ouarzazate',1),(1232,'MA47',1213,'',0,'','Province de Sidi Ifni',1),(1233,'MA48',1213,'',0,'','Province de Taroudant',1),(1234,'MA49',1213,'',0,'','Province de Tinghir',1),(1235,'MA50',1213,'',0,'','Province de Tiznit',1),(1236,'MA51',1213,'',0,'','Province de Zagora',1),(1237,'MA52',1212,'',0,'','Province d\'Azilal',1),(1238,'MA53',1212,'',0,'','Province de Beni Mellal',1),(1239,'MA54',1212,'',0,'','Province de Fquih Ben Salah',1),(1240,'MA55',1201,'',0,'','Préfecture de M\'diq-Fnideq',1),(1241,'MA56',1201,'',0,'','Préfecture de Tanger-Asilah',1),(1242,'MA57',1201,'',0,'','Province de Chefchaouen',1),(1243,'MA58',1201,'',0,'','Province de Fahs-Anjra',1),(1244,'MA59',1201,'',0,'','Province de Larache',1),(1245,'MA60',1201,'',0,'','Province d\'Ouezzane',1),(1246,'MA61',1201,'',0,'','Province de Tétouan',1),(1247,'MA62',1203,'',0,'','Province de Guercif',1),(1248,'MA63',1203,'',0,'','Province d\'Al Hoceïma',1),(1249,'MA64',1203,'',0,'','Province de Taounate',1),(1250,'MA65',1203,'',0,'','Province de Taza',1),(1251,'MA6A',1205,'',0,'','Préfecture de Fès',1),(1252,'MA7A',1205,'',0,'','Province de Boulemane',1),(1253,'MA15A',1214,'',0,'','Province d\'Assa-Zag',1),(1254,'MA16A',1214,'',0,'','Province d\'Es-Semara',1),(1255,'MA18A',1211,'',0,'','Préfecture de Marrakech',1),(1256,'MA19A',1214,'',0,'','Province de Tan-Tan',1),(1257,'MA19B',1214,'',0,'','Province de Tan-Tan',1),(1258,'TN01',1001,'',0,'','Ariana',1),(1259,'TN02',1001,'',0,'','Béja',1),(1260,'TN03',1001,'',0,'','Ben Arous',1),(1261,'TN04',1001,'',0,'','Bizerte',1),(1262,'TN05',1001,'',0,'','Gabès',1),(1263,'TN06',1001,'',0,'','Gafsa',1),(1264,'TN07',1001,'',0,'','Jendouba',1),(1265,'TN08',1001,'',0,'','Kairouan',1),(1266,'TN09',1001,'',0,'','Kasserine',1),(1267,'TN10',1001,'',0,'','Kébili',1),(1268,'TN11',1001,'',0,'','La Manouba',1),(1269,'TN12',1001,'',0,'','Le Kef',1),(1270,'TN13',1001,'',0,'','Mahdia',1),(1271,'TN14',1001,'',0,'','Médenine',1),(1272,'TN15',1001,'',0,'','Monastir',1),(1273,'TN16',1001,'',0,'','Nabeul',1),(1274,'TN17',1001,'',0,'','Sfax',1),(1275,'TN18',1001,'',0,'','Sidi Bouzid',1),(1276,'TN19',1001,'',0,'','Siliana',1),(1277,'TN20',1001,'',0,'','Sousse',1),(1278,'TN21',1001,'',0,'','Tataouine',1),(1279,'TN22',1001,'',0,'','Tozeur',1),(1280,'TN23',1001,'',0,'','Tunis',1),(1281,'TN24',1001,'',0,'','Zaghouan',1),(1287,'976',6,'97601',3,'MAYOTTE','Mayotte',1),(1513,'ON',1401,'',1,'','Ontario',1),(1514,'QC',1401,'',1,'','Quebec',1),(1515,'NS',1401,'',1,'','Nova Scotia',1),(1516,'NB',1401,'',1,'','New Brunswick',1),(1517,'MB',1401,'',1,'','Manitoba',1),(1518,'BC',1401,'',1,'','British Columbia',1),(1519,'PE',1401,'',1,'','Prince Edward Island',1),(1520,'SK',1401,'',1,'','Saskatchewan',1),(1521,'AB',1401,'',1,'','Alberta',1),(1522,'NL',1401,'',1,'','Newfoundland and Labrador',1),(1575,'BW',501,NULL,NULL,'BADEN-WÜRTTEMBERG','Baden-Württemberg',1),(1576,'BY',501,NULL,NULL,'BAYERN','Bayern',1),(1577,'BE',501,NULL,NULL,'BERLIN','Berlin',1),(1578,'BB',501,NULL,NULL,'BRANDENBURG','Brandenburg',1),(1579,'HB',501,NULL,NULL,'BREMEN','Bremen',1),(1580,'HH',501,NULL,NULL,'HAMBURG','Hamburg',1),(1581,'HE',501,NULL,NULL,'HESSEN','Hessen',1),(1582,'MV',501,NULL,NULL,'MECKLENBURG-VORPOMMERN','Mecklenburg-Vorpommern',1),(1583,'NI',501,NULL,NULL,'NIEDERSACHSEN','Niedersachsen',1),(1584,'NW',501,NULL,NULL,'NORDRHEIN-WESTFALEN','Nordrhein-Westfalen',1),(1585,'RP',501,NULL,NULL,'RHEINLAND-PFALZ','Rheinland-Pfalz',1),(1586,'SL',501,NULL,NULL,'SAARLAND','Saarland',1),(1587,'SN',501,NULL,NULL,'SACHSEN','Sachsen',1),(1588,'ST',501,NULL,NULL,'SACHSEN-ANHALT','Sachsen-Anhalt',1),(1589,'SH',501,NULL,NULL,'SCHLESWIG-HOLSTEIN','Schleswig-Holstein',1),(1590,'TH',501,NULL,NULL,'THÜRINGEN','Thüringen',1),(1592,'67',10205,'',0,'','Δράμα',1),(1684,'701',701,NULL,0,NULL,'Bedfordshire',1),(1685,'702',701,NULL,0,NULL,'Berkshire',1),(1686,'703',701,NULL,0,NULL,'Bristol, City of',1),(1687,'704',701,NULL,0,NULL,'Buckinghamshire',1),(1688,'705',701,NULL,0,NULL,'Cambridgeshire',1),(1689,'706',701,NULL,0,NULL,'Cheshire',1),(1690,'707',701,NULL,0,NULL,'Cleveland',1),(1691,'708',701,NULL,0,NULL,'Cornwall',1),(1692,'709',701,NULL,0,NULL,'Cumberland',1),(1693,'710',701,NULL,0,NULL,'Cumbria',1),(1694,'711',701,NULL,0,NULL,'Derbyshire',1),(1695,'712',701,NULL,0,NULL,'Devon',1),(1696,'713',701,NULL,0,NULL,'Dorset',1),(1697,'714',701,NULL,0,NULL,'Co. Durham',1),(1698,'715',701,NULL,0,NULL,'East Riding of Yorkshire',1),(1699,'716',701,NULL,0,NULL,'East Sussex',1),(1700,'717',701,NULL,0,NULL,'Essex',1),(1701,'718',701,NULL,0,NULL,'Gloucestershire',1),(1702,'719',701,NULL,0,NULL,'Greater Manchester',1),(1703,'720',701,NULL,0,NULL,'Hampshire',1),(1704,'721',701,NULL,0,NULL,'Hertfordshire',1),(1705,'722',701,NULL,0,NULL,'Hereford and Worcester',1),(1706,'723',701,NULL,0,NULL,'Herefordshire',1),(1707,'724',701,NULL,0,NULL,'Huntingdonshire',1),(1708,'725',701,NULL,0,NULL,'Isle of Man',1),(1709,'726',701,NULL,0,NULL,'Isle of Wight',1),(1710,'727',701,NULL,0,NULL,'Jersey',1),(1711,'728',701,NULL,0,NULL,'Kent',1),(1712,'729',701,NULL,0,NULL,'Lancashire',1),(1713,'730',701,NULL,0,NULL,'Leicestershire',1),(1714,'731',701,NULL,0,NULL,'Lincolnshire',1),(1715,'732',701,NULL,0,NULL,'London - City of London',1),(1716,'733',701,NULL,0,NULL,'Merseyside',1),(1717,'734',701,NULL,0,NULL,'Middlesex',1),(1718,'735',701,NULL,0,NULL,'Norfolk',1),(1719,'736',701,NULL,0,NULL,'North Yorkshire',1),(1720,'737',701,NULL,0,NULL,'North Riding of Yorkshire',1),(1721,'738',701,NULL,0,NULL,'Northamptonshire',1),(1722,'739',701,NULL,0,NULL,'Northumberland',1),(1723,'740',701,NULL,0,NULL,'Nottinghamshire',1),(1724,'741',701,NULL,0,NULL,'Oxfordshire',1),(1725,'742',701,NULL,0,NULL,'Rutland',1),(1726,'743',701,NULL,0,NULL,'Shropshire',1),(1727,'744',701,NULL,0,NULL,'Somerset',1),(1728,'745',701,NULL,0,NULL,'Staffordshire',1),(1729,'746',701,NULL,0,NULL,'Suffolk',1),(1730,'747',701,NULL,0,NULL,'Surrey',1),(1731,'748',701,NULL,0,NULL,'Sussex',1),(1732,'749',701,NULL,0,NULL,'Tyne and Wear',1),(1733,'750',701,NULL,0,NULL,'Warwickshire',1),(1734,'751',701,NULL,0,NULL,'West Midlands',1),(1735,'752',701,NULL,0,NULL,'West Sussex',1),(1736,'753',701,NULL,0,NULL,'West Yorkshire',1),(1737,'754',701,NULL,0,NULL,'West Riding of Yorkshire',1),(1738,'755',701,NULL,0,NULL,'Wiltshire',1),(1739,'756',701,NULL,0,NULL,'Worcestershire',1),(1740,'757',701,NULL,0,NULL,'Yorkshire',1),(1741,'758',702,NULL,0,NULL,'Anglesey',1),(1742,'759',702,NULL,0,NULL,'Breconshire',1),(1743,'760',702,NULL,0,NULL,'Caernarvonshire',1),(1744,'761',702,NULL,0,NULL,'Cardiganshire',1),(1745,'762',702,NULL,0,NULL,'Carmarthenshire',1),(1746,'763',702,NULL,0,NULL,'Ceredigion',1),(1747,'764',702,NULL,0,NULL,'Denbighshire',1),(1748,'765',702,NULL,0,NULL,'Flintshire',1),(1749,'766',702,NULL,0,NULL,'Glamorgan',1),(1750,'767',702,NULL,0,NULL,'Gwent',1),(1751,'768',702,NULL,0,NULL,'Gwynedd',1),(1752,'769',702,NULL,0,NULL,'Merionethshire',1),(1753,'770',702,NULL,0,NULL,'Monmouthshire',1),(1754,'771',702,NULL,0,NULL,'Mid Glamorgan',1),(1755,'772',702,NULL,0,NULL,'Montgomeryshire',1),(1756,'773',702,NULL,0,NULL,'Pembrokeshire',1),(1757,'774',702,NULL,0,NULL,'Powys',1),(1758,'775',702,NULL,0,NULL,'Radnorshire',1),(1759,'776',702,NULL,0,NULL,'South Glamorgan',1),(1760,'777',703,NULL,0,NULL,'Aberdeen, City of',1),(1761,'778',703,NULL,0,NULL,'Angus',1),(1762,'779',703,NULL,0,NULL,'Argyll',1),(1763,'780',703,NULL,0,NULL,'Ayrshire',1),(1764,'781',703,NULL,0,NULL,'Banffshire',1),(1765,'782',703,NULL,0,NULL,'Berwickshire',1),(1766,'783',703,NULL,0,NULL,'Bute',1),(1767,'784',703,NULL,0,NULL,'Caithness',1),(1768,'785',703,NULL,0,NULL,'Clackmannanshire',1),(1769,'786',703,NULL,0,NULL,'Dumfriesshire',1),(1770,'787',703,NULL,0,NULL,'Dumbartonshire',1),(1771,'788',703,NULL,0,NULL,'Dundee, City of',1),(1772,'789',703,NULL,0,NULL,'East Lothian',1),(1773,'790',703,NULL,0,NULL,'Fife',1),(1774,'791',703,NULL,0,NULL,'Inverness',1),(1775,'792',703,NULL,0,NULL,'Kincardineshire',1),(1776,'793',703,NULL,0,NULL,'Kinross-shire',1),(1777,'794',703,NULL,0,NULL,'Kirkcudbrightshire',1),(1778,'795',703,NULL,0,NULL,'Lanarkshire',1),(1779,'796',703,NULL,0,NULL,'Midlothian',1),(1780,'797',703,NULL,0,NULL,'Morayshire',1),(1781,'798',703,NULL,0,NULL,'Nairnshire',1),(1782,'799',703,NULL,0,NULL,'Orkney',1),(1783,'800',703,NULL,0,NULL,'Peebleshire',1),(1784,'801',703,NULL,0,NULL,'Perthshire',1),(1785,'802',703,NULL,0,NULL,'Renfrewshire',1),(1786,'803',703,NULL,0,NULL,'Ross & Cromarty',1),(1787,'804',703,NULL,0,NULL,'Roxburghshire',1),(1788,'805',703,NULL,0,NULL,'Selkirkshire',1),(1789,'806',703,NULL,0,NULL,'Shetland',1),(1790,'807',703,NULL,0,NULL,'Stirlingshire',1),(1791,'808',703,NULL,0,NULL,'Sutherland',1),(1792,'809',703,NULL,0,NULL,'West Lothian',1),(1793,'810',703,NULL,0,NULL,'Wigtownshire',1),(1794,'811',704,NULL,0,NULL,'Antrim',1),(1795,'812',704,NULL,0,NULL,'Armagh',1),(1796,'813',704,NULL,0,NULL,'Co. Down',1),(1797,'814',704,NULL,0,NULL,'Co. Fermanagh',1),(1798,'815',704,NULL,0,NULL,'Co. Londonderry',1),(1849,'GR',1701,NULL,NULL,NULL,'Groningen',1),(1850,'FR',1701,NULL,NULL,NULL,'Friesland',1),(1851,'DR',1701,NULL,NULL,NULL,'Drenthe',1),(1852,'OV',1701,NULL,NULL,NULL,'Overijssel',1),(1853,'GD',1701,NULL,NULL,NULL,'Gelderland',1),(1854,'FL',1701,NULL,NULL,NULL,'Flevoland',1),(1855,'UT',1701,NULL,NULL,NULL,'Utrecht',1),(1856,'NH',1701,NULL,NULL,NULL,'Noord-Holland',1),(1857,'ZH',1701,NULL,NULL,NULL,'Zuid-Holland',1),(1858,'ZL',1701,NULL,NULL,NULL,'Zeeland',1),(1859,'NB',1701,NULL,NULL,NULL,'Noord-Brabant',1),(1860,'LB',1701,NULL,NULL,NULL,'Limburg',1),(1900,'AC',5601,'ACRE',0,'AC','Acre',1),(1901,'AL',5601,'ALAGOAS',0,'AL','Alagoas',1),(1902,'AP',5601,'AMAPA',0,'AP','Amapá',1),(1903,'AM',5601,'AMAZONAS',0,'AM','Amazonas',1),(1904,'BA',5601,'BAHIA',0,'BA','Bahia',1),(1905,'CE',5601,'CEARA',0,'CE','Ceará',1),(1906,'ES',5601,'ESPIRITO SANTO',0,'ES','Espirito Santo',1),(1907,'GO',5601,'GOIAS',0,'GO','Goiás',1),(1908,'MA',5601,'MARANHAO',0,'MA','Maranhão',1),(1909,'MT',5601,'MATO GROSSO',0,'MT','Mato Grosso',1),(1910,'MS',5601,'MATO GROSSO DO SUL',0,'MS','Mato Grosso do Sul',1),(1911,'MG',5601,'MINAS GERAIS',0,'MG','Minas Gerais',1),(1912,'PA',5601,'PARA',0,'PA','Pará',1),(1913,'PB',5601,'PARAIBA',0,'PB','Paraiba',1),(1914,'PR',5601,'PARANA',0,'PR','Paraná',1),(1915,'PE',5601,'PERNAMBUCO',0,'PE','Pernambuco',1),(1916,'PI',5601,'PIAUI',0,'PI','Piauí',1),(1917,'RJ',5601,'RIO DE JANEIRO',0,'RJ','Rio de Janeiro',1),(1918,'RN',5601,'RIO GRANDE DO NORTE',0,'RN','Rio Grande do Norte',1),(1919,'RS',5601,'RIO GRANDE DO SUL',0,'RS','Rio Grande do Sul',1),(1920,'RO',5601,'RONDONIA',0,'RO','Rondônia',1),(1921,'RR',5601,'RORAIMA',0,'RR','Roraima',1),(1922,'SC',5601,'SANTA CATARINA',0,'SC','Santa Catarina',1),(1923,'SE',5601,'SERGIPE',0,'SE','Sergipe',1),(1924,'SP',5601,'SAO PAULO',0,'SP','Sao Paulo',1),(1925,'TO',5601,'TOCANTINS',0,'TO','Tocantins',1),(1926,'DF',5601,'DISTRITO FEDERAL',0,'DF','Distrito Federal',1),(1927,'001',5201,'',0,'','Belisario Boeto',1),(1928,'002',5201,'',0,'','Hernando Siles',1),(1929,'003',5201,'',0,'','Jaime Zudáñez',1),(1930,'004',5201,'',0,'','Juana Azurduy de Padilla',1),(1931,'005',5201,'',0,'','Luis Calvo',1),(1932,'006',5201,'',0,'','Nor Cinti',1),(1933,'007',5201,'',0,'','Oropeza',1),(1934,'008',5201,'',0,'','Sud Cinti',1),(1935,'009',5201,'',0,'','Tomina',1),(1936,'010',5201,'',0,'','Yamparáez',1),(1937,'011',5202,'',0,'','Abel Iturralde',1),(1938,'012',5202,'',0,'','Aroma',1),(1939,'013',5202,'',0,'','Bautista Saavedra',1),(1940,'014',5202,'',0,'','Caranavi',1),(1941,'015',5202,'',0,'','Eliodoro Camacho',1),(1942,'016',5202,'',0,'','Franz Tamayo',1),(1943,'017',5202,'',0,'','Gualberto Villarroel',1),(1944,'018',5202,'',0,'','Ingaví',1),(1945,'019',5202,'',0,'','Inquisivi',1),(1946,'020',5202,'',0,'','José Ramón Loayza',1),(1947,'021',5202,'',0,'','Larecaja',1),(1948,'022',5202,'',0,'','Los Andes (Bolivia)',1),(1949,'023',5202,'',0,'','Manco Kapac',1),(1950,'024',5202,'',0,'','Muñecas',1),(1951,'025',5202,'',0,'','Nor Yungas',1),(1952,'026',5202,'',0,'','Omasuyos',1),(1953,'027',5202,'',0,'','Pacajes',1),(1954,'028',5202,'',0,'','Pedro Domingo Murillo',1),(1955,'029',5202,'',0,'','Sud Yungas',1),(1956,'030',5202,'',0,'','General José Manuel Pando',1),(1957,'031',5203,'',0,'','Arani',1),(1958,'032',5203,'',0,'','Arque',1),(1959,'033',5203,'',0,'','Ayopaya',1),(1960,'034',5203,'',0,'','Bolívar (Bolivia)',1),(1961,'035',5203,'',0,'','Campero',1),(1962,'036',5203,'',0,'','Capinota',1),(1963,'037',5203,'',0,'','Cercado (Cochabamba)',1),(1964,'038',5203,'',0,'','Esteban Arze',1),(1965,'039',5203,'',0,'','Germán Jordán',1),(1966,'040',5203,'',0,'','José Carrasco',1),(1967,'041',5203,'',0,'','Mizque',1),(1968,'042',5203,'',0,'','Punata',1),(1969,'043',5203,'',0,'','Quillacollo',1),(1970,'044',5203,'',0,'','Tapacarí',1),(1971,'045',5203,'',0,'','Tiraque',1),(1972,'046',5203,'',0,'','Chapare',1),(1973,'047',5204,'',0,'','Carangas',1),(1974,'048',5204,'',0,'','Cercado (Oruro)',1),(1975,'049',5204,'',0,'','Eduardo Avaroa',1),(1976,'050',5204,'',0,'','Ladislao Cabrera',1),(1977,'051',5204,'',0,'','Litoral de Atacama',1),(1978,'052',5204,'',0,'','Mejillones',1),(1979,'053',5204,'',0,'','Nor Carangas',1),(1980,'054',5204,'',0,'','Pantaleón Dalence',1),(1981,'055',5204,'',0,'','Poopó',1),(1982,'056',5204,'',0,'','Sabaya',1),(1983,'057',5204,'',0,'','Sajama',1),(1984,'058',5204,'',0,'','San Pedro de Totora',1),(1985,'059',5204,'',0,'','Saucarí',1),(1986,'060',5204,'',0,'','Sebastián Pagador',1),(1987,'061',5204,'',0,'','Sud Carangas',1),(1988,'062',5204,'',0,'','Tomás Barrón',1),(1989,'063',5205,'',0,'','Alonso de Ibáñez',1),(1990,'064',5205,'',0,'','Antonio Quijarro',1),(1991,'065',5205,'',0,'','Bernardino Bilbao',1),(1992,'066',5205,'',0,'','Charcas (Potosí)',1),(1993,'067',5205,'',0,'','Chayanta',1),(1994,'068',5205,'',0,'','Cornelio Saavedra',1),(1995,'069',5205,'',0,'','Daniel Campos',1),(1996,'070',5205,'',0,'','Enrique Baldivieso',1),(1997,'071',5205,'',0,'','José María Linares',1),(1998,'072',5205,'',0,'','Modesto Omiste',1),(1999,'073',5205,'',0,'','Nor Chichas',1),(2000,'074',5205,'',0,'','Nor Lípez',1),(2001,'075',5205,'',0,'','Rafael Bustillo',1),(2002,'076',5205,'',0,'','Sud Chichas',1),(2003,'077',5205,'',0,'','Sud Lípez',1),(2004,'078',5205,'',0,'','Tomás Frías',1),(2005,'079',5206,'',0,'','Aniceto Arce',1),(2006,'080',5206,'',0,'','Burdet O\'Connor',1),(2007,'081',5206,'',0,'','Cercado (Tarija)',1),(2008,'082',5206,'',0,'','Eustaquio Méndez',1),(2009,'083',5206,'',0,'','José María Avilés',1),(2010,'084',5206,'',0,'','Gran Chaco',1),(2011,'085',5207,'',0,'','Andrés Ibáñez',1),(2012,'086',5207,'',0,'','Caballero',1),(2013,'087',5207,'',0,'','Chiquitos',1),(2014,'088',5207,'',0,'','Cordillera (Bolivia)',1),(2015,'089',5207,'',0,'','Florida',1),(2016,'090',5207,'',0,'','Germán Busch',1),(2017,'091',5207,'',0,'','Guarayos',1),(2018,'092',5207,'',0,'','Ichilo',1),(2019,'093',5207,'',0,'','Obispo Santistevan',1),(2020,'094',5207,'',0,'','Sara',1),(2021,'095',5207,'',0,'','Vallegrande',1),(2022,'096',5207,'',0,'','Velasco',1),(2023,'097',5207,'',0,'','Warnes',1),(2024,'098',5207,'',0,'','Ángel Sandóval',1),(2025,'099',5207,'',0,'','Ñuflo de Chaves',1),(2026,'100',5208,'',0,'','Cercado (Beni)',1),(2027,'101',5208,'',0,'','Iténez',1),(2028,'102',5208,'',0,'','Mamoré',1),(2029,'103',5208,'',0,'','Marbán',1),(2030,'104',5208,'',0,'','Moxos',1),(2031,'105',5208,'',0,'','Vaca Díez',1),(2032,'106',5208,'',0,'','Yacuma',1),(2033,'107',5208,'',0,'','General José Ballivián Segurola',1),(2034,'108',5209,'',0,'','Abuná',1),(2035,'109',5209,'',0,'','Madre de Dios',1),(2036,'110',5209,'',0,'','Manuripi',1),(2037,'111',5209,'',0,'','Nicolás Suárez',1),(2038,'112',5209,'',0,'','General Federico Román',1),(2039,'B',4101,NULL,NULL,'BURGENLAND','Burgenland',1),(2040,'K',4101,NULL,NULL,'KAERNTEN','Kärnten',1),(2041,'N',4101,NULL,NULL,'NIEDEROESTERREICH','Niederösterreich',1),(2042,'O',4101,NULL,NULL,'OBEROESTERREICH','Oberösterreich',1),(2043,'S',4101,NULL,NULL,'SALZBURG','Salzburg',1),(2044,'ST',4101,NULL,NULL,'STEIERMARK','Steiermark',1),(2045,'T',4101,NULL,NULL,'TIROL','Tirol',1),(2046,'V',4101,NULL,NULL,'VORARLBERG','Vorarlberg',1),(2047,'W',4101,NULL,NULL,'WIEN','Wien',1),(2048,'2326',2305,'',0,'MISIONES','Misiones',1),(2049,'PA-1',17801,'',0,'','Bocas del Toro',1),(2050,'PA-2',17801,'',0,'','Coclé',1),(2051,'PA-3',17801,'',0,'','Colón',1),(2052,'PA-4',17801,'',0,'','Chiriquí',1),(2053,'PA-5',17801,'',0,'','Darién',1),(2054,'PA-6',17801,'',0,'','Herrera',1),(2055,'PA-7',17801,'',0,'','Los Santos',1),(2056,'PA-8',17801,'',0,'','Panamá',1),(2057,'PA-9',17801,'',0,'','Veraguas',1),(2058,'PA-13',17801,'',0,'','Panamá Oeste',1),(2059,'AE-1',22701,'',0,'','Abu Dhabi',1),(2060,'AE-2',22701,'',0,'','Dubai',1),(2061,'AE-3',22701,'',0,'','Ajman',1),(2062,'AE-4',22701,'',0,'','Fujairah',1),(2063,'AE-5',22701,'',0,'','Ras al-Khaimah',1),(2064,'AE-6',22701,'',0,'','Sharjah',1),(2065,'AE-7',22701,'',0,'','Umm al-Quwain',1); +/*!40000 ALTER TABLE `llx_c_departements` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_ecotaxe` +-- + +DROP TABLE IF EXISTS `llx_c_ecotaxe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_ecotaxe` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(64) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `organization` varchar(255) DEFAULT NULL, + `fk_pays` int(11) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_ecotaxe` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_ecotaxe` +-- + +LOCK TABLES `llx_c_ecotaxe` WRITE; +/*!40000 ALTER TABLE `llx_c_ecotaxe` DISABLE KEYS */; +INSERT INTO `llx_c_ecotaxe` VALUES (1,'ER-A-A','Materiels electriques < 0,2kg',0.01000000,'ERP',1,1),(2,'ER-A-B','Materiels electriques >= 0,2 kg et < 0,5 kg',0.03000000,'ERP',1,1),(3,'ER-A-C','Materiels electriques >= 0,5 kg et < 1 kg',0.04000000,'ERP',1,1),(4,'ER-A-D','Materiels electriques >= 1 kg et < 2 kg',0.13000000,'ERP',1,1),(5,'ER-A-E','Materiels electriques >= 2 kg et < 4kg',0.21000000,'ERP',1,1),(6,'ER-A-F','Materiels electriques >= 4 kg et < 8 kg',0.42000000,'ERP',1,1),(7,'ER-A-G','Materiels electriques >= 8 kg et < 15 kg',0.84000000,'ERP',1,1),(8,'ER-A-H','Materiels electriques >= 15 kg et < 20 kg',1.25000000,'ERP',1,1),(9,'ER-A-I','Materiels electriques >= 20 kg et < 30 kg',1.88000000,'ERP',1,1),(10,'ER-A-J','Materiels electriques >= 30 kg',3.34000000,'ERP',1,1),(11,'ER-M-1','TV, Moniteurs < 9kg',0.84000000,'ERP',1,1),(12,'ER-M-2','TV, Moniteurs >= 9kg et < 15kg',1.67000000,'ERP',1,1),(13,'ER-M-3','TV, Moniteurs >= 15kg et < 30kg',3.34000000,'ERP',1,1),(14,'ER-M-4','TV, Moniteurs >= 30 kg',6.69000000,'ERP',1,1),(15,'EC-A-A','Materiels electriques 0,2 kg max',0.00840000,'Ecologic',1,1),(16,'EC-A-B','Materiels electriques 0,21 kg min - 0,50 kg max',0.02500000,'Ecologic',1,1),(17,'EC-A-C','Materiels electriques 0,51 kg min - 1 kg max',0.04000000,'Ecologic',1,1),(18,'EC-A-D','Materiels electriques 1,01 kg min - 2,5 kg max',0.13000000,'Ecologic',1,1),(19,'EC-A-E','Materiels electriques 2,51 kg min - 4 kg max',0.21000000,'Ecologic',1,1),(20,'EC-A-F','Materiels electriques 4,01 kg min - 8 kg max',0.42000000,'Ecologic',1,1),(21,'EC-A-G','Materiels electriques 8,01 kg min - 12 kg max',0.63000000,'Ecologic',1,1),(22,'EC-A-H','Materiels electriques 12,01 kg min - 20 kg max',1.05000000,'Ecologic',1,1),(23,'EC-A-I','Materiels electriques 20,01 kg min',1.88000000,'Ecologic',1,1),(24,'EC-M-1','TV, Moniteurs 9 kg max',0.84000000,'Ecologic',1,1),(25,'EC-M-2','TV, Moniteurs 9,01 kg min - 18 kg max',1.67000000,'Ecologic',1,1),(26,'EC-M-3','TV, Moniteurs 18,01 kg min - 36 kg max',3.34000000,'Ecologic',1,1),(27,'EC-M-4','TV, Moniteurs 36,01 kg min',6.69000000,'Ecologic',1,1),(28,'ES-M-1','TV, Moniteurs <= 20 pouces',0.84000000,'Eco-systemes',1,1),(29,'ES-M-2','TV, Moniteurs > 20 pouces et <= 32 pouces',3.34000000,'Eco-systemes',1,1),(30,'ES-M-3','TV, Moniteurs > 32 pouces et autres grands ecrans',6.69000000,'Eco-systemes',1,1),(31,'ES-A-A','Ordinateur fixe, Audio home systems (HIFI), elements hifi separes',0.84000000,'Eco-systemes',1,1),(32,'ES-A-B','Ordinateur portable, CD-RCR, VCR, lecteurs et enregistreurs DVD, instruments de musique et caisses de resonance, haut parleurs...',0.25000000,'Eco-systemes',1,1),(33,'ES-A-C','Imprimante, photocopieur, telecopieur',0.42000000,'Eco-systemes',1,1),(34,'ES-A-D','Accessoires, clavier, souris, PDA, imprimante photo, appareil photo, gps, telephone, repondeur, telephone sans fil, modem, telecommande, casque, camescope, baladeur mp3, radio portable, radio K7 et CD portable, radio reveil',0.08400000,'Eco-systemes',1,1),(35,'ES-A-E','GSM',0.00840000,'Eco-systemes',1,1),(36,'ES-A-F','Jouets et equipements de loisirs et de sports < 0,5 kg',0.04200000,'Eco-systemes',1,1),(37,'ES-A-G','Jouets et equipements de loisirs et de sports > 0,5 kg',0.17000000,'Eco-systemes',1,1),(38,'ES-A-H','Jouets et equipements de loisirs et de sports > 10 kg',1.25000000,'Eco-systemes',1,1); +/*!40000 ALTER TABLE `llx_c_ecotaxe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_effectif` +-- + +DROP TABLE IF EXISTS `llx_c_effectif`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_effectif` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_effectif` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_effectif` +-- + +LOCK TABLES `llx_c_effectif` WRITE; +/*!40000 ALTER TABLE `llx_c_effectif` DISABLE KEYS */; +INSERT INTO `llx_c_effectif` VALUES (0,'EF0','-',1,NULL),(1,'EF1-5','1 - 5',1,NULL),(2,'EF6-10','6 - 10',1,NULL),(3,'EF11-50','11 - 50',1,NULL),(4,'EF51-100','51 - 100',1,NULL),(5,'EF100-500','100 - 500',1,NULL),(6,'EF500-','> 500',1,NULL); +/*!40000 ALTER TABLE `llx_c_effectif` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_email_templates` +-- + +DROP TABLE IF EXISTS `llx_c_email_templates`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_email_templates` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `type_template` varchar(32) DEFAULT NULL, + `lang` varchar(6) DEFAULT NULL, + `private` smallint(6) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) DEFAULT NULL, + `position` smallint(6) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `topic` text, + `content` text, + `content_lines` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_email_templates` (`entity`,`label`,`lang`), + KEY `idx_type` (`type_template`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_email_templates` +-- + +LOCK TABLES `llx_c_email_templates` WRITE; +/*!40000 ALTER TABLE `llx_c_email_templates` DISABLE KEYS */; +INSERT INTO `llx_c_email_templates` VALUES (1,1,NULL,'propal_send',NULL,1,NULL,NULL,'2017-02-12 16:42:47','ggg',1,1,'gg','gggfff',NULL); +/*!40000 ALTER TABLE `llx_c_email_templates` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_field_list` +-- + +DROP TABLE IF EXISTS `llx_c_field_list`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_field_list` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `element` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `name` varchar(32) NOT NULL, + `alias` varchar(32) NOT NULL, + `title` varchar(32) NOT NULL, + `align` varchar(6) DEFAULT 'left', + `sort` tinyint(4) NOT NULL DEFAULT '1', + `search` tinyint(4) NOT NULL DEFAULT '0', + `enabled` varchar(255) DEFAULT '1', + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_field_list` +-- + +LOCK TABLES `llx_c_field_list` WRITE; +/*!40000 ALTER TABLE `llx_c_field_list` DISABLE KEYS */; +INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8); +/*!40000 ALTER TABLE `llx_c_field_list` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_format_cards` +-- + +DROP TABLE IF EXISTS `llx_c_format_cards`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_format_cards` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(50) NOT NULL, + `name` varchar(50) NOT NULL, + `paper_size` varchar(20) NOT NULL, + `orientation` varchar(1) NOT NULL, + `metric` varchar(5) NOT NULL, + `leftmargin` double(24,8) NOT NULL, + `topmargin` double(24,8) NOT NULL, + `nx` int(11) NOT NULL, + `ny` int(11) NOT NULL, + `spacex` double(24,8) NOT NULL, + `spacey` double(24,8) NOT NULL, + `width` double(24,8) NOT NULL, + `height` double(24,8) NOT NULL, + `font_size` int(11) NOT NULL, + `custom_x` double(24,8) NOT NULL, + `custom_y` double(24,8) NOT NULL, + `active` int(11) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_format_cards` +-- + +LOCK TABLES `llx_c_format_cards` WRITE; +/*!40000 ALTER TABLE `llx_c_format_cards` DISABLE KEYS */; +INSERT INTO `llx_c_format_cards` VALUES (1,'5160','Avery-5160, WL-875WX','letter','P','mm',5.58165000,12.70000000,3,10,3.55600000,0.00000000,65.87490000,25.40000000,7,0.00000000,0.00000000,1),(2,'5161','Avery-5161, WL-75WX','letter','P','mm',4.44500000,12.70000000,2,10,3.96800000,0.00000000,101.60000000,25.40000000,7,0.00000000,0.00000000,1),(3,'5162','Avery-5162, WL-100WX','letter','P','mm',3.87350000,22.35200000,2,7,4.95400000,0.00000000,101.60000000,33.78100000,8,0.00000000,0.00000000,1),(4,'5163','Avery-5163, WL-125WX','letter','P','mm',4.57200000,12.70000000,2,5,3.55600000,0.00000000,101.60000000,50.80000000,10,0.00000000,0.00000000,1),(5,'5164','5164 (Letter)','letter','P','in',0.14800000,0.50000000,2,3,0.20310000,0.00000000,4.00000000,3.33000000,12,0.00000000,0.00000000,0),(6,'8600','Avery-8600','letter','P','mm',7.10000000,19.00000000,3,10,9.50000000,3.10000000,66.60000000,25.40000000,7,0.00000000,0.00000000,1),(7,'99012','DYMO 99012 89*36mm','custom','L','mm',1.00000000,1.00000000,1,1,0.00000000,0.00000000,36.00000000,89.00000000,10,36.00000000,89.00000000,1),(8,'99014','DYMO 99014 101*54mm','custom','L','mm',1.00000000,1.00000000,1,1,0.00000000,0.00000000,54.00000000,101.00000000,10,54.00000000,101.00000000,1),(9,'AVERYC32010','Avery-C32010','A4','P','mm',15.00000000,13.00000000,2,5,10.00000000,0.00000000,85.00000000,54.00000000,10,0.00000000,0.00000000,1),(10,'CARD','Dolibarr Business cards','A4','P','mm',15.00000000,15.00000000,2,5,0.00000000,0.00000000,85.00000000,54.00000000,10,0.00000000,0.00000000,1),(11,'L7163','Avery-L7163','A4','P','mm',5.00000000,15.00000000,2,7,2.50000000,0.00000000,99.10000000,38.10000000,8,0.00000000,0.00000000,1); +/*!40000 ALTER TABLE `llx_c_format_cards` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_forme_juridique` +-- + +DROP TABLE IF EXISTS `llx_c_forme_juridique`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_forme_juridique` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` int(11) NOT NULL, + `fk_pays` int(11) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `isvatexempted` tinyint(4) NOT NULL DEFAULT '0', + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_forme_juridique` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=100221 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_forme_juridique` +-- + +LOCK TABLES `llx_c_forme_juridique` WRITE; +/*!40000 ALTER TABLE `llx_c_forme_juridique` DISABLE KEYS */; +INSERT INTO `llx_c_forme_juridique` VALUES (100001,100001,1,'Etudiant',0,0,'cabinetmed',0),(100002,100002,1,'Retraité',0,0,'cabinetmed',0),(100003,100003,1,'Artisan',0,0,'cabinetmed',0),(100004,100004,1,'Femme de ménage',0,0,'cabinetmed',0),(100005,100005,1,'Professeur',0,0,'cabinetmed',0),(100006,100006,1,'Profession libérale',0,0,'cabinetmed',0),(100007,100007,1,'Informaticien',0,0,'cabinetmed',0),(100009,0,0,'-',0,1,NULL,0),(100010,2301,23,'Monotributista',0,1,NULL,0),(100011,2302,23,'Sociedad Civil',0,1,NULL,0),(100012,2303,23,'Sociedades Comerciales',0,1,NULL,0),(100013,2304,23,'Sociedades de Hecho',0,1,NULL,0),(100014,2305,23,'Sociedades Irregulares',0,1,NULL,0),(100015,2306,23,'Sociedad Colectiva',0,1,NULL,0),(100016,2307,23,'Sociedad en Comandita Simple',0,1,NULL,0),(100017,2308,23,'Sociedad de Capital e Industria',0,1,NULL,0),(100018,2309,23,'Sociedad Accidental o en participación',0,1,NULL,0),(100019,2310,23,'Sociedad de Responsabilidad Limitada',0,1,NULL,0),(100020,2311,23,'Sociedad Anónima',0,1,NULL,0),(100021,2312,23,'Sociedad Anónima con Participación Estatal Mayoritaria',0,1,NULL,0),(100022,2313,23,'Sociedad en Comandita por Acciones (arts. 315 a 324, LSC)',0,1,NULL,0),(100023,11,1,'Artisan Commerçant (EI)',0,1,NULL,0),(100024,12,1,'Commerçant (EI)',0,1,NULL,0),(100025,13,1,'Artisan (EI)',0,1,NULL,0),(100026,14,1,'Officier public ou ministériel',0,1,NULL,0),(100027,15,1,'Profession libérale (EI)',0,1,NULL,0),(100028,16,1,'Exploitant agricole',0,1,NULL,0),(100029,17,1,'Agent commercial',0,1,NULL,0),(100030,18,1,'Associé Gérant de société',0,1,NULL,0),(100031,19,1,'Personne physique',0,1,NULL,0),(100032,21,1,'Indivision',0,1,NULL,0),(100033,22,1,'Société créée de fait',0,1,NULL,0),(100034,23,1,'Société en participation',0,1,NULL,0),(100035,27,1,'Paroisse hors zone concordataire',0,1,NULL,0),(100036,29,1,'Groupement de droit privé non doté de la personnalité morale',0,1,NULL,0),(100037,31,1,'Personne morale de droit étranger, immatriculée au RCS',0,1,NULL,0),(100038,32,1,'Personne morale de droit étranger, non immatriculée au RCS',0,1,NULL,0),(100039,35,1,'Régime auto-entrepreneur',0,1,NULL,0),(100040,41,1,'Etablissement public ou régie à caractère industriel ou commercial',0,1,NULL,0),(100041,51,1,'Société coopérative commerciale particulière',0,1,NULL,0),(100042,52,1,'Société en nom collectif',0,1,NULL,0),(100043,53,1,'Société en commandite',0,1,NULL,0),(100044,54,1,'Société à responsabilité limitée (SARL)',0,1,NULL,0),(100045,55,1,'Société anonyme à conseil d administration',0,1,NULL,0),(100046,56,1,'Société anonyme à directoire',0,1,NULL,0),(100047,57,1,'Société par actions simplifiée (SAS)',0,1,NULL,0),(100048,58,1,'Entreprise Unipersonnelle à Responsabilité Limitée (EURL)',0,1,NULL,0),(100049,59,1,'Société par actions simplifiée unipersonnelle (SASU)',0,1,NULL,0),(100050,60,1,'Entreprise Individuelle à Responsabilité Limitée (EIRL)',0,1,NULL,0),(100051,61,1,'Caisse d\'épargne et de prévoyance',0,1,NULL,0),(100052,62,1,'Groupement d\'intérêt économique (GIE)',0,1,NULL,0),(100053,63,1,'Société coopérative agricole',0,1,NULL,0),(100054,64,1,'Société non commerciale d assurances',0,1,NULL,0),(100055,65,1,'Société civile',0,1,NULL,0),(100056,69,1,'Personnes de droit privé inscrites au RCS',0,1,NULL,0),(100057,71,1,'Administration de l état',0,1,NULL,0),(100058,72,1,'Collectivité territoriale',0,1,NULL,0),(100059,73,1,'Etablissement public administratif',0,1,NULL,0),(100060,74,1,'Personne morale de droit public administratif',0,1,NULL,0),(100061,81,1,'Organisme gérant régime de protection social à adhésion obligatoire',0,1,NULL,0),(100062,82,1,'Organisme mutualiste',0,1,NULL,0),(100063,83,1,'Comité d entreprise',0,1,NULL,0),(100064,84,1,'Organisme professionnel',0,1,NULL,0),(100065,85,1,'Organisme de retraite à adhésion non obligatoire',0,1,NULL,0),(100066,91,1,'Syndicat de propriétaires',0,1,NULL,0),(100067,92,1,'Association loi 1901 ou assimilé',0,1,NULL,0),(100068,93,1,'Fondation',0,1,NULL,0),(100069,99,1,'Personne morale de droit privé',0,1,NULL,0),(100070,200,2,'Indépendant',0,1,NULL,0),(100071,201,2,'SPRL - Société à responsabilité limitée',0,1,NULL,0),(100072,202,2,'SA - Société Anonyme',0,1,NULL,0),(100073,203,2,'SCRL - Société coopérative à responsabilité limitée',0,1,NULL,0),(100074,204,2,'ASBL - Association sans but Lucratif',0,1,NULL,0),(100075,205,2,'SCRI - Société coopérative à responsabilité illimitée',0,1,NULL,0),(100076,206,2,'SCS - Société en commandite simple',0,1,NULL,0),(100077,207,2,'SCA - Société en commandite par action',0,1,NULL,0),(100078,208,2,'SNC - Société en nom collectif',0,1,NULL,0),(100079,209,2,'GIE - Groupement d intérêt économique',0,1,NULL,0),(100080,210,2,'GEIE - Groupement européen d intérêt économique',0,1,NULL,0),(100081,220,2,'Eenmanszaak',0,1,NULL,0),(100082,221,2,'BVBA - Besloten vennootschap met beperkte aansprakelijkheid',0,1,NULL,0),(100083,222,2,'NV - Naamloze Vennootschap',0,1,NULL,0),(100084,223,2,'CVBA - Coöperatieve vennootschap met beperkte aansprakelijkheid',0,1,NULL,0),(100085,224,2,'VZW - Vereniging zonder winstoogmerk',0,1,NULL,0),(100086,225,2,'CVOA - Coöperatieve vennootschap met onbeperkte aansprakelijkheid ',0,1,NULL,0),(100087,226,2,'GCV - Gewone commanditaire vennootschap',0,1,NULL,0),(100088,227,2,'Comm.VA - Commanditaire vennootschap op aandelen',0,1,NULL,0),(100089,228,2,'VOF - Vennootschap onder firma',0,1,NULL,0),(100090,229,2,'VS0 - Vennootschap met sociaal oogmerk',0,1,NULL,0),(100091,500,5,'GmbH - Gesellschaft mit beschränkter Haftung',0,1,NULL,0),(100092,501,5,'AG - Aktiengesellschaft ',0,1,NULL,0),(100093,502,5,'GmbH&Co. KG - Gesellschaft mit beschränkter Haftung & Compagnie Kommanditgesellschaft',0,1,NULL,0),(100094,503,5,'Gewerbe - Personengesellschaft',0,1,NULL,0),(100095,504,5,'UG - Unternehmergesellschaft -haftungsbeschränkt-',0,1,NULL,0),(100096,505,5,'GbR - Gesellschaft des bürgerlichen Rechts',0,1,NULL,0),(100097,506,5,'KG - Kommanditgesellschaft',0,1,NULL,0),(100098,507,5,'Ltd. - Limited Company',0,1,NULL,0),(100099,508,5,'OHG - Offene Handelsgesellschaft',0,1,NULL,0),(100100,10201,102,'Ατομική επιχείρηση',0,1,NULL,0),(100101,10202,102,'Εταιρική επιχείρηση',0,1,NULL,0),(100102,10203,102,'Ομόρρυθμη Εταιρεία Ο.Ε',0,1,NULL,0),(100103,10204,102,'Ετερόρρυθμη Εταιρεία Ε.Ε',0,1,NULL,0),(100104,10205,102,'Εταιρεία Περιορισμένης Ευθύνης Ε.Π.Ε',0,1,NULL,0),(100105,10206,102,'Ανώνυμη Εταιρεία Α.Ε',0,1,NULL,0),(100106,10207,102,'Ανώνυμη ναυτιλιακή εταιρεία Α.Ν.Ε',0,1,NULL,0),(100107,10208,102,'Συνεταιρισμός',0,1,NULL,0),(100108,10209,102,'Συμπλοιοκτησία',0,1,NULL,0),(100109,301,3,'Società semplice',0,1,NULL,0),(100110,302,3,'Società in nome collettivo s.n.c.',0,1,NULL,0),(100111,303,3,'Società in accomandita semplice s.a.s.',0,1,NULL,0),(100112,304,3,'Società per azioni s.p.a.',0,1,NULL,0),(100113,305,3,'Società a responsabilità limitata s.r.l.',0,1,NULL,0),(100114,306,3,'Società in accomandita per azioni s.a.p.a.',0,1,NULL,0),(100115,307,3,'Società cooperativa a r.l.',0,1,NULL,0),(100116,308,3,'Società consortile',0,1,NULL,0),(100117,309,3,'Società europea',0,1,NULL,0),(100118,310,3,'Società cooperativa europea',0,1,NULL,0),(100119,311,3,'Società unipersonale',0,1,NULL,0),(100120,312,3,'Società di professionisti',0,1,NULL,0),(100121,313,3,'Società di fatto',0,1,NULL,0),(100122,315,3,'Società apparente',0,1,NULL,0),(100123,316,3,'Impresa individuale ',0,1,NULL,0),(100124,317,3,'Impresa coniugale',0,1,NULL,0),(100125,318,3,'Impresa familiare',0,1,NULL,0),(100126,319,3,'Consorzio cooperativo',0,1,NULL,0),(100127,320,3,'Società cooperativa sociale',0,1,NULL,0),(100128,321,3,'Società cooperativa di consumo',0,1,NULL,0),(100129,322,3,'Società cooperativa agricola',0,1,NULL,0),(100130,323,3,'A.T.I. Associazione temporanea di imprese',0,1,NULL,0),(100131,324,3,'R.T.I. Raggruppamento temporaneo di imprese',0,1,NULL,0),(100132,325,3,'Studio associato',0,1,NULL,0),(100133,600,6,'Raison Individuelle',0,1,NULL,0),(100134,601,6,'Société Simple',0,1,NULL,0),(100135,602,6,'Société en nom collectif',0,1,NULL,0),(100136,603,6,'Société en commandite',0,1,NULL,0),(100137,604,6,'Société anonyme (SA)',0,1,NULL,0),(100138,605,6,'Société en commandite par actions',0,1,NULL,0),(100139,606,6,'Société à responsabilité limitée (SARL)',0,1,NULL,0),(100140,607,6,'Société coopérative',0,1,NULL,0),(100141,608,6,'Association',0,1,NULL,0),(100142,609,6,'Fondation',0,1,NULL,0),(100143,700,7,'Sole Trader',0,1,NULL,0),(100144,701,7,'Partnership',0,1,NULL,0),(100145,702,7,'Private Limited Company by shares (LTD)',0,1,NULL,0),(100146,703,7,'Public Limited Company',0,1,NULL,0),(100147,704,7,'Workers Cooperative',0,1,NULL,0),(100148,705,7,'Limited Liability Partnership',0,1,NULL,0),(100149,706,7,'Franchise',0,1,NULL,0),(100150,1000,10,'Société à responsabilité limitée (SARL)',0,1,NULL,0),(100151,1001,10,'Société en Nom Collectif (SNC)',0,1,NULL,0),(100152,1002,10,'Société en Commandite Simple (SCS)',0,1,NULL,0),(100153,1003,10,'société en participation',0,1,NULL,0),(100154,1004,10,'Société Anonyme (SA)',0,1,NULL,0),(100155,1005,10,'Société Unipersonnelle à Responsabilité Limitée (SUARL)',0,1,NULL,0),(100156,1006,10,'Groupement d\'intérêt économique (GEI)',0,1,NULL,0),(100157,1007,10,'Groupe de sociétés',0,1,NULL,0),(100158,1701,17,'Eenmanszaak',0,1,NULL,0),(100159,1702,17,'Maatschap',0,1,NULL,0),(100160,1703,17,'Vennootschap onder firma',0,1,NULL,0),(100161,1704,17,'Commanditaire vennootschap',0,1,NULL,0),(100162,1705,17,'Besloten vennootschap (BV)',0,1,NULL,0),(100163,1706,17,'Naamloze Vennootschap (NV)',0,1,NULL,0),(100164,1707,17,'Vereniging',0,1,NULL,0),(100165,1708,17,'Stichting',0,1,NULL,0),(100166,1709,17,'Coöperatie met beperkte aansprakelijkheid (BA)',0,1,NULL,0),(100167,1710,17,'Coöperatie met uitgesloten aansprakelijkheid (UA)',0,1,NULL,0),(100168,1711,17,'Coöperatie met wettelijke aansprakelijkheid (WA)',0,1,NULL,0),(100169,1712,17,'Onderlinge waarborgmaatschappij',0,1,NULL,0),(100170,401,4,'Empresario Individual',0,1,NULL,0),(100171,402,4,'Comunidad de Bienes',0,1,NULL,0),(100172,403,4,'Sociedad Civil',0,1,NULL,0),(100173,404,4,'Sociedad Colectiva',0,1,NULL,0),(100174,405,4,'Sociedad Limitada',0,1,NULL,0),(100175,406,4,'Sociedad Anónima',0,1,NULL,0),(100176,407,4,'Sociedad Comanditaria por Acciones',0,1,NULL,0),(100177,408,4,'Sociedad Comanditaria Simple',0,1,NULL,0),(100178,409,4,'Sociedad Laboral',0,1,NULL,0),(100179,410,4,'Sociedad Cooperativa',0,1,NULL,0),(100180,411,4,'Sociedad de Garantía Recíproca',0,1,NULL,0),(100181,412,4,'Entidad de Capital-Riesgo',0,1,NULL,0),(100182,413,4,'Agrupación de Interés Económico',0,1,NULL,0),(100183,414,4,'Sociedad de Inversión Mobiliaria',0,1,NULL,0),(100184,415,4,'Agrupación sin Ánimo de Lucro',0,1,NULL,0),(100185,15201,152,'Mauritius Private Company Limited By Shares',0,1,NULL,0),(100186,15202,152,'Mauritius Company Limited By Guarantee',0,1,NULL,0),(100187,15203,152,'Mauritius Public Company Limited By Shares',0,1,NULL,0),(100188,15204,152,'Mauritius Foreign Company',0,1,NULL,0),(100189,15205,152,'Mauritius GBC1 (Offshore Company)',0,1,NULL,0),(100190,15206,152,'Mauritius GBC2 (International Company)',0,1,NULL,0),(100191,15207,152,'Mauritius General Partnership',0,1,NULL,0),(100192,15208,152,'Mauritius Limited Partnership',0,1,NULL,0),(100193,15209,152,'Mauritius Sole Proprietorship',0,1,NULL,0),(100194,15210,152,'Mauritius Trusts',0,1,NULL,0),(100195,15401,154,'Sociedad en nombre colectivo',0,1,NULL,0),(100196,15402,154,'Sociedad en comandita simple',0,1,NULL,0),(100197,15403,154,'Sociedad de responsabilidad limitada',0,1,NULL,0),(100198,15404,154,'Sociedad anónima',0,1,NULL,0),(100199,15405,154,'Sociedad en comandita por acciones',0,1,NULL,0),(100200,15406,154,'Sociedad cooperativa',0,1,NULL,0),(100201,4100,41,'GmbH - Gesellschaft mit beschränkter Haftung',0,1,NULL,0),(100202,4101,41,'GesmbH - Gesellschaft mit beschränkter Haftung',0,1,NULL,0),(100203,4102,41,'AG - Aktiengesellschaft',0,1,NULL,0),(100204,4103,41,'EWIV - Europäische wirtschaftliche Interessenvereinigung',0,1,NULL,0),(100205,4104,41,'KEG - Kommanditerwerbsgesellschaft',0,1,NULL,0),(100206,4105,41,'OEG - Offene Erwerbsgesellschaft',0,1,NULL,0),(100207,4106,41,'OHG - Offene Handelsgesellschaft',0,1,NULL,0),(100208,4107,41,'AG & Co KG - Kommanditgesellschaft',0,1,NULL,0),(100209,4108,41,'GmbH & Co KG - Kommanditgesellschaft',0,1,NULL,0),(100210,4109,41,'KG - Kommanditgesellschaft',0,1,NULL,0),(100211,4110,41,'OG - Offene Gesellschaft',0,1,NULL,0),(100212,4111,41,'GbR - Gesellschaft nach bürgerlichem Recht',0,1,NULL,0),(100213,4112,41,'GesbR - Gesellschaft nach bürgerlichem Recht',0,1,NULL,0),(100214,4113,41,'GesnbR - Gesellschaft nach bürgerlichem Recht',0,1,NULL,0),(100215,4114,41,'e.U. - eingetragener Einzelunternehmer',0,1,NULL,0),(100216,17801,178,'Empresa individual',0,1,NULL,0),(100217,17802,178,'Asociación General',0,1,NULL,0),(100218,17803,178,'Sociedad de Responsabilidad Limitada',0,1,NULL,0),(100219,17804,178,'Sociedad Civil',0,1,NULL,0),(100220,17805,178,'Sociedad Anónima',0,1,NULL,0); +/*!40000 ALTER TABLE `llx_c_forme_juridique` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_holiday_types` +-- + +DROP TABLE IF EXISTS `llx_c_holiday_types`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_holiday_types` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `label` varchar(255) NOT NULL, + `affect` int(11) NOT NULL, + `delay` int(11) NOT NULL, + `newByMonth` double(8,5) NOT NULL DEFAULT '0.00000', + `fk_country` int(11) DEFAULT NULL, + `active` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_holiday_types` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_holiday_types` +-- + +LOCK TABLES `llx_c_holiday_types` WRITE; +/*!40000 ALTER TABLE `llx_c_holiday_types` DISABLE KEYS */; +INSERT INTO `llx_c_holiday_types` VALUES (1,'LEAVE_SICK','Sick leave',0,0,0.00000,NULL,1),(2,'LEAVE_OTHER','Other leave',0,0,0.00000,NULL,1),(3,'LEAVE_PAID','Paid vacation',1,7,0.00000,NULL,1),(4,'LEAVE_RTT_FR','RTT',1,7,0.83000,1,0),(5,'LEAVE_PAID_FR','Paid vacation',1,30,2.08334,1,0); +/*!40000 ALTER TABLE `llx_c_holiday_types` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_hrm_department` +-- + +DROP TABLE IF EXISTS `llx_c_hrm_department`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_hrm_department` ( + `rowid` int(11) NOT NULL, + `pos` tinyint(4) NOT NULL DEFAULT '0', + `code` varchar(16) NOT NULL, + `label` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_hrm_department` +-- + +LOCK TABLES `llx_c_hrm_department` WRITE; +/*!40000 ALTER TABLE `llx_c_hrm_department` DISABLE KEYS */; +INSERT INTO `llx_c_hrm_department` VALUES (1,5,'MANAGEMENT','Management',1),(2,10,'GESTION','Gestion',1),(3,15,'TRAINING','Training',1),(4,20,'IT','Inform. Technology (IT)',1),(5,25,'MARKETING','Marketing',1),(6,30,'SALES','Sales',1),(7,35,'LEGAL','Legal',1),(8,40,'FINANCIAL','Financial accounting',1),(9,45,'HUMANRES','Human resources',1),(10,50,'PURCHASING','Purchasing',1),(11,55,'SERVICES','Services',1),(12,60,'CUSTOMSERV','Customer service',1),(13,65,'CONSULTING','Consulting',1),(14,70,'LOGISTIC','Logistics',1),(15,75,'CONSTRUCT','Engineering/design',1),(16,80,'PRODUCTION','Manufacturing',1),(17,85,'QUALITY','Quality assurance',1),(18,85,'MAINT','Plant assurance',1); +/*!40000 ALTER TABLE `llx_c_hrm_department` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_hrm_function` +-- + +DROP TABLE IF EXISTS `llx_c_hrm_function`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_hrm_function` ( + `rowid` int(11) NOT NULL, + `pos` tinyint(4) NOT NULL DEFAULT '0', + `code` varchar(16) NOT NULL, + `label` varchar(50) DEFAULT NULL, + `c_level` tinyint(4) NOT NULL DEFAULT '0', + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_hrm_function` +-- + +LOCK TABLES `llx_c_hrm_function` WRITE; +/*!40000 ALTER TABLE `llx_c_hrm_function` DISABLE KEYS */; +INSERT INTO `llx_c_hrm_function` VALUES (1,5,'EXECBOARD','Executive board',0,1),(2,10,'MANAGDIR','Managing director',1,1),(3,15,'ACCOUNTMANAG','Account manager',0,1),(4,20,'ENGAGDIR','Engagement director',1,1),(5,25,'DIRECTOR','Director',1,1),(6,30,'PROJMANAG','Project manager',0,1),(7,35,'DEPHEAD','Department head',0,1),(8,40,'SECRETAR','Secretary',0,1),(9,45,'EMPLOYEE','Department employee',0,1); +/*!40000 ALTER TABLE `llx_c_hrm_function` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_incoterms` +-- + +DROP TABLE IF EXISTS `llx_c_incoterms`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_incoterms` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(3) NOT NULL, + `libelle` varchar(255) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_incoterms` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_incoterms` +-- + +LOCK TABLES `llx_c_incoterms` WRITE; +/*!40000 ALTER TABLE `llx_c_incoterms` DISABLE KEYS */; +INSERT INTO `llx_c_incoterms` VALUES (1,'EXW','Ex Works, au départ non chargé, non dédouané sortie d\'usine (uniquement adapté aux flux domestiques, nationaux)',1),(2,'FCA','Free Carrier, marchandises dédouanées et chargées dans le pays de départ, chez le vendeur ou chez le commissionnaire de transport de l\'acheteur',1),(3,'FAS','Free Alongside Ship, sur le quai du port de départ',1),(4,'FOB','Free On Board, chargé sur le bateau, les frais de chargement dans celui-ci étant fonction du liner term indiqué par la compagnie maritime (à la charge du vendeur)',1),(5,'CFR','Cost and Freight, chargé dans le bateau, livraison au port de départ, frais payés jusqu\'au port d\'arrivée, sans assurance pour le transport, non déchargé du navire à destination (les frais de déchargement sont inclus ou non au port d\'arrivée)',1),(6,'CIF','Cost, Insurance and Freight, chargé sur le bateau, frais jusqu\'au port d\'arrivée, avec l\'assurance marchandise transportée souscrite par le vendeur pour le compte de l\'acheteur',1),(7,'CPT','Carriage Paid To, livraison au premier transporteur, frais jusqu\'au déchargement du mode de transport, sans assurance pour le transport',1),(8,'CIP','Carriage and Insurance Paid to, idem CPT, avec assurance marchandise transportée souscrite par le vendeur pour le compte de l\'acheteur',1),(9,'DAT','Delivered At Terminal, marchandises (déchargées) livrées sur quai, dans un terminal maritime, fluvial, aérien, routier ou ferroviaire désigné (dédouanement import, et post-acheminement payés par l\'acheteur)',1),(10,'DAP','Delivered At Place, marchandises (non déchargées) mises à disposition de l\'acheteur dans le pays d\'importation au lieu précisé dans le contrat (déchargement, dédouanement import payé par l\'acheteur)',1),(11,'DDP','Delivered Duty Paid, marchandises (non déchargées) livrées à destination finale, dédouanement import et taxes à la charge du vendeur ; l\'acheteur prend en charge uniquement le déchargement (si exclusion des taxes type TVA, le préciser clairement)',1); +/*!40000 ALTER TABLE `llx_c_incoterms` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_input_method` +-- + +DROP TABLE IF EXISTS `llx_c_input_method`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_input_method` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) DEFAULT NULL, + `libelle` varchar(60) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_methode_commande_fournisseur` (`code`), + UNIQUE KEY `uk_c_input_method` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_input_method` +-- + +LOCK TABLES `llx_c_input_method` WRITE; +/*!40000 ALTER TABLE `llx_c_input_method` DISABLE KEYS */; +INSERT INTO `llx_c_input_method` VALUES (1,'OrderByMail','Courrier',1,NULL),(2,'OrderByFax','Fax',1,NULL),(3,'OrderByEMail','EMail',1,NULL),(4,'OrderByPhone','Téléphone',1,NULL),(5,'OrderByWWW','En ligne',1,NULL); +/*!40000 ALTER TABLE `llx_c_input_method` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_input_reason` +-- + +DROP TABLE IF EXISTS `llx_c_input_reason`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_input_reason` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) NOT NULL, + `label` varchar(60) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_input_reason` (`code`) +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_input_reason` +-- + +LOCK TABLES `llx_c_input_reason` WRITE; +/*!40000 ALTER TABLE `llx_c_input_reason` DISABLE KEYS */; +INSERT INTO `llx_c_input_reason` VALUES (1,'SRC_INTE','Web site',1,NULL),(2,'SRC_CAMP_MAIL','Mailing campaign',1,NULL),(3,'SRC_CAMP_PHO','Phone campaign',1,NULL),(4,'SRC_CAMP_FAX','Fax campaign',1,NULL),(5,'SRC_COMM','Commercial contact',1,NULL),(6,'SRC_SHOP','Shop contact',1,NULL),(7,'SRC_CAMP_EMAIL','EMailing campaign',1,NULL),(8,'SRC_WOM','Word of mouth',1,NULL),(9,'SRC_PARTNER','Partner',1,NULL),(10,'SRC_EMPLOYEE','Employee',1,NULL),(11,'SRC_SPONSORING','Sponsoring',1,NULL); +/*!40000 ALTER TABLE `llx_c_input_reason` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_lead_status` +-- + +DROP TABLE IF EXISTS `llx_c_lead_status`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_lead_status` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(10) DEFAULT NULL, + `label` varchar(50) DEFAULT NULL, + `position` int(11) DEFAULT NULL, + `percent` double(5,2) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_lead_status_code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_lead_status` +-- + +LOCK TABLES `llx_c_lead_status` WRITE; +/*!40000 ALTER TABLE `llx_c_lead_status` DISABLE KEYS */; +INSERT INTO `llx_c_lead_status` VALUES (1,'PROSP','Prospection',10,0.00,1),(2,'QUAL','Qualification',20,20.00,1),(3,'PROPO','Proposal',30,40.00,1),(4,'NEGO','Negotiation',40,60.00,1),(5,'PENDING','Pending',50,50.00,0),(6,'WON','Won',60,100.00,1),(7,'LOST','Lost',70,0.00,1); +/*!40000 ALTER TABLE `llx_c_lead_status` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_methode_commande_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_c_methode_commande_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_methode_commande_fournisseur` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) DEFAULT NULL, + `libelle` varchar(60) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_methode_commande_fournisseur` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_methode_commande_fournisseur` +-- + +LOCK TABLES `llx_c_methode_commande_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_c_methode_commande_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_c_methode_commande_fournisseur` VALUES (1,'OrderByMail','Courrier',1),(2,'OrderByFax','Fax',1),(3,'OrderByEMail','EMail',1),(4,'OrderByPhone','Téléphone',1),(5,'OrderByWWW','En ligne',1); +/*!40000 ALTER TABLE `llx_c_methode_commande_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_paiement` +-- + +DROP TABLE IF EXISTS `llx_c_paiement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_paiement` ( + `id` int(11) NOT NULL, + `code` varchar(6) NOT NULL, + `libelle` varchar(62) DEFAULT NULL, + `type` smallint(6) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `accountancy_code` varchar(32) DEFAULT NULL, + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_paiement` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_paiement` +-- + +LOCK TABLES `llx_c_paiement` WRITE; +/*!40000 ALTER TABLE `llx_c_paiement` DISABLE KEYS */; +INSERT INTO `llx_c_paiement` VALUES (0,'','-',3,1,NULL,NULL),(1,'TIP','TIP',2,0,NULL,NULL),(2,'VIR','Virement',2,1,NULL,NULL),(3,'PRE','Prélèvement',2,1,NULL,NULL),(4,'LIQ','Espèces',2,1,NULL,NULL),(6,'CB','Carte Bancaire',2,1,NULL,NULL),(7,'CHQ','Chèque',2,1,NULL,NULL),(50,'VAD','Paiement en ligne',2,0,NULL,NULL),(51,'TRA','Traite',2,0,NULL,NULL),(52,'LCR','LCR',2,0,NULL,NULL),(53,'FAC','Factor',2,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_paiement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_paper_format` +-- + +DROP TABLE IF EXISTS `llx_c_paper_format`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_paper_format` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `label` varchar(50) NOT NULL, + `width` float(6,2) DEFAULT '0.00', + `height` float(6,2) DEFAULT '0.00', + `unit` varchar(5) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_paper_format` +-- + +LOCK TABLES `llx_c_paper_format` WRITE; +/*!40000 ALTER TABLE `llx_c_paper_format` DISABLE KEYS */; +INSERT INTO `llx_c_paper_format` VALUES (1,'EU4A0','Format 4A0',1682.00,2378.00,'mm',1,NULL),(2,'EU2A0','Format 2A0',1189.00,1682.00,'mm',1,NULL),(3,'EUA0','Format A0',840.00,1189.00,'mm',1,NULL),(4,'EUA1','Format A1',594.00,840.00,'mm',1,NULL),(5,'EUA2','Format A2',420.00,594.00,'mm',1,NULL),(6,'EUA3','Format A3',297.00,420.00,'mm',1,NULL),(7,'EUA4','Format A4',210.00,297.00,'mm',1,NULL),(8,'EUA5','Format A5',148.00,210.00,'mm',1,NULL),(9,'EUA6','Format A6',105.00,148.00,'mm',1,NULL),(100,'USLetter','Format Letter (A)',216.00,279.00,'mm',1,NULL),(105,'USLegal','Format Legal',216.00,356.00,'mm',1,NULL),(110,'USExecutive','Format Executive',190.00,254.00,'mm',1,NULL),(115,'USLedger','Format Ledger/Tabloid (B)',279.00,432.00,'mm',1,NULL),(200,'CAP1','Format Canadian P1',560.00,860.00,'mm',1,NULL),(205,'CAP2','Format Canadian P2',430.00,560.00,'mm',1,NULL),(210,'CAP3','Format Canadian P3',280.00,430.00,'mm',1,NULL),(215,'CAP4','Format Canadian P4',215.00,280.00,'mm',1,NULL),(220,'CAP5','Format Canadian P5',140.00,215.00,'mm',1,NULL),(225,'CAP6','Format Canadian P6',107.00,140.00,'mm',1,NULL); +/*!40000 ALTER TABLE `llx_c_paper_format` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_payment_term` +-- + +DROP TABLE IF EXISTS `llx_c_payment_term`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_payment_term` ( + `rowid` int(11) NOT NULL, + `code` varchar(16) DEFAULT NULL, + `sortorder` smallint(6) DEFAULT NULL, + `active` tinyint(4) DEFAULT '1', + `libelle` varchar(255) DEFAULT NULL, + `libelle_facture` text, + `type_cdr` tinyint(4) DEFAULT NULL, + `nbjour` smallint(6) DEFAULT NULL, + `decalage` smallint(6) DEFAULT NULL, + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_payment_term` +-- + +LOCK TABLES `llx_c_payment_term` WRITE; +/*!40000 ALTER TABLE `llx_c_payment_term` DISABLE KEYS */; +INSERT INTO `llx_c_payment_term` VALUES (1,'RECEP',1,1,'A réception','Réception de facture',0,0,NULL,NULL),(2,'30D',2,1,'30 jours','Réglement à 30 jours',0,30,NULL,NULL),(3,'30DENDMONTH',3,1,'30 jours fin de mois','Réglement à 30 jours fin de mois',1,30,NULL,NULL),(4,'60D',4,1,'60 jours','Réglement à 60 jours',0,60,NULL,NULL),(5,'60DENDMONTH',5,1,'60 jours fin de mois','Réglement à 60 jours fin de mois',1,60,NULL,NULL),(6,'PT_ORDER',6,1,'A réception de commande','A réception de commande',0,0,NULL,NULL),(7,'PT_DELIVERY',7,1,'Livraison','Règlement à la livraison',0,0,NULL,NULL),(8,'PT_5050',8,1,'50 et 50','Règlement 50% à la commande, 50% à la livraison',0,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_payment_term` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_pays` +-- + +DROP TABLE IF EXISTS `llx_c_pays`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_pays` ( + `rowid` int(11) NOT NULL, + `code` varchar(2) NOT NULL, + `code_iso` varchar(3) DEFAULT NULL, + `libelle` varchar(50) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_c_pays_code` (`code`), + UNIQUE KEY `idx_c_pays_libelle` (`libelle`), + UNIQUE KEY `idx_c_pays_code_iso` (`code_iso`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_pays` +-- + +LOCK TABLES `llx_c_pays` WRITE; +/*!40000 ALTER TABLE `llx_c_pays` DISABLE KEYS */; +INSERT INTO `llx_c_pays` VALUES (0,'',NULL,'-',1),(1,'FR',NULL,'France',1),(2,'BE',NULL,'Belgium',1),(3,'IT',NULL,'Italy',1),(4,'ES',NULL,'Spain',1),(5,'DE',NULL,'Germany',1),(6,'CH',NULL,'Suisse',1),(7,'GB',NULL,'United Kingdow',1),(8,'IE',NULL,'Irland',1),(9,'CN',NULL,'China',1),(10,'TN',NULL,'Tunisie',1),(11,'US',NULL,'United States',1),(12,'MA',NULL,'Maroc',1),(13,'DZ',NULL,'Algérie',1),(14,'CA',NULL,'Canada',1),(15,'TG',NULL,'Togo',1),(16,'GA',NULL,'Gabon',1),(17,'NL',NULL,'Nerderland',1),(18,'HU',NULL,'Hongrie',1),(19,'RU',NULL,'Russia',1),(20,'SE',NULL,'Sweden',1),(21,'CI',NULL,'Côte d\'Ivoire',1),(22,'SN',NULL,'Sénégal',1),(23,'AR',NULL,'Argentine',1),(24,'CM',NULL,'Cameroun',1),(25,'PT',NULL,'Portugal',1),(26,'SA',NULL,'Arabie Saoudite',1),(27,'MC',NULL,'Monaco',1),(28,'AU',NULL,'Australia',1),(29,'SG',NULL,'Singapour',1),(30,'AF',NULL,'Afghanistan',1),(31,'AX',NULL,'Iles Aland',1),(32,'AL',NULL,'Albanie',1),(33,'AS',NULL,'Samoa américaines',1),(34,'AD',NULL,'Andorre',1),(35,'AO',NULL,'Angola',1),(36,'AI',NULL,'Anguilla',1),(37,'AQ',NULL,'Antarctique',1),(38,'AG',NULL,'Antigua-et-Barbuda',1),(39,'AM',NULL,'Arménie',1),(40,'AW',NULL,'Aruba',1),(41,'AT',NULL,'Autriche',1),(42,'AZ',NULL,'Azerbaïdjan',1),(43,'BS',NULL,'Bahamas',1),(44,'BH',NULL,'Bahreïn',1),(45,'BD',NULL,'Bangladesh',1),(46,'BB',NULL,'Barbade',1),(47,'BY',NULL,'Biélorussie',1),(48,'BZ',NULL,'Belize',1),(49,'BJ',NULL,'Bénin',1),(50,'BM',NULL,'Bermudes',1),(51,'BT',NULL,'Bhoutan',1),(52,'BO',NULL,'Bolivie',1),(53,'BA',NULL,'Bosnie-Herzégovine',1),(54,'BW',NULL,'Botswana',1),(55,'BV',NULL,'Ile Bouvet',1),(56,'BR',NULL,'Brésil',1),(57,'IO',NULL,'Territoire britannique de l\'Océan Indien',1),(58,'BN',NULL,'Brunei',1),(59,'BG',NULL,'Bulgarie',1),(60,'BF',NULL,'Burkina Faso',1),(61,'BI',NULL,'Burundi',1),(62,'KH',NULL,'Cambodge',1),(63,'CV',NULL,'Cap-Vert',1),(64,'KY',NULL,'Iles Cayman',1),(65,'CF',NULL,'République centrafricaine',1),(66,'TD',NULL,'Tchad',1),(67,'CL',NULL,'Chili',1),(68,'CX',NULL,'Ile Christmas',1),(69,'CC',NULL,'Iles des Cocos (Keeling)',1),(70,'CO',NULL,'Colombie',1),(71,'KM',NULL,'Comores',1),(72,'CG',NULL,'Congo',1),(73,'CD',NULL,'République démocratique du Congo',1),(74,'CK',NULL,'Iles Cook',1),(75,'CR',NULL,'Costa Rica',1),(76,'HR',NULL,'Croatie',1),(77,'CU',NULL,'Cuba',1),(78,'CY',NULL,'Chypre',1),(79,'CZ',NULL,'République Tchèque',1),(80,'DK',NULL,'Danemark',1),(81,'DJ',NULL,'Djibouti',1),(82,'DM',NULL,'Dominique',1),(83,'DO',NULL,'République Dominicaine',1),(84,'EC',NULL,'Equateur',1),(85,'EG',NULL,'Egypte',1),(86,'SV',NULL,'Salvador',1),(87,'GQ',NULL,'Guinée Equatoriale',1),(88,'ER',NULL,'Erythrée',1),(89,'EE',NULL,'Estonie',1),(90,'ET',NULL,'Ethiopie',1),(91,'FK',NULL,'Iles Falkland',1),(92,'FO',NULL,'Iles Féroé',1),(93,'FJ',NULL,'Iles Fidji',1),(94,'FI',NULL,'Finlande',1),(95,'GF',NULL,'Guyane française',1),(96,'PF',NULL,'Polynésie française',1),(97,'TF',NULL,'Terres australes françaises',1),(98,'GM',NULL,'Gambie',1),(99,'GE',NULL,'Géorgie',1),(100,'GH',NULL,'Ghana',1),(101,'GI',NULL,'Gibraltar',1),(102,'GR',NULL,'Grèce',1),(103,'GL',NULL,'Groenland',1),(104,'GD',NULL,'Grenade',1),(105,'GP',NULL,'Guadeloupe',1),(106,'GU',NULL,'Guam',1),(107,'GT',NULL,'Guatemala',1),(108,'GN',NULL,'Guinée',1),(109,'GW',NULL,'Guinée-Bissao',1),(110,'GY',NULL,'Guyana',1),(111,'HT',NULL,'Haiti',1),(112,'HM',NULL,'Iles Heard et McDonald',1),(113,'VA',NULL,'Saint-Siège (Vatican)',1),(114,'HN',NULL,'Honduras',1),(115,'HK',NULL,'Hong Kong',1),(116,'IS',NULL,'Islande',1),(117,'IN',NULL,'India',1),(118,'ID',NULL,'Indonésie',1),(119,'IR',NULL,'Iran',1),(120,'IQ',NULL,'Iraq',1),(121,'IL',NULL,'Israel',1),(122,'JM',NULL,'Jamaïque',1),(123,'JP',NULL,'Japon',1),(124,'JO',NULL,'Jordanie',1),(125,'KZ',NULL,'Kazakhstan',1),(126,'KE',NULL,'Kenya',1),(127,'KI',NULL,'Kiribati',1),(128,'KP',NULL,'Corée du Nord',1),(129,'KR',NULL,'Corée du Sud',1),(130,'KW',NULL,'Koweït',1),(131,'KG',NULL,'Kirghizistan',1),(132,'LA',NULL,'Laos',1),(133,'LV',NULL,'Lettonie',1),(134,'LB',NULL,'Liban',1),(135,'LS',NULL,'Lesotho',1),(136,'LR',NULL,'Liberia',1),(137,'LY',NULL,'Libye',1),(138,'LI',NULL,'Liechtenstein',1),(139,'LT',NULL,'Lituanie',1),(140,'LU',NULL,'Luxembourg',1),(141,'MO',NULL,'Macao',1),(142,'MK',NULL,'ex-République yougoslave de Macédoine',1),(143,'MG',NULL,'Madagascar',1),(144,'MW',NULL,'Malawi',1),(145,'MY',NULL,'Malaisie',1),(146,'MV',NULL,'Maldives',1),(147,'ML',NULL,'Mali',1),(148,'MT',NULL,'Malte',1),(149,'MH',NULL,'Iles Marshall',1),(150,'MQ',NULL,'Martinique',1),(151,'MR',NULL,'Mauritanie',1),(152,'MU',NULL,'Maurice',1),(153,'YT',NULL,'Mayotte',1),(154,'MX',NULL,'Mexique',1),(155,'FM',NULL,'Micronésie',1),(156,'MD',NULL,'Moldavie',1),(157,'MN',NULL,'Mongolie',1),(158,'MS',NULL,'Monserrat',1),(159,'MZ',NULL,'Mozambique',1),(160,'MM',NULL,'Birmanie (Myanmar)',1),(161,'NA',NULL,'Namibie',1),(162,'NR',NULL,'Nauru',1),(163,'NP',NULL,'Népal',1),(164,'AN',NULL,'Antilles néerlandaises',1),(165,'NC',NULL,'Nouvelle-Calédonie',1),(166,'NZ',NULL,'Nouvelle-Zélande',1),(167,'NI',NULL,'Nicaragua',1),(168,'NE',NULL,'Niger',1),(169,'NG',NULL,'Nigeria',1),(170,'NU',NULL,'Nioué',1),(171,'NF',NULL,'Ile Norfolk',1),(172,'MP',NULL,'Mariannes du Nord',1),(173,'NO',NULL,'Norvège',1),(174,'OM',NULL,'Oman',1),(175,'PK',NULL,'Pakistan',1),(176,'PW',NULL,'Palaos',1),(177,'PS',NULL,'territoire Palestinien Occupé',1),(178,'PA',NULL,'Panama',1),(179,'PG',NULL,'Papouasie-Nouvelle-Guinée',1),(180,'PY',NULL,'Paraguay',1),(181,'PE',NULL,'Pérou',1),(182,'PH',NULL,'Philippines',1),(183,'PN',NULL,'Iles Pitcairn',1),(184,'PL',NULL,'Pologne',1),(185,'PR',NULL,'Porto Rico',1),(186,'QA',NULL,'Qatar',1),(187,'RE',NULL,'Réunion',1),(188,'RO',NULL,'Roumanie',1),(189,'RW',NULL,'Rwanda',1),(190,'SH',NULL,'Sainte-Hélène',1),(191,'KN',NULL,'Saint-Christophe-et-Niévès',1),(192,'LC',NULL,'Sainte-Lucie',1),(193,'PM',NULL,'Saint-Pierre-et-Miquelon',1),(194,'VC',NULL,'Saint-Vincent-et-les-Grenadines',1),(195,'WS',NULL,'Samoa',1),(196,'SM',NULL,'Saint-Marin',1),(197,'ST',NULL,'Sao Tomé-et-Principe',1),(198,'RS',NULL,'Serbie',1),(199,'SC',NULL,'Seychelles',1),(200,'SL',NULL,'Sierra Leone',1),(201,'SK',NULL,'Slovaquie',1),(202,'SI',NULL,'Slovénie',1),(203,'SB',NULL,'Iles Salomon',1),(204,'SO',NULL,'Somalie',1),(205,'ZA',NULL,'Afrique du Sud',1),(206,'GS',NULL,'Iles Géorgie du Sud et Sandwich du Sud',1),(207,'LK',NULL,'Sri Lanka',1),(208,'SD',NULL,'Soudan',1),(209,'SR',NULL,'Suriname',1),(210,'SJ',NULL,'Iles Svalbard et Jan Mayen',1),(211,'SZ',NULL,'Swaziland',1),(212,'SY',NULL,'Syrie',1),(213,'TW',NULL,'Taïwan',1),(214,'TJ',NULL,'Tadjikistan',1),(215,'TZ',NULL,'Tanzanie',1),(216,'TH',NULL,'Thaïlande',1),(217,'TL',NULL,'Timor Oriental',1),(218,'TK',NULL,'Tokélaou',1),(219,'TO',NULL,'Tonga',1),(220,'TT',NULL,'Trinité-et-Tobago',1),(221,'TR',NULL,'Turquie',1),(222,'TM',NULL,'Turkménistan',1),(223,'TC',NULL,'Iles Turks-et-Caicos',1),(224,'TV',NULL,'Tuvalu',1),(225,'UG',NULL,'Ouganda',1),(226,'UA',NULL,'Ukraine',1),(227,'AE',NULL,'Émirats arabes unis',1),(228,'UM',NULL,'Iles mineures éloignées des États-Unis',1),(229,'UY',NULL,'Uruguay',1),(230,'UZ',NULL,'Ouzbékistan',1),(231,'VU',NULL,'Vanuatu',1),(232,'VE',NULL,'Vénézuela',1),(233,'VN',NULL,'Viêt Nam',1),(234,'VG',NULL,'Iles Vierges britanniques',1),(235,'VI',NULL,'Iles Vierges américaines',1),(236,'WF',NULL,'Wallis-et-Futuna',1),(237,'EH',NULL,'Sahara occidental',1),(238,'YE',NULL,'Yémen',1),(239,'ZM',NULL,'Zambie',1),(240,'ZW',NULL,'Zimbabwe',1),(241,'GG',NULL,'Guernesey',1),(242,'IM',NULL,'Ile de Man',1),(243,'JE',NULL,'Jersey',1),(244,'ME',NULL,'Monténégro',1),(245,'BL',NULL,'Saint-Barthélemy',1),(246,'MF',NULL,'Saint-Martin',1); +/*!40000 ALTER TABLE `llx_c_pays` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_price_expression` +-- + +DROP TABLE IF EXISTS `llx_c_price_expression`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_price_expression` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(20) NOT NULL, + `expression` varchar(80) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_price_expression` +-- + +LOCK TABLES `llx_c_price_expression` WRITE; +/*!40000 ALTER TABLE `llx_c_price_expression` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_price_expression` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_price_global_variable` +-- + +DROP TABLE IF EXISTS `llx_c_price_global_variable`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_price_global_variable` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(20) NOT NULL, + `description` text, + `value` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_price_global_variable` +-- + +LOCK TABLES `llx_c_price_global_variable` WRITE; +/*!40000 ALTER TABLE `llx_c_price_global_variable` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_price_global_variable` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_price_global_variable_updater` +-- + +DROP TABLE IF EXISTS `llx_c_price_global_variable_updater`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_price_global_variable_updater` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `type` int(11) NOT NULL, + `description` text, + `parameters` text, + `fk_variable` int(11) NOT NULL, + `update_interval` int(11) DEFAULT '0', + `next_update` int(11) DEFAULT '0', + `last_status` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_price_global_variable_updater` +-- + +LOCK TABLES `llx_c_price_global_variable_updater` WRITE; +/*!40000 ALTER TABLE `llx_c_price_global_variable_updater` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_price_global_variable_updater` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_propalst` +-- + +DROP TABLE IF EXISTS `llx_c_propalst`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_propalst` ( + `id` smallint(6) NOT NULL, + `code` varchar(12) NOT NULL, + `label` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_propalst` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_propalst` +-- + +LOCK TABLES `llx_c_propalst` WRITE; +/*!40000 ALTER TABLE `llx_c_propalst` DISABLE KEYS */; +INSERT INTO `llx_c_propalst` VALUES (0,'PR_DRAFT','Brouillon',1),(1,'PR_OPEN','Ouverte',1),(2,'PR_SIGNED','Signée',1),(3,'PR_NOTSIGNED','Non Signée',1),(4,'PR_FAC','Facturée',1); +/*!40000 ALTER TABLE `llx_c_propalst` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_prospectlevel` +-- + +DROP TABLE IF EXISTS `llx_c_prospectlevel`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_prospectlevel` ( + `code` varchar(12) NOT NULL, + `label` varchar(30) DEFAULT NULL, + `sortorder` smallint(6) DEFAULT NULL, + `active` smallint(6) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_prospectlevel` +-- + +LOCK TABLES `llx_c_prospectlevel` WRITE; +/*!40000 ALTER TABLE `llx_c_prospectlevel` DISABLE KEYS */; +INSERT INTO `llx_c_prospectlevel` VALUES ('PL_HIGH','High',4,1,NULL),('PL_LOW','Low',2,1,NULL),('PL_MEDIUM','Medium',3,1,NULL),('PL_NONE','None',1,1,NULL); +/*!40000 ALTER TABLE `llx_c_prospectlevel` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_regions` +-- + +DROP TABLE IF EXISTS `llx_c_regions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_regions` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code_region` int(11) NOT NULL, + `fk_pays` int(11) NOT NULL, + `cheflieu` varchar(50) DEFAULT NULL, + `tncc` int(11) DEFAULT NULL, + `nom` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `code_region` (`code_region`), + UNIQUE KEY `uk_code_region` (`code_region`), + KEY `idx_c_regions_fk_pays` (`fk_pays`), + CONSTRAINT `fk_c_regions_fk_pays` FOREIGN KEY (`fk_pays`) REFERENCES `llx_c_pays` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=23346 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_regions` +-- + +LOCK TABLES `llx_c_regions` WRITE; +/*!40000 ALTER TABLE `llx_c_regions` DISABLE KEYS */; +INSERT INTO `llx_c_regions` VALUES (1,0,0,'0',0,'-',1),(101,1,1,'97105',3,'Guadeloupe',1),(102,2,1,'97209',3,'Martinique',1),(103,3,1,'97302',3,'Guyane',1),(104,4,1,'97411',3,'Réunion',1),(105,11,1,'75056',1,'Île-de-France',1),(106,21,1,'51108',0,'Champagne-Ardenne',1),(107,22,1,'80021',0,'Picardie',1),(108,23,1,'76540',0,'Haute-Normandie',1),(109,24,1,'45234',2,'Centre',1),(110,25,1,'14118',0,'Basse-Normandie',1),(111,26,1,'21231',0,'Bourgogne',1),(112,31,1,'59350',2,'Nord-Pas-de-Calais',1),(113,41,1,'57463',0,'Lorraine',1),(114,42,1,'67482',1,'Alsace',1),(115,43,1,'25056',0,'Franche-Comté',1),(116,52,1,'44109',4,'Pays de la Loire',1),(117,53,1,'35238',0,'Bretagne',1),(118,54,1,'86194',2,'Poitou-Charentes',1),(119,72,1,'33063',1,'Aquitaine',1),(120,73,1,'31555',0,'Midi-Pyrénées',1),(121,74,1,'87085',2,'Limousin',1),(122,82,1,'69123',2,'Rhône-Alpes',1),(123,83,1,'63113',1,'Auvergne',1),(124,91,1,'34172',2,'Languedoc-Roussillon',1),(125,93,1,'13055',0,'Provence-Alpes-Côte d\'Azur',1),(126,94,1,'2A004',0,'Corse',1),(201,201,2,'',1,'Flandre',1),(202,202,2,'',2,'Wallonie',1),(203,203,2,'',3,'Bruxelles-Capitale',1),(301,301,3,NULL,1,'Abruzzo',1),(302,302,3,NULL,1,'Basilicata',1),(303,303,3,NULL,1,'Calabria',1),(304,304,3,NULL,1,'Campania',1),(305,305,3,NULL,1,'Emilia-Romagna',1),(306,306,3,NULL,1,'Friuli-Venezia Giulia',1),(307,307,3,NULL,1,'Lazio',1),(308,308,3,NULL,1,'Liguria',1),(309,309,3,NULL,1,'Lombardia',1),(310,310,3,NULL,1,'Marche',1),(311,311,3,NULL,1,'Molise',1),(312,312,3,NULL,1,'Piemonte',1),(313,313,3,NULL,1,'Puglia',1),(314,314,3,NULL,1,'Sardegna',1),(315,315,3,NULL,1,'Sicilia',1),(316,316,3,NULL,1,'Toscana',1),(317,317,3,NULL,1,'Trentino-Alto Adige',1),(318,318,3,NULL,1,'Umbria',1),(319,319,3,NULL,1,'Valle d Aosta',1),(320,320,3,NULL,1,'Veneto',1),(401,401,4,'',0,'Andalucia',1),(402,402,4,'',0,'Aragón',1),(403,403,4,'',0,'Castilla y León',1),(404,404,4,'',0,'Castilla la Mancha',1),(405,405,4,'',0,'Canarias',1),(406,406,4,'',0,'Cataluña',1),(407,407,4,'',0,'Comunidad de Ceuta',1),(408,408,4,'',0,'Comunidad Foral de Navarra',1),(409,409,4,'',0,'Comunidad de Melilla',1),(410,410,4,'',0,'Cantabria',1),(411,411,4,'',0,'Comunidad Valenciana',1),(412,412,4,'',0,'Extemadura',1),(413,413,4,'',0,'Galicia',1),(414,414,4,'',0,'Islas Baleares',1),(415,415,4,'',0,'La Rioja',1),(416,416,4,'',0,'Comunidad de Madrid',1),(417,417,4,'',0,'Región de Murcia',1),(418,418,4,'',0,'Principado de Asturias',1),(419,419,4,'',0,'Pais Vasco',1),(601,601,6,'',1,'Cantons',1),(1001,1001,10,'',0,'Ariana',1),(1002,1002,10,'',0,'Béja',1),(1003,1003,10,'',0,'Ben Arous',1),(1004,1004,10,'',0,'Bizerte',1),(1005,1005,10,'',0,'Gabès',1),(1006,1006,10,'',0,'Gafsa',1),(1007,1007,10,'',0,'Jendouba',1),(1008,1008,10,'',0,'Kairouan',1),(1009,1009,10,'',0,'Kasserine',1),(1010,1010,10,'',0,'Kébili',1),(1011,1011,10,'',0,'La Manouba',1),(1012,1012,10,'',0,'Le Kef',1),(1013,1013,10,'',0,'Mahdia',1),(1014,1014,10,'',0,'Médenine',1),(1015,1015,10,'',0,'Monastir',1),(1016,1016,10,'',0,'Nabeul',1),(1017,1017,10,'',0,'Sfax',1),(1018,1018,10,'',0,'Sidi Bouzid',1),(1019,1019,10,'',0,'Siliana',1),(1020,1020,10,'',0,'Sousse',1),(1021,1021,10,'',0,'Tataouine',1),(1022,1022,10,'',0,'Tozeur',1),(1023,1023,10,'',0,'Tunis',1),(1024,1024,10,'',0,'Zaghouan',1),(1101,1101,11,'',0,'United-States',1),(1201,1201,12,'',0,'Tanger-Tétouan',1),(1202,1202,12,'',0,'Gharb-Chrarda-Beni Hssen',1),(1203,1203,12,'',0,'Taza-Al Hoceima-Taounate',1),(1204,1204,12,'',0,'L\'Oriental',1),(1205,1205,12,'',0,'Fès-Boulemane',1),(1206,1206,12,'',0,'Meknès-Tafialet',1),(1207,1207,12,'',0,'Rabat-Salé-Zemour-Zaër',1),(1208,1208,12,'',0,'Grand Cassablanca',1),(1209,1209,12,'',0,'Chaouia-Ouardigha',1),(1210,1210,12,'',0,'Doukahla-Adba',1),(1211,1211,12,'',0,'Marrakech-Tensift-Al Haouz',1),(1212,1212,12,'',0,'Tadla-Azilal',1),(1213,1213,12,'',0,'Sous-Massa-Drâa',1),(1214,1214,12,'',0,'Guelmim-Es Smara',1),(1215,1215,12,'',0,'Laâyoune-Boujdour-Sakia el Hamra',1),(1216,1216,12,'',0,'Oued Ed-Dahab Lagouira',1),(1301,1301,13,'',0,'Algerie',1),(2301,2301,23,'',0,'Norte',1),(2302,2302,23,'',0,'Litoral',1),(2303,2303,23,'',0,'Cuyana',1),(2304,2304,23,'',0,'Central',1),(2305,2305,23,'',0,'Patagonia',1),(2801,2801,28,'',0,'Australia',1),(4601,4601,46,'',0,'Barbados',1),(6701,6701,67,NULL,NULL,'Tarapacá',1),(6702,6702,67,NULL,NULL,'Antofagasta',1),(6703,6703,67,NULL,NULL,'Atacama',1),(6704,6704,67,NULL,NULL,'Coquimbo',1),(6705,6705,67,NULL,NULL,'Valparaíso',1),(6706,6706,67,NULL,NULL,'General Bernardo O Higgins',1),(6707,6707,67,NULL,NULL,'Maule',1),(6708,6708,67,NULL,NULL,'Biobío',1),(6709,6709,67,NULL,NULL,'Raucanía',1),(6710,6710,67,NULL,NULL,'Los Lagos',1),(6711,6711,67,NULL,NULL,'Aysén General Carlos Ibáñez del Campo',1),(6712,6712,67,NULL,NULL,'Magallanes y Antártica Chilena',1),(6713,6713,67,NULL,NULL,'Santiago',1),(6714,6714,67,NULL,NULL,'Los Ríos',1),(6715,6715,67,NULL,NULL,'Arica y Parinacota',1),(7001,7001,70,'',0,'Colombie',1),(8601,8601,86,NULL,NULL,'Central',1),(8602,8602,86,NULL,NULL,'Oriental',1),(8603,8603,86,NULL,NULL,'Occidental',1),(10201,10201,102,NULL,NULL,'??????',1),(10202,10202,102,NULL,NULL,'?????? ??????',1),(10203,10203,102,NULL,NULL,'???????? ?????????',1),(10204,10204,102,NULL,NULL,'?????',1),(10205,10205,102,NULL,NULL,'????????? ????????? ??? ?????',1),(10206,10206,102,NULL,NULL,'???????',1),(10207,10207,102,NULL,NULL,'????? ?????',1),(10208,10208,102,NULL,NULL,'?????? ??????',1),(10209,10209,102,NULL,NULL,'????????????',1),(10210,10210,102,NULL,NULL,'????? ??????',1),(10211,10211,102,NULL,NULL,'?????? ??????',1),(10212,10212,102,NULL,NULL,'????????',1),(10213,10213,102,NULL,NULL,'?????? ?????????',1),(11401,11401,114,'',0,'Honduras',1),(11701,11701,117,'',0,'India',1),(15201,15201,152,'',0,'Rivière Noire',1),(15202,15202,152,'',0,'Flacq',1),(15203,15203,152,'',0,'Grand Port',1),(15204,15204,152,'',0,'Moka',1),(15205,15205,152,'',0,'Pamplemousses',1),(15206,15206,152,'',0,'Plaines Wilhems',1),(15207,15207,152,'',0,'Port-Louis',1),(15208,15208,152,'',0,'Rivière du Rempart',1),(15209,15209,152,'',0,'Savanne',1),(15210,15210,152,'',0,'Rodrigues',1),(15211,15211,152,'',0,'Les îles Agaléga',1),(15212,15212,152,'',0,'Les écueils des Cargados Carajos',1),(15401,15401,154,'',0,'Mexique',1),(23201,23201,232,'',0,'Los Andes',1),(23202,23202,232,'',0,'Capital',1),(23203,23203,232,'',0,'Central',1),(23204,23204,232,'',0,'Cento Occidental',1),(23205,23205,232,'',0,'Guayana',1),(23206,23206,232,'',0,'Insular',1),(23207,23207,232,'',0,'Los Llanos',1),(23208,23208,232,'',0,'Nor-Oriental',1),(23209,23209,232,'',0,'Zuliana',1),(23215,6,1,'97601',3,'Mayotte',1),(23280,420,4,'',0,'Otros',1),(23281,501,5,'',0,'Deutschland',1),(23296,701,7,'',0,'England',1),(23297,702,7,'',0,'Wales',1),(23298,703,7,'',0,'Scotland',1),(23299,704,7,'',0,'Northern Ireland',1),(23325,1401,14,'',0,'Canada',1),(23326,1701,17,'',0,'Provincies van Nederland ',1),(23333,5601,56,'',0,'Brasil',1),(23334,5201,52,'',0,'Chuquisaca',1),(23335,5202,52,'',0,'La Paz',1),(23336,5203,52,'',0,'Cochabamba',1),(23337,5204,52,'',0,'Oruro',1),(23338,5205,52,'',0,'Potosí',1),(23339,5206,52,'',0,'Tarija',1),(23340,5207,52,'',0,'Santa Cruz',1),(23341,5208,52,'',0,'El Beni',1),(23342,5209,52,'',0,'Pando',1),(23343,4101,41,'',0,'Österreich',1),(23344,17801,178,'',0,'Panama',1),(23345,22701,227,'',0,'United Arab Emirates',1); +/*!40000 ALTER TABLE `llx_c_regions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_revenuestamp` +-- + +DROP TABLE IF EXISTS `llx_c_revenuestamp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_revenuestamp` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_pays` int(11) NOT NULL, + `taux` double NOT NULL, + `note` varchar(128) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `accountancy_code_sell` varchar(32) DEFAULT NULL, + `accountancy_code_buy` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_revenuestamp` +-- + +LOCK TABLES `llx_c_revenuestamp` WRITE; +/*!40000 ALTER TABLE `llx_c_revenuestamp` DISABLE KEYS */; +INSERT INTO `llx_c_revenuestamp` VALUES (101,10,0.4,'Revenue stamp tunisia',1,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_revenuestamp` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_shipment_mode` +-- + +DROP TABLE IF EXISTS `llx_c_shipment_mode`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_shipment_mode` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `code` varchar(30) NOT NULL, + `libelle` varchar(50) NOT NULL, + `description` text, + `tracking` varchar(256) NOT NULL, + `active` tinyint(4) DEFAULT '0', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_shipment_mode` +-- + +LOCK TABLES `llx_c_shipment_mode` WRITE; +/*!40000 ALTER TABLE `llx_c_shipment_mode` DISABLE KEYS */; +INSERT INTO `llx_c_shipment_mode` VALUES (1,'2010-10-09 23:43:16','CATCH','Catch','Catch by client','',1,NULL),(2,'2010-10-09 23:43:16','TRANS','Transporter','Generic transporter','',1,NULL),(3,'2010-10-09 23:43:16','COLSUI','Colissimo Suivi','Colissimo Suivi','',0,NULL),(4,'2011-07-18 17:28:27','LETTREMAX','Lettre Max','Courrier Suivi et Lettre Max','',0,NULL),(9,'2013-02-24 01:48:18','UPS','UPS','United Parcel Service','http://wwwapps.ups.com/etracking/tracking.cgi?InquiryNumber2=&InquiryNumber3=&tracknums_displayed=3&loc=fr_FR&TypeOfInquiryNumber=T&HTMLVersion=4.0&InquiryNumber22=&InquiryNumber32=&track=Track&Suivi.x=64&Suivi.y=7&Suivi=Valider&InquiryNumber1={TRACKID}',0,NULL),(10,'2013-02-24 01:48:18','KIALA','KIALA','Relais Kiala','http://www.kiala.fr/tnt/delivery/{TRACKID}',0,NULL),(11,'2013-02-24 01:48:18','GLS','GLS','General Logistics Systems','http://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/FR01/FR/5004.htm?txtAction=71000&txtRefNo={TRACKID}',0,NULL),(12,'2013-02-24 01:48:18','CHRONO','Chronopost','Chronopost','http://www.chronopost.fr/expedier/inputLTNumbersNoJahia.do?listeNumeros={TRACKID}',0,NULL); +/*!40000 ALTER TABLE `llx_c_shipment_mode` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_stcomm` +-- + +DROP TABLE IF EXISTS `llx_c_stcomm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_stcomm` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `picto` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_stcomm` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_stcomm` +-- + +LOCK TABLES `llx_c_stcomm` WRITE; +/*!40000 ALTER TABLE `llx_c_stcomm` DISABLE KEYS */; +INSERT INTO `llx_c_stcomm` VALUES (-1,'ST_NO','Do not contact',1,NULL),(0,'ST_NEVER','Never contacted',1,NULL),(1,'ST_TODO','To contact',1,NULL),(2,'ST_PEND','Contact in progress',1,NULL),(3,'ST_DONE','Contacted',1,NULL); +/*!40000 ALTER TABLE `llx_c_stcomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_tva` +-- + +DROP TABLE IF EXISTS `llx_c_tva`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_tva` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_pays` int(11) NOT NULL, + `code` varchar(10) DEFAULT '', + `taux` double NOT NULL, + `localtax1` varchar(20) DEFAULT NULL, + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2` varchar(20) DEFAULT NULL, + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `note` varchar(128) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `accountancy_code_sell` varchar(32) DEFAULT NULL, + `accountancy_code_buy` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_tva_id` (`fk_pays`,`code`,`taux`,`recuperableonly`) +) ENGINE=InnoDB AUTO_INCREMENT=2477 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_tva` +-- + +LOCK TABLES `llx_c_tva` WRITE; +/*!40000 ALTER TABLE `llx_c_tva` DISABLE KEYS */; +INSERT INTO `llx_c_tva` VALUES (11,1,'',20,NULL,'0',NULL,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,'',8.5,NULL,'0',NULL,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,'',8.5,NULL,'0',NULL,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,'',5.5,NULL,'0',NULL,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,'',2.1,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(17,1,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(21,2,'',21,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,'',6,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,'',12,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,'',21,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,'',4,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,'',21,'5.2','3','-19:-15:-9','5',0,'VAT standard rate',1,NULL,NULL),(42,4,'',10,'1.4','3','-19:-15:-9','5',0,'VAT reduced rate',1,NULL,NULL),(43,4,'',4,'0.5','3','-19:-15:-9','5',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,'',0,'0','3','-19:-15:-9','5',0,'VAT Rate 0',1,NULL,NULL),(51,5,'',19,NULL,'0',NULL,'0',0,'allgemeine Ust.',1,NULL,NULL),(52,5,'',7,NULL,'0',NULL,'0',0,'ermäßigte USt.',1,NULL,NULL),(53,5,'',0,NULL,'0',NULL,'0',0,'keine USt.',1,NULL,NULL),(54,5,'',5.5,NULL,'0',NULL,'0',0,'USt. Forst',0,NULL,NULL),(55,5,'',10.7,NULL,'0',NULL,'0',0,'USt. Landwirtschaft',0,NULL,NULL),(61,6,'',8,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,'',3.8,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,'',2.5,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,'',17.5,NULL,'0',NULL,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,'',5,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(81,8,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(82,8,'',23,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(83,8,'',13.5,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(84,8,'',9,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(85,8,'',4.8,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(91,9,'',17,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,'',13,NULL,'0',NULL,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,'',3,NULL,'0',NULL,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,'',6,'1','4','0','0',0,'VAT 6%',1,NULL,NULL),(102,10,'',12,'1','4','0','0',0,'VAT 12%',1,NULL,NULL),(103,10,'',18,'1','4','0','0',0,'VAT 18%',1,NULL,NULL),(104,10,'',7.5,'1','4','0','0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,'',15,'1','4','0','0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,'',22.5,'1','4','0','0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,'',0,'1','4','0','0',0,'VAT Rate 0',1,NULL,NULL),(111,11,'',0,NULL,'0',NULL,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,'',4,NULL,'0',NULL,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,'',6,NULL,'0',NULL,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,'',14,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,'',7,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,'',7,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,'',5,'9.975','1',NULL,'0',0,'GST/TPS and PST/TVQ rate for Province',1,NULL,NULL),(171,17,'',19,NULL,'0',NULL,'0',0,'Algemeen BTW tarief',1,NULL,NULL),(172,17,'',6,NULL,'0',NULL,'0',0,'Verlaagd BTW tarief',1,NULL,NULL),(173,17,'',0,NULL,'0',NULL,'0',0,'0 BTW tarief',1,NULL,NULL),(174,17,'',21,NULL,'0',NULL,'0',0,'Algemeen BTW tarief (vanaf 1 oktober 2012)',0,NULL,NULL),(201,20,'',25,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,'',12,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,'',6,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(211,21,'',0,'0','0','0','0',0,'IVA Rate 0',1,NULL,NULL),(212,21,'',18,'7.5','2','0','0',0,'IVA standard rate',1,NULL,NULL),(221,22,'',18,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(222,22,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(223,22,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,'',21,NULL,'0',NULL,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,'',10.5,NULL,'0',NULL,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,'',0,NULL,'0',NULL,'0',0,'IVA Rate 0',1,NULL,NULL),(241,24,'',19.25,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(242,24,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(251,25,'',23,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,'',13,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,'',6,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(261,26,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(271,27,'',19.6,NULL,'0',NULL,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,'',8.5,NULL,'0',NULL,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,'',8.5,NULL,'0',NULL,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,'',5.5,NULL,'0',NULL,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,'',2.1,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,'',10,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,'',0,NULL,'0',NULL,'0',0,'No VAT',1,NULL,NULL),(462,46,'',15,NULL,'0',NULL,'0',0,'VAT 15%',1,NULL,NULL),(463,46,'',7.5,NULL,'0',NULL,'0',0,'VAT 7.5%',1,NULL,NULL),(561,56,'',0,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(591,59,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,'',19,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,'',25,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,'',13,NULL,'0',NULL,'0',0,'IVA 13',1,NULL,NULL),(862,86,'',0,NULL,'0',NULL,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,'',0,NULL,'0',NULL,'0',0,'No ISV',1,NULL,NULL),(1142,114,'',12,NULL,'0',NULL,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,'',25.5,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,'',0,NULL,'0',NULL,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,'',12.5,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,'',4,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,'',1,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1176,117,'CGST+SGST',0,'9','1','9','1',0,'CGST+SGST - Same state sales',1,NULL,NULL),(1177,117,'IGST',18,'0','0','0','0',0,'IGST',1,NULL,NULL),(1231,123,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,'',5,NULL,'0',NULL,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,'',15,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,'',12,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,'',6,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,'',3,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1481,148,'',18,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1482,148,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1483,148,'',5,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1484,148,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1511,151,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1512,151,'',14,NULL,'0',NULL,'0',0,'VAT Rate 14',1,NULL,NULL),(1521,152,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,'',15,NULL,'0',NULL,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,'',0,NULL,'0',NULL,'0',0,'No VAT',1,NULL,NULL),(1542,154,'',16,NULL,'0',NULL,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,'',10,NULL,'0',NULL,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,'',15,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1692,169,'',5,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1693,169,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,'',25,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,'',14,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,'',8,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1781,178,'',7,NULL,'0',NULL,'0',0,'ITBMS standard rate',1,NULL,NULL),(1782,178,'',0,NULL,'0',NULL,'0',0,'ITBMS Rate 0',1,NULL,NULL),(1811,181,'',18,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1812,181,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,'',3,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,'',24,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,'',9,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,'',5,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,'',0,NULL,'0',NULL,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,'',19,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,'',22,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,'',9.5,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(2051,205,'',0,NULL,'0',NULL,'0',0,'No VAT',1,NULL,NULL),(2052,205,'',14,NULL,'0',NULL,'0',0,'VAT 14%',1,NULL,NULL),(2131,213,'',5,NULL,'0',NULL,'0',0,'VAT 5%',1,NULL,NULL),(2261,226,'',20,NULL,'0',NULL,'0',0,'VAT standart rate',1,NULL,NULL),(2262,226,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,'',0,NULL,'0',NULL,'0',0,'No VAT',1,NULL,NULL),(2322,232,'',12,NULL,'0',NULL,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,'',8,NULL,'0',NULL,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,102,'',23,'0','0','0','0',0,'Κανονικός Φ.Π.Α.',1,NULL,NULL),(2463,102,'',0,'0','0','0','0',0,'Μηδενικό Φ.Π.Α.',1,NULL,NULL),(2464,102,'',13,'0','0','0','0',0,'Μειωμένος Φ.Π.Α.',1,NULL,NULL),(2465,102,'',6.5,'0','0','0','0',0,'Υπερμειωμένος Φ.Π.Α.',1,NULL,NULL),(2466,102,'',16,'0','0','0','0',0,'Νήσων κανονικός Φ.Π.Α.',1,NULL,NULL),(2467,102,'',9,'0','0','0','0',0,'Νήσων μειωμένος Φ.Π.Α.',1,NULL,NULL),(2468,102,'',5,'0','0','0','0',0,'Νήσων υπερμειωμένος Φ.Π.Α.',1,NULL,NULL),(2469,1,'85',8.5,NULL,'0',NULL,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(2470,1,'85NPR',8.5,NULL,'0',NULL,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(2471,1,'85NPROM',8.5,'2','3',NULL,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0,NULL,NULL),(2472,1,'85NPROMOMR',8.5,'2','3','2.5','3',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_tva` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_type_contact` +-- + +DROP TABLE IF EXISTS `llx_c_type_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_type_contact` ( + `rowid` int(11) NOT NULL, + `element` varchar(30) NOT NULL, + `source` varchar(8) NOT NULL DEFAULT 'external', + `code` varchar(32) NOT NULL, + `libelle` varchar(64) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_type_contact_id` (`element`,`source`,`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_type_contact` +-- + +LOCK TABLES `llx_c_type_contact` WRITE; +/*!40000 ALTER TABLE `llx_c_type_contact` DISABLE KEYS */; +INSERT INTO `llx_c_type_contact` VALUES (10,'contrat','internal','SALESREPSIGN','Commercial signataire du contrat',1,NULL,0),(11,'contrat','internal','SALESREPFOLL','Commercial suivi du contrat',1,NULL,0),(20,'contrat','external','BILLING','Contact client facturation contrat',1,NULL,0),(21,'contrat','external','CUSTOMER','Contact client suivi contrat',1,NULL,0),(22,'contrat','external','SALESREPSIGN','Contact client signataire contrat',1,NULL,0),(31,'propal','internal','SALESREPFOLL','Commercial à l\'origine de la propale',1,NULL,0),(40,'propal','external','BILLING','Contact client facturation propale',1,NULL,0),(41,'propal','external','CUSTOMER','Contact client suivi propale',1,NULL,0),(50,'facture','internal','SALESREPFOLL','Responsable suivi du paiement',1,NULL,0),(60,'facture','external','BILLING','Contact client facturation',1,NULL,0),(61,'facture','external','SHIPPING','Contact client livraison',1,NULL,0),(62,'facture','external','SERVICE','Contact client prestation',1,NULL,0),(70,'invoice_supplier','internal','SALESREPFOLL','Responsable suivi du paiement',1,NULL,0),(71,'invoice_supplier','external','BILLING','Contact fournisseur facturation',1,NULL,0),(72,'invoice_supplier','external','SHIPPING','Contact fournisseur livraison',1,NULL,0),(73,'invoice_supplier','external','SERVICE','Contact fournisseur prestation',1,NULL,0),(80,'agenda','internal','ACTOR','Responsable',1,NULL,0),(81,'agenda','internal','GUEST','Guest',1,NULL,0),(85,'agenda','external','ACTOR','Responsable',1,NULL,0),(86,'agenda','external','GUEST','Guest',1,NULL,0),(91,'commande','internal','SALESREPFOLL','Responsable suivi de la commande',1,NULL,0),(100,'commande','external','BILLING','Contact client facturation commande',1,NULL,0),(101,'commande','external','CUSTOMER','Contact client suivi commande',1,NULL,0),(102,'commande','external','SHIPPING','Contact client livraison commande',1,NULL,0),(120,'fichinter','internal','INTERREPFOLL','Responsable suivi de l\'intervention',1,NULL,0),(121,'fichinter','internal','INTERVENING','Intervenant',1,NULL,0),(130,'fichinter','external','BILLING','Contact client facturation intervention',1,NULL,0),(131,'fichinter','external','CUSTOMER','Contact client suivi de l\'intervention',1,NULL,0),(140,'order_supplier','internal','SALESREPFOLL','Responsable suivi de la commande',1,NULL,0),(141,'order_supplier','internal','SHIPPING','Responsable réception de la commande',1,NULL,0),(142,'order_supplier','external','BILLING','Contact fournisseur facturation commande',1,NULL,0),(143,'order_supplier','external','CUSTOMER','Contact fournisseur suivi commande',1,NULL,0),(145,'order_supplier','external','SHIPPING','Contact fournisseur livraison commande',1,NULL,0),(150,'dolresource','internal','USERINCHARGE','In charge of resource',1,NULL,0),(151,'dolresource','external','THIRDINCHARGE','In charge of resource',1,NULL,0),(160,'project','internal','PROJECTLEADER','Chef de Projet',1,NULL,0),(161,'project','internal','PROJECTCONTRIBUTOR','Intervenant',1,NULL,0),(170,'project','external','PROJECTLEADER','Chef de Projet',1,NULL,0),(171,'project','external','PROJECTCONTRIBUTOR','Intervenant',1,NULL,0),(180,'project_task','internal','TASKEXECUTIVE','Responsable',1,NULL,0),(181,'project_task','internal','TASKCONTRIBUTOR','Intervenant',1,NULL,0),(190,'project_task','external','TASKEXECUTIVE','Responsable',1,NULL,0),(191,'project_task','external','TASKCONTRIBUTOR','Intervenant',1,NULL,0),(200,'societe','external','GENERALREF','Généraliste (référent)',0,'cabinetmed',0),(201,'societe','external','GENERALISTE','Généraliste',0,'cabinetmed',0),(210,'societe','external','SPECCHIROR','Chirurgien ortho',0,'cabinetmed',0),(211,'societe','external','SPECCHIROT','Chirurgien autre',0,'cabinetmed',0),(220,'societe','external','SPECDERMA','Dermatologue',0,'cabinetmed',0),(225,'societe','external','SPECENDOC','Endocrinologue',0,'cabinetmed',0),(230,'societe','external','SPECGYNECO','Gynécologue',0,'cabinetmed',0),(240,'societe','external','SPECGASTRO','Gastroantérologue',0,'cabinetmed',0),(245,'societe','external','SPECINTERNE','Interniste',0,'cabinetmed',0),(250,'societe','external','SPECCARDIO','Cardiologue',0,'cabinetmed',0),(260,'societe','external','SPECNEPHRO','Néphrologue',0,'cabinetmed',0),(263,'societe','external','SPECPNEUMO','Pneumologue',0,'cabinetmed',0),(265,'societe','external','SPECNEURO','Neurologue',0,'cabinetmed',0),(270,'societe','external','SPECRHUMATO','Rhumatologue',0,'cabinetmed',0),(280,'societe','external','KINE','Kinésithérapeute',0,'cabinetmed',0); +/*!40000 ALTER TABLE `llx_c_type_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_type_fees` +-- + +DROP TABLE IF EXISTS `llx_c_type_fees`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_type_fees` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(12) NOT NULL, + `label` varchar(30) DEFAULT NULL, + `accountancy_code` varchar(32) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_type_fees` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_type_fees` +-- + +LOCK TABLES `llx_c_type_fees` WRITE; +/*!40000 ALTER TABLE `llx_c_type_fees` DISABLE KEYS */; +INSERT INTO `llx_c_type_fees` VALUES (1,'TF_OTHER','Other','705',1,NULL,0),(2,'TF_TRIP','Trip',NULL,1,NULL,0),(3,'TF_LUNCH','Lunch',NULL,1,NULL,0); +/*!40000 ALTER TABLE `llx_c_type_fees` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_type_resource` +-- + +DROP TABLE IF EXISTS `llx_c_type_resource`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_type_resource` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(32) NOT NULL, + `label` varchar(64) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_type_resource_id` (`label`,`code`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_type_resource` +-- + +LOCK TABLES `llx_c_type_resource` WRITE; +/*!40000 ALTER TABLE `llx_c_type_resource` DISABLE KEYS */; +INSERT INTO `llx_c_type_resource` VALUES (1,'RES_ROOMS','Rooms',1),(2,'RES_CARS','Cars',1); +/*!40000 ALTER TABLE `llx_c_type_resource` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_typent` +-- + +DROP TABLE IF EXISTS `llx_c_typent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_typent` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(64) DEFAULT NULL, + `fk_country` int(11) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_typent` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_typent` +-- + +LOCK TABLES `llx_c_typent` WRITE; +/*!40000 ALTER TABLE `llx_c_typent` DISABLE KEYS */; +INSERT INTO `llx_c_typent` VALUES (0,'TE_UNKNOWN','-',NULL,1,NULL,0),(1,'TE_STARTUP','Start-up',NULL,1,NULL,0),(2,'TE_GROUP','Grand groupe',NULL,1,NULL,0),(3,'TE_MEDIUM','PME/PMI',NULL,1,NULL,0),(4,'TE_SMALL','TPE',NULL,1,NULL,0),(5,'TE_ADMIN','Administration',NULL,1,NULL,0),(6,'TE_WHOLE','Grossiste',NULL,1,NULL,0),(7,'TE_RETAIL','Revendeur',NULL,1,NULL,0),(8,'TE_PRIVATE','Particulier',NULL,1,NULL,0),(100,'TE_OTHER','Autres',NULL,1,NULL,0),(101,'TE_HOMME','Homme',NULL,0,'cabinetmed',0),(102,'TE_FEMME','Femme',NULL,0,'cabinetmed',0),(231,'TE_A_RI','Responsable Inscripto',23,1,NULL,0),(232,'TE_B_RNI','Responsable No Inscripto',23,1,NULL,0),(233,'TE_C_FE','Consumidor Final/Exento',23,1,NULL,0); +/*!40000 ALTER TABLE `llx_c_typent` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_units` +-- + +DROP TABLE IF EXISTS `llx_c_units`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_units` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(3) DEFAULT NULL, + `label` varchar(50) DEFAULT NULL, + `short_label` varchar(5) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_units_code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_units` +-- + +LOCK TABLES `llx_c_units` WRITE; +/*!40000 ALTER TABLE `llx_c_units` DISABLE KEYS */; +INSERT INTO `llx_c_units` VALUES (1,'P','piece','p',1),(2,'SET','set','se',1),(3,'S','second','s',1),(4,'H','hour','h',1),(5,'D','day','d',1),(6,'KG','kilogram','kg',1),(7,'G','gram','g',1),(8,'M','meter','m',1),(9,'LM','linear meter','lm',1),(10,'M2','square meter','m2',1),(11,'M3','cubic meter','m3',1),(12,'L','liter','l',1); +/*!40000 ALTER TABLE `llx_c_units` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_ziptown` +-- + +DROP TABLE IF EXISTS `llx_c_ziptown`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_ziptown` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(5) DEFAULT NULL, + `fk_county` int(11) DEFAULT NULL, + `fk_pays` int(11) NOT NULL DEFAULT '0', + `zip` varchar(10) NOT NULL, + `town` varchar(255) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ziptown_fk_pays` (`zip`,`town`,`fk_pays`), + KEY `idx_c_ziptown_fk_county` (`fk_county`), + KEY `idx_c_ziptown_fk_pays` (`fk_pays`), + KEY `idx_c_ziptown_zip` (`zip`), + CONSTRAINT `fk_c_ziptown_fk_county` FOREIGN KEY (`fk_county`) REFERENCES `llx_c_departements` (`rowid`), + CONSTRAINT `fk_c_ziptown_fk_pays` FOREIGN KEY (`fk_pays`) REFERENCES `llx_c_pays` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_ziptown` +-- + +LOCK TABLES `llx_c_ziptown` WRITE; +/*!40000 ALTER TABLE `llx_c_ziptown` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_ziptown` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie` +-- + +DROP TABLE IF EXISTS `llx_categorie`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_parent` int(11) NOT NULL DEFAULT '0', + `label` varchar(255) NOT NULL, + `type` tinyint(4) NOT NULL DEFAULT '1', + `entity` int(11) NOT NULL DEFAULT '1', + `description` text, + `fk_soc` int(11) DEFAULT NULL, + `visible` tinyint(4) NOT NULL DEFAULT '1', + `import_key` varchar(14) DEFAULT NULL, + `color` varchar(8) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_categorie_ref` (`entity`,`fk_parent`,`label`,`type`), + KEY `idx_categorie_type` (`type`), + KEY `idx_categorie_label` (`label`) +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie` +-- + +LOCK TABLES `llx_categorie` WRITE; +/*!40000 ALTER TABLE `llx_categorie` DISABLE KEYS */; +INSERT INTO `llx_categorie` VALUES (1,0,'Preferred Partners',1,1,'This category is used to tag suppliers that are Prefered Partners',NULL,0,NULL,'005fbf'),(2,0,'MyCategory',1,1,'This is description of MyCategory for customer and prospects
',NULL,0,NULL,NULL),(3,7,'Hot products',1,1,'This is description of hot products
',NULL,0,NULL,NULL),(4,0,'Merchant',1,1,'Category dedicated to merchant third parties',NULL,0,NULL,'bf5f00'),(5,7,'Bio Fairtrade',0,1,'',NULL,0,NULL,NULL),(6,7,'Bio AB',0,1,'',NULL,0,NULL,NULL),(7,9,'Bio',0,1,'This product is a BIO product',NULL,0,NULL,NULL),(8,7,'Bio Dynamic',0,1,'',NULL,0,NULL,NULL),(9,0,'High Quality Product',0,1,'Label dedicated for High quality products',NULL,0,NULL,'7f7f00'),(10,0,'Reserved for VIP',0,1,'Product of thi category are reserved to VIP customers',NULL,0,NULL,'7f0000'),(11,9,'ISO',0,1,'Product of this category has an ISO label',NULL,0,NULL,NULL),(12,0,'VIP',2,1,'',NULL,0,NULL,'bf5f00'),(13,0,'Region North',2,1,'Customer of North Region',NULL,0,NULL,'7f007f'),(14,0,'Regular customer',2,1,'',NULL,0,NULL,'5fbf00'),(15,13,'Region North A',2,1,'',NULL,0,NULL,'bf00bf'),(17,0,'MyTag1',4,1,'',NULL,0,NULL,NULL),(18,0,'Met during meeting',4,1,'',NULL,0,NULL,'ff7f00'),(19,17,'MySubTag1',4,1,'',NULL,0,NULL,NULL),(20,13,'Region North B',2,1,'',NULL,0,NULL,'bf005f'),(21,0,'Region South',2,1,'',NULL,0,NULL,NULL),(22,21,'Region South A',2,1,'',NULL,0,NULL,NULL),(23,21,'Region South B',2,1,'',NULL,0,NULL,NULL),(24,0,'Limited Edition',0,1,'This is a limited edition',NULL,0,NULL,'ff7f00'),(25,0,'Imported products',0,1,'For product we have to import from another country',NULL,0,NULL,NULL),(26,28,'Friends',4,1,'Category of friends contact',NULL,0,NULL,'00bf00'),(27,28,'Family',4,1,'Category of family contacts',NULL,0,NULL,'007f3f'),(28,0,'Personal contacts',4,1,'For personal contacts',NULL,0,NULL,'007f3f'),(29,0,'Online only merchant',1,1,'',NULL,0,NULL,'aaaaff'),(30,0,'ppp',6,1,'ppp',NULL,0,NULL,'ff5656'); +/*!40000 ALTER TABLE `llx_categorie` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_account` +-- + +DROP TABLE IF EXISTS `llx_categorie_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_account` ( + `fk_categorie` int(11) NOT NULL, + `fk_account` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_account`), + KEY `idx_categorie_account_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_account_fk_account` (`fk_account`), + CONSTRAINT `fk_categorie_account_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_account_fk_account` FOREIGN KEY (`fk_account`) REFERENCES `llx_bank_account` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_account` +-- + +LOCK TABLES `llx_categorie_account` WRITE; +/*!40000 ALTER TABLE `llx_categorie_account` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_association` +-- + +DROP TABLE IF EXISTS `llx_categorie_association`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_association` ( + `fk_categorie_mere` int(11) NOT NULL, + `fk_categorie_fille` int(11) NOT NULL, + UNIQUE KEY `uk_categorie_association` (`fk_categorie_mere`,`fk_categorie_fille`), + UNIQUE KEY `uk_categorie_association_fk_categorie_fille` (`fk_categorie_fille`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_association` +-- + +LOCK TABLES `llx_categorie_association` WRITE; +/*!40000 ALTER TABLE `llx_categorie_association` DISABLE KEYS */; +INSERT INTO `llx_categorie_association` VALUES (3,5),(9,11); +/*!40000 ALTER TABLE `llx_categorie_association` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_contact` +-- + +DROP TABLE IF EXISTS `llx_categorie_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_contact` ( + `fk_categorie` int(11) NOT NULL, + `fk_socpeople` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_socpeople`), + KEY `idx_categorie_contact_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_contact_fk_socpeople` (`fk_socpeople`), + CONSTRAINT `fk_categorie_contact_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_contact_fk_socpeople` FOREIGN KEY (`fk_socpeople`) REFERENCES `llx_socpeople` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_contact` +-- + +LOCK TABLES `llx_categorie_contact` WRITE; +/*!40000 ALTER TABLE `llx_categorie_contact` DISABLE KEYS */; +INSERT INTO `llx_categorie_contact` VALUES (18,3,NULL),(18,6,NULL),(19,6,NULL),(26,9,NULL),(27,7,NULL),(27,8,NULL),(27,10,NULL),(28,11,NULL); +/*!40000 ALTER TABLE `llx_categorie_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_categorie_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_fournisseur` ( + `fk_categorie` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_soc`), + KEY `idx_categorie_fournisseur_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_fournisseur_fk_societe` (`fk_soc`), + CONSTRAINT `fk_categorie_fournisseur_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_fournisseur_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_fournisseur` +-- + +LOCK TABLES `llx_categorie_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_categorie_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_categorie_fournisseur` VALUES (1,2,NULL),(1,10,NULL),(9,2,NULL); +/*!40000 ALTER TABLE `llx_categorie_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_lang` +-- + +DROP TABLE IF EXISTS `llx_categorie_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_lang` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_category` int(11) NOT NULL DEFAULT '0', + `lang` varchar(5) NOT NULL DEFAULT '0', + `label` varchar(255) NOT NULL, + `description` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_category_lang` (`fk_category`,`lang`), + CONSTRAINT `fk_category_lang_fk_category` FOREIGN KEY (`fk_category`) REFERENCES `llx_categorie` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_lang` +-- + +LOCK TABLES `llx_categorie_lang` WRITE; +/*!40000 ALTER TABLE `llx_categorie_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_member` +-- + +DROP TABLE IF EXISTS `llx_categorie_member`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_member` ( + `fk_categorie` int(11) NOT NULL, + `fk_member` int(11) NOT NULL, + PRIMARY KEY (`fk_categorie`,`fk_member`), + KEY `idx_categorie_member_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_member_fk_member` (`fk_member`), + CONSTRAINT `fk_categorie_member_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_member_member_rowid` FOREIGN KEY (`fk_member`) REFERENCES `llx_adherent` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_member` +-- + +LOCK TABLES `llx_categorie_member` WRITE; +/*!40000 ALTER TABLE `llx_categorie_member` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_member` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_product` +-- + +DROP TABLE IF EXISTS `llx_categorie_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_product` ( + `fk_categorie` int(11) NOT NULL, + `fk_product` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_product`), + KEY `idx_categorie_product_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_product_fk_product` (`fk_product`), + CONSTRAINT `fk_categorie_product_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_product_product_rowid` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_product` +-- + +LOCK TABLES `llx_categorie_product` WRITE; +/*!40000 ALTER TABLE `llx_categorie_product` DISABLE KEYS */; +INSERT INTO `llx_categorie_product` VALUES (5,2,NULL),(6,2,NULL),(8,4,NULL),(9,5,NULL),(9,12,NULL),(10,3,NULL),(10,4,NULL),(24,1,NULL),(24,11,NULL),(25,10,NULL); +/*!40000 ALTER TABLE `llx_categorie_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_project` +-- + +DROP TABLE IF EXISTS `llx_categorie_project`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_project` ( + `fk_categorie` int(11) NOT NULL, + `fk_project` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_project`), + KEY `idx_categorie_project_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_project_fk_project` (`fk_project`), + CONSTRAINT `fk_categorie_project_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_project_fk_project` FOREIGN KEY (`fk_project`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_categorie_project_fk_project_rowid` FOREIGN KEY (`fk_project`) REFERENCES `llx_projet` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_project` +-- + +LOCK TABLES `llx_categorie_project` WRITE; +/*!40000 ALTER TABLE `llx_categorie_project` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_project` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_societe` +-- + +DROP TABLE IF EXISTS `llx_categorie_societe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_societe` ( + `fk_categorie` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_soc`), + KEY `idx_categorie_societe_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_societe_fk_societe` (`fk_soc`), + CONSTRAINT `fk_categorie_societe_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_societe_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_societe` +-- + +LOCK TABLES `llx_categorie_societe` WRITE; +/*!40000 ALTER TABLE `llx_categorie_societe` DISABLE KEYS */; +INSERT INTO `llx_categorie_societe` VALUES (2,2,NULL),(2,19,NULL),(12,10,NULL),(12,11,NULL),(14,11,NULL); +/*!40000 ALTER TABLE `llx_categorie_societe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_user` +-- + +DROP TABLE IF EXISTS `llx_categorie_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_user` ( + `fk_categorie` int(11) NOT NULL, + `fk_user` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_user`), + KEY `idx_categorie_user_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_user_fk_user` (`fk_user`), + CONSTRAINT `fk_categorie_user_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_user_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_user` +-- + +LOCK TABLES `llx_categorie_user` WRITE; +/*!40000 ALTER TABLE `llx_categorie_user` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categories_extrafields` +-- + +DROP TABLE IF EXISTS `llx_categories_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categories_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_categories_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categories_extrafields` +-- + +LOCK TABLES `llx_categories_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_categories_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categories_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_chargesociales` +-- + +DROP TABLE IF EXISTS `llx_chargesociales`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_chargesociales` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_ech` datetime NOT NULL, + `libelle` varchar(80) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_type` int(11) NOT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `paye` smallint(6) NOT NULL DEFAULT '0', + `periode` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `ref` varchar(16) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_chargesociales` +-- + +LOCK TABLES `llx_chargesociales` WRITE; +/*!40000 ALTER TABLE `llx_chargesociales` DISABLE KEYS */; +INSERT INTO `llx_chargesociales` VALUES (4,'2011-08-09 00:00:00','fff',1,60,NULL,NULL,10,1,'2011-08-01','2012-12-08 13:11:10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_chargesociales` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande` +-- + +DROP TABLE IF EXISTS `llx_commande`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `ref_client` varchar(255) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `date_commande` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `source` smallint(6) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `amount_ht` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `facture` tinyint(4) DEFAULT '0', + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(3) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `fk_warehouse` int(11) DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `fk_input_reason` int(11) DEFAULT NULL, + `fk_delivery_address` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_commande_ref` (`ref`,`entity`), + KEY `idx_commande_fk_soc` (`fk_soc`), + KEY `idx_commande_fk_user_author` (`fk_user_author`), + KEY `idx_commande_fk_user_valid` (`fk_user_valid`), + KEY `idx_commande_fk_user_cloture` (`fk_user_cloture`), + KEY `idx_commande_fk_projet` (`fk_projet`), + KEY `idx_commande_fk_account` (`fk_account`), + KEY `idx_commande_fk_currency` (`fk_currency`), + CONSTRAINT `fk_commande_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_commande_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_commande_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_commande_fk_user_cloture` FOREIGN KEY (`fk_user_cloture`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_commande_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande` +-- + +LOCK TABLES `llx_commande` WRITE; +/*!40000 ALTER TABLE `llx_commande` DISABLE KEYS */; +INSERT INTO `llx_commande` VALUES (1,'2016-07-30 15:13:20',1,NULL,'CO1107-0002',1,NULL,NULL,'','2011-07-20 15:23:12','2016-08-08 13:59:09',NULL,'2016-07-20',1,NULL,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,1,1,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(2,'2016-07-30 15:13:20',1,NULL,'CO1107-0003',1,NULL,NULL,'','2011-07-20 23:20:12','2018-02-12 17:06:51',NULL,'2016-07-21',1,NULL,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,0,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(3,'2016-07-30 15:13:20',1,NULL,'CO1107-0004',1,NULL,NULL,'','2011-07-20 23:22:53','2018-02-17 18:27:56',NULL,'2016-07-21',1,NULL,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,30.00000000,30.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(5,'2016-07-30 15:12:32',1,NULL,'CO1108-0001',1,NULL,NULL,'','2011-08-08 03:04:11','2015-08-08 03:04:21',NULL,'2015-08-08',1,NULL,1,NULL,NULL,2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(6,'2016-07-30 15:13:20',19,NULL,'(PROV6)',1,NULL,NULL,'','2013-02-17 16:22:14',NULL,NULL,'2016-02-17',1,NULL,NULL,NULL,NULL,0,0,0,NULL,0,11.76000000,0.00000000,0.00000000,60.00000000,71.76000000,'','','einstein',0,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(17,'2017-02-15 22:50:34',4,NULL,'CO7001-0005',1,NULL,NULL,NULL,'2017-02-15 23:50:34','2017-02-15 23:50:34',NULL,'2016-05-13',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,509.00000000,509.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,509.00000000,0.00000000,509.00000000),(18,'2017-02-15 23:08:58',7,4,'CO7001-0006',1,NULL,NULL,NULL,'2017-02-15 23:51:23','2017-02-15 23:51:23',NULL,'2017-02-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,900.00000000,900.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,900.00000000,0.00000000,900.00000000),(20,'2017-02-15 23:09:04',4,NULL,'CO7001-0007',1,NULL,NULL,NULL,'2017-02-15 23:55:52','2017-02-15 23:55:52',NULL,'2016-04-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,330.00000000,330.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,330.00000000,0.00000000,330.00000000),(29,'2017-02-15 23:08:42',4,NULL,'CO7001-0008',1,NULL,NULL,NULL,'2017-02-16 00:03:44','2017-02-16 00:03:44',NULL,'2017-02-12',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,457.00000000,457.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,457.00000000,0.00000000,457.00000000),(34,'2017-02-15 23:08:47',11,NULL,'CO7001-0009',1,NULL,NULL,NULL,'2017-02-16 00:05:01','2017-02-16 00:05:01',NULL,'2017-01-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,124.00000000,124.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,124.00000000,0.00000000,124.00000000),(38,'2017-02-15 23:08:50',3,NULL,'CO7001-0010',1,NULL,NULL,NULL,'2017-02-16 00:05:01','2017-02-16 00:05:01',NULL,'2017-02-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,0.00000000,200.00000000),(40,'2017-02-15 23:08:53',11,NULL,'CO7001-0011',1,NULL,NULL,NULL,'2017-02-16 00:05:10','2017-02-16 00:05:11',NULL,'2017-01-23',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,1210.00000000,1210.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1210.00000000,0.00000000,1210.00000000),(43,'2017-02-15 23:05:11',10,NULL,'CO7001-0012',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2017-02-16 00:05:11',NULL,'2017-02-13',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,478.00000000,478.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,478.00000000,0.00000000,478.00000000),(47,'2017-02-15 23:09:10',1,NULL,'CO7001-0013',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2017-02-16 00:05:11',NULL,'2016-11-13',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,55.00000000,55.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,55.00000000,0.00000000,55.00000000),(48,'2017-02-15 23:09:07',4,NULL,'CO7001-0014',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2017-02-16 00:05:11',NULL,'2016-07-30',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,540.00000000,540.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,540.00000000,0.00000000,540.00000000),(50,'2017-02-15 23:05:26',1,NULL,'CO7001-0015',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2017-02-16 00:05:26',NULL,'2017-12-12',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,118.00000000,118.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,118.00000000,0.00000000,118.00000000),(54,'2017-02-15 23:06:01',12,NULL,'CO7001-0016',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2017-02-16 00:05:26','2017-02-16 03:05:56','2016-06-03',12,NULL,12,12,1,3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,220.00000000,220.00000000,'','','',1,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,220.00000000,0.00000000,220.00000000),(58,'2017-02-15 23:09:13',1,NULL,'CO7001-0017',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2017-02-16 00:05:26',NULL,'2016-07-23',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,436.00000000,436.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,436.00000000,0.00000000,436.00000000),(62,'2017-02-15 23:09:16',19,NULL,'CO7001-0018',1,NULL,NULL,NULL,'2017-02-16 00:05:35','2017-02-16 00:05:35',NULL,'2016-02-23',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,410.00000000,410.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,410.00000000,0.00000000,410.00000000),(68,'2017-02-15 23:09:19',3,NULL,'CO7001-0019',1,NULL,NULL,NULL,'2017-02-16 00:05:35','2017-02-16 00:05:35',NULL,'2016-05-19',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,45.00000000,45.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,45.00000000,0.00000000,45.00000000),(72,'2017-02-15 23:09:23',6,NULL,'CO7001-0020',1,NULL,NULL,NULL,'2017-02-16 00:05:36','2017-02-16 00:05:36',NULL,'2016-11-13',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,610.00000000,610.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,2,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,610.00000000,0.00000000,610.00000000),(75,'2017-02-16 00:14:20',4,NULL,'CO7001-0021',1,NULL,NULL,NULL,'2017-02-16 00:05:37','2017-02-16 04:14:20',NULL,'2016-02-13',12,NULL,12,NULL,1,1,0,0,NULL,0,25.00000000,49.88000000,0.00000000,1200.00000000,1274.88000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1200.00000000,25.00000000,1274.88000000),(78,'2017-02-15 23:05:37',12,NULL,'CO7001-0022',1,NULL,NULL,NULL,'2017-02-16 00:05:37','2017-02-16 00:05:37',NULL,'2016-10-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,928.00000000,928.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,928.00000000,0.00000000,928.00000000),(81,'2017-02-15 23:09:30',11,NULL,'CO7001-0023',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2016-07-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,725.00000000,725.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,725.00000000,0.00000000,725.00000000),(83,'2017-02-15 23:10:24',26,NULL,'CO7001-0024',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2016-04-03',12,NULL,12,NULL,1,-1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,105.00000000,105.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,105.00000000,0.00000000,105.00000000),(84,'2017-02-15 23:05:38',2,NULL,'CO7001-0025',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2016-06-19',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,510.00000000,510.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,510.00000000,0.00000000,510.00000000),(85,'2017-02-15 23:05:38',1,NULL,'CO7001-0026',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2016-01-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,47.00000000,47.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,47.00000000,0.00000000,47.00000000),(88,'2017-02-15 23:09:36',10,NULL,'CO7001-0027',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2015-02-23',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000),(90,'2017-02-16 00:46:31',19,NULL,'(PROV90)',1,NULL,NULL,NULL,'2017-02-16 04:46:31',NULL,NULL,'2017-02-16',12,NULL,NULL,NULL,NULL,0,0,0,NULL,0,0.00000000,0.00000000,0.00000000,440.00000000,440.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,440.00000000,0.00000000,440.00000000),(91,'2017-02-16 00:46:37',1,NULL,'(PROV91)',1,NULL,NULL,NULL,'2017-02-16 04:46:37',NULL,NULL,'2017-02-16',12,NULL,NULL,NULL,NULL,0,0,0,NULL,0,0.00000000,0.00000000,0.00000000,1000.00000000,1000.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000),(92,'2017-02-16 00:47:25',3,NULL,'(PROV92)',1,NULL,NULL,NULL,'2017-02-16 04:47:25',NULL,NULL,'2017-02-16',12,NULL,NULL,NULL,NULL,0,0,0,NULL,0,0.00000000,0.00000000,0.00000000,1018.00000000,1018.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1018.00000000,0.00000000,1018.00000000); +/*!40000 ALTER TABLE `llx_commande` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commande_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_extrafields` +-- + +LOCK TABLES `llx_commande_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commande_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) NOT NULL, + `ref` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_supplier` varchar(255) DEFAULT NULL, + `fk_projet` int(11) DEFAULT '0', + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_approve` datetime DEFAULT NULL, + `date_approve2` datetime DEFAULT NULL, + `date_commande` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_approve` int(11) DEFAULT NULL, + `fk_user_approve2` int(11) DEFAULT NULL, + `source` smallint(6) NOT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `billed` smallint(6) DEFAULT '0', + `amount_ht` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_input_method` int(11) DEFAULT '0', + `fk_cond_reglement` int(11) DEFAULT '0', + `fk_mode_reglement` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `date_livraison` datetime DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_commande_fournisseur_ref` (`ref`,`fk_soc`,`entity`), + KEY `idx_commande_fournisseur_fk_soc` (`fk_soc`), + KEY `billed` (`billed`), + CONSTRAINT `fk_commande_fournisseur_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur` +-- + +LOCK TABLES `llx_commande_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseur` VALUES (1,'2017-02-01 14:54:01',13,'CF1007-0001',1,NULL,NULL,NULL,'2016-07-11 17:13:40','2017-02-01 18:51:42','2017-02-01 18:52:04',NULL,'2017-02-01',1,NULL,12,12,NULL,0,4,0,0,0,0,39.20000000,0.00000000,0.00000000,200.00000000,239.20000000,NULL,NULL,'muscadet',2,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(2,'2016-07-30 16:11:52',1,'CF1007-0002',1,NULL,NULL,NULL,'2016-07-11 18:46:28','2016-07-11 18:47:33',NULL,NULL,'2016-07-11',1,NULL,1,NULL,NULL,0,3,0,0,0,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,NULL,NULL,'muscadet',4,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(3,'2012-12-08 13:11:07',17,'(PROV3)',1,NULL,NULL,NULL,'2011-08-04 23:00:52',NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(4,'2012-12-08 13:11:07',17,'(PROV4)',1,NULL,NULL,NULL,'2011-08-04 23:19:32',NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(13,'2017-02-01 13:35:27',1,'CF1303-0004',1,NULL,NULL,NULL,'2016-03-09 19:39:18','2016-03-09 19:39:27','2016-03-09 19:39:32',NULL,'2016-03-09',1,NULL,1,1,NULL,0,2,0,0,0,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,NULL,NULL,'muscadet',1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_commande_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_dispatch` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_dispatch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_dispatch` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `fk_commandefourndet` int(11) NOT NULL DEFAULT '0', + `qty` float DEFAULT NULL, + `fk_entrepot` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `batch` varchar(30) DEFAULT NULL, + `eatby` date DEFAULT NULL, + `sellby` date DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_fournisseur_dispatch_fk_commande` (`fk_commande`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_dispatch` +-- + +LOCK TABLES `llx_commande_fournisseur_dispatch` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_dispatch` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_fournisseur_dispatch` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_fournisseur_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_extrafields` +-- + +LOCK TABLES `llx_commande_fournisseur_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_fournisseur_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_log` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datelog` datetime NOT NULL, + `fk_commande` int(11) NOT NULL, + `fk_statut` smallint(6) NOT NULL, + `fk_user` int(11) NOT NULL, + `comment` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_log` +-- + +LOCK TABLES `llx_commande_fournisseur_log` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_log` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseur_log` VALUES (1,'2010-07-11 15:13:40','2010-07-11 17:13:40',1,0,1,NULL),(2,'2010-07-11 15:15:42','2010-07-11 17:15:42',1,1,1,NULL),(3,'2010-07-11 15:16:28','2010-07-11 17:16:28',1,2,1,NULL),(4,'2010-07-11 15:19:14','2010-07-11 00:00:00',1,3,1,NULL),(5,'2010-07-11 15:19:36','2010-07-11 00:00:00',1,5,1,NULL),(6,'2010-07-11 16:46:28','2010-07-11 18:46:28',2,0,1,NULL),(7,'2010-07-11 16:47:33','2010-07-11 18:47:33',2,1,1,NULL),(8,'2010-07-11 16:47:41','2010-07-11 18:47:41',2,2,1,NULL),(9,'2010-07-11 16:48:00','2010-07-11 00:00:00',2,3,1,NULL),(10,'2011-08-04 21:00:52','2011-08-04 23:00:52',3,0,1,NULL),(11,'2011-08-04 21:19:32','2011-08-04 23:19:32',4,0,1,NULL),(12,'2011-08-04 21:22:16','2011-08-04 23:22:16',5,0,1,NULL),(13,'2011-08-04 21:22:54','2011-08-04 23:22:54',6,0,1,NULL),(14,'2011-08-04 21:23:29','2011-08-04 23:23:29',7,0,1,NULL),(15,'2011-08-04 21:36:10','2011-08-04 23:36:10',8,0,1,NULL),(19,'2011-08-08 13:04:37','2011-08-08 15:04:37',6,1,1,NULL),(20,'2011-08-08 13:04:38','2011-08-08 15:04:38',6,2,1,NULL),(29,'2013-03-09 18:39:18','2013-03-09 19:39:18',13,0,1,NULL),(30,'2013-03-09 18:39:27','2013-03-09 19:39:27',13,1,1,NULL),(31,'2013-03-09 18:39:32','2013-03-09 19:39:32',13,2,1,NULL),(32,'2013-03-09 18:39:41','2013-03-09 00:00:00',13,3,1,'hf'),(33,'2013-03-22 09:26:38','2013-03-22 10:26:38',14,0,1,NULL); +/*!40000 ALTER TABLE `llx_commande_fournisseur_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseurdet` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseurdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseurdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT '0.000', + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `special_code` int(11) DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `fk_commande_fournisseurdet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_commande_fournisseurdet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseurdet` +-- + +LOCK TABLES `llx_commande_fournisseurdet` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseurdet` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseurdet` VALUES (1,1,NULL,NULL,'','','Chips',19.600,'',0.000,'',0.000,'',10,0,0,20.00000000,200.00000000,39.20000000,0.00000000,0.00000000,239.20000000,0,NULL,NULL,0,NULL,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(2,2,NULL,4,'ABCD','Decapsuleur','',0.000,'',0.000,'',0.000,'',20,0,0,10.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(6,13,NULL,NULL,'','','dfgdf',0.000,'',0.000,'0',0.000,'0',1,0,0,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_commande_fournisseurdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseurdet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseurdet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseurdet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_fournisseurdet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseurdet_extrafields` +-- + +LOCK TABLES `llx_commande_fournisseurdet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseurdet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_fournisseurdet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commandedet` +-- + +DROP TABLE IF EXISTS `llx_commandedet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commandedet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT NULL, + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT NULL, + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `fk_remise_except` int(11) DEFAULT NULL, + `price` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_commandefourndet` int(11) DEFAULT NULL, + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_commandedet_fk_commande` (`fk_commande`), + KEY `idx_commandedet_fk_product` (`fk_product`), + KEY `fk_commandedet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_commandedet_fk_commande` FOREIGN KEY (`fk_commande`) REFERENCES `llx_commande` (`rowid`), + CONSTRAINT `fk_commandedet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=292 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commandedet` +-- + +LOCK TABLES `llx_commandedet` WRITE; +/*!40000 ALTER TABLE `llx_commandedet` DISABLE KEYS */; +INSERT INTO `llx_commandedet` VALUES (1,1,NULL,NULL,NULL,'Product 1',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(2,1,NULL,2,NULL,'',0.000,'',0.000,'',0.000,'',1,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(3,1,NULL,5,NULL,'cccc',0.000,'',0.000,'',0.000,'',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(4,2,NULL,NULL,NULL,'hgf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(10,5,NULL,NULL,NULL,'gfdgdf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(11,6,NULL,NULL,NULL,'gdfg',19.600,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(12,6,NULL,NULL,NULL,'gfdgd',19.600,'',0.000,'',0.000,'',1,0,0,NULL,50,50.00000000,50.00000000,9.80000000,0.00000000,0.00000000,59.80000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(14,3,NULL,NULL,NULL,'gdfgdf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(15,3,NULL,NULL,NULL,'fghfgh',0.000,'',0.000,'',0.000,'',1,0,0,NULL,20,20.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(16,17,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(17,17,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(18,17,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,9,9.00000000,9.00000000,0.00000000,0.00000000,0.00000000,9.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',9.00000000,9.00000000,0.00000000,9.00000000),(19,18,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(20,18,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(21,18,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(24,20,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,5,5.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',5.00000000,20.00000000,0.00000000,20.00000000),(25,20,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(26,20,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(55,29,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(56,29,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(57,29,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(58,29,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,9,9.00000000,27.00000000,0.00000000,0.00000000,0.00000000,27.00000000,1,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',9.00000000,27.00000000,0.00000000,27.00000000),(59,29,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,10,10.00000000,30.00000000,0.00000000,0.00000000,0.00000000,30.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',10.00000000,30.00000000,0.00000000,30.00000000),(75,34,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(76,34,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(77,34,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(78,34,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,9,9.00000000,9.00000000,0.00000000,0.00000000,0.00000000,9.00000000,1,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',9.00000000,9.00000000,0.00000000,9.00000000),(94,38,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(95,38,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(99,40,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(100,40,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(101,40,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(102,40,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(103,40,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(112,43,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(113,43,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(114,43,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(115,43,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(116,43,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(125,47,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(126,47,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(127,47,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(128,47,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(129,48,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(130,48,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(134,50,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(135,50,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(145,54,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(146,54,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(158,58,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(159,58,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(160,58,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,9,9.00000000,36.00000000,0.00000000,0.00000000,0.00000000,36.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',9.00000000,36.00000000,0.00000000,36.00000000),(174,62,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(175,62,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(176,62,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(198,68,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(199,68,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(209,72,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(210,72,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(211,72,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',10.00000000,10.00000000,0.00000000,10.00000000),(212,72,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(213,72,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(227,75,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(235,78,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(236,78,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(237,78,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(238,78,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(246,81,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(247,81,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(248,81,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,5,5.00000000,25.00000000,0.00000000,0.00000000,0.00000000,25.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',5.00000000,25.00000000,0.00000000,25.00000000),(253,83,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,5,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',5.00000000,5.00000000,0.00000000,5.00000000),(254,83,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(255,83,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(256,83,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(257,84,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(258,84,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(259,84,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(260,85,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,9,9.00000000,27.00000000,0.00000000,0.00000000,0.00000000,27.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',9.00000000,27.00000000,0.00000000,27.00000000),(261,85,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(262,85,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(271,88,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(272,88,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(276,75,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,90.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(278,75,NULL,13,NULL,'A powerfull computer XP4523 
\r\n(Code douane: USXP765 - Pays d'origine: Etats-Unis)',5.000,'',9.975,'1',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,25.00000000,49.88000000,0.00000000,574.88000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,25.00000000,574.88000000),(279,75,NULL,13,NULL,'A powerfull computer XP4523 
\n(Code douane: USXP765 - Pays d\'origine: Etats-Unis)',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(280,90,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(281,90,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,10,10.00000000,30.00000000,0.00000000,0.00000000,0.00000000,30.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',10.00000000,30.00000000,0.00000000,30.00000000),(282,90,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(283,90,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(284,91,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(285,91,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(286,91,NULL,13,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(287,92,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(288,92,NULL,13,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(289,92,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(290,92,NULL,13,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(291,92,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',9.00000000,18.00000000,0.00000000,18.00000000); +/*!40000 ALTER TABLE `llx_commandedet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commandedet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commandedet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commandedet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commandedet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commandedet_extrafields` +-- + +LOCK TABLES `llx_commandedet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commandedet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commandedet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_const` +-- + +DROP TABLE IF EXISTS `llx_const`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_const` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `value` text NOT NULL, + `type` varchar(6) DEFAULT NULL, + `visible` tinyint(4) NOT NULL DEFAULT '1', + `note` text, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_const` (`name`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=6545 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_const` +-- + +LOCK TABLES `llx_const` WRITE; +/*!40000 ALTER TABLE `llx_const` DISABLE KEYS */; +INSERT INTO `llx_const` VALUES (8,'MAIN_UPLOAD_DOC',0,'2048','chaine',0,'Max size for file upload (0 means no upload allowed)','2010-07-08 11:17:57'),(9,'MAIN_SEARCHFORM_SOCIETE',0,'1','yesno',0,'Show form for quick company search','2010-07-08 11:17:57'),(10,'MAIN_SEARCHFORM_CONTACT',0,'1','yesno',0,'Show form for quick contact search','2010-07-08 11:17:57'),(11,'MAIN_SEARCHFORM_PRODUITSERVICE',0,'1','yesno',0,'Show form for quick product search','2010-07-08 11:17:58'),(12,'MAIN_SEARCHFORM_ADHERENT',0,'1','yesno',0,'Show form for quick member search','2010-07-08 11:17:58'),(16,'MAIN_SIZE_LISTE_LIMIT',0,'25','chaine',0,'Longueur maximum des listes','2010-07-08 11:17:58'),(17,'MAIN_SHOW_WORKBOARD',0,'1','yesno',0,'Affichage tableau de bord de travail Dolibarr','2010-07-08 11:17:58'),(29,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',1,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2010-07-08 11:17:58'),(33,'SOCIETE_NOLIST_COURRIER',0,'1','yesno',0,'Liste les fichiers du repertoire courrier','2010-07-08 11:17:58'),(36,'ADHERENT_MAIL_REQUIRED',1,'1','yesno',0,'EMail required to create a new member','2010-07-08 11:17:58'),(37,'ADHERENT_MAIL_FROM',1,'adherents@domain.com','chaine',0,'Sender EMail for automatic emails','2010-07-08 11:17:58'),(38,'ADHERENT_MAIL_RESIL',1,'Your subscription has been resiliated.\r\nWe hope to see you soon again','texte',0,'Mail resiliation','2010-07-08 11:17:58'),(39,'ADHERENT_MAIL_VALID',1,'Your subscription has been validated.\r\nThis is a remind of your personal information :\r\n\r\n%INFOS%\r\n\r\n','texte',0,'Mail de validation','2010-07-08 11:17:59'),(40,'ADHERENT_MAIL_COTIS',1,'Hello %PRENOM%,\r\nThanks for your subscription.\r\nThis email confirms that your subscription has been received and processed.\r\n\r\n','texte',0,'Mail de validation de cotisation','2010-07-08 11:17:59'),(41,'ADHERENT_MAIL_VALID_SUBJECT',1,'Your subscription has been validated','chaine',0,'Sujet du mail de validation','2010-07-08 11:17:59'),(42,'ADHERENT_MAIL_RESIL_SUBJECT',1,'Resiliating your subscription','chaine',0,'Sujet du mail de resiliation','2010-07-08 11:17:59'),(43,'ADHERENT_MAIL_COTIS_SUBJECT',1,'Receipt of your subscription','chaine',0,'Sujet du mail de validation de cotisation','2010-07-08 11:17:59'),(44,'MAILING_EMAIL_FROM',1,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2010-07-08 11:17:59'),(45,'ADHERENT_USE_MAILMAN',1,'0','yesno',0,'Utilisation de Mailman','2010-07-08 11:17:59'),(46,'ADHERENT_MAILMAN_UNSUB_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&user=%EMAIL%','chaine',0,'Url de desinscription aux listes mailman','2010-07-08 11:17:59'),(47,'ADHERENT_MAILMAN_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%','chaine',0,'Url pour les inscriptions mailman','2010-07-08 11:17:59'),(48,'ADHERENT_MAILMAN_LISTS',1,'test-test,test-test2','chaine',0,'Listes auxquelles inscrire les nouveaux adherents','2010-07-08 11:17:59'),(49,'ADHERENT_MAILMAN_ADMINPW',1,'','chaine',0,'Mot de passe Admin des liste mailman','2010-07-08 11:17:59'),(50,'ADHERENT_MAILMAN_SERVER',1,'lists.domain.com','chaine',0,'Serveur hebergeant les interfaces d Admin des listes mailman','2010-07-08 11:17:59'),(51,'ADHERENT_MAILMAN_LISTS_COTISANT',1,'','chaine',0,'Liste(s) auxquelles les nouveaux cotisants sont inscris automatiquement','2010-07-08 11:17:59'),(52,'ADHERENT_USE_SPIP',1,'0','yesno',0,'Utilisation de SPIP ?','2010-07-08 11:17:59'),(53,'ADHERENT_USE_SPIP_AUTO',1,'0','yesno',0,'Utilisation de SPIP automatiquement','2010-07-08 11:17:59'),(54,'ADHERENT_SPIP_USER',1,'user','chaine',0,'user spip','2010-07-08 11:17:59'),(55,'ADHERENT_SPIP_PASS',1,'pass','chaine',0,'Pass de connection','2010-07-08 11:17:59'),(56,'ADHERENT_SPIP_SERVEUR',1,'localhost','chaine',0,'serveur spip','2010-07-08 11:17:59'),(57,'ADHERENT_SPIP_DB',1,'spip','chaine',0,'db spip','2010-07-08 11:17:59'),(58,'ADHERENT_CARD_HEADER_TEXT',1,'%ANNEE%','chaine',0,'Texte imprime sur le haut de la carte adherent','2010-07-08 11:17:59'),(59,'ADHERENT_CARD_FOOTER_TEXT',1,'Association AZERTY','chaine',0,'Texte imprime sur le bas de la carte adherent','2010-07-08 11:17:59'),(61,'FCKEDITOR_ENABLE_USER',1,'1','yesno',0,'Activation fckeditor sur notes utilisateurs','2010-07-08 11:17:59'),(62,'FCKEDITOR_ENABLE_SOCIETE',1,'1','yesno',0,'Activation fckeditor sur notes societe','2010-07-08 11:17:59'),(63,'FCKEDITOR_ENABLE_PRODUCTDESC',1,'1','yesno',0,'Activation fckeditor sur notes produits','2010-07-08 11:17:59'),(64,'FCKEDITOR_ENABLE_MEMBER',1,'1','yesno',0,'Activation fckeditor sur notes adherent','2010-07-08 11:17:59'),(65,'FCKEDITOR_ENABLE_MAILING',1,'1','yesno',0,'Activation fckeditor sur emailing','2010-07-08 11:17:59'),(67,'DON_ADDON_MODEL',1,'html_cerfafr','chaine',0,'','2010-07-08 11:18:00'),(68,'PROPALE_ADDON',1,'mod_propale_marbre','chaine',0,'','2010-07-08 11:18:00'),(69,'PROPALE_ADDON_PDF',1,'azur','chaine',0,'','2010-07-08 11:18:00'),(70,'COMMANDE_ADDON',1,'mod_commande_marbre','chaine',0,'','2010-07-08 11:18:00'),(71,'COMMANDE_ADDON_PDF',1,'einstein','chaine',0,'','2010-07-08 11:18:00'),(72,'COMMANDE_SUPPLIER_ADDON',1,'mod_commande_fournisseur_muguet','chaine',0,'','2010-07-08 11:18:00'),(73,'COMMANDE_SUPPLIER_ADDON_PDF',1,'muscadet','chaine',0,'','2010-07-08 11:18:00'),(74,'EXPEDITION_ADDON',1,'enlevement','chaine',0,'','2010-07-08 11:18:00'),(76,'FICHEINTER_ADDON',1,'pacific','chaine',0,'','2010-07-08 11:18:00'),(77,'FICHEINTER_ADDON_PDF',1,'soleil','chaine',0,'','2010-07-08 11:18:00'),(79,'FACTURE_ADDON_PDF',1,'crabe','chaine',0,'','2010-07-08 11:18:00'),(80,'PROPALE_VALIDITY_DURATION',1,'15','chaine',0,'Durée de validitée des propales','2010-07-08 11:18:00'),(230,'COMPANY_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2010-07-08 11:26:20'),(238,'LIVRAISON_ADDON_PDF',1,'typhon','chaine',0,'Nom du gestionnaire de generation des commandes en PDF','2010-07-08 11:26:27'),(239,'LIVRAISON_ADDON_NUMBER',1,'mod_livraison_jade','chaine',0,'Nom du gestionnaire de numerotation des bons de livraison','2013-03-20 13:17:36'),(245,'FACTURE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2010-07-08 11:28:53'),(249,'DON_FORM',1,'html_cerfafr','chaine',0,'Nom du gestionnaire de formulaire de dons','2017-09-06 16:12:22'),(254,'ADHERENT_BANK_ACCOUNT',1,'','chaine',0,'ID du Compte banquaire utilise','2010-07-08 11:29:05'),(255,'ADHERENT_BANK_CATEGORIE',1,'','chaine',0,'ID de la categorie banquaire des cotisations','2010-07-08 11:29:05'),(256,'ADHERENT_ETIQUETTE_TYPE',1,'L7163','chaine',0,'Type d etiquette (pour impression de planche d etiquette)','2010-07-08 11:29:05'),(269,'PROJECT_ADDON_PDF',1,'baleine','chaine',0,'Nom du gestionnaire de generation des projets en PDF','2010-07-08 11:29:33'),(270,'PROJECT_ADDON',1,'mod_project_simple','chaine',0,'Nom du gestionnaire de numerotation des projets','2010-07-08 11:29:33'),(368,'STOCK_USERSTOCK_AUTOCREATE',1,'1','chaine',0,'','2010-07-08 22:44:59'),(369,'EXPEDITION_ADDON_PDF',1,'merou','chaine',0,'','2010-07-08 22:58:07'),(377,'FACTURE_ADDON',1,'mod_facture_terre','chaine',0,'','2010-07-08 23:08:12'),(380,'ADHERENT_CARD_TEXT',1,'%TYPE% n° %ID%\r\n%PRENOM% %NOM%\r\n<%EMAIL%>\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%','',0,'Texte imprime sur la carte adherent','2010-07-08 23:14:46'),(381,'ADHERENT_CARD_TEXT_RIGHT',1,'aaa','',0,'','2010-07-08 23:14:55'),(385,'PRODUIT_USE_SEARCH_TO_SELECT',1,'1','chaine',0,'','2010-07-08 23:22:19'),(386,'STOCK_CALCULATE_ON_SHIPMENT',1,'1','chaine',0,'','2010-07-08 23:23:21'),(387,'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER',1,'1','chaine',0,'','2010-07-08 23:23:26'),(392,'MAIN_AGENDA_XCAL_EXPORTKEY',1,'dolibarr','chaine',0,'','2010-07-08 23:27:50'),(393,'MAIN_AGENDA_EXPORT_PAST_DELAY',1,'100','chaine',0,'','2010-07-08 23:27:50'),(610,'CASHDESK_ID_THIRDPARTY',1,'7','chaine',0,'','2010-07-11 17:08:18'),(611,'CASHDESK_ID_BANKACCOUNT_CASH',1,'3','chaine',0,'','2010-07-11 17:08:18'),(612,'CASHDESK_ID_BANKACCOUNT_CHEQUE',1,'1','chaine',0,'','2010-07-11 17:08:18'),(613,'CASHDESK_ID_BANKACCOUNT_CB',1,'1','chaine',0,'','2010-07-11 17:08:18'),(614,'CASHDESK_ID_WAREHOUSE',1,'2','chaine',0,'','2010-07-11 17:08:18'),(660,'LDAP_USER_DN',1,'ou=users,dc=my-domain,dc=com','chaine',0,NULL,'2010-07-18 10:25:27'),(661,'LDAP_GROUP_DN',1,'ou=groups,dc=my-domain,dc=com','chaine',0,NULL,'2010-07-18 10:25:27'),(662,'LDAP_FILTER_CONNECTION',1,'&(objectClass=user)(objectCategory=person)','chaine',0,NULL,'2010-07-18 10:25:27'),(663,'LDAP_FIELD_LOGIN',1,'uid','chaine',0,NULL,'2010-07-18 10:25:27'),(664,'LDAP_FIELD_FULLNAME',1,'cn','chaine',0,NULL,'2010-07-18 10:25:27'),(665,'LDAP_FIELD_NAME',1,'sn','chaine',0,NULL,'2010-07-18 10:25:27'),(666,'LDAP_FIELD_FIRSTNAME',1,'givenname','chaine',0,NULL,'2010-07-18 10:25:27'),(667,'LDAP_FIELD_MAIL',1,'mail','chaine',0,NULL,'2010-07-18 10:25:27'),(668,'LDAP_FIELD_PHONE',1,'telephonenumber','chaine',0,NULL,'2010-07-18 10:25:27'),(669,'LDAP_FIELD_FAX',1,'facsimiletelephonenumber','chaine',0,NULL,'2010-07-18 10:25:27'),(670,'LDAP_FIELD_MOBILE',1,'mobile','chaine',0,NULL,'2010-07-18 10:25:27'),(671,'LDAP_SERVER_TYPE',1,'openldap','chaine',0,'','2010-07-18 10:25:46'),(672,'LDAP_SERVER_PROTOCOLVERSION',1,'3','chaine',0,'','2010-07-18 10:25:47'),(673,'LDAP_SERVER_HOST',1,'localhost','chaine',0,'','2010-07-18 10:25:47'),(674,'LDAP_SERVER_PORT',1,'389','chaine',0,'','2010-07-18 10:25:47'),(675,'LDAP_SERVER_USE_TLS',1,'0','chaine',0,'','2010-07-18 10:25:47'),(676,'LDAP_SYNCHRO_ACTIVE',1,'dolibarr2ldap','chaine',0,'','2010-07-18 10:25:47'),(677,'LDAP_CONTACT_ACTIVE',1,'1','chaine',0,'','2010-07-18 10:25:47'),(678,'LDAP_MEMBER_ACTIVE',1,'1','chaine',0,'','2010-07-18 10:25:47'),(974,'MAIN_MODULE_WORKFLOW_TRIGGERS',1,'1','chaine',0,NULL,'2011-07-18 18:02:20'),(975,'WORKFLOW_PROPAL_AUTOCREATE_ORDER',1,'1','chaine',0,'','2011-07-18 18:02:24'),(980,'PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR',1,'1234567','chaine',0,'','2011-07-18 18:05:50'),(983,'FACTURE_RIB_NUMBER',1,'1','chaine',0,'','2011-07-18 18:35:14'),(984,'FACTURE_CHQ_NUMBER',1,'1','chaine',0,'','2011-07-18 18:35:14'),(1016,'GOOGLE_DUPLICATE_INTO_GCAL',1,'1','chaine',0,'','2011-07-18 21:40:20'),(1152,'SOCIETE_CODECLIENT_ADDON',1,'mod_codeclient_monkey','chaine',0,'','2011-07-29 20:50:02'),(1231,'MAIN_UPLOAD_DOC',1,'2048','chaine',0,'','2011-07-29 21:04:00'),(1234,'MAIN_UMASK',1,'0664','chaine',0,'','2011-07-29 21:04:11'),(1240,'MAIN_LOGEVENTS_USER_LOGIN',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1241,'MAIN_LOGEVENTS_USER_LOGIN_FAILED',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1242,'MAIN_LOGEVENTS_USER_LOGOUT',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1243,'MAIN_LOGEVENTS_USER_CREATE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1244,'MAIN_LOGEVENTS_USER_MODIFY',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1245,'MAIN_LOGEVENTS_USER_NEW_PASSWORD',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1246,'MAIN_LOGEVENTS_USER_ENABLEDISABLE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1247,'MAIN_LOGEVENTS_USER_DELETE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1248,'MAIN_LOGEVENTS_GROUP_CREATE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1249,'MAIN_LOGEVENTS_GROUP_MODIFY',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1250,'MAIN_LOGEVENTS_GROUP_DELETE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1251,'MAIN_BOXES_MAXLINES',1,'5','',0,'','2011-07-29 21:05:42'),(1482,'EXPEDITION_ADDON_NUMBER',1,'mod_expedition_safor','chaine',0,'Nom du gestionnaire de numerotation des expeditions','2011-08-05 17:53:11'),(1490,'CONTRACT_ADDON',1,'mod_contract_serpis','chaine',0,'Nom du gestionnaire de numerotation des contrats','2011-08-05 18:11:58'),(1677,'COMMANDE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/orders','chaine',0,NULL,'2012-12-08 13:11:02'),(1698,'PRODUCT_CODEPRODUCT_ADDON',1,'mod_codeproduct_leopard','yesno',0,'Module to control product codes','2012-12-08 13:11:25'),(1724,'PROPALE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2012-12-08 13:17:14'),(1730,'OPENSTREETMAP_ENABLE_MAPS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1731,'OPENSTREETMAP_ENABLE_MAPS_CONTACTS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1732,'OPENSTREETMAP_ENABLE_MAPS_MEMBERS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1733,'OPENSTREETMAP_MAPS_ZOOM_LEVEL',1,'15','chaine',0,'','2012-12-08 13:22:47'),(1742,'MAIN_MAIL_EMAIL_FROM',2,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2012-12-08 14:08:14'),(1743,'MAIN_MENU_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2013-02-11 19:43:54'),(1744,'MAIN_MENUFRONT_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2013-02-11 19:43:54'),(1745,'MAIN_MENU_SMARTPHONE',2,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2012-12-08 14:08:14'),(1746,'MAIN_MENUFRONT_SMARTPHONE',2,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2012-12-08 14:08:14'),(1747,'MAIN_THEME',2,'eldy','chaine',0,'Default theme','2012-12-08 14:08:14'),(1748,'MAIN_DELAY_ACTIONS_TODO',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2012-12-08 14:08:14'),(1749,'MAIN_DELAY_ORDERS_TO_PROCESS',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2012-12-08 14:08:14'),(1750,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2012-12-08 14:08:14'),(1751,'MAIN_DELAY_PROPALS_TO_CLOSE',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2012-12-08 14:08:14'),(1752,'MAIN_DELAY_PROPALS_TO_BILL',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2012-12-08 14:08:14'),(1753,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2012-12-08 14:08:14'),(1754,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2012-12-08 14:08:14'),(1755,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2012-12-08 14:08:14'),(1756,'MAIN_DELAY_RUNNING_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2012-12-08 14:08:14'),(1757,'MAIN_DELAY_MEMBERS',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2012-12-08 14:08:14'),(1758,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',2,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2012-12-08 14:08:14'),(1759,'MAILING_EMAIL_FROM',2,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2012-12-08 14:08:14'),(1760,'MAIN_INFO_SOCIETE_COUNTRY',3,'1:FR:France','chaine',0,'','2013-02-26 21:56:28'),(1761,'MAIN_INFO_SOCIETE_NOM',3,'bbb','chaine',0,'','2012-12-08 14:08:20'),(1762,'MAIN_INFO_SOCIETE_STATE',3,'0','chaine',0,'','2013-02-27 14:20:27'),(1763,'MAIN_MONNAIE',3,'EUR','chaine',0,'','2012-12-08 14:08:20'),(1764,'MAIN_LANG_DEFAULT',3,'auto','chaine',0,'','2012-12-08 14:08:20'),(1765,'MAIN_MAIL_EMAIL_FROM',3,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2012-12-08 14:08:20'),(1766,'MAIN_MENU_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2013-02-11 19:43:54'),(1767,'MAIN_MENUFRONT_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2013-02-11 19:43:54'),(1768,'MAIN_MENU_SMARTPHONE',3,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2012-12-08 14:08:20'),(1769,'MAIN_MENUFRONT_SMARTPHONE',3,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2012-12-08 14:08:20'),(1770,'MAIN_THEME',3,'eldy','chaine',0,'Default theme','2012-12-08 14:08:20'),(1771,'MAIN_DELAY_ACTIONS_TODO',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2012-12-08 14:08:20'),(1772,'MAIN_DELAY_ORDERS_TO_PROCESS',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2012-12-08 14:08:20'),(1773,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2012-12-08 14:08:20'),(1774,'MAIN_DELAY_PROPALS_TO_CLOSE',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2012-12-08 14:08:20'),(1775,'MAIN_DELAY_PROPALS_TO_BILL',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2012-12-08 14:08:20'),(1776,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2012-12-08 14:08:20'),(1777,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2012-12-08 14:08:20'),(1778,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2012-12-08 14:08:20'),(1779,'MAIN_DELAY_RUNNING_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2012-12-08 14:08:20'),(1780,'MAIN_DELAY_MEMBERS',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2012-12-08 14:08:20'),(1781,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',3,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2012-12-08 14:08:20'),(1782,'MAILING_EMAIL_FROM',3,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2012-12-08 14:08:20'),(1803,'SYSLOG_FILE',1,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2012-12-08 14:15:08'),(1804,'SYSLOG_HANDLERS',1,'[\"mod_syslog_file\"]','chaine',0,'','2012-12-08 14:15:08'),(1805,'MAIN_MODULE_SKINCOLOREDITOR',3,'1',NULL,0,NULL,'2012-12-08 14:35:40'),(1806,'MAIN_MODULE_SKINCOLOREDITOR_TABS_0',3,'user:+tabskincoloreditors:ColorEditor:skincoloreditor@skincoloreditor:/skincoloreditor/usercolors.php?id=__ID__','chaine',0,NULL,'2012-12-08 14:35:40'),(1922,'PAYPAL_API_SANDBOX',1,'1','chaine',0,'','2012-12-12 12:11:05'),(1923,'PAYPAL_API_USER',1,'seller_1355312017_biz_api1.nltechno.com','chaine',0,'','2012-12-12 12:11:05'),(1924,'PAYPAL_API_PASSWORD',1,'1355312040','chaine',0,'','2012-12-12 12:11:05'),(1925,'PAYPAL_API_SIGNATURE',1,'AXqqdsWBzvfn0q5iNmbuiDv1y.3EAXIMWyl4C5KvDReR9HDwwAd6dQ4Q','chaine',0,'','2012-12-12 12:11:05'),(1926,'PAYPAL_API_INTEGRAL_OR_PAYPALONLY',1,'integral','chaine',0,'','2012-12-12 12:11:05'),(1927,'PAYPAL_SECURITY_TOKEN',1,'50c82fab36bb3b6aa83e2a50691803b2','chaine',0,'','2012-12-12 12:11:05'),(1928,'PAYPAL_SECURITY_TOKEN_UNIQUE',1,'0','chaine',0,'','2012-12-12 12:11:05'),(1929,'PAYPAL_ADD_PAYMENT_URL',1,'1','chaine',0,'','2012-12-12 12:11:05'),(1980,'MAIN_PDF_FORMAT',1,'EUA4','chaine',0,'','2012-12-12 19:58:05'),(1981,'MAIN_PROFID1_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1982,'MAIN_PROFID2_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1983,'MAIN_PROFID3_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1984,'MAIN_PROFID4_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1985,'MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',1,'0','chaine',0,'','2012-12-12 19:58:05'),(2251,'FCKEDITOR_TEST',1,'Test
\r\n\"\"fdfs','chaine',0,'','2012-12-19 19:12:24'),(2293,'SYSTEMTOOLS_MYSQLDUMP',1,'/usr/bin/mysqldump','chaine',0,'','2012-12-27 02:02:00'),(2835,'MAIN_USE_CONNECT_TIMEOUT',1,'10','chaine',0,'','2013-01-16 19:28:50'),(2836,'MAIN_USE_RESPONSE_TIMEOUT',1,'30','chaine',0,'','2013-01-16 19:28:50'),(2837,'MAIN_PROXY_USE',1,'0','chaine',0,'','2013-01-16 19:28:50'),(2838,'MAIN_PROXY_HOST',1,'localhost','chaine',0,'','2013-01-16 19:28:50'),(2839,'MAIN_PROXY_PORT',1,'8080','chaine',0,'','2013-01-16 19:28:50'),(2840,'MAIN_PROXY_USER',1,'aaa','chaine',0,'','2013-01-16 19:28:50'),(2841,'MAIN_PROXY_PASS',1,'bbb','chaine',0,'','2013-01-16 19:28:50'),(2848,'OVHSMS_NICK',1,'BN196-OVH','chaine',0,'','2013-01-16 19:32:36'),(2849,'OVHSMS_PASS',1,'bigone-10','chaine',0,'','2013-01-16 19:32:36'),(2850,'OVHSMS_SOAPURL',1,'https://www.ovh.com/soapi/soapi-re-1.55.wsdl','chaine',0,'','2013-01-16 19:32:36'),(2854,'THEME_ELDY_RGB',1,'bfbf00','chaine',0,'','2013-01-18 10:02:53'),(2855,'THEME_ELDY_ENABLE_PERSONALIZED',1,'0','chaine',0,'','2013-01-18 10:02:55'),(2858,'MAIN_SESSION_TIMEOUT',1,'2000','chaine',0,'','2013-01-19 17:01:53'),(2862,'TICKET_ADDON',1,'mod_ticket_avenc','chaine',0,'Nom du gestionnaire de numerotation des tickets','2013-01-19 17:16:10'),(2867,'FACSIM_ADDON',1,'mod_facsim_alcoy','chaine',0,'','2013-01-19 17:16:25'),(2868,'POS_SERVICES',1,'0','chaine',0,'','2013-01-19 17:16:51'),(2869,'POS_USE_TICKETS',1,'1','chaine',0,'','2013-01-19 17:16:51'),(2870,'POS_MAX_TTC',1,'100','chaine',0,'','2013-01-19 17:16:51'),(3190,'MAIN_MODULE_HOLIDAY',2,'1',NULL,0,NULL,'2013-02-01 08:52:34'),(3191,'MAIN_MODULE_HOLIDAY_TABS_0',2,'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->write:/holiday/index.php?mainmenu=holiday&id=__ID__','chaine',0,NULL,'2013-02-01 08:52:34'),(3195,'INVOICE_SUPPLIER_ADDON_PDF',1,'canelle','chaine',0,'','2013-02-10 19:50:27'),(3199,'MAIN_FORCE_RELOAD_PAGE',1,'1','chaine',0,NULL,'2013-02-12 16:22:55'),(3217,'MAIN_PDF_TITLE_BACKGROUND_COLOR',1,'240,240,240','chaine',1,'','2013-02-13 15:18:02'),(3223,'OVH_THIRDPARTY_IMPORT',1,'2','chaine',0,'','2013-02-13 16:20:18'),(3241,'COMPANY_USE_SEARCH_TO_SELECT',1,'2','chaine',0,'','2013-02-17 14:33:39'),(3409,'AGENDA_USE_EVENT_TYPE',1,'1','chaine',0,'','2013-02-27 18:12:24'),(3886,'MAIN_REMOVE_INSTALL_WARNING',1,'1','chaine',1,'','2013-03-02 18:32:50'),(4013,'MAIN_DELAY_ACTIONS_TODO',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4014,'MAIN_DELAY_PROPALS_TO_CLOSE',1,'31','chaine',0,'','2013-03-06 08:59:12'),(4015,'MAIN_DELAY_PROPALS_TO_BILL',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4016,'MAIN_DELAY_ORDERS_TO_PROCESS',1,'2','chaine',0,'','2013-03-06 08:59:12'),(4017,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',1,'31','chaine',0,'','2013-03-06 08:59:12'),(4018,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4019,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',1,'2','chaine',0,'','2013-03-06 08:59:12'),(4020,'MAIN_DELAY_RUNNING_SERVICES',1,'-15','chaine',0,'','2013-03-06 08:59:12'),(4021,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',1,'62','chaine',0,'','2013-03-06 08:59:13'),(4022,'MAIN_DELAY_MEMBERS',1,'31','chaine',0,'','2013-03-06 08:59:13'),(4023,'MAIN_DISABLE_METEO',1,'0','chaine',0,'','2013-03-06 08:59:13'),(4044,'ADHERENT_VAT_FOR_SUBSCRIPTIONS',1,'0','',0,'','2013-03-06 16:06:38'),(4047,'ADHERENT_BANK_USE',1,'bankviainvoice','',0,'','2013-03-06 16:12:30'),(4049,'PHPSANE_SCANIMAGE',1,'/usr/bin/scanimage','chaine',0,'','2013-03-06 21:54:13'),(4050,'PHPSANE_PNMTOJPEG',1,'/usr/bin/pnmtojpeg','chaine',0,'','2013-03-06 21:54:13'),(4051,'PHPSANE_PNMTOTIFF',1,'/usr/bin/pnmtotiff','chaine',0,'','2013-03-06 21:54:13'),(4052,'PHPSANE_OCR',1,'/usr/bin/gocr','chaine',0,'','2013-03-06 21:54:13'),(4548,'ECM_AUTO_TREE_ENABLED',1,'1','chaine',0,'','2013-03-10 15:57:21'),(4579,'MAIN_MODULE_AGENDA',2,'1',NULL,0,NULL,'2013-03-13 15:29:19'),(4580,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4581,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4582,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4583,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4584,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4585,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4586,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4587,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4588,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4589,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4590,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4591,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4592,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4593,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4594,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4595,'MAIN_MODULE_GOOGLE',2,'1',NULL,0,NULL,'2013-03-13 15:29:47'),(4596,'MAIN_MODULE_GOOGLE_TABS_0',2,'agenda:+gcal:MenuAgendaGoogle:google@google:$conf->google->enabled && $conf->global->GOOGLE_ENABLE_AGENDA:/google/index.php','chaine',0,NULL,'2013-03-13 15:29:47'),(4597,'MAIN_MODULE_GOOGLE_TABS_1',2,'user:+gsetup:GoogleUserConf:google@google:$conf->google->enabled && $conf->global->GOOGLE_DUPLICATE_INTO_GCAL:/google/admin/google_calsync_user.php?id=__ID__','chaine',0,NULL,'2013-03-13 15:29:47'),(4598,'MAIN_MODULE_GOOGLE_TRIGGERS',2,'1','chaine',0,NULL,'2013-03-13 15:29:47'),(4599,'MAIN_MODULE_GOOGLE_HOOKS',2,'[\"toprightmenu\"]','chaine',0,NULL,'2013-03-13 15:29:47'),(4688,'GOOGLE_ENABLE_AGENDA',2,'1','chaine',0,'','2013-03-13 15:36:29'),(4689,'GOOGLE_AGENDA_NAME1',2,'eldy','chaine',0,'','2013-03-13 15:36:29'),(4690,'GOOGLE_AGENDA_SRC1',2,'eldy10@mail.com','chaine',0,'','2013-03-13 15:36:29'),(4691,'GOOGLE_AGENDA_COLOR1',2,'BE6D00','chaine',0,'','2013-03-13 15:36:29'),(4692,'GOOGLE_AGENDA_COLOR2',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4693,'GOOGLE_AGENDA_COLOR3',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4694,'GOOGLE_AGENDA_COLOR4',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4695,'GOOGLE_AGENDA_COLOR5',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4696,'GOOGLE_AGENDA_TIMEZONE',2,'Europe/Paris','chaine',0,'','2013-03-13 15:36:29'),(4697,'GOOGLE_AGENDA_NB',2,'5','chaine',0,'','2013-03-13 15:36:29'),(4725,'SOCIETE_CODECLIENT_ADDON',2,'mod_codeclient_leopard','chaine',0,'Module to control third parties codes','2013-03-13 20:21:35'),(4726,'SOCIETE_CODECOMPTA_ADDON',2,'mod_codecompta_panicum','chaine',0,'Module to control third parties codes','2013-03-13 20:21:35'),(4727,'SOCIETE_FISCAL_MONTH_START',2,'','chaine',0,'Mettre le numero du mois du debut d\\\'annee fiscale, ex: 9 pour septembre','2013-03-13 20:21:35'),(4728,'MAIN_SEARCHFORM_SOCIETE',2,'1','yesno',0,'Show form for quick company search','2013-03-13 20:21:35'),(4729,'MAIN_SEARCHFORM_CONTACT',2,'1','yesno',0,'Show form for quick contact search','2013-03-13 20:21:35'),(4730,'COMPANY_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2013-03-13 20:21:35'),(4743,'MAIN_MODULE_CLICKTODIAL',2,'1',NULL,0,NULL,'2013-03-13 20:30:28'),(4744,'MAIN_MODULE_NOTIFICATION',2,'1',NULL,0,NULL,'2013-03-13 20:30:34'),(4745,'MAIN_MODULE_WEBSERVICES',2,'1',NULL,0,NULL,'2013-03-13 20:30:41'),(4746,'MAIN_MODULE_PROPALE',2,'1',NULL,0,NULL,'2013-03-13 20:32:38'),(4747,'PROPALE_ADDON_PDF',2,'azur','chaine',0,'Nom du gestionnaire de generation des propales en PDF','2013-03-13 20:32:38'),(4748,'PROPALE_ADDON',2,'mod_propale_marbre','chaine',0,'Nom du gestionnaire de numerotation des propales','2013-03-13 20:32:38'),(4749,'PROPALE_VALIDITY_DURATION',2,'15','chaine',0,'Duration of validity of business proposals','2013-03-13 20:32:38'),(4750,'PROPALE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2013-03-13 20:32:38'),(4752,'MAIN_MODULE_TAX',2,'1',NULL,0,NULL,'2013-03-13 20:32:47'),(4753,'MAIN_MODULE_DON',2,'1',NULL,0,NULL,'2013-03-13 20:32:54'),(4754,'DON_ADDON_MODEL',2,'html_cerfafr','chaine',0,'Nom du gestionnaire de generation de recu de dons','2013-03-13 20:32:54'),(4755,'POS_USE_TICKETS',2,'1','chaine',0,'','2013-03-13 20:33:09'),(4756,'POS_MAX_TTC',2,'100','chaine',0,'','2013-03-13 20:33:09'),(4757,'MAIN_MODULE_POS',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4758,'TICKET_ADDON',2,'mod_ticket_avenc','chaine',0,'Nom du gestionnaire de numerotation des tickets','2013-03-13 20:33:09'),(4759,'MAIN_MODULE_BANQUE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4760,'MAIN_MODULE_FACTURE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4761,'FACTURE_ADDON_PDF',2,'crabe','chaine',0,'Name of PDF model of invoice','2013-03-13 20:33:09'),(4762,'FACTURE_ADDON',2,'mod_facture_terre','chaine',0,'Name of numbering numerotation rules of invoice','2013-03-13 20:33:09'),(4763,'FACTURE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2013-03-13 20:33:09'),(4764,'MAIN_MODULE_SOCIETE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4765,'MAIN_MODULE_PRODUCT',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4766,'PRODUCT_CODEPRODUCT_ADDON',2,'mod_codeproduct_leopard','chaine',0,'Module to control product codes','2013-03-13 20:33:09'),(4767,'MAIN_SEARCHFORM_PRODUITSERVICE',2,'1','yesno',0,'Show form for quick product search','2013-03-13 20:33:09'),(4772,'FACSIM_ADDON',2,'mod_facsim_alcoy','chaine',0,'','2013-03-13 20:33:32'),(4773,'MAIN_MODULE_MAILING',2,'1',NULL,0,NULL,'2013-03-13 20:33:37'),(4774,'MAIN_MODULE_OPENSURVEY',2,'1',NULL,0,NULL,'2013-03-13 20:33:42'),(4782,'AGENDA_USE_EVENT_TYPE',2,'1','chaine',0,'','2013-03-13 20:53:36'),(4884,'AGENDA_DISABLE_EXT',2,'1','chaine',0,'','2013-03-13 22:03:40'),(4928,'COMMANDE_SUPPLIER_ADDON_NUMBER',1,'mod_commande_fournisseur_muguet','chaine',0,'Nom du gestionnaire de numerotation des commandes fournisseur','2013-03-22 09:24:29'),(4929,'INVOICE_SUPPLIER_ADDON_NUMBER',1,'mod_facture_fournisseur_cactus','chaine',0,'Nom du gestionnaire de numerotation des factures fournisseur','2013-03-22 09:24:29'),(5001,'MAIN_CRON_KEY',0,'bc54582fe30d5d4a830c6f582ec28810','chaine',0,'','2013-03-23 17:54:53'),(5009,'CRON_KEY',0,'2c2e755c20be2014098f629865598006','chaine',0,'','2013-03-23 18:06:24'),(5139,'SOCIETE_ADD_REF_IN_LIST',1,'','yesno',0,'Display customer ref into select list','2013-09-08 23:06:08'),(5150,'PROJECT_TASK_ADDON_PDF',1,'','chaine',0,'Name of PDF/ODT tasks manager class','2013-09-08 23:06:14'),(5151,'PROJECT_TASK_ADDON',1,'mod_task_simple','chaine',0,'Name of Numbering Rule task manager class','2013-09-08 23:06:14'),(5152,'PROJECT_TASK_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/tasks','chaine',0,'','2013-09-08 23:06:14'),(5239,'BOOKMARKS_SHOW_IN_MENU',1,'10','chaine',0,'','2014-03-02 15:42:26'),(5271,'DONATION_ART200',1,'','yesno',0,'Option Française - Eligibilité Art200 du CGI','2014-12-21 12:51:28'),(5272,'DONATION_ART238',1,'','yesno',0,'Option Française - Eligibilité Art238 bis du CGI','2014-12-21 12:51:28'),(5273,'DONATION_ART885',1,'','yesno',0,'Option Française - Eligibilité Art885-0 V bis du CGI','2014-12-21 12:51:28'),(5274,'DONATION_MESSAGE',1,'Thank you','chaine',0,'Message affiché sur le récépissé de versements ou dons','2014-12-21 12:51:28'),(5288,'DONATION_ACCOUNTINGACCOUNT',1,'7581','chaine',0,'Compte comptable de remise des versements ou dons','2015-07-19 13:41:21'),(5349,'MAIN_SEARCHFORM_CONTACT',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5351,'MAIN_SEARCHFORM_PRODUITSERVICE',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5352,'MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER',1,'0','chaine',0,'','2015-10-03 10:11:33'),(5353,'MAIN_SEARCHFORM_ADHERENT',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5354,'MAIN_SEARCHFORM_PROJECT',1,'0','chaine',0,'','2015-10-03 10:11:33'),(5394,'FCKEDITOR_ENABLE_DETAILS',1,'1','yesno',0,'WYSIWIG for products details lines for all entities','2015-11-04 15:27:44'),(5395,'FCKEDITOR_ENABLE_USERSIGN',1,'1','yesno',0,'WYSIWIG for user signature','2015-11-04 15:27:44'),(5396,'FCKEDITOR_ENABLE_MAIL',1,'1','yesno',0,'WYSIWIG for products details lines for all entities','2015-11-04 15:27:44'),(5398,'CATEGORIE_RECURSIV_ADD',1,'','yesno',0,'Affect parent categories','2015-11-04 15:27:46'),(5403,'MAIN_MODULE_FCKEDITOR',1,'1',NULL,0,NULL,'2015-11-04 15:41:40'),(5404,'MAIN_MODULE_CATEGORIE',1,'1',NULL,0,NULL,'2015-11-04 15:41:43'),(5415,'EXPEDITION_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/shipment','chaine',0,NULL,'2015-11-15 22:38:28'),(5416,'LIVRAISON_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/delivery','chaine',0,NULL,'2015-11-15 22:38:28'),(5419,'MAIN_MODULE_CASHDESK',1,'1',NULL,0,NULL,'2015-11-15 22:38:33'),(5426,'MAIN_MODULE_PROJET',1,'1',NULL,0,NULL,'2015-11-15 22:38:44'),(5427,'PROJECT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/projects','chaine',0,NULL,'2015-11-15 22:38:44'),(5428,'PROJECT_USE_OPPORTUNIES',1,'1','chaine',0,NULL,'2015-11-15 22:38:44'),(5430,'MAIN_MODULE_EXPORT',1,'1',NULL,0,NULL,'2015-11-15 22:38:56'),(5431,'MAIN_MODULE_IMPORT',1,'1',NULL,0,NULL,'2015-11-15 22:38:58'),(5432,'MAIN_MODULE_MAILING',1,'1',NULL,0,NULL,'2015-11-15 22:39:00'),(5434,'EXPENSEREPORT_ADDON_PDF',1,'standard','chaine',0,'Name of manager to build PDF expense reports documents','2015-11-15 22:39:05'),(5435,'MAIN_MODULE_SALARIES',1,'1',NULL,0,NULL,'2015-11-15 22:39:08'),(5436,'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',1,'421','chaine',0,NULL,'2015-11-15 22:39:08'),(5437,'SALARIES_ACCOUNTING_ACCOUNT_CHARGE',1,'641','chaine',0,NULL,'2015-11-15 22:39:08'),(5441,'ADHERENT_ETIQUETTE_TEXT',1,'%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%','texte',0,'Text to print on member address sheets','2015-11-15 22:39:17'),(5443,'MAIN_MODULE_PRELEVEMENT',1,'1',NULL,0,NULL,'2015-11-15 22:39:33'),(5453,'MAIN_MODULE_CONTRAT',1,'1',NULL,0,NULL,'2015-11-15 22:39:52'),(5455,'MAIN_MODULE_FICHEINTER',1,'1',NULL,0,NULL,'2015-11-15 22:39:56'),(5459,'MAIN_MODULE_PAYPAL',1,'1',NULL,0,NULL,'2015-11-15 22:41:02'),(5460,'MAIN_MODULE_MARGIN',1,'1',NULL,0,NULL,'2015-11-15 22:41:47'),(5461,'MAIN_MODULE_MARGIN_TABS_0',1,'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__','chaine',0,NULL,'2015-11-15 22:41:47'),(5462,'MAIN_MODULE_MARGIN_TABS_1',1,'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous && ($object->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__','chaine',0,NULL,'2015-11-15 22:41:47'),(5463,'MAIN_MODULE_PROPALE',1,'1',NULL,0,NULL,'2015-11-15 22:41:47'),(5483,'GENBARCODE_BARCODETYPE_THIRDPARTY',1,'6','chaine',0,'','2016-01-16 15:49:43'),(5484,'PRODUIT_DEFAULT_BARCODE_TYPE',1,'2','chaine',0,'','2016-01-16 15:49:46'),(5539,'PRODUCT_USE_OLD_PATH_FOR_PHOTO',0,'0','chaine',1,'Use old path for products images','2016-01-22 13:34:23'),(5541,'MODULE_GOOGLE_DEBUG',1,'0','chaine',1,'','2016-01-22 13:34:57'),(5586,'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',1,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur les notes de frais impayées','2016-01-22 17:28:18'),(5587,'MAIN_FIX_FOR_BUGGED_MTA',1,'1','chaine',1,'Set constant to fix email ending from PHP with some linux ike system','2016-01-22 17:28:18'),(5590,'MAIN_VERSION_LAST_INSTALL',0,'3.8.3','chaine',0,'Dolibarr version when install','2016-01-22 17:28:42'),(5604,'MAIN_INFO_SOCIETE_LOGO',1,'mybigcompany.png','chaine',0,'','2016-01-22 17:33:49'),(5605,'MAIN_INFO_SOCIETE_LOGO_SMALL',1,'mybigcompany_small.png','chaine',0,'','2016-01-22 17:33:49'),(5606,'MAIN_INFO_SOCIETE_LOGO_MINI',1,'mybigcompany_mini.png','chaine',0,'','2016-01-22 17:33:49'),(5612,'MAIN_ENABLE_LOG_TO_HTML',0,'0','chaine',1,'If this option is set to 1, it is possible to see log output at end of HTML sources by adding paramater logtohtml=1 on URL','2016-03-13 10:54:45'),(5614,'MAIN_SIZE_SHORTLISTE_LIMIT',1,'4','chaine',0,'Longueur maximum des listes courtes (fiche client)','2016-03-13 10:54:46'),(5626,'MAIN_MODULE_SUPPLIERPROPOSAL',1,'1',NULL,0,NULL,'2016-07-30 11:13:20'),(5627,'SUPPLIER_PROPOSAL_ADDON_PDF',1,'aurore','chaine',0,'Name of submodule to generate PDF for supplier quotation request','2016-07-30 11:13:20'),(5628,'SUPPLIER_PROPOSAL_ADDON',1,'mod_supplier_proposal_marbre','chaine',0,'Name of submodule to number supplier quotation request','2016-07-30 11:13:20'),(5629,'SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/supplier_proposal','chaine',0,NULL,'2016-07-30 11:13:20'),(5632,'MAIN_MODULE_RESOURCE',1,'1',NULL,0,NULL,'2016-07-30 11:13:32'),(5633,'MAIN_MODULE_API',1,'1',NULL,0,NULL,'2016-07-30 11:13:54'),(5634,'MAIN_MODULE_WEBSERVICES',1,'1',NULL,0,NULL,'2016-07-30 11:13:56'),(5635,'WEBSERVICES_KEY',1,'dolibarrkey','chaine',0,'','2016-07-30 11:14:04'),(5638,'MAIN_MODULE_EXTERNALRSS',1,'1',NULL,0,NULL,'2016-07-30 11:15:04'),(5639,'EXTERNAL_RSS_TITLE_1',1,'Dolibarr.org News','chaine',0,'','2016-07-30 11:15:25'),(5640,'EXTERNAL_RSS_URLRSS_1',1,'https://www.dolibarr.org/rss','chaine',0,'','2016-07-30 11:15:25'),(5642,'SOCIETE_CODECOMPTA_ADDON',1,'mod_codecompta_aquarium','chaine',0,'','2016-07-30 11:16:42'),(5707,'CASHDESK_NO_DECREASE_STOCK',1,'1','chaine',0,'','2016-07-30 13:38:11'),(5708,'MAIN_MODULE_PRODUCTBATCH',1,'1',NULL,0,NULL,'2016-07-30 13:38:11'),(5710,'MAIN_MODULE_STOCK',1,'1',NULL,0,NULL,'2016-07-30 13:38:11'),(5711,'MAIN_MODULE_PRODUCT',1,'1',NULL,0,NULL,'2016-07-30 13:38:11'),(5712,'MAIN_MODULE_EXPEDITION',1,'1',NULL,0,NULL,'2016-07-30 13:38:11'),(5808,'MARGIN_TYPE',1,'costprice','chaine',0,'','2016-07-30 16:32:18'),(5809,'DISPLAY_MARGIN_RATES',1,'1','chaine',0,'','2016-07-30 16:32:20'),(5810,'MAIN_FEATURES_LEVEL',0,'0','chaine',1,'Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development','2016-07-30 18:36:15'),(5813,'USER_PASSWORD_PATTERN',1,'8;1;1;1;3;1','chaine',0,'','2016-07-31 16:04:58'),(5814,'MAIN_MODULE_EXPENSEREPORT',1,'1',NULL,0,NULL,'2016-07-31 21:14:32'),(5830,'LOAN_ACCOUNTING_ACCOUNT_CAPITAL',1,'164','chaine',0,NULL,'2017-01-29 15:11:51'),(5831,'LOAN_ACCOUNTING_ACCOUNT_INSURANCE',1,'6162','chaine',0,NULL,'2017-01-29 15:11:51'),(5833,'ACCOUNTING_EXPORT_SEPARATORCSV',1,',','string',0,NULL,'2017-01-29 15:11:56'),(5834,'ACCOUNTING_ACCOUNT_SUSPENSE',1,'471','chaine',0,NULL,'2017-01-29 15:11:56'),(5835,'ACCOUNTING_SELL_JOURNAL',1,'VTE','chaine',0,NULL,'2017-01-29 15:11:56'),(5836,'ACCOUNTING_PURCHASE_JOURNAL',1,'ACH','chaine',0,NULL,'2017-01-29 15:11:56'),(5837,'ACCOUNTING_SOCIAL_JOURNAL',1,'SOC','chaine',0,NULL,'2017-01-29 15:11:56'),(5838,'ACCOUNTING_MISCELLANEOUS_JOURNAL',1,'OD','chaine',0,NULL,'2017-01-29 15:11:56'),(5839,'ACCOUNTING_ACCOUNT_TRANSFER_CASH',1,'58','chaine',0,NULL,'2017-01-29 15:11:56'),(5840,'CHARTOFACCOUNTS',1,'2','chaine',0,NULL,'2017-01-29 15:11:56'),(5841,'ACCOUNTING_EXPORT_MODELCSV',1,'1','chaine',0,NULL,'2017-01-29 15:11:56'),(5842,'ACCOUNTING_LENGTH_GACCOUNT',1,'','chaine',0,NULL,'2017-01-29 15:11:56'),(5843,'ACCOUNTING_LENGTH_AACCOUNT',1,'','chaine',0,NULL,'2017-01-29 15:11:56'),(5844,'ACCOUNTING_LIST_SORT_VENTILATION_TODO',1,'1','yesno',0,NULL,'2017-01-29 15:11:56'),(5845,'ACCOUNTING_LIST_SORT_VENTILATION_DONE',1,'1','yesno',0,NULL,'2017-01-29 15:11:56'),(5846,'ACCOUNTING_EXPORT_DATE',1,'%d%m%Y','chaine',0,NULL,'2017-01-29 15:11:56'),(5847,'ACCOUNTING_EXPENSEREPORT_JOURNAL',1,'ER','chaine',0,NULL,'2017-01-29 15:11:56'),(5848,'ACCOUNTING_EXPORT_FORMAT',1,'csv','chaine',0,NULL,'2017-01-29 15:11:56'),(5853,'MAIN_MODULE_WORKFLOW',1,'1',NULL,0,NULL,'2017-01-29 15:12:12'),(5854,'MAIN_MODULE_NOTIFICATION',1,'1',NULL,0,NULL,'2017-01-29 15:12:35'),(5855,'MAIN_MODULE_OAUTH',1,'1',NULL,0,NULL,'2017-01-29 15:12:41'),(5856,'MAIN_MODULE_PRINTING',1,'1',NULL,0,NULL,'2017-01-29 15:12:44'),(5883,'MAILING_LIMIT_SENDBYWEB',0,'15','chaine',1,'Number of targets to defined packet size when sending mass email','2017-01-29 17:36:33'),(5884,'MAIN_MAIL_DEBUG',1,'0','chaine',1,'','2017-01-29 18:53:02'),(5885,'MAIN_SOAP_DEBUG',1,'0','chaine',1,'','2017-01-29 18:53:02'),(5887,'PROJECT_USE_OPPORTUNITIES',1,'1','chaine',0,'','2017-02-01 12:23:56'),(5888,'PROJECT_HIDE_TASKS',1,'1','chaine',0,'','2017-02-01 12:23:56'),(5889,'MAIN_AGENDA_ACTIONAUTO_COMPANY_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5890,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5891,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLOSE_REFUSED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5892,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLOSE_SIGNED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5893,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLASSIFY_BILLED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5894,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5895,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5896,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5897,'MAIN_AGENDA_ACTIONAUTO_ORDER_CLOSE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5898,'MAIN_AGENDA_ACTIONAUTO_ORDER_CANCEL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5899,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5900,'MAIN_AGENDA_ACTIONAUTO_ORDER_CLASSIFY_BILLED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5901,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5902,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5903,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5904,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5905,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5906,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5907,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_APPROVE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5908,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_RECEIVE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5909,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_SUBMIT',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5910,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_REFUSE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5911,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_CLASSIFY_BILLED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5912,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5913,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_UNVALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5914,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5915,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_PAYED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5916,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5917,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_CANCELED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5918,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5919,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_REOPEN',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5920,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5921,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5922,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5923,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5924,'MAIN_AGENDA_ACTIONAUTO_MEMBER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5925,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5926,'MAIN_AGENDA_ACTIONAUTO_MEMBER_MODIFY',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5927,'MAIN_AGENDA_ACTIONAUTO_MEMBER_RESILIATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5928,'MAIN_AGENDA_ACTIONAUTO_MEMBER_DELETE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5929,'MAIN_AGENDA_ACTIONAUTO_PROJECT_CREATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5930,'MAIN_AGENDA_ACTIONAUTO_PROJECT_DELETE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5931,'DATABASE_PWD_ENCRYPTED',1,'1','chaine',0,'','2017-02-01 15:06:04'),(5932,'MAIN_DISABLE_ALL_MAILS',1,'0','chaine',0,'','2017-02-01 15:09:09'),(5933,'MAIN_MAIL_SENDMODE',1,'mail','chaine',0,'','2017-02-01 15:09:09'),(5934,'MAIN_MAIL_SMTP_PORT',1,'465','chaine',0,'','2017-02-01 15:09:09'),(5935,'MAIN_MAIL_SMTP_SERVER',1,'smtp.mail.com','chaine',0,'','2017-02-01 15:09:09'),(5936,'MAIN_MAIL_SMTPS_ID',1,'eldy10@mail.com','chaine',0,'','2017-02-01 15:09:09'),(5937,'MAIN_MAIL_SMTPS_PW',1,'bidonge','chaine',0,'','2017-02-01 15:09:09'),(5938,'MAIN_MAIL_EMAIL_FROM',1,'robot@example.com','chaine',0,'','2017-02-01 15:09:09'),(5939,'MAIN_MAIL_DEFAULT_FROMTYPE',1,'user','chaine',0,'','2017-02-01 15:09:09'),(5940,'PRELEVEMENT_ID_BANKACCOUNT',1,'1','chaine',0,'','2017-02-06 04:04:47'),(5941,'PRELEVEMENT_ICS',1,'ICS123456','chaine',0,'','2017-02-06 04:04:47'),(5942,'PRELEVEMENT_USER',1,'1','chaine',0,'','2017-02-06 04:04:47'),(5943,'BANKADDON_PDF',1,'sepamandate','chaine',0,'','2017-02-06 04:13:52'),(5947,'CHEQUERECEIPTS_THYME_MASK',1,'CHK{yy}{mm}-{0000@1}','chaine',0,'','2017-02-06 04:16:27'),(5948,'MAIN_MODULE_LOAN',1,'1',NULL,0,NULL,'2017-02-06 19:19:05'),(5954,'MAIN_SUBMODULE_EXPEDITION',1,'1','chaine',0,'','2017-02-06 23:57:37'),(5963,'MAIN_MODULE_BANQUE',1,'1',NULL,0,NULL,'2017-02-07 18:56:12'),(5964,'MAIN_MODULE_TAX',1,'1',NULL,0,NULL,'2017-02-07 18:56:12'),(5996,'CABINETMED_RHEUMATOLOGY_ON',1,'0','texte',0,'','2017-02-12 19:20:04'),(5999,'MAIN_SEARCHFORM_SOCIETE',1,'1','texte',0,'','2017-02-12 19:20:04'),(6000,'CABINETMED_BANK_PATIENT_REQUIRED',1,'0','texte',0,'','2017-02-12 19:20:04'),(6004,'MAIN_MODULE_MULTICOMPANY_CSS',1,'[\"\\/multicompany\\/css\\/multicompany.css.php\"]','chaine',0,NULL,'2017-02-15 17:17:11'),(6019,'MAIN_INFO_SOCIETE_COUNTRY',2,'1:FR:France','chaine',0,'','2017-02-15 17:18:22'),(6020,'MAIN_INFO_SOCIETE_NOM',2,'MySecondCompany','chaine',0,'','2017-02-15 17:18:22'),(6021,'MAIN_INFO_SOCIETE_STATE',2,'0','chaine',0,'','2017-02-15 17:18:22'),(6022,'MAIN_MONNAIE',2,'EUR','chaine',0,'','2017-02-15 17:18:22'),(6023,'MAIN_LANG_DEFAULT',2,'auto','chaine',0,'','2017-02-15 17:18:22'),(6032,'MAIN_MODULE_MULTICURRENCY',1,'1',NULL,0,NULL,'2017-02-15 17:29:59'),(6047,'MAIN_MODULE_SYSLOG',0,'1',NULL,0,NULL,'2017-02-15 22:36:58'),(6048,'SYSLOG_FACILITY',0,'LOG_USER','chaine',0,'','2017-02-15 22:37:01'),(6049,'SYSLOG_FIREPHP_INCLUDEPATH',0,'/home/ldestailleur/git/dolibarr_5.0/htdocs/includes/firephp/firephp-core/lib/','chaine',0,'','2017-02-15 22:37:01'),(6050,'SYSLOG_FILE',0,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2017-02-15 22:37:01'),(6051,'SYSLOG_CHROMEPHP_INCLUDEPATH',0,'/home/ldestailleur/git/dolibarr_5.0/htdocs/includes/ccampbell/chromephp/','chaine',0,'','2017-02-15 22:37:01'),(6052,'SYSLOG_HANDLERS',0,'[\"mod_syslog_file\"]','chaine',0,'','2017-02-15 22:37:01'),(6054,'SYSLOG_LEVEL',0,'7','chaine',0,'','2017-02-15 22:37:21'),(6074,'CABINETMED_DELAY_TO_LOCK_RECORD',1,'','chaine',1,'Number of days before locking edit of consultation','2017-02-21 00:04:15'),(6092,'MAIN_SIZE_SHORTLIST_LIMIT',0,'3','chaine',0,'Max length for small lists (tabs)','2017-05-12 09:02:38'),(6099,'MAIN_MODULE_SKYPE',1,'1',NULL,0,NULL,'2017-05-12 09:03:51'),(6100,'MAIN_MODULE_GRAVATAR',1,'1',NULL,0,NULL,'2017-05-12 09:03:54'),(6101,'MAIN_MODULE_ACCOUNTING',1,'1',NULL,0,NULL,'2017-05-12 09:14:30'),(6102,'PRODUCT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/products','chaine',0,'','2017-08-27 13:29:07'),(6103,'CONTRACT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/contracts','chaine',0,'','2017-08-27 13:29:07'),(6104,'USERGROUP_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/usergroups','chaine',0,'','2017-08-27 13:29:07'),(6105,'USER_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/users','chaine',0,'','2017-08-27 13:29:07'),(6106,'MAIN_ENABLE_OVERWRITE_TRANSLATION',1,'1','chaine',0,'Enable overwrote of translation','2017-08-27 13:29:07'),(6108,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_CREATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6109,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_CLASSIFY_BILLED',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6110,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_CLASSIFY_UNBILLED',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6111,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_CREATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6112,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_MODIFY',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6113,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_DELETE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6114,'MAIN_AGENDA_ACTIONAUTO_PROJECT_MODIFY',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6115,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_CREATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6116,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_VALIDATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6117,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_APPROVE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6118,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_PAYED',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6119,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_CREATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6120,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_VALIDATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6121,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_APPROVE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6137,'MAIN_LANG_DEFAULT',1,'auto','chaine',0,'','2017-08-28 10:19:58'),(6138,'MAIN_MULTILANGS',1,'1','chaine',0,'','2017-08-28 10:19:58'),(6139,'MAIN_THEME',1,'eldy','chaine',0,'','2017-08-28 10:19:58'),(6140,'THEME_ELDY_USE_HOVER',1,'edf4fb','chaine',0,'','2017-08-28 10:19:58'),(6141,'MAIN_SIZE_LISTE_LIMIT',1,'25','chaine',0,'','2017-08-28 10:19:59'),(6142,'MAIN_SIZE_SHORTLIST_LIMIT',1,'3','chaine',0,'','2017-08-28 10:19:59'),(6143,'MAIN_DISABLE_JAVASCRIPT',1,'0','chaine',0,'','2017-08-28 10:19:59'),(6144,'MAIN_BUTTON_HIDE_UNAUTHORIZED',1,'0','chaine',0,'','2017-08-28 10:19:59'),(6145,'MAIN_START_WEEK',1,'1','chaine',0,'','2017-08-28 10:19:59'),(6146,'MAIN_DEFAULT_WORKING_DAYS',1,'1-5','chaine',0,'','2017-08-28 10:19:59'),(6147,'MAIN_DEFAULT_WORKING_HOURS',1,'9-18','chaine',0,'','2017-08-28 10:19:59'),(6148,'MAIN_SHOW_LOGO',1,'1','chaine',0,'','2017-08-28 10:19:59'),(6149,'MAIN_FIRSTNAME_NAME_POSITION',1,'0','chaine',0,'','2017-08-28 10:19:59'),(6150,'MAIN_HELPCENTER_DISABLELINK',0,'1','chaine',0,'','2017-08-28 10:19:59'),(6151,'MAIN_HOME',1,'__(NoteSomeFeaturesAreDisabled)__
\r\n
\r\n__(SomeTranslationAreUncomplete)__
','chaine',0,'','2017-08-28 10:19:59'),(6152,'MAIN_HELP_DISABLELINK',0,'0','chaine',0,'','2017-08-28 10:19:59'),(6153,'MAIN_BUGTRACK_ENABLELINK',1,'0','chaine',0,'','2017-08-28 10:19:59'),(6154,'MAIN_LOGIN_BACKGROUND',1,'background_dolibarr.jpg','chaine',0,'','2017-08-28 10:19:59'),(6353,'MAIN_MENU_STANDARD',1,'eldy_menu.php','chaine',0,'','2017-08-30 15:14:44'),(6354,'MAIN_MENU_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2017-08-30 15:14:44'),(6355,'MAIN_MENUFRONT_STANDARD',1,'eldy_menu.php','chaine',0,'','2017-08-30 15:14:44'),(6356,'MAIN_MENUFRONT_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2017-08-30 15:14:44'),(6376,'MAIN_VERSION_LAST_UPGRADE',0,'6.0.1','chaine',0,'Dolibarr version for last upgrade','2017-09-04 12:19:03'),(6377,'COMMANDE_SAPHIR_MASK',1,'{yy}{mm}{000}{ttt}','chaine',0,'','2017-09-06 07:56:25'),(6461,'MAIN_INFO_SOCIETE_COUNTRY',1,'117:IN:India','chaine',0,'','2017-09-06 08:51:11'),(6462,'MAIN_INFO_SOCIETE_NOM',1,'MyBigCompany','chaine',0,'','2017-09-06 08:51:11'),(6463,'MAIN_INFO_SOCIETE_ADDRESS',1,'21 Jump street..ll..ee \"','chaine',0,'','2017-09-06 08:51:11'),(6464,'MAIN_INFO_SOCIETE_TOWN',1,'MyTown','chaine',0,'','2017-09-06 08:51:12'),(6465,'MAIN_INFO_SOCIETE_ZIP',1,'75500','chaine',0,'','2017-09-06 08:51:12'),(6466,'MAIN_INFO_SOCIETE_STATE',1,'290','chaine',0,'','2017-09-06 08:51:12'),(6467,'MAIN_MONNAIE',1,'EUR','chaine',0,'','2017-09-06 08:51:12'),(6468,'MAIN_INFO_SOCIETE_TEL',1,'09123123','chaine',0,'','2017-09-06 08:51:12'),(6469,'MAIN_INFO_SOCIETE_FAX',1,'09123124','chaine',0,'','2017-09-06 08:51:12'),(6470,'MAIN_INFO_SOCIETE_MAIL',1,'myemail@mybigcompany.com','chaine',0,'','2017-09-06 08:51:12'),(6471,'MAIN_INFO_SOCIETE_WEB',1,'https://www.dolibarr.org','chaine',0,'','2017-09-06 08:51:12'),(6472,'MAIN_INFO_SOCIETE_NOTE',1,'This is note about my company\r\n\"ee\"','chaine',0,'','2017-09-06 08:51:12'),(6473,'MAIN_INFO_SOCIETE_GENCOD',1,'1234567890','chaine',0,'','2017-09-06 08:51:12'),(6474,'MAIN_INFO_SOCIETE_MANAGERS',1,'Zack Zeceo','chaine',0,'','2017-09-06 08:51:12'),(6475,'MAIN_INFO_CAPITAL',1,'10000','chaine',0,'','2017-09-06 08:51:12'),(6476,'MAIN_INFO_SOCIETE_FORME_JURIDIQUE',1,'0','chaine',0,'','2017-09-06 08:51:12'),(6477,'MAIN_INFO_SIREN',1,'123456','chaine',0,'','2017-09-06 08:51:12'),(6478,'MAIN_INFO_SIRET',1,'1','chaine',0,'','2017-09-06 08:51:12'),(6479,'MAIN_INFO_APE',1,'1','chaine',0,'','2017-09-06 08:51:12'),(6480,'MAIN_INFO_RCS',1,'1','chaine',0,'','2017-09-06 08:51:12'),(6481,'MAIN_INFO_PROFID5',1,'1','chaine',0,'','2017-09-06 08:51:12'),(6482,'MAIN_INFO_TVAINTRA',1,'FR1234567','chaine',0,'','2017-09-06 08:51:12'),(6483,'MAIN_INFO_SOCIETE_OBJECT',1,'A company demo to show how Dolibarr ERP CRM is wonderfull','chaine',0,'','2017-09-06 08:51:12'),(6484,'SOCIETE_FISCAL_MONTH_START',1,'4','chaine',0,'','2017-09-06 08:51:12'),(6485,'FACTURE_TVAOPTION',1,'1','chaine',0,'','2017-09-06 08:51:12'),(6486,'FACTURE_LOCAL_TAX1_OPTION',1,'localtax1on','chaine',0,'','2017-09-06 08:51:12'),(6487,'FACTURE_LOCAL_TAX2_OPTION',1,'localtax2on','chaine',0,'','2017-09-06 08:51:12'),(6488,'MAIN_INFO_VALUE_LOCALTAX1',1,'0','chaine',0,'','2017-09-06 08:51:12'),(6489,'MAIN_INFO_LOCALTAX_CALC1',1,'0','chaine',0,'','2017-09-06 08:51:12'),(6490,'MAIN_INFO_VALUE_LOCALTAX2',1,'0','chaine',0,'','2017-09-06 08:51:12'),(6491,'MAIN_INFO_LOCALTAX_CALC2',1,'0','chaine',0,'','2017-09-06 08:51:12'),(6497,'MAIN_MODULE_AGENDA',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6498,'MAIN_MODULE_BARCODE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6499,'MAIN_MODULE_CRON',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6500,'MAIN_MODULE_COMMANDE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6501,'MAIN_MODULE_DON',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6502,'MAIN_MODULE_ECM',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6503,'MAIN_MODULE_FACTURE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6504,'MAIN_MODULE_FOURNISSEUR',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6505,'MAIN_MODULE_HOLIDAY',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6506,'MAIN_MODULE_HOLIDAY_TABS_0',1,'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=hrm&id=__ID__','chaine',0,NULL,'2017-09-06 16:18:46'),(6507,'MAIN_MODULE_OPENSURVEY',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6508,'MAIN_MODULE_SOCIETE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6509,'MAIN_MODULE_SERVICE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6510,'MAIN_MODULE_USER',0,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-09-06 16:18:46'),(6518,'GOOGLE_DUPLICATE_INTO_THIRDPARTIES',1,'1','chaine',0,'','2017-09-06 19:43:57'),(6519,'GOOGLE_DUPLICATE_INTO_CONTACTS',1,'0','chaine',0,'','2017-09-06 19:43:57'),(6520,'GOOGLE_TAG_PREFIX',1,'Dolibarr (Thirdparties)','chaine',0,'','2017-09-06 19:43:57'),(6521,'GOOGLE_TAG_PREFIX_CONTACTS',1,'Dolibarr (Contacts/Addresses)','chaine',0,'','2017-09-06 19:43:57'),(6522,'GOOGLE_ENABLE_AGENDA',1,'1','chaine',0,'','2017-09-06 19:44:12'),(6523,'GOOGLE_AGENDA_COLOR1',1,'1B887A','chaine',0,'','2017-09-06 19:44:12'),(6524,'GOOGLE_AGENDA_COLOR2',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6525,'GOOGLE_AGENDA_COLOR3',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6526,'GOOGLE_AGENDA_COLOR4',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6527,'GOOGLE_AGENDA_COLOR5',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6528,'GOOGLE_AGENDA_TIMEZONE',1,'Europe/Paris','chaine',0,'','2017-09-06 19:44:12'),(6529,'GOOGLE_AGENDA_NB',1,'5','chaine',0,'','2017-09-06 19:44:12'),(6543,'MAIN_SMS_DEBUG',0,'1','chaine',1,'This is to enable OVH SMS debug','2017-09-06 19:44:34'); +/*!40000 ALTER TABLE `llx_const` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contrat` +-- + +DROP TABLE IF EXISTS `llx_contrat`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contrat` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `ref_ext` varchar(30) DEFAULT NULL, + `ref_supplier` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_contrat` datetime DEFAULT NULL, + `statut` smallint(6) DEFAULT '0', + `mise_en_service` datetime DEFAULT NULL, + `fin_validite` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_commercial_signature` int(11) DEFAULT NULL, + `fk_commercial_suivi` int(11) DEFAULT NULL, + `fk_user_author` int(11) NOT NULL DEFAULT '0', + `fk_user_mise_en_service` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `ref_customer` varchar(30) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_contrat_ref` (`ref`,`entity`), + KEY `idx_contrat_fk_soc` (`fk_soc`), + KEY `idx_contrat_fk_user_author` (`fk_user_author`), + CONSTRAINT `fk_contrat_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_contrat_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contrat` +-- + +LOCK TABLES `llx_contrat` WRITE; +/*!40000 ALTER TABLE `llx_contrat` DISABLE KEYS */; +INSERT INTO `llx_contrat` VALUES (1,'CONTRACT1',NULL,NULL,1,'2010-07-08 23:53:55','2010-07-09 01:53:25','2010-07-09 00:00:00',1,NULL,NULL,NULL,3,NULL,2,2,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'CONTRAT1',NULL,NULL,1,'2010-07-10 16:18:16','2010-07-10 18:13:37','2010-07-10 00:00:00',1,NULL,NULL,NULL,2,NULL,2,2,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'CT1303-0001',NULL,NULL,1,'2013-03-06 09:05:07','2013-03-06 10:04:57','2013-03-06 00:00:00',1,NULL,NULL,NULL,19,NULL,1,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_contrat` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contrat_extrafields` +-- + +DROP TABLE IF EXISTS `llx_contrat_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contrat_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_contrat_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contrat_extrafields` +-- + +LOCK TABLES `llx_contrat_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_contrat_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_contrat_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contratdet` +-- + +DROP TABLE IF EXISTS `llx_contratdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contratdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_contrat` int(11) NOT NULL, + `fk_product` int(11) DEFAULT NULL, + `statut` smallint(6) DEFAULT '0', + `label` text, + `description` text, + `fk_remise_except` int(11) DEFAULT NULL, + `date_commande` datetime DEFAULT NULL, + `date_ouverture_prevue` datetime DEFAULT NULL, + `date_ouverture` datetime DEFAULT NULL, + `date_fin_validite` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT '0.000', + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double NOT NULL, + `remise_percent` double DEFAULT '0', + `subprice` double(24,8) DEFAULT '0.00000000', + `price_ht` double DEFAULT NULL, + `remise` double DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '1', + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `fk_user_author` int(11) NOT NULL DEFAULT '0', + `fk_user_ouverture` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `commentaire` text, + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_contratdet_fk_contrat` (`fk_contrat`), + KEY `idx_contratdet_fk_product` (`fk_product`), + KEY `idx_contratdet_date_ouverture_prevue` (`date_ouverture_prevue`), + KEY `idx_contratdet_date_ouverture` (`date_ouverture`), + KEY `idx_contratdet_date_fin_validite` (`date_fin_validite`), + KEY `fk_contratdet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_contratdet_fk_contrat` FOREIGN KEY (`fk_contrat`) REFERENCES `llx_contrat` (`rowid`), + CONSTRAINT `fk_contratdet_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_contratdet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contratdet` +-- + +LOCK TABLES `llx_contratdet` WRITE; +/*!40000 ALTER TABLE `llx_contratdet` DISABLE KEYS */; +INSERT INTO `llx_contratdet` VALUES (1,'2013-03-06 09:00:00',1,3,4,'','',NULL,NULL,'2010-07-09 00:00:00','2010-07-09 12:00:00','2013-03-15 00:00:00',NULL,0.000,'',0.000,'',0.000,'',1,0,0.00000000,0,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,0,0,0.00000000,0,1,1,'',NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(2,'2010-07-10 16:14:14',2,NULL,0,'','Abonnement annuel assurance',NULL,NULL,'2010-07-10 00:00:00',NULL,'2011-07-10 00:00:00',NULL,1.000,'',0.000,'',0.000,'',1,0,10.00000000,10,0,10.00000000,0.10000000,0.00000000,0.00000000,10.10000000,1,0,NULL,0.00000000,0,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(3,'2013-03-05 10:20:58',2,3,5,'','gdfg',NULL,NULL,'2010-07-10 00:00:00','2010-07-10 12:00:00','2011-07-09 00:00:00','2013-03-06 12:00:00',4.000,'',0.000,'',0.000,'',1,0,0.00000000,0,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,0,0,0.00000000,0,1,1,'',NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(4,'2012-12-08 13:11:17',2,3,0,'','',NULL,NULL,'2010-07-10 00:00:00',NULL,NULL,NULL,0.000,'',0.000,'',0.000,'',1,10,40.00000000,40,NULL,36.00000000,0.00000000,0.00000000,0.00000000,36.00000000,1,0,NULL,0.00000000,0,NULL,1,'',NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(5,'2013-03-06 09:05:40',3,NULL,4,'','gfdg',NULL,NULL,NULL,'2013-03-06 12:00:00','2013-03-07 12:00:00',NULL,0.000,'',0.000,'',0.000,'',1,0,10.00000000,10,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,0,0,0.00000000,0,1,1,'',NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_contratdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contratdet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_contratdet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contratdet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_contratdet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contratdet_extrafields` +-- + +LOCK TABLES `llx_contratdet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_contratdet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_contratdet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contratdet_log` +-- + +DROP TABLE IF EXISTS `llx_contratdet_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contratdet_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_contratdet` int(11) NOT NULL, + `date` datetime NOT NULL, + `statut` smallint(6) NOT NULL, + `fk_user_author` int(11) NOT NULL, + `commentaire` text, + PRIMARY KEY (`rowid`), + KEY `idx_contratdet_log_fk_contratdet` (`fk_contratdet`), + KEY `idx_contratdet_log_date` (`date`), + CONSTRAINT `fk_contratdet_log_fk_contratdet` FOREIGN KEY (`fk_contratdet`) REFERENCES `llx_contratdet` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contratdet_log` +-- + +LOCK TABLES `llx_contratdet_log` WRITE; +/*!40000 ALTER TABLE `llx_contratdet_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_contratdet_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_cotisation` +-- + +DROP TABLE IF EXISTS `llx_cotisation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_cotisation` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `dateadh` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `cotisation` double DEFAULT NULL, + `fk_bank` int(11) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_cotisation` (`fk_adherent`,`dateadh`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_cotisation` +-- + +LOCK TABLES `llx_cotisation` WRITE; +/*!40000 ALTER TABLE `llx_cotisation` DISABLE KEYS */; +INSERT INTO `llx_cotisation` VALUES (1,'2010-07-10 13:05:30','2010-07-10 15:05:30',2,'2010-07-10 00:00:00','2011-07-10',20,NULL,'Adhésion/cotisation 2010'),(2,'2010-07-11 14:20:00','2010-07-11 16:20:00',2,'2011-07-11 00:00:00','2012-07-10',10,NULL,'Adhésion/cotisation 2011'),(3,'2010-07-18 10:20:33','2010-07-18 12:20:33',2,'2012-07-11 00:00:00','2013-07-17',10,NULL,'Adhésion/cotisation 2012'),(4,'2013-03-06 15:43:37','2013-03-06 16:43:37',2,'2013-07-18 00:00:00','2014-07-17',10,NULL,'Adhésion/cotisation 2013'),(5,'2013-03-06 15:44:12','2013-03-06 16:44:12',2,'2014-07-18 00:00:00','2015-07-17',11,NULL,'Adhésion/cotisation 2014'),(6,'2013-03-06 15:47:48','2013-03-06 16:47:48',2,'2015-07-18 00:00:00','2016-07-17',10,NULL,'Adhésion/cotisation 2015'),(7,'2013-03-06 15:48:16','2013-03-06 16:48:16',2,'2016-07-18 00:00:00','2017-07-17',20,22,'Adhésion/cotisation 2016'),(8,'2013-03-20 13:17:57','2013-03-20 14:17:57',1,'2010-07-10 00:00:00','2011-07-09',10,NULL,'Adhésion/cotisation 2010'),(10,'2013-03-20 13:30:11','2013-03-20 14:30:11',1,'2011-07-10 00:00:00','2012-07-09',10,23,'Adhésion/cotisation 2011'); +/*!40000 ALTER TABLE `llx_cotisation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_cronjob` +-- + +DROP TABLE IF EXISTS `llx_cronjob`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_cronjob` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `jobtype` varchar(10) NOT NULL, + `label` text NOT NULL, + `command` varchar(255) DEFAULT NULL, + `classesname` varchar(255) DEFAULT NULL, + `objectname` varchar(255) DEFAULT NULL, + `methodename` varchar(255) DEFAULT NULL, + `params` text, + `md5params` varchar(32) DEFAULT NULL, + `module_name` varchar(255) DEFAULT NULL, + `priority` int(11) DEFAULT '0', + `datelastrun` datetime DEFAULT NULL, + `datenextrun` datetime DEFAULT NULL, + `datestart` datetime DEFAULT NULL, + `dateend` datetime DEFAULT NULL, + `datelastresult` datetime DEFAULT NULL, + `lastresult` text, + `lastoutput` text, + `unitfrequency` varchar(255) NOT NULL DEFAULT '3600', + `frequency` int(11) NOT NULL DEFAULT '0', + `nbrun` int(11) DEFAULT NULL, + `status` int(11) NOT NULL DEFAULT '1', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `note` text, + `libname` varchar(255) DEFAULT NULL, + `entity` int(11) DEFAULT '0', + `maxrun` int(11) NOT NULL DEFAULT '0', + `autodelete` int(11) DEFAULT '0', + `fk_mailing` int(11) DEFAULT NULL, + `test` varchar(255) DEFAULT '1', + `processing` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_cronjob` +-- + +LOCK TABLES `llx_cronjob` WRITE; +/*!40000 ALTER TABLE `llx_cronjob` DISABLE KEYS */; +INSERT INTO `llx_cronjob` VALUES (1,'2013-03-23 18:18:39','2013-03-23 19:18:39','command','aaa','aaaa','','','','','','',0,NULL,NULL,'2013-03-23 19:18:00',NULL,NULL,NULL,NULL,'3600',3600,0,0,1,1,'',NULL,0,0,0,NULL,'1',0),(28,'2017-09-06 16:18:46','2017-09-06 20:18:46','method','PurgeDeleteTemporaryFilesShort',NULL,'core/class/utils.class.php','Utils','purgeFiles',NULL,NULL,'cron',10,NULL,NULL,'2017-09-06 20:18:46',NULL,NULL,NULL,NULL,'604800',2,NULL,1,NULL,NULL,'PurgeDeleteTemporaryFiles',NULL,1,0,0,NULL,'1',0),(29,'2017-09-06 16:18:46','2017-09-06 20:18:46','method','MakeLocalDatabaseDumpShort',NULL,'core/class/utils.class.php','Utils','dumpDatabase','none,auto,1,auto,10',NULL,'cron',20,NULL,NULL,'2017-09-06 20:18:46',NULL,NULL,NULL,NULL,'604800',1,NULL,0,NULL,NULL,'MakeLocalDatabaseDump',NULL,1,0,0,NULL,'1',0),(30,'2017-09-06 16:18:46','2017-09-06 20:18:46','method','RecurringInvoices',NULL,'compta/facture/class/facture-rec.class.php','FactureRec','createRecurringInvoices',NULL,NULL,'facture',0,NULL,NULL,'2017-09-06 20:18:46',NULL,NULL,NULL,NULL,'86400',1,NULL,1,NULL,NULL,'Generate recurring invoices',NULL,1,0,0,NULL,'',0); +/*!40000 ALTER TABLE `llx_cronjob` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_default_values` +-- + +DROP TABLE IF EXISTS `llx_default_values`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_default_values` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `type` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `user_id` int(11) NOT NULL DEFAULT '0', + `page` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `param` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `value` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_default_values` (`type`,`entity`,`user_id`,`page`,`param`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_default_values` +-- + +LOCK TABLES `llx_default_values` WRITE; +/*!40000 ALTER TABLE `llx_default_values` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_default_values` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_deplacement` +-- + +DROP TABLE IF EXISTS `llx_deplacement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_deplacement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dated` datetime DEFAULT NULL, + `fk_user` int(11) NOT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `type` varchar(12) NOT NULL, + `fk_statut` int(11) NOT NULL DEFAULT '1', + `km` double DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT '0', + `note_private` text, + `note_public` text, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_deplacement` +-- + +LOCK TABLES `llx_deplacement` WRITE; +/*!40000 ALTER TABLE `llx_deplacement` DISABLE KEYS */; +INSERT INTO `llx_deplacement` VALUES (1,NULL,1,'2010-07-09 01:58:04','2010-07-08 23:58:18','2010-07-09 12:00:00',2,1,NULL,'TF_LUNCH',1,10,2,1,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_deplacement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_document_model` +-- + +DROP TABLE IF EXISTS `llx_document_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_document_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(50) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `type` varchar(20) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `description` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_document_model` (`nom`,`type`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=298 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_document_model` +-- + +LOCK TABLES `llx_document_model` WRITE; +/*!40000 ALTER TABLE `llx_document_model` DISABLE KEYS */; +INSERT INTO `llx_document_model` VALUES (9,'merou',1,'shipping',NULL,NULL),(181,'generic_invoice_odt',1,'invoice','ODT templates','FACTURE_ADDON_PDF_ODT_PATH'),(193,'canelle2',1,'invoice_supplier','canelle2',NULL),(195,'canelle',1,'invoice_supplier','canelle',NULL),(198,'azur',2,'propal',NULL,NULL),(199,'html_cerfafr',2,'donation',NULL,NULL),(200,'crabe',2,'invoice',NULL,NULL),(201,'generic_odt',1,'company','ODT templates','COMPANY_ADDON_PDF_ODT_PATH'),(250,'baleine',1,'project',NULL,NULL),(255,'soleil',1,'ficheinter',NULL,NULL),(256,'azur',1,'propal',NULL,NULL),(270,'aurore',1,'supplier_proposal',NULL,NULL),(273,'beluga',1,'project','beluga',NULL),(274,'rouget',1,'shipping',NULL,NULL),(275,'typhon',1,'delivery',NULL,NULL),(278,'standard',1,'expensereport',NULL,NULL),(281,'sepamandate',1,'bankaccount','sepamandate',NULL),(294,'einstein',1,'order',NULL,NULL),(295,'html_cerfafr',1,'donation',NULL,NULL),(296,'crabe',1,'invoice',NULL,NULL),(297,'muscadet',1,'order_supplier',NULL,NULL); +/*!40000 ALTER TABLE `llx_document_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_don` +-- + +DROP TABLE IF EXISTS `llx_don`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_don` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `datec` datetime DEFAULT NULL, + `datedon` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_payment` int(11) DEFAULT NULL, + `paid` smallint(6) NOT NULL DEFAULT '0', + `firstname` varchar(50) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `societe` varchar(50) DEFAULT NULL, + `address` text, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `country` varchar(50) DEFAULT NULL, + `fk_country` int(11) NOT NULL, + `email` varchar(255) DEFAULT NULL, + `phone` varchar(24) DEFAULT NULL, + `phone_mobile` varchar(24) DEFAULT NULL, + `public` smallint(6) NOT NULL DEFAULT '1', + `fk_projet` int(11) DEFAULT NULL, + `fk_user_author` int(11) NOT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_don` +-- + +LOCK TABLES `llx_don` WRITE; +/*!40000 ALTER TABLE `llx_don` DISABLE KEYS */; +INSERT INTO `llx_don` VALUES (1,NULL,1,'2010-07-08 23:57:17',1,'2010-07-09 01:55:33','2010-07-09 12:00:00',10,1,0,'Donator','','Guest company','','','','France',0,'',NULL,NULL,1,1,1,1,'',NULL,'html_cerfafr',NULL,NULL),(2,NULL,1,'2017-02-06 04:05:29',0,'2017-02-06 08:05:29','2017-02-06 12:00:00',100,NULL,0,'','','','','','',NULL,0,'','','',1,NULL,12,NULL,NULL,NULL,NULL,NULL,NULL),(3,NULL,1,'2017-09-06 16:18:19',2,'2017-09-06 20:05:17','2017-09-06 12:00:00',10,NULL,0,'','','','','','',NULL,0,'','','',1,NULL,12,12,NULL,NULL,'html_cerfafr',NULL,NULL),(4,NULL,1,'2017-09-06 16:07:07',1,'2017-09-06 20:06:59','2017-09-06 12:00:00',10,NULL,0,'','','','','','',NULL,117,'','','',1,NULL,12,12,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_don` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_don_extrafields` +-- + +DROP TABLE IF EXISTS `llx_don_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_don_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_don_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_don_extrafields` +-- + +LOCK TABLES `llx_don_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_don_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_don_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ecm_directories` +-- + +DROP TABLE IF EXISTS `llx_ecm_directories`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ecm_directories` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_parent` int(11) DEFAULT NULL, + `description` varchar(255) NOT NULL, + `cachenbofdoc` int(11) NOT NULL DEFAULT '0', + `fullpath` varchar(750) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `date_c` datetime DEFAULT NULL, + `date_m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_c` int(11) DEFAULT NULL, + `fk_user_m` int(11) DEFAULT NULL, + `acl` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ecm_directories` (`label`,`fk_parent`,`entity`), + KEY `idx_ecm_directories_fk_user_c` (`fk_user_c`), + KEY `idx_ecm_directories_fk_user_m` (`fk_user_m`), + CONSTRAINT `fk_ecm_directories_fk_user_c` FOREIGN KEY (`fk_user_c`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_ecm_directories_fk_user_m` FOREIGN KEY (`fk_user_m`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ecm_directories` +-- + +LOCK TABLES `llx_ecm_directories` WRITE; +/*!40000 ALTER TABLE `llx_ecm_directories` DISABLE KEYS */; +INSERT INTO `llx_ecm_directories` VALUES (8,'Administrative documents',1,0,'Directory to store administrative contacts',0,NULL,NULL,'2016-07-30 16:54:41','2016-07-30 12:54:41',12,NULL,NULL),(9,'Images',1,0,'',34,NULL,NULL,'2016-07-30 16:55:33','2016-07-30 13:24:41',12,NULL,NULL); +/*!40000 ALTER TABLE `llx_ecm_directories` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ecm_files` +-- + +DROP TABLE IF EXISTS `llx_ecm_files`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ecm_files` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(128) DEFAULT NULL, + `label` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `filename` varchar(255) NOT NULL, + `filepath` varchar(255) DEFAULT NULL, + `fullpath_orig` varchar(750) DEFAULT NULL, + `description` text, + `keywords` text, + `cover` text, + `gen_or_uploaded` varchar(12) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `date_c` datetime DEFAULT NULL, + `date_m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_c` int(11) DEFAULT NULL, + `fk_user_m` int(11) DEFAULT NULL, + `acl` text, + `position` int(11) DEFAULT NULL, + `keyword` varchar(750) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ecm_files` (`filepath`,`filename`,`entity`), + KEY `idx_ecm_files_label` (`label`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ecm_files` +-- + +LOCK TABLES `llx_ecm_files` WRITE; +/*!40000 ALTER TABLE `llx_ecm_files` DISABLE KEYS */; +INSERT INTO `llx_ecm_files` VALUES (1,NULL,'6ff09d1c53ef83fe622b02a320bcfa52',1,'FA1107-0019.pdf','facture/FA1107-0019','/home/ldestailleur/git/dolibarr_6.0/documents/facture/FA1107-0019/FA1107-0019.pdf','',NULL,NULL,'unknown',NULL,'2017-08-30 15:53:34','2017-08-30 11:53:34',18,NULL,NULL,1,NULL),(2,NULL,'a6c8a0f04af73e4dfc059006d7a5f55a',1,'FA1107-0019_invoice.odt','facture/FA1107-0019','/home/ldestailleur/git/dolibarr_6.0/documents/facture/FA1107-0019/FA1107-0019_invoice.odt','',NULL,NULL,'unknown',NULL,'2017-08-30 15:53:34','2017-08-30 11:53:34',18,NULL,NULL,2,NULL),(3,NULL,'24e96a4a0da25d1ac5049ea46d031d3a',1,'FA1107-0019-depotFacture-1418-INH-N000289-20170720.pdf','facture/FA1107-0019','depotFacture-1418-INH-N000289-20170720.pdf','',NULL,NULL,'uploaded',NULL,'2017-08-30 15:54:45','2017-08-30 11:54:45',18,NULL,NULL,3,NULL),(4,NULL,'91a42a4e2c77e826562c83fa84f6fccd',1,'CO7001-0027-acces-coopinfo.txt','commande/CO7001-0027','acces-coopinfo.txt','',NULL,NULL,'uploaded',NULL,'2017-08-30 16:02:33','2017-08-30 12:02:33',18,NULL,NULL,1,NULL),(5,NULL,'3a9283622bae3469fd90eefd90eb53ea',1,'FA1601-0024.pdf','facture/FA1601-0024','/home/ldestailleur/git/dolibarr_6.0/documents/facture/FA1601-0024/FA1601-0024.pdf','',NULL,NULL,'unknown',NULL,'2017-08-30 16:23:01','2017-08-30 12:23:01',12,NULL,NULL,1,NULL),(6,NULL,'24e96a4a0da25d1ac5049ea46d031d3a',1,'FA1601-0024-depotFacture-1418-INH-N000289-20170720.pdf','facture/FA1601-0024','depotFacture-1418-INH-N000289-20170720.pdf','',NULL,NULL,'uploaded',NULL,'2017-08-30 16:23:14','2017-08-30 12:23:14',12,NULL,NULL,2,NULL),(7,NULL,'d41d8cd98f00b204e9800998ecf8427e',1,'Exxxqqqw','produit/COMP-XP4523','/home/ldestailleur/git/dolibarr_6.0/documents/produit/COMP-XP4523/Exxxqqqw','',NULL,NULL,'unknown',NULL,'2017-08-30 19:03:15','2017-08-30 15:04:02',12,NULL,NULL,2,NULL),(8,NULL,'8245ba8e8e345655f06cd904d7d54f73',1,'compxp4523product.jpg','produit/COMP-XP4523','/home/ldestailleur/git/dolibarr_6.0/documents/produit/COMP-XP4523/compxp4523product.jpg','',NULL,NULL,'unknown',NULL,'2017-08-30 19:03:15','2017-08-30 15:04:02',12,NULL,NULL,1,NULL),(9,NULL,'d32552ee874c82b9f0ccab4f309b4b61',1,'dolihelp.ico','produit/COMP-XP4523','/home/ldestailleur/git/dolibarr_6.0/documents/produit/COMP-XP4523/dolihelp.ico','',NULL,NULL,'unknown',NULL,'2017-08-30 19:03:15','2017-08-30 15:03:15',12,NULL,NULL,3,NULL); +/*!40000 ALTER TABLE `llx_ecm_files` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ecommerce_category` +-- + +DROP TABLE IF EXISTS `llx_ecommerce_category`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ecommerce_category` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `type` tinyint(4) NOT NULL DEFAULT '1', + `description` text COLLATE utf8_unicode_ci, + `fk_category` int(11) NOT NULL, + `fk_site` int(11) NOT NULL, + `remote_id` int(11) NOT NULL, + `remote_parent_id` int(11) DEFAULT NULL, + `last_update` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ecommerce_category_fk_site_fk_category` (`fk_site`,`fk_category`), + KEY `idx_ecommerce_category_fk_category` (`fk_category`), + KEY `idx_ecommerce_category_fk_site` (`fk_site`) +) ENGINE=InnoDB AUTO_INCREMENT=2260 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Table transition remote site - Dolibarr'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ecommerce_category` +-- + +LOCK TABLES `llx_ecommerce_category` WRITE; +/*!40000 ALTER TABLE `llx_ecommerce_category` DISABLE KEYS */; +INSERT INTO `llx_ecommerce_category` VALUES (1951,'Root Catalog',0,'',1750,1,3,1,'2007-12-05 04:38:59'),(1952,'Parquets',0,'',1751,1,35,3,'2016-01-19 09:35:20'),(1953,'Parquets massifs exotiques',0,'',1752,1,36,35,'2016-01-19 09:35:44'),(1954,'Parquets massifs salle de bain',0,'',1753,1,135,35,'2016-01-19 09:36:03'),(1955,'Parquets massifs bruts',0,'',1754,1,43,35,'2016-01-19 09:36:24'),(1956,'Parquets massifs naturels',0,'',1755,1,46,35,'2016-01-19 09:36:47'),(1957,'Parquets massifs tendances',0,'',1756,1,136,35,'2016-01-19 09:37:04'),(1958,'Parquets massifs vieillis',0,'',1757,1,227,35,'2016-01-19 09:37:23'),(1959,'Parquets contrecollés classiques',0,'',1758,1,51,35,'2016-01-19 09:37:49'),(1960,'Parquets contrecollés tendance',0,'',1759,1,54,35,'2016-01-19 09:38:09'),(1961,'Parquets contrecollés sols chauffants & rafraîchissants',0,'',1760,1,57,35,'2016-01-19 09:38:35'),(1962,'Parquets contrecollés vieillis',0,'',1761,1,279,35,'2016-01-19 09:38:57'),(1963,'Terrasses',0,'',1762,1,80,3,'2017-03-15 09:46:37'),(1964,'Lames terrasse Bois Exotique',0,'',1763,1,81,80,'2017-03-15 15:34:21'),(1965,'Ipé',0,'',1764,1,461,81,'2017-03-15 09:55:42'),(1966,'Cumaru',0,'',1765,1,462,81,'2017-03-15 09:57:55'),(1967,'Terrasses bois français',0,'',1766,1,84,80,'2015-10-07 15:51:30'),(1968,'Lames Terrasse Bois Composite',0,'',1767,1,86,80,'2017-03-15 14:33:51'),(1969,'Lames Bois Composite',0,'',1768,1,463,86,'2017-03-15 10:24:30'),(1970,'Fixations Lames Composites',0,'',1769,1,464,86,'2017-03-15 10:26:53'),(1971,'Accessoires terrasses',0,'',1770,1,286,80,'2017-03-15 10:58:40'),(1972,'FORET ÉTAGÉ SPAX',0,'',1771,1,396,286,'2017-03-15 10:57:07'),(1973,'CALES ET FEUTRES POUR LAMBOURDE',0,'',1772,1,459,286,'2017-03-15 10:55:50'),(1974,'Feutre Géotextile',0,'',1773,1,466,80,'2017-03-20 15:15:32'),(1975,'Cales pour Lambourdes',0,'',1774,1,394,80,'2017-03-16 13:47:30'),(1976,'Lambourdes Pour Terrasse',0,'',1775,1,465,80,'2017-03-15 10:36:30'),(1977,'Vis Terrasse Inox SPAX',0,'',1776,1,366,80,'2017-03-15 14:26:33'),(1978,'Fixations Terrasse',0,'',1777,1,365,80,'2017-03-20 09:18:10'),(1979,'Plots Pour Terrasse',0,'',1778,1,367,80,'2017-03-16 13:09:09'),(1980,'Redresseur De Lames',0,'',1779,1,368,80,'2017-03-16 13:26:27'),(1981,'Espaceur et gabarit',0,'',1780,1,370,80,'2017-03-16 13:37:38'),(1982,'Forets et Embouts',0,'',1781,1,369,80,'2017-03-16 13:53:06'),(1983,'BANDE D\'ÉTANCHÉITÉ',0,'',1782,1,395,80,'2017-03-15 14:15:22'),(1984,'Luminaires extérieurs terrasses et jardins',0,'',1783,1,290,80,'2017-03-16 13:58:11'),(1985,'ÉCLAIRAGE Á POSER AU SOL',0,'',1784,1,374,290,'2017-03-15 10:59:39'),(1986,'ÉCLAIRAGE MURAL',0,'',1785,1,375,290,'2017-03-15 10:59:44'),(1987,'ÉCLAIRAGE D\'ORIENTATION',0,'',1786,1,376,290,'2017-03-15 11:00:02'),(1988,'Eclairage Design Collection',0,'',1787,1,377,290,'2015-03-05 18:25:35'),(1989,'SPOTS',0,'',1788,1,378,290,'2017-03-15 11:00:08'),(1990,'TRANSFORMATEURS',0,'',1789,1,372,290,'2017-03-15 11:00:14'),(1991,'CÂBLES ET RALLONGES',0,'',1790,1,373,290,'2017-03-15 11:00:24'),(1992,'PROGRAMMATEURS, DÉTECTEURS, TÉLÉCOMMANDES',0,'',1791,1,379,290,'2017-03-15 11:00:31'),(1993,'Revêtements sol & mur',0,'',1792,1,60,3,'2017-02-01 10:13:13'),(1994,'Dalles (cuir, béton ciré...)',0,'',1793,1,63,60,'2017-02-01 13:50:13'),(1995,'Dalles/lames plombantes',0,'',1794,1,401,60,'2017-02-01 13:50:20'),(1996,'Sols en bois',0,'',1795,1,61,60,'2017-02-01 13:50:59'),(1997,'Sols en liège',0,'',1796,1,294,60,'2017-02-01 13:50:52'),(1998,'Stratifiés classiques',0,'',1797,1,68,60,'2016-01-18 17:43:44'),(1999,'Stratifiés tendances',0,'',1798,1,72,60,'2016-01-18 17:44:37'),(2000,'Stratifiés salles de bain',0,'',1799,1,76,60,'2016-01-18 17:45:57'),(2001,'Stratifiés économiques',0,'',1800,1,78,60,'2016-01-18 17:45:32'),(2002,'Stratifiés colle intégrée',0,'',1801,1,421,60,'2016-03-24 10:36:21'),(2003,'Vinyles Click',0,'',1802,1,400,60,'2016-01-18 17:46:15'),(2004,'Vinyles',0,'',1803,1,283,60,'2015-10-29 16:09:39'),(2005,'Lambris',0,'',1804,1,89,60,'2017-02-01 10:13:57'),(2006,'Lambris massifs pin',0,'',1805,1,90,89,'2017-02-01 10:15:07'),(2007,'Accessoires lambris',0,'',1806,1,302,89,'2017-02-01 10:15:13'),(2008,'Entretien',0,'',1807,1,323,3,'2016-01-18 17:08:34'),(2009,'Toutes surfaces',0,'',1808,1,335,323,'2016-03-31 12:14:59'),(2010,'Parquet ciré',0,'',1809,1,359,323,'2016-03-31 12:21:35'),(2011,'Parquet huilé',0,'',1810,1,337,323,'2016-03-31 12:26:55'),(2012,'Parquet vitrifié',0,'',1811,1,339,323,'2016-03-31 12:31:26'),(2013,'Sols stratifié - Vinyl',0,'',1812,1,340,323,'2016-03-31 12:40:36'),(2014,'Terrasse',0,'',1813,1,341,323,'2016-01-18 17:10:11'),(2015,'SATURATEURS ENVIRONNEMENT',0,'',1814,1,342,341,'2017-02-01 14:30:22'),(2016,'SATURATEURS BOIS',0,'',1815,1,343,341,'2017-02-01 14:30:30'),(2017,'SATURATEURS MONOCOUCHE',0,'',1816,1,344,341,'2017-02-01 14:30:41'),(2018,'SATURATEURS OPAQUES',0,'',1817,1,345,341,'2017-02-01 14:33:53'),(2019,'NETTOYANTS - DÉGRISEURS',0,'',1818,1,346,341,'2017-02-01 14:31:20'),(2020,'RÉNOVATEURS COMPOSITES',0,'',1819,1,347,341,'2017-02-01 14:31:33'),(2021,'SYSTÈME ANTI UV',0,'',1820,1,348,341,'2017-02-01 14:32:02'),(2022,'Bardage',0,'',1821,1,349,323,'2016-01-18 17:20:26'),(2023,'HUILES BARDAGES',0,'',1822,1,350,349,'2017-02-01 14:32:18'),(2024,'LASURES OPTEM',0,'',1823,1,352,349,'2017-02-01 14:32:25'),(2025,'LASURES HPS',0,'',1824,1,353,349,'2017-02-01 14:32:32'),(2026,'LASURES ENVIRONNEMENT',0,'',1825,1,354,349,'2017-02-01 14:32:42'),(2027,'PEINTURES ENVIRONNEMENT',0,'',1826,1,355,349,'2017-02-01 14:32:51'),(2028,'SYSTÈME ANTI UV BARDAGE',0,'',1827,1,356,349,'2017-07-04 22:36:49'),(2029,'HUILES POUR TECK',0,'',1828,1,413,349,'2017-02-01 14:33:13'),(2030,'Décapants',0,'',1829,1,357,323,'2016-03-31 12:46:26'),(2031,'Décireurs',0,'',1830,1,361,323,'2016-03-31 12:52:31'),(2032,'Traitements',0,'',1831,1,358,323,'2016-03-31 12:54:22'),(2033,'Pose',0,'',1832,1,128,3,'2015-01-22 14:40:40'),(2034,'Finition',0,'',1833,1,319,3,'2016-01-18 17:25:47'),(2035,'HUILES POUR PARQUETS',0,'',1834,1,239,319,'2017-02-01 13:54:09'),(2036,'HUILES ENVIRONNEMENT',0,'',1835,1,334,239,'2017-02-01 13:55:03'),(2037,'HUILES CIRE',0,'',1836,1,241,239,'2017-02-01 13:55:42'),(2038,'HUILES TRADITIONNELLES',0,'',1837,1,321,239,'2017-02-01 13:55:53'),(2039,'HUILES DURES',0,'',1838,1,322,239,'2017-02-01 13:56:00'),(2040,'LASURES',0,'',1839,1,255,319,'2017-02-01 13:54:17'),(2041,'PEINTURES ENVIRONNEMENT LASURE',0,'',1840,1,325,255,'2017-07-04 22:37:25'),(2042,'LASURES BOIS ENVIRONNEMENT',0,'',1841,1,326,255,'2017-02-01 13:56:35'),(2043,'LASURES OPTEM',0,'',1842,1,327,255,'2017-02-01 13:56:42'),(2044,'LASURES TRADITIONNELLES',0,'',1843,1,328,255,'2017-02-01 13:56:51'),(2045,'PRÉPARATION BOIS EXTERIEUR',0,'',1844,1,329,255,'2017-02-01 13:57:12'),(2046,'VITRIFICATEURS',0,'',1845,1,240,319,'2017-02-01 13:54:27'),(2047,'VITRIFICATEURS TRADITIONNELS',0,'',1846,1,330,240,'2017-02-01 13:57:45'),(2048,'VITRIFICATEURS ENVIRONNEMENT',0,'',1847,1,331,240,'2017-02-01 13:58:00'),(2049,'VITRIFICATEURS OCÉANIC®',0,'',1848,1,332,240,'2017-02-01 13:59:10'),(2050,'VITRIFICATEURS ESCALIERS',0,'',1849,1,333,240,'2017-02-01 13:59:40'),(2051,'VITRIFICATEURS BI COMPOSANTS',0,'',1850,1,404,240,'2017-02-01 13:59:51'),(2052,'Béton - Pavés briques',0,'',1851,1,300,319,'2016-03-25 09:44:34'),(2053,'Peintures sol',0,'',1852,1,271,319,'2016-03-25 09:47:36'),(2054,'Peintures tableau d\'école',0,'',1853,1,360,319,'2016-03-25 09:59:01'),(2055,'Peinture décorative aqua',0,'',1854,1,426,319,'2016-03-25 10:08:28'),(2056,'Primaire fond dur',0,'',1855,1,320,319,'2016-03-25 10:10:34'),(2057,'Teintes parquets - boiseries',0,'',1856,1,324,319,'2016-03-25 10:14:55'),(2058,'Vernis bois',0,'',1857,1,296,319,'2016-03-25 10:16:20'),(2059,'Parquet ciré',0,'',1858,1,414,319,'2016-03-31 12:57:15'),(2060,'Peinture rénovation multi supports',0,'',1859,1,435,319,'2016-10-17 15:33:29'),(2061,'Accessoires disabled',0,'',1860,1,98,3,'2017-07-04 23:32:02'),(2062,'Produits de finitions',0,'',1861,1,108,98,'2015-01-21 11:05:10'),(2063,'Ventes flash',0,'',1862,1,129,3,'2017-02-17 11:21:37'),(2064,'Marques',0,'',1863,1,151,3,'2015-10-16 09:15:18'),(2065,'Blanchon',0,'',1864,1,161,151,'2015-12-14 17:42:03'),(2066,'Colles',0,'',1865,1,263,161,'2015-10-14 17:04:55'),(2067,'Décapants',0,'',1866,1,268,161,'2016-01-18 14:33:19'),(2068,'Décireurs',0,'',1867,1,303,161,'2016-01-18 14:33:39'),(2069,'Dégriseurs bois',0,'',1868,1,250,161,'2016-01-18 14:34:12'),(2070,'Diluants',0,'',1869,1,298,161,'2016-01-22 15:03:39'),(2071,'Encaustique et Cire',0,'',1870,1,416,161,'2016-01-21 09:21:28'),(2072,'Fonds durs',0,'',1871,1,257,161,'2016-01-22 15:04:00'),(2073,'Huiles bardage',0,'',1872,1,351,161,'2016-01-18 14:35:20'),(2074,'Huile-cire dure : Solid\'Oil',0,'',1873,1,249,161,'2016-01-22 15:04:58'),(2075,'Huiles cires',0,'',1874,1,264,161,'2016-01-22 15:05:27'),(2076,'Huile cire béton',0,'',1875,1,254,161,'2016-01-18 14:36:33'),(2077,'Huiles environnement pour parquet',0,'',1876,1,244,161,'2016-01-22 15:06:30'),(2078,'Huile d\'entretien',0,'',1877,1,248,161,'2016-01-11 16:55:17'),(2079,'Huile pour Teck',0,'',1878,1,259,161,'2016-01-18 14:37:06'),(2080,'Lasures bois très longue durée',0,'',1879,1,256,161,'2016-01-18 14:37:20'),(2081,'Lasures OPTEM',0,'',1880,1,316,161,'2016-01-18 14:37:37'),(2082,'Liant mastic à bois',0,'',1881,1,308,161,'2016-01-18 14:37:54'),(2083,'Nettoyants et rénovateurs',0,'',1882,1,253,161,'2016-01-18 14:38:18'),(2084,'Peinture bois très longue durée',0,'',1883,1,315,161,'2016-01-13 10:25:14'),(2085,'Peinture ciment bois',0,'',1884,1,270,161,'2016-01-18 14:38:40'),(2086,'Préparation bois extérieur',0,'',1885,1,317,161,'2016-01-18 14:39:05'),(2087,'Peinture décorative aqua',0,'',1886,1,425,161,'2016-03-01 14:36:39'),(2088,'Prim\' Huile',0,'',1887,1,246,161,'2016-01-18 14:39:19'),(2089,'Saturateur pour terrasse',0,'',1888,1,247,161,'2016-02-24 17:24:11'),(2090,'Savon Naturel des parquets huilés',0,'',1889,1,245,161,'2016-01-18 14:40:23'),(2091,'Système incolore anti-UV',0,'',1890,1,260,161,'2016-01-18 14:41:09'),(2092,'Teintes',0,'',1891,1,258,161,'2016-01-18 14:41:34'),(2093,'Traitement des bois - Trait\'plus -Trait\'découp',0,'',1892,1,251,161,'2016-01-18 14:42:00'),(2094,'Vitrificateurs environnement Blanchon',0,'',1893,1,243,161,'2016-01-18 14:42:24'),(2095,'Vitrificateurs parquet (VP)',0,'',1894,1,261,161,'2016-02-02 14:00:59'),(2096,'Vitrificateurs parquet Océanic®',0,'',1895,1,265,161,'2016-01-19 11:00:23'),(2097,'Vitrificateurs parquet SVP aqua',0,'',1896,1,405,161,'2015-12-04 13:49:33'),(2098,'Vernis bois',0,'',1897,1,297,161,'2016-02-02 14:02:02'),(2099,'Peinture rénovation',0,'',1898,1,436,161,'2016-10-18 14:49:46'),(2100,'Bugal',0,'',1899,1,280,151,'2016-03-26 10:23:08'),(2101,'Bona',0,'',1900,1,269,151,'2016-03-26 10:24:58'),(2102,'Balai Bona spay mop parquet',0,'',1901,1,312,269,'2016-01-18 14:46:36'),(2103,'Balai Bona spay mop sol dur',0,'',1902,1,311,269,'2016-01-18 14:46:56'),(2104,'Entretien parquet vitrifié',0,'',1903,1,306,269,'2016-01-18 14:47:20'),(2105,'Entretien parquet huilé',0,'',1904,1,307,269,'2015-12-01 11:03:24'),(2106,'Savon pour parquet huilé',0,'',1905,1,406,269,'2015-12-02 14:06:24'),(2107,'Huile d\'entretien parquet huilé',0,'',1906,1,407,269,'2015-12-02 15:45:26'),(2108,'Bostik',0,'',1907,1,162,151,'2011-04-08 13:05:04'),(2109,'Chêne de l\'Est',0,'',1908,1,155,151,'2016-03-26 10:25:53'),(2110,'Poussière d\'argile',0,'',1909,1,164,155,'2016-01-18 14:47:59'),(2111,'Plancher d\'autrefois',0,'',1910,1,165,155,'2016-01-18 14:48:11'),(2112,'Privilège Café',0,'',1911,1,166,155,'2016-01-18 14:48:31'),(2113,'Gamme Initiale',0,'',1912,1,423,155,'2016-11-02 11:30:10'),(2114,'Gamme Nature',0,'',1913,1,437,155,'2016-11-02 11:30:22'),(2115,'Cepam',0,'',1914,1,158,151,'2015-07-30 14:04:49'),(2116,'Natural',0,'',1915,1,187,158,'2014-07-02 13:42:36'),(2117,'Grand large',0,'',1916,1,188,158,'2014-07-02 13:42:46'),(2118,'Bord à bord',0,'',1917,1,189,158,'2014-07-02 13:42:57'),(2119,'Clean green',0,'',1918,1,288,151,'2016-03-26 10:28:14'),(2120,'Design by BP',0,'',1919,1,152,151,'2016-03-26 10:28:19'),(2121,'Massif brut',0,'',1920,1,228,152,'2016-01-18 14:49:17'),(2122,'Massif huilé naturel',0,'',1921,1,229,152,'2016-01-18 14:49:33'),(2123,'Lambris',0,'',1922,1,231,152,'2016-01-18 14:49:42'),(2124,'Massifs exotiques',0,'',1923,1,232,152,'2015-12-15 14:03:23'),(2125,'Massifs salle de bain',0,'',1924,1,233,152,'2016-01-18 14:50:01'),(2126,'Médoc 5G',0,'',1925,1,234,152,'2014-04-09 10:25:52'),(2127,'Colosse 5G',0,'',1926,1,235,152,'2014-04-09 10:27:24'),(2128,'Terrasses bois composite',0,'',1927,1,236,152,'2016-01-18 14:50:24'),(2129,'Terrasses bois',0,'',1928,1,237,152,'2016-01-18 14:50:42'),(2130,'Stratifié',0,'',1929,1,238,152,'2016-01-18 14:50:56'),(2131,'Emfi',0,'',1930,1,224,151,'2016-02-05 10:16:51'),(2132,'Cabbani',0,'',1931,1,156,151,'2017-02-21 14:18:31'),(2133,'Collection 02 (Finition Huilée)',0,'',1932,1,192,156,'2017-02-21 15:20:28'),(2134,'Collection 01 (Finition Vernie)',0,'',1933,1,193,156,'2017-02-21 14:58:31'),(2135,'Collection 03 (Finition Vernie)',0,'',1934,1,412,156,'2017-02-22 13:14:49'),(2136,'Garden lights',0,'',1935,1,289,151,'2016-03-26 10:32:34'),(2137,'Transformateurs',0,'',1936,1,380,289,'2015-03-11 16:43:54'),(2138,'Câbles et rallonges',0,'',1937,1,381,289,'2015-03-11 16:44:02'),(2139,'Programmateurs, détecteurs, télécommandes',0,'',1938,1,382,289,'2015-03-11 16:44:09'),(2140,'Eclairage à poser au sol',0,'',1939,1,383,289,'2015-03-11 16:44:17'),(2141,'Eclairage mural',0,'',1940,1,384,289,'2015-03-11 16:44:24'),(2142,'Eclairage d\'orientation',0,'',1941,1,385,289,'2015-03-11 16:44:31'),(2143,'SPOTS',0,'',1942,1,386,289,'2015-03-11 16:44:38'),(2144,'Eclairage Design Collection',0,'',1943,1,387,289,'2015-03-11 16:46:51'),(2145,'Pièces détachées',0,'',1944,1,388,289,'2015-03-11 16:48:03'),(2146,'Hapax',0,'',1945,1,273,151,'2016-02-05 13:14:38'),(2147,'Haro',0,'',1946,1,163,151,'2016-01-14 16:39:17'),(2148,'A l\'Anglaise Série 4000',0,'',1947,1,217,163,'2016-02-25 10:30:24'),(2149,'Toscana Série 3000',0,'',1948,1,218,163,'2016-02-25 10:32:27'),(2150,'Planche large à l\'ancienne - Série 4000',0,'',1949,1,287,163,'2016-01-18 14:58:07'),(2151,'Planche large à l\'ancienne - Série 3000',0,'',1950,1,219,163,'2017-03-21 16:19:37'),(2152,'Célénio Papyrus',0,'',1951,1,222,163,'2016-01-18 14:58:53'),(2153,'Célénio Athos',0,'',1952,1,223,163,'2016-01-18 14:59:06'),(2154,'Célénio Atrium',0,'',1953,1,226,163,'2016-01-18 14:59:19'),(2155,'Gran Via',0,'',1954,1,424,163,'2016-02-25 10:06:45'),(2156,'Tritty 100',0,'',1955,1,242,163,'2016-02-23 15:24:42'),(2157,'Tritty 100 - Silent CT',0,'',1956,1,422,163,'2016-02-01 17:23:41'),(2158,'Tritty 75',0,'',1957,1,285,163,'2016-01-11 16:47:33'),(2159,'Tritty 75 - Silent CT',0,'',1958,1,420,163,'2016-02-01 15:22:18'),(2160,'Haro Sols en liège',0,'',1959,1,293,163,'2017-07-04 22:35:39'),(2161,'Tritty 90',0,'',1960,1,448,163,'2017-01-09 10:28:29'),(2162,'Tritty 90 - Silent CT',0,'',1961,1,449,163,'2017-01-09 10:33:13'),(2163,'Tritty 90 - Silent Pro',0,'',1962,1,450,163,'2017-01-09 10:34:36'),(2164,'A l\'anglaise Série 3500',0,'',1963,1,451,163,'2017-01-10 08:50:28'),(2165,'Planche large à l\'ancienne - Série 3500',0,'',1964,1,469,163,'2017-03-22 16:43:12'),(2166,'Lamett',0,'',1965,1,272,151,'2016-03-26 10:44:05'),(2167,'Atlanta',0,'',1966,1,274,272,'2015-03-04 17:24:47'),(2168,'Cézanne',0,'',1967,1,362,272,'2016-01-27 10:27:55'),(2169,'Cuba',0,'',1968,1,364,272,'2016-01-18 17:01:24'),(2170,'Dijon',0,'',1969,1,313,272,'2016-01-27 13:14:13'),(2171,'New york',0,'',1970,1,275,272,'2014-07-02 13:23:40'),(2172,'Oslo',0,'',1971,1,276,272,'2016-01-27 14:26:50'),(2173,'Country',0,'',1972,1,277,272,'2014-07-02 13:26:51'),(2174,'Farm',0,'',1973,1,278,272,'2015-11-18 16:38:07'),(2175,'Impérial',0,'',1974,1,230,272,'2016-01-18 17:02:26'),(2176,'Nature',0,'',1975,1,282,272,'2014-07-02 13:27:21'),(2177,'Brussels',0,'',1976,1,284,272,'2017-02-15 09:14:11'),(2178,'Palace',0,'',1977,1,363,272,'2016-01-18 17:02:52'),(2179,'Royal',0,'',1978,1,371,272,'2016-01-18 17:03:06'),(2180,'Classica',0,'',1979,1,391,272,'2017-02-15 09:14:07'),(2181,'Sapphire',0,'',1980,1,392,272,'2017-02-15 09:14:00'),(2182,'Bolero',0,'',1981,1,393,272,'2017-02-15 09:13:47'),(2183,'Listone Giordano',0,'',1982,1,154,151,'2016-01-18 14:31:31'),(2184,'Linéa 70',0,'',1983,1,195,154,'2016-01-18 17:04:34'),(2185,'Piano 90',0,'',1984,1,196,154,'2016-01-18 17:04:55'),(2186,'Makita',0,'',1985,1,403,151,'2015-11-04 13:40:24'),(2187,'Objectflor',0,'',1986,1,402,151,'2015-11-02 17:45:40'),(2188,'Parqueterie Berrichonne',0,'',1987,1,153,151,'2016-01-26 16:54:20'),(2189,'Confluence 90',0,'',1988,1,211,153,'2017-03-03 16:30:22'),(2190,'Terrasse',0,'',1989,1,214,153,'2016-01-14 14:58:31'),(2191,'Nativ 11',0,'',1990,1,215,153,'2017-02-22 16:43:16'),(2192,'Class clic 140',0,'',1991,1,216,153,'2017-03-03 16:29:58'),(2193,'Confluence 140',0,'',1992,1,417,153,'2017-03-03 16:30:06'),(2194,'Confluence 170',0,'',1993,1,418,153,'2017-03-03 16:30:12'),(2195,'Confluence 190',0,'',1994,1,419,153,'2017-03-03 16:30:17'),(2196,'Nativ 14',0,'',1995,1,460,153,'2017-03-01 10:42:26'),(2197,'Quick Step',0,'',1996,1,157,151,'2016-01-18 14:32:33'),(2198,'Ambient Click',0,'',1997,1,399,157,'2017-01-24 14:15:35'),(2199,'Arte',0,'',1998,1,184,157,'2016-03-26 11:03:17'),(2200,'Balance Click',0,'',1999,1,398,157,'2015-12-14 13:51:44'),(2201,'Classic',0,'',2000,1,181,157,'2016-01-18 17:06:14'),(2202,'Creo',0,'',2001,1,309,157,'2016-01-18 17:06:24'),(2203,'Vogue',0,'',2002,1,175,157,'2015-04-07 12:47:45'),(2204,'Eligna',0,'',2003,1,177,157,'2016-01-18 17:06:36'),(2205,'Eligna Wide',0,'',2004,1,262,157,'2016-01-18 17:06:46'),(2206,'Elite',0,'',2005,1,179,157,'2016-01-18 17:06:57'),(2207,'Impressive',0,'',2006,1,304,157,'2017-04-10 14:14:08'),(2208,'Impressive Ultra',0,'',2007,1,305,157,'2017-04-10 14:13:54'),(2209,'Lagune',0,'',2008,1,180,157,'2016-01-18 17:07:29'),(2210,'Largo',0,'',2009,1,174,157,'2016-01-18 17:07:39'),(2211,'Perspective',0,'',2010,1,178,157,'2016-01-18 17:07:47'),(2212,'Perspective Wide',0,'',2011,1,310,157,'2016-01-18 17:07:58'),(2213,'Imperio',0,'',2012,1,438,157,'2016-11-16 10:56:09'),(2214,'Palazzo',0,'',2013,1,439,157,'2016-11-16 10:58:35'),(2215,'Castello',0,'',2014,1,441,157,'2016-11-16 11:04:00'),(2216,'Villa',0,'',2015,1,442,157,'2016-11-16 11:03:35'),(2217,'Compact',0,'',2016,1,444,157,'2016-11-16 11:06:42'),(2218,'Balance Click Plus',0,'',2017,1,452,157,'2017-01-23 16:58:07'),(2219,'Ambient Click Plus',0,'',2018,1,453,157,'2017-01-24 14:15:57'),(2220,'Pulse Click',0,'',2019,1,454,157,'2017-01-24 16:18:34'),(2221,'Pulse Click Plus',0,'',2020,1,455,157,'2017-01-25 10:43:20'),(2222,'Majestic',0,'',2021,1,470,157,'2017-04-10 14:17:26'),(2223,'Solidfloor',0,'',2022,1,292,151,'2016-01-18 14:32:45'),(2224,'Spax',0,'',2023,1,281,151,'2016-11-30 10:04:04'),(2225,'Verniland',0,'',2024,1,160,151,'2015-11-04 13:38:41'),(2226,'Virginia',0,'',2025,1,167,160,'2014-07-02 13:41:49'),(2227,'Callao',0,'',2026,1,169,160,'2014-07-02 13:42:00'),(2228,'Sapin brossé large',0,'',2027,1,170,160,'2014-07-02 13:42:10'),(2229,'Duo color',0,'',2028,1,173,160,'2014-07-02 13:42:23'),(2230,'Accessoires lambris',0,'',2029,1,301,160,'2014-07-25 09:30:55'),(2231,'Woca',0,'',2030,1,427,151,'2016-04-14 12:24:43'),(2232,'Box d\'entretien des parquets huilés',0,'',2031,1,432,427,'2016-03-14 17:33:10'),(2233,'Détachant',0,'',2032,1,430,427,'2016-03-14 17:27:05'),(2234,'Huile d\'entretien',0,'',2033,1,429,427,'2016-03-15 17:01:35'),(2235,'Huile d\'extérieur',0,'',2034,1,433,427,'2016-03-14 17:58:24'),(2236,'Nettoyant intensif',0,'',2035,1,431,427,'2016-03-14 17:30:25'),(2237,'Oil Care',0,'',2036,1,434,427,'2016-04-01 14:54:00'),(2238,'Savon naturel des parquets huilés',0,'',2037,1,428,427,'2016-04-01 15:38:07'),(2239,'L\'outil parfait',0,'',2038,1,446,151,'2016-11-30 10:44:20'),(2240,'Lalegno',0,'',2039,1,456,151,'2017-02-01 13:14:31'),(2241,'Fiberdeck',0,'',2040,1,458,151,'2017-02-15 10:16:05'),(2242,'Dressing',0,'',2041,1,447,3,'2016-11-30 15:52:29'),(2243,'Kendoors',0,'',2042,1,471,447,'2017-05-31 08:03:58'),(2244,'Accessoires',0,'',2043,1,457,3,'2017-02-01 14:25:08'),(2245,'LAMBOURDES & TASSEAUX',0,'',2044,1,99,457,'2017-03-21 17:03:37'),(2246,'COLLES & MASTICS',0,'',2045,1,107,457,'2017-03-21 17:03:42'),(2247,'SOUS-COUCHES',0,'',2046,1,100,457,'2017-02-01 14:26:19'),(2248,'BARRES DE SEUIL',0,'',2047,1,225,457,'2017-02-01 14:26:26'),(2249,'PLINTHES',0,'',2048,1,103,457,'2017-02-01 14:26:33'),(2250,'SOUS-PROFILÉ INCIZO',0,'',2049,1,397,457,'2017-02-01 14:27:04'),(2251,'ACCESSOIRES TERRASSES',0,'',2050,1,140,457,'2017-02-01 14:27:16'),(2252,'ACCESSOIRES LUMINAIRES',0,'',2051,1,291,457,'2017-02-01 14:27:24'),(2253,'CONTRES PLINTHES',0,'',2052,1,408,457,'2017-02-01 14:27:56'),(2254,'CHAMPLATS',0,'',2053,1,409,457,'2017-02-01 14:27:41'),(2255,'QUARTS DE ROND',0,'',2054,1,410,457,'2017-02-01 14:27:50'),(2256,'NEZ DE MARCHE',0,'',2055,1,411,457,'2017-02-01 14:28:02'),(2257,'OUTILLAGE PARQUET',0,'',2056,1,116,457,'2017-02-01 14:28:13'),(2258,'Brosses & Spalters',0,'',2057,1,467,457,'2017-03-21 16:54:05'),(2259,'Rouleaux & Montures',0,'',2058,1,468,457,'2017-03-21 17:03:14'); +/*!40000 ALTER TABLE `llx_ecommerce_category` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_contact` +-- + +DROP TABLE IF EXISTS `llx_element_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_contact` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datecreate` datetime DEFAULT NULL, + `statut` smallint(6) DEFAULT '5', + `element_id` int(11) NOT NULL, + `fk_c_type_contact` int(11) NOT NULL, + `fk_socpeople` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_contact_idx1` (`element_id`,`fk_c_type_contact`,`fk_socpeople`), + KEY `fk_element_contact_fk_c_type_contact` (`fk_c_type_contact`), + KEY `idx_element_contact_fk_socpeople` (`fk_socpeople`), + CONSTRAINT `fk_element_contact_fk_c_type_contact` FOREIGN KEY (`fk_c_type_contact`) REFERENCES `llx_c_type_contact` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_contact` +-- + +LOCK TABLES `llx_element_contact` WRITE; +/*!40000 ALTER TABLE `llx_element_contact` DISABLE KEYS */; +INSERT INTO `llx_element_contact` VALUES (1,'2010-07-09 00:49:43',4,1,160,1),(2,'2010-07-09 00:49:56',4,2,160,1),(3,'2010-07-09 00:50:19',4,3,160,1),(4,'2010-07-09 00:50:42',4,4,160,1),(5,'2010-07-09 01:52:36',4,1,120,1),(6,'2010-07-09 01:53:25',4,1,10,2),(7,'2010-07-09 01:53:25',4,1,11,2),(8,'2010-07-10 18:13:37',4,2,10,2),(9,'2010-07-10 18:13:37',4,2,11,2),(11,'2010-07-11 16:22:36',4,5,160,1),(12,'2010-07-11 16:23:53',4,2,180,1),(13,'2013-01-23 15:04:27',4,19,200,5),(14,'2013-01-23 16:06:37',4,19,210,2),(15,'2013-01-23 16:12:43',4,19,220,2),(16,'2013-03-06 10:04:57',4,3,10,1),(17,'2013-03-06 10:04:57',4,3,11,1),(18,'2014-12-21 13:52:41',4,3,180,1),(19,'2014-12-21 13:55:39',4,4,180,1),(20,'2014-12-21 14:16:58',4,5,180,1),(21,'2016-07-30 15:29:07',4,6,160,12),(22,'2016-07-30 15:29:48',4,7,160,12),(23,'2016-07-30 15:30:25',4,8,160,12),(24,'2016-07-30 15:33:27',4,6,180,12),(25,'2016-07-30 15:33:39',4,7,180,12),(26,'2016-07-30 15:33:54',4,8,180,12),(27,'2016-07-30 15:34:09',4,9,180,12),(28,'2016-07-31 18:27:20',4,9,160,12); +/*!40000 ALTER TABLE `llx_element_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_element` +-- + +DROP TABLE IF EXISTS `llx_element_element`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_element` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_source` int(11) NOT NULL, + `sourcetype` varchar(32) NOT NULL, + `fk_target` int(11) NOT NULL, + `targettype` varchar(32) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_element_idx1` (`fk_source`,`sourcetype`,`fk_target`,`targettype`), + KEY `idx_element_element_fk_target` (`fk_target`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_element` +-- + +LOCK TABLES `llx_element_element` WRITE; +/*!40000 ALTER TABLE `llx_element_element` DISABLE KEYS */; +INSERT INTO `llx_element_element` VALUES (4,1,'order_supplier',20,'invoice_supplier'),(12,1,'shipping',217,'facture'),(5,2,'cabinetmed_cabinetmedcons',216,'facture'),(1,2,'contrat',2,'facture'),(2,2,'propal',1,'commande'),(3,5,'commande',1,'shipping'),(13,5,'commande',217,'facture'),(11,25,'propal',92,'commande'),(9,28,'propal',90,'commande'),(10,29,'propal',91,'commande'),(6,75,'commande',2,'shipping'); +/*!40000 ALTER TABLE `llx_element_element` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_resources` +-- + +DROP TABLE IF EXISTS `llx_element_resources`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_resources` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `element_id` int(11) DEFAULT NULL, + `element_type` varchar(64) DEFAULT NULL, + `resource_id` int(11) DEFAULT NULL, + `resource_type` varchar(64) DEFAULT NULL, + `busy` int(11) DEFAULT NULL, + `mandatory` int(11) DEFAULT NULL, + `fk_user_create` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `duree` double DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_resources_idx1` (`resource_id`,`resource_type`,`element_id`,`element_type`), + KEY `idx_element_element_element_id` (`element_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_resources` +-- + +LOCK TABLES `llx_element_resources` WRITE; +/*!40000 ALTER TABLE `llx_element_resources` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_element_resources` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_tag` +-- + +DROP TABLE IF EXISTS `llx_element_tag`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_tag` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `lang` varchar(5) NOT NULL, + `tag` varchar(255) NOT NULL, + `fk_element` int(11) NOT NULL, + `element` varchar(64) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_element_tag` (`entity`,`lang`,`tag`,`fk_element`,`element`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_tag` +-- + +LOCK TABLES `llx_element_tag` WRITE; +/*!40000 ALTER TABLE `llx_element_tag` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_element_tag` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_entity_extrafields` +-- + +DROP TABLE IF EXISTS `llx_entity_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_entity_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_entity_extrafields` +-- + +LOCK TABLES `llx_entity_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_entity_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_entity_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_entrepot` +-- + +DROP TABLE IF EXISTS `llx_entrepot`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_entrepot` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `description` text, + `lieu` varchar(64) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_departement` int(11) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `statut` tinyint(4) DEFAULT '1', + `fk_user_author` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `fk_parent` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_entrepot_label` (`label`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_entrepot` +-- + +LOCK TABLES `llx_entrepot` WRITE; +/*!40000 ALTER TABLE `llx_entrepot` DISABLE KEYS */; +INSERT INTO `llx_entrepot` VALUES (1,'2010-07-09 00:31:22','2010-07-08 22:40:36','WAREHOUSEHOUSTON',1,'Warehouse located at Houston','Warehouse houston','','','Houston',NULL,11,1,1,NULL,0),(2,'2010-07-09 00:41:03','2010-07-08 22:41:03','WAREHOUSEPARIS',1,'
','Warehouse Paris','','75000','Paris',NULL,1,1,1,NULL,0),(3,'2010-07-11 16:18:59','2016-07-30 13:52:08','Stock personnel Dupont',1,'Cet entrepôt représente le stock personnel de Alain Dupont','','','','',NULL,2,1,1,NULL,0),(9,'2015-10-03 11:47:41','2015-10-03 09:47:41','Personal stock Marie Curie',1,'This warehouse represents personal stock of Marie Curie','','','','',NULL,1,1,1,NULL,0),(10,'2015-10-05 09:07:52','2016-07-30 13:52:24','Personal stock Alex Theceo',1,'This warehouse represents personal stock of Alex Theceo','','','','',NULL,3,1,1,NULL,0),(12,'2015-10-05 21:29:35','2015-10-05 19:29:35','Personal stock Charly Commery',1,'This warehouse represents personal stock of Charly Commery','','','','',NULL,1,1,11,NULL,0),(13,'2015-10-05 21:33:33','2016-07-30 13:51:38','Personal stock Sam Scientol',1,'This warehouse represents personal stock of Sam Scientol','','','7500','Paris',NULL,1,0,11,NULL,0),(18,'2016-01-22 17:27:02','2016-01-22 16:27:02','Personal stock Laurent Destailleur',1,'This warehouse represents personal stock of Laurent Destailleur','','','','',NULL,1,1,12,NULL,0),(19,'2016-07-30 16:50:23','2016-07-30 12:50:23','Personal stock Eldy',1,'This warehouse represents personal stock of Eldy','','','','',NULL,14,1,12,NULL,0),(20,'2017-02-02 03:55:45','2017-02-01 23:55:45','Personal stock Alex Boston',1,'This warehouse represents personal stock of Alex Boston','','','','',NULL,14,1,12,NULL,NULL); +/*!40000 ALTER TABLE `llx_entrepot` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_establishment` +-- + +DROP TABLE IF EXISTS `llx_establishment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_establishment` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `name` varchar(50) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_state` int(11) DEFAULT '0', + `fk_country` int(11) DEFAULT '0', + `profid1` varchar(20) DEFAULT NULL, + `profid2` varchar(20) DEFAULT NULL, + `profid3` varchar(20) DEFAULT NULL, + `phone` varchar(20) DEFAULT NULL, + `fk_user_author` int(11) NOT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `datec` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `status` tinyint(4) DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_establishment` +-- + +LOCK TABLES `llx_establishment` WRITE; +/*!40000 ALTER TABLE `llx_establishment` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_establishment` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_event_element` +-- + +DROP TABLE IF EXISTS `llx_event_element`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_event_element` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_source` int(11) NOT NULL, + `fk_target` int(11) NOT NULL, + `targettype` varchar(32) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_event_element` +-- + +LOCK TABLES `llx_event_element` WRITE; +/*!40000 ALTER TABLE `llx_event_element` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_event_element` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_events` +-- + +DROP TABLE IF EXISTS `llx_events`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_events` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `type` varchar(32) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `dateevent` datetime DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `description` varchar(250) NOT NULL, + `ip` varchar(250) DEFAULT NULL, + `user_agent` varchar(255) DEFAULT NULL, + `fk_object` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_events_dateevent` (`dateevent`) +) ENGINE=InnoDB AUTO_INCREMENT=871 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_events` +-- + +LOCK TABLES `llx_events` WRITE; +/*!40000 ALTER TABLE `llx_events` DISABLE KEYS */; +INSERT INTO `llx_events` VALUES (30,'2011-07-18 18:23:06','USER_LOGOUT',1,'2011-07-18 20:23:06',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(31,'2011-07-18 18:23:12','USER_LOGIN_FAILED',1,'2011-07-18 20:23:12',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(32,'2011-07-18 18:23:17','USER_LOGIN',1,'2011-07-18 20:23:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(33,'2011-07-18 20:10:51','USER_LOGIN_FAILED',1,'2011-07-18 22:10:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(34,'2011-07-18 20:10:55','USER_LOGIN',1,'2011-07-18 22:10:55',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(35,'2011-07-18 21:18:57','USER_LOGIN',1,'2011-07-18 23:18:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(36,'2011-07-20 10:34:10','USER_LOGIN',1,'2011-07-20 12:34:10',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(37,'2011-07-20 12:36:44','USER_LOGIN',1,'2011-07-20 14:36:44',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(38,'2011-07-20 13:20:51','USER_LOGIN_FAILED',1,'2011-07-20 15:20:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(39,'2011-07-20 13:20:54','USER_LOGIN',1,'2011-07-20 15:20:54',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(40,'2011-07-20 15:03:46','USER_LOGIN_FAILED',1,'2011-07-20 17:03:46',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(41,'2011-07-20 15:03:55','USER_LOGIN',1,'2011-07-20 17:03:55',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(42,'2011-07-20 18:05:05','USER_LOGIN_FAILED',1,'2011-07-20 20:05:05',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(43,'2011-07-20 18:05:08','USER_LOGIN',1,'2011-07-20 20:05:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(44,'2011-07-20 21:08:53','USER_LOGIN_FAILED',1,'2011-07-20 23:08:53',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(45,'2011-07-20 21:08:56','USER_LOGIN',1,'2011-07-20 23:08:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(46,'2011-07-21 01:26:12','USER_LOGIN',1,'2011-07-21 03:26:12',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(47,'2011-07-21 22:35:45','USER_LOGIN_FAILED',1,'2011-07-22 00:35:45',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(48,'2011-07-21 22:35:49','USER_LOGIN',1,'2011-07-22 00:35:49',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(49,'2011-07-26 23:09:47','USER_LOGIN_FAILED',1,'2011-07-27 01:09:47',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(50,'2011-07-26 23:09:50','USER_LOGIN',1,'2011-07-27 01:09:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(51,'2011-07-27 17:02:27','USER_LOGIN_FAILED',1,'2011-07-27 19:02:27',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(52,'2011-07-27 17:02:32','USER_LOGIN',1,'2011-07-27 19:02:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(53,'2011-07-27 23:33:37','USER_LOGIN_FAILED',1,'2011-07-28 01:33:37',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(54,'2011-07-27 23:33:41','USER_LOGIN',1,'2011-07-28 01:33:41',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(55,'2011-07-28 18:20:36','USER_LOGIN_FAILED',1,'2011-07-28 20:20:36',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(56,'2011-07-28 18:20:38','USER_LOGIN',1,'2011-07-28 20:20:38',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(57,'2011-07-28 20:13:30','USER_LOGIN_FAILED',1,'2011-07-28 22:13:30',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(58,'2011-07-28 20:13:34','USER_LOGIN',1,'2011-07-28 22:13:34',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(59,'2011-07-28 20:22:51','USER_LOGIN',1,'2011-07-28 22:22:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(60,'2011-07-28 23:05:06','USER_LOGIN',1,'2011-07-29 01:05:06',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(61,'2011-07-29 20:15:50','USER_LOGIN_FAILED',1,'2011-07-29 22:15:50',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(62,'2011-07-29 20:15:53','USER_LOGIN',1,'2011-07-29 22:15:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(68,'2011-07-29 20:51:01','USER_LOGOUT',1,'2011-07-29 22:51:01',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(69,'2011-07-29 20:51:05','USER_LOGIN',1,'2011-07-29 22:51:05',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(70,'2011-07-30 08:46:20','USER_LOGIN_FAILED',1,'2011-07-30 10:46:20',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(71,'2011-07-30 08:46:38','USER_LOGIN_FAILED',1,'2011-07-30 10:46:38',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(72,'2011-07-30 08:46:42','USER_LOGIN',1,'2011-07-30 10:46:42',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(73,'2011-07-30 10:05:12','USER_LOGIN_FAILED',1,'2011-07-30 12:05:12',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(74,'2011-07-30 10:05:15','USER_LOGIN',1,'2011-07-30 12:05:15',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(75,'2011-07-30 12:15:46','USER_LOGIN',1,'2011-07-30 14:15:46',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(76,'2011-07-31 22:19:30','USER_LOGIN',1,'2011-08-01 00:19:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(77,'2011-07-31 23:32:52','USER_LOGIN',1,'2011-08-01 01:32:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(78,'2011-08-01 01:24:50','USER_LOGIN_FAILED',1,'2011-08-01 03:24:50',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(79,'2011-08-01 01:24:54','USER_LOGIN',1,'2011-08-01 03:24:54',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(80,'2011-08-01 19:31:36','USER_LOGIN_FAILED',1,'2011-08-01 21:31:35',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(81,'2011-08-01 19:31:39','USER_LOGIN',1,'2011-08-01 21:31:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(82,'2011-08-01 20:01:36','USER_LOGIN',1,'2011-08-01 22:01:36',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(83,'2011-08-01 20:52:54','USER_LOGIN_FAILED',1,'2011-08-01 22:52:54',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(84,'2011-08-01 20:52:58','USER_LOGIN',1,'2011-08-01 22:52:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(85,'2011-08-01 21:17:28','USER_LOGIN_FAILED',1,'2011-08-01 23:17:28',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(86,'2011-08-01 21:17:31','USER_LOGIN',1,'2011-08-01 23:17:31',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(87,'2011-08-04 11:55:17','USER_LOGIN',1,'2011-08-04 13:55:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(88,'2011-08-04 20:19:03','USER_LOGIN_FAILED',1,'2011-08-04 22:19:03',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(89,'2011-08-04 20:19:07','USER_LOGIN',1,'2011-08-04 22:19:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(90,'2011-08-05 17:51:42','USER_LOGIN_FAILED',1,'2011-08-05 19:51:42',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(91,'2011-08-05 17:51:47','USER_LOGIN',1,'2011-08-05 19:51:47',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(92,'2011-08-05 17:56:03','USER_LOGIN',1,'2011-08-05 19:56:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(93,'2011-08-05 17:59:10','USER_LOGIN',1,'2011-08-05 19:59:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30',NULL),(94,'2011-08-05 18:01:58','USER_LOGIN',1,'2011-08-05 20:01:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30',NULL),(95,'2011-08-05 19:59:56','USER_LOGIN',1,'2011-08-05 21:59:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(96,'2011-08-06 18:33:22','USER_LOGIN',1,'2011-08-06 20:33:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(97,'2011-08-07 00:56:59','USER_LOGIN',1,'2011-08-07 02:56:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(98,'2011-08-07 22:49:14','USER_LOGIN',1,'2011-08-08 00:49:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(99,'2011-08-07 23:05:18','USER_LOGOUT',1,'2011-08-08 01:05:18',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(105,'2011-08-08 00:41:09','USER_LOGIN',1,'2011-08-08 02:41:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(106,'2011-08-08 11:58:55','USER_LOGIN',1,'2011-08-08 13:58:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(107,'2011-08-08 14:35:48','USER_LOGIN',1,'2011-08-08 16:35:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(108,'2011-08-08 14:36:31','USER_LOGOUT',1,'2011-08-08 16:36:31',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(109,'2011-08-08 14:38:28','USER_LOGIN',1,'2011-08-08 16:38:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(110,'2011-08-08 14:39:02','USER_LOGOUT',1,'2011-08-08 16:39:02',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(111,'2011-08-08 14:39:10','USER_LOGIN',1,'2011-08-08 16:39:10',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(112,'2011-08-08 14:39:28','USER_LOGOUT',1,'2011-08-08 16:39:28',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(113,'2011-08-08 14:39:37','USER_LOGIN',1,'2011-08-08 16:39:37',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(114,'2011-08-08 14:50:02','USER_LOGOUT',1,'2011-08-08 16:50:02',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(115,'2011-08-08 14:51:45','USER_LOGIN_FAILED',1,'2011-08-08 16:51:45',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(116,'2011-08-08 14:51:52','USER_LOGIN',1,'2011-08-08 16:51:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(117,'2011-08-08 15:09:54','USER_LOGOUT',1,'2011-08-08 17:09:54',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(118,'2011-08-08 15:10:19','USER_LOGIN_FAILED',1,'2011-08-08 17:10:19',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(119,'2011-08-08 15:10:28','USER_LOGIN',1,'2011-08-08 17:10:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(121,'2011-08-08 15:14:58','USER_LOGOUT',1,'2011-08-08 17:14:58',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(122,'2011-08-08 15:15:00','USER_LOGIN_FAILED',1,'2011-08-08 17:15:00',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(123,'2011-08-08 15:17:57','USER_LOGIN',1,'2011-08-08 17:17:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(124,'2011-08-08 15:35:56','USER_LOGOUT',1,'2011-08-08 17:35:56',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(125,'2011-08-08 15:36:05','USER_LOGIN',1,'2011-08-08 17:36:05',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(126,'2011-08-08 17:32:42','USER_LOGIN',1,'2011-08-08 19:32:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(127,'2012-12-08 13:49:37','USER_LOGOUT',1,'2012-12-08 14:49:37',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(128,'2012-12-08 13:49:42','USER_LOGIN',1,'2012-12-08 14:49:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(129,'2012-12-08 13:50:12','USER_LOGOUT',1,'2012-12-08 14:50:12',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(130,'2012-12-08 13:50:14','USER_LOGIN',1,'2012-12-08 14:50:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(131,'2012-12-08 13:50:17','USER_LOGOUT',1,'2012-12-08 14:50:17',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(132,'2012-12-08 13:52:47','USER_LOGIN',1,'2012-12-08 14:52:47',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(133,'2012-12-08 13:53:08','USER_MODIFY',1,'2012-12-08 14:53:08',1,'User admin modified','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(134,'2012-12-08 14:08:45','USER_LOGOUT',1,'2012-12-08 15:08:45',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(135,'2012-12-08 14:09:09','USER_LOGIN',1,'2012-12-08 15:09:09',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(136,'2012-12-08 14:11:43','USER_LOGOUT',1,'2012-12-08 15:11:43',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(137,'2012-12-08 14:11:45','USER_LOGIN',1,'2012-12-08 15:11:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(138,'2012-12-08 14:22:53','USER_LOGOUT',1,'2012-12-08 15:22:53',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(139,'2012-12-08 14:22:54','USER_LOGIN',1,'2012-12-08 15:22:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(140,'2012-12-08 14:23:10','USER_LOGOUT',1,'2012-12-08 15:23:10',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(141,'2012-12-08 14:23:11','USER_LOGIN',1,'2012-12-08 15:23:11',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(142,'2012-12-08 14:23:49','USER_LOGOUT',1,'2012-12-08 15:23:49',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(143,'2012-12-08 14:23:50','USER_LOGIN',1,'2012-12-08 15:23:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(144,'2012-12-08 14:28:08','USER_LOGOUT',1,'2012-12-08 15:28:08',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(145,'2012-12-08 14:35:15','USER_LOGIN',1,'2012-12-08 15:35:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(146,'2012-12-08 14:35:18','USER_LOGOUT',1,'2012-12-08 15:35:18',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(147,'2012-12-08 14:36:07','USER_LOGIN',1,'2012-12-08 15:36:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(148,'2012-12-08 14:36:09','USER_LOGOUT',1,'2012-12-08 15:36:09',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(149,'2012-12-08 14:36:41','USER_LOGIN',1,'2012-12-08 15:36:41',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(150,'2012-12-08 15:59:13','USER_LOGIN',1,'2012-12-08 16:59:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(151,'2012-12-09 11:49:52','USER_LOGIN',1,'2012-12-09 12:49:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(152,'2012-12-09 13:46:31','USER_LOGIN',1,'2012-12-09 14:46:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(153,'2012-12-09 19:03:14','USER_LOGIN',1,'2012-12-09 20:03:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(154,'2012-12-10 00:16:31','USER_LOGIN',1,'2012-12-10 01:16:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(170,'2012-12-11 22:03:31','USER_LOGIN',1,'2012-12-11 23:03:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(171,'2012-12-12 00:32:39','USER_LOGIN',1,'2012-12-12 01:32:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(172,'2012-12-12 10:49:59','USER_LOGIN',1,'2012-12-12 11:49:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(175,'2012-12-12 10:57:40','USER_MODIFY',1,'2012-12-12 11:57:40',1,'Modification utilisateur admin','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(176,'2012-12-12 13:29:15','USER_LOGIN',1,'2012-12-12 14:29:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(177,'2012-12-12 13:30:15','USER_LOGIN',1,'2012-12-12 14:30:15',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(178,'2012-12-12 13:40:08','USER_LOGOUT',1,'2012-12-12 14:40:08',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(179,'2012-12-12 13:40:10','USER_LOGIN',1,'2012-12-12 14:40:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(180,'2012-12-12 13:40:26','USER_MODIFY',1,'2012-12-12 14:40:26',1,'Modification utilisateur admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(181,'2012-12-12 13:40:34','USER_LOGOUT',1,'2012-12-12 14:40:34',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(182,'2012-12-12 13:42:23','USER_LOGIN',1,'2012-12-12 14:42:23',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(183,'2012-12-12 13:43:02','USER_NEW_PASSWORD',1,'2012-12-12 14:43:02',NULL,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(184,'2012-12-12 13:43:25','USER_LOGOUT',1,'2012-12-12 14:43:25',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(185,'2012-12-12 13:43:27','USER_LOGIN_FAILED',1,'2012-12-12 14:43:27',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(186,'2012-12-12 13:43:30','USER_LOGIN',1,'2012-12-12 14:43:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(187,'2012-12-12 14:52:11','USER_LOGIN',1,'2012-12-12 15:52:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(188,'2012-12-12 17:53:00','USER_LOGIN_FAILED',1,'2012-12-12 18:53:00',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(189,'2012-12-12 17:53:07','USER_LOGIN_FAILED',1,'2012-12-12 18:53:07',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(190,'2012-12-12 17:53:51','USER_NEW_PASSWORD',1,'2012-12-12 18:53:51',NULL,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(191,'2012-12-12 17:54:00','USER_LOGIN',1,'2012-12-12 18:54:00',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(192,'2012-12-12 17:54:10','USER_NEW_PASSWORD',1,'2012-12-12 18:54:10',1,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(193,'2012-12-12 17:54:10','USER_MODIFY',1,'2012-12-12 18:54:10',1,'Modification utilisateur admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(194,'2012-12-12 18:57:09','USER_LOGIN',1,'2012-12-12 19:57:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(195,'2012-12-12 23:04:08','USER_LOGIN',1,'2012-12-13 00:04:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(196,'2012-12-17 20:03:14','USER_LOGIN',1,'2012-12-17 21:03:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(197,'2012-12-17 21:18:45','USER_LOGIN',1,'2012-12-17 22:18:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(198,'2012-12-17 22:30:08','USER_LOGIN',1,'2012-12-17 23:30:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(199,'2012-12-18 23:32:03','USER_LOGIN',1,'2012-12-19 00:32:03',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(200,'2012-12-19 09:38:03','USER_LOGIN',1,'2012-12-19 10:38:03',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(201,'2012-12-19 11:23:35','USER_LOGIN',1,'2012-12-19 12:23:35',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(202,'2012-12-19 12:46:22','USER_LOGIN',1,'2012-12-19 13:46:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(214,'2012-12-19 19:11:31','USER_LOGIN',1,'2012-12-19 20:11:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(215,'2012-12-21 16:36:57','USER_LOGIN',1,'2012-12-21 17:36:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(216,'2012-12-21 16:38:43','USER_NEW_PASSWORD',1,'2012-12-21 17:38:43',1,'Changement mot de passe de adupont','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(217,'2012-12-21 16:38:43','USER_MODIFY',1,'2012-12-21 17:38:43',1,'Modification utilisateur adupont','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(218,'2012-12-21 16:38:51','USER_LOGOUT',1,'2012-12-21 17:38:51',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(219,'2012-12-21 16:38:55','USER_LOGIN',1,'2012-12-21 17:38:55',3,'(UserLogged,adupont)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(220,'2012-12-21 16:48:18','USER_LOGOUT',1,'2012-12-21 17:48:18',3,'(UserLogoff,adupont)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(221,'2012-12-21 16:48:20','USER_LOGIN',1,'2012-12-21 17:48:20',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(222,'2012-12-26 18:28:18','USER_LOGIN',1,'2012-12-26 19:28:18',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(223,'2012-12-26 20:00:24','USER_LOGIN',1,'2012-12-26 21:00:24',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(224,'2012-12-27 01:10:27','USER_LOGIN',1,'2012-12-27 02:10:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(225,'2012-12-28 19:12:08','USER_LOGIN',1,'2012-12-28 20:12:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(226,'2012-12-28 20:16:58','USER_LOGIN',1,'2012-12-28 21:16:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(227,'2012-12-29 14:35:46','USER_LOGIN',1,'2012-12-29 15:35:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(228,'2012-12-29 14:37:59','USER_LOGOUT',1,'2012-12-29 15:37:59',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(229,'2012-12-29 14:38:00','USER_LOGIN',1,'2012-12-29 15:38:00',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(230,'2012-12-29 17:16:48','USER_LOGIN',1,'2012-12-29 18:16:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(231,'2012-12-31 12:02:59','USER_LOGIN',1,'2012-12-31 13:02:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(232,'2013-01-02 20:32:51','USER_LOGIN',1,'2013-01-02 21:32:51',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0',NULL),(233,'2013-01-02 20:58:59','USER_LOGIN',1,'2013-01-02 21:58:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(234,'2013-01-03 09:25:07','USER_LOGIN',1,'2013-01-03 10:25:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(235,'2013-01-03 19:39:31','USER_LOGIN',1,'2013-01-03 20:39:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(236,'2013-01-04 22:40:19','USER_LOGIN',1,'2013-01-04 23:40:19',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(237,'2013-01-05 12:59:59','USER_LOGIN',1,'2013-01-05 13:59:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(238,'2013-01-05 15:28:52','USER_LOGIN',1,'2013-01-05 16:28:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(239,'2013-01-05 17:02:08','USER_LOGIN',1,'2013-01-05 18:02:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(240,'2013-01-06 12:13:33','USER_LOGIN',1,'2013-01-06 13:13:33',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(241,'2013-01-07 01:21:15','USER_LOGIN',1,'2013-01-07 02:21:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(242,'2013-01-07 01:46:31','USER_LOGOUT',1,'2013-01-07 02:46:31',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(243,'2013-01-07 19:54:50','USER_LOGIN',1,'2013-01-07 20:54:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(244,'2013-01-08 21:55:01','USER_LOGIN',1,'2013-01-08 22:55:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(245,'2013-01-09 11:13:28','USER_LOGIN',1,'2013-01-09 12:13:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(246,'2013-01-10 18:30:46','USER_LOGIN',1,'2013-01-10 19:30:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(247,'2013-01-11 18:03:26','USER_LOGIN',1,'2013-01-11 19:03:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(248,'2013-01-12 11:15:04','USER_LOGIN',1,'2013-01-12 12:15:04',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(249,'2013-01-12 14:42:44','USER_LOGIN',1,'2013-01-12 15:42:44',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(250,'2013-01-13 12:07:17','USER_LOGIN',1,'2013-01-13 13:07:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(251,'2013-01-13 17:37:58','USER_LOGIN',1,'2013-01-13 18:37:58',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(252,'2013-01-13 19:24:21','USER_LOGIN',1,'2013-01-13 20:24:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(253,'2013-01-13 19:29:19','USER_LOGOUT',1,'2013-01-13 20:29:19',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(254,'2013-01-13 21:39:39','USER_LOGIN',1,'2013-01-13 22:39:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(255,'2013-01-14 00:52:21','USER_LOGIN',1,'2013-01-14 01:52:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(256,'2013-01-16 11:34:31','USER_LOGIN',1,'2013-01-16 12:34:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(257,'2013-01-16 15:36:21','USER_LOGIN',1,'2013-01-16 16:36:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(258,'2013-01-16 19:17:36','USER_LOGIN',1,'2013-01-16 20:17:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(259,'2013-01-16 19:48:08','GROUP_CREATE',1,'2013-01-16 20:48:08',1,'Création groupe ggg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(260,'2013-01-16 21:48:53','USER_LOGIN',1,'2013-01-16 22:48:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(261,'2013-01-17 19:55:53','USER_LOGIN',1,'2013-01-17 20:55:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(262,'2013-01-18 09:48:01','USER_LOGIN',1,'2013-01-18 10:48:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(263,'2013-01-18 13:22:36','USER_LOGIN',1,'2013-01-18 14:22:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(264,'2013-01-18 16:10:23','USER_LOGIN',1,'2013-01-18 17:10:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(265,'2013-01-18 17:41:40','USER_LOGIN',1,'2013-01-18 18:41:40',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(266,'2013-01-19 14:33:48','USER_LOGIN',1,'2013-01-19 15:33:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(267,'2013-01-19 16:47:43','USER_LOGIN',1,'2013-01-19 17:47:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(268,'2013-01-19 16:59:43','USER_LOGIN',1,'2013-01-19 17:59:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(269,'2013-01-19 17:00:22','USER_LOGIN',1,'2013-01-19 18:00:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(270,'2013-01-19 17:04:16','USER_LOGOUT',1,'2013-01-19 18:04:16',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(271,'2013-01-19 17:04:18','USER_LOGIN',1,'2013-01-19 18:04:18',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(272,'2013-01-20 00:34:19','USER_LOGIN',1,'2013-01-20 01:34:19',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(273,'2013-01-21 11:54:17','USER_LOGIN',1,'2013-01-21 12:54:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(274,'2013-01-21 13:48:15','USER_LOGIN',1,'2013-01-21 14:48:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(275,'2013-01-21 14:30:22','USER_LOGIN',1,'2013-01-21 15:30:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(276,'2013-01-21 15:10:46','USER_LOGIN',1,'2013-01-21 16:10:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(277,'2013-01-21 17:27:43','USER_LOGIN',1,'2013-01-21 18:27:43',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(278,'2013-01-21 21:48:15','USER_LOGIN',1,'2013-01-21 22:48:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(279,'2013-01-21 21:50:42','USER_LOGIN',1,'2013-01-21 22:50:42',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(280,'2013-01-23 09:28:26','USER_LOGIN',1,'2013-01-23 10:28:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(281,'2013-01-23 13:21:57','USER_LOGIN',1,'2013-01-23 14:21:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(282,'2013-01-23 16:52:00','USER_LOGOUT',1,'2013-01-23 17:52:00',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(283,'2013-01-23 16:52:05','USER_LOGIN_FAILED',1,'2013-01-23 17:52:05',NULL,'Bad value for login or password - login=bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(284,'2013-01-23 16:52:09','USER_LOGIN',1,'2013-01-23 17:52:09',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(285,'2013-01-23 16:52:27','USER_CREATE',1,'2013-01-23 17:52:27',1,'Création utilisateur aaa','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(286,'2013-01-23 16:52:27','USER_NEW_PASSWORD',1,'2013-01-23 17:52:27',1,'Changement mot de passe de aaa','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(287,'2013-01-23 16:52:37','USER_CREATE',1,'2013-01-23 17:52:37',1,'Création utilisateur bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(288,'2013-01-23 16:52:37','USER_NEW_PASSWORD',1,'2013-01-23 17:52:37',1,'Changement mot de passe de bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(289,'2013-01-23 16:53:15','USER_LOGOUT',1,'2013-01-23 17:53:15',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(290,'2013-01-23 16:53:20','USER_LOGIN',1,'2013-01-23 17:53:20',4,'(UserLogged,aaa)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(291,'2013-01-23 19:16:58','USER_LOGIN',1,'2013-01-23 20:16:58',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(292,'2013-01-26 10:54:07','USER_LOGIN',1,'2013-01-26 11:54:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(293,'2013-01-29 10:15:36','USER_LOGIN',1,'2013-01-29 11:15:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(294,'2013-01-30 17:42:50','USER_LOGIN',1,'2013-01-30 18:42:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(295,'2013-02-01 08:49:55','USER_LOGIN',1,'2013-02-01 09:49:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(296,'2013-02-01 08:51:57','USER_LOGOUT',1,'2013-02-01 09:51:57',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(297,'2013-02-01 08:52:39','USER_LOGIN',1,'2013-02-01 09:52:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(298,'2013-02-01 21:03:01','USER_LOGIN',1,'2013-02-01 22:03:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(299,'2013-02-10 19:48:39','USER_LOGIN',1,'2013-02-10 20:48:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(300,'2013-02-10 20:46:48','USER_LOGIN',1,'2013-02-10 21:46:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(301,'2013-02-10 21:39:23','USER_LOGIN',1,'2013-02-10 22:39:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(302,'2013-02-11 19:00:13','USER_LOGIN',1,'2013-02-11 20:00:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(303,'2013-02-11 19:43:44','USER_LOGIN_FAILED',1,'2013-02-11 20:43:44',NULL,'Unknown column \'u.fk_user\' in \'field list\'','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(304,'2013-02-11 19:44:01','USER_LOGIN',1,'2013-02-11 20:44:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(305,'2013-02-12 00:27:35','USER_LOGIN',1,'2013-02-12 01:27:35',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(306,'2013-02-12 00:27:38','USER_LOGOUT',1,'2013-02-12 01:27:38',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(307,'2013-02-12 00:28:07','USER_LOGIN',1,'2013-02-12 01:28:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(308,'2013-02-12 00:28:09','USER_LOGOUT',1,'2013-02-12 01:28:09',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(309,'2013-02-12 00:28:26','USER_LOGIN',1,'2013-02-12 01:28:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(310,'2013-02-12 00:28:30','USER_LOGOUT',1,'2013-02-12 01:28:30',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(311,'2013-02-12 12:42:15','USER_LOGIN',1,'2013-02-12 13:42:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(312,'2013-02-12 13:46:16','USER_LOGIN',1,'2013-02-12 14:46:16',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(313,'2013-02-12 14:54:28','USER_LOGIN',1,'2013-02-12 15:54:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(314,'2013-02-12 16:04:46','USER_LOGIN',1,'2013-02-12 17:04:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(315,'2013-02-13 14:02:43','USER_LOGIN',1,'2013-02-13 15:02:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(316,'2013-02-13 14:48:30','USER_LOGIN',1,'2013-02-13 15:48:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(317,'2013-02-13 17:44:53','USER_LOGIN',1,'2013-02-13 18:44:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(318,'2013-02-15 08:44:36','USER_LOGIN',1,'2013-02-15 09:44:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(319,'2013-02-15 08:53:20','USER_LOGIN',1,'2013-02-15 09:53:20',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(320,'2013-02-16 19:10:28','USER_LOGIN',1,'2013-02-16 20:10:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(321,'2013-02-16 19:22:40','USER_CREATE',1,'2013-02-16 20:22:40',1,'Création utilisateur aaab','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(322,'2013-02-16 19:22:40','USER_NEW_PASSWORD',1,'2013-02-16 20:22:40',1,'Changement mot de passe de aaab','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(323,'2013-02-16 19:48:15','USER_CREATE',1,'2013-02-16 20:48:15',1,'Création utilisateur zzz','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(324,'2013-02-16 19:48:15','USER_NEW_PASSWORD',1,'2013-02-16 20:48:15',1,'Changement mot de passe de zzz','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(325,'2013-02-16 19:50:08','USER_CREATE',1,'2013-02-16 20:50:08',1,'Création utilisateur zzzg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(326,'2013-02-16 19:50:08','USER_NEW_PASSWORD',1,'2013-02-16 20:50:08',1,'Changement mot de passe de zzzg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(327,'2013-02-16 21:20:03','USER_LOGIN',1,'2013-02-16 22:20:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(328,'2013-02-17 14:30:51','USER_LOGIN',1,'2013-02-17 15:30:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(329,'2013-02-17 17:21:22','USER_LOGIN',1,'2013-02-17 18:21:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(330,'2013-02-17 17:48:43','USER_MODIFY',1,'2013-02-17 18:48:43',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(331,'2013-02-17 17:48:47','USER_MODIFY',1,'2013-02-17 18:48:47',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(332,'2013-02-17 17:48:51','USER_MODIFY',1,'2013-02-17 18:48:51',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(333,'2013-02-17 17:48:56','USER_MODIFY',1,'2013-02-17 18:48:56',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(334,'2013-02-18 22:00:01','USER_LOGIN',1,'2013-02-18 23:00:01',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(335,'2013-02-19 08:19:52','USER_LOGIN',1,'2013-02-19 09:19:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(336,'2013-02-19 22:00:52','USER_LOGIN',1,'2013-02-19 23:00:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(337,'2013-02-20 09:34:52','USER_LOGIN',1,'2013-02-20 10:34:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(338,'2013-02-20 13:12:28','USER_LOGIN',1,'2013-02-20 14:12:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(339,'2013-02-20 17:19:44','USER_LOGIN',1,'2013-02-20 18:19:44',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(340,'2013-02-20 19:07:21','USER_MODIFY',1,'2013-02-20 20:07:21',1,'Modification utilisateur adupont','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(341,'2013-02-20 19:47:17','USER_LOGIN',1,'2013-02-20 20:47:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(342,'2013-02-20 19:48:01','USER_MODIFY',1,'2013-02-20 20:48:01',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(343,'2013-02-21 08:27:07','USER_LOGIN',1,'2013-02-21 09:27:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(344,'2013-02-23 13:34:13','USER_LOGIN',1,'2013-02-23 14:34:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(345,'2013-02-24 01:06:41','USER_LOGIN_FAILED',1,'2013-02-24 02:06:41',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(346,'2013-02-24 01:06:45','USER_LOGIN_FAILED',1,'2013-02-24 02:06:45',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(347,'2013-02-24 01:06:55','USER_LOGIN_FAILED',1,'2013-02-24 02:06:55',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(348,'2013-02-24 01:07:03','USER_LOGIN_FAILED',1,'2013-02-24 02:07:03',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(349,'2013-02-24 01:07:21','USER_LOGIN_FAILED',1,'2013-02-24 02:07:21',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(350,'2013-02-24 01:08:12','USER_LOGIN_FAILED',1,'2013-02-24 02:08:12',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(351,'2013-02-24 01:08:42','USER_LOGIN_FAILED',1,'2013-02-24 02:08:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(352,'2013-02-24 01:08:50','USER_LOGIN_FAILED',1,'2013-02-24 02:08:50',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(353,'2013-02-24 01:09:08','USER_LOGIN_FAILED',1,'2013-02-24 02:09:08',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(354,'2013-02-24 01:09:42','USER_LOGIN_FAILED',1,'2013-02-24 02:09:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(355,'2013-02-24 01:09:50','USER_LOGIN_FAILED',1,'2013-02-24 02:09:50',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(356,'2013-02-24 01:10:05','USER_LOGIN_FAILED',1,'2013-02-24 02:10:05',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(357,'2013-02-24 01:10:22','USER_LOGIN_FAILED',1,'2013-02-24 02:10:22',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(358,'2013-02-24 01:10:30','USER_LOGIN_FAILED',1,'2013-02-24 02:10:30',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(359,'2013-02-24 01:10:56','USER_LOGIN_FAILED',1,'2013-02-24 02:10:56',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(360,'2013-02-24 01:11:26','USER_LOGIN_FAILED',1,'2013-02-24 02:11:26',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(361,'2013-02-24 01:12:06','USER_LOGIN_FAILED',1,'2013-02-24 02:12:06',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(362,'2013-02-24 01:21:14','USER_LOGIN_FAILED',1,'2013-02-24 02:21:14',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(363,'2013-02-24 01:21:25','USER_LOGIN_FAILED',1,'2013-02-24 02:21:25',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(364,'2013-02-24 01:21:54','USER_LOGIN_FAILED',1,'2013-02-24 02:21:54',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(365,'2013-02-24 01:22:14','USER_LOGIN_FAILED',1,'2013-02-24 02:22:14',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(366,'2013-02-24 01:22:37','USER_LOGIN_FAILED',1,'2013-02-24 02:22:37',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(367,'2013-02-24 01:23:01','USER_LOGIN_FAILED',1,'2013-02-24 02:23:01',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(368,'2013-02-24 01:23:39','USER_LOGIN_FAILED',1,'2013-02-24 02:23:39',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(369,'2013-02-24 01:24:04','USER_LOGIN_FAILED',1,'2013-02-24 02:24:04',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(370,'2013-02-24 01:24:39','USER_LOGIN_FAILED',1,'2013-02-24 02:24:39',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(371,'2013-02-24 01:25:01','USER_LOGIN_FAILED',1,'2013-02-24 02:25:01',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(372,'2013-02-24 01:25:12','USER_LOGIN_FAILED',1,'2013-02-24 02:25:12',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(373,'2013-02-24 01:27:30','USER_LOGIN_FAILED',1,'2013-02-24 02:27:30',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(374,'2013-02-24 01:28:00','USER_LOGIN_FAILED',1,'2013-02-24 02:28:00',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(375,'2013-02-24 01:28:35','USER_LOGIN_FAILED',1,'2013-02-24 02:28:35',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(376,'2013-02-24 01:29:03','USER_LOGIN_FAILED',1,'2013-02-24 02:29:03',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(377,'2013-02-24 01:29:55','USER_LOGIN_FAILED',1,'2013-02-24 02:29:55',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(378,'2013-02-24 01:32:40','USER_LOGIN_FAILED',1,'2013-02-24 02:32:40',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(379,'2013-02-24 01:39:33','USER_LOGIN_FAILED',1,'2013-02-24 02:39:33',NULL,'Identifiants login ou mot de passe incorrects - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(380,'2013-02-24 01:39:38','USER_LOGIN_FAILED',1,'2013-02-24 02:39:38',NULL,'Identifiants login ou mot de passe incorrects - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(381,'2013-02-24 01:39:47','USER_LOGIN_FAILED',1,'2013-02-24 02:39:47',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(382,'2013-02-24 01:40:54','USER_LOGIN_FAILED',1,'2013-02-24 02:40:54',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(383,'2013-02-24 01:47:57','USER_LOGIN_FAILED',1,'2013-02-24 02:47:57',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(384,'2013-02-24 01:48:05','USER_LOGIN_FAILED',1,'2013-02-24 02:48:05',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(385,'2013-02-24 01:48:07','USER_LOGIN_FAILED',1,'2013-02-24 02:48:07',NULL,'Unknown column \'u.lastname\' in \'field list\'','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(386,'2013-02-24 01:48:35','USER_LOGIN',1,'2013-02-24 02:48:35',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(387,'2013-02-24 01:56:32','USER_LOGIN',1,'2013-02-24 02:56:32',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(388,'2013-02-24 02:05:55','USER_LOGOUT',1,'2013-02-24 03:05:55',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(389,'2013-02-24 02:39:52','USER_LOGIN',1,'2013-02-24 03:39:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(390,'2013-02-24 02:51:10','USER_LOGOUT',1,'2013-02-24 03:51:10',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(391,'2013-02-24 12:46:41','USER_LOGIN',1,'2013-02-24 13:46:41',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(392,'2013-02-24 12:46:52','USER_LOGOUT',1,'2013-02-24 13:46:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(393,'2013-02-24 12:46:56','USER_LOGIN',1,'2013-02-24 13:46:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(394,'2013-02-24 12:47:56','USER_LOGOUT',1,'2013-02-24 13:47:56',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(395,'2013-02-24 12:48:00','USER_LOGIN',1,'2013-02-24 13:48:00',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(396,'2013-02-24 12:48:11','USER_LOGOUT',1,'2013-02-24 13:48:11',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(397,'2013-02-24 12:48:32','USER_LOGIN',1,'2013-02-24 13:48:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(398,'2013-02-24 12:52:22','USER_LOGOUT',1,'2013-02-24 13:52:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(399,'2013-02-24 12:52:27','USER_LOGIN',1,'2013-02-24 13:52:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(400,'2013-02-24 12:52:54','USER_LOGOUT',1,'2013-02-24 13:52:54',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(401,'2013-02-24 12:52:59','USER_LOGIN',1,'2013-02-24 13:52:59',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(402,'2013-02-24 12:55:39','USER_LOGOUT',1,'2013-02-24 13:55:39',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(403,'2013-02-24 12:55:59','USER_LOGIN',1,'2013-02-24 13:55:59',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(404,'2013-02-24 12:56:07','USER_LOGOUT',1,'2013-02-24 13:56:07',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(405,'2013-02-24 12:56:23','USER_LOGIN',1,'2013-02-24 13:56:23',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(406,'2013-02-24 12:56:46','USER_LOGOUT',1,'2013-02-24 13:56:46',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(407,'2013-02-24 12:58:30','USER_LOGIN',1,'2013-02-24 13:58:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(408,'2013-02-24 12:58:33','USER_LOGOUT',1,'2013-02-24 13:58:33',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(409,'2013-02-24 12:58:51','USER_LOGIN',1,'2013-02-24 13:58:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(410,'2013-02-24 12:58:58','USER_LOGOUT',1,'2013-02-24 13:58:58',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(411,'2013-02-24 13:18:53','USER_LOGIN',1,'2013-02-24 14:18:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(412,'2013-02-24 13:19:52','USER_LOGOUT',1,'2013-02-24 14:19:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(413,'2013-02-24 15:39:31','USER_LOGIN_FAILED',1,'2013-02-24 16:39:31',NULL,'ErrorBadValueForCode - login=admin','127.0.0.1',NULL,NULL),(414,'2013-02-24 15:42:07','USER_LOGIN',1,'2013-02-24 16:42:07',1,'(UserLogged,admin)','127.0.0.1',NULL,NULL),(415,'2013-02-24 15:42:52','USER_LOGOUT',1,'2013-02-24 16:42:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(416,'2013-02-24 16:04:21','USER_LOGIN',1,'2013-02-24 17:04:21',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(417,'2013-02-24 16:11:28','USER_LOGIN_FAILED',1,'2013-02-24 17:11:28',NULL,'ErrorBadValueForCode - login=admin','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(418,'2013-02-24 16:11:37','USER_LOGIN',1,'2013-02-24 17:11:37',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(419,'2013-02-24 16:36:52','USER_LOGOUT',1,'2013-02-24 17:36:52',1,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(420,'2013-02-24 16:40:37','USER_LOGIN',1,'2013-02-24 17:40:37',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(421,'2013-02-24 16:57:16','USER_LOGIN',1,'2013-02-24 17:57:16',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(422,'2013-02-24 17:01:30','USER_LOGOUT',1,'2013-02-24 18:01:30',1,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(423,'2013-02-24 17:02:33','USER_LOGIN',1,'2013-02-24 18:02:33',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(424,'2013-02-24 17:14:22','USER_LOGOUT',1,'2013-02-24 18:14:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(425,'2013-02-24 17:15:07','USER_LOGIN_FAILED',1,'2013-02-24 18:15:07',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(426,'2013-02-24 17:15:20','USER_LOGIN',1,'2013-02-24 18:15:20',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(427,'2013-02-24 17:20:14','USER_LOGIN',1,'2013-02-24 18:20:14',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(428,'2013-02-24 17:20:51','USER_LOGIN',1,'2013-02-24 18:20:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(429,'2013-02-24 17:20:54','USER_LOGOUT',1,'2013-02-24 18:20:54',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(430,'2013-02-24 17:21:19','USER_LOGIN',1,'2013-02-24 18:21:19',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(431,'2013-02-24 17:32:35','USER_LOGIN',1,'2013-02-24 18:32:35',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(432,'2013-02-24 18:28:48','USER_LOGIN',1,'2013-02-24 19:28:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(433,'2013-02-24 18:29:27','USER_LOGOUT',1,'2013-02-24 19:29:27',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(434,'2013-02-24 18:29:32','USER_LOGIN',1,'2013-02-24 19:29:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(435,'2013-02-24 20:13:13','USER_LOGOUT',1,'2013-02-24 21:13:13',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(436,'2013-02-24 20:13:17','USER_LOGIN',1,'2013-02-24 21:13:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(437,'2013-02-25 08:57:16','USER_LOGIN',1,'2013-02-25 09:57:16',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(438,'2013-02-25 08:57:59','USER_LOGOUT',1,'2013-02-25 09:57:59',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(439,'2013-02-25 09:15:02','USER_LOGIN',1,'2013-02-25 10:15:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(440,'2013-02-25 09:15:50','USER_LOGOUT',1,'2013-02-25 10:15:50',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(441,'2013-02-25 09:15:57','USER_LOGIN',1,'2013-02-25 10:15:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(442,'2013-02-25 09:16:12','USER_LOGOUT',1,'2013-02-25 10:16:12',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(443,'2013-02-25 09:16:19','USER_LOGIN',1,'2013-02-25 10:16:19',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(444,'2013-02-25 09:16:25','USER_LOGOUT',1,'2013-02-25 10:16:25',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(445,'2013-02-25 09:16:39','USER_LOGIN_FAILED',1,'2013-02-25 10:16:39',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(446,'2013-02-25 09:16:42','USER_LOGIN_FAILED',1,'2013-02-25 10:16:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(447,'2013-02-25 09:16:54','USER_LOGIN_FAILED',1,'2013-02-25 10:16:54',NULL,'Identificadors d'usuari o contrasenya incorrectes - login=gfdg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(448,'2013-02-25 09:17:53','USER_LOGIN',1,'2013-02-25 10:17:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(449,'2013-02-25 09:18:37','USER_LOGOUT',1,'2013-02-25 10:18:37',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(450,'2013-02-25 09:18:41','USER_LOGIN',1,'2013-02-25 10:18:41',4,'(UserLogged,aaa)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(451,'2013-02-25 09:18:47','USER_LOGOUT',1,'2013-02-25 10:18:47',4,'(UserLogoff,aaa)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(452,'2013-02-25 10:05:34','USER_LOGIN',1,'2013-02-25 11:05:34',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(453,'2013-02-26 21:51:40','USER_LOGIN',1,'2013-02-26 22:51:40',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(454,'2013-02-26 23:30:06','USER_LOGIN',1,'2013-02-27 00:30:06',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(455,'2013-02-27 14:13:11','USER_LOGIN',1,'2013-02-27 15:13:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(456,'2013-02-27 18:12:06','USER_LOGIN_FAILED',1,'2013-02-27 19:12:06',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(457,'2013-02-27 18:12:10','USER_LOGIN',1,'2013-02-27 19:12:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(458,'2013-02-27 20:20:08','USER_LOGIN',1,'2013-02-27 21:20:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(459,'2013-03-01 22:12:03','USER_LOGIN',1,'2013-03-01 23:12:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(460,'2013-03-02 11:45:50','USER_LOGIN',1,'2013-03-02 12:45:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(461,'2013-03-02 15:53:51','USER_LOGIN_FAILED',1,'2013-03-02 16:53:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(462,'2013-03-02 15:53:53','USER_LOGIN',1,'2013-03-02 16:53:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(463,'2013-03-02 18:32:32','USER_LOGIN',1,'2013-03-02 19:32:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(464,'2013-03-02 22:59:36','USER_LOGIN',1,'2013-03-02 23:59:36',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(465,'2013-03-03 16:26:26','USER_LOGIN',1,'2013-03-03 17:26:26',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(466,'2013-03-03 22:50:27','USER_LOGIN',1,'2013-03-03 23:50:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(467,'2013-03-04 08:29:27','USER_LOGIN',1,'2013-03-04 09:29:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(468,'2013-03-04 18:27:28','USER_LOGIN',1,'2013-03-04 19:27:28',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; NP06)',NULL),(469,'2013-03-04 19:27:23','USER_LOGIN',1,'2013-03-04 20:27:23',1,'(UserLogged,admin)','192.168.0.254','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',NULL),(470,'2013-03-04 19:35:14','USER_LOGIN',1,'2013-03-04 20:35:14',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(471,'2013-03-04 19:55:49','USER_LOGIN',1,'2013-03-04 20:55:49',1,'(UserLogged,admin)','192.168.0.254','Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)',NULL),(472,'2013-03-04 21:16:13','USER_LOGIN',1,'2013-03-04 22:16:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(473,'2013-03-05 10:17:30','USER_LOGIN',1,'2013-03-05 11:17:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(474,'2013-03-05 11:02:43','USER_LOGIN',1,'2013-03-05 12:02:43',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(475,'2013-03-05 23:14:39','USER_LOGIN',1,'2013-03-06 00:14:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(476,'2013-03-06 08:58:57','USER_LOGIN',1,'2013-03-06 09:58:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(477,'2013-03-06 14:29:40','USER_LOGIN',1,'2013-03-06 15:29:40',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(478,'2013-03-06 21:53:02','USER_LOGIN',1,'2013-03-06 22:53:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(479,'2013-03-07 21:14:39','USER_LOGIN',1,'2013-03-07 22:14:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(480,'2013-03-08 00:06:05','USER_LOGIN',1,'2013-03-08 01:06:05',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(481,'2013-03-08 01:38:13','USER_LOGIN',1,'2013-03-08 02:38:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(482,'2013-03-08 08:59:50','USER_LOGIN',1,'2013-03-08 09:59:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(483,'2013-03-09 12:08:51','USER_LOGIN',1,'2013-03-09 13:08:51',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(484,'2013-03-09 15:19:53','USER_LOGIN',1,'2013-03-09 16:19:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(495,'2013-03-09 18:06:21','USER_LOGIN',1,'2013-03-09 19:06:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(496,'2013-03-09 20:01:24','USER_LOGIN',1,'2013-03-09 21:01:24',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(497,'2013-03-09 23:36:45','USER_LOGIN',1,'2013-03-10 00:36:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(498,'2013-03-10 14:37:13','USER_LOGIN',1,'2013-03-10 15:37:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(499,'2013-03-10 17:54:12','USER_LOGIN',1,'2013-03-10 18:54:12',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(500,'2013-03-11 08:57:09','USER_LOGIN',1,'2013-03-11 09:57:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(501,'2013-03-11 22:05:13','USER_LOGIN',1,'2013-03-11 23:05:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(502,'2013-03-12 08:34:27','USER_LOGIN',1,'2013-03-12 09:34:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(503,'2013-03-13 09:11:02','USER_LOGIN',1,'2013-03-13 10:11:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(504,'2013-03-13 10:02:11','USER_LOGIN',1,'2013-03-13 11:02:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(505,'2013-03-13 13:20:58','USER_LOGIN',1,'2013-03-13 14:20:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(506,'2013-03-13 16:19:28','USER_LOGIN',1,'2013-03-13 17:19:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(507,'2013-03-13 18:34:30','USER_LOGIN',1,'2013-03-13 19:34:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(508,'2013-03-14 08:25:02','USER_LOGIN',1,'2013-03-14 09:25:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(509,'2013-03-14 19:15:22','USER_LOGIN',1,'2013-03-14 20:15:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(510,'2013-03-14 21:58:53','USER_LOGIN',1,'2013-03-14 22:58:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(511,'2013-03-14 21:58:59','USER_LOGOUT',1,'2013-03-14 22:58:59',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(512,'2013-03-14 21:59:07','USER_LOGIN',1,'2013-03-14 22:59:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(513,'2013-03-14 22:58:22','USER_LOGOUT',1,'2013-03-14 23:58:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(514,'2013-03-14 23:00:25','USER_LOGIN',1,'2013-03-15 00:00:25',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(515,'2013-03-16 12:14:28','USER_LOGIN',1,'2013-03-16 13:14:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(516,'2013-03-16 16:09:01','USER_LOGIN',1,'2013-03-16 17:09:01',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(517,'2013-03-16 16:57:11','USER_LOGIN',1,'2013-03-16 17:57:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(518,'2013-03-16 19:31:31','USER_LOGIN',1,'2013-03-16 20:31:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(519,'2013-03-17 17:44:39','USER_LOGIN',1,'2013-03-17 18:44:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(520,'2013-03-17 20:40:57','USER_LOGIN',1,'2013-03-17 21:40:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(521,'2013-03-17 23:14:05','USER_LOGIN',1,'2013-03-18 00:14:05',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(522,'2013-03-17 23:28:47','USER_LOGOUT',1,'2013-03-18 00:28:47',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(523,'2013-03-17 23:28:54','USER_LOGIN',1,'2013-03-18 00:28:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(524,'2013-03-18 17:37:30','USER_LOGIN',1,'2013-03-18 18:37:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(525,'2013-03-18 18:11:37','USER_LOGIN',1,'2013-03-18 19:11:37',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(526,'2013-03-19 08:35:08','USER_LOGIN',1,'2013-03-19 09:35:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(527,'2013-03-19 09:20:23','USER_LOGIN',1,'2013-03-19 10:20:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(528,'2013-03-20 13:17:13','USER_LOGIN',1,'2013-03-20 14:17:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(529,'2013-03-20 14:44:31','USER_LOGIN',1,'2013-03-20 15:44:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(530,'2013-03-20 18:24:25','USER_LOGIN',1,'2013-03-20 19:24:25',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(531,'2013-03-20 19:15:54','USER_LOGIN',1,'2013-03-20 20:15:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(532,'2013-03-21 18:40:47','USER_LOGIN',1,'2013-03-21 19:40:47',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(533,'2013-03-21 21:42:24','USER_LOGIN',1,'2013-03-21 22:42:24',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(534,'2013-03-22 08:39:23','USER_LOGIN',1,'2013-03-22 09:39:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(535,'2013-03-23 13:04:55','USER_LOGIN',1,'2013-03-23 14:04:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(536,'2013-03-23 15:47:43','USER_LOGIN',1,'2013-03-23 16:47:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(537,'2013-03-23 22:56:36','USER_LOGIN',1,'2013-03-23 23:56:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(538,'2013-03-24 01:22:32','USER_LOGIN',1,'2013-03-24 02:22:32',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(539,'2013-03-24 14:40:42','USER_LOGIN',1,'2013-03-24 15:40:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(540,'2013-03-24 15:30:26','USER_LOGOUT',1,'2013-03-24 16:30:26',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(541,'2013-03-24 15:30:29','USER_LOGIN',1,'2013-03-24 16:30:29',2,'(UserLogged,demo)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(542,'2013-03-24 15:49:40','USER_LOGOUT',1,'2013-03-24 16:49:40',2,'(UserLogoff,demo)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(543,'2013-03-24 15:49:48','USER_LOGIN',1,'2013-03-24 16:49:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(544,'2013-03-24 15:52:35','USER_MODIFY',1,'2013-03-24 16:52:35',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(545,'2013-03-24 15:52:52','USER_MODIFY',1,'2013-03-24 16:52:52',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(546,'2013-03-24 15:53:09','USER_MODIFY',1,'2013-03-24 16:53:09',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(547,'2013-03-24 15:53:23','USER_MODIFY',1,'2013-03-24 16:53:23',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(548,'2013-03-24 16:00:04','USER_MODIFY',1,'2013-03-24 17:00:04',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(549,'2013-03-24 16:01:50','USER_MODIFY',1,'2013-03-24 17:01:50',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(550,'2013-03-24 16:10:14','USER_MODIFY',1,'2013-03-24 17:10:14',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(551,'2013-03-24 16:55:13','USER_LOGIN',1,'2013-03-24 17:55:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(552,'2013-03-24 17:44:29','USER_LOGIN',1,'2013-03-24 18:44:29',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(553,'2013-09-08 23:06:26','USER_LOGIN',1,'2013-09-09 01:06:26',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36',NULL),(554,'2013-10-21 22:32:28','USER_LOGIN',1,'2013-10-22 00:32:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36',NULL),(555,'2013-10-21 22:32:48','USER_LOGIN',1,'2013-10-22 00:32:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36',NULL),(556,'2013-11-07 00:01:51','USER_LOGIN',1,'2013-11-07 01:01:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36',NULL),(557,'2014-03-02 15:21:07','USER_LOGIN',1,'2014-03-02 16:21:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(558,'2014-03-02 15:36:53','USER_LOGIN',1,'2014-03-02 16:36:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(559,'2014-03-02 18:54:23','USER_LOGIN',1,'2014-03-02 19:54:23',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(560,'2014-03-02 19:11:17','USER_LOGIN',1,'2014-03-02 20:11:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(561,'2014-03-03 18:19:24','USER_LOGIN',1,'2014-03-03 19:19:24',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(562,'2014-12-21 12:51:38','USER_LOGIN',1,'2014-12-21 13:51:38',1,'(UserLogged,admin) - TZ=1;TZString=CET;Screen=1920x969','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36',NULL),(563,'2014-12-21 19:52:09','USER_LOGIN',1,'2014-12-21 20:52:09',1,'(UserLogged,admin) - TZ=1;TZString=CET;Screen=1920x969','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36',NULL),(566,'2015-10-03 08:49:43','USER_NEW_PASSWORD',1,'2015-10-03 10:49:43',1,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(567,'2015-10-03 08:49:43','USER_MODIFY',1,'2015-10-03 10:49:43',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(568,'2015-10-03 09:03:12','USER_MODIFY',1,'2015-10-03 11:03:12',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(569,'2015-10-03 09:03:42','USER_MODIFY',1,'2015-10-03 11:03:42',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(570,'2015-10-03 09:07:36','USER_MODIFY',1,'2015-10-03 11:07:36',1,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(571,'2015-10-03 09:08:58','USER_NEW_PASSWORD',1,'2015-10-03 11:08:58',1,'Password change for pcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(572,'2015-10-03 09:08:58','USER_MODIFY',1,'2015-10-03 11:08:58',1,'User pcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(573,'2015-10-03 09:09:23','USER_MODIFY',1,'2015-10-03 11:09:23',1,'User pcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(574,'2015-10-03 09:11:04','USER_NEW_PASSWORD',1,'2015-10-03 11:11:04',1,'Password change for athestudent','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(575,'2015-10-03 09:11:04','USER_MODIFY',1,'2015-10-03 11:11:04',1,'User athestudent modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(576,'2015-10-03 09:11:53','USER_MODIFY',1,'2015-10-03 11:11:53',1,'User abookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(577,'2015-10-03 09:42:12','USER_LOGIN_FAILED',1,'2015-10-03 11:42:11',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(578,'2015-10-03 09:42:19','USER_LOGIN_FAILED',1,'2015-10-03 11:42:19',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(579,'2015-10-03 09:42:42','USER_LOGIN_FAILED',1,'2015-10-03 11:42:42',NULL,'Bad value for login or password - login=aeinstein','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(580,'2015-10-03 09:43:50','USER_LOGIN',1,'2015-10-03 11:43:50',1,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x788','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(581,'2015-10-03 09:44:44','GROUP_MODIFY',1,'2015-10-03 11:44:44',1,'Group Sale representatives modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(582,'2015-10-03 09:46:25','GROUP_CREATE',1,'2015-10-03 11:46:25',1,'Group Management created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(583,'2015-10-03 09:46:46','GROUP_CREATE',1,'2015-10-03 11:46:46',1,'Group Scientists created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(584,'2015-10-03 09:47:41','USER_CREATE',1,'2015-10-03 11:47:41',1,'User mcurie created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(585,'2015-10-03 09:47:41','USER_NEW_PASSWORD',1,'2015-10-03 11:47:41',1,'Password change for mcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(586,'2015-10-03 09:47:53','USER_MODIFY',1,'2015-10-03 11:47:53',1,'User mcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(587,'2015-10-03 09:48:32','USER_DELETE',1,'2015-10-03 11:48:32',1,'User bbb removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(588,'2015-10-03 09:48:52','USER_MODIFY',1,'2015-10-03 11:48:52',1,'User bookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(589,'2015-10-03 10:01:28','USER_MODIFY',1,'2015-10-03 12:01:28',1,'User bookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(590,'2015-10-03 10:01:39','USER_MODIFY',1,'2015-10-03 12:01:39',1,'User bookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(591,'2015-10-05 06:32:38','USER_LOGIN_FAILED',1,'2015-10-05 08:32:38',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(592,'2015-10-05 06:32:44','USER_LOGIN',1,'2015-10-05 08:32:44',1,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(593,'2015-10-05 07:07:52','USER_CREATE',1,'2015-10-05 09:07:52',1,'User atheceo created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(594,'2015-10-05 07:07:52','USER_NEW_PASSWORD',1,'2015-10-05 09:07:52',1,'Password change for atheceo','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(595,'2015-10-05 07:09:08','USER_NEW_PASSWORD',1,'2015-10-05 09:09:08',1,'Password change for aeinstein','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(596,'2015-10-05 07:09:08','USER_MODIFY',1,'2015-10-05 09:09:08',1,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(597,'2015-10-05 07:09:46','USER_CREATE',1,'2015-10-05 09:09:46',1,'User admin created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(598,'2015-10-05 07:09:46','USER_NEW_PASSWORD',1,'2015-10-05 09:09:46',1,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(599,'2015-10-05 07:10:20','USER_MODIFY',1,'2015-10-05 09:10:20',1,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(600,'2015-10-05 07:10:48','USER_MODIFY',1,'2015-10-05 09:10:48',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(601,'2015-10-05 07:11:22','USER_NEW_PASSWORD',1,'2015-10-05 09:11:22',1,'Password change for bbookkeeper','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(602,'2015-10-05 07:11:22','USER_MODIFY',1,'2015-10-05 09:11:22',1,'User bbookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(603,'2015-10-05 07:12:37','USER_MODIFY',1,'2015-10-05 09:12:37',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(604,'2015-10-05 07:13:27','USER_MODIFY',1,'2015-10-05 09:13:27',1,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(605,'2015-10-05 07:13:52','USER_MODIFY',1,'2015-10-05 09:13:52',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(606,'2015-10-05 07:14:35','USER_LOGOUT',1,'2015-10-05 09:14:35',1,'(UserLogoff,aeinstein)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(607,'2015-10-05 07:14:40','USER_LOGIN_FAILED',1,'2015-10-05 09:14:40',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(608,'2015-10-05 07:14:44','USER_LOGIN_FAILED',1,'2015-10-05 09:14:44',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(609,'2015-10-05 07:14:49','USER_LOGIN',1,'2015-10-05 09:14:49',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(610,'2015-10-05 07:57:18','USER_MODIFY',1,'2015-10-05 09:57:18',12,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(611,'2015-10-05 08:06:54','USER_LOGOUT',1,'2015-10-05 10:06:54',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(612,'2015-10-05 08:07:03','USER_LOGIN',1,'2015-10-05 10:07:03',11,'(UserLogged,atheceo) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(613,'2015-10-05 19:18:46','USER_LOGIN',1,'2015-10-05 21:18:46',11,'(UserLogged,atheceo) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(614,'2015-10-05 19:29:35','USER_CREATE',1,'2015-10-05 21:29:35',11,'User ccommercy created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(615,'2015-10-05 19:29:35','USER_NEW_PASSWORD',1,'2015-10-05 21:29:35',11,'Password change for ccommercy','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(616,'2015-10-05 19:30:13','GROUP_CREATE',1,'2015-10-05 21:30:13',11,'Group Commercial created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(617,'2015-10-05 19:31:37','USER_NEW_PASSWORD',1,'2015-10-05 21:31:37',11,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(618,'2015-10-05 19:31:37','USER_MODIFY',1,'2015-10-05 21:31:37',11,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(619,'2015-10-05 19:32:00','USER_MODIFY',1,'2015-10-05 21:32:00',11,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(620,'2015-10-05 19:33:33','USER_CREATE',1,'2015-10-05 21:33:33',11,'User sscientol created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(621,'2015-10-05 19:33:33','USER_NEW_PASSWORD',1,'2015-10-05 21:33:33',11,'Password change for sscientol','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(622,'2015-10-05 19:33:47','USER_NEW_PASSWORD',1,'2015-10-05 21:33:47',11,'Password change for mcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(623,'2015-10-05 19:33:47','USER_MODIFY',1,'2015-10-05 21:33:47',11,'User mcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(624,'2015-10-05 19:34:23','USER_NEW_PASSWORD',1,'2015-10-05 21:34:23',11,'Password change for pcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(625,'2015-10-05 19:34:23','USER_MODIFY',1,'2015-10-05 21:34:23',11,'User pcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(626,'2015-10-05 19:34:42','USER_MODIFY',1,'2015-10-05 21:34:42',11,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(627,'2015-10-05 19:36:06','USER_NEW_PASSWORD',1,'2015-10-05 21:36:06',11,'Password change for ccommercy','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(628,'2015-10-05 19:36:06','USER_MODIFY',1,'2015-10-05 21:36:06',11,'User ccommercy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(629,'2015-10-05 19:36:57','USER_NEW_PASSWORD',1,'2015-10-05 21:36:57',11,'Password change for atheceo','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(630,'2015-10-05 19:36:57','USER_MODIFY',1,'2015-10-05 21:36:57',11,'User atheceo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(631,'2015-10-05 19:37:27','USER_LOGOUT',1,'2015-10-05 21:37:27',11,'(UserLogoff,atheceo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(632,'2015-10-05 19:37:35','USER_LOGIN_FAILED',1,'2015-10-05 21:37:35',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(633,'2015-10-05 19:37:39','USER_LOGIN_FAILED',1,'2015-10-05 21:37:39',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(634,'2015-10-05 19:37:44','USER_LOGIN_FAILED',1,'2015-10-05 21:37:44',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(635,'2015-10-05 19:37:49','USER_LOGIN_FAILED',1,'2015-10-05 21:37:49',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(636,'2015-10-05 19:38:12','USER_LOGIN_FAILED',1,'2015-10-05 21:38:12',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(637,'2015-10-05 19:40:48','USER_LOGIN_FAILED',1,'2015-10-05 21:40:48',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(638,'2015-10-05 19:40:55','USER_LOGIN',1,'2015-10-05 21:40:55',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(639,'2015-10-05 19:43:34','USER_MODIFY',1,'2015-10-05 21:43:34',12,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(640,'2015-10-05 19:45:43','USER_CREATE',1,'2015-10-05 21:45:43',12,'User aaa created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(641,'2015-10-05 19:45:43','USER_NEW_PASSWORD',1,'2015-10-05 21:45:43',12,'Password change for aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(642,'2015-10-05 19:46:18','USER_DELETE',1,'2015-10-05 21:46:18',12,'User aaa removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(643,'2015-10-05 19:47:09','USER_MODIFY',1,'2015-10-05 21:47:09',12,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(644,'2015-10-05 19:47:22','USER_MODIFY',1,'2015-10-05 21:47:22',12,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(645,'2015-10-05 19:52:05','USER_MODIFY',1,'2015-10-05 21:52:05',12,'User sscientol modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(646,'2015-10-05 19:52:23','USER_MODIFY',1,'2015-10-05 21:52:23',12,'User bbookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(647,'2015-10-05 19:54:54','USER_NEW_PASSWORD',1,'2015-10-05 21:54:54',12,'Password change for zzeceo','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(648,'2015-10-05 19:54:54','USER_MODIFY',1,'2015-10-05 21:54:54',12,'User zzeceo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(649,'2015-10-05 19:57:02','USER_MODIFY',1,'2015-10-05 21:57:02',12,'User zzeceo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(650,'2015-10-05 19:57:57','USER_NEW_PASSWORD',1,'2015-10-05 21:57:57',12,'Password change for pcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(651,'2015-10-05 19:57:57','USER_MODIFY',1,'2015-10-05 21:57:57',12,'User pcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(652,'2015-10-05 19:59:42','USER_NEW_PASSWORD',1,'2015-10-05 21:59:42',12,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(653,'2015-10-05 19:59:42','USER_MODIFY',1,'2015-10-05 21:59:42',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(654,'2015-10-05 20:00:21','USER_MODIFY',1,'2015-10-05 22:00:21',12,'User adminx modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(655,'2015-10-05 20:05:36','USER_MODIFY',1,'2015-10-05 22:05:36',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(656,'2015-10-05 20:06:25','USER_MODIFY',1,'2015-10-05 22:06:25',12,'User ccommercy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(657,'2015-10-05 20:07:18','USER_MODIFY',1,'2015-10-05 22:07:18',12,'User mcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(658,'2015-10-05 20:07:36','USER_MODIFY',1,'2015-10-05 22:07:36',12,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(659,'2015-10-05 20:08:34','USER_MODIFY',1,'2015-10-05 22:08:34',12,'User bbookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(660,'2015-10-05 20:47:52','USER_CREATE',1,'2015-10-05 22:47:52',12,'User cc1 created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(661,'2015-10-05 20:47:52','USER_NEW_PASSWORD',1,'2015-10-05 22:47:52',12,'Password change for cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(662,'2015-10-05 20:47:55','USER_LOGOUT',1,'2015-10-05 22:47:55',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(663,'2015-10-05 20:48:08','USER_LOGIN',1,'2015-10-05 22:48:08',11,'(UserLogged,zzeceo) - TZ=1;TZString=Europe/Berlin;Screen=1590x434','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(664,'2015-10-05 20:48:39','USER_CREATE',1,'2015-10-05 22:48:39',11,'User cc2 created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(665,'2015-10-05 20:48:39','USER_NEW_PASSWORD',1,'2015-10-05 22:48:39',11,'Password change for cc2','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(666,'2015-10-05 20:48:59','USER_NEW_PASSWORD',1,'2015-10-05 22:48:59',11,'Password change for cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(667,'2015-10-05 20:48:59','USER_MODIFY',1,'2015-10-05 22:48:59',11,'User cc1 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(668,'2015-10-05 21:06:36','USER_LOGOUT',1,'2015-10-05 23:06:35',11,'(UserLogoff,zzeceo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(669,'2015-10-05 21:06:44','USER_LOGIN_FAILED',1,'2015-10-05 23:06:44',NULL,'Bad value for login or password - login=cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(670,'2015-10-05 21:07:12','USER_LOGIN_FAILED',1,'2015-10-05 23:07:12',NULL,'Bad value for login or password - login=cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(671,'2015-10-05 21:07:19','USER_LOGIN_FAILED',1,'2015-10-05 23:07:19',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(672,'2015-10-05 21:07:27','USER_LOGIN_FAILED',1,'2015-10-05 23:07:27',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(673,'2015-10-05 21:07:32','USER_LOGIN',1,'2015-10-05 23:07:32',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(674,'2015-10-05 21:12:28','USER_NEW_PASSWORD',1,'2015-10-05 23:12:28',12,'Password change for cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(675,'2015-10-05 21:12:28','USER_MODIFY',1,'2015-10-05 23:12:28',12,'User cc1 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(676,'2015-10-05 21:13:00','USER_CREATE',1,'2015-10-05 23:13:00',12,'User aaa created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(677,'2015-10-05 21:13:00','USER_NEW_PASSWORD',1,'2015-10-05 23:13:00',12,'Password change for aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(678,'2015-10-05 21:13:40','USER_DELETE',1,'2015-10-05 23:13:40',12,'User aaa removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(679,'2015-10-05 21:14:47','USER_LOGOUT',1,'2015-10-05 23:14:47',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(680,'2015-10-05 21:14:56','USER_LOGIN',1,'2015-10-05 23:14:56',16,'(UserLogged,cc1) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(681,'2015-10-05 21:15:56','USER_LOGOUT',1,'2015-10-05 23:15:56',16,'(UserLogoff,cc1)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(682,'2015-10-05 21:16:06','USER_LOGIN',1,'2015-10-05 23:16:06',17,'(UserLogged,cc2) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(683,'2015-10-05 21:37:25','USER_LOGOUT',1,'2015-10-05 23:37:25',17,'(UserLogoff,cc2)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(684,'2015-10-05 21:37:31','USER_LOGIN',1,'2015-10-05 23:37:31',16,'(UserLogged,cc1) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(685,'2015-10-05 21:43:53','USER_LOGOUT',1,'2015-10-05 23:43:53',16,'(UserLogoff,cc1)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(686,'2015-10-05 21:44:00','USER_LOGIN',1,'2015-10-05 23:44:00',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(687,'2015-10-05 21:46:17','USER_LOGOUT',1,'2015-10-05 23:46:17',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(688,'2015-10-05 21:46:24','USER_LOGIN',1,'2015-10-05 23:46:24',16,'(UserLogged,cc1) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(689,'2015-11-04 15:17:06','USER_LOGIN',1,'2015-11-04 16:17:06',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(690,'2015-11-15 22:04:04','USER_LOGIN',1,'2015-11-15 23:04:04',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(691,'2015-11-15 22:23:45','USER_MODIFY',1,'2015-11-15 23:23:45',12,'User ccommercy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(692,'2015-11-15 22:24:22','USER_MODIFY',1,'2015-11-15 23:24:22',12,'User cc1 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(693,'2015-11-15 22:24:53','USER_MODIFY',1,'2015-11-15 23:24:53',12,'User cc2 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(694,'2015-11-15 22:25:17','USER_MODIFY',1,'2015-11-15 23:25:17',12,'User cc1 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(695,'2015-11-15 22:45:37','USER_LOGOUT',1,'2015-11-15 23:45:37',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(696,'2015-11-18 13:41:02','USER_LOGIN',1,'2015-11-18 14:41:02',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(697,'2015-11-18 14:23:35','USER_LOGIN',1,'2015-11-18 15:23:35',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(698,'2015-11-18 15:15:46','USER_LOGOUT',1,'2015-11-18 16:15:46',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(699,'2015-11-18 15:15:51','USER_LOGIN',1,'2015-11-18 16:15:51',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(700,'2015-11-30 17:52:08','USER_LOGIN',1,'2015-11-30 18:52:08',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(701,'2016-01-10 16:45:43','USER_LOGIN',1,'2016-01-10 17:45:43',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(702,'2016-01-10 16:45:52','USER_LOGOUT',1,'2016-01-10 17:45:52',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(703,'2016-01-10 16:46:06','USER_LOGIN',1,'2016-01-10 17:46:06',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(704,'2016-01-16 14:53:47','USER_LOGIN',1,'2016-01-16 15:53:47',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(705,'2016-01-16 15:04:29','USER_LOGOUT',1,'2016-01-16 16:04:29',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(706,'2016-01-16 15:04:40','USER_LOGIN',1,'2016-01-16 16:04:40',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(707,'2016-01-22 09:33:26','USER_LOGIN',1,'2016-01-22 10:33:26',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(708,'2016-01-22 09:35:19','USER_LOGOUT',1,'2016-01-22 10:35:19',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(709,'2016-01-22 09:35:29','USER_LOGIN',1,'2016-01-22 10:35:29',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(710,'2016-01-22 10:47:34','USER_CREATE',1,'2016-01-22 11:47:34',12,'User aaa created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(711,'2016-01-22 10:47:34','USER_NEW_PASSWORD',1,'2016-01-22 11:47:34',12,'Password change for aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(712,'2016-01-22 12:07:56','USER_LOGIN',1,'2016-01-22 13:07:56',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(713,'2016-01-22 12:36:25','USER_NEW_PASSWORD',1,'2016-01-22 13:36:25',12,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(714,'2016-01-22 12:36:25','USER_MODIFY',1,'2016-01-22 13:36:25',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(715,'2016-01-22 12:56:32','USER_MODIFY',1,'2016-01-22 13:56:32',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(716,'2016-01-22 12:58:05','USER_MODIFY',1,'2016-01-22 13:58:05',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(717,'2016-01-22 13:01:02','USER_MODIFY',1,'2016-01-22 14:01:02',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(718,'2016-01-22 13:01:18','USER_MODIFY',1,'2016-01-22 14:01:18',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(719,'2016-01-22 13:13:42','USER_MODIFY',1,'2016-01-22 14:13:42',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(720,'2016-01-22 13:15:20','USER_DELETE',1,'2016-01-22 14:15:20',12,'User aaa removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(721,'2016-01-22 13:19:21','USER_LOGOUT',1,'2016-01-22 14:19:21',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(722,'2016-01-22 13:19:32','USER_LOGIN',1,'2016-01-22 14:19:32',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(723,'2016-01-22 13:19:51','USER_LOGOUT',1,'2016-01-22 14:19:51',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(724,'2016-01-22 13:20:01','USER_LOGIN',1,'2016-01-22 14:20:01',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(725,'2016-01-22 13:28:22','USER_LOGOUT',1,'2016-01-22 14:28:22',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(726,'2016-01-22 13:28:35','USER_LOGIN',1,'2016-01-22 14:28:35',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(727,'2016-01-22 13:33:54','USER_LOGOUT',1,'2016-01-22 14:33:54',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(728,'2016-01-22 13:34:05','USER_LOGIN',1,'2016-01-22 14:34:05',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(729,'2016-01-22 13:51:46','USER_MODIFY',1,'2016-01-22 14:51:46',12,'User ccommercy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(730,'2016-01-22 16:20:12','USER_LOGIN',1,'2016-01-22 17:20:12',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(731,'2016-01-22 16:20:22','USER_LOGOUT',1,'2016-01-22 17:20:22',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(732,'2016-01-22 16:20:36','USER_LOGIN',1,'2016-01-22 17:20:36',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(733,'2016-01-22 16:27:02','USER_CREATE',1,'2016-01-22 17:27:02',12,'User ldestailleur created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(734,'2016-01-22 16:27:02','USER_NEW_PASSWORD',1,'2016-01-22 17:27:02',12,'Password change for ldestailleur','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(735,'2016-01-22 16:28:34','USER_MODIFY',1,'2016-01-22 17:28:34',12,'User ldestailleur modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(736,'2016-01-22 16:30:01','USER_ENABLEDISABLE',1,'2016-01-22 17:30:01',12,'User cc2 activated','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(737,'2016-01-22 17:11:06','USER_LOGIN',1,'2016-01-22 18:11:06',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(738,'2016-01-22 18:00:02','USER_DELETE',1,'2016-01-22 19:00:02',12,'User zzz removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(739,'2016-01-22 18:01:40','USER_DELETE',1,'2016-01-22 19:01:40',12,'User aaab removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(740,'2016-01-22 18:01:52','USER_DELETE',1,'2016-01-22 19:01:52',12,'User zzzg removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(741,'2016-03-13 10:54:59','USER_LOGIN',1,'2016-03-13 14:54:59',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x971','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36',NULL),(742,'2016-07-30 11:13:10','USER_LOGIN',1,'2016-07-30 15:13:10',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(743,'2016-07-30 12:50:23','USER_CREATE',1,'2016-07-30 16:50:23',12,'User eldy created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(744,'2016-07-30 12:50:23','USER_CREATE',1,'2016-07-30 16:50:23',12,'User eldy created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(745,'2016-07-30 12:50:23','USER_NEW_PASSWORD',1,'2016-07-30 16:50:23',12,'Password change for eldy','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(746,'2016-07-30 12:50:38','USER_MODIFY',1,'2016-07-30 16:50:38',12,'User eldy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(747,'2016-07-30 12:50:54','USER_DELETE',1,'2016-07-30 16:50:54',12,'User eldy removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(748,'2016-07-30 12:51:23','USER_NEW_PASSWORD',1,'2016-07-30 16:51:23',12,'Password change for ldestailleur','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(749,'2016-07-30 12:51:23','USER_MODIFY',1,'2016-07-30 16:51:23',12,'User ldestailleur modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(750,'2016-07-30 18:26:58','USER_LOGIN',1,'2016-07-30 22:26:58',18,'(UserLogged,ldestailleur) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(751,'2016-07-30 18:27:40','USER_LOGOUT',1,'2016-07-30 22:27:40',18,'(UserLogoff,ldestailleur)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(752,'2016-07-30 18:27:47','USER_LOGIN',1,'2016-07-30 22:27:47',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(753,'2016-07-30 19:00:00','USER_LOGOUT',1,'2016-07-30 23:00:00',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(754,'2016-07-30 19:00:04','USER_LOGIN',1,'2016-07-30 23:00:04',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(755,'2016-07-30 19:00:14','USER_LOGOUT',1,'2016-07-30 23:00:14',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(756,'2016-07-30 19:00:19','USER_LOGIN',1,'2016-07-30 23:00:19',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(757,'2016-07-30 19:00:43','USER_LOGOUT',1,'2016-07-30 23:00:43',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(758,'2016-07-30 19:00:48','USER_LOGIN',1,'2016-07-30 23:00:48',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(759,'2016-07-30 19:03:52','USER_LOGOUT',1,'2016-07-30 23:03:52',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(760,'2016-07-30 19:03:57','USER_LOGIN_FAILED',1,'2016-07-30 23:03:57',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(761,'2016-07-30 19:03:59','USER_LOGIN',1,'2016-07-30 23:03:59',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(762,'2016-07-30 19:04:13','USER_LOGOUT',1,'2016-07-30 23:04:13',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(763,'2016-07-30 19:04:17','USER_LOGIN',1,'2016-07-30 23:04:17',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(764,'2016-07-30 19:04:26','USER_LOGOUT',1,'2016-07-30 23:04:26',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(765,'2016-07-30 19:04:31','USER_LOGIN',1,'2016-07-30 23:04:31',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(766,'2016-07-30 19:10:50','USER_LOGOUT',1,'2016-07-30 23:10:50',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(767,'2016-07-30 19:10:54','USER_LOGIN',1,'2016-07-30 23:10:54',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(768,'2016-07-31 10:15:52','USER_LOGIN',1,'2016-07-31 14:15:52',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Lynx/2.8.8pre.4 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.23',NULL),(769,'2016-07-31 10:16:27','USER_LOGIN',1,'2016-07-31 14:16:27',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(770,'2016-07-31 10:32:14','USER_LOGIN',1,'2016-07-31 14:32:14',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Lynx/2.8.8pre.4 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.23',NULL),(771,'2016-07-31 10:36:28','USER_LOGIN',1,'2016-07-31 14:36:28',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Links (2.8; Linux 3.19.0-46-generic x86_64; GNU C 4.8.2; text)',NULL),(772,'2016-07-31 10:40:10','USER_LOGIN',1,'2016-07-31 14:40:10',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Links (2.8; Linux 3.19.0-46-generic x86_64; GNU C 4.8.2; text)',NULL),(773,'2016-07-31 10:54:16','USER_LOGIN',1,'2016-07-31 14:54:16',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Lynx/2.8.8pre.4 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.23',NULL),(774,'2016-07-31 12:52:52','USER_LOGIN',1,'2016-07-31 16:52:52',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x592','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(775,'2016-07-31 13:25:33','USER_LOGOUT',1,'2016-07-31 17:25:33',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(776,'2016-07-31 13:26:32','USER_LOGIN',1,'2016-07-31 17:26:32',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1280x751','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(777,'2016-07-31 14:13:57','USER_LOGOUT',1,'2016-07-31 18:13:57',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(778,'2016-07-31 14:14:04','USER_LOGIN',1,'2016-07-31 18:14:04',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(779,'2016-07-31 16:04:35','USER_LOGIN',1,'2016-07-31 20:04:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(780,'2016-07-31 21:14:14','USER_LOGIN',1,'2016-08-01 01:14:14',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(781,'2017-01-29 15:14:05','USER_LOGOUT',1,'2017-01-29 19:14:05',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(782,'2017-01-29 15:34:43','USER_LOGIN',1,'2017-01-29 19:34:43',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x571','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(783,'2017-01-29 15:35:04','USER_LOGOUT',1,'2017-01-29 19:35:04',12,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(784,'2017-01-29 15:35:12','USER_LOGIN',1,'2017-01-29 19:35:12',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(785,'2017-01-29 15:36:43','USER_LOGOUT',1,'2017-01-29 19:36:43',12,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(786,'2017-01-29 15:41:21','USER_LOGIN',1,'2017-01-29 19:41:21',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x571','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(787,'2017-01-29 15:41:41','USER_LOGOUT',1,'2017-01-29 19:41:41',12,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(788,'2017-01-29 15:42:43','USER_LOGIN',1,'2017-01-29 19:42:43',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x571','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(789,'2017-01-29 15:43:18','USER_LOGOUT',1,'2017-01-29 19:43:18',12,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(790,'2017-01-29 15:46:31','USER_LOGIN',1,'2017-01-29 19:46:31',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x571','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(791,'2017-01-29 16:18:56','USER_LOGIN',1,'2017-01-29 20:18:56',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=360x526','192.168.0.254','Mozilla/5.0 (Linux; Android 6.0; LG-H818 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36 - DoliDroid - Android client pour Dolibarr ERP-CRM',NULL),(792,'2017-01-29 17:20:59','USER_LOGIN',1,'2017-01-29 21:20:59',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(793,'2017-01-30 11:19:40','USER_LOGIN',1,'2017-01-30 15:19:40',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(794,'2017-01-31 16:49:39','USER_LOGIN',1,'2017-01-31 20:49:39',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x520','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(795,'2017-02-01 10:55:23','USER_LOGIN',1,'2017-02-01 14:55:23',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(796,'2017-02-01 13:34:31','USER_LOGIN',1,'2017-02-01 17:34:31',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(797,'2017-02-01 14:41:26','USER_LOGIN',1,'2017-02-01 18:41:26',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(798,'2017-02-01 23:51:48','USER_LOGIN_FAILED',1,'2017-02-02 03:51:48',NULL,'Bad value for login or password - login=autologin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(799,'2017-02-01 23:52:55','USER_LOGIN',1,'2017-02-02 03:52:55',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(800,'2017-02-01 23:55:45','USER_CREATE',1,'2017-02-02 03:55:45',12,'User aboston created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(801,'2017-02-01 23:55:45','USER_NEW_PASSWORD',1,'2017-02-02 03:55:45',12,'Password change for aboston','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(802,'2017-02-01 23:56:38','USER_MODIFY',1,'2017-02-02 03:56:38',12,'User aboston modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(803,'2017-02-01 23:56:50','USER_MODIFY',1,'2017-02-02 03:56:50',12,'User aboston modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(804,'2017-02-02 01:14:44','USER_LOGIN',1,'2017-02-02 05:14:44',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(805,'2017-02-03 10:27:18','USER_LOGIN',1,'2017-02-03 14:27:18',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(806,'2017-02-04 10:22:34','USER_LOGIN',1,'2017-02-04 14:22:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x489','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(807,'2017-02-06 04:01:31','USER_LOGIN',1,'2017-02-06 08:01:31',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(808,'2017-02-06 10:21:32','USER_LOGIN',1,'2017-02-06 14:21:32',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(809,'2017-02-06 19:09:27','USER_LOGIN',1,'2017-02-06 23:09:27',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(810,'2017-02-06 23:39:17','USER_LOGIN',1,'2017-02-07 03:39:17',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(811,'2017-02-07 11:36:34','USER_LOGIN',1,'2017-02-07 15:36:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x676','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(812,'2017-02-07 18:51:53','USER_LOGIN',1,'2017-02-07 22:51:53',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(813,'2017-02-07 23:13:40','USER_LOGIN',1,'2017-02-08 03:13:40',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(814,'2017-02-08 09:29:12','USER_LOGIN',1,'2017-02-08 13:29:12',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(815,'2017-02-08 17:33:12','USER_LOGIN',1,'2017-02-08 21:33:12',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(816,'2017-02-09 17:30:34','USER_LOGIN',1,'2017-02-09 21:30:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(817,'2017-02-10 09:30:02','USER_LOGIN',1,'2017-02-10 13:30:02',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(818,'2017-02-10 16:16:14','USER_LOGIN',1,'2017-02-10 20:16:14',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(819,'2017-02-10 17:28:15','USER_LOGIN',1,'2017-02-10 21:28:15',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(820,'2017-02-11 12:54:03','USER_LOGIN',1,'2017-02-11 16:54:03',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(821,'2017-02-11 17:23:52','USER_LOGIN',1,'2017-02-11 21:23:52',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(822,'2017-02-12 12:44:03','USER_LOGIN',1,'2017-02-12 16:44:03',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(823,'2017-02-12 16:42:13','USER_LOGIN',1,'2017-02-12 20:42:13',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(824,'2017-02-12 19:14:18','USER_LOGIN',1,'2017-02-12 23:14:18',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(825,'2017-02-15 17:17:00','USER_LOGIN',1,'2017-02-15 21:17:00',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(826,'2017-02-15 22:02:40','USER_LOGIN',1,'2017-02-16 02:02:40',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(827,'2017-02-16 22:13:27','USER_LOGIN',1,'2017-02-17 02:13:27',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x619','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(828,'2017-02-16 23:54:04','USER_LOGIN',1,'2017-02-17 03:54:04',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(829,'2017-02-17 09:14:27','USER_LOGIN',1,'2017-02-17 13:14:27',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(830,'2017-02-17 12:07:05','USER_LOGIN',1,'2017-02-17 16:07:05',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(831,'2017-02-19 21:22:20','USER_LOGIN',1,'2017-02-20 01:22:20',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(832,'2017-02-20 09:26:47','USER_LOGIN',1,'2017-02-20 13:26:47',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(833,'2017-02-20 16:39:55','USER_LOGIN',1,'2017-02-20 20:39:55',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(834,'2017-02-20 16:49:00','USER_MODIFY',1,'2017-02-20 20:49:00',12,'Modification utilisateur ccommerson','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(835,'2017-02-20 17:57:15','USER_LOGIN',1,'2017-02-20 21:57:14',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(836,'2017-02-20 19:43:48','USER_LOGIN',1,'2017-02-20 23:43:48',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(837,'2017-02-21 00:04:05','USER_LOGIN',1,'2017-02-21 04:04:05',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(838,'2017-02-21 10:23:13','USER_LOGIN',1,'2017-02-21 14:23:13',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(839,'2017-02-21 10:30:17','USER_LOGOUT',1,'2017-02-21 14:30:17',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(840,'2017-02-21 10:30:22','USER_LOGIN',1,'2017-02-21 14:30:22',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(841,'2017-02-21 11:44:05','USER_LOGIN',1,'2017-02-21 15:44:05',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(842,'2017-05-12 09:02:48','USER_LOGIN',1,'2017-05-12 13:02:48',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36',NULL),(843,'2017-08-27 13:29:16','USER_LOGIN',1,'2017-08-27 17:29:16',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL),(844,'2017-08-28 09:11:07','USER_LOGIN',1,'2017-08-28 13:11:07',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL),(845,'2017-08-28 10:08:58','USER_LOGIN',1,'2017-08-28 14:08:58',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL),(846,'2017-08-28 10:12:46','USER_MODIFY',1,'2017-08-28 14:12:46',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL),(847,'2017-08-28 10:28:25','USER_LOGIN',1,'2017-08-28 14:28:25',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL),(848,'2017-08-28 10:28:36','USER_LOGOUT',1,'2017-08-28 14:28:36',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL),(849,'2017-08-28 10:34:50','USER_LOGIN',1,'2017-08-28 14:34:50',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL),(850,'2017-08-28 11:59:02','USER_LOGIN',1,'2017-08-28 15:59:02',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL),(851,'2017-08-29 09:57:34','USER_LOGIN',1,'2017-08-29 13:57:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(852,'2017-08-29 11:05:51','USER_LOGIN',1,'2017-08-29 15:05:51',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(853,'2017-08-29 14:15:58','USER_LOGIN',1,'2017-08-29 18:15:58',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(854,'2017-08-29 17:49:28','USER_LOGIN',1,'2017-08-29 21:49:28',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(855,'2017-08-30 11:53:25','USER_LOGIN',1,'2017-08-30 15:53:25',18,'(UserLogged,ldestailleur) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(856,'2017-08-30 12:19:31','USER_MODIFY',1,'2017-08-30 16:19:31',18,'Modification utilisateur ldestailleur - UserRemovedFromGroup','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(857,'2017-08-30 12:19:32','USER_MODIFY',1,'2017-08-30 16:19:32',18,'Modification utilisateur ldestailleur - UserRemovedFromGroup','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(858,'2017-08-30 12:19:33','USER_MODIFY',1,'2017-08-30 16:19:33',18,'Modification utilisateur ldestailleur - UserRemovedFromGroup','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(859,'2017-08-30 12:21:42','USER_LOGOUT',1,'2017-08-30 16:21:42',18,'(UserLogoff,ldestailleur)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(860,'2017-08-30 12:21:48','USER_LOGIN',1,'2017-08-30 16:21:48',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(861,'2017-08-30 15:02:06','USER_LOGIN',1,'2017-08-30 19:02:06',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(862,'2017-08-31 09:25:42','USER_LOGIN',1,'2017-08-31 13:25:42',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(863,'2017-09-04 07:51:21','USER_LOGIN',1,'2017-09-04 11:51:21',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x577','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(864,'2017-09-04 09:17:09','USER_LOGIN',1,'2017-09-04 13:17:09',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(865,'2017-09-04 13:40:28','USER_LOGIN',1,'2017-09-04 17:40:28',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(866,'2017-09-06 07:55:30','USER_LOGIN',1,'2017-09-06 11:55:30',18,'(UserLogged,ldestailleur) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(867,'2017-09-06 07:55:33','USER_LOGOUT',1,'2017-09-06 11:55:33',18,'(UserLogoff,ldestailleur)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(868,'2017-09-06 07:55:38','USER_LOGIN',1,'2017-09-06 11:55:38',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(869,'2017-09-06 16:03:38','USER_LOGIN',1,'2017-09-06 20:03:38',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL),(870,'2017-09-06 19:43:07','USER_LOGIN',1,'2017-09-06 23:43:07',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',NULL); +/*!40000 ALTER TABLE `llx_events` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expedition` +-- + +DROP TABLE IF EXISTS `llx_expedition`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expedition` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_customer` varchar(30) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `ref_ext` varchar(30) DEFAULT NULL, + `ref_int` varchar(30) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_expedition` datetime DEFAULT NULL, + `date_delivery` datetime DEFAULT NULL, + `fk_address` int(11) DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `tracking_number` varchar(50) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `height` float DEFAULT NULL, + `height_unit` int(11) DEFAULT NULL, + `width` float DEFAULT NULL, + `size_units` int(11) DEFAULT NULL, + `size` float DEFAULT NULL, + `weight_units` int(11) DEFAULT NULL, + `weight` float DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `billed` smallint(6) DEFAULT '0', + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_expedition_uk_ref` (`ref`,`entity`), + KEY `idx_expedition_fk_soc` (`fk_soc`), + KEY `idx_expedition_fk_user_author` (`fk_user_author`), + KEY `idx_expedition_fk_user_valid` (`fk_user_valid`), + KEY `idx_expedition_fk_shipping_method` (`fk_shipping_method`), + CONSTRAINT `fk_expedition_fk_shipping_method` FOREIGN KEY (`fk_shipping_method`) REFERENCES `llx_c_shipment_mode` (`rowid`), + CONSTRAINT `fk_expedition_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_expedition_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_expedition_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expedition` +-- + +LOCK TABLES `llx_expedition` WRITE; +/*!40000 ALTER TABLE `llx_expedition` DISABLE KEYS */; +INSERT INTO `llx_expedition` VALUES (1,'2016-01-22 17:33:03','SH1302-0001',1,NULL,1,NULL,NULL,NULL,'2011-08-08 03:05:34',1,'2013-02-17 18:22:51',1,NULL,'2011-08-09 00:00:00',NULL,NULL,'',1,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,'merou',NULL,NULL,NULL,NULL,0,NULL),(2,'2017-02-15 23:11:35','(PROV2)',1,NULL,4,NULL,NULL,NULL,'2017-02-16 03:11:35',12,NULL,NULL,NULL,NULL,NULL,1,'',0,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,'merou',0,'',NULL,NULL,0,NULL); +/*!40000 ALTER TABLE `llx_expedition` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expedition_extrafields` +-- + +DROP TABLE IF EXISTS `llx_expedition_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expedition_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_expedition_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expedition_extrafields` +-- + +LOCK TABLES `llx_expedition_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_expedition_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_expedition_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expedition_methode` +-- + +DROP TABLE IF EXISTS `llx_expedition_methode`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expedition_methode` ( + `rowid` int(11) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `code` varchar(30) NOT NULL, + `libelle` varchar(50) NOT NULL, + `description` text, + `active` tinyint(4) DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expedition_methode` +-- + +LOCK TABLES `llx_expedition_methode` WRITE; +/*!40000 ALTER TABLE `llx_expedition_methode` DISABLE KEYS */; +INSERT INTO `llx_expedition_methode` VALUES (1,'2010-07-08 11:18:00','CATCH','Catch','Catch by client',1),(2,'2010-07-08 11:18:00','TRANS','Transporter','Generic transporter',1),(3,'2010-07-08 11:18:01','COLSUI','Colissimo Suivi','Colissimo Suivi',0); +/*!40000 ALTER TABLE `llx_expedition_methode` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expeditiondet` +-- + +DROP TABLE IF EXISTS `llx_expeditiondet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expeditiondet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expedition` int(11) NOT NULL, + `fk_origin_line` int(11) DEFAULT NULL, + `fk_entrepot` int(11) DEFAULT NULL, + `qty` double DEFAULT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_expeditiondet_fk_expedition` (`fk_expedition`), + CONSTRAINT `fk_expeditiondet_fk_expedition` FOREIGN KEY (`fk_expedition`) REFERENCES `llx_expedition` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expeditiondet` +-- + +LOCK TABLES `llx_expeditiondet` WRITE; +/*!40000 ALTER TABLE `llx_expeditiondet` DISABLE KEYS */; +INSERT INTO `llx_expeditiondet` VALUES (1,1,10,3,1,0),(2,2,226,19,2,0); +/*!40000 ALTER TABLE `llx_expeditiondet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expeditiondet_batch` +-- + +DROP TABLE IF EXISTS `llx_expeditiondet_batch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expeditiondet_batch` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expeditiondet` int(11) NOT NULL, + `eatby` date DEFAULT NULL, + `sellby` date DEFAULT NULL, + `batch` varchar(30) DEFAULT NULL, + `qty` double NOT NULL DEFAULT '0', + `fk_origin_stock` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_fk_expeditiondet` (`fk_expeditiondet`), + CONSTRAINT `fk_expeditiondet_batch_fk_expeditiondet` FOREIGN KEY (`fk_expeditiondet`) REFERENCES `llx_expeditiondet` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expeditiondet_batch` +-- + +LOCK TABLES `llx_expeditiondet_batch` WRITE; +/*!40000 ALTER TABLE `llx_expeditiondet_batch` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_expeditiondet_batch` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expeditiondet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_expeditiondet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expeditiondet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_expeditiondet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expeditiondet_extrafields` +-- + +LOCK TABLES `llx_expeditiondet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_expeditiondet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_expeditiondet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expensereport` +-- + +DROP TABLE IF EXISTS `llx_expensereport`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expensereport` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(50) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_number_int` int(11) DEFAULT NULL, + `ref_ext` int(11) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `date_debut` date NOT NULL, + `date_fin` date NOT NULL, + `date_create` datetime NOT NULL, + `date_valid` datetime DEFAULT NULL, + `date_approve` datetime DEFAULT NULL, + `date_refuse` datetime DEFAULT NULL, + `date_cancel` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_author` int(11) NOT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_validator` int(11) DEFAULT NULL, + `fk_user_approve` int(11) DEFAULT NULL, + `fk_user_refuse` int(11) DEFAULT NULL, + `fk_user_cancel` int(11) DEFAULT NULL, + `fk_statut` int(11) NOT NULL, + `fk_c_paiement` int(11) DEFAULT NULL, + `paid` smallint(6) NOT NULL DEFAULT '0', + `note_public` text, + `note_private` text, + `detail_refuse` varchar(255) DEFAULT NULL, + `detail_cancel` varchar(255) DEFAULT NULL, + `integration_compta` int(11) DEFAULT NULL, + `fk_bank_account` int(11) DEFAULT NULL, + `model_pdf` varchar(50) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_expensereport_uk_ref` (`ref`,`entity`), + KEY `idx_expensereport_date_debut` (`date_debut`), + KEY `idx_expensereport_date_fin` (`date_fin`), + KEY `idx_expensereport_fk_statut` (`fk_statut`), + KEY `idx_expensereport_fk_user_author` (`fk_user_author`), + KEY `idx_expensereport_fk_user_valid` (`fk_user_valid`), + KEY `idx_expensereport_fk_user_approve` (`fk_user_approve`), + KEY `idx_expensereport_fk_refuse` (`fk_user_approve`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expensereport` +-- + +LOCK TABLES `llx_expensereport` WRITE; +/*!40000 ALTER TABLE `llx_expensereport` DISABLE KEYS */; +INSERT INTO `llx_expensereport` VALUES (1,'ADMIN-ER00002-150101',1,2,NULL,8.33000000,1.67000000,0.00000000,0.00000000,10.00000000,'2015-01-01','2015-01-03','2016-01-22 19:03:37','2016-01-22 19:06:50','2017-02-16 02:12:40',NULL,NULL,'2017-02-15 22:12:40',12,NULL,12,12,12,NULL,NULL,5,NULL,0,'Holidays',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL),(2,'(PROV2)',1,NULL,NULL,141.67000000,28.33000000,0.00000000,0.00000000,170.00000000,'2015-02-01','2015-02-28','2016-01-22 19:04:44',NULL,NULL,NULL,NULL,'2016-01-22 18:06:21',12,12,NULL,12,NULL,NULL,NULL,0,NULL,0,'Work on projet X','','',NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL),(3,'(PROV3)',1,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'2017-02-02','2017-02-02','2017-02-02 03:57:03',NULL,NULL,NULL,NULL,'2017-02-01 23:57:03',19,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL); +/*!40000 ALTER TABLE `llx_expensereport` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expensereport_det` +-- + +DROP TABLE IF EXISTS `llx_expensereport_det`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expensereport_det` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expensereport` int(11) NOT NULL, + `fk_c_type_fees` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `comments` text NOT NULL, + `product_type` int(11) DEFAULT '-1', + `qty` double NOT NULL, + `value_unit` double NOT NULL, + `remise_percent` double DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT NULL, + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) DEFAULT NULL, + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) DEFAULT NULL, + `total_ht` double(24,8) NOT NULL DEFAULT '0.00000000', + `total_tva` double(24,8) NOT NULL DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) NOT NULL DEFAULT '0.00000000', + `date` date NOT NULL, + `info_bits` int(11) DEFAULT '0', + `special_code` int(11) DEFAULT '0', + `rang` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_facture` int(11) DEFAULT '0', + `fk_code_ventilation` int(11) DEFAULT '0', + `vat_src_code` varchar(10) DEFAULT '', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expensereport_det` +-- + +LOCK TABLES `llx_expensereport_det` WRITE; +/*!40000 ALTER TABLE `llx_expensereport_det` DISABLE KEYS */; +INSERT INTO `llx_expensereport_det` VALUES (1,1,3,1,'',-1,1,10,NULL,20.000,0.000,NULL,0.000,NULL,8.33000000,1.67000000,0.00000000,0.00000000,10.00000000,'2015-01-01',0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0,0,''),(2,2,3,4,'',-1,1,20,NULL,20.000,0.000,NULL,0.000,NULL,16.67000000,3.33000000,0.00000000,0.00000000,20.00000000,'2015-01-07',0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0,0,''),(3,2,2,5,'Train',-1,1,150,NULL,20.000,0.000,NULL,0.000,NULL,125.00000000,25.00000000,0.00000000,0.00000000,150.00000000,'2015-02-05',0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0,0,''); +/*!40000 ALTER TABLE `llx_expensereport_det` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expensereport_extrafields` +-- + +DROP TABLE IF EXISTS `llx_expensereport_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expensereport_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_expensereport_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expensereport_extrafields` +-- + +LOCK TABLES `llx_expensereport_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_expensereport_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_expensereport_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_export_compta` +-- + +DROP TABLE IF EXISTS `llx_export_compta`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_export_compta` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(12) NOT NULL, + `date_export` datetime NOT NULL, + `fk_user` int(11) NOT NULL, + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_export_compta` +-- + +LOCK TABLES `llx_export_compta` WRITE; +/*!40000 ALTER TABLE `llx_export_compta` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_export_compta` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_export_model` +-- + +DROP TABLE IF EXISTS `llx_export_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_export_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL DEFAULT '0', + `label` varchar(50) NOT NULL, + `type` varchar(20) NOT NULL, + `field` text NOT NULL, + `filter` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_export_model` (`label`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_export_model` +-- + +LOCK TABLES `llx_export_model` WRITE; +/*!40000 ALTER TABLE `llx_export_model` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_export_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_extrafields` +-- + +DROP TABLE IF EXISTS `llx_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `elementtype` varchar(64) NOT NULL DEFAULT 'member', + `name` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) NOT NULL, + `type` varchar(8) DEFAULT NULL, + `size` varchar(8) DEFAULT NULL, + `pos` int(11) DEFAULT '0', + `alwayseditable` int(11) DEFAULT '0', + `param` text, + `fieldunique` int(11) DEFAULT '0', + `fieldrequired` int(11) DEFAULT '0', + `perms` varchar(255) DEFAULT NULL, + `list` int(11) DEFAULT '0', + `ishidden` int(11) DEFAULT '0', + `fieldcomputed` text, + `fielddefault` varchar(255) DEFAULT NULL, + `langs` varchar(24) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_extrafields_name` (`name`,`entity`,`elementtype`) +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_extrafields` +-- + +LOCK TABLES `llx_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_extrafields` DISABLE KEYS */; +INSERT INTO `llx_extrafields` VALUES (2,'adherent','zzz',1,'2013-09-08 23:04:20','zzz','varchar','255',0,0,NULL,0,0,NULL,0,0,NULL,NULL,NULL),(27,'projet','priority',1,'2016-07-30 11:28:27','Priority','select','',0,1,'a:1:{s:7:\"options\";a:5:{i:1;s:1:\"1\";i:2;s:1:\"2\";i:3;s:1:\"3\";i:4;s:1:\"4\";i:5;s:1:\"5\";}}',0,0,NULL,0,0,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture` +-- + +DROP TABLE IF EXISTS `llx_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `facnumber` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `type` smallint(6) NOT NULL DEFAULT '0', + `ref_client` varchar(255) DEFAULT NULL, + `increment` varchar(10) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `date_valid` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `paye` smallint(6) NOT NULL DEFAULT '0', + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `close_code` varchar(16) DEFAULT NULL, + `close_note` varchar(128) DEFAULT NULL, + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `revenuestamp` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(3) DEFAULT NULL, + `fk_cond_reglement` int(11) NOT NULL DEFAULT '1', + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `situation_cycle_ref` smallint(6) DEFAULT NULL, + `situation_counter` smallint(6) DEFAULT NULL, + `situation_final` smallint(6) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `date_pointoftax` date DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_fac_rec_source` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_facture_uk_facnumber` (`facnumber`,`entity`), + KEY `idx_facture_fk_soc` (`fk_soc`), + KEY `idx_facture_fk_user_author` (`fk_user_author`), + KEY `idx_facture_fk_user_valid` (`fk_user_valid`), + KEY `idx_facture_fk_facture_source` (`fk_facture_source`), + KEY `idx_facture_fk_projet` (`fk_projet`), + KEY `idx_facture_fk_account` (`fk_account`), + KEY `idx_facture_fk_currency` (`fk_currency`), + KEY `idx_facture_fk_statut` (`fk_statut`), + CONSTRAINT `fk_facture_fk_facture_source` FOREIGN KEY (`fk_facture_source`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_facture_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_facture_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=218 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture` +-- + +LOCK TABLES `llx_facture` WRITE; +/*!40000 ALTER TABLE `llx_facture` DISABLE KEYS */; +INSERT INTO `llx_facture` VALUES (2,'FA1007-0002',1,NULL,NULL,0,NULL,NULL,2,'2010-07-10 18:20:13','2016-07-10',NULL,'2016-07-30 15:13:20',1,10.00000000,NULL,NULL,0,NULL,NULL,0.10000000,0.00000000,0.00000000,0.00000000,46.00000000,46.10000000,2,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2016-07-10',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(3,'FA1107-0006',1,NULL,NULL,0,NULL,NULL,10,'2011-07-18 20:33:35','2016-07-18',NULL,'2016-07-30 15:13:20',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,15.00000000,15.00000000,2,1,NULL,1,NULL,1,NULL,NULL,1,0,'2016-07-18',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(5,'FA1108-0003',1,NULL,NULL,0,NULL,NULL,7,'2011-08-01 03:34:11','2015-08-01',NULL,'2016-07-30 15:12:32',1,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,2,1,NULL,1,NULL,NULL,NULL,NULL,0,6,'2015-08-01',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(6,'FA1108-0004',1,NULL,NULL,0,NULL,NULL,7,'2011-08-06 20:33:53','2015-08-06',NULL,'2016-07-30 15:12:32',1,0.00000000,NULL,NULL,0,NULL,NULL,0.98000000,0.00000000,0.00000000,0.00000000,5.00000000,5.98000000,2,1,NULL,1,NULL,NULL,NULL,NULL,0,4,'2015-08-06','Cash\nReceived : 6 EUR\nRendu : 0.02 EUR\n\n--------------------------------------',NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(8,'FA1108-0005',1,NULL,NULL,3,NULL,NULL,2,'2011-08-08 02:41:44','2015-08-08',NULL,'2016-07-30 15:12:32',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-08-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(9,'FA1108-0007',1,NULL,NULL,3,NULL,NULL,10,'2011-08-08 02:55:14','2015-08-08',NULL,'2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,1.96000000,0.00000000,0.00000000,0.00000000,10.00000000,11.96000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-08-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(10,'AV1212-0001',1,NULL,NULL,2,NULL,NULL,10,'2012-12-08 17:45:20','2015-12-08','2015-12-08','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,-0.63000000,0.00000000,0.00000000,0.00000000,-11.00000000,-11.63000000,1,1,NULL,1,3,NULL,NULL,NULL,0,0,'2015-12-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(12,'AV1212-0002',1,NULL,NULL,2,NULL,NULL,10,'2012-12-08 18:20:14','2015-12-08','2015-12-08','2016-07-30 15:12:32',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,-5.00000000,2,1,NULL,1,3,NULL,NULL,NULL,0,0,'2015-12-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(13,'FA1212-0011',1,NULL,NULL,0,NULL,NULL,7,'2012-12-09 20:04:19','2015-12-09','2016-02-12','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,2.74000000,0.00000000,0.00000000,0.00000000,14.00000000,16.74000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-12-09',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(32,'FA1212-0021',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:34:23','2015-12-11','2016-03-24','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,90.00000000,0.00000000,0.00000000,0.60000000,520.00000000,610.60000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(33,'FA1212-0023',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:34:23','2015-12-11','2017-03-03','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,'abandon',NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,3,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(55,'FA1212-0009',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:35:51','2015-12-11','2015-12-12','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-12-11','This is a comment (private)','This is a comment (public)','generic_invoice_odt:/home/ldestailleur/git/dolibarr_3.8/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(148,'FS1301-0001',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:22:48','2016-01-19','2016-01-19','2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,1,1,NULL,1,NULL,NULL,NULL,NULL,0,1,'2016-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(149,'FA1601-0024',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:30:05','2016-01-19','2017-08-29','2017-08-29 18:39:09',0,0.00000000,NULL,NULL,0,NULL,NULL,1.80000000,0.90000000,0.90000000,0.00000000,20.00000000,23.60000000,1,1,NULL,12,NULL,NULL,NULL,NULL,0,0,'2016-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,20.00000000,1.80000000,23.60000000,NULL),(150,'FA6801-0010',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:31:10','2016-01-19','2016-01-19','2016-07-30 15:13:20',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,0,1,'2016-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(151,'FS1301-0002',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:31:58','2016-01-19','2016-01-19','2016-07-30 15:13:20',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,0,1,'2016-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(160,'FA1507-0015',1,NULL,NULL,0,NULL,NULL,12,'2013-03-06 16:47:48','2016-07-18','2014-03-06','2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,1.11000000,0.00000000,0.00000000,0.00000000,8.89000000,10.00000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2016-07-18',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(210,'FA1107-0019',1,NULL,NULL,0,NULL,NULL,10,'2013-03-20 14:30:11','2016-07-10','2018-03-20','2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2016-07-10',NULL,NULL,'generic_invoice_odt:/home/ldestailleur/git/dolibarr_3.8/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(211,'FA1303-0020',1,NULL,NULL,0,NULL,NULL,19,'2013-03-22 09:40:10','2016-03-22','2017-03-02','2017-02-06 04:11:17',0,0.00000000,NULL,NULL,0,NULL,NULL,17.64000000,0.00000000,0.00000000,0.40000000,340.00000000,358.04000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,3,'2016-03-22',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(213,'AV1303-0003',1,NULL,NULL,2,NULL,NULL,1,'2014-03-03 19:22:03','2016-03-03','2017-03-03','2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-1000.00000000,-1000.00000000,1,1,NULL,1,32,NULL,NULL,NULL,0,0,'2016-03-03',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(216,'(PROV216)',1,NULL,NULL,0,NULL,NULL,26,'2017-02-12 23:21:27','2017-02-12',NULL,'2017-02-12 19:21:27',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2017-02-12',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,'',NULL,0,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,NULL),(217,'(PROV217)',1,NULL,NULL,0,NULL,NULL,1,'2017-08-31 13:26:17','2017-08-31',NULL,'2017-08-31 09:26:17',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2017-08-31',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,'',NULL,1,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,NULL); +/*!40000 ALTER TABLE `llx_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facture_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facture_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_extrafields` +-- + +LOCK TABLES `llx_facture_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facture_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(255) NOT NULL, + `ref_supplier` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `type` smallint(6) NOT NULL DEFAULT '0', + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `libelle` varchar(255) DEFAULT NULL, + `paye` smallint(6) NOT NULL DEFAULT '0', + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise` double(24,8) DEFAULT '0.00000000', + `close_code` varchar(16) DEFAULT NULL, + `close_note` varchar(128) DEFAULT NULL, + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_facture_fourn_ref` (`ref`,`entity`), + UNIQUE KEY `uk_facture_fourn_ref_supplier` (`ref_supplier`,`fk_soc`,`entity`), + KEY `idx_facture_fourn_date_lim_reglement` (`date_lim_reglement`), + KEY `idx_facture_fourn_fk_soc` (`fk_soc`), + KEY `idx_facture_fourn_fk_user_author` (`fk_user_author`), + KEY `idx_facture_fourn_fk_user_valid` (`fk_user_valid`), + KEY `idx_facture_fourn_fk_projet` (`fk_projet`), + CONSTRAINT `fk_facture_fourn_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn` +-- + +LOCK TABLES `llx_facture_fourn` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn` DISABLE KEYS */; +INSERT INTO `llx_facture_fourn` VALUES (16,'SI1601-0001','FR70813',1,NULL,0,1,'2012-12-19 15:24:11','2003-04-11','2017-02-06 04:08:22','OVH FR70813',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,829.00000000,162.48000000,991.48000000,1,1,NULL,12,NULL,NULL,NULL,1,NULL,'2003-04-11','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(17,'SI1601-0002','FR81385',1,NULL,0,1,'2013-02-13 17:19:35','2003-06-04','2017-02-06 04:08:31','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,NULL,NULL,1,NULL,'2003-06-04','','','canelle',NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(18,'SI1601-0003','FR81385',1,NULL,0,2,'2013-02-13 17:20:25','2003-06-04','2017-02-06 04:08:35','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,NULL,NULL,1,NULL,'2003-06-04','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(19,'SI1601-0004','FR813852',1,NULL,0,2,'2013-03-16 17:59:02','2013-03-16','2017-02-06 04:08:38','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(20,'SI1702-0001','INV-AE56ER08',1,NULL,0,13,'2017-02-01 19:00:31','2017-02-01','2017-02-01 15:05:28','',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,200.00000000,39.20000000,239.20000000,1,12,NULL,12,NULL,5,NULL,1,0,'2017-02-01','The customer has called us the 24th april. He agree us to not pay the remain of invoice due to default.
\r\nLet\'s see with our book keeper, if we must cancel invoice or ask the supplier a credit note...',NULL,'canelle',NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,39.20000000,239.20000000); +/*!40000 ALTER TABLE `llx_facture_fourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn_det` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn_det`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn_det` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture_fourn` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `pu_ht` double(24,8) DEFAULT NULL, + `pu_ttc` double(24,8) DEFAULT NULL, + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `tva_tx` double(6,3) DEFAULT NULL, + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `total_ht` double(24,8) DEFAULT NULL, + `tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_code_ventilation` int(11) NOT NULL DEFAULT '0', + `special_code` int(11) DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_facture_fourn_det_fk_facture` (`fk_facture_fourn`), + KEY `fk_facture_fourn_det_fk_unit` (`fk_unit`), + KEY `idx_facture_fourn_det_fk_code_ventilation` (`fk_code_ventilation`), + KEY `idx_facture_fourn_det_fk_product` (`fk_product`), + CONSTRAINT `fk_facture_fourn_det_fk_facture` FOREIGN KEY (`fk_facture_fourn`) REFERENCES `llx_facture_fourn` (`rowid`), + CONSTRAINT `fk_facture_fourn_det_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn_det` +-- + +LOCK TABLES `llx_facture_fourn_det` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn_det` DISABLE KEYS */; +INSERT INTO `llx_facture_fourn_det` VALUES (44,16,NULL,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
6 mois - Location de SuperPlan avec la connexion 512kbs
Du 11/04/2003 à 11/10/2003',414.00000000,495.14400000,1,0,19.600,'',0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(45,16,NULL,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
6 mois - Location de SuperPlan avec la connexion 512kbs
Du 11/10/2003 à 11/04/2004',414.00000000,495.14400000,1,0,19.600,'',0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(46,16,NULL,NULL,NULL,NULL,'ref :sd.installation.annuel
Frais de mise en service d\'un serveur dédié pour un paiement annuel
',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(47,17,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(48,17,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,'',0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(49,18,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(50,18,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,'',0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(51,19,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,'',0.000,'0',0.000,'0',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(52,19,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,'',0.000,'0',0.000,'0',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(53,20,NULL,NULL,NULL,NULL,'Chips',20.00000000,23.92000000,10,0,19.600,'',0.000,'0',0.000,'0',200.00000000,39.20000000,0.00000000,0.00000000,239.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,0,'EUR',20.00000000,200.00000000,39.20000000,239.20000000); +/*!40000 ALTER TABLE `llx_facture_fourn_det` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn_det_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn_det_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn_det_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facture_fourn_det_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn_det_extrafields` +-- + +LOCK TABLES `llx_facture_fourn_det_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn_det_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_fourn_det_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facture_fourn_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn_extrafields` +-- + +LOCK TABLES `llx_facture_fourn_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_fourn_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_rec` +-- + +DROP TABLE IF EXISTS `llx_facture_rec`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_rec` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `titre` varchar(50) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_user_author` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT '0', + `fk_mode_reglement` int(11) DEFAULT '0', + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `last_gen` varchar(7) DEFAULT NULL, + `unit_frequency` varchar(2) DEFAULT 'd', + `date_when` datetime DEFAULT NULL, + `date_last_gen` datetime DEFAULT NULL, + `nb_gen_done` int(11) DEFAULT NULL, + `nb_gen_max` int(11) DEFAULT NULL, + `frequency` int(11) DEFAULT NULL, + `usenewprice` int(11) DEFAULT '0', + `revenuestamp` double(24,8) DEFAULT '0.00000000', + `auto_validate` int(11) DEFAULT '0', + `fk_account` int(11) DEFAULT '0', + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_user_modif` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `vat_src_code` varchar(10) DEFAULT '', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_facture_rec_uk_titre` (`titre`,`entity`), + KEY `idx_facture_rec_fk_soc` (`fk_soc`), + KEY `idx_facture_rec_fk_user_author` (`fk_user_author`), + KEY `idx_facture_rec_fk_projet` (`fk_projet`), + CONSTRAINT `fk_facture_rec_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_rec_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_rec_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_rec` +-- + +LOCK TABLES `llx_facture_rec` WRITE; +/*!40000 ALTER TABLE `llx_facture_rec` DISABLE KEYS */; +INSERT INTO `llx_facture_rec` VALUES (1,'fsdfsfsfsf',1,10,'2017-02-07 03:47:00',0.00000000,0,0,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,12,NULL,1,0,NULL,NULL,NULL,NULL,'m',NULL,NULL,0,0,0,0,0.00000000,0,3,NULL,NULL,1.00000000,10.00000000,0.00000000,10.00000000,NULL,'2017-02-07 02:47:00',''),(2,'fffff',1,10,'2017-02-07 03:47:58',0.00000000,0,0,0,0.00000000,0.00000000,0.00000000,5.00000000,5.00000000,12,6,1,2,NULL,NULL,NULL,NULL,'m',NULL,NULL,0,0,0,0,0.00000000,0,4,NULL,NULL,1.00000000,5.00000000,0.00000000,5.00000000,NULL,'2017-02-07 02:47:58',''); +/*!40000 ALTER TABLE `llx_facture_rec` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet` +-- + +DROP TABLE IF EXISTS `llx_facturedet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `fk_remise_except` int(11) DEFAULT NULL, + `subprice` double(24,8) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT NULL, + `total_tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `fk_code_ventilation` int(11) NOT NULL DEFAULT '0', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_contract_line` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `situation_percent` double DEFAULT NULL, + `fk_prev_id` int(11) DEFAULT NULL, + `fk_unit` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_fk_remise_except` (`fk_remise_except`,`fk_facture`), + KEY `idx_facturedet_fk_facture` (`fk_facture`), + KEY `idx_facturedet_fk_product` (`fk_product`), + KEY `fk_facturedet_fk_unit` (`fk_unit`), + KEY `idx_facturedet_fk_code_ventilation` (`fk_code_ventilation`), + CONSTRAINT `fk_facturedet_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_facturedet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=1031 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet` +-- + +LOCK TABLES `llx_facturedet` WRITE; +/*!40000 ALTER TABLE `llx_facturedet` DISABLE KEYS */; +INSERT INTO `llx_facturedet` VALUES (3,2,NULL,3,NULL,'Service S1',0.000,'',0.000,'',0.000,'',1,10,4,NULL,40.00000000,36.00000000,36.00000000,0.00000000,0.00000000,0.00000000,36.00000000,1,'2010-07-10 00:00:00',NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(4,2,NULL,NULL,NULL,'Abonnement annuel assurance',1.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.10000000,0.00000000,0.00000000,10.10000000,0,'2010-07-10 00:00:00','2011-07-10 00:00:00',0,NULL,0.00000000,0,0,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(11,3,NULL,4,NULL,'afsdfsdfsdfsdf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(12,3,NULL,NULL,NULL,'dfdfd',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(13,5,NULL,4,NULL,'Decapsuleur',12.500,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(14,6,NULL,4,NULL,'Decapsuleur',19.600,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.98000000,0.00000000,0.00000000,5.98000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(21,8,NULL,NULL,NULL,'dddd',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(22,9,NULL,NULL,NULL,'ggg',19.600,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(23,10,NULL,4,NULL,'',12.500,'',0.000,'',0.000,'',1,0,0,NULL,-5.00000000,NULL,-5.00000000,-0.63000000,0.00000000,0.00000000,-5.63000000,0,NULL,NULL,0,NULL,12.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(24,10,NULL,1,NULL,'A beatifull pink dress\r\nlkm',0.000,'',0.000,'',0.000,'',1,0,0,NULL,-6.00000000,NULL,-6.00000000,0.00000000,0.00000000,0.00000000,-6.00000000,0,NULL,NULL,0,0,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(26,12,NULL,1,NULL,'A beatifull pink dress\r\nhfghf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,-5.00000000,NULL,-5.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,0,NULL,NULL,0,0,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(27,13,NULL,NULL,NULL,'gdfgdf',19.600,'',0.000,'',0.000,'',1.4,0,0,NULL,10.00000000,NULL,14.00000000,2.74000000,0.00000000,0.00000000,16.74000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(137,33,NULL,NULL,NULL,'Desc',10.000,'',0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(138,33,NULL,NULL,NULL,'Desc',10.000,'',0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(256,55,NULL,NULL,NULL,'Desc',10.000,'',0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(257,55,NULL,NULL,NULL,'Desc',10.000,'',0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(753,13,NULL,2,NULL,'(Pays d\'origine: Albanie)',0.000,'',0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,0,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(754,148,NULL,11,NULL,'hfghf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(755,148,NULL,4,NULL,'Decapsuleur',12.500,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,NULL,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(757,150,NULL,2,NULL,'Product P1',12.500,'',0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(758,151,NULL,2,NULL,'Product P1',12.500,'',0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(768,32,NULL,NULL,NULL,'mlml',18.000,'',0.000,'',0.000,'',1,0,0,NULL,100.00000000,NULL,100.00000000,18.00000000,0.00000000,0.00000000,118.00000000,0,NULL,NULL,0,NULL,46.00000000,0,0,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(769,32,NULL,NULL,NULL,'mlkml',18.000,'',0.000,'',0.000,'',1,0,0,NULL,400.00000000,NULL,400.00000000,72.00000000,0.00000000,0.00000000,472.00000000,0,NULL,NULL,0,NULL,300.00000000,0,0,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(772,160,NULL,NULL,NULL,'Adhésion/cotisation 2015',12.500,'',0.000,'',0.000,'',1,0,0,NULL,8.88889000,NULL,8.89000000,1.11000000,0.00000000,0.00000000,10.00000000,1,'2015-07-18 00:00:00','2016-07-17 00:00:00',0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(776,32,NULL,NULL,NULL,'fsdfsdfds',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(777,32,NULL,NULL,NULL,'fsdfsdfds',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(779,32,NULL,NULL,NULL,'fsdfds',0.000,'',0.000,'0',0.000,'0',0,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,9,NULL,NULL,0,0,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(780,32,NULL,NULL,NULL,'ffsdf',0.000,'',0.000,'0',0.000,'0',0,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,9,NULL,NULL,0,NULL,0.00000000,0,1790,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1022,210,NULL,NULL,NULL,'Adhésion/cotisation 2011',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,'2011-07-10 00:00:00','2012-07-09 00:00:00',0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1023,211,NULL,NULL,NULL,'Samsung Android x4',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,250.00000000,NULL,250.00000000,0.00000000,0.00000000,0.00000000,250.00000000,0,NULL,NULL,0,NULL,200.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1024,211,NULL,1,NULL,'A beatifull pink dress\r\nSize XXL',19.600,'',0.000,'0',0.000,'0',1,10,0,NULL,100.00000000,NULL,90.00000000,17.64000000,0.00000000,0.00000000,107.64000000,0,NULL,NULL,0,NULL,90.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1026,213,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',10,0,0,NULL,-100.00000000,NULL,-1000.00000000,0.00000000,0.00000000,0.00000000,-1000.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1028,149,NULL,NULL,NULL,'opoo',0.000,'CGST+SGST',9.000,'1',9.000,'1',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.90000000,0.90000000,11.80000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,100,NULL,NULL,12,12,0,'',10.00000000,10.00000000,0.00000000,11.80000000),(1029,149,NULL,NULL,NULL,'gdgd',18.000,'IGST',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,1.80000000,0.00000000,0.00000000,11.80000000,0,NULL,NULL,0,NULL,0.00000000,0,0,3,NULL,NULL,100,NULL,NULL,12,12,0,'',10.00000000,10.00000000,1.80000000,11.80000000),(1030,217,NULL,NULL,NULL,'gfdgdf',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL,NULL,100,NULL,NULL,12,12,1,'EUR',10.00000000,10.00000000,0.00000000,10.00000000); +/*!40000 ALTER TABLE `llx_facturedet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facturedet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facturedet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet_extrafields` +-- + +LOCK TABLES `llx_facturedet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facturedet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facturedet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet_rec` +-- + +DROP TABLE IF EXISTS `llx_facturedet_rec`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet_rec` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `subprice` double(24,8) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT NULL, + `total_tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_contract_line` int(11) DEFAULT NULL, + `fk_unit` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `fk_facturedet_rec_fk_unit` (`fk_unit`), + CONSTRAINT `fk_facturedet_rec_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet_rec` +-- + +LOCK TABLES `llx_facturedet_rec` WRITE; +/*!40000 ALTER TABLE `llx_facturedet_rec` DISABLE KEYS */; +INSERT INTO `llx_facturedet_rec` VALUES (1,1,NULL,NULL,0,NULL,'ùkù',0.000,'',0.000,'0',0.000,'0',1,0,NULL,10.00000000,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(3,2,NULL,NULL,0,NULL,'ddd',0.000,'',0.000,'0',0.000,'0',1,0,NULL,5.00000000,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_facturedet_rec` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinter` +-- + +DROP TABLE IF EXISTS `llx_fichinter`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinter` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT '0', + `fk_contrat` int(11) DEFAULT '0', + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `datei` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `duree` double DEFAULT NULL, + `dateo` date DEFAULT NULL, + `datee` date DEFAULT NULL, + `datet` date DEFAULT NULL, + `description` text, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `ref_ext` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_fichinter_ref` (`ref`,`entity`), + KEY `idx_fichinter_fk_soc` (`fk_soc`), + CONSTRAINT `fk_fichinter_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinter` +-- + +LOCK TABLES `llx_fichinter` WRITE; +/*!40000 ALTER TABLE `llx_fichinter` DISABLE KEYS */; +INSERT INTO `llx_fichinter` VALUES (1,2,1,0,'FI1007-0001',1,'2016-01-22 17:39:37','2010-07-09 01:42:41','2016-01-22 18:39:37',NULL,1,NULL,12,1,10800,NULL,NULL,NULL,NULL,NULL,NULL,'soleil',NULL,NULL),(2,1,NULL,0,'FI1007-0002',1,'2012-12-08 13:11:07','2010-07-11 16:07:51',NULL,NULL,1,NULL,NULL,0,3600,NULL,NULL,NULL,'ferfrefeferf',NULL,NULL,'soleil',NULL,NULL),(3,2,NULL,0,'FI1511-0003',1,'2016-07-30 15:51:16','2015-11-18 15:57:34','2016-01-22 18:38:46',NULL,2,NULL,12,1,36000,NULL,NULL,NULL,NULL,NULL,NULL,'soleil',NULL,NULL); +/*!40000 ALTER TABLE `llx_fichinter` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinter_extrafields` +-- + +DROP TABLE IF EXISTS `llx_fichinter_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinter_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_ficheinter_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinter_extrafields` +-- + +LOCK TABLES `llx_fichinter_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_fichinter_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_fichinter_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinterdet` +-- + +DROP TABLE IF EXISTS `llx_fichinterdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinterdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_fichinter` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `date` datetime DEFAULT NULL, + `description` text, + `duree` int(11) DEFAULT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_fichinterdet_fk_fichinter` (`fk_fichinter`), + CONSTRAINT `fk_fichinterdet_fk_fichinter` FOREIGN KEY (`fk_fichinter`) REFERENCES `llx_fichinter` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinterdet` +-- + +LOCK TABLES `llx_fichinterdet` WRITE; +/*!40000 ALTER TABLE `llx_fichinterdet` DISABLE KEYS */; +INSERT INTO `llx_fichinterdet` VALUES (1,1,NULL,'2010-07-07 04:00:00','Intervention sur site',3600,0),(2,1,NULL,'2010-07-08 11:00:00','Other actions on client site.',7200,0),(3,2,NULL,'2010-07-11 05:00:00','Pres',3600,0),(5,3,NULL,'2015-11-18 09:00:00','Intervention on building windows 1',32400,0),(6,3,NULL,'2016-01-22 00:00:00','Intervention on building windows 2',3600,0); +/*!40000 ALTER TABLE `llx_fichinterdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinterdet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_fichinterdet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinterdet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_ficheinterdet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinterdet_extrafields` +-- + +LOCK TABLES `llx_fichinterdet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_fichinterdet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_fichinterdet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday` +-- + +DROP TABLE IF EXISTS `llx_holiday`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL, + `date_create` datetime NOT NULL, + `description` varchar(255) NOT NULL, + `date_debut` date NOT NULL, + `date_fin` date NOT NULL, + `halfday` int(11) DEFAULT '0', + `statut` int(11) NOT NULL DEFAULT '1', + `fk_validator` int(11) NOT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_refuse` datetime DEFAULT NULL, + `fk_user_refuse` int(11) DEFAULT NULL, + `date_cancel` datetime DEFAULT NULL, + `fk_user_cancel` int(11) DEFAULT NULL, + `detail_refuse` varchar(250) DEFAULT NULL, + `note_private` text, + `note_public` text, + `note` text, + `fk_user_create` int(11) DEFAULT NULL, + `fk_type` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `entity` int(11) NOT NULL DEFAULT '1', + `ref` varchar(30) DEFAULT NULL, + `ref_ext` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_holiday_fk_user` (`fk_user`), + KEY `idx_holiday_date_debut` (`date_debut`), + KEY `idx_holiday_date_fin` (`date_fin`), + KEY `idx_holiday_fk_user_create` (`fk_user_create`), + KEY `idx_holiday_date_create` (`date_create`), + KEY `idx_holiday_fk_validator` (`fk_validator`), + KEY `idx_holiday_entity` (`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday` +-- + +LOCK TABLES `llx_holiday` WRITE; +/*!40000 ALTER TABLE `llx_holiday` DISABLE KEYS */; +INSERT INTO `llx_holiday` VALUES (1,1,'2013-02-17 19:06:35','gdf','2013-02-10','2013-02-11',0,3,1,'2013-02-17 19:06:57',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'0000-00-00 00:00:00',1,NULL,NULL,NULL,NULL,NULL),(2,12,'2016-01-22 19:10:01','','2016-01-04','2016-01-08',0,1,11,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,5,'0000-00-00 00:00:00',1,NULL,NULL,NULL,NULL,NULL),(3,13,'2016-01-22 19:10:29','','2016-01-11','2016-01-13',0,2,11,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,5,'0000-00-00 00:00:00',1,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_holiday` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_config` +-- + +DROP TABLE IF EXISTS `llx_holiday_config`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_config` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) DEFAULT NULL, + `value` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_config` +-- + +LOCK TABLES `llx_holiday_config` WRITE; +/*!40000 ALTER TABLE `llx_holiday_config` DISABLE KEYS */; +INSERT INTO `llx_holiday_config` VALUES (1,'userGroup','1'),(2,'lastUpdate','20170829181921'),(3,'nbUser',''),(4,'delayForRequest','31'),(5,'AlertValidatorDelay','0'),(6,'AlertValidatorSolde','0'),(7,'nbHolidayDeducted','1'),(8,'nbHolidayEveryMonth','2.08334'); +/*!40000 ALTER TABLE `llx_holiday_config` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_logs` +-- + +DROP TABLE IF EXISTS `llx_holiday_logs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_logs` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_action` datetime NOT NULL, + `fk_user_action` int(11) NOT NULL, + `fk_user_update` int(11) NOT NULL, + `type_action` varchar(255) NOT NULL, + `prev_solde` varchar(255) NOT NULL, + `new_solde` varchar(255) NOT NULL, + `fk_type` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=195 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_logs` +-- + +LOCK TABLES `llx_holiday_logs` WRITE; +/*!40000 ALTER TABLE `llx_holiday_logs` DISABLE KEYS */; +INSERT INTO `llx_holiday_logs` VALUES (1,'2013-01-17 21:03:15',1,1,'Event : Mise à jour mensuelle','0.00','2.08',1),(2,'2013-01-17 21:03:15',1,2,'Event : Mise à jour mensuelle','0.00','2.08',1),(3,'2013-01-17 21:03:15',1,3,'Event : Mise à jour mensuelle','0.00','2.08',1),(4,'2013-02-01 09:53:26',1,1,'Event : Mise à jour mensuelle','2.08','4.16',1),(5,'2013-02-01 09:53:26',1,2,'Event : Mise à jour mensuelle','2.08','4.16',1),(6,'2013-02-01 09:53:26',1,3,'Event : Mise à jour mensuelle','2.08','4.16',1),(7,'2013-02-01 09:53:26',1,1,'Event : Mise à jour mensuelle','4.17','6.25',1),(8,'2013-02-01 09:53:26',1,2,'Event : Mise à jour mensuelle','4.17','6.25',1),(9,'2013-02-01 09:53:26',1,3,'Event : Mise à jour mensuelle','4.17','6.25',1),(10,'2013-02-01 09:53:26',1,4,'Event : Mise à jour mensuelle','0.00','2.08',1),(11,'2013-02-01 09:53:31',1,1,'Event : Mise à jour mensuelle','6.25','8.33',1),(12,'2013-02-01 09:53:31',1,2,'Event : Mise à jour mensuelle','6.25','8.33',1),(13,'2013-02-01 09:53:31',1,3,'Event : Mise à jour mensuelle','6.25','8.33',1),(14,'2013-02-01 09:53:31',1,4,'Event : Mise à jour mensuelle','2.08','4.16',1),(15,'2013-02-01 09:53:31',1,1,'Event : Mise à jour mensuelle','8.33','10.41',1),(16,'2013-02-01 09:53:31',1,2,'Event : Mise à jour mensuelle','8.33','10.41',1),(17,'2013-02-01 09:53:31',1,3,'Event : Mise à jour mensuelle','8.33','10.41',1),(18,'2013-02-01 09:53:31',1,4,'Event : Mise à jour mensuelle','4.17','6.25',1),(19,'2013-02-01 09:53:33',1,1,'Event : Mise à jour mensuelle','10.42','12.50',1),(20,'2013-02-01 09:53:33',1,2,'Event : Mise à jour mensuelle','10.42','12.50',1),(21,'2013-02-01 09:53:33',1,3,'Event : Mise à jour mensuelle','10.42','12.50',1),(22,'2013-02-01 09:53:33',1,4,'Event : Mise à jour mensuelle','6.25','8.33',1),(23,'2013-02-01 09:53:34',1,1,'Event : Mise à jour mensuelle','12.50','14.58',1),(24,'2013-02-01 09:53:34',1,2,'Event : Mise à jour mensuelle','12.50','14.58',1),(25,'2013-02-01 09:53:34',1,3,'Event : Mise à jour mensuelle','12.50','14.58',1),(26,'2013-02-01 09:53:34',1,4,'Event : Mise à jour mensuelle','8.33','10.41',1),(27,'2013-02-01 09:53:34',1,1,'Event : Mise à jour mensuelle','14.58','16.66',1),(28,'2013-02-01 09:53:34',1,2,'Event : Mise à jour mensuelle','14.58','16.66',1),(29,'2013-02-01 09:53:34',1,3,'Event : Mise à jour mensuelle','14.58','16.66',1),(30,'2013-02-01 09:53:34',1,4,'Event : Mise à jour mensuelle','10.42','12.50',1),(31,'2013-02-01 09:53:36',1,1,'Event : Mise à jour mensuelle','16.67','18.75',1),(32,'2013-02-01 09:53:36',1,2,'Event : Mise à jour mensuelle','16.67','18.75',1),(33,'2013-02-01 09:53:36',1,3,'Event : Mise à jour mensuelle','16.67','18.75',1),(34,'2013-02-01 09:53:36',1,4,'Event : Mise à jour mensuelle','12.50','14.58',1),(35,'2013-02-01 09:53:36',1,1,'Event : Mise à jour mensuelle','18.75','20.83',1),(36,'2013-02-01 09:53:36',1,2,'Event : Mise à jour mensuelle','18.75','20.83',1),(37,'2013-02-01 09:53:36',1,3,'Event : Mise à jour mensuelle','18.75','20.83',1),(38,'2013-02-01 09:53:36',1,4,'Event : Mise à jour mensuelle','14.58','16.66',1),(39,'2013-02-01 09:53:37',1,1,'Event : Mise à jour mensuelle','20.83','22.91',1),(40,'2013-02-01 09:53:37',1,2,'Event : Mise à jour mensuelle','20.83','22.91',1),(41,'2013-02-01 09:53:37',1,3,'Event : Mise à jour mensuelle','20.83','22.91',1),(42,'2013-02-01 09:53:37',1,4,'Event : Mise à jour mensuelle','16.67','18.75',1),(43,'2013-02-01 09:53:37',1,1,'Event : Mise à jour mensuelle','22.92','25.00',1),(44,'2013-02-01 09:53:37',1,2,'Event : Mise à jour mensuelle','22.92','25.00',1),(45,'2013-02-01 09:53:37',1,3,'Event : Mise à jour mensuelle','22.92','25.00',1),(46,'2013-02-01 09:53:37',1,4,'Event : Mise à jour mensuelle','18.75','20.83',1),(47,'2013-02-01 09:53:44',1,1,'Event : Mise à jour mensuelle','25.00','27.08',1),(48,'2013-02-01 09:53:44',1,2,'Event : Mise à jour mensuelle','25.00','27.08',1),(49,'2013-02-01 09:53:44',1,3,'Event : Mise à jour mensuelle','25.00','27.08',1),(50,'2013-02-01 09:53:44',1,4,'Event : Mise à jour mensuelle','20.83','22.91',1),(51,'2013-02-01 09:53:47',1,1,'Event : Mise à jour mensuelle','27.08','29.16',1),(52,'2013-02-01 09:53:47',1,2,'Event : Mise à jour mensuelle','27.08','29.16',1),(53,'2013-02-01 09:53:47',1,3,'Event : Mise à jour mensuelle','27.08','29.16',1),(54,'2013-02-01 09:53:47',1,4,'Event : Mise à jour mensuelle','22.92','25.00',1),(55,'2013-02-01 09:53:47',1,1,'Event : Mise à jour mensuelle','29.17','31.25',1),(56,'2013-02-01 09:53:47',1,2,'Event : Mise à jour mensuelle','29.17','31.25',1),(57,'2013-02-01 09:53:47',1,3,'Event : Mise à jour mensuelle','29.17','31.25',1),(58,'2013-02-01 09:53:47',1,4,'Event : Mise à jour mensuelle','25.00','27.08',1),(59,'2013-02-01 09:53:49',1,1,'Event : Mise à jour mensuelle','31.25','33.33',1),(60,'2013-02-01 09:53:49',1,2,'Event : Mise à jour mensuelle','31.25','33.33',1),(61,'2013-02-01 09:53:49',1,3,'Event : Mise à jour mensuelle','31.25','33.33',1),(62,'2013-02-01 09:53:49',1,4,'Event : Mise à jour mensuelle','27.08','29.16',1),(63,'2013-02-01 09:53:52',1,1,'Event : Mise à jour mensuelle','33.33','35.41',1),(64,'2013-02-01 09:53:52',1,2,'Event : Mise à jour mensuelle','33.33','35.41',1),(65,'2013-02-01 09:53:52',1,3,'Event : Mise à jour mensuelle','33.33','35.41',1),(66,'2013-02-01 09:53:52',1,4,'Event : Mise à jour mensuelle','29.17','31.25',1),(67,'2013-02-01 09:53:52',1,1,'Event : Mise à jour mensuelle','35.42','37.50',1),(68,'2013-02-01 09:53:52',1,2,'Event : Mise à jour mensuelle','35.42','37.50',1),(69,'2013-02-01 09:53:52',1,3,'Event : Mise à jour mensuelle','35.42','37.50',1),(70,'2013-02-01 09:53:52',1,4,'Event : Mise à jour mensuelle','31.25','33.33',1),(71,'2013-02-01 09:53:53',1,1,'Event : Mise à jour mensuelle','37.50','39.58',1),(72,'2013-02-01 09:53:53',1,2,'Event : Mise à jour mensuelle','37.50','39.58',1),(73,'2013-02-01 09:53:53',1,3,'Event : Mise à jour mensuelle','37.50','39.58',1),(74,'2013-02-01 09:53:53',1,4,'Event : Mise à jour mensuelle','33.33','35.41',1),(75,'2013-02-01 09:53:54',1,1,'Event : Mise à jour mensuelle','39.58','41.66',1),(76,'2013-02-01 09:53:54',1,2,'Event : Mise à jour mensuelle','39.58','41.66',1),(77,'2013-02-01 09:53:54',1,3,'Event : Mise à jour mensuelle','39.58','41.66',1),(78,'2013-02-01 09:53:54',1,4,'Event : Mise à jour mensuelle','35.42','37.50',1),(79,'2013-02-01 09:53:54',1,1,'Event : Mise à jour mensuelle','41.67','43.75',1),(80,'2013-02-01 09:53:54',1,2,'Event : Mise à jour mensuelle','41.67','43.75',1),(81,'2013-02-01 09:53:54',1,3,'Event : Mise à jour mensuelle','41.67','43.75',1),(82,'2013-02-01 09:53:54',1,4,'Event : Mise à jour mensuelle','37.50','39.58',1),(83,'2013-02-01 09:55:49',1,1,'Event : Mise à jour mensuelle','43.75','45.83',1),(84,'2013-02-01 09:55:49',1,2,'Event : Mise à jour mensuelle','43.75','45.83',1),(85,'2013-02-01 09:55:49',1,3,'Event : Mise à jour mensuelle','43.75','45.83',1),(86,'2013-02-01 09:55:49',1,4,'Event : Mise à jour mensuelle','39.58','41.66',1),(87,'2013-02-01 09:55:56',1,1,'Event : Mise à jour mensuelle','45.83','47.91',1),(88,'2013-02-01 09:55:56',1,2,'Event : Mise à jour mensuelle','45.83','47.91',1),(89,'2013-02-01 09:55:56',1,3,'Event : Mise à jour mensuelle','45.83','47.91',1),(90,'2013-02-01 09:55:56',1,4,'Event : Mise à jour mensuelle','41.67','43.75',1),(91,'2013-02-01 09:56:01',1,1,'Event : Mise à jour mensuelle','47.92','50.00',1),(92,'2013-02-01 09:56:01',1,2,'Event : Mise à jour mensuelle','47.92','50.00',1),(93,'2013-02-01 09:56:01',1,3,'Event : Mise à jour mensuelle','47.92','50.00',1),(94,'2013-02-01 09:56:01',1,4,'Event : Mise à jour mensuelle','43.75','45.83',1),(95,'2013-02-01 09:56:01',1,1,'Event : Mise à jour mensuelle','50.00','52.08',1),(96,'2013-02-01 09:56:01',1,2,'Event : Mise à jour mensuelle','50.00','52.08',1),(97,'2013-02-01 09:56:01',1,3,'Event : Mise à jour mensuelle','50.00','52.08',1),(98,'2013-02-01 09:56:01',1,4,'Event : Mise à jour mensuelle','45.83','47.91',1),(99,'2013-02-01 09:56:03',1,1,'Event : Mise à jour mensuelle','52.08','54.16',1),(100,'2013-02-01 09:56:03',1,2,'Event : Mise à jour mensuelle','52.08','54.16',1),(101,'2013-02-01 09:56:03',1,3,'Event : Mise à jour mensuelle','52.08','54.16',1),(102,'2013-02-01 09:56:03',1,4,'Event : Mise à jour mensuelle','47.92','50.00',1),(103,'2013-02-01 09:56:03',1,1,'Event : Mise à jour mensuelle','54.17','56.25',1),(104,'2013-02-01 09:56:03',1,2,'Event : Mise à jour mensuelle','54.17','56.25',1),(105,'2013-02-01 09:56:03',1,3,'Event : Mise à jour mensuelle','54.17','56.25',1),(106,'2013-02-01 09:56:03',1,4,'Event : Mise à jour mensuelle','50.00','52.08',1),(107,'2013-02-01 09:56:05',1,1,'Event : Mise à jour mensuelle','56.25','58.33',1),(108,'2013-02-01 09:56:05',1,2,'Event : Mise à jour mensuelle','56.25','58.33',1),(109,'2013-02-01 09:56:05',1,3,'Event : Mise à jour mensuelle','56.25','58.33',1),(110,'2013-02-01 09:56:05',1,4,'Event : Mise à jour mensuelle','52.08','54.16',1),(111,'2013-02-01 09:56:06',1,1,'Event : Mise à jour mensuelle','58.33','60.41',1),(112,'2013-02-01 09:56:06',1,2,'Event : Mise à jour mensuelle','58.33','60.41',1),(113,'2013-02-01 09:56:06',1,3,'Event : Mise à jour mensuelle','58.33','60.41',1),(114,'2013-02-01 09:56:06',1,4,'Event : Mise à jour mensuelle','54.17','56.25',1),(115,'2013-02-01 09:56:06',1,1,'Event : Mise à jour mensuelle','60.42','62.50',1),(116,'2013-02-01 09:56:06',1,2,'Event : Mise à jour mensuelle','60.42','62.50',1),(117,'2013-02-01 09:56:06',1,3,'Event : Mise à jour mensuelle','60.42','62.50',1),(118,'2013-02-01 09:56:06',1,4,'Event : Mise à jour mensuelle','56.25','58.33',1),(119,'2013-02-01 09:56:07',1,1,'Event : Mise à jour mensuelle','62.50','64.58',1),(120,'2013-02-01 09:56:07',1,2,'Event : Mise à jour mensuelle','62.50','64.58',1),(121,'2013-02-01 09:56:07',1,3,'Event : Mise à jour mensuelle','62.50','64.58',1),(122,'2013-02-01 09:56:07',1,4,'Event : Mise à jour mensuelle','58.33','60.41',1),(123,'2013-02-01 09:56:07',1,1,'Event : Mise à jour mensuelle','64.58','66.66',1),(124,'2013-02-01 09:56:07',1,2,'Event : Mise à jour mensuelle','64.58','66.66',1),(125,'2013-02-01 09:56:07',1,3,'Event : Mise à jour mensuelle','64.58','66.66',1),(126,'2013-02-01 09:56:07',1,4,'Event : Mise à jour mensuelle','60.42','62.50',1),(127,'2013-02-01 09:56:50',1,1,'Event : Mise à jour mensuelle','66.67','68.75',1),(128,'2013-02-01 09:56:50',1,2,'Event : Mise à jour mensuelle','66.67','68.75',1),(129,'2013-02-01 09:56:50',1,3,'Event : Mise à jour mensuelle','66.67','68.75',1),(130,'2013-02-01 09:56:50',1,4,'Event : Mise à jour mensuelle','62.50','64.58',1),(131,'2013-02-01 09:56:50',1,1,'Event : Mise à jour mensuelle','68.75','70.83',1),(132,'2013-02-01 09:56:50',1,2,'Event : Mise à jour mensuelle','68.75','70.83',1),(133,'2013-02-01 09:56:50',1,3,'Event : Mise à jour mensuelle','68.75','70.83',1),(134,'2013-02-01 09:56:50',1,4,'Event : Mise à jour mensuelle','64.58','66.66',1),(135,'2013-02-17 18:49:21',1,1,'Event : Mise à jour mensuelle','70.83','72.91',1),(136,'2013-02-17 18:49:21',1,2,'Event : Mise à jour mensuelle','70.83','72.91',1),(137,'2013-02-17 18:49:21',1,3,'Event : Mise à jour mensuelle','70.83','72.91',1),(138,'2013-02-17 18:49:21',1,4,'Event : Mise à jour mensuelle','66.67','68.75',1),(139,'2013-02-17 19:06:57',1,1,'Event : Holiday','72.92','71.92',1),(140,'2013-03-01 23:12:31',1,1,'Event : Mise à jour mensuelle','71.92','74.00',1),(141,'2013-03-01 23:12:31',1,2,'Event : Mise à jour mensuelle','72.92','75.00',1),(142,'2013-03-01 23:12:31',1,3,'Event : Mise à jour mensuelle','72.92','75.00',1),(143,'2013-03-01 23:12:31',1,4,'Event : Mise à jour mensuelle','68.75','70.83',1),(145,'2015-07-19 15:44:57',1,1,'Monthly update','0','2.08334',4),(146,'2015-07-19 15:44:57',1,2,'Monthly update','0','2.08334',4),(147,'2015-07-19 15:44:57',1,3,'Monthly update','0','2.08334',4),(148,'2015-07-19 15:44:57',1,4,'Monthly update','0','2.08334',4),(151,'2015-07-19 15:44:57',1,1,'Monthly update','0','2.08334',5),(152,'2015-07-19 15:44:57',1,2,'Monthly update','0','2.08334',5),(153,'2015-07-19 15:44:57',1,3,'Monthly update','0','2.08334',5),(154,'2015-07-19 15:44:57',1,4,'Monthly update','0','2.08334',5),(157,'2015-07-19 15:44:57',1,1,'Monthly update','0','2.08334',9),(158,'2015-07-19 15:44:57',1,2,'Monthly update','0','2.08334',9),(159,'2015-07-19 15:44:57',1,3,'Monthly update','0','2.08334',9),(160,'2015-07-19 15:44:57',1,4,'Monthly update','0','2.08334',9),(163,'2016-01-22 18:59:06',12,1,'Monthly update','0','2.08334',4),(164,'2016-01-22 18:59:06',12,2,'Monthly update','0','2.08334',4),(165,'2016-01-22 18:59:06',12,3,'Monthly update','0','2.08334',4),(166,'2016-01-22 18:59:06',12,4,'Monthly update','0','2.08334',4),(168,'2016-01-22 18:59:06',12,1,'Monthly update','0','2.08334',5),(169,'2016-01-22 18:59:06',12,2,'Monthly update','0','2.08334',5),(170,'2016-01-22 18:59:06',12,3,'Monthly update','0','2.08334',5),(171,'2016-01-22 18:59:06',12,4,'Monthly update','0','2.08334',5),(173,'2016-01-22 18:59:06',12,1,'Monthly update','0','2.08334',9),(174,'2016-01-22 18:59:06',12,2,'Monthly update','0','2.08334',9),(175,'2016-01-22 18:59:06',12,3,'Monthly update','0','2.08334',9),(176,'2016-01-22 18:59:06',12,4,'Monthly update','0','2.08334',9),(178,'2016-01-22 18:59:38',12,18,'Manual update','0','10',5),(179,'2016-01-22 18:59:42',12,16,'Manual update','0','10',5),(180,'2016-01-22 18:59:45',12,12,'Manual update','0','10',5),(181,'2016-01-22 18:59:49',12,1,'Manual update','0','10',5),(182,'2016-01-22 18:59:52',12,2,'Manual update','0','10',5),(183,'2016-01-22 18:59:55',12,3,'Manual update','0','5',5),(184,'2016-07-30 19:45:49',12,1,'Manual update','0','25',3),(185,'2016-07-30 19:45:52',12,2,'Manual update','0','23',3),(186,'2016-07-30 19:45:54',12,3,'Manual update','0','10',3),(187,'2016-07-30 19:45:57',12,4,'Manual update','0','-4',3),(188,'2016-07-30 19:46:02',12,10,'Manual update','0','20',3),(189,'2016-07-30 19:46:04',12,11,'Manual update','0','30',3),(190,'2016-07-30 19:46:07',12,12,'Manual update','0','15',3),(191,'2016-07-30 19:46:09',12,13,'Manual update','0','11',3),(192,'2016-07-30 19:46:12',12,14,'Manual update','0','4',3),(193,'2016-07-30 19:46:14',12,16,'Manual update','0','5',3),(194,'2016-07-30 19:46:16',12,18,'Manual update','0','22',3); +/*!40000 ALTER TABLE `llx_holiday_logs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_users` +-- + +DROP TABLE IF EXISTS `llx_holiday_users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_users` ( + `fk_user` int(11) NOT NULL, + `nb_holiday` double NOT NULL DEFAULT '0', + `fk_type` int(11) NOT NULL DEFAULT '1' +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_users` +-- + +LOCK TABLES `llx_holiday_users` WRITE; +/*!40000 ALTER TABLE `llx_holiday_users` DISABLE KEYS */; +INSERT INTO `llx_holiday_users` VALUES (0,0,1),(1,74.00334000000001,1),(2,75.00024000000003,1),(3,75.00024000000003,1),(4,70.83356000000002,1),(5,2.08334,1),(6,0,1),(18,10,5),(16,10,5),(12,10,5),(1,10,5),(2,10,5),(3,5,5),(1,25,3),(2,23,3),(3,10,3),(4,-4,3),(10,20,3),(11,30,3),(12,15,3),(13,11,3),(14,4,3),(16,5,3),(18,22,3); +/*!40000 ALTER TABLE `llx_holiday_users` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_import_model` +-- + +DROP TABLE IF EXISTS `llx_import_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_import_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL DEFAULT '0', + `label` varchar(50) NOT NULL, + `type` varchar(50) DEFAULT NULL, + `field` text NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_import_model` (`label`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_import_model` +-- + +LOCK TABLES `llx_import_model` WRITE; +/*!40000 ALTER TABLE `llx_import_model` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_import_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_inventory` +-- + +DROP TABLE IF EXISTS `llx_inventory`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_inventory` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_warehouse` int(11) DEFAULT NULL, + `date_inventory` date DEFAULT NULL, + `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_validation` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + `datec` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_inventory_rowid` (`rowid`), + KEY `idx_inventory_ref` (`ref`), + KEY `idx_inventory_entity` (`entity`), + KEY `idx_inventory_fk_warehouse` (`fk_warehouse`), + KEY `idx_inventory_status` (`status`), + KEY `idx_inventory_import_key` (`import_key`), + KEY `idx_inventory_tms` (`tms`), + KEY `idx_inventory_datec` (`datec`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_inventory` +-- + +LOCK TABLES `llx_inventory` WRITE; +/*!40000 ALTER TABLE `llx_inventory` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_inventory` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_inventory_extrafields` +-- + +DROP TABLE IF EXISTS `llx_inventory_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_inventory_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_inventory_extrafields` +-- + +LOCK TABLES `llx_inventory_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_inventory_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_inventory_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_inventorydet` +-- + +DROP TABLE IF EXISTS `llx_inventorydet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_inventorydet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_inventory` int(11) DEFAULT '0', + `fk_warehouse` int(11) DEFAULT '0', + `fk_product` int(11) DEFAULT '0', + `batch` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, + `qty_view` double DEFAULT NULL, + `qty_stock` double DEFAULT NULL, + `qty_regulated` double DEFAULT NULL, + `pmp` double DEFAULT '0', + `pa` double DEFAULT '0', + `new_pmp` double DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_inventorydet_tms` (`tms`), + KEY `idx_inventorydet_datec` (`datec`), + KEY `idx_inventorydet_fk_inventory` (`fk_inventory`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_inventorydet` +-- + +LOCK TABLES `llx_inventorydet` WRITE; +/*!40000 ALTER TABLE `llx_inventorydet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_inventorydet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_links` +-- + +DROP TABLE IF EXISTS `llx_links`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_links` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datea` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `label` varchar(255) NOT NULL, + `objecttype` varchar(255) NOT NULL, + `objectid` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_links` (`objectid`,`label`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_links` +-- + +LOCK TABLES `llx_links` WRITE; +/*!40000 ALTER TABLE `llx_links` DISABLE KEYS */; +INSERT INTO `llx_links` VALUES (1,1,'2016-01-16 16:45:35','http://www.dolicloud.com','The DoliCoud service','societe',10),(2,1,'2016-01-16 17:14:35','https://www.dolistore.com/en/tools-documentation/12-SVG-file-for-85cm-x-200cm-rollup.html','Link to rollup file on dolistore.com','product',11),(3,1,'2016-01-22 17:40:23','http://www.nltechno.com','NLtechno portal','societe',10),(4,1,'2016-01-22 18:32:31','https://play.google.com/store/apps/details?id=com.nltechno.dolidroidpro','Link on Google Play','product',5); +/*!40000 ALTER TABLE `llx_links` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraison` +-- + +DROP TABLE IF EXISTS `llx_livraison`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraison` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_customer` varchar(30) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `ref_ext` varchar(30) DEFAULT NULL, + `ref_int` varchar(30) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_delivery` datetime DEFAULT NULL, + `fk_address` int(11) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_livraison_uk_ref` (`ref`,`entity`), + KEY `idx_livraison_fk_soc` (`fk_soc`), + KEY `idx_livraison_fk_user_author` (`fk_user_author`), + KEY `idx_livraison_fk_user_valid` (`fk_user_valid`), + CONSTRAINT `fk_livraison_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_livraison_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_livraison_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraison` +-- + +LOCK TABLES `llx_livraison` WRITE; +/*!40000 ALTER TABLE `llx_livraison` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraison` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraison_extrafields` +-- + +DROP TABLE IF EXISTS `llx_livraison_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraison_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_livraison_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraison_extrafields` +-- + +LOCK TABLES `llx_livraison_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_livraison_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraison_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraisondet` +-- + +DROP TABLE IF EXISTS `llx_livraisondet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraisondet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_livraison` int(11) DEFAULT NULL, + `fk_origin_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `description` text, + `qty` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_livraisondet_fk_expedition` (`fk_livraison`), + CONSTRAINT `fk_livraisondet_fk_livraison` FOREIGN KEY (`fk_livraison`) REFERENCES `llx_livraison` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraisondet` +-- + +LOCK TABLES `llx_livraisondet` WRITE; +/*!40000 ALTER TABLE `llx_livraisondet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraisondet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraisondet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_livraisondet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraisondet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_livraisondet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraisondet_extrafields` +-- + +LOCK TABLES `llx_livraisondet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_livraisondet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraisondet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_loan` +-- + +DROP TABLE IF EXISTS `llx_loan`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_loan` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(80) NOT NULL, + `fk_bank` int(11) DEFAULT NULL, + `capital` double NOT NULL DEFAULT '0', + `datestart` date DEFAULT NULL, + `dateend` date DEFAULT NULL, + `nbterm` double DEFAULT NULL, + `rate` double NOT NULL, + `note_private` text, + `note_public` text, + `capital_position` double DEFAULT '0', + `date_position` date DEFAULT NULL, + `paid` smallint(6) NOT NULL DEFAULT '0', + `accountancy_account_capital` varchar(32) DEFAULT NULL, + `accountancy_account_insurance` varchar(32) DEFAULT NULL, + `accountancy_account_interest` varchar(32) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `fk_projet` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_loan` +-- + +LOCK TABLES `llx_loan` WRITE; +/*!40000 ALTER TABLE `llx_loan` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_loan` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_loan_schedule` +-- + +DROP TABLE IF EXISTS `llx_loan_schedule`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_loan_schedule` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_loan` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount_capital` double DEFAULT '0', + `amount_insurance` double DEFAULT '0', + `amount_interest` double DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `note_private` text COLLATE utf8_unicode_ci, + `note_public` text COLLATE utf8_unicode_ci, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_loan_schedule` +-- + +LOCK TABLES `llx_loan_schedule` WRITE; +/*!40000 ALTER TABLE `llx_loan_schedule` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_loan_schedule` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_localtax` +-- + +DROP TABLE IF EXISTS `llx_localtax`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_localtax` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `localtaxtype` tinyint(4) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `note` text, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_localtax` +-- + +LOCK TABLES `llx_localtax` WRITE; +/*!40000 ALTER TABLE `llx_localtax` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_localtax` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_mailing` +-- + +DROP TABLE IF EXISTS `llx_mailing`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_mailing` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `statut` smallint(6) DEFAULT '0', + `titre` varchar(60) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `sujet` varchar(60) DEFAULT NULL, + `body` mediumtext, + `bgcolor` varchar(8) DEFAULT NULL, + `bgimage` varchar(255) DEFAULT NULL, + `cible` varchar(60) DEFAULT NULL, + `nbemail` int(11) DEFAULT NULL, + `email_from` varchar(160) DEFAULT NULL, + `email_replyto` varchar(160) DEFAULT NULL, + `email_errorsto` varchar(160) DEFAULT NULL, + `tag` varchar(128) DEFAULT NULL, + `date_creat` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_appro` datetime DEFAULT NULL, + `date_envoi` datetime DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_appro` int(11) DEFAULT NULL, + `joined_file1` varchar(255) DEFAULT NULL, + `joined_file2` varchar(255) DEFAULT NULL, + `joined_file3` varchar(255) DEFAULT NULL, + `joined_file4` varchar(255) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_mailing` +-- + +LOCK TABLES `llx_mailing` WRITE; +/*!40000 ALTER TABLE `llx_mailing` DISABLE KEYS */; +INSERT INTO `llx_mailing` VALUES (3,2,'Commercial emailing January',1,'Buy my product','
\"\"
\r\n\"Seguici\"Seguici\"Seguici\"Seguici
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n

DoliCloud is the service to provide you a web hosting solution of Dolibarr ERP CRM in one click. Just enter your email to create your instance and you are ready to work. Backup and full access is to data (SFTP, Mysql) are provided.

\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
Test Dolibarr ERP CRM on Dolicloud →
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
DoliCloud team
\r\n Unsubscribe   |   View on web browser
\r\n
\r\n
','','',NULL,26,'dolibarr@domain.com','','',NULL,'2010-07-11 13:15:59','2017-01-29 21:33:11',NULL,'2017-01-29 21:36:40',1,12,NULL,NULL,NULL,NULL,NULL,NULL),(4,0,'Commercial emailing February',1,'Buy my product','This is a new éEéé\"Mailing content
\r\n
\r\n\r\nYou can adit it with the WYSIWYG editor.
\r\nIt is\r\n
    \r\n
  • \r\n Fast
  • \r\n
  • \r\n Easy to use
  • \r\n
  • \r\n Pretty
  • \r\n
','','',NULL,NULL,'dolibarr@domain.com','','',NULL,'2011-07-18 20:44:33',NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,1,'Commercial emailing March',1,'Buy my product','
\"\"
\r\n\"Seguici\"Seguici\"Seguici\"Seguici
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n

DoliCloud is the service to provide you a web hosting solution __EMAIL__ of Dolibarr ERP CRM in one click. Just enter your email to create your instance and you are ready to work. Backup and full access is to data (SFTP, Mysql) are provided.

\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
Test Dolibarr ERP CRM on Dolicloud →
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
DoliCloud team
\r\n Unsubscribe   |   View on web browser
\r\n
\r\n
','','',NULL,28,'dolibarr@domain.com','','',NULL,'2017-01-29 21:47:37','2017-01-29 21:54:55',NULL,NULL,12,12,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_mailing` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_mailing_cibles` +-- + +DROP TABLE IF EXISTS `llx_mailing_cibles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_mailing_cibles` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_mailing` int(11) NOT NULL, + `fk_contact` int(11) NOT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `email` varchar(160) NOT NULL, + `other` varchar(255) DEFAULT NULL, + `tag` varchar(128) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `source_url` varchar(255) DEFAULT NULL, + `source_id` int(11) DEFAULT NULL, + `source_type` varchar(16) DEFAULT NULL, + `date_envoi` datetime DEFAULT NULL, + `error_text` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_mailing_cibles` (`fk_mailing`,`email`), + KEY `idx_mailing_cibles_email` (`email`) +) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_mailing_cibles` +-- + +LOCK TABLES `llx_mailing_cibles` WRITE; +/*!40000 ALTER TABLE `llx_mailing_cibles` DISABLE KEYS */; +INSERT INTO `llx_mailing_cibles` VALUES (1,1,0,'Dupont','Alain','toto@aa.com','Date fin=10/07/2011',NULL,0,'0',NULL,NULL,NULL,NULL),(2,2,0,'Swiss customer supplier','','abademail@aa.com','',NULL,0,'0',NULL,NULL,NULL,NULL),(3,2,0,'Smith Vick','','vsmith@email.com','',NULL,0,'0',NULL,NULL,NULL,NULL),(4,3,0,'Swiss customer supplier','','abademail@aa.com','',NULL,1,'0',NULL,NULL,'2017-01-29 21:36:40',NULL),(5,3,0,'Smith Vick','','vsmith@email.com','',NULL,1,'0',NULL,NULL,'2017-01-29 21:36:40',NULL),(7,3,0,'Name 2','Firstname 2','emailtest2@example.com','','522b79aedf231576db576d246d82a0d7',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(8,3,0,'Name 3','Firstname 3','emailtest3@example.com','','f3e74e96a64068093af469b6826a75bf',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(9,3,0,'Name 4','Firstname 4','emailtest4@example.com','','fdacf67090698e0216f5c9a449e7404a',2,'',NULL,'file','2017-01-29 21:36:40',NULL),(10,3,0,'Name 5','Firstname 5','emailtest5@example.com','','38b4e4895bf5e7f9969c9ad9bbcd0dce',3,'',NULL,'file','2017-01-29 21:36:40',NULL),(11,3,0,'Name 1','Firstname 1','emailtest1@example.com','','b2543a771e2a10c694fc6437859e29ae',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(12,3,0,'Do','John','johndoe@example.com','','bdb70b6835ca053b113e7ac53c83efbe',-1,'',NULL,'file','2017-01-29 21:36:40','Invalid email'),(13,3,0,'Smith,Alan','','alan.smith@example.com','','326b9fb6d83f58b7ce5ca28a51022c83',2,'',NULL,'file','2017-01-29 21:36:40',NULL),(15,3,0,'Bowl','Kathy','kathy.bowl@example.com','','0848d51a04ad29adf28de7d6efe63091',2,'',NULL,'file','2017-01-29 21:36:40',NULL),(16,3,0,'Ducanseen','Herbert','herbert@example.com','','0585f4366c7b0c8bab592acb7256a409',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(17,3,0,'Djay','Djay','djay@example.com','','fad171648dcd8449d6e2f8246724f153',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(18,3,0,'','','alice.bigo@example.com','','86b03b13caec209e9a9d96979b7154b8',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(19,3,0,'','','bob.markus@example.com','','06df0b2b930718949a5afee280f04e6b',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(20,3,0,'Customer 1','','mycustomer1@example.com','','cac0a5a38fa9e67ed63d0753e08cd919',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(21,3,0,'Customer 2','','mycustomer2@example.com','','19b631ee27e7036684675f2db35c54f0',0,'',NULL,'file',NULL,NULL),(22,3,0,'Customer 3','','mycustomer3@example.com','','bfd49e2db7c511e2d5bde30eda7db07a',0,'',NULL,'file',NULL,NULL),(23,3,0,'Customer 4','','mycustomer4@example.com','','de4640d0684c62dd83ffc27ff20d5938',0,'',NULL,'file',NULL,NULL),(24,3,0,'Customer 5','','mycustomer5@example.com','','2eb5786291928fd23ca0354ac261ec9b',0,'',NULL,'file',NULL,NULL),(25,3,0,'Customer 6','','mycustomer6@example.com','','c50c85b7f3370232c1d1335e17f953ca',0,'',NULL,'file',NULL,NULL),(26,3,0,'Prospect 1','','myprospect1@example.com','','553b1f7417f7c96290cdec5ca4c560f7',0,'',NULL,'file',NULL,NULL),(27,3,0,'Prospect 2','','myprospect2@example.com','','de45e526168546315ff4fedb54e63102',0,'',NULL,'file',NULL,NULL),(28,3,0,'Prospect 3','','myprospect3@example.com','','466d946e7c46881334f4abe427d382fa',0,'',NULL,'file',NULL,NULL),(29,3,0,'Prospect 4','','myprospect4@example.com','','619d1ec47318842971db7fa266b6d74a',0,'',NULL,'file',NULL,NULL),(30,3,0,'Prospect 5','','myprospect5@example.com','','e301713dcbf58d33ef1ae540dee58ad7',0,'',NULL,'file',NULL,NULL),(31,3,0,'Prospect 6','','myprospect6@example.com','','26fcbd0c641a535bfc14a80a867a61f2',0,'',NULL,'file',NULL,NULL),(32,5,0,'Swiss customer supplier','','abademail@aa.com','','0e7d20e3c9b1612a75eab5d12da84060',0,'0',NULL,'',NULL,NULL),(33,5,0,'Smith Vick','','vsmith@email.com','','cab14f12668ccb2c92843969819c6c6e',0,'0',NULL,'',NULL,NULL),(34,5,0,'Name 2','Firstname 2','emailtest2@example.com','','1b6adeceaac7e2b9c399c877f8b1a616',0,'',NULL,'file',NULL,NULL),(35,5,0,'Name 3','Firstname 3','emailtest3@example.com','','c9f6f80ba118c378aef4974e17b01a07',0,'',NULL,'file',NULL,NULL),(36,5,0,'Name 4','Firstname 4','emailtest4@example.com','','75a3051301db736a2bb7722de7b4ece1',0,'',NULL,'file',NULL,NULL),(37,5,0,'Name 5','Firstname 5','emailtest5@example.com','','a9e292e70ec11ed58718c9f5da58f870',0,'',NULL,'file',NULL,NULL),(38,5,0,'Name 1','Firstname 1','emailtest1@example.com','','0243e796981c9e82cc23d8a6a5a23570',0,'',NULL,'file',NULL,NULL),(39,5,0,'Do','John','johndoe@example.com','','7db6219748fbad348b1aa89f2014d529',0,'',NULL,'file',NULL,NULL),(40,5,0,'Smith,Alan','','alan.smith@example.com','','5006f91f3bd97918460b6dc3edf4cd7f',0,'',NULL,'file',NULL,NULL),(41,5,0,'Bowl','Kathy','kathy.bowl@example.com','','377ac5b241f2d5bf421a7162c60bf7b6',0,'',NULL,'file',NULL,NULL),(42,5,0,'Ducanseen','Herbert','herbert@example.com','','10e1b891a249ee8046f1686a0a44d773',0,'',NULL,'file',NULL,NULL),(43,5,0,'Djay','Djay','djay@example.com','','6cf76a2b74874caa6b8eced78f63bca1',0,'',NULL,'file',NULL,NULL),(44,5,0,'','','alice.bigo@example.com','','61651804afc02887a3934ab042285044',0,'',NULL,'file',NULL,NULL),(45,5,0,'','','bob.markus@example.com','','b6d3e934e4bc92d194b43041260564da',0,'',NULL,'file',NULL,NULL),(46,5,0,'Customer 1','','mycustomer1@example.com','','fa9ade908a5a420e7dc64e62d1d9eb65',0,'',NULL,'file',NULL,NULL),(47,5,0,'Customer 2','','mycustomer2@example.com','','5d502923487f0f4226ab9f5f71102857',0,'',NULL,'file',NULL,NULL),(48,5,0,'Customer 3','','mycustomer3@example.com','','0b7da54f9969554eee95684069173f23',0,'',NULL,'file',NULL,NULL),(49,5,0,'Customer 4','','mycustomer4@example.com','','b073cf47a6af4740c76620ab4442033c',0,'',NULL,'file',NULL,NULL),(50,5,0,'Customer 5','','mycustomer5@example.com','','468b7404027e91edf437c3980619c8f6',0,'',NULL,'file',NULL,NULL),(51,5,0,'Customer 6','','mycustomer6@example.com','','cb196086497f64cd23dd68aed2bf5cc8',0,'',NULL,'file',NULL,NULL),(52,5,0,'Prospect 1','','myprospect1@example.com','','9854ed6528267f30c8c22c24384b31ae',0,'',NULL,'file',NULL,NULL),(53,5,0,'Prospect 2','','myprospect2@example.com','','b37ed581bbc51b6d9a334e1626b5fe22',0,'',NULL,'file',NULL,NULL),(54,5,0,'Prospect 3','','myprospect3@example.com','','8bedd7821877a72841efae36691f7765',0,'',NULL,'file',NULL,NULL),(55,5,0,'Prospect 4','','myprospect4@example.com','','518353a5cfb1a628ada10874ac4e0098',0,'',NULL,'file',NULL,NULL),(56,5,0,'Prospect 5','','myprospect5@example.com','','de392a2999e262fec63c9de4a3fe7613',0,'',NULL,'file',NULL,NULL),(57,5,0,'Prospect 6','','myprospect6@example.com','','56256cc297c4870c514819cdb4e6b95c',0,'',NULL,'file',NULL,NULL),(58,5,0,'Prospect 7','','myprospect7@example.com','','d32512607d4e74d6f71d031538128721',0,'',NULL,'file',NULL,NULL),(59,5,0,'Prospect 8','','myprospect8@example.com','','427eeb75492ede5355996a8df998f9de',0,'',NULL,'file',NULL,NULL); +/*!40000 ALTER TABLE `llx_mailing_cibles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_menu` +-- + +DROP TABLE IF EXISTS `llx_menu`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_menu` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `menu_handler` varchar(16) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `module` varchar(64) DEFAULT NULL, + `type` varchar(4) NOT NULL, + `mainmenu` varchar(100) NOT NULL, + `fk_menu` int(11) NOT NULL, + `fk_leftmenu` varchar(24) DEFAULT NULL, + `fk_mainmenu` varchar(24) DEFAULT NULL, + `position` int(11) NOT NULL, + `url` varchar(255) NOT NULL, + `target` varchar(100) DEFAULT NULL, + `titre` varchar(255) NOT NULL, + `langs` varchar(100) DEFAULT NULL, + `level` smallint(6) DEFAULT NULL, + `leftmenu` varchar(100) DEFAULT NULL, + `perms` varchar(255) DEFAULT NULL, + `enabled` varchar(255) DEFAULT '1', + `usertype` int(11) NOT NULL DEFAULT '0', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_menu_uk_menu` (`menu_handler`,`fk_menu`,`position`,`url`,`entity`), + KEY `idx_menu_menuhandler_type` (`menu_handler`,`type`) +) ENGINE=InnoDB AUTO_INCREMENT=166442 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_menu` +-- + +LOCK TABLES `llx_menu` WRITE; +/*!40000 ALTER TABLE `llx_menu` DISABLE KEYS */; +INSERT INTO `llx_menu` VALUES (103094,'all',2,'agenda','top','agenda',0,NULL,NULL,100,'/comm/action/index.php','','Agenda','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103095,'all',2,'agenda','left','agenda',103094,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103096,'all',2,'agenda','left','agenda',103095,NULL,NULL,101,'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction','commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103097,'all',2,'agenda','left','agenda',103095,NULL,NULL,102,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Calendar','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103098,'all',2,'agenda','left','agenda',103097,NULL,NULL,103,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103099,'all',2,'agenda','left','agenda',103097,NULL,NULL,104,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103100,'all',2,'agenda','left','agenda',103097,NULL,NULL,105,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103101,'all',2,'agenda','left','agenda',103097,NULL,NULL,106,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103102,'all',2,'agenda','left','agenda',103095,NULL,NULL,112,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda','','List','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103103,'all',2,'agenda','left','agenda',103102,NULL,NULL,113,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103104,'all',2,'agenda','left','agenda',103102,NULL,NULL,114,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103105,'all',2,'agenda','left','agenda',103102,NULL,NULL,115,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103106,'all',2,'agenda','left','agenda',103102,NULL,NULL,116,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103107,'all',2,'agenda','left','agenda',103095,NULL,NULL,120,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103108,'all',2,'pos','top','pos',0,NULL,NULL,100,'/pos/backend/listefac.php','','POS','pos@pos',NULL,'1','1','1',2,'2013-03-13 20:33:09'),(103109,'all',2,'pos','left','pos',103108,NULL,NULL,100,'/pos/backend/list.php','','Tickets','pos@pos',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103110,'all',2,'pos','left','pos',103109,NULL,NULL,100,'/pos/backend/list.php','','List','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103111,'all',2,'pos','left','pos',103110,NULL,NULL,100,'/pos/backend/list.php?viewstatut=0','','StatusTicketDraft','pos@pos',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103112,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/list.php?viewstatut=1','','StatusTicketClosed','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103113,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/list.php?viewstatut=2','','StatusTicketProcessed','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103114,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/list.php?viewtype=1','','StatusTicketReturned','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103115,'all',2,'pos','left','pos',103108,NULL,NULL,100,'/pos/backend/listefac.php','','Factures','pos@pos',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103116,'all',2,'pos','left','pos',103115,NULL,NULL,100,'/pos/backend/listefac.php','','List','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103117,'all',2,'pos','left','pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=0','','BillStatusDraft','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103118,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=1','','BillStatusValidated','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103119,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=2&viewtype=0','','BillStatusPaid','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103120,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewtype=2','','BillStatusReturned','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103121,'all',2,'pos','left','@pos',103108,NULL,NULL,100,'/pos/frontend/index.php','','POS','main',NULL,NULL,'$user->rights->pos->frontend','1',0,'2013-03-13 20:33:09'),(103122,'all',2,'pos','left','@pos',103121,NULL,NULL,100,'/pos/frontend/index.php','','NewTicket','main',NULL,NULL,'$user->rights->pos->frontend','1',0,'2013-03-13 20:33:09'),(103123,'all',2,'pos','left','@pos',103121,NULL,NULL,101,'/pos/backend/closes.php','','CloseandArching','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103124,'all',2,'pos','left','@pos',103108,NULL,NULL,100,'/pos/backend/terminal/cash.php','','Terminal','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103125,'all',2,'pos','left','@pos',103124,NULL,NULL,100,'/pos/backend/terminal/card.php?action=create','','NewCash','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103126,'all',2,'pos','left','@pos',103124,NULL,NULL,101,'/pos/backend/terminal/cash.php','','List','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103127,'all',2,'pos','left','@pos',103123,NULL,NULL,101,'/pos/backend/closes.php?viewstatut=0','','Arqueo','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103128,'all',2,'pos','left','@pos',103123,NULL,NULL,102,'/pos/backend/closes.php?viewstatut=1','','Closes','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103129,'all',2,'pos','left','@pos',103108,NULL,NULL,102,'/pos/backend/transfers.php','','Transfer','main',NULL,NULL,'$user->rights->pos->transfer','1',0,'2013-03-13 20:33:09'),(103130,'all',2,'pos','left','@pos',103108,NULL,NULL,102,'/pos/backend/resultat/index.php','','Rapport','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103131,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/casoc.php','','ReportsCustomer','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103132,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/causer.php','','ReportsUser','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103133,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/sellsjournal.php','','ReportsSells','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103134,'all',2,'opensurvey','top','opensurvey',0,NULL,NULL,200,'/opensurvey/index.php','','Surveys','opensurvey',NULL,NULL,'$user->rights->opensurvey->survey->read','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103135,'all',2,'opensurvey','left','opensurvey',-1,NULL,'opensurvey',200,'/opensurvey/index.php?mainmenu=opensurvey&leftmenu=opensurvey','','Survey','opensurvey@opensurvey',NULL,'opensurvey','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103136,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',210,'/opensurvey/public/index.php','_blank','NewSurvey','opensurvey@opensurvey',NULL,'opensurvey_new','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103137,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',220,'/opensurvey/list.php','','List','opensurvey@opensurvey',NULL,'opensurvey_list','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(124179,'all',1,'cashdesk','top','cashdesk',0,NULL,NULL,100,'/cashdesk/index.php?user=__LOGIN__','pointofsale','CashDeskMenu','cashdesk',NULL,NULL,'$user->rights->cashdesk->use','$conf->cashdesk->enabled',0,'2015-11-15 22:38:33'),(124210,'all',1,'margins','left','accountancy',-1,NULL,'accountancy',100,'/margin/index.php','','Margins','margins',NULL,'margins','$user->rights->margins->liretous','$conf->margin->enabled',2,'2015-11-15 22:41:47'),(145086,'all',1,'supplier_proposal','left','commercial',-1,NULL,'commercial',300,'/supplier_proposal/index.php','','SupplierProposalsShort','supplier_proposal',NULL,'supplier_proposalsubmenu','$user->rights->supplier_proposal->lire','$conf->supplier_proposal->enabled',2,'2016-07-30 11:13:20'),(145087,'all',1,'supplier_proposal','left','commercial',-1,'supplier_proposalsubmenu','commercial',301,'/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals','','SupplierProposalNew','supplier_proposal',NULL,NULL,'$user->rights->supplier_proposal->creer','$conf->supplier_proposal->enabled',2,'2016-07-30 11:13:20'),(145088,'all',1,'supplier_proposal','left','commercial',-1,'supplier_proposalsubmenu','commercial',302,'/supplier_proposal/list.php?leftmenu=supplier_proposals','','List','supplier_proposal',NULL,NULL,'$user->rights->supplier_proposal->lire','$conf->supplier_proposal->enabled',2,'2016-07-30 11:13:20'),(145089,'all',1,'supplier_proposal','left','commercial',-1,'supplier_proposalsubmenu','commercial',303,'/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier','','Statistics','supplier_proposal',NULL,NULL,'$user->rights->supplier_proposal->lire','$conf->supplier_proposal->enabled',2,'2016-07-30 11:13:20'),(145090,'all',1,'resource','left','tools',-1,NULL,'tools',100,'/resource/list.php','','MenuResourceIndex','resource',NULL,'resource','$user->rights->resource->read','1',0,'2016-07-30 11:13:32'),(145091,'all',1,'resource','left','tools',-1,'resource','tools',101,'/resource/add.php','','MenuResourceAdd','resource',NULL,NULL,'$user->rights->resource->read','1',0,'2016-07-30 11:13:32'),(145092,'all',1,'resource','left','tools',-1,'resource','tools',102,'/resource/list.php','','List','resource',NULL,NULL,'$user->rights->resource->read','1',0,'2016-07-30 11:13:32'),(145127,'all',1,'printing','left','home',-1,'admintools','home',300,'/printing/index.php?mainmenu=home&leftmenu=admintools','','MenuDirectPrinting','printing',NULL,NULL,'$user->rights->printing->read','$conf->printing->enabled && $leftmenu==\'admintools\'',0,'2017-01-29 15:12:44'),(161088,'auguria',1,'','top','home',0,NULL,NULL,10,'/index.php?mainmenu=home&leftmenu=','','Home','',-1,'','','1',2,'2017-08-30 15:14:30'),(161089,'auguria',1,'societe|fournisseur','top','companies',0,NULL,NULL,20,'/societe/index.php?mainmenu=companies&leftmenu=','','ThirdParties','companies',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)',2,'2017-08-30 15:14:30'),(161090,'auguria',1,'product|service','top','products',0,NULL,NULL,30,'/product/index.php?mainmenu=products&leftmenu=','','Products/Services','products',-1,'','$user->rights->produit->lire||$user->rights->service->lire','$conf->product->enabled || $conf->service->enabled',0,'2017-08-30 15:14:30'),(161092,'auguria',1,'propal|commande|fournisseur|contrat|ficheinter','top','commercial',0,NULL,NULL,40,'/comm/index.php?mainmenu=commercial&leftmenu=','','Commercial','commercial',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(161093,'auguria',1,'comptabilite|accounting|facture|don|tax|salaries|loan','top','accountancy',0,NULL,NULL,50,'/compta/index.php?mainmenu=accountancy&leftmenu=','','MenuFinancial','compta',-1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read','$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled',2,'2017-08-30 15:14:30'),(161094,'auguria',1,'projet','top','project',0,NULL,NULL,70,'/projet/index.php?mainmenu=project&leftmenu=','','Projects','projects',-1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(161095,'auguria',1,'mailing|export|import|opensurvey|resource','top','tools',0,NULL,NULL,90,'/core/tools.php?mainmenu=tools&leftmenu=','','Tools','other',-1,'','$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read || $user->rights->resource->read','$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled || $conf->resource->enabled',2,'2017-08-30 15:14:30'),(161100,'auguria',1,'adherent','top','members',0,NULL,NULL,110,'/adherents/index.php?mainmenu=members&leftmenu=','','Members','members',-1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(161101,'auguria',1,'banque|prelevement','top','bank',0,NULL,NULL,60,'/compta/bank/index.php?mainmenu=bank&leftmenu=bank','','MenuBankCash','banks',-1,'','$user->rights->banque->lire || $user->rights->prelevement->bons->lire','$conf->banque->enabled || $conf->prelevement->enabled',0,'2017-08-30 15:14:30'),(161102,'auguria',1,'hrm|holiday|deplacement|expensereport','top','hrm',0,NULL,NULL,80,'/hrm/index.php?mainmenu=hrm&leftmenu=','','HRM','holiday',-1,'','$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire','$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(161177,'auguria',1,'','left','home',161088,NULL,NULL,0,'/index.php','','MyDashboard','',0,'','','1',2,'2017-08-30 15:14:30'),(161187,'auguria',1,'','left','home',161088,NULL,NULL,1,'/admin/index.php?leftmenu=setup','','Setup','admin',0,'setup','','$user->admin',2,'2017-08-30 15:14:30'),(161188,'auguria',1,'','left','home',161187,NULL,NULL,1,'/admin/company.php?leftmenu=setup','','MenuCompanySetup','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161189,'auguria',1,'','left','home',161187,NULL,NULL,4,'/admin/ihm.php?leftmenu=setup','','GUISetup','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161190,'auguria',1,'','left','home',161187,NULL,NULL,2,'/admin/modules.php?leftmenu=setup','','Modules','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161191,'auguria',1,'','left','home',161187,NULL,NULL,6,'/admin/boxes.php?leftmenu=setup','','Boxes','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161192,'auguria',1,'','left','home',161187,NULL,NULL,3,'/admin/menus.php?leftmenu=setup','','Menus','admin',1,'','','$leftmenu==\'setup\'',2,'2017-09-06 08:29:47'),(161193,'auguria',1,'','left','home',161187,NULL,NULL,7,'/admin/delais.php?leftmenu=setup','','Alerts','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161194,'auguria',1,'','left','home',161187,NULL,NULL,10,'/admin/pdf.php?leftmenu=setup','','PDF','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161195,'auguria',1,'','left','home',161187,NULL,NULL,8,'/admin/security_other.php?leftmenu=setup','','Security','admin',1,'','','$leftmenu==\'setup\'',2,'2017-09-06 08:29:36'),(161196,'auguria',1,'','left','home',161187,NULL,NULL,11,'/admin/mails.php?leftmenu=setup','','Emails','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161197,'auguria',1,'','left','home',161187,NULL,NULL,9,'/admin/limits.php?leftmenu=setup','','MenuLimits','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161198,'auguria',1,'','left','home',161187,NULL,NULL,13,'/admin/dict.php?leftmenu=setup','','Dictionary','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161199,'auguria',1,'','left','home',161187,NULL,NULL,14,'/admin/const.php?leftmenu=setup','','OtherSetup','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161200,'auguria',1,'','left','home',161187,NULL,NULL,12,'/admin/sms.php?leftmenu=setup','','SMS','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161201,'auguria',1,'','left','home',161187,NULL,NULL,4,'/admin/translation.php?leftmenu=setup','','Translation','admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161288,'auguria',1,'','left','home',161387,NULL,NULL,0,'/admin/system/dolibarr.php?leftmenu=admintools','','InfoDolibarr','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161289,'auguria',1,'','left','home',161288,NULL,NULL,2,'/admin/system/modules.php?leftmenu=admintools','','Modules','admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161290,'auguria',1,'','left','home',161288,NULL,NULL,3,'/admin/triggers.php?leftmenu=admintools','','Triggers','admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161291,'auguria',1,'','left','home',161288,NULL,NULL,4,'/admin/system/filecheck.php?leftmenu=admintools','','FileCheck','admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161292,'auguria',1,'','left','home',161387,NULL,NULL,1,'/admin/system/browser.php?leftmenu=admintools','','InfoBrowser','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161293,'auguria',1,'','left','home',161387,NULL,NULL,2,'/admin/system/os.php?leftmenu=admintools','','InfoOS','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161294,'auguria',1,'','left','home',161387,NULL,NULL,3,'/admin/system/web.php?leftmenu=admintools','','InfoWebServer','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161295,'auguria',1,'','left','home',161387,NULL,NULL,4,'/admin/system/phpinfo.php?leftmenu=admintools','','InfoPHP','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161297,'auguria',1,'','left','home',161387,NULL,NULL,5,'/admin/system/database.php?leftmenu=admintools','','InfoDatabase','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161387,'auguria',1,'','left','home',161088,NULL,NULL,2,'/admin/tools/index.php?leftmenu=admintools','','AdminTools','admin',0,'admintools','','$user->admin',2,'2017-08-30 15:14:30'),(161388,'auguria',1,'','left','home',161387,NULL,NULL,6,'/admin/tools/dolibarr_export.php?leftmenu=admintools','','Backup','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161389,'auguria',1,'','left','home',161387,NULL,NULL,7,'/admin/tools/dolibarr_import.php?leftmenu=admintools','','Restore','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161392,'auguria',1,'','left','home',161387,NULL,NULL,8,'/admin/tools/update.php?leftmenu=admintools','','MenuUpgrade','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161393,'auguria',1,'','left','home',161387,NULL,NULL,9,'/admin/tools/eaccelerator.php?leftmenu=admintools','','EAccelerator','admin',1,'','','$leftmenu==\"admintools\" && function_exists(\"eaccelerator_info\")',2,'2017-08-30 15:14:30'),(161394,'auguria',1,'','left','home',161387,NULL,NULL,10,'/admin/tools/listevents.php?leftmenu=admintools','','Audit','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161395,'auguria',1,'','left','home',161387,NULL,NULL,11,'/admin/tools/listsessions.php?leftmenu=admintools','','Sessions','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161396,'auguria',1,'','left','home',161387,NULL,NULL,12,'/admin/tools/purge.php?leftmenu=admintools','','Purge','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161398,'auguria',1,'','left','home',161387,NULL,NULL,14,'/admin/system/about.php?leftmenu=admintools','','ExternalResources','admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161407,'auguria',1,'','left','home',161387,NULL,NULL,15,'/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools','','ProductVatMassChange','products',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161487,'auguria',1,'','left','home',161088,NULL,NULL,4,'/user/home.php?leftmenu=users','','MenuUsersAndGroups','users',0,'users','','1',2,'2017-08-30 15:14:30'),(161488,'auguria',1,'','left','home',161487,NULL,NULL,0,'/user/index.php?leftmenu=users','','Users','users',1,'','$user->rights->user->user->lire || $user->admin','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161489,'auguria',1,'','left','home',161488,NULL,NULL,0,'/user/card.php?leftmenu=users&action=create','','NewUser','users',2,'','($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161490,'auguria',1,'','left','home',161487,NULL,NULL,1,'/user/group/index.php?leftmenu=users','','Groups','users',1,'','(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161491,'auguria',1,'','left','home',161490,NULL,NULL,0,'/user/group/card.php?leftmenu=users&action=create','','NewGroup','users',2,'','(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161587,'auguria',1,'','left','companies',161089,NULL,NULL,0,'/societe/index.php?leftmenu=thirdparties','','ThirdParty','companies',0,'thirdparties','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161588,'auguria',1,'','left','companies',161587,NULL,NULL,0,'/societe/card.php?action=create','','MenuNewThirdParty','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161589,'auguria',1,'','left','companies',161587,NULL,NULL,0,'/societe/list.php?action=create','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161590,'auguria',1,'','left','companies',161587,NULL,NULL,5,'/societe/list.php?type=f&leftmenu=suppliers','','ListSuppliersShort','suppliers',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161591,'auguria',1,'','left','companies',161590,NULL,NULL,0,'/societe/card.php?leftmenu=supplier&action=create&type=f','','NewSupplier','suppliers',2,'','$user->rights->societe->creer','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161593,'auguria',1,'','left','companies',161587,NULL,NULL,3,'/societe/list.php?type=p&leftmenu=prospects','','ListProspectsShort','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161594,'auguria',1,'','left','companies',161593,NULL,NULL,0,'/societe/card.php?leftmenu=prospects&action=create&type=p','','MenuNewProspect','companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161596,'auguria',1,'','left','companies',161587,NULL,NULL,4,'/societe/list.php?type=c&leftmenu=customers','','ListCustomersShort','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161597,'auguria',1,'','left','companies',161596,NULL,NULL,0,'/societe/card.php?leftmenu=customers&action=create&type=c','','MenuNewCustomer','companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161687,'auguria',1,'','left','companies',161089,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','ContactsAddresses','companies',0,'contacts','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161688,'auguria',1,'','left','companies',161687,NULL,NULL,0,'/contact/card.php?leftmenu=contacts&action=create','','NewContactAddress','companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161689,'auguria',1,'','left','companies',161687,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161691,'auguria',1,'','left','companies',161689,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=p','','ThirdPartyProspects','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161692,'auguria',1,'','left','companies',161689,NULL,NULL,2,'/contact/list.php?leftmenu=contacts&type=c','','ThirdPartyCustomers','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161693,'auguria',1,'','left','companies',161689,NULL,NULL,3,'/contact/list.php?leftmenu=contacts&type=f','','ThirdPartySuppliers','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161694,'auguria',1,'','left','companies',161689,NULL,NULL,4,'/contact/list.php?leftmenu=contacts&type=o','','Others','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161737,'auguria',1,'','left','companies',161089,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=1','','SuppliersCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161738,'auguria',1,'','left','companies',161737,NULL,NULL,0,'/categories/card.php?action=create&type=1','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161747,'auguria',1,'','left','companies',161089,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=2','','CustomersProspectsCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161748,'auguria',1,'','left','companies',161747,NULL,NULL,0,'/categories/card.php?action=create&type=2','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161757,'auguria',1,'','left','companies',161089,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=4','','ContactCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161758,'auguria',1,'','left','companies',161757,NULL,NULL,0,'/categories/card.php?action=create&type=4','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(162187,'auguria',1,'','left','commercial',161092,NULL,NULL,4,'/comm/propal/index.php?leftmenu=propals','','Prop','propal',0,'propals','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162188,'auguria',1,'','left','commercial',162187,NULL,NULL,0,'/comm/propal/card.php?action=create&leftmenu=propals','','NewPropal','propal',1,'','$user->rights->propale->creer','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162189,'auguria',1,'','left','commercial',162187,NULL,NULL,1,'/comm/propal/list.php?leftmenu=propals','','List','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162190,'auguria',1,'','left','commercial',162189,NULL,NULL,2,'/comm/propal/list.php?leftmenu=propals&viewstatut=0','','PropalsDraft','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162191,'auguria',1,'','left','commercial',162189,NULL,NULL,3,'/comm/propal/list.php?leftmenu=propals&viewstatut=1','','PropalsOpened','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162192,'auguria',1,'','left','commercial',162189,NULL,NULL,4,'/comm/propal/list.php?leftmenu=propals&viewstatut=2','','PropalStatusSigned','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162193,'auguria',1,'','left','commercial',162189,NULL,NULL,5,'/comm/propal/list.php?leftmenu=propals&viewstatut=3','','PropalStatusNotSigned','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162194,'auguria',1,'','left','commercial',162189,NULL,NULL,6,'/comm/propal/list.php?leftmenu=propals&viewstatut=4','','PropalStatusBilled','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162197,'auguria',1,'','left','commercial',162187,NULL,NULL,4,'/comm/propal/stats/index.php?leftmenu=propals','','Statistics','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162287,'auguria',1,'','left','commercial',161092,NULL,NULL,5,'/commande/index.php?leftmenu=orders','','CustomersOrders','orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162288,'auguria',1,'','left','commercial',162287,NULL,NULL,0,'/commande/card.php?action=create&leftmenu=orders','','NewOrder','orders',1,'','$user->rights->commande->creer','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162289,'auguria',1,'','left','commercial',162287,NULL,NULL,1,'/commande/list.php?leftmenu=orders','','List','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162290,'auguria',1,'','left','commercial',162289,NULL,NULL,2,'/commande/list.php?leftmenu=orders&viewstatut=0','','StatusOrderDraftShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162291,'auguria',1,'','left','commercial',162289,NULL,NULL,3,'/commande/list.php?leftmenu=orders&viewstatut=1','','StatusOrderValidated','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162292,'auguria',1,'','left','commercial',162289,NULL,NULL,4,'/commande/list.php?leftmenu=orders&viewstatut=2','','StatusOrderOnProcessShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162293,'auguria',1,'','left','commercial',162289,NULL,NULL,5,'/commande/list.php?leftmenu=orders&viewstatut=3','','StatusOrderToBill','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162294,'auguria',1,'','left','commercial',162289,NULL,NULL,6,'/commande/list.php?leftmenu=orders&viewstatut=4','','StatusOrderProcessed','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162295,'auguria',1,'','left','commercial',162289,NULL,NULL,7,'/commande/list.php?leftmenu=orders&viewstatut=-1','','StatusOrderCanceledShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162296,'auguria',1,'','left','commercial',162287,NULL,NULL,4,'/commande/stats/index.php?leftmenu=orders','','Statistics','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162387,'auguria',1,'','left','commercial',161090,NULL,NULL,6,'/expedition/index.php?leftmenu=sendings','','Shipments','sendings',0,'sendings','$user->rights->expedition->lire','$conf->expedition->enabled',2,'2017-08-30 15:14:30'),(162388,'auguria',1,'','left','commercial',162387,NULL,NULL,0,'/expedition/card.php?action=create2&leftmenu=sendings','','NewSending','sendings',1,'','$user->rights->expedition->creer','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162389,'auguria',1,'','left','commercial',162387,NULL,NULL,1,'/expedition/list.php?leftmenu=sendings','','List','sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162390,'auguria',1,'','left','commercial',162387,NULL,NULL,2,'/expedition/stats/index.php?leftmenu=sendings','','Statistics','sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162487,'auguria',1,'','left','commercial',161092,NULL,NULL,7,'/contrat/index.php?leftmenu=contracts','','Contracts','contracts',0,'contracts','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162488,'auguria',1,'','left','commercial',162487,NULL,NULL,0,'/contrat/card.php?&action=create&leftmenu=contracts','','NewContract','contracts',1,'','$user->rights->contrat->creer','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162489,'auguria',1,'','left','commercial',162487,NULL,NULL,1,'/contrat/list.php?leftmenu=contracts','','List','contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162490,'auguria',1,'','left','commercial',162487,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts','','MenuServices','contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162491,'auguria',1,'','left','commercial',162490,NULL,NULL,0,'/contrat/services.php?leftmenu=contracts&mode=0','','MenuInactiveServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162492,'auguria',1,'','left','commercial',162490,NULL,NULL,1,'/contrat/services.php?leftmenu=contracts&mode=4','','MenuRunningServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162493,'auguria',1,'','left','commercial',162490,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts&mode=4&filter=expired','','MenuExpiredServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162494,'auguria',1,'','left','commercial',162490,NULL,NULL,3,'/contrat/services.php?leftmenu=contracts&mode=5','','MenuClosedServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162587,'auguria',1,'','left','commercial',161092,NULL,NULL,8,'/fichinter/list.php?leftmenu=ficheinter','','Interventions','interventions',0,'ficheinter','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162588,'auguria',1,'','left','commercial',162587,NULL,NULL,0,'/fichinter/card.php?action=create&leftmenu=ficheinter','','NewIntervention','interventions',1,'','$user->rights->ficheinter->creer','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162589,'auguria',1,'','left','commercial',162587,NULL,NULL,1,'/fichinter/list.php?leftmenu=ficheinter','','List','interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162590,'auguria',1,'','left','commercial',162587,NULL,NULL,2,'/fichinter/stats/index.php?leftmenu=ficheinter','','Statistics','interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162687,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/fourn/facture/list.php?leftmenu=suppliers_bills','','BillsSuppliers','bills',0,'supplier_bills','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162688,'auguria',1,'','left','accountancy',162687,NULL,NULL,0,'/fourn/facture/card.php?action=create&leftmenu=suppliers_bills','','NewBill','bills',1,'','$user->rights->fournisseur->facture->creer','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162689,'auguria',1,'','left','accountancy',162687,NULL,NULL,1,'/fourn/facture/list.php?leftmenu=suppliers_bills','','List','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162690,'auguria',1,'','left','accountancy',162687,NULL,NULL,2,'/fourn/facture/paiement.php?leftmenu=suppliers_bills','','Payments','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162691,'auguria',1,'','left','accountancy',162687,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier','','Statistics','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162692,'auguria',1,'','left','accountancy',162690,NULL,NULL,1,'/fourn/facture/rapport.php?leftmenu=suppliers_bills','','Reporting','bills',2,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162787,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills','','BillsCustomers','bills',0,'customer_bills','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162788,'auguria',1,'','left','accountancy',162787,NULL,NULL,3,'/compta/facture/card.php?action=create&leftmenu=customers_bills','','NewBill','bills',1,'','$user->rights->facture->creer','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162789,'auguria',1,'','left','accountancy',162787,NULL,NULL,5,'/compta/facture/fiche-rec.php?leftmenu=customers_bills','','ListOfTemplates','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162791,'auguria',1,'','left','accountancy',162787,NULL,NULL,6,'/compta/paiement/list.php?leftmenu=customers_bills','','Payments','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162792,'auguria',1,'','left','accountancy',162787,NULL,NULL,4,'/compta/facture/list.php?leftmenu=customers_bills','','List','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162797,'auguria',1,'','left','accountancy',162791,NULL,NULL,1,'/compta/paiement/rapport.php?leftmenu=customers_bills','','Reportings','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162798,'auguria',1,'','left','accountancy',161101,NULL,NULL,9,'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank','','MenuChequeDeposits','bills',0,'checks','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162799,'auguria',1,'','left','accountancy',162798,NULL,NULL,0,'/compta/paiement/cheque/card.php?leftmenu=checks&action=new','','NewCheckDeposit','compta',1,'','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162800,'auguria',1,'','left','accountancy',162798,NULL,NULL,1,'/compta/paiement/cheque/list.php?leftmenu=checks','','List','bills',1,'','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162801,'auguria',1,'','left','accountancy',162787,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills','','Statistics','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162807,'auguria',1,'','left','accountancy',162792,NULL,NULL,1,'/compta/facture/list.php?leftmenu=customers_bills&search_status=0','','BillShortStatusDraft','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162808,'auguria',1,'','left','accountancy',162792,NULL,NULL,2,'/compta/facture/list.php?leftmenu=customers_bills&search_status=1','','BillShortStatusNotPaid','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162809,'auguria',1,'','left','accountancy',162792,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills&search_status=2','','BillShortStatusPaid','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162810,'auguria',1,'','left','accountancy',162792,NULL,NULL,4,'/compta/facture/list.php?leftmenu=customers_bills&search_status=3','','BillShortStatusCanceled','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162987,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/commande/list.php?leftmenu=orders&viewstatut=3','','MenuOrdersToBill','orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',0,'2017-08-30 15:14:30'),(163087,'auguria',1,'','left','accountancy',161093,NULL,NULL,4,'/don/index.php?leftmenu=donations&mainmenu=accountancy','','Donations','donations',0,'donations','$user->rights->don->lire','$conf->don->enabled',2,'2017-08-30 15:14:30'),(163088,'auguria',1,'','left','accountancy',163087,NULL,NULL,0,'/don/card.php?leftmenu=donations&mainmenu=accountancy&action=create','','NewDonation','donations',1,'','$user->rights->don->creer','$conf->don->enabled && $leftmenu==\"donations\"',2,'2017-08-30 15:14:30'),(163089,'auguria',1,'','left','accountancy',163087,NULL,NULL,1,'/don/list.php?leftmenu=donations&mainmenu=accountancy','','List','donations',1,'','$user->rights->don->lire','$conf->don->enabled && $leftmenu==\"donations\"',2,'2017-08-30 15:14:30'),(163187,'auguria',1,'','left','accountancy',161102,NULL,NULL,5,'/compta/deplacement/index.php?leftmenu=tripsandexpenses','','TripsAndExpenses','trips',0,'tripsandexpenses','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163188,'auguria',1,'','left','accountancy',163187,NULL,NULL,1,'/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses','','New','trips',1,'','$user->rights->deplacement->creer','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163189,'auguria',1,'','left','accountancy',163187,NULL,NULL,2,'/compta/deplacement/list.php?leftmenu=tripsandexpenses','','List','trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163190,'auguria',1,'','left','accountancy',163187,NULL,NULL,2,'/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses','','Statistics','trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163287,'auguria',1,'','left','accountancy',161093,NULL,NULL,6,'/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy','','MenuSpecialExpenses','compta',0,'tax','(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read)','$conf->tax->enabled || $conf->salaries->enabled',0,'2017-08-30 15:14:30'),(163297,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy','','Salaries','salaries',1,'tax_sal','$user->rights->salaries->payment->read','$conf->salaries->enabled',0,'2017-08-30 15:14:30'),(163298,'auguria',1,'','left','accountancy',163297,NULL,NULL,2,'/compta/salaries/card.php?leftmenu=tax_salary&action=create','','NewPayment','companies',2,'','$user->rights->salaries->payment->write','$conf->salaries->enabled && $leftmenu==\"tax_salary\"',0,'2017-08-30 15:14:30'),(163299,'auguria',1,'','left','accountancy',163297,NULL,NULL,3,'/compta/salaries/index.php?leftmenu=tax_salary','','Payments','companies',2,'','$user->rights->salaries->payment->read','$conf->salaries->enabled && $leftmenu==\"tax_salary\"',0,'2017-08-30 15:14:30'),(163307,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy','','Loans','loan',1,'tax_loan','$user->rights->loan->read','$conf->loan->enabled',0,'2017-08-30 15:14:30'),(163308,'auguria',1,'','left','accountancy',163307,NULL,NULL,2,'/loan/card.php?leftmenu=tax_loan&action=create','','NewLoan','loan',2,'','$user->rights->loan->write','$conf->loan->enabled && $leftmenu==\"tax_loan\"',0,'2017-08-30 15:14:30'),(163310,'auguria',1,'','left','accountancy',163307,NULL,NULL,4,'/loan/calc.php?leftmenu=tax_loan','','Calculator','companies',2,'','$user->rights->loan->calc','$conf->loan->enabled && $leftmenu==\"tax_loan\" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)',0,'2017-08-30 15:14:30'),(163337,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/compta/sociales/index.php?leftmenu=tax_social','','SocialContributions','',1,'tax_social','$user->rights->tax->charges->lire','$conf->tax->enabled',0,'2017-08-30 15:14:30'),(163338,'auguria',1,'','left','accountancy',163337,NULL,NULL,2,'/compta/sociales/card.php?leftmenu=tax_social&action=create','','MenuNewSocialContribution','',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2017-08-30 15:14:30'),(163339,'auguria',1,'','left','accountancy',163337,NULL,NULL,3,'/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly','','Payments','',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2017-08-30 15:14:30'),(163387,'auguria',1,'','left','accountancy',163287,NULL,NULL,7,'/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy','','VAT','companies',1,'tax_vat','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)',0,'2017-08-30 15:14:30'),(163388,'auguria',1,'','left','accountancy',163387,NULL,NULL,0,'/compta/tva/card.php?leftmenu=tax_vat&action=create','','New','companies',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163389,'auguria',1,'','left','accountancy',163387,NULL,NULL,1,'/compta/tva/reglement.php?leftmenu=tax_vat','','List','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163390,'auguria',1,'','left','accountancy',163387,NULL,NULL,2,'/compta/tva/clients.php?leftmenu=tax_vat','','ReportByCustomers','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163391,'auguria',1,'','left','accountancy',163387,NULL,NULL,3,'/compta/tva/quadri_detail.php?leftmenu=tax_vat','','ReportByQuarter','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163487,'auguria',1,'','left','accountancy',161093,NULL,NULL,7,'/accountancy/index.php?leftmenu=accountancy','','MenuAccountancy','accountancy',0,'accounting','! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163488,'auguria',1,'','left','accountancy',163487,NULL,NULL,2,'/accountancy/customer/index.php?leftmenu=dispatch_customer','','CustomersVentilation','accountancy',1,'dispatch_customer','$user->rights->accounting->bind->write','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163489,'auguria',1,'','left','accountancy',163488,NULL,NULL,3,'/accountancy/customer/list.php','','ToDispatch','accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $leftmenu==\"dispatch_customer\"',0,'2017-08-30 15:14:30'),(163490,'auguria',1,'','left','accountancy',163488,NULL,NULL,4,'/accountancy/customer/lines.php','','Dispatched','accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $leftmenu==\"dispatch_customer\"',0,'2017-08-30 15:14:30'),(163497,'auguria',1,'','left','accountancy',163487,NULL,NULL,5,'/accountancy/supplier/index.php?leftmenu=dispatch_supplier','','SuppliersVentilation','accountancy',1,'ventil_supplier','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled',0,'2017-08-30 15:14:30'),(163498,'auguria',1,'','left','accountancy',163497,NULL,NULL,6,'/accountancy/supplier/list.php','','ToDispatch','accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu==\"dispatch_supplier\"',0,'2017-08-30 15:14:30'),(163499,'auguria',1,'','left','accountancy',163497,NULL,NULL,7,'/accountancy/supplier/lines.php','','Dispatched','accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu==\"dispatch_supplier\"',0,'2017-08-30 15:14:30'),(163507,'auguria',1,'','left','accountancy',163487,NULL,NULL,5,'/accountancy/expensereport/index.php?leftmenu=dispatch_expensereport','','ExpenseReportsVentilation','accountancy',1,'ventil_expensereport','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(163508,'auguria',1,'','left','accountancy',163507,NULL,NULL,6,'/accountancy/expensereport/list.php','','ToDispatch','accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"dispatch_expensereport\"',0,'2017-08-30 15:14:30'),(163509,'auguria',1,'','left','accountancy',163507,NULL,NULL,7,'/accountancy/expensereport/lines.php','','Dispatched','accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"dispatch_expensereport\"',0,'2017-08-30 15:14:30'),(163517,'auguria',1,'','left','accountancy',163487,NULL,NULL,15,'/accountancy/bookkeeping/list.php','','Bookkeeping','accountancy',1,'bookkeeping','$user->rights->accounting->mouvements->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163522,'auguria',1,'','left','accountancy',163487,NULL,NULL,16,'/accountancy/bookkeeping/balance.php','','AccountBalance','accountancy',1,'balance','$user->rights->accounting->mouvements->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163527,'auguria',1,'','left','accountancy',163487,NULL,NULL,17,'/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy','','Reportings','main',1,'report','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163528,'auguria',1,'','left','accountancy',163527,NULL,NULL,19,'/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy','','ReportInOut','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163529,'auguria',1,'','left','accountancy',163528,NULL,NULL,18,'/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy','','ByAccounts','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163530,'auguria',1,'','left','accountancy',163528,NULL,NULL,20,'/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy','','ByCompanies','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163531,'auguria',1,'','left','accountancy',163527,NULL,NULL,21,'/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy','','ReportTurnover','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163532,'auguria',1,'','left','accountancy',163531,NULL,NULL,22,'/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy','','ByCompanies','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163533,'auguria',1,'','left','accountancy',163531,NULL,NULL,23,'/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy','','ByUsers','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163534,'auguria',1,'','left','accountancy',163531,NULL,NULL,24,'/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy','','ByProductsAndServices','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163537,'auguria',1,'','left','accountancy',163538,NULL,NULL,80,'/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin','','FiscalPeriod','admin',1,'accountancy_admin_period','','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\" && $conf->global->MAIN_FEATURES_LEVEL > 0',2,'2017-08-30 15:14:30'),(163538,'auguria',1,'','left','accountancy',163487,NULL,NULL,1,'/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Setup','accountancy',1,'accountancy_admin','$user->rights->accounting->chartofaccount','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163541,'auguria',1,'','left','accountancy',163538,NULL,NULL,10,'/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin','','AccountingJournals','accountancy',2,'accountancy_admin_journal','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163542,'auguria',1,'','left','accountancy',163538,NULL,NULL,20,'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Pcg_version','accountancy',2,'accountancy_admin_chartmodel','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163543,'auguria',1,'','left','accountancy',163538,NULL,NULL,30,'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Chartofaccounts','accountancy',2,'accountancy_admin_chart','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163544,'auguria',1,'','left','accountancy',163538,NULL,NULL,40,'/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin','','AccountingCategory','accountancy',2,'accountancy_admin_chart_group','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163545,'auguria',1,'','left','accountancy',163538,NULL,NULL,50,'/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin','','MenuDefaultAccounts','accountancy',2,'accountancy_admin_default','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163546,'auguria',1,'','left','accountancy',163538,NULL,NULL,60,'/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuVatAccounts','accountancy',2,'accountancy_admin_vat','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163547,'auguria',1,'','left','accountancy',163538,NULL,NULL,70,'/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuTaxAccounts','accountancy',2,'accountancy_admin_tax','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163548,'auguria',1,'','left','accountancy',163538,NULL,NULL,80,'/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuExpenseReportAccounts','accountancy',2,'accountancy_admin_expensereport','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163549,'auguria',1,'','left','accountancy',163538,NULL,NULL,90,'/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin','','MenuProductsAccounts','accountancy',2,'accountancy_admin_product','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163587,'auguria',1,'','left','accountancy',161101,NULL,NULL,9,'/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank','','StandingOrders','withdrawals',0,'withdraw','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled',2,'2017-08-30 15:14:30'),(163589,'auguria',1,'','left','accountancy',163587,NULL,NULL,0,'/compta/prelevement/create.php?leftmenu=withdraw','','NewStandingOrder','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163590,'auguria',1,'','left','accountancy',163587,NULL,NULL,2,'/compta/prelevement/bons.php?leftmenu=withdraw','','WithdrawalsReceipts','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163591,'auguria',1,'','left','accountancy',163587,NULL,NULL,3,'/compta/prelevement/list.php?leftmenu=withdraw','','WithdrawalsLines','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163593,'auguria',1,'','left','accountancy',163587,NULL,NULL,5,'/compta/prelevement/rejets.php?leftmenu=withdraw','','Rejects','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163594,'auguria',1,'','left','accountancy',163587,NULL,NULL,6,'/compta/prelevement/stats.php?leftmenu=withdraw','','Statistics','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163687,'auguria',1,'','left','accountancy',161101,NULL,NULL,1,'/compta/bank/index.php?leftmenu=bank&mainmenu=bank','','MenuBankCash','banks',0,'bank','$user->rights->banque->lire','$conf->banque->enabled',0,'2017-08-30 15:14:30'),(163688,'auguria',1,'','left','accountancy',163687,NULL,NULL,0,'/compta/bank/card.php?action=create&leftmenu=bank','','MenuNewFinancialAccount','banks',1,'','$user->rights->banque->configurer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163690,'auguria',1,'','left','accountancy',163687,NULL,NULL,2,'/compta/bank/bankentries.php?leftmenu=bank','','ListTransactions','banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163691,'auguria',1,'','left','accountancy',163687,NULL,NULL,3,'/compta/bank/budget.php?leftmenu=bank','','ListTransactionsByCategory','banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163693,'auguria',1,'','left','accountancy',163687,NULL,NULL,5,'/compta/bank/transfer.php?leftmenu=bank','','BankTransfers','banks',1,'','$user->rights->banque->transfer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163737,'auguria',1,'','left','accountancy',161101,NULL,NULL,4,'/categories/index.php?leftmenu=bank&type=5','','Categories','categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(163738,'auguria',1,'','left','accountancy',163737,NULL,NULL,0,'/categories/card.php?leftmenu=bank&action=create&type=5','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(163787,'auguria',1,'','left','accountancy',161093,NULL,NULL,11,'/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy','','Reportings','main',0,'ca','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled',0,'2017-08-30 15:14:30'),(163792,'auguria',1,'','left','accountancy',163487,NULL,NULL,1,'','','Journalization','main',1,'','$user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163793,'auguria',1,'','left','accountancy',163792,NULL,NULL,4,'/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1','','SellsJournal','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163794,'auguria',1,'','left','accountancy',163792,NULL,NULL,1,'/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3','','BankJournal','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163795,'auguria',1,'','left','accountancy',163792,NULL,NULL,2,'/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6','','ExpenseReportJournal','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163796,'auguria',1,'','left','accountancy',163792,NULL,NULL,3,'/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2','','PurchasesJournal','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163798,'auguria',1,'','left','accountancy',163787,NULL,NULL,0,'/compta/resultat/index.php?leftmenu=ca','','ReportInOut','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163799,'auguria',1,'','left','accountancy',163788,NULL,NULL,0,'/compta/resultat/clientfourn.php?leftmenu=ca','','ByCompanies','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163800,'auguria',1,'','left','accountancy',163787,NULL,NULL,1,'/compta/stats/index.php?leftmenu=ca','','ReportTurnover','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163801,'auguria',1,'','left','accountancy',163790,NULL,NULL,0,'/compta/stats/casoc.php?leftmenu=ca','','ByCompanies','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163802,'auguria',1,'','left','accountancy',163790,NULL,NULL,1,'/compta/stats/cabyuser.php?leftmenu=ca','','ByUsers','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163803,'auguria',1,'','left','accountancy',163790,NULL,NULL,1,'/compta/stats/cabyprodserv.php?leftmenu=ca','','ByProductsAndServices','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163887,'auguria',1,'','left','products',161090,NULL,NULL,0,'/product/index.php?leftmenu=product&type=0','','Products','products',0,'product','$user->rights->produit->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163888,'auguria',1,'','left','products',163887,NULL,NULL,0,'/product/card.php?leftmenu=product&action=create&type=0','','NewProduct','products',1,'','$user->rights->produit->creer','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163889,'auguria',1,'','left','products',163887,NULL,NULL,1,'/product/list.php?leftmenu=product&type=0','','List','products',1,'','$user->rights->produit->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163890,'auguria',1,'','left','products',163887,NULL,NULL,4,'/product/reassort.php?type=0','','Stocks','products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163891,'auguria',1,'','left','products',163887,NULL,NULL,7,'/product/stats/card.php?id=all&leftmenu=stats&type=0','','Statistics','main',1,'','$user->rights->produit->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(163892,'auguria',1,'','left','products',163887,NULL,NULL,5,'/product/reassortlot.php?type=0','','StocksByLotSerial','products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->productbatch->enabled',2,'2017-08-30 15:14:30'),(163893,'auguria',1,'','left','products',163887,NULL,NULL,6,'/product/stock/productlot_list.php','','LotSerial','products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->productbatch->enabled',2,'2017-08-30 15:14:30'),(163987,'auguria',1,'','left','products',161090,NULL,NULL,1,'/product/index.php?leftmenu=service&type=1','','Services','products',0,'service','$user->rights->service->lire','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163988,'auguria',1,'','left','products',163987,NULL,NULL,0,'/product/card.php?leftmenu=service&action=create&type=1','','NewService','products',1,'','$user->rights->service->creer','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163989,'auguria',1,'','left','products',163987,NULL,NULL,1,'/product/list.php?leftmenu=service&type=1','','List','products',1,'','$user->rights->service->lire','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163990,'auguria',1,'','left','products',163987,NULL,NULL,5,'/product/stats/card.php?id=all&leftmenu=stats&type=1','','Statistics','main',1,'','$user->rights->service->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(164187,'auguria',1,'','left','products',161090,NULL,NULL,3,'/product/stock/index.php?leftmenu=stock','','Stock','stocks',0,'stock','$user->rights->stock->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164188,'auguria',1,'','left','products',164187,NULL,NULL,0,'/product/stock/card.php?action=create','','MenuNewWarehouse','stocks',1,'','$user->rights->stock->creer','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164189,'auguria',1,'','left','products',164187,NULL,NULL,1,'/product/stock/list.php','','List','stocks',1,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164191,'auguria',1,'','left','products',164187,NULL,NULL,3,'/product/stock/mouvement.php','','Movements','stocks',1,'','$user->rights->stock->mouvement->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164192,'auguria',1,'','left','products',164187,NULL,NULL,4,'/product/stock/replenish.php','','Replenishments','stocks',1,'','$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire','$conf->stock->enabled && $conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(164193,'auguria',1,'','left','products',164187,NULL,NULL,5,'/product/stock/massstockmove.php','','MassStockTransferShort','stocks',1,'','$user->rights->stock->mouvement->creer','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164287,'auguria',1,'','left','products',161090,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=0','','Categories','categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164288,'auguria',1,'','left','products',164287,NULL,NULL,0,'/categories/card.php?action=create&type=0','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164487,'auguria',1,'','left','project',161094,NULL,NULL,3,'/projet/activity/perweek.php?leftmenu=projects','','NewTimeSpent','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164687,'auguria',1,'','left','project',161094,NULL,NULL,0,'/projet/index.php?leftmenu=projects','','Projects','projects',0,'projects','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164688,'auguria',1,'','left','project',164687,NULL,NULL,1,'/projet/card.php?leftmenu=projects&action=create','','NewProject','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164689,'auguria',1,'','left','project',164687,NULL,NULL,2,'/projet/list.php?leftmenu=projects','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164690,'auguria',1,'','left','project',164687,NULL,NULL,3,'/projet/stats/index.php?leftmenu=projects','','Statistics','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164787,'auguria',1,'','left','project',161094,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects','','Activities','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164788,'auguria',1,'','left','project',164787,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create','','NewTask','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164789,'auguria',1,'','left','project',164787,NULL,NULL,2,'/projet/tasks/list.php?leftmenu=projects','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164791,'auguria',1,'','left','project',164787,NULL,NULL,4,'/projet/tasks/stats/index.php?leftmenu=projects','','Statistics','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164891,'auguria',1,'','left','project',161094,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=6','','Categories','categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164892,'auguria',1,'','left','project',164891,NULL,NULL,0,'/categories/card.php?action=create&type=6','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164987,'auguria',1,'','left','tools',161095,NULL,NULL,0,'/comm/mailing/index.php?leftmenu=mailing','','EMailings','mails',0,'mailing','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(164988,'auguria',1,'','left','tools',164987,NULL,NULL,0,'/comm/mailing/card.php?leftmenu=mailing&action=create','','NewMailing','mails',1,'','$user->rights->mailing->creer','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(164989,'auguria',1,'','left','tools',164987,NULL,NULL,1,'/comm/mailing/list.php?leftmenu=mailing','','List','mails',1,'','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(165187,'auguria',1,'','left','tools',161095,NULL,NULL,2,'/exports/index.php?leftmenu=export','','FormatedExport','exports',0,'export','$user->rights->export->lire','$conf->export->enabled',2,'2017-08-30 15:14:30'),(165188,'auguria',1,'','left','tools',165187,NULL,NULL,0,'/exports/export.php?leftmenu=export','','NewExport','exports',1,'','$user->rights->export->creer','$conf->export->enabled',2,'2017-08-30 15:14:30'),(165217,'auguria',1,'','left','tools',161095,NULL,NULL,2,'/imports/index.php?leftmenu=import','','FormatedImport','exports',0,'import','$user->rights->import->run','$conf->import->enabled',2,'2017-08-30 15:14:30'),(165218,'auguria',1,'','left','tools',165217,NULL,NULL,0,'/imports/import.php?leftmenu=import','','NewImport','exports',1,'','$user->rights->import->run','$conf->import->enabled',2,'2017-08-30 15:14:30'),(165287,'auguria',1,'','left','members',161100,NULL,NULL,0,'/adherents/index.php?leftmenu=members&mainmenu=members','','Members','members',0,'members','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165288,'auguria',1,'','left','members',165287,NULL,NULL,0,'/adherents/card.php?leftmenu=members&action=create','','NewMember','members',1,'','$user->rights->adherent->creer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165289,'auguria',1,'','left','members',165287,NULL,NULL,1,'/adherents/list.php','','List','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165290,'auguria',1,'','left','members',165289,NULL,NULL,2,'/adherents/list.php?leftmenu=members&statut=-1','','MenuMembersToValidate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165291,'auguria',1,'','left','members',165289,NULL,NULL,3,'/adherents/list.php?leftmenu=members&statut=1','','MenuMembersValidated','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165292,'auguria',1,'','left','members',165289,NULL,NULL,4,'/adherents/list.php?leftmenu=members&statut=1&filter=outofdate','','MenuMembersNotUpToDate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165293,'auguria',1,'','left','members',165289,NULL,NULL,5,'/adherents/list.php?leftmenu=members&statut=1&filter=uptodate','','MenuMembersUpToDate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165294,'auguria',1,'','left','members',165289,NULL,NULL,6,'/adherents/list.php?leftmenu=members&statut=0','','MenuMembersResiliated','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165295,'auguria',1,'','left','members',165287,NULL,NULL,7,'/adherents/stats/geo.php?leftmenu=members&mode=memberbycountry','','MenuMembersStats','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165387,'auguria',1,'','left','members',161100,NULL,NULL,1,'/adherents/index.php?leftmenu=members&mainmenu=members','','Subscriptions','compta',0,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165388,'auguria',1,'','left','members',165387,NULL,NULL,0,'/adherents/list.php?statut=-1&leftmenu=accountancy&mainmenu=members','','NewSubscription','compta',1,'','$user->rights->adherent->cotisation->creer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165389,'auguria',1,'','left','members',165387,NULL,NULL,1,'/adherents/subscription/list.php?leftmenu=members','','List','compta',1,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165390,'auguria',1,'','left','members',165387,NULL,NULL,7,'/adherents/stats/index.php?leftmenu=members','','MenuMembersStats','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165589,'auguria',1,'','left','members',165287,NULL,NULL,9,'/adherents/htpasswd.php?leftmenu=export','','Filehtpasswd','members',1,'','$user->rights->adherent->export','! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && $conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165590,'auguria',1,'','left','members',165287,NULL,NULL,10,'/adherents/cartes/carte.php?leftmenu=export','','MembersCards','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165687,'auguria',1,'','left','hrm',161102,NULL,NULL,1,'/user/index.php?leftmenu=hrm&mode=employee','','Employees','hrm',0,'hrm','$user->rights->hrm->employee->read','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165688,'auguria',1,'','left','hrm',165687,NULL,NULL,1,'/user/card.php?action=create&employee=1','','NewEmployee','hrm',1,'','$user->rights->hrm->employee->write','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165689,'auguria',1,'','left','hrm',165687,NULL,NULL,2,'/user/index.php?$leftmenu=hrm&mode=employee&contextpage=employeelist','','List','hrm',1,'','$user->rights->hrm->employee->read','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165787,'auguria',1,'','left','members',161100,NULL,NULL,5,'/adherents/type.php?leftmenu=setup&mainmenu=members','','MembersTypes','members',0,'setup','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165788,'auguria',1,'','left','members',165787,NULL,NULL,0,'/adherents/type.php?leftmenu=setup&mainmenu=members&action=create','','New','members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165789,'auguria',1,'','left','members',165787,NULL,NULL,1,'/adherents/type.php?leftmenu=setup&mainmenu=members','','List','members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(166087,'auguria',1,'','left','hrm',161102,NULL,NULL,1,'/holiday/list.php?&leftmenu=hrm','','CPTitreMenu','holiday',0,'hrm','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166088,'auguria',1,'','left','hrm',166087,NULL,NULL,1,'/holiday/card.php?&action=request','','MenuAddCP','holiday',1,'','$user->rights->holiday->write','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166089,'auguria',1,'','left','hrm',166087,NULL,NULL,1,'/holiday/list.php?&leftmenu=hrm','','List','holiday',1,'','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166090,'auguria',1,'','left','hrm',166089,NULL,NULL,1,'/holiday/list.php?select_statut=2&leftmenu=hrm','','ListToApprove','trips',2,'','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166091,'auguria',1,'','left','hrm',166087,NULL,NULL,2,'/holiday/define_holiday.php?&action=request','','MenuConfCP','holiday',1,'','$user->rights->holiday->define_holiday','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166092,'auguria',1,'','left','hrm',166087,NULL,NULL,3,'/holiday/view_log.php?&action=request','','MenuLogCP','holiday',1,'','$user->rights->holiday->define_holiday','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166187,'auguria',1,'','left','commercial',161092,NULL,NULL,6,'/fourn/commande/index.php?leftmenu=orders_suppliers','','SuppliersOrders','orders',0,'orders_suppliers','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166188,'auguria',1,'','left','commercial',166187,NULL,NULL,0,'/fourn/commande/card.php?action=create&leftmenu=orders_suppliers','','NewOrder','orders',1,'','$user->rights->fournisseur->commande->creer','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166189,'auguria',1,'','left','commercial',166187,NULL,NULL,1,'/fourn/commande/list.php?leftmenu=orders_suppliers&viewstatut=0','','List','orders',1,'','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166195,'auguria',1,'','left','commercial',166187,NULL,NULL,7,'/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier','','Statistics','orders',1,'','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166287,'auguria',1,'','left','members',161100,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=3','','MembersCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->adherent->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(166288,'auguria',1,'','left','members',166287,NULL,NULL,0,'/categories/card.php?action=create&type=3','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->adherent->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(166387,'auguria',1,'','left','hrm',161102,NULL,NULL,5,'/expensereport/index.php?leftmenu=expensereport','','TripsAndExpenses','trips',0,'expensereport','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166388,'auguria',1,'','left','hrm',166387,NULL,NULL,1,'/expensereport/card.php?action=create&leftmenu=expensereport','','New','trips',1,'','$user->rights->expensereport->creer','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166389,'auguria',1,'','left','hrm',166387,NULL,NULL,2,'/expensereport/list.php?leftmenu=expensereport','','List','trips',1,'','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166390,'auguria',1,'','left','hrm',166389,NULL,NULL,2,'/expensereport/list.php?search_status=2&leftmenu=expensereport','','ListToApprove','trips',2,'','$user->rights->expensereport->approve','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166391,'auguria',1,'','left','hrm',166387,NULL,NULL,2,'/expensereport/stats/index.php?leftmenu=expensereport','','Statistics','trips',1,'','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166416,'all',1,'agenda','top','agenda',0,NULL,NULL,15,'/comm/action/index.php','','TMenuAgenda','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166417,'all',1,'agenda','left','agenda',166416,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166418,'all',1,'agenda','left','agenda',166417,NULL,NULL,101,'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction','commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166419,'all',1,'agenda','left','agenda',166417,NULL,NULL,140,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Agenda','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166420,'all',1,'agenda','left','agenda',166419,NULL,NULL,141,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166421,'all',1,'agenda','left','agenda',166419,NULL,NULL,142,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166422,'all',1,'agenda','left','agenda',166419,NULL,NULL,143,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2017-09-06 16:18:46'),(166423,'all',1,'agenda','left','agenda',166419,NULL,NULL,144,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2017-09-06 16:18:46'),(166424,'all',1,'agenda','left','agenda',166417,NULL,NULL,110,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda','','List','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166425,'all',1,'agenda','left','agenda',166424,NULL,NULL,111,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166426,'all',1,'agenda','left','agenda',166424,NULL,NULL,112,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166427,'all',1,'agenda','left','agenda',166424,NULL,NULL,113,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2017-09-06 16:18:46'),(166428,'all',1,'agenda','left','agenda',166424,NULL,NULL,114,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2017-09-06 16:18:46'),(166429,'all',1,'agenda','left','agenda',166417,NULL,NULL,160,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2017-09-06 16:18:46'),(166430,'all',1,'barcode','left','tools',-1,NULL,'tools',200,'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint','','BarCodePrintsheet','products',NULL,'barcodeprint','($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)','$conf->barcode->enabled',2,'2017-09-06 16:18:46'),(166431,'all',1,'barcode','left','home',-1,'admintools','home',300,'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools','','MassBarcodeInit','products',NULL,NULL,'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)','$conf->barcode->enabled && ($leftmenu==\"admintools\" || $leftmenu==\"admintools_info\")',0,'2017-09-06 16:18:46'),(166432,'all',1,'cron','left','home',-1,'admintools','home',200,'/cron/list.php?status=-2&leftmenu=admintools','','CronList','cron',NULL,NULL,'$user->rights->cron->read','$conf->cron->enabled && preg_match(\'/^admintools/\', $leftmenu)',2,'2017-09-06 16:18:46'),(166433,'all',1,'ecm','top','ecm',0,NULL,NULL,100,'/ecm/index.php','','MenuECM','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup','$conf->ecm->enabled',2,'2017-09-06 16:18:46'),(166434,'all',1,'ecm','left','ecm',-1,NULL,'ecm',101,'/ecm/index.php?mainmenu=ecm&leftmenu=ecm','','ECMArea','ecm',NULL,'ecm','$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2017-09-06 16:18:46'),(166435,'all',1,'ecm','left','ecm',-1,'ecm','ecm',102,'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm','','ECMSectionsManual','ecm',NULL,'ecm_manual','$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2017-09-06 16:18:46'),(166436,'all',1,'ecm','left','ecm',-1,'ecm','ecm',103,'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm','','ECMSectionsAuto','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload','($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)',2,'2017-09-06 16:18:46'),(166437,'all',1,'opensurvey','left','tools',-1,NULL,'tools',200,'/opensurvey/index.php?mainmenu=tools&leftmenu=opensurvey','','Survey','opensurvey',NULL,'opensurvey','$user->rights->opensurvey->read','$conf->opensurvey->enabled',0,'2017-09-06 16:18:46'),(166438,'all',1,'opensurvey','left','tools',-1,'opensurvey','tools',210,'/opensurvey/wizard/index.php','','NewSurvey','opensurvey',NULL,'opensurvey_new','$user->rights->opensurvey->write','$conf->opensurvey->enabled',0,'2017-09-06 16:18:46'),(166439,'all',1,'opensurvey','left','tools',-1,'opensurvey','tools',220,'/opensurvey/list.php','','List','opensurvey',NULL,'opensurvey_list','$user->rights->opensurvey->read','$conf->opensurvey->enabled',0,'2017-09-06 16:18:46'); +/*!40000 ALTER TABLE `llx_menu` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_multicurrency` +-- + +DROP TABLE IF EXISTS `llx_multicurrency`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_multicurrency` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_create` datetime DEFAULT NULL, + `code` varchar(255) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `entity` int(11) DEFAULT '1', + `fk_user` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_multicurrency` +-- + +LOCK TABLES `llx_multicurrency` WRITE; +/*!40000 ALTER TABLE `llx_multicurrency` DISABLE KEYS */; +INSERT INTO `llx_multicurrency` VALUES (1,'2017-02-15 21:17:16','EUR','Euros (€)',1,12); +/*!40000 ALTER TABLE `llx_multicurrency` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_multicurrency_rate` +-- + +DROP TABLE IF EXISTS `llx_multicurrency_rate`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_multicurrency_rate` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_sync` datetime DEFAULT NULL, + `rate` double NOT NULL DEFAULT '0', + `fk_multicurrency` int(11) NOT NULL, + `entity` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_multicurrency_rate` +-- + +LOCK TABLES `llx_multicurrency_rate` WRITE; +/*!40000 ALTER TABLE `llx_multicurrency_rate` DISABLE KEYS */; +INSERT INTO `llx_multicurrency_rate` VALUES (1,'2017-02-15 21:17:16',1,1,1); +/*!40000 ALTER TABLE `llx_multicurrency_rate` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_notify` +-- + +DROP TABLE IF EXISTS `llx_notify`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_notify` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `daten` datetime DEFAULT NULL, + `fk_action` int(11) NOT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `objet_type` varchar(24) NOT NULL, + `objet_id` int(11) NOT NULL, + `email` varchar(255) DEFAULT NULL, + `type` varchar(16) DEFAULT 'email', + `type_target` varchar(16) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_notify` +-- + +LOCK TABLES `llx_notify` WRITE; +/*!40000 ALTER TABLE `llx_notify` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_notify` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_notify_def` +-- + +DROP TABLE IF EXISTS `llx_notify_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_notify_def` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` date DEFAULT NULL, + `fk_action` int(11) NOT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `type` varchar(16) DEFAULT 'email', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_notify_def` +-- + +LOCK TABLES `llx_notify_def` WRITE; +/*!40000 ALTER TABLE `llx_notify_def` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_notify_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_notify_def_object` +-- + +DROP TABLE IF EXISTS `llx_notify_def_object`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_notify_def_object` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `objet_type` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `objet_id` int(11) NOT NULL, + `type_notif` varchar(16) COLLATE utf8_unicode_ci DEFAULT 'browser', + `date_notif` datetime DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + `moreparam` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_notify_def_object` +-- + +LOCK TABLES `llx_notify_def_object` WRITE; +/*!40000 ALTER TABLE `llx_notify_def_object` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_notify_def_object` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_oauth_state` +-- + +DROP TABLE IF EXISTS `llx_oauth_state`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_oauth_state` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `service` varchar(36) DEFAULT NULL, + `state` varchar(128) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_oauth_state` +-- + +LOCK TABLES `llx_oauth_state` WRITE; +/*!40000 ALTER TABLE `llx_oauth_state` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_oauth_state` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_oauth_token` +-- + +DROP TABLE IF EXISTS `llx_oauth_token`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_oauth_token` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `service` varchar(36) DEFAULT NULL, + `token` text, + `fk_user` int(11) DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_oauth_token` +-- + +LOCK TABLES `llx_oauth_token` WRITE; +/*!40000 ALTER TABLE `llx_oauth_token` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_oauth_token` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_comments` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_comments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_comments` ( + `id_comment` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_sondage` char(16) NOT NULL, + `comment` text NOT NULL, + `usercomment` text, + PRIMARY KEY (`id_comment`), + KEY `idx_id_comment` (`id_comment`), + KEY `idx_id_sondage` (`id_sondage`) +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_comments` +-- + +LOCK TABLES `llx_opensurvey_comments` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_comments` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_comments` VALUES (2,'434dio8rxfljs3p1','aaa','aaa'),(5,'434dio8rxfljs3p1','aaa','aaa'),(6,'434dio8rxfljs3p1','gfh','jj'),(11,'434dio8rxfljs3p1','fsdf','fdsf'),(12,'3imby4hf7joiilsu','fsdf','aa'),(16,'3imby4hf7joiilsu','gdfg','gfdg'),(17,'3imby4hf7joiilsu','gfdgd','gdfgd'),(18,'om4e7azfiurnjtqe','fds','fdsf'),(26,'qgsfrgb922rqzocy','gfdg','gfdg'),(27,'qgsfrgb922rqzocy','gfdg','gfd'),(30,'ckanvbe7kt3rdb3h','hfgh','fdfds'); +/*!40000 ALTER TABLE `llx_opensurvey_comments` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_formquestions` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_formquestions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_formquestions` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `id_sondage` varchar(16) DEFAULT NULL, + `question` text, + `available_answers` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_formquestions` +-- + +LOCK TABLES `llx_opensurvey_formquestions` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_formquestions` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_opensurvey_formquestions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_sondage` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_sondage`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_sondage` ( + `id_sondage` varchar(16) NOT NULL, + `commentaires` text, + `mail_admin` varchar(128) DEFAULT NULL, + `nom_admin` varchar(64) DEFAULT NULL, + `fk_user_creat` int(11) NOT NULL, + `titre` text NOT NULL, + `date_fin` datetime DEFAULT NULL, + `status` int(11) DEFAULT '1', + `format` varchar(2) NOT NULL, + `mailsonde` tinyint(4) NOT NULL DEFAULT '0', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `entity` int(11) NOT NULL DEFAULT '1', + `allow_comments` tinyint(4) NOT NULL DEFAULT '1', + `allow_spy` tinyint(4) NOT NULL DEFAULT '1', + `sujet` text, + PRIMARY KEY (`id_sondage`), + KEY `idx_date_fin` (`date_fin`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_sondage` +-- + +LOCK TABLES `llx_opensurvey_sondage` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_sondage` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_sondage` VALUES ('m4467s2mtk6khmxc','What is your prefered date for a brunch','myemail@aaa.com','fdfds',0,'Date of next brunch','2013-03-07 00:00:00',1,'D',1,'2017-02-20 16:47:22',1,1,1,',1483473600'),('tim1dye8x5eeetxu','Please vote for the candidate you want to have for our new president this year.',NULL,NULL,12,'Election of new president','2017-02-26 04:00:00',1,'A',0,'2017-02-20 16:53:37',1,1,0,'Alan Candide@foragainst,Alex Candor@foragainst'); +/*!40000 ALTER TABLE `llx_opensurvey_sondage` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_user_formanswers` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_user_formanswers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_user_formanswers` ( + `fk_user_survey` int(11) NOT NULL, + `fk_question` int(11) NOT NULL, + `reponses` text +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_user_formanswers` +-- + +LOCK TABLES `llx_opensurvey_user_formanswers` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_user_formanswers` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_opensurvey_user_formanswers` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_user_studs` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_user_studs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_user_studs` ( + `id_users` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(64) NOT NULL, + `id_sondage` varchar(16) NOT NULL, + `reponses` varchar(100) NOT NULL, + PRIMARY KEY (`id_users`), + KEY `idx_id_users` (`id_users`), + KEY `idx_nom` (`nom`), + KEY `idx_id_sondage` (`id_sondage`), + KEY `idx_opensurvey_user_studs_id_users` (`id_users`), + KEY `idx_opensurvey_user_studs_nom` (`nom`), + KEY `idx_opensurvey_user_studs_id_sondage` (`id_sondage`) +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_user_studs` +-- + +LOCK TABLES `llx_opensurvey_user_studs` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_user_studs` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_user_studs` VALUES (1,'gfdgdf','om4e7azfiurnjtqe','01'),(2,'aa','3imby4hf7joiilsu','210'),(3,'fsdf','z2qcqjh5pm1q4p99','0110'),(5,'hfghf','z2qcqjh5pm1q4p99','1110'),(6,'qqqq','ah9xvaqu1ajjrqse','000111'),(7,'hjgh','ah9xvaqu1ajjrqse','000010'),(8,'bcvb','qgsfrgb922rqzocy','011000'),(9,'gdfg','ah9xvaqu1ajjrqse','001000'),(10,'ggg','ah9xvaqu1ajjrqse','000100'),(11,'gfdgd','ah9xvaqu1ajjrqse','001000'),(12,'hhhh','ah9xvaqu1ajjrqse','010000'),(13,'iii','ah9xvaqu1ajjrqse','000100'),(14,'kkk','ah9xvaqu1ajjrqse','001000'),(15,'lllll','ah9xvaqu1ajjrqse','000001'),(16,'kk','ah9xvaqu1ajjrqse','000001'),(17,'gggg','ah9xvaqu1ajjrqse','001000'),(18,'mmmm','ah9xvaqu1ajjrqse','000000'),(19,'jkjkj','ah9xvaqu1ajjrqse','000001'),(20,'azerty','8mcdnf2hgcntfibe','012'),(21,'hfghfg','8mcdnf2hgcntfibe','012'),(22,'fd','ckanvbe7kt3rdb3h','10'),(25,'John Doe','m4467s2mtk6khmxc','1'),(26,'Martial Bill','m4467s2mtk6khmxc','01'),(27,'Marissa Campbell','m4467s2mtk6khmxc','11'),(28,'Leonard Cast','m4467s2mtk6khmxc','01'),(29,'John Doe','tim1dye8x5eeetxu','01'),(30,'Eldy','tim1dye8x5eeetxu','11'); +/*!40000 ALTER TABLE `llx_opensurvey_user_studs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_overwrite_trans` +-- + +DROP TABLE IF EXISTS `llx_overwrite_trans`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_overwrite_trans` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `lang` varchar(5) DEFAULT NULL, + `transkey` varchar(128) DEFAULT NULL, + `transvalue` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_overwrite_trans` (`lang`,`transkey`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_overwrite_trans` +-- + +LOCK TABLES `llx_overwrite_trans` WRITE; +/*!40000 ALTER TABLE `llx_overwrite_trans` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_overwrite_trans` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiement` +-- + +DROP TABLE IF EXISTS `llx_paiement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) NOT NULL DEFAULT '', + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double(24,8) DEFAULT NULL, + `fk_paiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `fk_export_compta` int(11) NOT NULL DEFAULT '0', + `multicurrency_amount` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiement` +-- + +LOCK TABLES `llx_paiement` WRITE; +/*!40000 ALTER TABLE `llx_paiement` DISABLE KEYS */; +INSERT INTO `llx_paiement` VALUES (2,'',1,'2011-07-18 20:50:24','2016-07-30 15:13:20','2016-07-08 12:00:00',20.00000000,6,'','',5,1,NULL,0,0,0.00000000),(3,'',1,'2011-07-18 20:50:47','2016-07-30 15:13:20','2016-07-08 12:00:00',10.00000000,4,'','',6,1,NULL,0,0,0.00000000),(5,'',1,'2011-08-01 03:34:11','2016-07-30 15:12:32','2015-08-01 03:34:11',5.63000000,6,'','Payment Invoice FA1108-0003',8,1,NULL,0,0,0.00000000),(6,'',1,'2011-08-06 20:33:54','2016-07-30 15:12:32','2015-08-06 20:33:53',5.98000000,4,'','Payment Invoice FA1108-0004',13,1,NULL,0,0,0.00000000),(8,'',1,'2011-08-08 02:53:40','2016-07-30 15:12:32','2015-08-08 12:00:00',26.10000000,4,'','',14,1,NULL,0,0,0.00000000),(9,'',1,'2011-08-08 02:55:58','2016-07-30 15:12:32','2015-08-08 12:00:00',26.96000000,1,'','',15,1,NULL,0,0,0.00000000),(17,'',1,'2012-12-09 15:28:44','2016-07-30 15:12:32','2015-12-09 12:00:00',2.00000000,4,'','',16,1,NULL,0,0,0.00000000),(18,'',1,'2012-12-09 15:28:53','2016-07-30 15:12:32','2015-12-09 12:00:00',-2.00000000,4,'','',17,1,NULL,0,0,0.00000000),(19,'',1,'2012-12-09 17:35:55','2016-07-30 15:12:32','2015-12-09 12:00:00',-2.00000000,4,'','',18,1,NULL,0,0,0.00000000),(20,'',1,'2012-12-09 17:37:02','2016-07-30 15:12:32','2015-12-09 12:00:00',2.00000000,4,'','',19,1,NULL,0,0,0.00000000),(21,'',1,'2012-12-09 18:35:07','2016-07-30 15:12:32','2015-12-09 12:00:00',-2.00000000,4,'','',20,1,NULL,0,0,0.00000000),(23,'',1,'2012-12-12 18:54:33','2016-07-30 15:12:32','2015-12-12 12:00:00',1.00000000,1,'','',21,1,NULL,0,0,0.00000000),(24,'',1,'2013-03-06 16:48:16','2016-07-30 15:13:20','2016-03-06 00:00:00',20.00000000,4,'','Adhésion/cotisation 2016',22,1,NULL,0,0,0.00000000),(25,'',1,'2013-03-20 14:30:11','2016-07-30 15:13:20','2016-03-20 00:00:00',10.00000000,2,'','Adhésion/cotisation 2011',23,1,NULL,0,0,0.00000000),(26,'',1,'2014-03-02 19:57:58','2016-07-30 15:13:20','2016-07-09 12:00:00',605.00000000,2,'','',24,1,NULL,0,0,0.00000000),(29,'',1,'2014-03-02 20:01:39','2016-07-30 15:13:20','2016-03-19 12:00:00',500.00000000,4,'','',26,1,NULL,0,0,0.00000000),(30,'',1,'2014-03-02 20:02:06','2016-07-30 15:13:20','2016-03-21 12:00:00',400.00000000,2,'','',27,1,NULL,0,0,0.00000000),(32,'',1,'2014-03-03 19:22:32','2016-07-30 15:12:32','2015-10-03 12:00:00',-400.00000000,4,'','',28,1,NULL,0,0,0.00000000),(33,'',1,'2014-03-03 19:23:16','2016-07-30 15:13:20','2016-03-10 12:00:00',-300.00000000,4,'','',29,1,NULL,0,0,0.00000000),(34,'PAY1603-0001',1,'2017-02-06 08:10:24','2017-02-06 04:10:24','2016-03-22 12:00:00',150.00000000,7,'','',33,12,NULL,0,0,150.00000000),(35,'PAY1603-0002',1,'2017-02-06 08:10:50','2017-02-06 04:10:50','2016-03-25 12:00:00',140.00000000,3,'','',34,12,NULL,0,0,140.00000000),(36,'PAY1702-0003',1,'2017-02-21 16:07:43','2017-02-21 12:07:43','2017-02-21 12:00:00',50.00000000,3,'T170201','',37,12,NULL,0,0,50.00000000); +/*!40000 ALTER TABLE `llx_paiement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiement_facture` +-- + +DROP TABLE IF EXISTS `llx_paiement_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiement_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_paiement` int(11) DEFAULT NULL, + `fk_facture` int(11) DEFAULT NULL, + `amount` double(24,8) DEFAULT NULL, + `multicurrency_amount` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_paiement_facture` (`fk_paiement`,`fk_facture`), + KEY `idx_paiement_facture_fk_facture` (`fk_facture`), + KEY `idx_paiement_facture_fk_paiement` (`fk_paiement`), + CONSTRAINT `fk_paiement_facture_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_paiement_facture_fk_paiement` FOREIGN KEY (`fk_paiement`) REFERENCES `llx_paiement` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiement_facture` +-- + +LOCK TABLES `llx_paiement_facture` WRITE; +/*!40000 ALTER TABLE `llx_paiement_facture` DISABLE KEYS */; +INSERT INTO `llx_paiement_facture` VALUES (2,2,2,20.00000000,0.00000000),(3,3,2,10.00000000,0.00000000),(5,5,5,5.63000000,0.00000000),(6,6,6,5.98000000,0.00000000),(9,8,2,16.10000000,0.00000000),(10,8,8,10.00000000,0.00000000),(11,9,3,15.00000000,0.00000000),(12,9,9,11.96000000,0.00000000),(24,20,9,1.00000000,0.00000000),(31,26,32,600.00000000,0.00000000),(36,29,32,500.00000000,0.00000000),(37,30,32,400.00000000,0.00000000),(38,34,211,150.00000000,150.00000000),(39,35,211,140.00000000,140.00000000),(40,36,211,50.00000000,50.00000000); +/*!40000 ALTER TABLE `llx_paiement_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementcharge` +-- + +DROP TABLE IF EXISTS `llx_paiementcharge`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementcharge` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_charge` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_typepaiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementcharge` +-- + +LOCK TABLES `llx_paiementcharge` WRITE; +/*!40000 ALTER TABLE `llx_paiementcharge` DISABLE KEYS */; +INSERT INTO `llx_paiementcharge` VALUES (4,4,'2011-08-05 23:11:37','2011-08-05 21:11:37','2011-08-05 12:00:00',10,2,'','',12,1,NULL); +/*!40000 ALTER TABLE `llx_paiementcharge` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementfourn` +-- + +DROP TABLE IF EXISTS `llx_paiementfourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementfourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_paiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `multicurrency_amount` double(24,8) DEFAULT '0.00000000', + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementfourn` +-- + +LOCK TABLES `llx_paiementfourn` WRITE; +/*!40000 ALTER TABLE `llx_paiementfourn` DISABLE KEYS */; +INSERT INTO `llx_paiementfourn` VALUES (1,NULL,NULL,'2016-01-22 17:56:34','2016-01-22 18:56:34','2016-01-22 12:00:00',900,12,4,'','',30,0,0.00000000,NULL),(2,'SPAY1702-0001',1,'2017-02-01 15:02:45','2017-02-01 19:02:44','2017-02-01 12:00:00',200,12,4,'','',32,0,200.00000000,NULL); +/*!40000 ALTER TABLE `llx_paiementfourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementfourn_facturefourn` +-- + +DROP TABLE IF EXISTS `llx_paiementfourn_facturefourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementfourn_facturefourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_paiementfourn` int(11) DEFAULT NULL, + `fk_facturefourn` int(11) DEFAULT NULL, + `amount` double DEFAULT '0', + `multicurrency_amount` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_paiementfourn_facturefourn` (`fk_paiementfourn`,`fk_facturefourn`), + KEY `idx_paiementfourn_facturefourn_fk_facture` (`fk_facturefourn`), + KEY `idx_paiementfourn_facturefourn_fk_paiement` (`fk_paiementfourn`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementfourn_facturefourn` +-- + +LOCK TABLES `llx_paiementfourn_facturefourn` WRITE; +/*!40000 ALTER TABLE `llx_paiementfourn_facturefourn` DISABLE KEYS */; +INSERT INTO `llx_paiementfourn_facturefourn` VALUES (1,1,16,900,0.00000000),(2,2,20,200,200.00000000); +/*!40000 ALTER TABLE `llx_paiementfourn_facturefourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_donation` +-- + +DROP TABLE IF EXISTS `llx_payment_donation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_donation` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_donation` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_donation` +-- + +LOCK TABLES `llx_payment_donation` WRITE; +/*!40000 ALTER TABLE `llx_payment_donation` DISABLE KEYS */; +INSERT INTO `llx_payment_donation` VALUES (1,3,'2017-09-06 20:08:36','2017-09-06 16:08:36','2017-09-06 12:00:00',10,4,'','',38,12,NULL); +/*!40000 ALTER TABLE `llx_payment_donation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_expensereport` +-- + +DROP TABLE IF EXISTS `llx_payment_expensereport`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_expensereport` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expensereport` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_expensereport` +-- + +LOCK TABLES `llx_payment_expensereport` WRITE; +/*!40000 ALTER TABLE `llx_payment_expensereport` DISABLE KEYS */; +INSERT INTO `llx_payment_expensereport` VALUES (1,1,'2017-02-16 02:13:13','2017-02-15 22:13:13','2017-02-16 12:00:00',5,7,'','',0,12,NULL),(2,1,'2017-02-16 02:22:09','2017-02-15 22:22:09','2017-02-16 12:00:00',1,7,'','',36,12,NULL); +/*!40000 ALTER TABLE `llx_payment_expensereport` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_loan` +-- + +DROP TABLE IF EXISTS `llx_payment_loan`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_loan` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_loan` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount_capital` double DEFAULT '0', + `amount_insurance` double DEFAULT '0', + `amount_interest` double DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `note_private` text, + `note_public` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_loan` +-- + +LOCK TABLES `llx_payment_loan` WRITE; +/*!40000 ALTER TABLE `llx_payment_loan` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_payment_loan` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_salary` +-- + +DROP TABLE IF EXISTS `llx_payment_salary`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_salary` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_user` int(11) NOT NULL, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `salary` double DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `datesp` date DEFAULT NULL, + `dateep` date DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `note` text, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_payment_salary_ref` (`num_payment`), + KEY `idx_payment_salary_user` (`fk_user`,`entity`), + KEY `idx_payment_salary_datep` (`datep`), + KEY `idx_payment_salary_datesp` (`datesp`), + KEY `idx_payment_salary_dateep` (`dateep`), + CONSTRAINT `fk_payment_salary_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_salary` +-- + +LOCK TABLES `llx_payment_salary` WRITE; +/*!40000 ALTER TABLE `llx_payment_salary` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_payment_salary` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_various` +-- + +DROP TABLE IF EXISTS `llx_payment_various`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_various` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `sens` smallint(6) NOT NULL DEFAULT '0', + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `accountancy_code` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `note` text COLLATE utf8_unicode_ci, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_various` +-- + +LOCK TABLES `llx_payment_various` WRITE; +/*!40000 ALTER TABLE `llx_payment_various` DISABLE KEYS */; +INSERT INTO `llx_payment_various` VALUES (2,'2017-07-14 14:46:19','2017-07-14 18:46:19','2017-07-14','2017-07-14',0,123.00000000,4,'','Miscellaneous payment','518',1,NULL,48,12,NULL); +/*!40000 ALTER TABLE `llx_payment_various` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_bons` +-- + +DROP TABLE IF EXISTS `llx_prelevement_bons`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_bons` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(12) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `statut` smallint(6) DEFAULT '0', + `credite` smallint(6) DEFAULT '0', + `note` text, + `date_trans` datetime DEFAULT NULL, + `method_trans` smallint(6) DEFAULT NULL, + `fk_user_trans` int(11) DEFAULT NULL, + `date_credit` datetime DEFAULT NULL, + `fk_user_credit` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_prelevement_bons_ref` (`ref`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_bons` +-- + +LOCK TABLES `llx_prelevement_bons` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_bons` DISABLE KEYS */; +INSERT INTO `llx_prelevement_bons` VALUES (1,'T170201',1,'2017-02-21 15:53:46',50,2,0,NULL,'2017-02-21 12:00:00',0,12,'2017-02-21 12:00:00',12); +/*!40000 ALTER TABLE `llx_prelevement_bons` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_facture` +-- + +DROP TABLE IF EXISTS `llx_prelevement_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_prelevement_lignes` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_prelevement_facture_fk_prelevement_lignes` (`fk_prelevement_lignes`), + CONSTRAINT `fk_prelevement_facture_fk_prelevement_lignes` FOREIGN KEY (`fk_prelevement_lignes`) REFERENCES `llx_prelevement_lignes` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_facture` +-- + +LOCK TABLES `llx_prelevement_facture` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_facture` DISABLE KEYS */; +INSERT INTO `llx_prelevement_facture` VALUES (1,211,1); +/*!40000 ALTER TABLE `llx_prelevement_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_facture_demande` +-- + +DROP TABLE IF EXISTS `llx_prelevement_facture_demande`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_facture_demande` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `amount` double NOT NULL, + `date_demande` datetime NOT NULL, + `traite` smallint(6) DEFAULT '0', + `date_traite` datetime DEFAULT NULL, + `fk_prelevement_bons` int(11) DEFAULT NULL, + `fk_user_demande` int(11) NOT NULL, + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_facture_demande` +-- + +LOCK TABLES `llx_prelevement_facture_demande` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_facture_demande` DISABLE KEYS */; +INSERT INTO `llx_prelevement_facture_demande` VALUES (1,211,50,'2017-02-06 08:11:17',1,'2017-02-21 15:53:46',1,12,'','','',''); +/*!40000 ALTER TABLE `llx_prelevement_facture_demande` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_lignes` +-- + +DROP TABLE IF EXISTS `llx_prelevement_lignes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_lignes` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_prelevement_bons` int(11) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `statut` smallint(6) DEFAULT '0', + `client_nom` varchar(255) DEFAULT NULL, + `amount` double DEFAULT '0', + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`), + KEY `idx_prelevement_lignes_fk_prelevement_bons` (`fk_prelevement_bons`), + CONSTRAINT `fk_prelevement_lignes_fk_prelevement_bons` FOREIGN KEY (`fk_prelevement_bons`) REFERENCES `llx_prelevement_bons` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_lignes` +-- + +LOCK TABLES `llx_prelevement_lignes` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_lignes` DISABLE KEYS */; +INSERT INTO `llx_prelevement_lignes` VALUES (1,1,19,2,'Magic Food Store',50,'','','','',NULL); +/*!40000 ALTER TABLE `llx_prelevement_lignes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_rejet` +-- + +DROP TABLE IF EXISTS `llx_prelevement_rejet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_rejet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_prelevement_lignes` int(11) DEFAULT NULL, + `date_rejet` datetime DEFAULT NULL, + `motif` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_creation` int(11) DEFAULT NULL, + `note` text, + `afacturer` tinyint(4) DEFAULT '0', + `fk_facture` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_rejet` +-- + +LOCK TABLES `llx_prelevement_rejet` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_rejet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_prelevement_rejet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_printer_receipt` +-- + +DROP TABLE IF EXISTS `llx_printer_receipt`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_printer_receipt` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) DEFAULT NULL, + `fk_type` int(11) DEFAULT NULL, + `fk_profile` int(11) DEFAULT NULL, + `parameter` varchar(128) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_printer_receipt` +-- + +LOCK TABLES `llx_printer_receipt` WRITE; +/*!40000 ALTER TABLE `llx_printer_receipt` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_printer_receipt` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_printer_receipt_template` +-- + +DROP TABLE IF EXISTS `llx_printer_receipt_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_printer_receipt_template` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) DEFAULT NULL, + `template` text, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_printer_receipt_template` +-- + +LOCK TABLES `llx_printer_receipt_template` WRITE; +/*!40000 ALTER TABLE `llx_printer_receipt_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_printer_receipt_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_printing` +-- + +DROP TABLE IF EXISTS `llx_printing`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_printing` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `printer_name` text NOT NULL, + `printer_location` text NOT NULL, + `printer_id` varchar(255) NOT NULL, + `copy` int(11) NOT NULL DEFAULT '1', + `module` varchar(16) NOT NULL, + `driver` varchar(16) NOT NULL, + `userid` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_printing` +-- + +LOCK TABLES `llx_printing` WRITE; +/*!40000 ALTER TABLE `llx_printing` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_printing` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product` +-- + +DROP TABLE IF EXISTS `llx_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `virtual` tinyint(4) NOT NULL DEFAULT '0', + `fk_parent` int(11) DEFAULT '0', + `ref` varchar(128) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `label` varchar(255) NOT NULL, + `description` text, + `note` text, + `customcode` varchar(32) DEFAULT NULL, + `fk_country` int(11) DEFAULT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `price_min` double(24,8) DEFAULT '0.00000000', + `price_min_ttc` double(24,8) DEFAULT '0.00000000', + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `tosell` tinyint(4) DEFAULT '1', + `tobuy` tinyint(4) DEFAULT '1', + `onportal` smallint(6) DEFAULT '0', + `tobatch` tinyint(4) NOT NULL DEFAULT '0', + `fk_product_type` int(11) DEFAULT '0', + `duration` varchar(6) DEFAULT NULL, + `seuil_stock_alerte` int(11) DEFAULT '0', + `url` varchar(255) DEFAULT NULL, + `barcode` varchar(255) DEFAULT NULL, + `fk_barcode_type` int(11) DEFAULT NULL, + `accountancy_code_sell` varchar(32) DEFAULT NULL, + `accountancy_code_buy` varchar(32) DEFAULT NULL, + `partnumber` varchar(32) DEFAULT NULL, + `weight` float DEFAULT NULL, + `weight_units` tinyint(4) DEFAULT NULL, + `length` float DEFAULT NULL, + `length_units` tinyint(4) DEFAULT NULL, + `surface` float DEFAULT NULL, + `surface_units` tinyint(4) DEFAULT NULL, + `volume` float DEFAULT NULL, + `volume_units` tinyint(4) DEFAULT NULL, + `stock` double DEFAULT NULL, + `pmp` double(24,8) NOT NULL DEFAULT '0.00000000', + `fifo` double(24,8) DEFAULT NULL, + `lifo` double(24,8) DEFAULT NULL, + `canvas` varchar(32) DEFAULT 'default@product', + `finished` tinyint(4) DEFAULT NULL, + `hidden` tinyint(4) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `desiredstock` int(11) DEFAULT '0', + `fk_price_expression` int(11) DEFAULT NULL, + `fk_unit` int(11) DEFAULT NULL, + `cost_price` double(24,8) DEFAULT NULL, + `default_vat_code` varchar(10) DEFAULT NULL, + `price_autogen` smallint(6) DEFAULT '0', + `note_public` text, + `model_pdf` varchar(255) DEFAULT '', + `width` float DEFAULT NULL, + `width_units` tinyint(4) DEFAULT NULL, + `height` float DEFAULT NULL, + `height_units` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_ref` (`ref`,`entity`), + UNIQUE KEY `uk_product_barcode` (`barcode`,`fk_barcode_type`,`entity`), + KEY `idx_product_label` (`label`), + KEY `idx_product_barcode` (`barcode`), + KEY `idx_product_import_key` (`import_key`), + KEY `idx_product_fk_country` (`fk_country`), + KEY `idx_product_fk_user_author` (`fk_user_author`), + KEY `idx_product_fk_barcode_type` (`fk_barcode_type`), + KEY `fk_product_fk_unit` (`fk_unit`), + KEY `idx_product_seuil_stock_alerte` (`seuil_stock_alerte`), + CONSTRAINT `fk_product_barcode_type` FOREIGN KEY (`fk_barcode_type`) REFERENCES `llx_c_barcode_type` (`rowid`), + CONSTRAINT `fk_product_fk_country` FOREIGN KEY (`fk_country`) REFERENCES `llx_c_country` (`rowid`), + CONSTRAINT `fk_product_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product` +-- + +LOCK TABLES `llx_product` WRITE; +/*!40000 ALTER TABLE `llx_product` DISABLE KEYS */; +INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2016-01-16 16:30:35',0,0,'PINKDRESS',1,NULL,'Pink dress','A beatifull pink dress','','',NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,NULL,'123456789066',2,'701PINKDRESS','601PINKDRESS',NULL,670,-3,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(2,'2010-07-09 00:30:01','2016-01-16 16:37:14',0,0,'PEARPIE',1,NULL,'Pear Pie','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,NULL,'123456789077',2,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(3,'2010-07-09 00:30:25','2016-01-16 16:40:03',0,0,'CAKECONTRIB',1,NULL,'Cake making contribution','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,1,'1m',NULL,NULL,'123456789088',2,'701CAKEM','601CAKEM',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(4,'2010-07-10 14:44:06','2016-01-16 15:58:20',0,0,'APPLEPIE',1,NULL,'Apple Pie','Nice Bio Apple Pie.
\r\n ','','',NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,NULL,'123456789034',2,'701','601',NULL,500,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(5,'2011-07-20 23:11:38','2016-01-16 16:18:24',0,0,'DOLIDROID',1,NULL,'DoliDroid, Android app for Dolibarr','DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

','','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,'https://play.google.com/store/apps/details?id=com.nltechno.dolidroidpro','123456789023',2,'701','601',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(10,'2008-12-31 00:00:00','2017-02-16 00:12:09',0,0,'COMP-XP4523',1,NULL,'Computer XP4523','A powerfull computer XP4523 ','This product is imported.
\r\nWarning: Delay to get it are not reliable.','USXP765',11,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,'0',0.000,'0',NULL,12,1,1,0,1,0,'',150,NULL,'123456789055',2,'701OLDC','601OLDC',NULL,1.7,0,NULL,0,NULL,0,NULL,0,110,0.00000000,NULL,NULL,NULL,NULL,0,'20110729232310',200,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(11,'2013-01-13 20:24:42','2016-07-30 13:42:31',0,0,'ROLLUPABC',1,NULL,'Rollup Dolibarr','A nice rollup','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,'0',0.000,'0',1,12,0,0,0,0,0,'',NULL,NULL,'123456789044',2,'','',NULL,2.5,0,NULL,0,2.34,0,NULL,0,-1,0.00000000,NULL,NULL,'',1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(12,'2016-07-30 17:31:29','2016-07-30 13:35:02',0,0,'DOLICLOUD',1,NULL,'SaaS service of Dolibarr ERP CRM','Cloud hosting of Dolibarr ERP and CRM software','','',NULL,9.00000000,9.00000000,9.00000000,9.00000000,'HT',0.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,1,'',NULL,'http://www.dolicloud.com','123456789013',2,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,'',0,0,NULL,NULL,NULL,NULL,8.50000000,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(13,'2017-02-16 03:49:00','2017-02-15 23:49:27',0,0,'COMP-XP4548',1,NULL,'Computer XP4523','A powerfull computer XP4523 ','This product is imported.
\r\nWarning: Delay to get it are not reliable.','USXP765',11,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,'0',0.000,'0',12,12,1,1,0,1,0,'',150,NULL,NULL,2,'','',NULL,1.7,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,200,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_association` +-- + +DROP TABLE IF EXISTS `llx_product_association`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_association` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_pere` int(11) NOT NULL DEFAULT '0', + `fk_product_fils` int(11) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `incdec` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_association` (`fk_product_pere`,`fk_product_fils`), + KEY `idx_product_association` (`fk_product_fils`), + KEY `idx_product_association_fils` (`fk_product_fils`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_association` +-- + +LOCK TABLES `llx_product_association` WRITE; +/*!40000 ALTER TABLE `llx_product_association` DISABLE KEYS */; +INSERT INTO `llx_product_association` VALUES (2,5,1,1,1),(3,4,3,5,1),(4,4,1,2,1); +/*!40000 ALTER TABLE `llx_product_association` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_attribute` +-- + +DROP TABLE IF EXISTS `llx_product_attribute`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_attribute` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `label` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `rang` int(11) NOT NULL DEFAULT '0', + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_attribute_ref` (`ref`), + UNIQUE KEY `unique_ref` (`ref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_attribute` +-- + +LOCK TABLES `llx_product_attribute` WRITE; +/*!40000 ALTER TABLE `llx_product_attribute` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_attribute` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_attribute_combination` +-- + +DROP TABLE IF EXISTS `llx_product_attribute_combination`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_attribute_combination` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_parent` int(11) NOT NULL, + `fk_product_child` int(11) NOT NULL, + `variation_price` float NOT NULL, + `variation_price_percentage` int(11) DEFAULT NULL, + `variation_weight` float NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_attribute_combination` +-- + +LOCK TABLES `llx_product_attribute_combination` WRITE; +/*!40000 ALTER TABLE `llx_product_attribute_combination` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_attribute_combination` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_attribute_combination2val` +-- + +DROP TABLE IF EXISTS `llx_product_attribute_combination2val`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_attribute_combination2val` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_prod_combination` int(11) NOT NULL, + `fk_prod_attr` int(11) NOT NULL, + `fk_prod_attr_val` int(11) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_attribute_combination2val` +-- + +LOCK TABLES `llx_product_attribute_combination2val` WRITE; +/*!40000 ALTER TABLE `llx_product_attribute_combination2val` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_attribute_combination2val` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_attribute_value` +-- + +DROP TABLE IF EXISTS `llx_product_attribute_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_attribute_value` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_attribute` int(11) NOT NULL, + `ref` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `unique_ref` (`fk_product_attribute`,`ref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_attribute_value` +-- + +LOCK TABLES `llx_product_attribute_value` WRITE; +/*!40000 ALTER TABLE `llx_product_attribute_value` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_attribute_value` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_batch` +-- + +DROP TABLE IF EXISTS `llx_product_batch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_batch` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product_stock` int(11) NOT NULL, + `eatby` datetime DEFAULT NULL, + `sellby` datetime DEFAULT NULL, + `batch` varchar(30) NOT NULL, + `qty` double NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_batch` (`fk_product_stock`,`batch`), + KEY `idx_fk_product_stock` (`fk_product_stock`), + KEY `ix_fk_product_stock` (`fk_product_stock`), + KEY `idx_batch` (`batch`), + CONSTRAINT `fk_product_batch_fk_product_stock` FOREIGN KEY (`fk_product_stock`) REFERENCES `llx_product_stock` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_batch` +-- + +LOCK TABLES `llx_product_batch` WRITE; +/*!40000 ALTER TABLE `llx_product_batch` DISABLE KEYS */; +INSERT INTO `llx_product_batch` VALUES (1,'2016-07-30 13:40:39',8,NULL,NULL,'5599887766452',15,NULL),(2,'2016-07-30 13:40:12',8,NULL,NULL,'4494487766452',60,NULL),(3,'2017-02-16 00:12:09',9,NULL,NULL,'5599887766452',35,NULL); +/*!40000 ALTER TABLE `llx_product_batch` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_customer_price` +-- + +DROP TABLE IF EXISTS `llx_product_customer_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_customer_price` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `price_min` double(24,8) DEFAULT '0.00000000', + `price_min_ttc` double(24,8) DEFAULT '0.00000000', + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_customer_price_fk_product_fk_soc` (`fk_product`,`fk_soc`), + KEY `idx_product_customer_price_fk_user` (`fk_user`), + KEY `fk_customer_price_fk_soc` (`fk_soc`), + KEY `idx_product_customer_price_fk_soc` (`fk_soc`), + CONSTRAINT `fk_customer_price_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) ON DELETE CASCADE, + CONSTRAINT `fk_customer_price_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) ON DELETE CASCADE, + CONSTRAINT `fk_product_customer_price_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_product_customer_price_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_product_customer_price_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_customer_price` +-- + +LOCK TABLES `llx_product_customer_price` WRITE; +/*!40000 ALTER TABLE `llx_product_customer_price` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_customer_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_customer_price_log` +-- + +DROP TABLE IF EXISTS `llx_product_customer_price_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_customer_price_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `fk_product` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `price_min` double(24,8) DEFAULT '0.00000000', + `price_min_ttc` double(24,8) DEFAULT '0.00000000', + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_customer_price_log` +-- + +LOCK TABLES `llx_product_customer_price_log` WRITE; +/*!40000 ALTER TABLE `llx_product_customer_price_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_customer_price_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_extrafields` +-- + +DROP TABLE IF EXISTS `llx_product_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_product_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_extrafields` +-- + +LOCK TABLES `llx_product_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_product_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_fournisseur_price` +-- + +DROP TABLE IF EXISTS `llx_product_fournisseur_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_fournisseur_price` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `ref_fourn` varchar(30) DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `quantity` double DEFAULT NULL, + `remise_percent` double NOT NULL DEFAULT '0', + `remise` double NOT NULL DEFAULT '0', + `unitprice` double(24,8) DEFAULT '0.00000000', + `charges` double(24,8) DEFAULT '0.00000000', + `unitcharges` double(24,8) DEFAULT '0.00000000', + `tva_tx` double(6,3) NOT NULL DEFAULT '0.000', + `default_vat_code` varchar(10) DEFAULT NULL, + `info_bits` int(11) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_supplier_price_expression` int(11) DEFAULT NULL, + `fk_price_expression` int(11) DEFAULT NULL, + `delivery_time_days` int(11) DEFAULT NULL, + `supplier_reputation` varchar(10) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_price_ttc` double(24,8) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_price` double(24,8) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_fournisseur_price_ref` (`ref_fourn`,`fk_soc`,`quantity`,`entity`), + KEY `idx_product_fournisseur_price_fk_user` (`fk_user`), + KEY `idx_product_fourn_price_fk_product` (`fk_product`,`entity`), + KEY `idx_product_fourn_price_fk_soc` (`fk_soc`,`entity`), + CONSTRAINT `fk_product_fournisseur_price_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_product_fournisseur_price_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_fournisseur_price` +-- + +LOCK TABLES `llx_product_fournisseur_price` WRITE; +/*!40000 ALTER TABLE `llx_product_fournisseur_price` DISABLE KEYS */; +INSERT INTO `llx_product_fournisseur_price` VALUES (1,'2010-07-11 18:45:42','2012-12-08 13:11:08',4,1,'ABCD',NULL,10.00000000,1,0,0,10.00000000,0.00000000,0.00000000,0.000,NULL,0,1,NULL,1,NULL,NULL,NULL,NULL,1.00000000,NULL,NULL,NULL,NULL),(2,'2016-07-30 17:34:38','2016-07-30 13:34:38',12,10,'BASIC',0,9.00000000,1,0,0,9.00000000,0.00000000,0.00000000,0.000,NULL,0,12,NULL,1,NULL,NULL,NULL,'FAVORITE',1.00000000,NULL,NULL,NULL,NULL),(3,'2017-02-02 05:17:08','2017-02-02 01:17:08',1,10,'aaa',0,100.00000000,1,10,0,100.00000000,0.00000000,0.00000000,12.500,NULL,0,12,NULL,1,NULL,NULL,NULL,NULL,1.00000000,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_product_fournisseur_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_fournisseur_price_log` +-- + +DROP TABLE IF EXISTS `llx_product_fournisseur_price_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_fournisseur_price_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `fk_product_fournisseur` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `quantity` double DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_price` double(24,8) DEFAULT NULL, + `multicurrency_price_ttc` double(24,8) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_fournisseur_price_log` +-- + +LOCK TABLES `llx_product_fournisseur_price_log` WRITE; +/*!40000 ALTER TABLE `llx_product_fournisseur_price_log` DISABLE KEYS */; +INSERT INTO `llx_product_fournisseur_price_log` VALUES (1,'2010-07-11 18:45:42',1,10.00000000,1,1,NULL,NULL,1.00000000,NULL,NULL); +/*!40000 ALTER TABLE `llx_product_fournisseur_price_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_lang` +-- + +DROP TABLE IF EXISTS `llx_product_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_lang` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product` int(11) NOT NULL DEFAULT '0', + `lang` varchar(5) NOT NULL DEFAULT '0', + `label` varchar(255) NOT NULL, + `description` text, + `note` text, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_lang` (`fk_product`,`lang`), + CONSTRAINT `fk_product_lang_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_lang` +-- + +LOCK TABLES `llx_product_lang` WRITE; +/*!40000 ALTER TABLE `llx_product_lang` DISABLE KEYS */; +INSERT INTO `llx_product_lang` VALUES (1,1,'en_US','Pink dress','A beatifull pink dress','',NULL),(2,2,'en_US','Pear Pie','','',NULL),(3,3,'en_US','Cake making contribution','','',NULL),(4,4,'fr_FR','Decapsuleur','','',NULL),(5,5,'en_US','DoliDroid, Android app for Dolibarr','DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

','',NULL),(9,11,'fr_FR','hfghf','','',NULL),(10,2,'fr_FR','Product P1','','',NULL),(11,4,'en_US','Apple Pie','Nice Bio Apple Pie.
\r\n ','',NULL),(12,11,'en_US','Rollup Dolibarr','A nice rollup','',NULL),(13,10,'en_US','Computer XP4523','A powerfull computer XP4523 ','This product is imported.
\r\nWarning: Delay to get it are not reliable.',NULL),(14,12,'en_US','SaaS hosting of Dolibarr ERP CRM','Cloud hosting of Dolibarr ERP and CRM software','',NULL),(15,12,'fr_FR','Service SaaS Hébergement Dolibarr ERP CRM','Service SaaS d'hébergement de la solution Dolibarr ERP CRM','',NULL),(16,13,'en_US','Computer XP4523','A powerfull computer XP4523 ',NULL,NULL),(17,13,'fr_FR','Computer XP4523','A powerfull computer XP4523 ',NULL,NULL); +/*!40000 ALTER TABLE `llx_product_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_lot` +-- + +DROP TABLE IF EXISTS `llx_product_lot`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_lot` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) DEFAULT '1', + `fk_product` int(11) NOT NULL, + `batch` varchar(30) DEFAULT NULL, + `eatby` date DEFAULT NULL, + `sellby` date DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `import_key` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_lot` (`fk_product`,`batch`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_lot` +-- + +LOCK TABLES `llx_product_lot` WRITE; +/*!40000 ALTER TABLE `llx_product_lot` DISABLE KEYS */; +INSERT INTO `llx_product_lot` VALUES (1,1,2,'123456','2016-07-07',NULL,'2016-07-21 20:55:19','2016-12-12 10:53:58',NULL,NULL,NULL),(2,1,2,'2222','2016-07-08','2016-07-07','2016-07-21 21:00:42','2016-12-12 10:53:58',NULL,NULL,NULL),(3,1,10,'5599887766452',NULL,NULL,'2016-07-30 17:39:31','2016-12-12 10:53:58',NULL,NULL,NULL),(4,1,10,'4494487766452',NULL,NULL,'2016-07-30 17:40:12','2016-12-12 10:53:58',NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_product_lot` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_lot_extrafields` +-- + +DROP TABLE IF EXISTS `llx_product_lot_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_lot_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_product_lot_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_lot_extrafields` +-- + +LOCK TABLES `llx_product_lot_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_product_lot_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_lot_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_price` +-- + +DROP TABLE IF EXISTS `llx_product_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_price` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `date_price` datetime DEFAULT NULL, + `price_level` smallint(6) DEFAULT '1', + `price` double(24,8) DEFAULT NULL, + `price_ttc` double(24,8) DEFAULT NULL, + `price_min` double(24,8) DEFAULT NULL, + `price_min_ttc` double(24,8) DEFAULT NULL, + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) NOT NULL, + `default_vat_code` varchar(10) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `tosell` tinyint(4) DEFAULT '1', + `price_by_qty` int(11) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_price_expression` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_price` double(24,8) DEFAULT '0.00000000', + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_price_ttc` double(24,8) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_product_price_fk_user_author` (`fk_user_author`), + KEY `idx_product_price_fk_product` (`fk_product`), + CONSTRAINT `fk_product_price_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_product_price_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_price` +-- + +LOCK TABLES `llx_product_price` WRITE; +/*!40000 ALTER TABLE `llx_product_price` DISABLE KEYS */; +INSERT INTO `llx_product_price` VALUES (1,1,'2010-07-08 12:33:17',1,'2010-07-08 14:33:17',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(2,1,'2010-07-08 22:30:01',2,'2010-07-09 00:30:01',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(3,1,'2010-07-08 22:30:25',3,'2010-07-09 00:30:25',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(4,1,'2010-07-10 12:44:06',4,'2010-07-10 14:44:06',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(5,1,'2011-07-20 21:11:38',5,'2011-07-20 23:11:38',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',19.600,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(6,1,'2011-07-27 17:02:59',5,'2011-07-27 19:02:59',1,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(10,1,'2011-07-31 22:34:27',4,'2011-08-01 00:34:27',1,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(12,1,'2013-01-13 19:24:59',11,'2013-01-13 20:24:59',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(13,1,'2013-03-12 09:30:24',1,'2013-03-12 10:30:24',1,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(14,1,'2016-07-30 13:31:29',12,'2016-07-30 17:31:29',1,9.00000000,9.00000000,9.00000000,9.00000000,'HT',0.000,NULL,0,0.000,'0',0.000,'0',12,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(15,1,'2017-02-15 23:49:00',13,'2017-02-16 03:49:00',1,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,NULL,0,0.000,'0',0.000,'0',12,0,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL),(16,1,'2017-08-30 15:04:04',10,'2017-08-30 19:04:04',1,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,NULL,0,0.000,'0',0.000,'0',12,1,0,NULL,NULL,NULL,NULL,0.00000000,1.00000000,NULL); +/*!40000 ALTER TABLE `llx_product_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_price_by_qty` +-- + +DROP TABLE IF EXISTS `llx_product_price_by_qty`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_price_by_qty` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_price` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `remise_percent` double NOT NULL DEFAULT '0', + `remise` double NOT NULL DEFAULT '0', + `qty_min` double DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_price_by_qty_level` (`fk_product_price`,`qty_min`), + KEY `idx_product_price_by_qty_fk_product_price` (`fk_product_price`), + CONSTRAINT `fk_product_price_by_qty_fk_product_price` FOREIGN KEY (`fk_product_price`) REFERENCES `llx_product_price` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_price_by_qty` +-- + +LOCK TABLES `llx_product_price_by_qty` WRITE; +/*!40000 ALTER TABLE `llx_product_price_by_qty` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_price_by_qty` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_pricerules` +-- + +DROP TABLE IF EXISTS `llx_product_pricerules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_pricerules` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `level` int(11) NOT NULL, + `fk_level` int(11) NOT NULL, + `var_percent` float NOT NULL, + `var_min_percent` float NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `unique_level` (`level`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_pricerules` +-- + +LOCK TABLES `llx_product_pricerules` WRITE; +/*!40000 ALTER TABLE `llx_product_pricerules` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_pricerules` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_stock` +-- + +DROP TABLE IF EXISTS `llx_product_stock`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_stock` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `fk_entrepot` int(11) NOT NULL, + `reel` double DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_stock` (`fk_product`,`fk_entrepot`), + KEY `idx_product_stock_fk_product` (`fk_product`), + KEY `idx_product_stock_fk_entrepot` (`fk_entrepot`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_stock` +-- + +LOCK TABLES `llx_product_stock` WRITE; +/*!40000 ALTER TABLE `llx_product_stock` DISABLE KEYS */; +INSERT INTO `llx_product_stock` VALUES (1,'2010-07-08 22:43:51',2,2,1000,NULL),(3,'2010-07-10 23:02:20',4,2,1000,NULL),(4,'2013-01-19 17:22:48',4,1,1,NULL),(5,'2013-01-19 17:22:48',1,1,2,NULL),(6,'2013-01-19 17:22:48',11,1,-1,NULL),(7,'2013-01-19 17:31:58',2,1,-2,NULL),(8,'2016-07-30 13:40:39',10,2,75,NULL),(9,'2017-02-16 00:12:09',10,1,35,NULL); +/*!40000 ALTER TABLE `llx_product_stock` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_subproduct` +-- + +DROP TABLE IF EXISTS `llx_product_subproduct`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_subproduct` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product` int(11) NOT NULL, + `fk_product_subproduct` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `fk_product` (`fk_product`,`fk_product_subproduct`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_subproduct` +-- + +LOCK TABLES `llx_product_subproduct` WRITE; +/*!40000 ALTER TABLE `llx_product_subproduct` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_subproduct` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_warehouse_properties` +-- + +DROP TABLE IF EXISTS `llx_product_warehouse_properties`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_warehouse_properties` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `fk_entrepot` int(11) NOT NULL, + `seuil_stock_alerte` int(11) DEFAULT '0', + `desiredstock` int(11) DEFAULT '0', + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_warehouse_properties` +-- + +LOCK TABLES `llx_product_warehouse_properties` WRITE; +/*!40000 ALTER TABLE `llx_product_warehouse_properties` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_warehouse_properties` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet` +-- + +DROP TABLE IF EXISTS `llx_projet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `datec` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dateo` date DEFAULT NULL, + `datee` date DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `description` text, + `fk_user_creat` int(11) NOT NULL, + `public` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `fk_opp_status` int(11) DEFAULT NULL, + `opp_percent` double(5,2) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `budget_amount` double(24,8) DEFAULT NULL, + `date_close` datetime DEFAULT NULL, + `fk_user_close` int(11) DEFAULT NULL, + `opp_amount` double(24,8) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_projet_ref` (`ref`,`entity`), + KEY `idx_projet_fk_soc` (`fk_soc`), + CONSTRAINT `fk_projet_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet` +-- + +LOCK TABLES `llx_projet` WRITE; +/*!40000 ALTER TABLE `llx_projet` DISABLE KEYS */; +INSERT INTO `llx_projet` VALUES (1,11,'2010-07-09','2015-10-05 20:51:28','2010-07-09',NULL,'PROJ1',1,'Project One','',1,0,1,NULL,NULL,NULL,'gdfgdfg','baleine',NULL,NULL,NULL,NULL,NULL,NULL),(2,13,'2010-07-09','2015-10-05 20:51:51','2010-07-09',NULL,'PROJ2',1,'Project Two','',1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,1,'2010-07-09','2017-02-01 11:55:08','2010-07-09',NULL,'PROJINDIAN',1,'Project for Indian company move','',1,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,NULL,'2010-07-09','2010-07-08 22:50:49','2010-07-09',NULL,'PROJSHARED',1,'The Global project','',1,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,NULL,'2010-07-11','2017-02-01 15:01:51','2010-07-11','2011-07-14','RMLL',1,'Project management RMLL','',1,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,10,'2016-07-30','2016-07-30 15:53:07','2016-07-30',NULL,'PJ1607-0001',1,'PROJALICE1','The Alice project number 1',12,0,1,2,20.00,NULL,NULL,NULL,5000.00000000,NULL,NULL,8000.00000000,NULL,NULL),(7,10,'2016-07-30','2017-02-01 12:24:37','2016-07-30',NULL,'PJ1607-0002',1,'PROJALICE2','The Alice project number 2',12,0,1,6,100.00,NULL,NULL,NULL,NULL,'2017-02-01 16:24:31',12,7000.00000000,NULL,NULL),(8,10,'2016-07-30','2016-07-30 15:53:23','2016-07-30',NULL,'PJ1607-0003',1,'PROJALICE2','The Alice project number 3',12,0,1,6,100.00,NULL,NULL,NULL,NULL,NULL,NULL,3550.00000000,NULL,NULL),(9,4,'2016-07-31','2016-07-31 14:27:26','2016-07-31',NULL,'PJ1607-0004',1,'Project Top X','',12,0,1,2,27.00,NULL,NULL,NULL,NULL,NULL,NULL,4000.00000000,NULL,NULL); +/*!40000 ALTER TABLE `llx_projet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_projet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + `priority` text, + PRIMARY KEY (`rowid`), + KEY `idx_projet_extrafields` (`fk_object`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_extrafields` +-- + +LOCK TABLES `llx_projet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_projet_extrafields` DISABLE KEYS */; +INSERT INTO `llx_projet_extrafields` VALUES (5,'2016-07-30 15:53:07',6,NULL,'3'),(7,'2016-07-30 15:53:23',8,NULL,'5'),(9,'2016-07-31 14:27:24',9,NULL,'0'),(13,'2017-02-01 11:55:08',3,NULL,'0'),(15,'2017-02-01 12:24:31',7,NULL,'1'),(16,'2017-02-01 15:01:51',5,NULL,'0'); +/*!40000 ALTER TABLE `llx_projet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task` +-- + +DROP TABLE IF EXISTS `llx_projet_task`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(50) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_projet` int(11) NOT NULL, + `fk_task_parent` int(11) NOT NULL DEFAULT '0', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dateo` datetime DEFAULT NULL, + `datee` datetime DEFAULT NULL, + `datev` datetime DEFAULT NULL, + `label` varchar(255) NOT NULL, + `description` text, + `duration_effective` double DEFAULT '0', + `planned_workload` double DEFAULT '0', + `progress` int(11) DEFAULT '0', + `priority` int(11) DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `note_private` text, + `note_public` text, + `rang` int(11) DEFAULT '0', + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_projet_task_ref` (`ref`,`entity`), + KEY `idx_projet_task_fk_projet` (`fk_projet`), + KEY `idx_projet_task_fk_user_creat` (`fk_user_creat`), + KEY `idx_projet_task_fk_user_valid` (`fk_user_valid`), + CONSTRAINT `fk_projet_task_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_projet_task_fk_user_creat` FOREIGN KEY (`fk_user_creat`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_projet_task_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task` +-- + +LOCK TABLES `llx_projet_task` WRITE; +/*!40000 ALTER TABLE `llx_projet_task` DISABLE KEYS */; +INSERT INTO `llx_projet_task` VALUES (2,'2',1,5,0,'2010-07-11 16:23:53','2013-09-08 23:06:14','2010-07-11 12:00:00','2011-07-14 12:00:00',NULL,'Heberger site RMLL','',0,0,0,0,1,NULL,0,NULL,NULL,0,NULL,NULL),(3,'TK1007-0001',1,1,0,'2014-12-21 13:52:41','2016-07-30 11:35:40','2014-12-21 16:52:00',NULL,NULL,'Analyze','',9000,36000,0,0,1,NULL,0,NULL,'gdfgdfgdf',0,NULL,NULL),(4,'TK1007-0002',1,1,0,'2014-12-21 13:55:39','2016-07-30 11:35:51','2014-12-21 16:55:00',NULL,NULL,'Specification','',7200,18000,25,0,1,NULL,0,NULL,NULL,0,NULL,NULL),(5,'TK1007-0003',1,1,0,'2014-12-21 14:16:58','2016-07-30 11:35:59','2014-12-21 17:16:00',NULL,NULL,'Development','',0,0,0,0,1,NULL,0,NULL,NULL,0,NULL,NULL),(6,'TK1607-0004',1,6,0,'2016-07-30 15:33:27','2016-07-30 11:34:47','2016-07-30 02:00:00',NULL,NULL,'Project preparation phase A','',75600,720000,10,0,12,NULL,0,NULL,NULL,0,NULL,NULL),(7,'TK1607-0005',1,6,0,'2016-07-30 15:33:39','2017-01-30 11:23:39','2016-07-30 02:00:00',NULL,NULL,'Project preparation phase B','',40260,1080000,5,0,12,NULL,0,NULL,NULL,0,NULL,NULL),(8,'TK1607-0006',1,6,0,'2016-07-30 15:33:53','2016-07-30 11:33:53','2016-07-30 02:00:00',NULL,NULL,'Project execution phase A','',0,162000,0,0,12,NULL,0,NULL,NULL,0,NULL,NULL),(9,'TK1607-0007',1,6,0,'2016-07-30 15:34:09','2016-07-30 11:34:09','2016-10-27 02:00:00',NULL,NULL,'Project execution phase B','',0,2160000,0,0,12,NULL,0,NULL,NULL,0,NULL,NULL),(10,'TK1007-0008',1,1,0,'2016-07-30 15:36:31','2016-07-30 11:36:31','2016-07-30 02:00:00',NULL,NULL,'Tests','',0,316800,0,0,12,NULL,0,NULL,NULL,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_projet_task` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task_extrafields` +-- + +DROP TABLE IF EXISTS `llx_projet_task_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_projet_task_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task_extrafields` +-- + +LOCK TABLES `llx_projet_task_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_projet_task_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_projet_task_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task_time` +-- + +DROP TABLE IF EXISTS `llx_projet_task_time`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task_time` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_task` int(11) NOT NULL, + `task_date` date DEFAULT NULL, + `task_datehour` datetime DEFAULT NULL, + `task_date_withhour` int(11) DEFAULT '0', + `task_duration` double DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `thm` double(24,8) DEFAULT NULL, + `note` text, + `invoice_id` int(11) DEFAULT NULL, + `invoice_line_id` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `datec` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + KEY `idx_projet_task_time_task` (`fk_task`), + KEY `idx_projet_task_time_date` (`task_date`), + KEY `idx_projet_task_time_datehour` (`task_datehour`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task_time` +-- + +LOCK TABLES `llx_projet_task_time` WRITE; +/*!40000 ALTER TABLE `llx_projet_task_time` DISABLE KEYS */; +INSERT INTO `llx_projet_task_time` VALUES (2,4,'2014-12-21','2014-12-21 12:00:00',0,3600,1,NULL,'',NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(3,4,'2014-12-18','2014-12-18 12:00:00',0,3600,1,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(4,3,'2014-12-21','2014-12-21 12:00:00',0,3600,1,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(5,3,'2014-12-21','2014-12-21 12:00:00',0,1800,1,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(6,3,'2014-12-21','2014-12-21 12:00:00',0,3600,1,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(7,6,'2016-07-25','2016-07-25 00:00:00',0,18000,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(8,6,'2016-07-26','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(9,6,'2016-07-27','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(10,6,'2016-07-29','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(11,6,'2016-07-31','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(12,7,'2016-07-25','2016-07-25 00:00:00',0,10800,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(13,7,'2016-07-26','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(14,7,'2016-07-27','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(15,7,'2017-01-30','2017-01-30 10:00:00',1,660,12,NULL,'',NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'); +/*!40000 ALTER TABLE `llx_projet_task_time` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propal` +-- + +DROP TABLE IF EXISTS `llx_propal`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propal` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `ref_client` varchar(255) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `datep` date DEFAULT NULL, + `fin_validite` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `price` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(3) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `fk_delivery_address` int(11) DEFAULT NULL, + `fk_input_reason` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_propal_ref` (`ref`,`entity`), + KEY `idx_propal_fk_soc` (`fk_soc`), + KEY `idx_propal_fk_user_author` (`fk_user_author`), + KEY `idx_propal_fk_user_valid` (`fk_user_valid`), + KEY `idx_propal_fk_user_cloture` (`fk_user_cloture`), + KEY `idx_propal_fk_projet` (`fk_projet`), + KEY `idx_propal_fk_account` (`fk_account`), + KEY `idx_propal_fk_currency` (`fk_currency`), + CONSTRAINT `fk_propal_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_propal_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_propal_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_propal_fk_user_cloture` FOREIGN KEY (`fk_user_cloture`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_propal_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propal` +-- + +LOCK TABLES `llx_propal` WRITE; +/*!40000 ALTER TABLE `llx_propal` DISABLE KEYS */; +INSERT INTO `llx_propal` VALUES (1,2,NULL,'2016-07-30 15:56:45','PR1007-0001',1,NULL,NULL,'','2010-07-09 01:33:49','2016-07-09','2016-07-24 12:00:00','2017-08-08 14:24:18',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,30.00000000,3.84000000,0.00000000,0.00000000,33.84000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(2,1,NULL,'2016-07-30 15:56:54','PR1007-0002',1,NULL,NULL,'','2010-07-10 02:11:44','2016-07-10','2016-07-25 12:00:00','2016-07-10 02:12:55','2017-07-20 15:23:12',1,NULL,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,1,'','','azur',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(3,4,NULL,'2016-07-30 15:56:54','PR1007-0003',1,NULL,NULL,'','2010-07-18 11:35:11','2016-07-18','2016-08-02 12:00:00','2016-07-18 11:36:18','2017-07-20 15:21:15',1,NULL,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(5,19,NULL,'2016-07-30 15:56:54','PR1302-0005',1,NULL,NULL,'','2013-02-17 15:39:56','2016-02-17','2016-03-04 12:00:00','2018-11-15 23:27:10',NULL,1,NULL,12,NULL,1,0,NULL,NULL,0,10.00000000,2.00000000,0.00000000,0.00000000,12.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(6,19,NULL,'2016-07-30 15:56:54','PR1302-0006',1,NULL,NULL,'','2013-02-17 15:40:12','2016-02-17','2016-03-04 12:00:00',NULL,NULL,1,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(7,19,NULL,'2017-01-29 17:49:33','PR1302-0007',1,NULL,NULL,'','2013-02-17 15:41:15','2016-02-17','2016-03-04 12:00:00','2017-01-29 21:49:33',NULL,1,NULL,12,NULL,1,0,NULL,NULL,0,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,400.00000000,0.00000000,400.00000000),(8,19,NULL,'2016-07-30 15:56:39','PR1302-0008',1,NULL,NULL,'','2013-02-17 15:43:39','2016-02-17','2016-03-04 12:00:00',NULL,NULL,1,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(10,7,NULL,'2016-07-30 15:57:25','(PROV10)',1,NULL,NULL,'','2015-11-15 23:37:08','2015-11-15','2016-11-30 12:00:00',NULL,NULL,12,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,3,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,0,'',NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(11,1,NULL,'2017-02-16 00:44:58','PR1702-0009',1,NULL,NULL,'','2017-02-16 01:44:58','2015-05-13','2015-05-28 12:00:00','2017-02-16 01:44:58',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,60.00000000,0.00000000,0.00000000,0.00000000,60.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,60.00000000,0.00000000,60.00000000),(12,7,NULL,'2017-02-16 00:45:44','PR1702-0010',1,NULL,NULL,'','2017-02-16 01:45:44','2015-06-24','2015-07-09 12:00:00','2017-02-16 01:45:44',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,832.00000000,0.00000000,0.00000000,0.00000000,832.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,832.00000000,0.00000000,832.00000000),(13,26,NULL,'2017-02-16 00:46:15','PR1702-0011',1,NULL,NULL,'','2017-02-16 01:46:15','2015-04-03','2015-04-18 12:00:00','2017-02-16 01:46:15',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,242.00000000,0.00000000,0.00000000,0.00000000,242.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,242.00000000,0.00000000,242.00000000),(14,3,NULL,'2017-02-16 00:46:15','PR1702-0012',1,NULL,NULL,'','2017-02-16 01:46:15','2016-06-19','2016-07-04 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,245.00000000,0.00000000,0.00000000,0.00000000,245.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,245.00000000,0.00000000,245.00000000),(15,26,NULL,'2017-02-16 00:46:15','PR1702-0013',1,NULL,NULL,'','2017-02-16 01:46:15','2016-05-01','2016-05-16 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,940.00000000,0.00000000,0.00000000,0.00000000,940.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,940.00000000,0.00000000,940.00000000),(16,1,NULL,'2017-02-16 00:46:15','PR1702-0014',1,NULL,NULL,'','2017-02-16 01:46:15','2015-05-13','2015-05-28 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,125.00000000,0.00000000,0.00000000,0.00000000,125.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,125.00000000,0.00000000,125.00000000),(17,1,NULL,'2017-02-16 00:46:15','PR1702-0015',1,NULL,NULL,'','2017-02-16 01:46:15','2016-07-23','2016-08-07 12:00:00','2017-02-16 01:46:15',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,163.00000000,0.00000000,0.00000000,0.00000000,163.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,163.00000000,0.00000000,163.00000000),(18,26,NULL,'2017-02-16 00:46:15','PR1702-0016',1,NULL,NULL,'','2017-02-16 01:46:15','2015-02-13','2015-02-28 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,900.00000000,0.00000000,0.00000000,0.00000000,900.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,900.00000000,0.00000000,900.00000000),(19,12,NULL,'2017-02-16 00:46:15','PR1702-0017',1,NULL,NULL,'','2017-02-16 01:46:15','2015-03-30','2015-04-14 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,0.00000000,200.00000000),(20,26,NULL,'2017-02-16 00:46:15','PR1702-0018',1,NULL,NULL,'','2017-02-16 01:46:15','2016-11-13','2016-11-28 12:00:00','2017-02-16 01:46:15',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,830.00000000,0.00000000,0.00000000,0.00000000,830.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,830.00000000,0.00000000,830.00000000),(21,1,NULL,'2017-02-16 00:47:09','PR1702-0019',1,NULL,NULL,'','2017-02-16 01:46:15','2015-09-23','2018-10-08 12:00:00','2017-02-16 04:47:09',NULL,1,NULL,12,NULL,1,0,NULL,NULL,0,89.00000000,0.00000000,0.00000000,0.00000000,89.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,89.00000000,0.00000000,89.00000000),(22,26,NULL,'2017-02-16 00:47:13','PR1702-0020',1,NULL,NULL,'','2017-02-16 01:46:15','2016-11-13','2016-11-28 12:00:00','2017-02-16 01:46:15',NULL,1,NULL,1,NULL,0,0,NULL,NULL,0,70.00000000,0.00000000,0.00000000,0.00000000,70.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,70.00000000,0.00000000,70.00000000),(23,12,NULL,'2017-02-17 12:07:18','PR1702-0021',1,NULL,NULL,'','2017-02-16 01:46:17','2016-04-03','2016-04-18 12:00:00','2017-02-17 16:07:18',NULL,2,NULL,12,NULL,1,0,NULL,NULL,0,715.00000000,0.00000000,0.00000000,0.00000000,715.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,715.00000000,0.00000000,715.00000000),(24,7,NULL,'2017-02-16 00:46:17','PR1702-0022',1,NULL,NULL,'','2017-02-16 01:46:17','2016-11-13','2016-11-28 12:00:00','2017-02-16 01:46:17',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,250.00000000,0.00000000,0.00000000,0.00000000,250.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,250.00000000,0.00000000,250.00000000),(25,3,NULL,'2017-02-16 00:47:29','PR1702-0023',1,NULL,NULL,'','2017-02-16 01:46:17','2016-07-09','2016-07-24 12:00:00','2017-02-16 01:46:17','2017-02-16 04:47:29',1,NULL,1,12,4,0,NULL,NULL,0,1018.00000000,0.00000000,0.00000000,0.00000000,1018.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1018.00000000,0.00000000,1018.00000000),(26,1,NULL,'2017-02-16 00:46:18','PR1702-0024',1,NULL,NULL,'','2017-02-16 01:46:17','2016-04-03','2016-04-18 12:00:00','2017-02-16 01:46:18',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,710.00000000,0.00000000,0.00000000,0.00000000,710.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,710.00000000,0.00000000,710.00000000),(27,6,NULL,'2017-02-16 00:46:18','PR1702-0025',1,NULL,NULL,'','2017-02-16 01:46:18','2016-11-12','2016-11-27 12:00:00','2017-02-16 01:46:18',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,300.00000000,0.00000000,300.00000000),(28,19,NULL,'2017-02-16 00:46:31','PR1702-0026',1,NULL,NULL,'','2017-02-16 01:46:18','2015-07-30','2015-08-14 12:00:00','2017-02-16 01:46:18','2017-02-16 04:46:31',2,NULL,2,12,2,0,NULL,NULL,0,440.00000000,0.00000000,0.00000000,0.00000000,440.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,440.00000000,0.00000000,440.00000000),(29,1,NULL,'2017-02-16 00:46:37','PR1702-0027',1,NULL,NULL,'','2017-02-16 01:46:18','2015-07-23','2015-08-07 12:00:00','2017-02-16 01:46:18','2017-02-16 04:46:37',2,NULL,2,12,2,0,NULL,NULL,0,1000.00000000,0.00000000,0.00000000,0.00000000,1000.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000),(30,1,NULL,'2017-02-16 00:46:42','PR1702-0028',1,NULL,NULL,'','2017-02-16 01:46:18','2016-05-01','2016-05-16 12:00:00','2017-02-16 01:46:18','2017-02-16 04:46:42',2,NULL,2,12,3,0,NULL,NULL,0,1200.00000000,0.00000000,0.00000000,0.00000000,1200.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1200.00000000,0.00000000,1200.00000000),(31,11,NULL,'2017-02-16 00:46:18','PR1702-0029',1,NULL,NULL,'','2017-02-16 01:46:18','2016-06-24','2016-07-09 12:00:00','2017-02-16 01:46:18',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,720.00000000,0.00000000,0.00000000,0.00000000,720.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,720.00000000,0.00000000,720.00000000),(32,19,NULL,'2017-02-16 00:46:18','PR1702-0030',1,NULL,NULL,'','2017-02-16 01:46:18','2016-11-12','2016-11-27 12:00:00','2017-02-16 01:46:18',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,608.00000000,0.00000000,0.00000000,0.00000000,608.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,608.00000000,0.00000000,608.00000000); +/*!40000 ALTER TABLE `llx_propal` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propal_extrafields` +-- + +DROP TABLE IF EXISTS `llx_propal_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propal_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_propal_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propal_extrafields` +-- + +LOCK TABLES `llx_propal_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_propal_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_propal_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propal_merge_pdf_product` +-- + +DROP TABLE IF EXISTS `llx_propal_merge_pdf_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propal_merge_pdf_product` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product` int(11) NOT NULL, + `file_name` varchar(200) NOT NULL, + `lang` varchar(5) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) NOT NULL, + `datec` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propal_merge_pdf_product` +-- + +LOCK TABLES `llx_propal_merge_pdf_product` WRITE; +/*!40000 ALTER TABLE `llx_propal_merge_pdf_product` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_propal_merge_pdf_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propaldet` +-- + +DROP TABLE IF EXISTS `llx_propaldet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propaldet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_propal` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `fk_remise_except` int(11) DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT '0.000', + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `price` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_propaldet_fk_propal` (`fk_propal`), + KEY `idx_propaldet_fk_product` (`fk_product`), + KEY `fk_propaldet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_propaldet_fk_propal` FOREIGN KEY (`fk_propal`) REFERENCES `llx_propal` (`rowid`), + CONSTRAINT `fk_propaldet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propaldet` +-- + +LOCK TABLES `llx_propaldet` WRITE; +/*!40000 ALTER TABLE `llx_propaldet` DISABLE KEYS */; +INSERT INTO `llx_propaldet` VALUES (1,1,NULL,NULL,NULL,'Une machine à café',NULL,12.500,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.25000000,0.00000000,0.00000000,11.25000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(2,2,NULL,NULL,NULL,'Product 1',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(3,2,NULL,2,NULL,'',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(4,3,NULL,NULL,NULL,'A new marvelous product',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(5,1,NULL,5,NULL,'cccc',NULL,19.600,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(11,1,NULL,4,NULL,'',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(12,1,NULL,4,NULL,'',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(13,1,NULL,4,NULL,'',NULL,12.500,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(24,5,NULL,NULL,NULL,'On demand Apple pie',NULL,20.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,10.00000000,2.00000000,0.00000000,0.00000000,12.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(25,7,NULL,NULL,NULL,'Help to setup Magic Food computer',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,400.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'',400.00000000,400.00000000,0.00000000,400.00000000),(26,11,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(27,11,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,10.00000000,0.00000000,10.00000000),(28,12,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',5.00000000,5.00000000,0.00000000,5.00000000),(29,12,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(30,12,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(31,12,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,9.00000000,27.00000000,0.00000000,0.00000000,0.00000000,27.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',9.00000000,27.00000000,0.00000000,27.00000000),(32,12,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(33,13,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(34,13,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(35,13,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,9.00000000,27.00000000,0.00000000,0.00000000,0.00000000,27.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',9.00000000,27.00000000,0.00000000,27.00000000),(36,13,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(37,14,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(38,14,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(39,15,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(40,15,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(41,15,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(42,15,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(43,16,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(44,16,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(45,16,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(46,17,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(47,17,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(48,17,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(49,17,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(50,17,NULL,3,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(51,18,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(52,18,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(53,18,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(54,19,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(55,19,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(56,19,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(57,19,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(58,19,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(59,20,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(60,20,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,10.00000000,0.00000000,10.00000000),(61,20,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(62,20,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(63,21,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(64,21,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,9.00000000,9.00000000,0.00000000,0.00000000,0.00000000,9.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',9.00000000,9.00000000,0.00000000,9.00000000),(65,21,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(66,21,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(67,22,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(68,22,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(69,23,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(70,23,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(71,23,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(72,23,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(73,24,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',5.00000000,5.00000000,0.00000000,5.00000000),(74,24,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(75,24,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(76,24,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(77,25,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(78,25,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(79,25,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(80,25,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(81,25,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(82,26,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(83,26,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,10.00000000,0.00000000,10.00000000),(84,26,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(85,26,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(86,26,NULL,3,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(87,27,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(88,27,NULL,3,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(89,28,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(90,28,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,10.00000000,30.00000000,0.00000000,0.00000000,0.00000000,30.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,30.00000000,0.00000000,30.00000000),(91,28,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(92,28,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(93,29,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(94,29,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(95,29,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(96,30,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(97,30,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(98,30,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(99,30,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(100,31,NULL,4,NULL,'Nice Bio Apple Pie.
\r\n ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,5.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',5.00000000,20.00000000,0.00000000,20.00000000),(101,31,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(102,31,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(103,31,NULL,3,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(104,32,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(105,32,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(106,32,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(107,32,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(108,32,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',9.00000000,18.00000000,0.00000000,18.00000000); +/*!40000 ALTER TABLE `llx_propaldet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propaldet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_propaldet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propaldet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_propaldet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propaldet_extrafields` +-- + +LOCK TABLES `llx_propaldet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_propaldet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_propaldet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_resource` +-- + +DROP TABLE IF EXISTS `llx_resource`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_resource` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `ref` varchar(255) DEFAULT NULL, + `asset_number` varchar(255) DEFAULT NULL, + `description` text, + `fk_code_type_resource` varchar(32) DEFAULT NULL, + `note_public` text, + `note_private` text, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `fk_code_type_resource_idx` (`fk_code_type_resource`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_resource` +-- + +LOCK TABLES `llx_resource` WRITE; +/*!40000 ALTER TABLE `llx_resource` DISABLE KEYS */; +INSERT INTO `llx_resource` VALUES (1,1,'Car Kangoo 1',NULL,'Car number 1 - Num XDF-45-GH','RES_CARS',NULL,NULL,'2017-02-20 16:44:12',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL),(2,1,'Car Kangoo 2',NULL,'Car number 2 - Num GHY-78-JJ','RES_CARS',NULL,NULL,'2017-02-20 16:44:01',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL),(3,1,'Meeting room - 14p',NULL,'Meeting room
\r\n14 places','RES_ROOMS',NULL,NULL,'2017-02-20 16:44:38',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL),(4,1,'Meeting room - 8p',NULL,'Meeting room
\r\n8 places','RES_ROOMS',NULL,NULL,'2017-02-20 16:45:00',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_resource` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_resource_extrafields` +-- + +DROP TABLE IF EXISTS `llx_resource_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_resource_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_resource_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_resource_extrafields` +-- + +LOCK TABLES `llx_resource_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_resource_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_resource_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_rights_def` +-- + +DROP TABLE IF EXISTS `llx_rights_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_rights_def` ( + `id` int(11) NOT NULL DEFAULT '0', + `libelle` varchar(255) DEFAULT NULL, + `module` varchar(64) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `perms` varchar(50) DEFAULT NULL, + `subperms` varchar(50) DEFAULT NULL, + `type` varchar(1) DEFAULT NULL, + `bydefault` tinyint(4) DEFAULT '0', + PRIMARY KEY (`id`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_rights_def` +-- + +LOCK TABLES `llx_rights_def` WRITE; +/*!40000 ALTER TABLE `llx_rights_def` DISABLE KEYS */; +INSERT INTO `llx_rights_def` VALUES (11,'Lire les factures','facture',1,'lire',NULL,'a',0),(11,'Lire les factures','facture',2,'lire',NULL,'a',1),(12,'Creer/modifier les factures','facture',1,'creer',NULL,'a',0),(12,'Creer/modifier les factures','facture',2,'creer',NULL,'a',0),(13,'Dévalider les factures','facture',1,'invoice_advance','unvalidate','a',0),(13,'Dévalider les factures','facture',2,'invoice_advance','unvalidate','a',0),(14,'Valider les factures','facture',1,'invoice_advance','validate','a',0),(14,'Valider les factures','facture',2,'valider',NULL,'a',0),(15,'Envoyer les factures par mail','facture',1,'invoice_advance','send','a',0),(15,'Envoyer les factures par mail','facture',2,'invoice_advance','send','a',0),(16,'Emettre des paiements sur les factures','facture',1,'paiement',NULL,'a',0),(16,'Emettre des paiements sur les factures','facture',2,'paiement',NULL,'a',0),(19,'Supprimer les factures','facture',1,'supprimer',NULL,'a',0),(19,'Supprimer les factures','facture',2,'supprimer',NULL,'a',0),(21,'Lire les propositions commerciales','propale',1,'lire',NULL,'r',1),(21,'Lire les propositions commerciales','propale',2,'lire',NULL,'r',1),(22,'Creer/modifier les propositions commerciales','propale',1,'creer',NULL,'w',0),(22,'Creer/modifier les propositions commerciales','propale',2,'creer',NULL,'w',0),(24,'Valider les propositions commerciales','propale',1,'propal_advance','validate','d',0),(24,'Valider les propositions commerciales','propale',2,'valider',NULL,'d',0),(25,'Envoyer les propositions commerciales aux clients','propale',1,'propal_advance','send','d',0),(25,'Envoyer les propositions commerciales aux clients','propale',2,'propal_advance','send','d',0),(26,'Cloturer les propositions commerciales','propale',1,'cloturer',NULL,'d',0),(26,'Cloturer les propositions commerciales','propale',2,'cloturer',NULL,'d',0),(27,'Supprimer les propositions commerciales','propale',1,'supprimer',NULL,'d',0),(27,'Supprimer les propositions commerciales','propale',2,'supprimer',NULL,'d',0),(28,'Exporter les propositions commerciales et attributs','propale',1,'export',NULL,'r',0),(28,'Exporter les propositions commerciales et attributs','propale',2,'export',NULL,'r',0),(31,'Lire les produits','produit',1,'lire',NULL,'r',1),(31,'Lire les produits','produit',2,'lire',NULL,'r',1),(32,'Creer/modifier les produits','produit',1,'creer',NULL,'w',0),(32,'Creer/modifier les produits','produit',2,'creer',NULL,'w',0),(34,'Supprimer les produits','produit',1,'supprimer',NULL,'d',0),(34,'Supprimer les produits','produit',2,'supprimer',NULL,'d',0),(38,'Exporter les produits','produit',1,'export',NULL,'r',0),(38,'Exporter les produits','produit',2,'export',NULL,'r',0),(41,'Read projects and tasks (shared projects or projects I am contact for). Can also enter time consumed on assigned tasks (timesheet)','projet',1,'lire',NULL,'r',1),(42,'Create/modify projects and tasks (shared projects or projects I am contact for)','projet',1,'creer',NULL,'w',0),(44,'Delete project and tasks (shared projects or projects I am contact for)','projet',1,'supprimer',NULL,'d',0),(45,'Export projects','projet',1,'export',NULL,'d',0),(61,'Lire les fiches d\'intervention','ficheinter',1,'lire',NULL,'r',1),(62,'Creer/modifier les fiches d\'intervention','ficheinter',1,'creer',NULL,'w',0),(64,'Supprimer les fiches d\'intervention','ficheinter',1,'supprimer',NULL,'d',0),(67,'Exporter les fiches interventions','ficheinter',1,'export',NULL,'r',0),(68,'Envoyer les fiches d\'intervention par courriel','ficheinter',1,'ficheinter_advance','send','r',0),(69,'Valider les fiches d\'intervention ','ficheinter',1,'ficheinter_advance','validate','a',0),(70,'Dévalider les fiches d\'intervention','ficheinter',1,'ficheinter_advance','unvalidate','a',0),(81,'Lire les commandes clients','commande',1,'lire',NULL,'r',0),(82,'Creer/modifier les commandes clients','commande',1,'creer',NULL,'w',0),(84,'Valider les commandes clients','commande',1,'order_advance','validate','d',0),(86,'Envoyer les commandes clients','commande',1,'order_advance','send','d',0),(87,'Cloturer les commandes clients','commande',1,'cloturer',NULL,'d',0),(88,'Annuler les commandes clients','commande',1,'order_advance','annuler','d',0),(89,'Supprimer les commandes clients','commande',1,'supprimer',NULL,'d',0),(91,'Lire les charges','tax',1,'charges','lire','r',0),(91,'Lire les charges','tax',2,'charges','lire','r',1),(92,'Creer/modifier les charges','tax',1,'charges','creer','w',0),(92,'Creer/modifier les charges','tax',2,'charges','creer','w',0),(93,'Supprimer les charges','tax',1,'charges','supprimer','d',0),(93,'Supprimer les charges','tax',2,'charges','supprimer','d',0),(94,'Exporter les charges','tax',1,'charges','export','r',0),(94,'Exporter les charges','tax',2,'charges','export','r',0),(101,'Lire les expeditions','expedition',1,'lire',NULL,'r',1),(102,'Creer modifier les expeditions','expedition',1,'creer',NULL,'w',0),(104,'Valider les expeditions','expedition',1,'shipping_advance','validate','d',0),(105,'Envoyer les expeditions aux clients','expedition',1,'shipping_advance','send','d',0),(106,'Exporter les expeditions','expedition',1,'shipment','export','r',0),(109,'Supprimer les expeditions','expedition',1,'supprimer',NULL,'d',0),(111,'Lire les comptes bancaires','banque',1,'lire',NULL,'r',0),(111,'Lire les comptes bancaires','banque',2,'lire',NULL,'r',1),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',1,'modifier',NULL,'w',0),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',2,'modifier',NULL,'w',0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',1,'configurer',NULL,'a',0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',2,'configurer',NULL,'a',0),(114,'Rapprocher les ecritures bancaires','banque',1,'consolidate',NULL,'w',0),(114,'Rapprocher les ecritures bancaires','banque',2,'consolidate',NULL,'w',0),(115,'Exporter transactions et releves','banque',1,'export',NULL,'r',0),(115,'Exporter transactions et releves','banque',2,'export',NULL,'r',0),(116,'Virements entre comptes','banque',1,'transfer',NULL,'w',0),(116,'Virements entre comptes','banque',2,'transfer',NULL,'w',0),(117,'Gerer les envois de cheques','banque',1,'cheque',NULL,'w',0),(117,'Gerer les envois de cheques','banque',2,'cheque',NULL,'w',0),(121,'Lire les societes','societe',1,'lire',NULL,'r',0),(121,'Lire les societes','societe',2,'lire',NULL,'r',1),(122,'Creer modifier les societes','societe',1,'creer',NULL,'w',0),(122,'Creer modifier les societes','societe',2,'creer',NULL,'w',0),(125,'Supprimer les societes','societe',1,'supprimer',NULL,'d',0),(125,'Supprimer les societes','societe',2,'supprimer',NULL,'d',0),(126,'Exporter les societes','societe',1,'export',NULL,'r',0),(126,'Exporter les societes','societe',2,'export',NULL,'r',0),(141,'Read all projects and tasks (also private projects I am not contact for)','projet',1,'all','lire','r',0),(142,'Create/modify all projects and tasks (also private projects I am not contact for)','projet',1,'all','creer','w',0),(144,'Delete all projects and tasks (also private projects I am not contact for)','projet',1,'all','supprimer','d',0),(151,'Read withdrawals','prelevement',1,'bons','lire','r',1),(152,'Create/modify a withdrawals','prelevement',1,'bons','creer','w',0),(153,'Send withdrawals to bank','prelevement',1,'bons','send','a',0),(154,'credit/refuse withdrawals','prelevement',1,'bons','credit','a',0),(161,'Lire les contrats','contrat',1,'lire',NULL,'r',1),(162,'Creer / modifier les contrats','contrat',1,'creer',NULL,'w',0),(163,'Activer un service d\'un contrat','contrat',1,'activer',NULL,'w',0),(164,'Desactiver un service d\'un contrat','contrat',1,'desactiver',NULL,'w',0),(165,'Supprimer un contrat','contrat',1,'supprimer',NULL,'d',0),(167,'Export contracts','contrat',1,'export',NULL,'r',0),(221,'Consulter les mailings','mailing',1,'lire',NULL,'r',1),(221,'Consulter les mailings','mailing',2,'lire',NULL,'r',1),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',1,'creer',NULL,'w',0),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',2,'creer',NULL,'w',0),(223,'Valider les mailings (permet leur envoi)','mailing',1,'valider',NULL,'w',0),(223,'Valider les mailings (permet leur envoi)','mailing',2,'valider',NULL,'w',0),(229,'Supprimer les mailings','mailing',1,'supprimer',NULL,'d',0),(229,'Supprimer les mailings','mailing',2,'supprimer',NULL,'d',0),(237,'View recipients and info','mailing',1,'mailing_advance','recipient','r',0),(237,'View recipients and info','mailing',2,'mailing_advance','recipient','r',0),(238,'Manually send mailings','mailing',1,'mailing_advance','send','w',0),(238,'Manually send mailings','mailing',2,'mailing_advance','send','w',0),(239,'Delete mailings after validation and/or sent','mailing',1,'mailing_advance','delete','d',0),(239,'Delete mailings after validation and/or sent','mailing',2,'mailing_advance','delete','d',0),(241,'Lire les categories','categorie',1,'lire',NULL,'r',1),(242,'Creer/modifier les categories','categorie',1,'creer',NULL,'w',0),(243,'Supprimer les categories','categorie',1,'supprimer',NULL,'d',0),(251,'Consulter les autres utilisateurs','user',1,'user','lire','r',0),(252,'Consulter les permissions des autres utilisateurs','user',1,'user_advance','readperms','r',0),(253,'Creer/modifier utilisateurs internes et externes','user',1,'user','creer','w',0),(254,'Creer/modifier utilisateurs externes seulement','user',1,'user_advance','write','w',0),(255,'Modifier le mot de passe des autres utilisateurs','user',1,'user','password','w',0),(256,'Supprimer ou desactiver les autres utilisateurs','user',1,'user','supprimer','d',0),(262,'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).','societe',1,'client','voir','r',0),(262,'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).','societe',2,'client','voir','r',1),(281,'Lire les contacts','societe',1,'contact','lire','r',0),(281,'Lire les contacts','societe',2,'contact','lire','r',1),(282,'Creer modifier les contacts','societe',1,'contact','creer','w',0),(282,'Creer modifier les contacts','societe',2,'contact','creer','w',0),(283,'Supprimer les contacts','societe',1,'contact','supprimer','d',0),(283,'Supprimer les contacts','societe',2,'contact','supprimer','d',0),(286,'Exporter les contacts','societe',1,'contact','export','d',0),(286,'Exporter les contacts','societe',2,'contact','export','d',0),(300,'Read barcodes','barcode',1,'lire_advance',NULL,'r',1),(301,'Create/modify barcodes','barcode',1,'creer_advance',NULL,'w',0),(341,'Consulter ses propres permissions','user',1,'self_advance','readperms','r',0),(342,'Creer/modifier ses propres infos utilisateur','user',1,'self','creer','w',0),(343,'Modifier son propre mot de passe','user',1,'self','password','w',0),(344,'Modifier ses propres permissions','user',1,'self_advance','writeperms','w',0),(351,'Consulter les groupes','user',1,'group_advance','read','r',0),(352,'Consulter les permissions des groupes','user',1,'group_advance','readperms','r',0),(353,'Creer/modifier les groupes et leurs permissions','user',1,'group_advance','write','w',0),(354,'Supprimer ou desactiver les groupes','user',1,'group_advance','delete','d',0),(358,'Exporter les utilisateurs','user',1,'user','export','r',0),(501,'Read employee contracts/salaries','salaries',1,'read',NULL,'r',0),(502,'Create/modify employee contracts/salaries','salaries',1,'write',NULL,'w',0),(510,'Read salaries','salaries',1,'read',NULL,'r',0),(511,'Read employee contracts/salaries','salaries',1,'read',NULL,'r',0),(512,'Create/modify salaries','salaries',1,'write',NULL,'w',0),(513,'Create/modify payment of salaries','salaries',1,'write',NULL,'w',0),(514,'Delete salaries','salaries',1,'delete',NULL,'d',0),(517,'Export salaries','salaries',1,'export',NULL,'r',0),(520,'Read loans','loan',1,'read',NULL,'r',0),(522,'Create/modify loans','loan',1,'write',NULL,'w',0),(524,'Delete loans','loan',1,'delete',NULL,'d',0),(525,'Access loan calculator','loan',1,'calc',NULL,'r',0),(527,'Export loans','loan',1,'export',NULL,'r',0),(531,'Lire les services','service',1,'lire',NULL,'r',0),(532,'Creer/modifier les services','service',1,'creer',NULL,'w',0),(534,'Supprimer les services','service',1,'supprimer',NULL,'d',0),(538,'Exporter les services','service',1,'export',NULL,'r',0),(701,'Lire les dons','don',1,'lire',NULL,'r',1),(701,'Lire les dons','don',2,'lire',NULL,'r',1),(702,'Creer/modifier les dons','don',1,'creer',NULL,'w',0),(702,'Creer/modifier les dons','don',2,'creer',NULL,'w',0),(703,'Supprimer les dons','don',1,'supprimer',NULL,'d',0),(703,'Supprimer les dons','don',2,'supprimer',NULL,'d',0),(771,'Read expense reports (yours and your subordinates)','expensereport',1,'lire',NULL,'r',1),(772,'Create/modify expense reports','expensereport',1,'creer',NULL,'w',0),(773,'Delete expense reports','expensereport',1,'supprimer',NULL,'d',0),(774,'Read all expense reports','expensereport',1,'readall',NULL,'r',1),(775,'Approve expense reports','expensereport',1,'approve',NULL,'w',0),(776,'Pay expense reports','expensereport',1,'to_paid',NULL,'w',0),(777,'Read expense reports of everybody','expensereport',1,'readall',NULL,'r',1),(778,'Create expense reports for everybody','expensereport',1,'writeall_advance',NULL,'w',0),(779,'Export expense reports','expensereport',1,'export',NULL,'r',0),(1001,'Lire les stocks','stock',1,'lire',NULL,'r',1),(1002,'Creer/Modifier les stocks','stock',1,'creer',NULL,'w',0),(1003,'Supprimer les stocks','stock',1,'supprimer',NULL,'d',0),(1004,'Lire mouvements de stocks','stock',1,'mouvement','lire','r',1),(1005,'Creer/modifier mouvements de stocks','stock',1,'mouvement','creer','w',0),(1101,'Lire les bons de livraison','expedition',1,'livraison','lire','r',1),(1102,'Creer modifier les bons de livraison','expedition',1,'livraison','creer','w',0),(1104,'Valider les bons de livraison','expedition',1,'livraison_advance','validate','d',0),(1109,'Supprimer les bons de livraison','expedition',1,'livraison','supprimer','d',0),(1121,'Read supplier proposals','supplier_proposal',1,'lire',NULL,'w',1),(1122,'Create/modify supplier proposals','supplier_proposal',1,'creer',NULL,'w',0),(1123,'Validate supplier proposals','supplier_proposal',1,'validate_advance',NULL,'w',0),(1124,'Envoyer les demandes fournisseurs','supplier_proposal',1,'send_advance',NULL,'w',0),(1125,'Delete supplier proposals','supplier_proposal',1,'supprimer',NULL,'w',0),(1126,'Close supplier price requests','supplier_proposal',1,'cloturer',NULL,'w',0),(1181,'Consulter les fournisseurs','fournisseur',1,'lire',NULL,'r',0),(1182,'Consulter les commandes fournisseur','fournisseur',1,'commande','lire','r',0),(1183,'Creer une commande fournisseur','fournisseur',1,'commande','creer','w',0),(1184,'Valider une commande fournisseur','fournisseur',1,'supplier_order_advance','validate','w',0),(1185,'Approuver une commande fournisseur','fournisseur',1,'commande','approuver','w',0),(1186,'Commander une commande fournisseur','fournisseur',1,'commande','commander','w',0),(1187,'Receptionner une commande fournisseur','fournisseur',1,'commande','receptionner','d',0),(1188,'Supprimer une commande fournisseur','fournisseur',1,'commande','supprimer','d',0),(1189,'Check/Uncheck a supplier order reception','fournisseur',1,'commande_advance','check','w',0),(1201,'Lire les exports','export',1,'lire',NULL,'r',1),(1202,'Creer/modifier un export','export',1,'creer',NULL,'w',0),(1231,'Consulter les factures fournisseur','fournisseur',1,'facture','lire','r',0),(1232,'Creer une facture fournisseur','fournisseur',1,'facture','creer','w',0),(1233,'Valider une facture fournisseur','fournisseur',1,'supplier_invoice_advance','validate','w',0),(1234,'Supprimer une facture fournisseur','fournisseur',1,'facture','supprimer','d',0),(1235,'Envoyer les factures par mail','fournisseur',1,'supplier_invoice_advance','send','a',0),(1236,'Exporter les factures fournisseurs, attributs et reglements','fournisseur',1,'facture','export','r',0),(1237,'Exporter les commande fournisseurs, attributs','fournisseur',1,'commande','export','r',0),(1251,'Run mass imports of external data (data load)','import',1,'run',NULL,'r',0),(1321,'Exporter les factures clients, attributs et reglements','facture',1,'facture','export','r',0),(1321,'Exporter les factures clients, attributs et reglements','facture',2,'facture','export','r',0),(1322,'Rouvrir une facture totalement réglée','facture',1,'invoice_advance','reopen','r',0),(1421,'Exporter les commandes clients et attributs','commande',1,'commande','export','r',0),(2401,'Read actions/tasks linked to his account','agenda',1,'myactions','read','r',0),(2401,'Read actions/tasks linked to his account','agenda',2,'myactions','read','r',1),(2402,'Create/modify actions/tasks linked to his account','agenda',1,'myactions','create','w',0),(2402,'Create/modify actions/tasks linked to his account','agenda',2,'myactions','create','w',0),(2403,'Delete actions/tasks linked to his account','agenda',1,'myactions','delete','w',0),(2403,'Delete actions/tasks linked to his account','agenda',2,'myactions','delete','w',0),(2411,'Read actions/tasks of others','agenda',1,'allactions','read','r',0),(2411,'Read actions/tasks of others','agenda',2,'allactions','read','r',0),(2412,'Create/modify actions/tasks of others','agenda',1,'allactions','create','w',0),(2412,'Create/modify actions/tasks of others','agenda',2,'allactions','create','w',0),(2413,'Delete actions/tasks of others','agenda',1,'allactions','delete','w',0),(2413,'Delete actions/tasks of others','agenda',2,'allactions','delete','w',0),(2414,'Export actions/tasks of others','agenda',1,'export',NULL,'w',0),(2501,'Consulter/Télécharger les documents','ecm',1,'read',NULL,'r',0),(2503,'Soumettre ou supprimer des documents','ecm',1,'upload',NULL,'w',0),(2515,'Administrer les rubriques de documents','ecm',1,'setup',NULL,'w',0),(20001,'Read your own holidays','holiday',1,'read',NULL,'w',0),(20001,'Créer / Modifier / Lire ses demandes de congés payés','holiday',2,'write',NULL,'w',1),(20002,'Create/modify your own holidays','holiday',1,'write',NULL,'w',0),(20002,'Lire / Modifier toutes les demandes de congés payés','holiday',2,'lire_tous',NULL,'w',0),(20003,'Delete holidays','holiday',1,'delete',NULL,'w',0),(20003,'Supprimer des demandes de congés payés','holiday',2,'delete',NULL,'w',0),(20004,'Read holidays for everybody','holiday',1,'read_all',NULL,'w',0),(20004,'Définir les congés payés des utilisateurs','holiday',2,'define_holiday',NULL,'w',0),(20005,'Create/modify holidays for everybody','holiday',1,'write_all',NULL,'w',0),(20005,'Voir les logs de modification des congés payés','holiday',2,'view_log',NULL,'w',0),(20006,'Setup holidays of users (setup and update balance)','holiday',1,'define_holiday',NULL,'w',0),(20006,'Accéder au rapport mensuel des congés payés','holiday',2,'month_report',NULL,'w',0),(23001,'Read cron jobs','cron',1,'read',NULL,'w',0),(23002,'Create cron Jobs','cron',1,'create',NULL,'w',0),(23003,'Delete cron Jobs','cron',1,'delete',NULL,'w',0),(23004,'Execute cron Jobs','cron',1,'execute',NULL,'w',0),(50101,'Use point of sale','cashdesk',1,'use',NULL,'a',1),(50401,'Bind products and invoices with accounting accounts','accounting',1,'bind','write','r',0),(50411,'Read operations in General Ledger','accounting',1,'mouvements','lire','r',0),(50412,'Write/Edit operations in General Ledger','accounting',1,'mouvements','creer','w',0),(50420,'Report and export reports (turnover, balance, journals, general ledger)','accounting',1,'comptarapport','lire','r',0),(50430,'Define and close a fiscal year','accounting',1,'fiscalyear',NULL,'r',0),(50440,'Manage chart of accounts, setup of accountancy','accounting',1,'chartofaccount',NULL,'r',0),(55001,'Read surveys','opensurvey',1,'read',NULL,'r',0),(55002,'Create/modify surveys','opensurvey',1,'write',NULL,'w',0),(59001,'Visualiser les marges','margins',1,'liretous',NULL,'r',1),(59002,'Définir les marges','margins',1,'creer',NULL,'w',0),(59003,'Read every user margin','margins',1,'read','all','r',0),(63001,'Read resources','resource',1,'read',NULL,'w',1),(63002,'Create/Modify resources','resource',1,'write',NULL,'w',0),(63003,'Delete resources','resource',1,'delete',NULL,'w',0),(63004,'Link resources','resource',1,'link',NULL,'w',0),(64001,'DirectPrint','printing',1,'read',NULL,'r',0),(101250,'Read surveys','opensurvey',2,'survey','read','r',0),(101251,'Create/modify surveys','opensurvey',2,'survey','write','w',0),(400051,'Use POS','pos',2,'frontend',NULL,'a',1),(400052,'Use Backend','pos',2,'backend',NULL,'a',1),(400053,'Make Transfers','pos',2,'transfer',NULL,'a',1),(400055,'Stats','pos',2,'stats',NULL,'a',1); +/*!40000 ALTER TABLE `llx_rights_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe` +-- + +DROP TABLE IF EXISTS `llx_societe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `statut` tinyint(4) DEFAULT '0', + `parent` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `nom` varchar(128) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `ref_int` varchar(60) DEFAULT NULL, + `code_client` varchar(24) DEFAULT NULL, + `code_fournisseur` varchar(24) DEFAULT NULL, + `code_compta` varchar(24) DEFAULT NULL, + `code_compta_fournisseur` varchar(24) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_departement` int(11) DEFAULT '0', + `fk_pays` int(11) DEFAULT '0', + `phone` varchar(20) DEFAULT NULL, + `fax` varchar(20) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `email` varchar(128) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `fk_effectif` int(11) DEFAULT '0', + `fk_typent` int(11) DEFAULT '0', + `fk_forme_juridique` int(11) DEFAULT '0', + `fk_currency` varchar(3) DEFAULT NULL, + `siren` varchar(128) DEFAULT NULL, + `siret` varchar(128) DEFAULT NULL, + `ape` varchar(128) DEFAULT NULL, + `idprof4` varchar(128) DEFAULT NULL, + `tva_intra` varchar(20) DEFAULT NULL, + `capital` double DEFAULT NULL, + `fk_stcomm` int(11) NOT NULL DEFAULT '0', + `note_private` text, + `note_public` text, + `prefix_comm` varchar(5) DEFAULT NULL, + `client` tinyint(4) DEFAULT '0', + `fournisseur` tinyint(4) DEFAULT '0', + `supplier_account` varchar(32) DEFAULT NULL, + `fk_prospectlevel` varchar(12) DEFAULT NULL, + `customer_bad` tinyint(4) DEFAULT '0', + `customer_rate` double DEFAULT '0', + `supplier_rate` double DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `remise_client` double DEFAULT '0', + `mode_reglement` tinyint(4) DEFAULT NULL, + `cond_reglement` tinyint(4) DEFAULT NULL, + `mode_reglement_supplier` int(11) DEFAULT NULL, + `outstanding_limit` double(24,8) DEFAULT NULL, + `cond_reglement_supplier` int(11) DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `tva_assuj` tinyint(4) DEFAULT '1', + `localtax1_assuj` tinyint(4) DEFAULT '0', + `localtax1_value` double(6,3) DEFAULT NULL, + `localtax2_assuj` tinyint(4) DEFAULT '0', + `localtax2_value` double(6,3) DEFAULT NULL, + `barcode` varchar(255) DEFAULT NULL, + `price_level` int(11) DEFAULT NULL, + `default_lang` varchar(6) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `status` tinyint(4) DEFAULT '1', + `logo` varchar(255) DEFAULT NULL, + `idprof5` varchar(128) DEFAULT NULL, + `idprof6` varchar(128) DEFAULT NULL, + `fk_barcode_type` int(11) DEFAULT '0', + `webservices_url` varchar(255) DEFAULT NULL, + `webservices_key` varchar(128) DEFAULT NULL, + `name_alias` varchar(128) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_societe_prefix_comm` (`prefix_comm`,`entity`), + UNIQUE KEY `uk_societe_code_client` (`code_client`,`entity`), + UNIQUE KEY `uk_societe_barcode` (`barcode`,`fk_barcode_type`,`entity`), + UNIQUE KEY `uk_societe_code_fournisseur` (`code_fournisseur`,`entity`), + KEY `idx_societe_user_creat` (`fk_user_creat`), + KEY `idx_societe_user_modif` (`fk_user_modif`), + KEY `idx_societe_barcode` (`barcode`) +) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe` +-- + +LOCK TABLES `llx_societe` WRITE; +/*!40000 ALTER TABLE `llx_societe` DISABLE KEYS */; +INSERT INTO `llx_societe` VALUES (1,0,NULL,'2016-01-16 15:21:09','2010-07-08 14:21:44','Indian SAS',1,NULL,NULL,'CU1212-0007','SU1212-0005','7050','6050','1 alalah road',NULL,'Delhi',0,117,NULL,NULL,NULL,NULL,NULL,NULL,4,NULL,'0','','','','','',5000,1,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,'en_IN',NULL,NULL,1,'indiancompany.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(2,0,NULL,'2016-07-30 11:45:49','2010-07-08 14:23:48','Teclib',1,NULL,NULL,'CU1108-0001','SU1108-0001','411CU11080001','401SU11080001','',NULL,'Paris',0,1,NULL,NULL,'www.teclib.com',NULL,NULL,4,3,57,'0','123456789','','ACE14','','',400000,0,NULL,NULL,NULL,3,1,NULL,'',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,0,0.000,NULL,0.000,NULL,NULL,'fr_FR',NULL,NULL,1,'teclibcompany.png','','',0,NULL,NULL,'',0,NULL,NULL,0,'',NULL),(3,0,NULL,'2017-02-16 00:47:25','2010-07-08 22:42:12','Spanish Comp',1,NULL,NULL,'SPANISHCOMP','SU1601-0009',NULL,NULL,'1 via mallere',NULL,'Madrid',123,4,NULL,NULL,NULL,NULL,NULL,3,4,408,'0','','','','','',10000,0,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,'es_AR',NULL,NULL,1,'spanishcompany.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(4,0,NULL,'2016-01-22 17:24:53','2010-07-08 22:48:18','Prospector Vaalen',1,NULL,NULL,'CU1303-0014',NULL,NULL,NULL,'',NULL,'Bruxelles',103,2,NULL,NULL,NULL,NULL,NULL,3,4,201,'0','12345678','','','','',0,0,NULL,NULL,NULL,3,0,NULL,'PL_LOW',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'valeencompany.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(5,0,NULL,'2017-02-21 11:01:17','2010-07-08 23:22:57','NoCountry GmBh',1,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,0,0,NULL,'',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,0,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'nocountrycomp.png','','',0,NULL,NULL,'',0,NULL,NULL,1,'EUR',NULL),(6,0,NULL,'2016-01-16 15:35:56','2010-07-09 00:15:09','Swiss Touch',1,NULL,NULL,'CU1601-0018','SU1601-0010',NULL,NULL,'',NULL,'Genevia',0,6,NULL,NULL,NULL,'swisstouch@example.ch',NULL,2,2,601,'0','','','','','',56000,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'swisstouch.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(7,0,NULL,'2016-01-16 15:38:32','2010-07-09 01:24:26','Generic customer',1,NULL,NULL,'CU1302-0011',NULL,NULL,NULL,'',NULL,NULL,0,7,NULL,NULL,NULL,'ttt@ttt.com',NULL,NULL,8,NULL,'0','','','','','',0,0,'Generic customer to use for Point Of Sale module.
',NULL,NULL,1,0,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'genericcustomer.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(10,0,NULL,'2016-01-16 15:44:20','2010-07-10 15:13:08','NLTechno',1,NULL,NULL,'CU1212-0005','SU1601-0011',NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,'notanemail@nltechno.com',NULL,1,4,54,'0','493861496','49386149600039','6209Z','22-01-2007','FR123456789',10000,0,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,'123456789012',NULL,'fr_FR',NULL,NULL,1,'logo_nltechno_94x100.png','','',0,NULL,NULL,'The OpenSource company',0,NULL,NULL,NULL,NULL,NULL),(11,0,NULL,'2017-05-12 09:06:31','2010-07-10 18:35:57','Company Corp 1',1,NULL,NULL,'CU1510-0017',NULL,'7051',NULL,'21 Green Hill street','75500','Los Angeles',0,11,'444123456',NULL,'companycorp1.com','companycorp1@example.com','corp1',1,1,NULL,'0','AB1234567','','','','USABS123',10000,0,NULL,NULL,NULL,3,0,NULL,'PL_LOW',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,0,0.000,NULL,0.000,NULL,NULL,'en_US',NULL,NULL,1,'comapnycorp1company.png','','',0,NULL,NULL,'',0,NULL,NULL,1,'EUR',NULL),(12,0,NULL,'2016-01-22 16:41:56','2010-07-11 16:18:08','Dupont Alain',1,NULL,NULL,'CU1601-0019',NULL,NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,'dalain@example.com',NULL,NULL,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'pierrecurie.jpg','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(13,0,NULL,'2016-01-22 17:13:16','2010-07-11 17:13:20','Company Corp 2',1,NULL,NULL,NULL,'SU1510-0008',NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,0,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'companycorp2company.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(17,0,NULL,'2017-02-15 22:55:34','2011-08-01 02:41:26','Book Keeping Company',1,NULL,NULL,'CU1108-0004','SU1108-0004',NULL,'401SU11080004','The French Company',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,1,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,0,1,NULL,'',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,0,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'bookkeepercompany.png','','',0,NULL,NULL,'',0,NULL,NULL,1,'EUR',NULL),(19,0,NULL,'2017-02-21 11:51:40','2013-01-12 12:23:05','Magic Food Store',1,NULL,NULL,'CU1301-0008',NULL,NULL,NULL,'65 holdywood boulevard','123456','BigTown',0,4,NULL,'0101',NULL,'myemail@domain.com',NULL,NULL,0,NULL,'0','','','10/10/2010','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.000,NULL,0.000,NULL,NULL,'en_US','patient@cabinetmed',NULL,1,'magicfoodstore.png','','',0,NULL,NULL,'',0,NULL,'sepamandate',NULL,NULL,NULL),(25,0,NULL,'2016-01-22 17:21:17','2013-03-10 15:47:37','Print Company',1,NULL,NULL,'CU1303-0016','SU1303-0007',NULL,NULL,'21 Gutenberg street','45600','Berlin',0,5,NULL,NULL,NULL,'printcompany@example.com',NULL,NULL,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,0,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,'de_DE',NULL,NULL,1,'printcompany.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(26,0,NULL,'2017-02-21 00:05:05','2017-02-12 23:17:04','Patient SuperIll',1,NULL,NULL,'CU1702-0020',NULL,'411CU17020020',NULL,'',NULL,NULL,0,14,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,'','','','','',NULL,0,NULL,NULL,NULL,3,0,NULL,'',0,0,0,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.000,NULL,0.000,NULL,NULL,'en_US','patient@cabinetmed',NULL,1,NULL,'','',0,NULL,NULL,'',0,NULL,NULL,0,'',NULL); +/*!40000 ALTER TABLE `llx_societe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_address` +-- + +DROP TABLE IF EXISTS `llx_societe_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_address` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(30) DEFAULT NULL, + `fk_soc` int(11) DEFAULT '0', + `name` varchar(60) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `phone` varchar(20) DEFAULT NULL, + `fax` varchar(20) DEFAULT NULL, + `note` text, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_address` +-- + +LOCK TABLES `llx_societe_address` WRITE; +/*!40000 ALTER TABLE `llx_societe_address` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_address` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_commerciaux` +-- + +DROP TABLE IF EXISTS `llx_societe_commerciaux`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_commerciaux` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_societe_commerciaux` (`fk_soc`,`fk_user`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_commerciaux` +-- + +LOCK TABLES `llx_societe_commerciaux` WRITE; +/*!40000 ALTER TABLE `llx_societe_commerciaux` DISABLE KEYS */; +INSERT INTO `llx_societe_commerciaux` VALUES (1,2,2,NULL),(2,3,2,NULL),(5,17,1,NULL),(6,19,1,NULL),(8,19,3,NULL),(9,11,16,NULL),(10,13,17,NULL),(11,26,12,NULL); +/*!40000 ALTER TABLE `llx_societe_commerciaux` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_extrafields` +-- + +DROP TABLE IF EXISTS `llx_societe_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_societe_extrafields` (`fk_object`) +) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_extrafields` +-- + +LOCK TABLES `llx_societe_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_societe_extrafields` DISABLE KEYS */; +INSERT INTO `llx_societe_extrafields` VALUES (75,'2016-01-22 16:40:03',10,NULL),(77,'2016-01-22 16:41:56',12,NULL),(79,'2016-01-22 17:13:16',13,NULL),(81,'2016-01-22 17:18:08',19,NULL),(82,'2016-01-22 17:21:17',25,NULL),(83,'2016-01-22 17:21:51',1,NULL),(85,'2016-01-22 17:22:32',3,NULL),(86,'2016-01-22 17:24:53',4,NULL),(88,'2016-01-22 17:25:26',6,NULL),(89,'2016-01-22 17:25:41',7,NULL),(92,'2016-07-30 11:45:49',2,NULL),(94,'2017-02-15 22:55:34',17,NULL),(95,'2017-02-21 00:05:05',26,NULL),(96,'2017-02-21 11:01:17',5,NULL),(97,'2017-05-12 09:06:31',11,NULL); +/*!40000 ALTER TABLE `llx_societe_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_log` +-- + +DROP TABLE IF EXISTS `llx_societe_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `datel` datetime DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_statut` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `author` varchar(30) DEFAULT NULL, + `label` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_log` +-- + +LOCK TABLES `llx_societe_log` WRITE; +/*!40000 ALTER TABLE `llx_societe_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_prices` +-- + +DROP TABLE IF EXISTS `llx_societe_prices`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_prices` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT '0', + `tms` timestamp NULL DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `price_level` tinyint(4) DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_prices` +-- + +LOCK TABLES `llx_societe_prices` WRITE; +/*!40000 ALTER TABLE `llx_societe_prices` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_prices` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_remise` +-- + +DROP TABLE IF EXISTS `llx_societe_remise`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_remise` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_soc` int(11) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `remise_client` double(6,3) NOT NULL DEFAULT '0.000', + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_remise` +-- + +LOCK TABLES `llx_societe_remise` WRITE; +/*!40000 ALTER TABLE `llx_societe_remise` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_remise` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_remise_except` +-- + +DROP TABLE IF EXISTS `llx_societe_remise_except`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_remise_except` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `amount_ht` double(24,8) NOT NULL, + `amount_tva` double(24,8) NOT NULL DEFAULT '0.00000000', + `amount_ttc` double(24,8) NOT NULL DEFAULT '0.00000000', + `tva_tx` double(6,3) NOT NULL DEFAULT '0.000', + `fk_user` int(11) NOT NULL, + `fk_facture_line` int(11) DEFAULT NULL, + `fk_facture` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `description` text NOT NULL, + `multicurrency_amount_ht` double(24,8) NOT NULL DEFAULT '0.00000000', + `multicurrency_amount_tva` double(24,8) NOT NULL DEFAULT '0.00000000', + `multicurrency_amount_ttc` double(24,8) NOT NULL DEFAULT '0.00000000', + `fk_invoice_supplier_line` int(11) DEFAULT NULL, + `fk_invoice_supplier` int(11) DEFAULT NULL, + `fk_invoice_supplier_source` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_societe_remise_except_fk_user` (`fk_user`), + KEY `idx_societe_remise_except_fk_soc` (`fk_soc`), + KEY `idx_societe_remise_except_fk_facture_line` (`fk_facture_line`), + KEY `idx_societe_remise_except_fk_facture` (`fk_facture`), + KEY `idx_societe_remise_except_fk_facture_source` (`fk_facture_source`), + KEY `fk_soc_remise_fk_invoice_supplier_line` (`fk_invoice_supplier_line`), + KEY `fk_societe_remise_fk_invoice_supplier_source` (`fk_invoice_supplier`), + CONSTRAINT `fk_societe_remise_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_facture_line` FOREIGN KEY (`fk_facture_line`) REFERENCES `llx_facturedet` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_facture_source` FOREIGN KEY (`fk_facture_source`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_invoice_supplier` FOREIGN KEY (`fk_invoice_supplier`) REFERENCES `llx_facture_fourn` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_invoice_supplier_source` FOREIGN KEY (`fk_invoice_supplier`) REFERENCES `llx_facture_fourn` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_soc_remise_fk_facture_line` FOREIGN KEY (`fk_facture_line`) REFERENCES `llx_facturedet` (`rowid`), + CONSTRAINT `fk_soc_remise_fk_invoice_supplier_line` FOREIGN KEY (`fk_invoice_supplier_line`) REFERENCES `llx_facture_fourn_det` (`rowid`), + CONSTRAINT `fk_soc_remise_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_remise_except` +-- + +LOCK TABLES `llx_societe_remise_except` WRITE; +/*!40000 ALTER TABLE `llx_societe_remise_except` DISABLE KEYS */; +INSERT INTO `llx_societe_remise_except` VALUES (2,1,19,'2013-03-19 09:36:15',10.00000000,1.25000000,11.25000000,12.500,1,NULL,NULL,NULL,'hfghgf',0.00000000,0.00000000,0.00000000,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_societe_remise_except` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_rib` +-- + +DROP TABLE IF EXISTS `llx_societe_rib`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_rib` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(30) DEFAULT NULL, + `bank` varchar(255) DEFAULT NULL, + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `bic` varchar(20) DEFAULT NULL, + `iban_prefix` varchar(34) DEFAULT NULL, + `domiciliation` varchar(255) DEFAULT NULL, + `proprio` varchar(60) DEFAULT NULL, + `owner_address` text, + `default_rib` tinyint(4) NOT NULL DEFAULT '0', + `rum` varchar(32) DEFAULT NULL, + `date_rum` date DEFAULT NULL, + `frstrecur` varchar(16) DEFAULT 'FRST', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_rib` +-- + +LOCK TABLES `llx_societe_rib` WRITE; +/*!40000 ALTER TABLE `llx_societe_rib` DISABLE KEYS */; +INSERT INTO `llx_societe_rib` VALUES (1,19,'2017-02-21 15:50:32','2017-02-21 11:53:08','Morgan Bank','Morgan Bank','','','','','PSPBFIHH','ES80 2310 0001 1800 0001 2345','Royal via,\r\nMadrid','Mr Esposito','10 via ferrata,\r\nMadrid',1,'RUM1301-0008-0',NULL,'FRST',NULL); +/*!40000 ALTER TABLE `llx_societe_rib` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_socpeople` +-- + +DROP TABLE IF EXISTS `llx_socpeople`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_socpeople` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `civility` varchar(6) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` text, + `fk_departement` int(11) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `birthday` date DEFAULT NULL, + `poste` varchar(80) DEFAULT NULL, + `phone` varchar(30) DEFAULT NULL, + `phone_perso` varchar(30) DEFAULT NULL, + `phone_mobile` varchar(30) DEFAULT NULL, + `fax` varchar(30) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `jabberid` varchar(255) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `photo` varchar(255) DEFAULT NULL, + `priv` smallint(6) NOT NULL DEFAULT '0', + `no_email` smallint(6) NOT NULL DEFAULT '0', + `fk_user_creat` int(11) DEFAULT '0', + `fk_user_modif` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `default_lang` varchar(6) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `statut` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + KEY `idx_socpeople_fk_soc` (`fk_soc`), + KEY `idx_socpeople_fk_user_creat` (`fk_user_creat`), + CONSTRAINT `fk_socpeople_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_socpeople_user_creat_user_rowid` FOREIGN KEY (`fk_user_creat`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_socpeople` +-- + +LOCK TABLES `llx_socpeople` WRITE; +/*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; +INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','eldy@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); +/*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_socpeople_extrafields` +-- + +DROP TABLE IF EXISTS `llx_socpeople_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_socpeople_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_socpeople_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_socpeople_extrafields` +-- + +LOCK TABLES `llx_socpeople_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_socpeople_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_socpeople_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_stock_mouvement` +-- + +DROP TABLE IF EXISTS `llx_stock_mouvement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_stock_mouvement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datem` datetime DEFAULT NULL, + `fk_product` int(11) NOT NULL, + `fk_entrepot` int(11) NOT NULL, + `value` double DEFAULT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `type_mouvement` smallint(6) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `fk_origin` int(11) DEFAULT NULL, + `origintype` varchar(32) DEFAULT NULL, + `inventorycode` varchar(128) DEFAULT NULL, + `batch` varchar(30) DEFAULT NULL, + `eatby` date DEFAULT NULL, + `sellby` date DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_stock_mouvement_fk_product` (`fk_product`), + KEY `idx_stock_mouvement_fk_entrepot` (`fk_entrepot`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_stock_mouvement` +-- + +LOCK TABLES `llx_stock_mouvement` WRITE; +/*!40000 ALTER TABLE `llx_stock_mouvement` DISABLE KEYS */; +INSERT INTO `llx_stock_mouvement` VALUES (1,'2010-07-08 22:43:51','2010-07-09 00:43:51',2,2,1000,0.00000000,0,1,'Correct stock',NULL,NULL,NULL,NULL,NULL,NULL),(3,'2010-07-10 22:56:18','2010-07-11 00:56:18',4,2,500,0.00000000,0,1,'Init',NULL,NULL,NULL,NULL,NULL,NULL),(4,'2010-07-10 23:02:20','2010-07-11 01:02:20',4,2,500,0.00000000,0,1,'',NULL,NULL,NULL,NULL,NULL,NULL),(5,'2010-07-11 16:49:44','2010-07-11 18:49:44',4,1,2,10.00000000,3,1,'',NULL,NULL,NULL,NULL,NULL,NULL),(6,'2010-07-11 16:49:44','2010-07-11 18:49:44',1,1,4,0.00000000,3,1,'',NULL,NULL,NULL,NULL,NULL,NULL),(7,'2013-01-19 17:22:48','2013-01-19 18:22:48',11,1,-1,0.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(8,'2013-01-19 17:22:48','2013-01-19 18:22:48',4,1,-1,5.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(9,'2013-01-19 17:22:48','2013-01-19 18:22:48',1,1,-2,0.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(10,'2013-01-19 17:31:10','2013-01-19 18:31:10',2,1,-1,0.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(11,'2013-01-19 17:31:58','2013-01-19 18:31:58',2,1,-1,0.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(12,'2016-07-30 13:39:31','2016-07-30 17:39:31',10,2,50,0.00000000,0,12,'Stock correction for product COMP-XP4523',0,'',NULL,'5599887766452',NULL,NULL),(13,'2016-07-30 13:40:12','2016-07-30 17:40:12',10,2,60,0.00000000,0,12,'Stock correction for product COMP-XP4523',0,'',NULL,'4494487766452',NULL,NULL),(14,'2016-07-30 13:40:39','2016-07-30 17:40:39',10,2,-35,0.00000000,1,12,'Stock transfer of product COMP-XP4523 into another warehouse',0,'','160730174015','5599887766452',NULL,NULL),(15,'2016-07-30 13:40:39','2016-07-30 17:40:39',10,1,35,0.00000000,0,12,'Stock transfer of product COMP-XP4523 into another warehouse',0,'','160730174015','5599887766452',NULL,NULL),(16,'2017-02-15 23:58:08','2017-02-16 03:58:08',10,1,-1,100.00000000,2,12,'Expédition SH1702-0002 validée',3,'shipping',NULL,'5599887766452',NULL,NULL),(17,'2017-02-16 00:12:09','2017-02-16 04:12:09',10,1,1,0.00000000,3,12,'Expédition SH1702-0002 supprimée',0,'',NULL,'5599887766452',NULL,NULL); +/*!40000 ALTER TABLE `llx_stock_mouvement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_subscription` +-- + +DROP TABLE IF EXISTS `llx_subscription`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_subscription` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `dateadh` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `subscription` double DEFAULT NULL, + `fk_bank` int(11) DEFAULT NULL, + `note` text COLLATE utf8_unicode_ci, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_subscription` (`fk_adherent`,`dateadh`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_subscription` +-- + +LOCK TABLES `llx_subscription` WRITE; +/*!40000 ALTER TABLE `llx_subscription` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_subscription` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_supplier_proposal` +-- + +DROP TABLE IF EXISTS `llx_supplier_proposal`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_supplier_proposal` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `price` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(3) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_supplier_proposal` +-- + +LOCK TABLES `llx_supplier_proposal` WRITE; +/*!40000 ALTER TABLE `llx_supplier_proposal` DISABLE KEYS */; +INSERT INTO `llx_supplier_proposal` VALUES (2,'(PROV2)',1,NULL,NULL,10,NULL,'2017-02-17 00:40:50','2017-02-17 04:40:14',NULL,NULL,12,NULL,NULL,NULL,0,0,NULL,NULL,0,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,NULL,NULL,2,7,'','','aurore','2017-02-17',1,NULL,NULL,1,'EUR',1.00000000,200.00000000,0.00000000,200.00000000); +/*!40000 ALTER TABLE `llx_supplier_proposal` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_supplier_proposal_extrafields` +-- + +DROP TABLE IF EXISTS `llx_supplier_proposal_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_supplier_proposal_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_supplier_proposal_extrafields` +-- + +LOCK TABLES `llx_supplier_proposal_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_supplier_proposal_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_supplier_proposal_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_supplier_proposaldet` +-- + +DROP TABLE IF EXISTS `llx_supplier_proposaldet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_supplier_proposaldet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_supplier_proposal` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `fk_remise_except` int(11) DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT '0.000', + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) DEFAULT NULL, + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) DEFAULT NULL, + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `price` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `info_bits` int(11) DEFAULT '0', + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `special_code` int(11) DEFAULT '0', + `rang` int(11) DEFAULT '0', + `ref_fourn` varchar(30) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_unit` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_supplier_proposaldet_fk_supplier_proposal` (`fk_supplier_proposal`), + KEY `idx_supplier_proposaldet_fk_product` (`fk_product`), + KEY `fk_supplier_proposaldet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_supplier_proposaldet_fk_supplier_proposal` FOREIGN KEY (`fk_supplier_proposal`) REFERENCES `llx_supplier_proposal` (`rowid`), + CONSTRAINT `fk_supplier_proposaldet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_supplier_proposaldet` +-- + +LOCK TABLES `llx_supplier_proposaldet` WRITE; +/*!40000 ALTER TABLE `llx_supplier_proposaldet` DISABLE KEYS */; +INSERT INTO `llx_supplier_proposaldet` VALUES (2,2,NULL,NULL,NULL,'A powerfull computer with 8Gb memory.',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,200.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,0,0.00000000,NULL,0,1,'',1,'EUR',200.00000000,200.00000000,0.00000000,200.00000000,NULL); +/*!40000 ALTER TABLE `llx_supplier_proposaldet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_supplier_proposaldet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_supplier_proposaldet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_supplier_proposaldet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_supplier_proposaldet_extrafields` +-- + +LOCK TABLES `llx_supplier_proposaldet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_supplier_proposaldet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_supplier_proposaldet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_tva` +-- + +DROP TABLE IF EXISTS `llx_tva`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_tva` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` date DEFAULT NULL, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `note` text, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_typepayment` int(11) DEFAULT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_tva` +-- + +LOCK TABLES `llx_tva` WRITE; +/*!40000 ALTER TABLE `llx_tva` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_tva` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user` +-- + +DROP TABLE IF EXISTS `llx_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `login` varchar(24) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `civility` varchar(6) DEFAULT NULL, + `ref_ext` varchar(50) DEFAULT NULL, + `ref_int` varchar(50) DEFAULT NULL, + `employee` smallint(6) DEFAULT '1', + `fk_establishment` int(11) DEFAULT '0', + `pass` varchar(128) DEFAULT NULL, + `pass_crypted` varchar(128) DEFAULT NULL, + `pass_temp` varchar(128) DEFAULT NULL, + `api_key` varchar(128) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `job` varchar(128) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `office_phone` varchar(20) DEFAULT NULL, + `office_fax` varchar(20) DEFAULT NULL, + `user_mobile` varchar(20) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `signature` text, + `admin` smallint(6) DEFAULT '0', + `webcal_login` varchar(25) DEFAULT NULL, + `module_comm` smallint(6) DEFAULT '1', + `module_compta` smallint(6) DEFAULT '1', + `fk_soc` int(11) DEFAULT NULL, + `fk_socpeople` int(11) DEFAULT NULL, + `fk_member` int(11) DEFAULT NULL, + `note` text, + `datelastlogin` datetime DEFAULT NULL, + `datepreviouslogin` datetime DEFAULT NULL, + `egroupware_id` int(11) DEFAULT NULL, + `ldap_sid` varchar(255) DEFAULT NULL, + `statut` tinyint(4) DEFAULT '1', + `photo` varchar(255) DEFAULT NULL, + `lang` varchar(6) DEFAULT NULL, + `openid` varchar(255) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `thm` double(24,8) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_state` int(11) DEFAULT '0', + `fk_country` int(11) DEFAULT '0', + `color` varchar(6) DEFAULT NULL, + `accountancy_code` varchar(32) DEFAULT NULL, + `barcode` varchar(255) DEFAULT NULL, + `fk_barcode_type` int(11) DEFAULT '0', + `nb_holiday` int(11) DEFAULT '0', + `salary` double(24,8) DEFAULT NULL, + `tjm` double(24,8) DEFAULT NULL, + `salaryextra` double(24,8) DEFAULT NULL, + `weeklyhours` double(16,8) DEFAULT NULL, + `gender` varchar(10) DEFAULT NULL, + `note_public` text, + `dateemployment` datetime DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_user_login` (`login`,`entity`), + UNIQUE KEY `uk_user_fk_socpeople` (`fk_socpeople`), + UNIQUE KEY `uk_user_fk_member` (`fk_member`), + UNIQUE KEY `uk_user_api_key` (`api_key`), + KEY `idx_user_api_key` (`api_key`), + KEY `idx_user_fk_societe` (`fk_soc`) +) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user` +-- + +LOCK TABLES `llx_user` WRITE; +/*!40000 ALTER TABLE `llx_user` DISABLE KEYS */; +INSERT INTO `llx_user` VALUES (1,'2010-07-08 13:20:11','2017-02-01 15:06:04',NULL,NULL,'aeinstein',0,NULL,NULL,NULL,1,0,NULL,'11c9c772d6471aa24c27274bdd8a223b',NULL,NULL,'Einstein','Albert','','','123456789','','','aeinstein@example.com','',0,'',1,1,NULL,NULL,NULL,'','2015-10-05 08:32:44','2015-10-03 11:43:50',NULL,'',1,'alberteinstein.jpg',NULL,NULL,14,NULL,'','','',NULL,NULL,'aaaaff','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(2,'2010-07-08 13:54:48','2017-02-01 15:06:04',NULL,NULL,'demo',1,NULL,NULL,NULL,1,0,NULL,'fe01ce2a7fbac8fafaed7c982a04e229',NULL,NULL,'Doe','David','','','09123123','','','daviddoe@mycompany.com','',0,'',1,1,NULL,NULL,NULL,'','2016-07-30 23:10:54','2016-07-30 23:04:17',NULL,'',1,'johndoe.png',NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(3,'2010-07-11 16:18:59','2017-02-01 15:06:04',NULL,NULL,'pcurie',1,NULL,NULL,NULL,1,0,NULL,'ab335b4eb4c3c99334f656e5db9584c9',NULL,NULL,'Curie','Pierre','','','','','','pcurie@example.com','',0,'',1,1,NULL,NULL,2,'','2012-12-21 17:38:55',NULL,NULL,'',1,'pierrecurie.jpg',NULL,NULL,14,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'2013-01-23 17:52:27','2017-02-01 15:06:04',NULL,NULL,'bbookkeeper',1,NULL,NULL,NULL,1,0,NULL,'a7d30b58d647fcf59b7163f9592b1dbb',NULL,NULL,'Bookkeeper','Bob','Bookkeeper','','','','','','',0,'',1,1,17,6,NULL,'','2013-02-25 10:18:41','2013-01-23 17:53:20',NULL,'',1,NULL,NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(10,'2015-10-03 11:47:41','2017-02-01 15:06:04',NULL,NULL,'mcurie',1,NULL,NULL,NULL,1,0,NULL,'52cda011808bb282d1d3625ab607a145',NULL,'t3mnkbhs','Curie','Marie','','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'mariecurie.jpg',NULL,NULL,14,NULL,'','','',NULL,NULL,'ffaaff','',NULL,0,0,NULL,NULL,NULL,NULL,'woman',NULL,NULL,NULL,NULL),(11,'2015-10-05 09:07:52','2017-02-01 15:06:04',NULL,NULL,'zzeceo',1,NULL,NULL,NULL,1,0,NULL,'92af989c4c3a5140fb5d73eb77a52454',NULL,'cq78nf9m','Zeceo','Zack','President','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'','2015-10-05 22:48:08','2015-10-05 21:18:46',NULL,'',1,NULL,NULL,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,'2015-10-05 09:09:46','2017-08-28 10:12:46',NULL,NULL,'admin',0,NULL,NULL,NULL,1,0,NULL,'21232f297a57a5a743894a0e4a801fc3',NULL,'nd6hgbcr','Adminson','Alice','Admin Technical','','','','','','Alice - 123',1,NULL,1,1,NULL,NULL,NULL,'','2017-09-06 23:43:07','2017-09-06 20:03:38',NULL,'',1,'mariecurie.jpg',NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'woman',NULL,NULL,NULL,NULL),(13,'2015-10-05 21:29:35','2017-02-01 15:06:04',NULL,NULL,'ccommercy',1,NULL,NULL,NULL,1,0,NULL,'179858e041af35e8f4c81d68c55fe9da',NULL,'y451ksdv','Commercy','Charle','Commercial leader','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(14,'2015-10-05 21:33:33','2017-02-01 15:06:04',NULL,NULL,'sscientol',1,NULL,NULL,NULL,1,0,NULL,'39bee07ac42f31c98e79cdcd5e5fe4c5',NULL,'s2hp8bxd','Scientol','Sam','Scientist leader','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,'2015-10-05 22:47:52','2017-02-20 16:49:00',NULL,NULL,'ccommerson',1,NULL,NULL,NULL,1,0,NULL,'d68005ccf362b82d084551b6291792a3',NULL,'cx9y1dk0','Charle1','Commerson','Sale representative','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'','2015-10-05 23:46:24','2015-10-05 23:37:31',NULL,'',1,NULL,NULL,NULL,13,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,'2015-10-05 22:48:39','2017-02-01 15:06:04',NULL,NULL,'cc2',1,NULL,NULL,NULL,1,0,NULL,'a964065211872fb76f876c6c3e952ea3',NULL,'gw8cb7xj','Charle2','Commerson','Sale representative','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'','2015-10-05 23:16:06',NULL,NULL,'',0,NULL,NULL,NULL,13,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(18,'2016-01-22 17:27:02','2017-02-01 15:06:04',NULL,NULL,'ldestailleur',1,NULL,NULL,NULL,1,0,NULL,'1bb7805145a7a5066df9e6d585b8b645',NULL,'87g06wbx','Destailleur','Laurent','Project leader of Dolibarr ERP CRM','','','','','ldestailleur@example.com','
Laurent DESTAILLEUR
\r\n\r\n
\r\n
Project Director
\r\nldestailleur@example.com
\r\n\r\n
 
\r\n\r\n
\r\n\r\n
\r\n
',0,NULL,1,1,10,10,NULL,'More information on http://www.destailleur.fr','2017-09-06 11:55:30','2017-08-30 15:53:25',NULL,'',1,'ldestailleur_200x200.jpg',NULL,NULL,NULL,NULL,'','','',NULL,NULL,'007f7f','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(19,'2017-02-02 03:55:44','2017-02-01 23:56:50',NULL,NULL,'aboston',1,NULL,NULL,NULL,1,0,NULL,'a7a77a5aff2d5fc2f75f2f61507c88d4',NULL,NULL,'Boston','Alex','','','','','','aboston@example.com','Alex Boston
\r\nAdmin support service - 555 01 02 03 04',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,12,25.00000000,'','','',NULL,NULL,'ff00ff','',NULL,0,0,NULL,NULL,NULL,32.00000000,NULL,NULL,'2014-11-04 00:00:00',NULL,NULL); +/*!40000 ALTER TABLE `llx_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_alert` +-- + +DROP TABLE IF EXISTS `llx_user_alert`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_alert` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `type` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_alert` +-- + +LOCK TABLES `llx_user_alert` WRITE; +/*!40000 ALTER TABLE `llx_user_alert` DISABLE KEYS */; +INSERT INTO `llx_user_alert` VALUES (1,1,1,1),(2,1,10,12); +/*!40000 ALTER TABLE `llx_user_alert` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_clicktodial` +-- + +DROP TABLE IF EXISTS `llx_user_clicktodial`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_clicktodial` ( + `fk_user` int(11) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `login` varchar(32) DEFAULT NULL, + `pass` varchar(64) DEFAULT NULL, + `poste` varchar(20) DEFAULT NULL, + PRIMARY KEY (`fk_user`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_clicktodial` +-- + +LOCK TABLES `llx_user_clicktodial` WRITE; +/*!40000 ALTER TABLE `llx_user_clicktodial` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_clicktodial` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_employment` +-- + +DROP TABLE IF EXISTS `llx_user_employment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_employment` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `ref` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `ref_ext` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `job` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `status` int(11) NOT NULL, + `salary` double(24,8) DEFAULT NULL, + `salaryextra` double(24,8) DEFAULT NULL, + `weeklyhours` double(16,8) DEFAULT NULL, + `dateemployment` date DEFAULT NULL, + `dateemploymentend` date DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_user_employment` (`ref`,`entity`), + KEY `fk_user_employment_fk_user` (`fk_user`), + CONSTRAINT `fk_user_employment_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_employment` +-- + +LOCK TABLES `llx_user_employment` WRITE; +/*!40000 ALTER TABLE `llx_user_employment` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_employment` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_extrafields` +-- + +DROP TABLE IF EXISTS `llx_user_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_user_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_extrafields` +-- + +LOCK TABLES `llx_user_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_user_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_param` +-- + +DROP TABLE IF EXISTS `llx_user_param`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_param` ( + `fk_user` int(11) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `param` varchar(255) NOT NULL, + `value` text NOT NULL, + UNIQUE KEY `uk_user_param` (`fk_user`,`param`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_param` +-- + +LOCK TABLES `llx_user_param` WRITE; +/*!40000 ALTER TABLE `llx_user_param` DISABLE KEYS */; +INSERT INTO `llx_user_param` VALUES (1,1,'MAIN_BOXES_0','1'),(1,1,'MAIN_THEME','eldy'),(1,3,'THEME_ELDY_ENABLE_PERSONALIZED','1'),(1,1,'THEME_ELDY_RGB','ded0ed'),(1,3,'THEME_ELDY_RGB','d0ddc3'),(2,1,'MAIN_BOXES_0','1'),(11,1,'MAIN_BOXES_0','1'),(12,1,'MAIN_BOXES_0','1'),(12,1,'MAIN_LANG_DEFAULT','en_US'),(12,1,'MAIN_SELECTEDFIELDS_/dolibarr_4.0/htdocs/adherents/list.php','d.zip,d.ref,d.lastname,d.firstname,d.company,d.login,d.morphy,t.libelle,d.email,d.datefin,d.statut,'),(12,1,'MAIN_SELECTEDFIELDS_invoicelist','f.tms,f.facnumber,f.ref_client,f.date,f.date_lim_reglement,s.nom,s.town,s.zip,f.fk_mode_reglement,f.total_ht,rtp,f.fk_statut,'),(12,1,'MAIN_SELECTEDFIELDS_projectlist','p.budget_amount,p.ref,p.title,s.nom,commercial,p.dateo,p.datee,p.public,p.opp_amount,p.fk_opp_status,p.opp_percent,p.fk_statut,ef.priority,'),(12,1,'MAIN_SELECTEDFIELDS_proposallist','p.datec,p.ref,p.ref_client,s.nom,s.town,s.zip,p.date,p.fin_validite,p.total_ht,u.login,p.fk_statut,'),(12,1,'MAIN_SELECTEDFIELDS_servicelist','p.ref,p.label,p.duration,p.sellprice,p.minbuyprice,p.tosell,p.tobuy,'); +/*!40000 ALTER TABLE `llx_user_param` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_rib` +-- + +DROP TABLE IF EXISTS `llx_user_rib`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_rib` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(30) DEFAULT NULL, + `bank` varchar(255) DEFAULT NULL, + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `bic` varchar(11) DEFAULT NULL, + `iban_prefix` varchar(34) DEFAULT NULL, + `domiciliation` varchar(255) DEFAULT NULL, + `proprio` varchar(60) DEFAULT NULL, + `owner_address` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_rib` +-- + +LOCK TABLES `llx_user_rib` WRITE; +/*!40000 ALTER TABLE `llx_user_rib` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_rib` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_rights` +-- + +DROP TABLE IF EXISTS `llx_user_rights`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_rights` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_user` int(11) NOT NULL, + `fk_id` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_user_rights` (`entity`,`fk_user`,`fk_id`), + KEY `fk_user_rights_fk_user_user` (`fk_user`), + CONSTRAINT `fk_user_rights_fk_user_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=16012 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_rights` +-- + +LOCK TABLES `llx_user_rights` WRITE; +/*!40000 ALTER TABLE `llx_user_rights` DISABLE KEYS */; +INSERT INTO `llx_user_rights` VALUES (12402,1,1,11),(12380,1,1,12),(12385,1,1,13),(12389,1,1,14),(12393,1,1,15),(12398,1,1,16),(12404,1,1,19),(9726,1,1,21),(9700,1,1,22),(9706,1,1,24),(9711,1,1,25),(9716,1,1,26),(9722,1,1,27),(9728,1,1,28),(9978,1,1,31),(9968,1,1,32),(9974,1,1,34),(1910,1,1,36),(9980,1,1,38),(11573,1,1,41),(11574,1,1,42),(11575,1,1,44),(11576,1,1,45),(7184,1,1,61),(7181,1,1,62),(7183,1,1,64),(7185,1,1,67),(7186,1,1,68),(1678,1,1,71),(1673,1,1,72),(1675,1,1,74),(1679,1,1,75),(1677,1,1,76),(1681,1,1,78),(1682,1,1,79),(12322,1,1,81),(12309,1,1,82),(12312,1,1,84),(12314,1,1,86),(12317,1,1,87),(12320,1,1,88),(12323,1,1,89),(11580,1,1,91),(11581,1,1,92),(11582,1,1,93),(11583,1,1,94),(10097,1,1,95),(10099,1,1,96),(10103,1,1,97),(10104,1,1,98),(7139,1,1,101),(7134,1,1,102),(7136,1,1,104),(7137,1,1,105),(7138,1,1,106),(7140,1,1,109),(10229,1,1,111),(10201,1,1,112),(10207,1,1,113),(10213,1,1,114),(10219,1,1,115),(10225,1,1,116),(10231,1,1,117),(12518,1,1,121),(12508,1,1,122),(12514,1,1,125),(12520,1,1,126),(11577,1,1,141),(11578,1,1,142),(11579,1,1,144),(2307,1,1,151),(2304,1,1,152),(2306,1,1,153),(2308,1,1,154),(10092,1,1,161),(10093,1,1,162),(10094,1,1,163),(10095,1,1,164),(10096,1,1,165),(1585,1,1,170),(12342,1,1,171),(12331,1,1,172),(12335,1,1,173),(12339,1,1,174),(12343,1,1,178),(10000,1,1,221),(9990,1,1,222),(9996,1,1,223),(10002,1,1,229),(10007,1,1,237),(10011,1,1,238),(10015,1,1,239),(1686,1,1,241),(1685,1,1,242),(1687,1,1,243),(12604,1,1,251),(12566,1,1,252),(12569,1,1,253),(12572,1,1,254),(12575,1,1,255),(12579,1,1,256),(1617,1,1,258),(12525,1,1,262),(12544,1,1,281),(12534,1,1,282),(12540,1,1,283),(12546,1,1,286),(12288,1,1,300),(12290,1,1,301),(11591,1,1,302),(1763,1,1,331),(1762,1,1,332),(1764,1,1,333),(12582,1,1,341),(12584,1,1,342),(12586,1,1,343),(12588,1,1,344),(12600,1,1,351),(12593,1,1,352),(12597,1,1,353),(12601,1,1,354),(12605,1,1,358),(12560,1,1,531),(12553,1,1,532),(12557,1,1,534),(1625,1,1,536),(12561,1,1,538),(12358,1,1,700),(12348,1,1,701),(12354,1,1,702),(12360,1,1,703),(1755,1,1,1001),(1754,1,1,1002),(1756,1,1,1003),(1758,1,1,1004),(1759,1,1,1005),(7146,1,1,1101),(7143,1,1,1102),(7145,1,1,1104),(7147,1,1,1109),(12412,1,1,1181),(12458,1,1,1182),(12417,1,1,1183),(12420,1,1,1184),(12423,1,1,1185),(12427,1,1,1186),(12431,1,1,1187),(12437,1,1,1188),(12434,1,1,1189),(1578,1,1,1201),(1579,1,1,1202),(12454,1,1,1231),(12443,1,1,1232),(12446,1,1,1233),(12449,1,1,1234),(12452,1,1,1235),(12455,1,1,1236),(12459,1,1,1237),(1736,1,1,1251),(12409,1,1,1321),(12326,1,1,1421),(8190,1,1,1791),(8187,1,1,1792),(8191,1,1,1793),(12264,1,1,2401),(12260,1,1,2402),(12266,1,1,2403),(12280,1,1,2411),(12276,1,1,2412),(12282,1,1,2413),(12286,1,1,2414),(1618,1,1,2500),(12370,1,1,2501),(12367,1,1,2503),(12371,1,1,2515),(9610,1,1,5001),(9611,1,1,5002),(12490,1,1,20001),(12468,1,1,20002),(12474,1,1,20003),(12480,1,1,20004),(12486,1,1,20005),(12492,1,1,20006),(12302,1,1,23001),(12295,1,1,23002),(12299,1,1,23003),(12303,1,1,23004),(7701,1,1,50101),(4984,1,1,50401),(4983,1,1,50402),(4985,1,1,50403),(4987,1,1,50411),(4988,1,1,50412),(4989,1,1,50415),(12498,1,1,55001),(12499,1,1,55002),(3564,1,1,100700),(3565,1,1,100701),(9596,1,1,101051),(9598,1,1,101052),(9600,1,1,101053),(9604,1,1,101060),(9605,1,1,101061),(7177,1,1,101201),(7178,1,1,101202),(10353,1,1,101250),(10355,1,1,101251),(8980,1,1,101261),(8981,1,1,101262),(7616,1,1,101331),(10030,1,1,101701),(10031,1,1,101702),(3582,1,1,102000),(3583,1,1,102001),(9819,1,1,400051),(9823,1,1,400052),(9827,1,1,400053),(9831,1,1,400055),(132,1,2,11),(133,1,2,12),(134,1,2,13),(135,1,2,14),(136,1,2,16),(137,1,2,19),(138,1,2,21),(139,1,2,22),(140,1,2,24),(141,1,2,25),(142,1,2,26),(143,1,2,27),(10359,1,2,31),(145,1,2,32),(10361,1,2,34),(146,1,2,36),(147,1,2,41),(148,1,2,42),(149,1,2,44),(150,1,2,61),(151,1,2,62),(152,1,2,64),(153,1,2,71),(154,1,2,72),(155,1,2,74),(156,1,2,75),(157,1,2,78),(158,1,2,79),(159,1,2,81),(160,1,2,82),(161,1,2,84),(162,1,2,86),(163,1,2,87),(164,1,2,88),(165,1,2,89),(166,1,2,91),(167,1,2,92),(168,1,2,93),(2475,1,2,95),(2476,1,2,96),(2477,1,2,97),(2478,1,2,98),(169,1,2,101),(170,1,2,102),(171,1,2,104),(172,1,2,109),(173,1,2,111),(174,1,2,112),(175,1,2,113),(176,1,2,114),(177,1,2,116),(178,1,2,117),(179,1,2,121),(180,1,2,122),(181,1,2,125),(182,1,2,141),(183,1,2,142),(184,1,2,144),(2479,1,2,151),(2480,1,2,152),(2481,1,2,153),(2482,1,2,154),(185,1,2,161),(186,1,2,162),(187,1,2,163),(188,1,2,164),(189,1,2,165),(190,1,2,170),(2471,1,2,171),(192,1,2,172),(2472,1,2,173),(193,1,2,221),(194,1,2,222),(195,1,2,229),(196,1,2,241),(197,1,2,242),(198,1,2,243),(199,1,2,251),(201,1,2,262),(202,1,2,281),(203,1,2,282),(204,1,2,283),(205,1,2,331),(15072,1,2,510),(2483,1,2,531),(207,1,2,532),(2484,1,2,534),(208,1,2,536),(2473,1,2,700),(210,1,2,701),(211,1,2,702),(2474,1,2,703),(15064,1,2,771),(15057,1,2,772),(15059,1,2,773),(15061,1,2,774),(15063,1,2,775),(15065,1,2,776),(212,1,2,1001),(213,1,2,1002),(214,1,2,1003),(215,1,2,1004),(216,1,2,1005),(217,1,2,1101),(218,1,2,1102),(219,1,2,1104),(220,1,2,1109),(15073,1,2,1121),(15074,1,2,1122),(15075,1,2,1123),(15076,1,2,1124),(15077,1,2,1125),(15078,1,2,1126),(221,1,2,1181),(222,1,2,1182),(223,1,2,1183),(224,1,2,1184),(225,1,2,1185),(226,1,2,1186),(227,1,2,1187),(228,1,2,1188),(229,1,2,1201),(230,1,2,1202),(231,1,2,1231),(232,1,2,1232),(233,1,2,1233),(234,1,2,1234),(235,1,2,1421),(236,1,2,2401),(237,1,2,2402),(238,1,2,2403),(239,1,2,2411),(240,1,2,2412),(241,1,2,2413),(242,1,2,2500),(2470,1,2,2501),(243,1,2,2515),(10363,1,2,20001),(10364,1,2,20002),(10365,1,2,20003),(10366,1,2,20004),(10367,1,2,20005),(10368,1,2,20006),(15054,1,2,23001),(10362,1,2,50101),(15067,1,2,55001),(15066,1,2,59001),(15068,1,2,63001),(15069,1,2,63002),(15070,1,2,63003),(15071,1,2,63004),(10372,1,2,101250),(1807,1,3,11),(1808,1,3,31),(1809,1,3,36),(1810,1,3,41),(1811,1,3,61),(1812,1,3,71),(1813,1,3,72),(1814,1,3,74),(1815,1,3,75),(1816,1,3,78),(1817,1,3,79),(1818,1,3,91),(1819,1,3,95),(1820,1,3,97),(1821,1,3,111),(1822,1,3,121),(1823,1,3,122),(1824,1,3,125),(1825,1,3,161),(1826,1,3,170),(1827,1,3,171),(1828,1,3,172),(1829,1,3,221),(1830,1,3,222),(1831,1,3,229),(1832,1,3,241),(1833,1,3,242),(1834,1,3,243),(1835,1,3,251),(1836,1,3,255),(1837,1,3,256),(1838,1,3,262),(1839,1,3,281),(1840,1,3,282),(1841,1,3,283),(1842,1,3,331),(1843,1,3,531),(1844,1,3,536),(1845,1,3,700),(1846,1,3,1001),(1847,1,3,1002),(1848,1,3,1003),(1849,1,3,1004),(1850,1,3,1005),(1851,1,3,1181),(1852,1,3,1182),(1853,1,3,1201),(1854,1,3,1202),(1855,1,3,1231),(1856,1,3,2401),(1857,1,3,2402),(1858,1,3,2403),(1859,1,3,2411),(1860,1,3,2412),(1861,1,3,2413),(1862,1,3,2500),(1863,1,3,2515),(8026,1,4,11),(8027,1,4,21),(8028,1,4,31),(8029,1,4,41),(8030,1,4,61),(8031,1,4,71),(8032,1,4,72),(8033,1,4,74),(8034,1,4,75),(8035,1,4,78),(8036,1,4,79),(8037,1,4,81),(8038,1,4,91),(8039,1,4,95),(8040,1,4,97),(8041,1,4,101),(8042,1,4,111),(8043,1,4,121),(8044,1,4,151),(8045,1,4,161),(8046,1,4,171),(8047,1,4,221),(8048,1,4,222),(8049,1,4,229),(8050,1,4,241),(8051,1,4,242),(8052,1,4,243),(8146,1,4,251),(8147,1,4,253),(8053,1,4,262),(8054,1,4,281),(8055,1,4,331),(8056,1,4,341),(8057,1,4,342),(8058,1,4,343),(8059,1,4,344),(8060,1,4,531),(8061,1,4,700),(8062,1,4,1001),(8063,1,4,1002),(8064,1,4,1003),(8065,1,4,1004),(8066,1,4,1005),(8067,1,4,1101),(8068,1,4,1181),(8069,1,4,1182),(8070,1,4,1201),(8071,1,4,1202),(8072,1,4,1231),(8073,1,4,2401),(8074,1,4,2501),(8075,1,4,2503),(8076,1,4,2515),(8077,1,4,20001),(8078,1,4,50101),(8079,1,4,101201),(8080,1,4,101261),(8081,1,4,102000),(8082,1,4,400051),(8083,1,4,400052),(8084,1,4,400053),(8085,1,4,400055),(12608,1,10,11),(12609,1,10,21),(12610,1,10,31),(12611,1,10,41),(12612,1,10,61),(12613,1,10,71),(12614,1,10,72),(12615,1,10,74),(12616,1,10,75),(12617,1,10,78),(12618,1,10,79),(12619,1,10,81),(12620,1,10,91),(12621,1,10,95),(12622,1,10,97),(12623,1,10,101),(12624,1,10,111),(12625,1,10,121),(12626,1,10,151),(12627,1,10,161),(12628,1,10,171),(12629,1,10,221),(12630,1,10,222),(12631,1,10,229),(12632,1,10,241),(12633,1,10,242),(12634,1,10,243),(12635,1,10,262),(12636,1,10,281),(12637,1,10,300),(12638,1,10,331),(12639,1,10,341),(12640,1,10,342),(12641,1,10,343),(12642,1,10,344),(12643,1,10,531),(12644,1,10,700),(12645,1,10,1001),(12646,1,10,1002),(12647,1,10,1003),(12648,1,10,1004),(12649,1,10,1005),(12650,1,10,1101),(12651,1,10,1181),(12652,1,10,1182),(12653,1,10,1201),(12654,1,10,1202),(12655,1,10,1231),(12656,1,10,2401),(12657,1,10,2501),(12658,1,10,2503),(12659,1,10,2515),(12660,1,10,20001),(12661,1,10,20002),(12662,1,10,23001),(12663,1,10,50101),(12664,1,11,11),(12665,1,11,21),(12666,1,11,31),(12667,1,11,41),(12668,1,11,61),(12669,1,11,71),(12670,1,11,72),(12671,1,11,74),(12672,1,11,75),(12673,1,11,78),(12674,1,11,79),(12675,1,11,81),(12676,1,11,91),(12677,1,11,95),(12678,1,11,97),(12679,1,11,101),(12680,1,11,111),(12681,1,11,121),(12682,1,11,151),(12683,1,11,161),(12684,1,11,171),(12685,1,11,221),(12686,1,11,222),(12687,1,11,229),(12688,1,11,241),(12689,1,11,242),(12690,1,11,243),(12691,1,11,262),(12692,1,11,281),(12693,1,11,300),(12694,1,11,331),(12695,1,11,341),(12696,1,11,342),(12697,1,11,343),(12698,1,11,344),(12699,1,11,531),(12700,1,11,700),(12701,1,11,1001),(12702,1,11,1002),(12703,1,11,1003),(12704,1,11,1004),(12705,1,11,1005),(12706,1,11,1101),(12707,1,11,1181),(12708,1,11,1182),(12709,1,11,1201),(12710,1,11,1202),(12711,1,11,1231),(12712,1,11,2401),(12713,1,11,2501),(12714,1,11,2503),(12715,1,11,2515),(12716,1,11,20001),(12717,1,11,20002),(12718,1,11,23001),(12719,1,11,50101),(15905,1,12,11),(15895,1,12,12),(15897,1,12,13),(15899,1,12,14),(15901,1,12,15),(15904,1,12,16),(15907,1,12,19),(14146,1,12,21),(14135,1,12,22),(14137,1,12,24),(14139,1,12,25),(14142,1,12,26),(14145,1,12,27),(14148,1,12,28),(14930,1,12,31),(14926,1,12,32),(14929,1,12,34),(14932,1,12,38),(13816,1,12,41),(13813,1,12,42),(13815,1,12,44),(13817,1,12,45),(14094,1,12,61),(14091,1,12,62),(14093,1,12,64),(14095,1,12,67),(14096,1,12,68),(13891,1,12,71),(13886,1,12,72),(13888,1,12,74),(13892,1,12,75),(13890,1,12,76),(13894,1,12,78),(13895,1,12,79),(15875,1,12,81),(15869,1,12,82),(15870,1,12,84),(15871,1,12,86),(15873,1,12,87),(15874,1,12,88),(15876,1,12,89),(15401,1,12,91),(15397,1,12,92),(15400,1,12,93),(15403,1,12,94),(13990,1,12,95),(12734,1,12,97),(14939,1,12,101),(14935,1,12,102),(14936,1,12,104),(14937,1,12,105),(14938,1,12,106),(14940,1,12,109),(15390,1,12,111),(15377,1,12,112),(15380,1,12,113),(15383,1,12,114),(15386,1,12,115),(15389,1,12,116),(15392,1,12,117),(15964,1,12,121),(15960,1,12,122),(15963,1,12,125),(15966,1,12,126),(13821,1,12,141),(13820,1,12,142),(13822,1,12,144),(13912,1,12,151),(13909,1,12,152),(13911,1,12,153),(13913,1,12,154),(14063,1,12,161),(14056,1,12,162),(14058,1,12,163),(14060,1,12,164),(14062,1,12,165),(14064,1,12,167),(13350,1,12,171),(13345,1,12,172),(13347,1,12,173),(13349,1,12,174),(13351,1,12,178),(13838,1,12,221),(13834,1,12,222),(13837,1,12,223),(13840,1,12,229),(13842,1,12,237),(13844,1,12,238),(13846,1,12,239),(13516,1,12,241),(13515,1,12,242),(13517,1,12,243),(16007,1,12,251),(15988,1,12,252),(15990,1,12,253),(15991,1,12,254),(15993,1,12,255),(15995,1,12,256),(15968,1,12,262),(15977,1,12,281),(15973,1,12,282),(15976,1,12,283),(15979,1,12,286),(15858,1,12,300),(15859,1,12,301),(14126,1,12,331),(14125,1,12,332),(14127,1,12,333),(15996,1,12,341),(15997,1,12,342),(15998,1,12,343),(15999,1,12,344),(16005,1,12,351),(16002,1,12,352),(16004,1,12,353),(16006,1,12,354),(16008,1,12,358),(13865,1,12,510),(13862,1,12,512),(13864,1,12,514),(13866,1,12,517),(15291,1,12,520),(15286,1,12,522),(15288,1,12,524),(15290,1,12,525),(15292,1,12,527),(15985,1,12,531),(15982,1,12,532),(15984,1,12,534),(15986,1,12,538),(13358,1,12,700),(15883,1,12,701),(15882,1,12,702),(15885,1,12,703),(15090,1,12,771),(15081,1,12,772),(15083,1,12,773),(15085,1,12,774),(15087,1,12,775),(15089,1,12,776),(15091,1,12,779),(14917,1,12,1001),(14916,1,12,1002),(14918,1,12,1003),(14920,1,12,1004),(14921,1,12,1005),(14945,1,12,1101),(14943,1,12,1102),(14944,1,12,1104),(14946,1,12,1109),(14762,1,12,1121),(14755,1,12,1122),(14757,1,12,1123),(14759,1,12,1124),(14761,1,12,1125),(14763,1,12,1126),(15911,1,12,1181),(15934,1,12,1182),(15914,1,12,1183),(15915,1,12,1184),(15917,1,12,1185),(15919,1,12,1186),(15921,1,12,1187),(15924,1,12,1188),(15922,1,12,1189),(13827,1,12,1201),(13828,1,12,1202),(15932,1,12,1231),(15927,1,12,1232),(15928,1,12,1233),(15930,1,12,1234),(15931,1,12,1235),(15933,1,12,1236),(15935,1,12,1237),(13829,1,12,1251),(15909,1,12,1321),(15910,1,12,1322),(15877,1,12,1421),(15846,1,12,2401),(15845,1,12,2402),(15848,1,12,2403),(15854,1,12,2411),(15853,1,12,2412),(15856,1,12,2413),(15857,1,12,2414),(15889,1,12,2501),(15888,1,12,2503),(15890,1,12,2515),(15435,1,12,5001),(15436,1,12,5002),(15950,1,12,20001),(15940,1,12,20002),(15943,1,12,20003),(15946,1,12,20004),(15949,1,12,20005),(15952,1,12,20006),(15865,1,12,23001),(15862,1,12,23002),(15864,1,12,23003),(15866,1,12,23004),(13712,1,12,50101),(15499,1,12,50401),(15501,1,12,50411),(15502,1,12,50412),(15503,1,12,50420),(15504,1,12,50430),(15498,1,12,50440),(15954,1,12,55001),(15955,1,12,55002),(14128,1,12,59001),(14129,1,12,59002),(14130,1,12,59003),(14818,1,12,63001),(14815,1,12,63002),(14817,1,12,63003),(14819,1,12,63004),(15241,1,12,64001),(16009,1,12,101331),(16010,1,12,101332),(16011,1,12,101333),(15438,1,12,101701),(15439,1,12,101702),(12776,1,13,11),(12777,1,13,21),(12778,1,13,31),(12779,1,13,41),(12780,1,13,61),(12781,1,13,71),(12782,1,13,72),(12783,1,13,74),(12784,1,13,75),(12785,1,13,78),(12786,1,13,79),(12787,1,13,81),(12788,1,13,91),(12789,1,13,95),(12790,1,13,97),(12791,1,13,101),(12792,1,13,111),(12793,1,13,121),(12794,1,13,151),(12795,1,13,161),(12796,1,13,171),(12797,1,13,221),(12798,1,13,222),(12799,1,13,229),(12800,1,13,241),(12801,1,13,242),(12802,1,13,243),(12803,1,13,262),(12804,1,13,281),(12805,1,13,300),(12806,1,13,331),(12807,1,13,341),(12808,1,13,342),(12809,1,13,343),(12810,1,13,344),(12811,1,13,531),(12812,1,13,700),(12813,1,13,1001),(12814,1,13,1002),(12815,1,13,1003),(12816,1,13,1004),(12817,1,13,1005),(12818,1,13,1101),(12819,1,13,1181),(12820,1,13,1182),(12821,1,13,1201),(12822,1,13,1202),(12823,1,13,1231),(12824,1,13,2401),(12825,1,13,2501),(12826,1,13,2503),(12827,1,13,2515),(12828,1,13,20001),(12829,1,13,20002),(12830,1,13,23001),(12831,1,13,50101),(12832,1,14,11),(12833,1,14,21),(12834,1,14,31),(12835,1,14,41),(12836,1,14,61),(12837,1,14,71),(12838,1,14,72),(12839,1,14,74),(12840,1,14,75),(12841,1,14,78),(12842,1,14,79),(12843,1,14,81),(12844,1,14,91),(12845,1,14,95),(12846,1,14,97),(12847,1,14,101),(12848,1,14,111),(12849,1,14,121),(12850,1,14,151),(12851,1,14,161),(12852,1,14,171),(12853,1,14,221),(12854,1,14,222),(12855,1,14,229),(12856,1,14,241),(12857,1,14,242),(12858,1,14,243),(12859,1,14,262),(12860,1,14,281),(12861,1,14,300),(12862,1,14,331),(12863,1,14,341),(12864,1,14,342),(12865,1,14,343),(12866,1,14,344),(12867,1,14,531),(12868,1,14,700),(12869,1,14,1001),(12870,1,14,1002),(12871,1,14,1003),(12872,1,14,1004),(12873,1,14,1005),(12874,1,14,1101),(12875,1,14,1181),(12876,1,14,1182),(12877,1,14,1201),(12878,1,14,1202),(12879,1,14,1231),(12880,1,14,2401),(12881,1,14,2501),(12882,1,14,2503),(12883,1,14,2515),(12884,1,14,20001),(12885,1,14,20002),(12886,1,14,23001),(12887,1,14,50101),(12944,1,16,11),(12945,1,16,21),(12946,1,16,31),(13056,1,16,41),(13057,1,16,42),(13058,1,16,44),(13059,1,16,45),(12948,1,16,61),(12949,1,16,71),(12950,1,16,72),(12951,1,16,74),(12952,1,16,75),(12953,1,16,78),(12954,1,16,79),(12955,1,16,81),(12956,1,16,91),(12957,1,16,95),(12958,1,16,97),(12959,1,16,101),(12960,1,16,111),(12961,1,16,121),(13060,1,16,141),(13061,1,16,142),(13062,1,16,144),(12962,1,16,151),(12963,1,16,161),(12964,1,16,171),(12965,1,16,221),(12966,1,16,222),(12967,1,16,229),(12968,1,16,241),(12969,1,16,242),(12970,1,16,243),(13128,1,16,251),(13064,1,16,262),(12972,1,16,281),(12973,1,16,300),(12974,1,16,331),(12975,1,16,341),(12976,1,16,342),(12977,1,16,343),(12978,1,16,344),(12979,1,16,531),(12980,1,16,700),(12981,1,16,1001),(12982,1,16,1002),(12983,1,16,1003),(12984,1,16,1004),(12985,1,16,1005),(12986,1,16,1101),(12987,1,16,1181),(12988,1,16,1182),(12989,1,16,1201),(12990,1,16,1202),(12991,1,16,1231),(12992,1,16,2401),(12993,1,16,2501),(12994,1,16,2503),(12995,1,16,2515),(12996,1,16,20001),(12997,1,16,20002),(12998,1,16,23001),(12999,1,16,50101),(13000,1,17,11),(13001,1,17,21),(13002,1,17,31),(13065,1,17,41),(13066,1,17,42),(13067,1,17,44),(13068,1,17,45),(13004,1,17,61),(13005,1,17,71),(13006,1,17,72),(13007,1,17,74),(13008,1,17,75),(13009,1,17,78),(13010,1,17,79),(13011,1,17,81),(13012,1,17,91),(13013,1,17,95),(13014,1,17,97),(13015,1,17,101),(13016,1,17,111),(13017,1,17,121),(13069,1,17,141),(13070,1,17,142),(13071,1,17,144),(13018,1,17,151),(13019,1,17,161),(13020,1,17,171),(13021,1,17,221),(13022,1,17,222),(13023,1,17,229),(13024,1,17,241),(13025,1,17,242),(13026,1,17,243),(13028,1,17,281),(13029,1,17,300),(13030,1,17,331),(13031,1,17,341),(13032,1,17,342),(13033,1,17,343),(13034,1,17,344),(13035,1,17,531),(13036,1,17,700),(13037,1,17,1001),(13038,1,17,1002),(13039,1,17,1003),(13040,1,17,1004),(13041,1,17,1005),(13042,1,17,1101),(13043,1,17,1181),(13044,1,17,1182),(13045,1,17,1201),(13046,1,17,1202),(13047,1,17,1231),(13048,1,17,2401),(13049,1,17,2501),(13050,1,17,2503),(13051,1,17,2515),(13052,1,17,20001),(13053,1,17,20002),(13054,1,17,23001),(13055,1,17,50101),(14504,1,18,11),(14505,1,18,21),(14506,1,18,31),(14507,1,18,41),(14508,1,18,61),(14509,1,18,71),(14510,1,18,78),(14511,1,18,81),(14512,1,18,91),(14513,1,18,95),(14514,1,18,101),(14515,1,18,111),(14516,1,18,121),(14517,1,18,151),(14518,1,18,161),(14519,1,18,221),(14520,1,18,241),(14521,1,18,262),(14522,1,18,281),(14523,1,18,300),(14524,1,18,331),(14525,1,18,332),(14526,1,18,333),(14527,1,18,341),(14528,1,18,342),(14529,1,18,343),(14530,1,18,344),(14531,1,18,531),(14532,1,18,701),(14533,1,18,771),(14534,1,18,774),(14535,1,18,1001),(14536,1,18,1004),(14537,1,18,1101),(14538,1,18,1181),(14539,1,18,1182),(14540,1,18,1201),(14541,1,18,1231),(14542,1,18,2401),(14543,1,18,2501),(14544,1,18,2503),(14545,1,18,2515),(14546,1,18,20001),(14547,1,18,20002),(14548,1,18,50101),(14549,1,18,59001),(15242,1,19,21),(15243,1,19,31),(15244,1,19,41),(15245,1,19,61),(15246,1,19,71),(15247,1,19,78),(15248,1,19,81),(15249,1,19,101),(15250,1,19,121),(15251,1,19,151),(15252,1,19,161),(15253,1,19,221),(15254,1,19,241),(15255,1,19,262),(15256,1,19,281),(15257,1,19,300),(15258,1,19,331),(15259,1,19,332),(15260,1,19,341),(15261,1,19,342),(15262,1,19,343),(15263,1,19,344),(15264,1,19,531),(15265,1,19,701),(15266,1,19,771),(15267,1,19,774),(15268,1,19,777),(15269,1,19,1001),(15270,1,19,1004),(15271,1,19,1101),(15272,1,19,1121),(15273,1,19,1181),(15274,1,19,1182),(15275,1,19,1201),(15276,1,19,1231),(15277,1,19,2401),(15278,1,19,2501),(15279,1,19,20001),(15280,1,19,20002),(15281,1,19,50101),(15282,1,19,59001),(15283,1,19,63001); +/*!40000 ALTER TABLE `llx_user_rights` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup` +-- + +DROP TABLE IF EXISTS `llx_usergroup`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `note` text, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_usergroup_name` (`nom`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup` +-- + +LOCK TABLES `llx_usergroup` WRITE; +/*!40000 ALTER TABLE `llx_usergroup` DISABLE KEYS */; +INSERT INTO `llx_usergroup` VALUES (1,'Sale representatives',1,'2013-01-16 20:48:08','2015-10-03 09:44:44','All sales representative users',NULL),(2,'Management',1,'2015-10-03 11:46:25','2015-10-03 09:46:25','',NULL),(3,'Scientists',1,'2015-10-03 11:46:46','2015-10-03 09:46:46','',NULL),(4,'Commercial',1,'2015-10-05 21:30:13','2015-10-05 19:30:13','',NULL); +/*!40000 ALTER TABLE `llx_usergroup` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup_extrafields` +-- + +DROP TABLE IF EXISTS `llx_usergroup_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_usergroup_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup_extrafields` +-- + +LOCK TABLES `llx_usergroup_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_usergroup_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_usergroup_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup_rights` +-- + +DROP TABLE IF EXISTS `llx_usergroup_rights`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup_rights` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_usergroup` int(11) NOT NULL, + `fk_id` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_usergroup_rights` (`entity`,`fk_usergroup`,`fk_id`), + KEY `fk_usergroup_rights_fk_usergroup` (`fk_usergroup`), + CONSTRAINT `fk_usergroup_rights_fk_usergroup` FOREIGN KEY (`fk_usergroup`) REFERENCES `llx_usergroup` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=200 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup_rights` +-- + +LOCK TABLES `llx_usergroup_rights` WRITE; +/*!40000 ALTER TABLE `llx_usergroup_rights` DISABLE KEYS */; +INSERT INTO `llx_usergroup_rights` VALUES (1,1,1,2401),(2,1,1,2402),(3,1,1,2403),(4,1,1,2411),(5,1,1,2412),(6,1,1,2413),(78,1,2,11),(79,1,2,12),(80,1,2,13),(81,1,2,14),(82,1,2,15),(83,1,2,16),(84,1,2,19),(144,1,2,21),(145,1,2,22),(146,1,2,24),(147,1,2,25),(148,1,2,26),(149,1,2,27),(150,1,2,28),(133,1,2,31),(134,1,2,32),(135,1,2,34),(136,1,2,38),(137,1,2,41),(138,1,2,42),(139,1,2,44),(140,1,2,45),(86,1,2,61),(87,1,2,62),(88,1,2,64),(89,1,2,67),(90,1,2,68),(7,1,2,71),(8,1,2,72),(9,1,2,74),(10,1,2,75),(11,1,2,76),(12,1,2,78),(13,1,2,79),(32,1,2,81),(33,1,2,82),(34,1,2,84),(35,1,2,86),(36,1,2,87),(37,1,2,88),(38,1,2,89),(173,1,2,91),(174,1,2,92),(175,1,2,93),(176,1,2,94),(40,1,2,95),(41,1,2,96),(42,1,2,97),(43,1,2,98),(66,1,2,101),(67,1,2,102),(68,1,2,104),(69,1,2,105),(70,1,2,106),(71,1,2,109),(21,1,2,111),(22,1,2,112),(23,1,2,113),(24,1,2,114),(25,1,2,115),(26,1,2,116),(27,1,2,117),(164,1,2,121),(165,1,2,122),(166,1,2,125),(167,1,2,126),(141,1,2,141),(142,1,2,142),(143,1,2,144),(129,1,2,151),(130,1,2,152),(131,1,2,153),(132,1,2,154),(44,1,2,161),(45,1,2,162),(46,1,2,163),(47,1,2,164),(48,1,2,165),(49,1,2,167),(54,1,2,171),(55,1,2,172),(56,1,2,173),(57,1,2,174),(58,1,2,178),(120,1,2,221),(121,1,2,222),(122,1,2,223),(123,1,2,229),(124,1,2,237),(125,1,2,238),(126,1,2,239),(29,1,2,241),(30,1,2,242),(31,1,2,243),(182,1,2,251),(183,1,2,252),(184,1,2,253),(185,1,2,254),(186,1,2,255),(187,1,2,256),(168,1,2,262),(169,1,2,281),(170,1,2,282),(171,1,2,283),(172,1,2,286),(197,1,2,331),(198,1,2,332),(199,1,2,333),(188,1,2,341),(189,1,2,342),(190,1,2,343),(191,1,2,344),(192,1,2,351),(193,1,2,352),(194,1,2,353),(195,1,2,354),(196,1,2,358),(151,1,2,531),(152,1,2,532),(153,1,2,534),(154,1,2,538),(59,1,2,700),(60,1,2,701),(61,1,2,702),(62,1,2,703),(177,1,2,1001),(178,1,2,1002),(179,1,2,1003),(180,1,2,1004),(181,1,2,1005),(72,1,2,1101),(73,1,2,1102),(74,1,2,1104),(75,1,2,1109),(91,1,2,1181),(92,1,2,1182),(93,1,2,1183),(94,1,2,1184),(95,1,2,1185),(96,1,2,1186),(97,1,2,1187),(98,1,2,1188),(99,1,2,1189),(76,1,2,1201),(77,1,2,1202),(100,1,2,1231),(101,1,2,1232),(102,1,2,1233),(103,1,2,1234),(104,1,2,1235),(105,1,2,1236),(106,1,2,1237),(113,1,2,1251),(85,1,2,1321),(39,1,2,1421),(14,1,2,2401),(15,1,2,2402),(16,1,2,2403),(17,1,2,2411),(18,1,2,2412),(19,1,2,2413),(20,1,2,2414),(63,1,2,2501),(64,1,2,2503),(65,1,2,2515),(114,1,2,20001),(115,1,2,20002),(116,1,2,20003),(117,1,2,20004),(118,1,2,20005),(119,1,2,20006),(50,1,2,23001),(51,1,2,23002),(52,1,2,23003),(53,1,2,23004),(28,1,2,50101),(127,1,2,55001),(128,1,2,55002); +/*!40000 ALTER TABLE `llx_usergroup_rights` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup_user` +-- + +DROP TABLE IF EXISTS `llx_usergroup_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup_user` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_user` int(11) NOT NULL, + `fk_usergroup` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_usergroup_user` (`entity`,`fk_user`,`fk_usergroup`), + KEY `fk_usergroup_user_fk_user` (`fk_user`), + KEY `fk_usergroup_user_fk_usergroup` (`fk_usergroup`), + CONSTRAINT `fk_usergroup_user_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_usergroup_user_fk_usergroup` FOREIGN KEY (`fk_usergroup`) REFERENCES `llx_usergroup` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup_user` +-- + +LOCK TABLES `llx_usergroup_user` WRITE; +/*!40000 ALTER TABLE `llx_usergroup_user` DISABLE KEYS */; +INSERT INTO `llx_usergroup_user` VALUES (2,1,1,3),(12,1,2,4),(3,1,3,3),(4,1,11,2),(13,1,12,1),(5,1,13,4),(6,1,16,1),(7,1,17,1),(11,1,18,1); +/*!40000 ALTER TABLE `llx_usergroup_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_website` +-- + +DROP TABLE IF EXISTS `llx_website`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_website` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) DEFAULT '1', + `ref` varchar(24) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `fk_default_home` int(11) DEFAULT NULL, + `virtualhost` varchar(255) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_modification` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_create` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_website_ref` (`ref`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_website` +-- + +LOCK TABLES `llx_website` WRITE; +/*!40000 ALTER TABLE `llx_website` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_website` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_website_page` +-- + +DROP TABLE IF EXISTS `llx_website_page`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_website_page` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_website` int(11) NOT NULL, + `pageurl` varchar(16) NOT NULL, + `title` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `keywords` varchar(255) DEFAULT NULL, + `content` mediumtext, + `status` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_modification` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_website_page_url` (`fk_website`,`pageurl`), + CONSTRAINT `fk_website_page_website` FOREIGN KEY (`fk_website`) REFERENCES `llx_website` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_website_page` +-- + +LOCK TABLES `llx_website_page` WRITE; +/*!40000 ALTER TABLE `llx_website_page` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_website_page` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2017-09-06 22:01:54 diff --git a/dev/initdemo/savedemo.sh b/dev/initdemo/savedemo.sh index fe9cba72c43..fd3f8caafd5 100755 --- a/dev/initdemo/savedemo.sh +++ b/dev/initdemo/savedemo.sh @@ -192,6 +192,7 @@ export list=" --ignore-table=$base.llx_cabinetmed_c_ccam --ignore-table=$base.llx_cabinetmed_c_examconclusion --ignore-table=$base.llx_cabinetmed_cons + --ignore-table=$base.llx_cabinetmed_cons_extrafields --ignore-table=$base.llx_cabinetmed_diaglec --ignore-table=$base.llx_cabinetmed_examaut --ignore-table=$base.llx_cabinetmed_exambio @@ -207,7 +208,18 @@ export list=" --ignore-table=$base.llx_dolicloud_customers --ignore-table=$base.llx_dolicloud_stats --ignore-table=$base.llx_dolicloud_emailstemplates + --ignore-table=$base.llx_dolireport_column + --ignore-table=$base.llx_dolireport_criteria + --ignore-table=$base.llx_dolireport_graph + --ignore-table=$base.llx_dolireport_plot + --ignore-table=$base.llx_dolireport_report --ignore-table=$base.llx_domain + --ignore-table=$base.llx_ecommerce_commande + --ignore-table=$base.llx_ecommerce_facture + --ignore-table=$base.llx_ecommerce_product + --ignore-table=$base.llx_ecommerce_site + --ignore-table=$base.llx_ecommerce_societe + --ignore-table=$base.llx_ecommerce_socpeople --ignore-table=$base.llx_element_rang --ignore-table=$base.llx_entity --ignore-table=$base.llx_filemanager_roots @@ -215,6 +227,8 @@ export list=" --ignore-table=$base.llx_google_maps --ignore-table=$base.llx_milestone --ignore-table=$base.llx_monitoring_probes + --ignore-table=$base.llx_m + --ignore-table=$base.llx_m_extrafields --ignore-table=$base.llx_notes --ignore-table=$base.llx_pos_cash --ignore-table=$base.llx_pos_control_cash diff --git a/dev/resources/iso-normes/sample_FEC_file.txt b/dev/resources/iso-normes/sample_FEC_file.txt index 5ca795af5c2..8ca50c92617 100644 --- a/dev/resources/iso-normes/sample_FEC_file.txt +++ b/dev/resources/iso-normes/sample_FEC_file.txt @@ -1,4 +1,4 @@ -JOURNALCODE JOURNALLIB ECRITURENUM ECRITUREDATE COMPTENUM COMPTELIB COMPAUXNUM COMPAUXLIB PIECEREF PIECEDATE ECRITURELIB DEBIT CREDIT ECRITURELET DATELET VALIDDATE MONTANTDEVISE IDEVISE +JOURNALCODE JOURNALLIB ECRITURENUM ECRITUREDATE COMPTENUM COMPTELIB COMPAUXNUM COMPAUXLIB PIECEREF PIECEDATE ECRITURELIB DEBIT CREDIT ECRITURELET DATELET VALIDDATE MONTANTDEVISE IDEVISE Banque Banque 17293 20170109 401PPRO PUBLI-PROV L08 20170109 PPRO domiciliation 1TR 187,20 0,00 20170109 Banque Banque 17293 20170109 5121CRA CR AGRICOLE L08 20170109 PPRO domiciliation 1TR 0,00 187,20 20170109 Banque Banque 17295 20170109 401ORPA ORANGE PARIS Report 20170109 ORPA adsl par 12 96,00 0,00 20170109 diff --git a/dev/resources/iso-normes/world_tax_rates.txt b/dev/resources/iso-normes/world_tax_rates.txt index e5bb64a86f2..740062288dc 100644 --- a/dev/resources/iso-normes/world_tax_rates.txt +++ b/dev/resources/iso-normes/world_tax_rates.txt @@ -1 +1,4 @@ -http://www.taxrates.cc/index.html \ No newline at end of file +http://www.taxrates.cc/index.html + +For India: VAT=IGST/CGST=Localtax1/SGST=Localtax2: https://cleartax.in/s/what-is-sgst-cgst-igst + diff --git a/dev/tools/rmphpclosingtag.sh b/dev/tools/rmphpclosingtag.sh deleted file mode 100755 index ec755bc399b..00000000000 --- a/dev/tools/rmphpclosingtag.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# vim:ft=sh:ts=3:sts=3:sw=3:et: - -### -# Strips the closing php tag `?>` and any following blank lines from the -# end of any PHP file in the current working directory and sub-directories. Files -# with non-whitespace characters following the closing tag will not be affected. -# -# Author: Bryan C. Geraghty -# Date: 2009-10-28 -# Source: http://bryan.ravensight.org/2010/07/remove-php-closing-tag/ -## - -FILES=$(pcregrep -rnM --include='^.*\.php$' '^\?\>(?=([\s\n]+)?$(?!\n))' .); - -for MATCH in $FILES; -do - FILE=`echo $MATCH | awk -F ':' '{print $1}'`; - TARGET=`echo $MATCH | awk -F ':' '{print $2}'`; - LINE_COUNT=`wc -l $FILE | awk -F " " '{print $1}'`; - echo "Removing lines ${TARGET} through ${LINE_COUNT} from file $FILE..."; - sed -i "${TARGET},${LINE_COUNT}d" $FILE; -done; diff --git a/dev/translation/erp_comparison_translation.txt b/dev/translation/erp_comparison_translation.txt index fb96c17e3f9..c99a5f4cc1c 100644 --- a/dev/translation/erp_comparison_translation.txt +++ b/dev/translation/erp_comparison_translation.txt @@ -12,3 +12,6 @@ Balance ?? Net profit Subledger account Subledger account ?? +Proposal ?? Quotation Proposal is ok but proposition looks better (proposal is for a detailed proposition). We can say also "business proposition or business proposal". + Indian are using "Quotation". + diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index 9136c192739..f65cefd7f94 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -25,7 +25,7 @@ $path=dirname(__FILE__).'/'; $web=0; // Test if batch mode -if (substr($sapi_type, 0, 3) == 'cgi') +if (substr($sapi_type, 0, 3) == 'cgi') { $web=1; } @@ -35,9 +35,9 @@ if ($web) { echo ""; echo ""; - + echo ""; - + echo ""; } @@ -142,9 +142,9 @@ foreach ($files AS $file) { } } -foreach ($langstrings_3d AS $filename => $file) +foreach ($langstrings_3d AS $filename => $file) { - foreach ($file AS $linenum => $value) + foreach ($file AS $linenum => $value) { $keys = array_keys($langstrings_full, $value); if (count($keys)>1) @@ -173,11 +173,11 @@ $sininstallandadmin=''; $sother=''; $count = 0; -foreach ($dups as $string => $pages) +foreach ($dups as $string => $pages) { $count++; $s=''; - + // Keyword $string if ($web) $s.=""; if ($web) $s.=""; @@ -188,32 +188,32 @@ foreach ($dups as $string => $pages) if ($web) $s.=""; if ($web) $s.=""; if (! $web) $s.= ' : '; - + // Loop on each files keyword was found $duplicateinsamefile=0; $inmain=0; $inadmin=0; - foreach ($pages AS $file => $lines) + foreach ($pages AS $file => $lines) { if ($file == 'main.lang') { $inmain=1; $inadmin=0; } if ($file == 'admin.lang' && ! $inmain) { $inadmin=1; } - + $s.=$file." "; - + // Loop on each line keword was found into file. $listoffilesforthisentry=array(); - foreach ($lines as $line => $translatedvalue) + foreach ($lines as $line => $translatedvalue) { if (! empty($listoffilesforthisentry[$file])) $duplicateinsamefile=1; $listoffilesforthisentry[$file]=1; - + $s.= "(".$line." - ".htmlentities($translatedvalue).") "; } if ($web) $s.="
"; } if ($web) $s.=""; $s.="\n"; - + if ($duplicateinsamefile) $sduplicateinsamefile .= $s; else if ($inmain) $sinmainandother .= $s; else if ($inadmin) $sininstallandadmin .= $s; @@ -252,7 +252,7 @@ if ($web) if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) { print "***** Strings in en_US that are never used:\n"; - + $unused=array(); foreach ($langstrings_dist AS $value => $line) { @@ -288,7 +288,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a if (preg_match('/^JuridicalStatus/', $value)) $qualifiedforclean=0; if (preg_match('/^CalcMode/', $value)) $qualifiedforclean=0; if (preg_match('/^newLT/', $value)) $qualifiedforclean=0; - if (preg_match('/^LT\d/', $value)) $qualifiedforclean=0; + if (preg_match('/^LT[0-9]/', $value)) $qualifiedforclean=0; if (preg_match('/^TypeContact_contrat_/', $value)) $qualifiedforclean=0; if (preg_match('/^ErrorPriceExpression/', $value)) $qualifiedforclean=0; if (preg_match('/^Language_/', $value)) $qualifiedforclean=0; @@ -315,7 +315,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a // orders if (preg_match('/^OrderSource/', $value)) $qualifiedforclean=0; if (preg_match('/^TypeContact_/', $value)) $qualifiedforclean=0; - // other.lang + // other.lang if (preg_match('/^Notify_/', $value)) $qualifiedforclean=0; if (preg_match('/^PredefinedMail/', $value)) $qualifiedforclean=0; if (preg_match('/^DemoCompany/', $value)) $qualifiedforclean=0; @@ -336,17 +336,17 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a if (preg_match('/OppStatus/', $value)) $qualifiedforclean=0; if (preg_match('/AvailabilityType/', $value)) $qualifiedforclean=0; if (preg_match('/CardProduct/', $value)) $qualifiedforclean=0; - + if (preg_match('/sms/i', $value)) $qualifiedforclean=0; if (preg_match('/TF_/i', $value)) $qualifiedforclean=0; if (preg_match('/WithBankUsing/i', $value)) $qualifiedforclean=0; if (preg_match('/descWORKFLOW_/i', $value)) $qualifiedforclean=0; - + if (! $qualifiedforclean) { - continue; + continue; } - + //$search = '\'trans("'.$value.'")\''; $search = '-e "\''.$value.'\'" -e \'"'.$value.'"\' -e "('.$value.')" -e "('.$value.',"'; $string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*'; @@ -356,7 +356,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a $unused[$value] = $line; echo $line; // $trad contains the \n } - else + else { unset($output); //print 'X'.$output.'Y'; @@ -364,7 +364,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a } if (empty($unused)) print "No string not used found.\n"; - else + else { $filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang'; print "Strings in en_US that are never used are saved into file ".$filetosave.":\n"; diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index 647b571c788..92233d71b98 100755 --- a/dev/translation/strip_language_file.php +++ b/dev/translation/strip_language_file.php @@ -303,6 +303,8 @@ foreach($filesToProcess as $fileToProcess) // ----- Process output now ----- + //print "Found primary key = ".$key."\n"; + // Key not in other file if (in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)) { @@ -321,7 +323,7 @@ foreach($filesToProcess as $fileToProcess) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key) ) { - //print "Key $key differs so we add it into new secondary language (line: $cnt).\n"; + //print "Key $key differs (aSecondary=".$aSecondary[$key].", aPrimary=".$aPrimary[$key].", aEnglish=".$aEnglish[$key].") so we add it into new secondary language (line: $cnt).\n"; fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n"); } } diff --git a/doc/images/dolibarr_screenshot5_1920x1080_a.jpg b/doc/images/dolibarr_screenshot5_1920x1080_a.jpg new file mode 100644 index 00000000000..1c6e2cbdbdf Binary files /dev/null and b/doc/images/dolibarr_screenshot5_1920x1080_a.jpg differ diff --git a/doc/images/dolibarr_screenshot5_1920x1080_b.jpg b/doc/images/dolibarr_screenshot5_1920x1080_b.jpg new file mode 100644 index 00000000000..5f7d8a5b573 Binary files /dev/null and b/doc/images/dolibarr_screenshot5_1920x1080_b.jpg differ diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index e369081f7e1..5c4e836986e 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -37,7 +37,7 @@ $langs->load("salaries"); $mesg = ''; $action = GETPOST('action','aZ09'); -$cancel = GETPOST('cancel'); +$cancel = GETPOST('cancel','alpha'); $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); @@ -69,8 +69,8 @@ $arrayfields=array( 'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1), 'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0), - 'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0), - 'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0), + 'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'), + 'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'), 'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1) ); @@ -84,8 +84,8 @@ $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accounting * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction')) { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha')) { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -94,10 +94,10 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { if (! empty($cancel)) $action = ''; - + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers + + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $search_account = ""; $search_label = ""; @@ -106,13 +106,13 @@ if (empty($reshook)) $search_pcgsubtype = ""; $search_array_options=array(); } - + if (GETPOST('change_chart')) { $chartofaccounts = GETPOST('chartofaccounts', 'int'); - + if (! empty($chartofaccounts)) { - + if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { $error ++; } @@ -120,12 +120,12 @@ if (empty($reshook)) $error ++; } } - + if ($action == 'disable') { if ($accounting->fetch($id)) { $result = $accounting->account_desactivate($id); } - + $action = 'update'; if ($result < 0) { setEventMessages($accounting->error, $accounting->errors, 'errors'); @@ -179,7 +179,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); -} +} $sql .= $db->plimit($limit + 1, $offset); @@ -190,13 +190,14 @@ if ($resql) { $num = $db->num_rows($resql); - $params=''; + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; - if ($search_account) $params.= '&search_account='.urlencode($search_account); - if ($search_label) $params.= '&search_label='.urlencode($search_label); - if ($search_accountparent) $params.= '&search_accountparent='.urlencode($search_accountparent); - if ($search_pcgtype) $params.= '&search_pcgtype='.urlencode($search_pcgtype); - if ($search_pcgsubtype) $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($search_account) $param.= '&search_account='.urlencode($search_account); + if ($search_label) $param.= '&search_label='.urlencode($search_label); + if ($search_accountparent) $param.= '&search_accountparent='.urlencode($search_accountparent); + if ($search_pcgtype) $param.= '&search_pcgtype='.urlencode($search_pcgtype); + if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype); if ($optioncss != '') $param.='&optioncss='.$optioncss; @@ -209,11 +210,11 @@ if ($resql) print ''; print ''; print ''; - + $htmlbuttonadd = '' . $langs->trans("Addanaccount") . ''; - - print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd); - + + print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd, '', $limit); + // Box to select active chart of account print $langs->trans("Selectchartofaccounts") . " : "; print '"; print ''; - print '
'; + print '
'; print '
'; - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; print ''."\n"; @@ -259,13 +260,13 @@ if ($resql) print $searchpicto; print ''; print ''; - + print ''; if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder); - if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_type']['help']); + if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_subtype']['help']); if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -274,14 +275,14 @@ if ($resql) $accountparent = new AccountingAccount($db); $i=0; - while ($i < min($num, $limit)) + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); $accountstatic->id = $obj->rowid; $accountstatic->label = $obj->label; $accountstatic->account_number = $obj->account_number; - + print ''; // Account number @@ -310,7 +311,7 @@ if ($resql) $accountparent->id = $obj->rowid2; $accountparent->label = $obj->label2; $accountparent->account_number = $obj->account_number2; - + print "\n"; @@ -371,11 +372,11 @@ if ($resql) } print '' . "\n"; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; } - + print "
"; print $accountparent->getNomUrl(1); print "
"; print "
"; print ''; diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index ff908d6d066..9df72687da8 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -68,7 +68,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -602,6 +602,7 @@ if ($id) print '
'; print ''; + print '
'; print ''; // Form to add a new line @@ -1139,6 +1140,7 @@ if ($id) } print '
'; + print '
'; print '
'; } @@ -1148,7 +1150,6 @@ else * Show list of dictionary to show */ - $var=true; $lastlineisempty=false; print ''; print ''; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index fa3adf1301b..79a8a531ec9 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -37,10 +37,10 @@ $langs->load("accountancy"); $mesg = ''; $action = GETPOST('action','aZ09'); -$backtopage = GETPOST('backtopage'); +$backtopage = GETPOST('backtopage','alpha'); $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); -$cancel = GETPOST('cancel'); +$cancel = GETPOST('cancel','alpha'); // Security check @@ -52,7 +52,7 @@ $object = new AccountingAccount($db); * Action */ -if (GETPOST('cancel')) +if (GETPOST('cancel','alpha')) { $urltogo=$backtopage?$backtopage:dol_buildpath('/accountancy/admin/account.php',1); header("Location: ".$urltogo); @@ -63,7 +63,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) { if (! $cancel) { $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; - + dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result = $db->query($sql); $obj = $db->fetch_object($result); @@ -172,16 +172,16 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) } } else if ($action == 'delete' && $user->rights->accounting->chartofaccount) { $result = $object->fetch($id); - + if (! empty($object->id)) { $result = $object->delete($user); - + if ($result > 0) { header("Location: account.php"); exit; } } - + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -270,7 +270,7 @@ if ($action == 'create') { $head = accounting_prepare_head($object); // Edit mode - if ($action == 'update') + if ($action == 'update') { dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr'); @@ -327,7 +327,7 @@ if ($action == 'create') { print ''; } else { // View mode - $linkback = '' . $langs->trans("BackToChartofaccounts") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr'); diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index fd8c67246f4..b281078a6bf 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -35,7 +35,7 @@ $langs->load("accountancy"); $mesg = ''; $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); -$cancel = GETPOST('cancel'); +$cancel = GETPOST('cancel','alpha'); $action = GETPOST('action','aZ09'); $cat_id = GETPOST('account_category'); $selectcpt = GETPOST('cpt_bk', 'array'); @@ -46,7 +46,7 @@ if ($cat_id == 0) { } // Security check -if (! empty($user->rights->accountancy->chartofaccount)) +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } @@ -98,26 +98,38 @@ dol_fiche_head(); print '
'; // Category -print ''; +print ''; print ''; -if (! empty($cat_id)) +if (! empty($cat_id)) { $return = $accountingcategory->getAccountsWithNoCategory($cat_id); if ($return < 0) { setEventMessages(null, $accountingcategory->errors, 'errors'); } - print ''; + print ''; print ''; @@ -164,4 +176,4 @@ if ($action == 'display' || $action == 'delete') { llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index e71482b0efa..fbacabda5d1 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -1,16 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand - * Copyright (C) 2011 Remy Younes - * Copyright (C) 2012-2015 Marcos García - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2016 Alexandre Spangaro - * Copyright (C) 2015 Ferran Marcet - * Copyright (C) 2016 Raphaël Doursenaud +/* Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2011-2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,12 +42,12 @@ $langs->load("hrm"); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); -$id=GETPOST('id','int'); +$id=32; $rowid=GETPOST('rowid','alpha'); $code=GETPOST('code','alpha'); // Security access -if (! empty($user->rights->accountancy->chartofaccount)) +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } @@ -74,7 +64,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -100,7 +90,7 @@ $tablib[32]= "DictionaryAccountancyCategory"; // Requests to extract data $tabsql=array(); -$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; +$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -108,15 +98,15 @@ $tabsqlsort[32]="position ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country"; +$tabfield[32]= "code,label,range_account,category_type,formula,position,country"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country"; +$tabfieldvalue[32]= "code,label,range_account,category_type,formula,position,country_id"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; +$tabfieldinsert[32]= "code,label,range_account,category_type,formula,position,fk_country"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on @@ -167,24 +157,17 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory - if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory if ($value == 'formula' && empty($_POST['formula'])) continue; - if ((! isset($_POST[$value]) || $_POST[$value]=='') - && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory - && (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10 - ) - ) + if ($value == 'range_account' && empty($_POST['range_account'])) continue; + if ($value == 'country') continue; // country_id required but not country + if (! isset($_POST[$value]) || $_POST[$value]=='') { $ok=0; $fieldnamekey=$listfield[$f]; // We take translate key of field if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label'; - if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments'; - if ($fieldnamekey == 'module') $fieldnamekey='Module'; if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; if ($fieldnamekey == 'note') $fieldnamekey = 'Note'; - if ($fieldnamekey == 'taux') $fieldnamekey = 'Rate'; if ($fieldnamekey == 'type') $fieldnamekey = 'Type'; if ($fieldnamekey == 'position') $fieldnamekey = 'Position'; if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated'; @@ -192,11 +175,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } } - // Other checks - if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { - $ok=0; - setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); - } if (isset($_POST["code"])) { if ($_POST["code"]=='0') @@ -210,17 +188,10 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; }*/ } - if (isset($_POST["country"]) && ($_POST["country"]=='0')) + if (isset($_POST["country"]) && ($_POST["country"] <= 0)) { - if (in_array($tablib[$id],array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries - { - $_POST["country"]=''; - } - else - { - $ok=0; - setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); - } + $ok=0; + setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); } // Clean some parameters @@ -262,14 +233,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i=0; foreach ($listfieldinsert as $f => $value) { - if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); - } - else if ($value == 'entity') { + if ($value == 'entity') { $_POST[$listfieldvalue[$i]] = $conf->entity; } if ($i) $sql.=","; - if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = '' + if ($_POST[$listfieldvalue[$i]] == '' && ! $listfieldvalue[$i] == 'formula') $sql.="null"; // For vat, we want/accept code = '' else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; $i++; } @@ -310,15 +278,15 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i = 0; foreach ($listfieldmodify as $field) { - if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + if ($field == 'fk_country' && $_POST['country'] > 0) { + $_POST[$listfieldvalue[$i]] = $_POST['country']; } else if ($field == 'entity') { $_POST[$listfieldvalue[$i]] = $conf->entity; } if ($i) $sql.=","; $sql.= $field."="; - if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = '' + if ($_POST[$listfieldvalue[$i]] == '' && ! $listfieldvalue[$i] == 'range_account') $sql.="null"; // For range_account, we want/accept code = '' else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; $i++; } @@ -458,11 +426,15 @@ $titlepicto='title_setup'; print load_fiche_titre($titre,$linkback,$titlepicto); +if ($id == 32) +{ + print $langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'

'; +} // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id>0?'&search_country_id='.$search_country_id:''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } //var_dump($elementList); @@ -508,6 +480,7 @@ if ($id) print ''; print ''; + print '
'; print '
' . $langs->trans("AccountingCategory") . '
' . $langs->trans("AccountingCategory") . ''; $formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 1); print ''; print '
' . $langs->trans("AddAccountFromBookKeepingWithNoCategories") . '
' . $langs->trans("AddAccountFromBookKeepingWithNoCategories") . ''; + + $arraykeyvalue=array(); + foreach($accountingcategory->lines_cptbk as $key => $val) + { + $arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' (' . $val->label_compte . ($val->doc_ref?' '.$val->doc_ref:'').')'; + } + if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) { - print ''; foreach ( $accountingcategory->lines_cptbk as $cpt ) { print ''; } print '
'; + print ajax_combobox('cpt_bk'); + */ print ' '; } print '
'; // Form to add a new line @@ -536,18 +509,15 @@ if ($id) { $valuetoshow=$langs->trans("Label"); } - if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } + if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments"); } if ($fieldlist[$field]=='country') { - if (in_array('region_id',$fieldlist)) { print ''; continue; } // For region page, we do not show the country input $valuetoshow=$langs->trans("Country"); } - if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; } if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); } if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); } if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); } if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } - if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); } - if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Direction"); } + if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Comment"); } if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); } if ($valuetoshow != '') @@ -617,8 +587,7 @@ if ($id) $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; - if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); - + if (GETPOST('from','alpha')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); // There is several pages if ($num > $listlimit) { @@ -700,8 +669,7 @@ if ($id) if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); } if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } - if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); } - if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Direction"); } + if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Comment"); } if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); } // Affiche nom du champ if ($showfield) @@ -742,6 +710,7 @@ if ($id) print '
'; print ''; print ''; + print ''; } else { @@ -759,17 +728,9 @@ if ($id) $showfield=1; $align="left"; $valuetoshow=$obj->{$fieldlist[$field]}; - if ($value == 'type_template') + if ($value == 'category_type') { - $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; - } - if ($value == 'element') - { - $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; - } - else if ($value == 'source') - { - $valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow; + $valuetoshow = yn($valuetoshow); } else if ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); @@ -785,12 +746,6 @@ if ($id) $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country); } } - else if ($fieldlist[$field]=='libelle_facture') { - $langs->load("bills"); - $key=$langs->trans("PaymentCondition".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - $valuetoshow=nl2br($valuetoshow); - } else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') { $key=$langs->trans("Country".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); @@ -804,83 +759,11 @@ if ($id) $key=$langs->trans("Action".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') { - $key=$langs->trans("Currency".strtoupper($obj->code_iso)); - $valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') { - $key=$langs->trans(strtoupper($obj->code)); - $valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') { - $key=$langs->trans(strtoupper($obj->code)); - $valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') { - $key=$langs->trans("Civility".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') { - $langs->load('agenda'); - $key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') { - $langs->load("bills"); - $key=$langs->trans("PaymentConditionShort".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') { - $langs->load("bills"); - $key=$langs->trans("PaymentType".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') { - $key=$langs->trans("DemandReasonType".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') { - $langs->load("orders"); - $key=$langs->trans($obj->code); - $valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]}; - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') { - $langs->load("sendings"); - $key=$langs->trans("SendingMethod".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format') - { - $key = $langs->trans('PaperFormat'.strtoupper($obj->code)); - $valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') - { - $langs->load('trips'); - $key = $langs->trans(strtoupper($obj->code)); - $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } - else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); - $valuetoshow=$langs->trans($obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); - $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); - } - else if (in_array($fieldlist[$field],array('recuperableonly'))) - { - $align="center"; - } - else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') { - $valuetoshow = length_accountg($valuetoshow); - } $class='tddict'; - if ($fieldlist[$field] == 'tracking') $class.=' tdoverflowauto'; // Show value for field if ($showfield) print ''; } @@ -891,14 +774,9 @@ if ($id) if (isset($obj->code)) { if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } - else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } - else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } - if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; } - if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; } $canbemodified=$iserasable; - if ($obj->code == 'RECEP') $canbemodified=1; $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if ($param) $url .= '&'.$param; @@ -909,10 +787,7 @@ if ($id) if ($canbedisabled) print ''.$actl[$obj->active].''; else { - if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); - else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); - else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); - else print $langs->trans("AlwaysActive"); + print $langs->trans("AlwaysActive"); } print ""; @@ -937,8 +812,8 @@ if ($id) print ''.$langs->trans("Setup").''; } print ''; - print "\n"; } + print "\n"; $i++; } } @@ -948,6 +823,7 @@ if ($id) } print '
 '.$valuetoshow.'
'; + print ''; print ''; } @@ -984,16 +860,17 @@ function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $contex { if ($fieldlist[$field] == 'country') { - if (in_array('region_id',$fieldlist)) - { - print ''; - //print join(',',$fieldlist); - print ''; - continue; - } // For state page, we do not show the country input (we link to region, not country) print ''; $fieldname='country'; - print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:$mysoc->country_code)), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone'); + if ($context == 'add') + { + $fieldname='country_id'; + print $form->select_country(GETPOST('country_id','int'), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone'); + } + else + { + print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:$mysoc->country_code)), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone'); + } print ''; } elseif ($fieldlist[$field] == 'country_id') @@ -1006,130 +883,14 @@ function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $contex print ''; } } - elseif ($fieldlist[$field] == 'region') - { - print ''; - $formcompany->select_region($region_id,'region'); + elseif ($fieldlist[$field] == 'category_type') { + print ''; + print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); print ''; } - elseif ($fieldlist[$field] == 'region_id') - { - $region_id = (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:0); - print ''; - print ''; - print ''; - } - elseif ($fieldlist[$field] == 'lang') - { - print ''; - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang'); - print ''; - } - // Le type de template - elseif ($fieldlist[$field] == 'type_template') - { - print ''; - print $form->selectarray('type_template', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - print ''; - } - // Le type de l'element (pour les type de contact) - elseif ($fieldlist[$field] == 'element') - { - print ''; - print $form->selectarray('element', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - print ''; - } - // La source de l'element (pour les type de contact) - elseif ($fieldlist[$field] == 'source') - { - print ''; - print $form->selectarray('source', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - print ''; - } - elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") - { - print ''; - print 'user'; - print ''; - } - elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { - if ($fieldlist[$field] == 'type_cdr') print ''; - else print ''; - if ($fieldlist[$field] == 'type_cdr') { - print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - } else { - print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); - } - print ''; - } - elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) { - $align="left"; - if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="center"; // Fields aligned on right - print ''; - print ''; - print ''; - } - elseif (in_array($fieldlist[$field], array('libelle_facture'))) { - print ''; - } - elseif (in_array($fieldlist[$field], array('content'))) - { - if ($tabname == MAIN_DB_PREFIX.'c_email_templates') - { - print ''; // To create an artificial CR for the current tr we are on - } - else print ''; - if ($context != 'hide') - { - //print ''; - $okforextended=true; - if ($tabname == MAIN_DB_PREFIX.'c_email_templates' && empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended=false; - $doleditor = new DolEditor($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_5, '90%'); - print $doleditor->Create(1); - } - else print ' '; - print ''; - } - elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { - print ''; - } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { print ''; } - elseif ($fieldlist[$field]=='unit') { - print ''; - $units = array( - 'mm' => $langs->trans('SizeUnitmm'), - 'cm' => $langs->trans('SizeUnitcm'), - 'point' => $langs->trans('SizeUnitpoint'), - 'inch' => $langs->trans('SizeUnitinch') - ); - print $form->selectarray('unit', $units, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 0, 0, 0); - print ''; - } - // Le type de taxe locale - elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type') - { - print ''; - print $form->selectarray($fieldlist[$field], $localtax_typeList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - print ''; - } - elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') - { - print ''; - if (! empty($conf->accounting->enabled)) - { - $fieldname = $fieldlist[$field]; - $accountancy_account = (! empty($obj->$fieldname) ? $obj->$fieldname : 0); - print $formaccounting->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone'); - } - else - { - $fieldname = $fieldlist[$field]; - print ''; - } - print ''; - } else { print ''; @@ -1137,8 +898,7 @@ function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $contex if ($fieldlist[$field]=='code') $class='maxwidth100'; if ($fieldlist[$field]=='position') $class='maxwidth50'; if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent'; - if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent'; - if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" '; + if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='category_type') $size='size="2" '; print ''; print ''; } diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 227949a3c1c..ce99bd6296c 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -1,11 +1,11 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ */ /** - * \file htdocs/accountancy/admin/index.php + * \file htdocs/accountancy/admin/defaultaccounts.php * \ingroup Advanced accountancy * \brief Setup page to configure accounting expert module */ @@ -42,7 +42,7 @@ $langs->load("salaries"); $langs->load("loan"); // Security check -if (! empty($user->rights->accountancy->chartofaccount)) +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } @@ -53,10 +53,10 @@ $action = GETPOST('action', 'alpha'); $list_account_main = array ( 'ACCOUNTING_ACCOUNT_CUSTOMER', 'ACCOUNTING_ACCOUNT_SUPPLIER', + 'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT', ); $list_account = array ( - 'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT', 'ACCOUNTING_PRODUCT_BUY_ACCOUNT', 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT', 'ACCOUNTING_SERVICE_BUY_ACCOUNT', diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index cdec35415fd..433448fa688 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -38,7 +38,7 @@ $langs->load("admin"); $langs->load("accountancy"); // Security check -if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount)) +if (empty($user->admin) && empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } @@ -47,7 +47,7 @@ $action = GETPOST('action', 'alpha'); // Parameters ACCOUNTING_EXPORT_* $main_option = array ( - 'ACCOUNTING_EXPORT_PREFIX_SPEC' + 'ACCOUNTING_EXPORT_PREFIX_SPEC' ); $model_option = array ( @@ -67,10 +67,10 @@ $model_option = array ( */ if ($action == 'update') { $error = 0; - + $format = GETPOST('format', 'alpha'); $modelcsv = GETPOST('modelcsv', 'int'); - + if (! empty($format)) { if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', $format, 'chaine', 0, '', $conf->entity)) { $error ++; @@ -78,7 +78,7 @@ if ($action == 'update') { } else { $error ++; } - + if (! empty($modelcsv)) { if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { $error ++; @@ -89,23 +89,23 @@ if ($action == 'update') { } else { $error ++; } - + foreach ( $main_option as $constname ) { $constvalue = GETPOST($constname, 'alpha'); - + if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error ++; } } - + foreach ( $model_option as $constname ) { $constvalue = GETPOST($constname, 'alpha'); - + if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error ++; } } - + if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -148,13 +148,13 @@ $var = ! $var; $num = count($main_option); if ($num) { foreach ( $main_option as $key ) { - + print ''; - + // Param $label = $langs->trans($key); print '' . $label . ''; - + // Value print ''; print ''; @@ -187,7 +187,7 @@ if (! $conf->use_javascript_ajax) { print ''; $listmodelcsv = AccountancyExport::getType(); print $form->selectarray("modelcsv", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0); - + print ''; } print ""; @@ -205,12 +205,12 @@ if ($num2) { print ''; print '' . $langs->trans('OtherOptions') . ''; print "\n"; - - if ($conf->global->ACCOUNTING_EXPORT_MODELCSV > 1) + + if ($conf->global->ACCOUNTING_EXPORT_MODELCSV > AccountancyExport::$EXPORT_TYPE_NORMAL) { print '' . $langs->trans('OptionsDeactivatedForThisExportModel') . ''; } - + print ''; print '' . $langs->trans("Selectformat") . ''; if (! $conf->use_javascript_ajax) { @@ -224,24 +224,24 @@ if ($num2) { 'txt' => $langs->trans("txt") ); print $form->selectarray("format", $listformat, $conf->global->ACCOUNTING_EXPORT_FORMAT, 0); - + print ''; } print ""; - - foreach ( $model_option as $key ) { + + foreach ( $model_option as $key ) { print ''; - + // Param $label = $langs->trans($key); print '' . $label . ''; - + // Value print ''; print ''; print ''; } - + print "\n"; } diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 7a8ab0673a7..78c6510469b 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -20,6 +20,7 @@ * \ingroup Advanced accountancy * \brief Page to show a fiscal year */ + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php'; @@ -43,10 +44,10 @@ $id = GETPOST('id', 'int'); // List of statut static $tmpstatut2label = array ( '0' => 'OpenFiscalYear', - '1' => 'CloseFiscalYear' + '1' => 'CloseFiscalYear' ); $statut2label = array ( - '' + '' ); foreach ( $tmpstatut2label as $key => $val ) $statut2label[$key] = $langs->trans($val); @@ -69,7 +70,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") { } else { setEventMessages($object->error, $object->errors, 'errors'); } -} +} else if ($action == 'add') { if (! GETPOST('cancel', 'alpha')) { @@ -113,7 +114,7 @@ else if ($action == 'add') { header("Location: ./fiscalyear.php"); exit(); } -} +} // Update record else if ($action == 'update') { @@ -126,7 +127,7 @@ else if ($action == 'update') { $object->statut = GETPOST('statut', 'int'); $result = $object->update($user); - + if ($result > 0) { header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit(); @@ -145,13 +146,13 @@ else if ($action == 'update') { * View */ +$form = new Form($db); + $title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card"); $helpurl = ""; llxHeader("",$title,$helpurl); -$form = new Form($db); - -if ($action == 'create') +if ($action == 'create') { print load_fiche_titre($langs->trans("NewFiscalYear")); @@ -184,7 +185,7 @@ if ($action == 'create') print $form->selectarray('statut', $statut2label, GETPOST('statut')); print ''; */ - + print ''; dol_fiche_end(); @@ -306,9 +307,9 @@ if ($action == 'create') print ''; } } diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index ead997a5d8c..b6aceb52ad4 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -266,7 +266,7 @@ if (! empty($user->admin)) } -// Param a user $user->rights->accountancy->chartofaccount can access +// Param a user $user->rights->accounting->chartofaccount can access foreach ($list as $key) { print ''; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 3dc932dbab5..fd988f9c637 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -41,7 +41,7 @@ $rowid=GETPOST('rowid','alpha'); $code=GETPOST('code','alpha'); // Security access -if (! empty($user->rights->accountancy->chartofaccount)) +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } @@ -58,7 +58,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -134,6 +134,7 @@ $elementList = array(); '2' => $langs->trans('AccountingJournalType2'), '3' => $langs->trans('AccountingJournalType3'), '4' => $langs->trans('AccountingJournalType4'), + '5' => $langs->trans('AccountingJournalType5'), '9' => $langs->trans('AccountingJournalType9') ); @@ -422,6 +423,7 @@ if ($id) print ''; print ''; + print '
'; print ''; // Form to add a new line @@ -488,7 +490,7 @@ if ($id) if (empty($reshook)) { - fieldList($fieldlist,$obj,$tabname[$id],'add'); + fieldListJournal($fieldlist,$obj,$tabname[$id],'add'); } print '
'; @@ -593,7 +595,7 @@ if ($id) $error=$hookmanager->error; $errors=$hookmanager->errors; // Show fields - if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); + if (empty($reshook)) fieldListJournal($fieldlist,$obj,$tabname[$id],'edit'); print ''; print ''; @@ -690,6 +692,7 @@ if ($id) } print '
'; + print '
'; print ''; } @@ -710,7 +713,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldList($fieldlist, $obj='', $tabname='', $context='') +function fieldListJournal($fieldlist, $obj='', $tabname='', $context='') { global $conf,$langs,$db; global $form, $mysoc; @@ -743,4 +746,4 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') print ''; } } -} \ No newline at end of file +} diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 311aab692ff..bebca87404c 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -90,15 +90,15 @@ $arrayfields=array(); * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $search_ref = ''; $search_label = ''; @@ -312,6 +312,7 @@ if ($result) $texte=$langs->trans("ListOfProductsServices"); print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); + print '
'; print ''; print ''; @@ -336,17 +337,17 @@ if ($result) print ''; print ''; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); - if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("OnSell"), $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("OnBuy"), $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); + if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder); if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { $fieldtosortaccount="p.accountancy_code_buy"; } else $fieldtosortaccount="p.accountancy_code_sell"; - print_liste_field_titre($langs->trans("CurrentDedicatedAccountingAccount"), $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("AssignDedicatedAccountingAccount")); + print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("AssignDedicatedAccountingAccount"); $clickpitco=$form->showCheckAddButtons('checkforselect', 1); print_liste_field_titre($clickpitco, '', '', '', '', 'align="center"'); print ''; @@ -448,6 +449,7 @@ if ($result) $i ++; } print '
'; + print '
'; // Example : Adding jquery code print ''; @@ -827,13 +815,15 @@ if (empty($action) || $action == 'view') { print '
'; $i = 0; + print '
'; print ""; print ""; print ""; print ""; - print ""; + print ""; print ""; - print ""; + print ""; + print ""; print ""; print ""; print ""; @@ -844,149 +834,43 @@ if (empty($action) || $action == 'view') { foreach ( $tabpay as $key => $val ) { // $key is rowid in llx_bank $date = dol_print_date($db->jdate($val["date"]), 'day'); - $reflabel = $val["ref"]; - if ($reflabel == '(SupplierInvoicePayment)') { - $reflabel = $langs->trans('Supplier'); - } - if ($reflabel == '(CustomerInvoicePayment)') { - $reflabel = $langs->trans('Customer'); - } - if ($reflabel == '(SocialContributionPayment)') { - $reflabel = $langs->trans('SocialContribution'); - } - if ($reflabel == '(DonationPayment)') { - $reflabel = $langs->trans('Donation'); - } - if ($reflabel == '(SubscriptionPayment)') { - $reflabel = $langs->trans('Subscription'); - } - if ($reflabel == '(ExpenseReportPayment)') { - $reflabel = $langs->trans('Employee'); - } + $ref = getSourceDocRef($val, $tabtype[$key]); - $ref=$reflabel; - if ($tabtype[$key] == 'payment') - { - $sqlmid = 'SELECT payfac.fk_facture as id'; - $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac"; - $sqlmid .= " WHERE payfac.fk_paiement=" . $val["paymentid"]; - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) { - $objmid = $db->fetch_object($resultmid); - $invoicestatic->fetch($objmid->id); - $ref=$langs->trans("Invoice").' '.$invoicestatic->getNomUrl(1); - } - else dol_print_error($db); - } - elseif ($tabtype[$key] == 'payment_supplier') - { - $sqlmid = 'SELECT payfac.fk_facturefourn as id'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfac"; - $sqlmid .= " WHERE payfac.fk_paiementfourn=" . $val["paymentsupplierid"]; - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) { - $objmid = $db->fetch_object($resultmid); - $invoicesupplierstatic->fetch($objmid->id); - $ref=$langs->trans("SupplierInvoice").' '.$invoicesupplierstatic->getNomUrl(1); - } - else dol_print_error($db); - } - elseif ($tabtype[$key] == 'payment_expensereport') - { - $sqlmid = 'SELECT payer.fk_expensereport as id'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_expensereport as payer"; - $sqlmid .= " WHERE payer.fk_expensereport=" . $val["fk_expensereport"]; - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) { - $objmid = $db->fetch_object($resultmid); - $expensereportstatic->fetch($objmid->id); - $ref=$langs->trans("ExpenseReport").' '.$expensereportstatic->getNomUrl(1); - } - else dol_print_error($db); - } - elseif ($tabtype[$key] == 'payment_vat') - { - $sqlmid = 'SELECT v.rowid as id'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "tva as v"; - $sqlmid .= " WHERE v.rowid=" . $val["paymentvatid"]; - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) { - $objmid = $db->fetch_object($resultmid); - $vatstatic->fetch($objmid->id); - $ref=$langs->trans("PaymentVat").' '.$vatstatic->getNomUrl(1); - } - else dol_print_error($db); - } - elseif ($tabtype[$key] == 'payment_donation') - { - $sqlmid = 'SELECT payd.fk_donation as id'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_donation as payd"; - $sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"]; - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) { - $objmid = $db->fetch_object($resultmid); - $donationstatic->fetch($objmid->id); - $ref=$langs->trans("Donation").' '.$donationstatic->getNomUrl(1); - } - else dol_print_error($db); - } - elseif ($tabtype[$key] == 'payment_salary') - { - $sqlmid = 'SELECT s.rowid as id'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_salary as s"; - $sqlmid .= " WHERE s.rowid=" . $val["paymentsalid"]; - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) { - $objmid = $db->fetch_object($resultmid); - $salarystatic->fetch($objmid->id); - $ref=$langs->trans("SalaryPayment").' '.$salarystatic->getNomUrl(1); - } - else dol_print_error($db); - } - elseif ($tabtype[$key] == 'payment_various') - { - $sqlmid = 'SELECT v.rowid as id'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_various as v"; - $sqlmid .= " WHERE v.rowid=" . $val["paymentvariousid"]; - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) { - $objmid = $db->fetch_object($resultmid); - $variousstatic->fetch($objmid->id); - $ref=$variousstatic->getNomUrl(1); - } - else dol_print_error($db); - } - - /*$invoicestatic->id = $key; - $invoicestatic->ref = $val["ref"]; - $invoicestatic->type = $val["type"];*/ // Bank foreach ( $tabbq[$key] as $k => $mt ) { + //var_dump($tabpay[$key]); + print ''; print ''; - print ""; + print ""; print ""; print ""; + // Ledger account print ""; - if ($val['soclib'] == '') { - print ""; - } else { - print ""; + // Subledger account + print ""; + print ""; print ""; print ""; print ""; @@ -997,17 +881,60 @@ if (empty($action) || $action == 'view') { if (is_array($tabtp[$key])) { foreach ( $tabtp[$key] as $k => $mt ) { if ($k != 'type') { + print ''; print ''; - print ""; + print ""; print ""; print ""; + // Ledger account print ""; + // Subledger account + print ""; print ""; print ""; @@ -1018,19 +945,30 @@ if (empty($action) || $action == 'view') { } } else { foreach ( $tabbq[$key] as $k => $mt ) { + print ''; print ''; - print ""; + print ""; print ""; print ""; + // Ledger account print ""; + // Subledger account + print ""; print ""; - print ""; + print ""; print ""; print ""; print ""; @@ -1039,8 +977,163 @@ if (empty($action) || $action == 'view') { } print "
" . $langs->trans("Date") . "" . $langs->trans("Piece") . ' (' . $langs->trans("InvoiceRef") . ")" . $langs->trans("Piece") . ' (' . $langs->trans("ObjectsRef") . ")" . $langs->trans("AccountAccounting") . "" . $langs->trans("Type") . "" . $langs->trans("SubledgerAccount") . "" . $langs->trans("Label") . "" . $langs->trans("PaymentMode") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
" . $date . "" . $ref . ""; - $accountoshow = length_accountg($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + $accounttoshow = length_accountg($k); + if (empty($accounttoshow) || $accounttoshow == 'NotDefined') { print ''.$langs->trans("BankAccountNotDefined").''; } - else print $accountoshow; + else print $accounttoshow; print "" . $bankstatic->label . " - " . $reflabel . "" . $bankstatic->label . " - " . $val['soclib'] . ""; + /*$accounttoshow = length_accountg($k); + if (empty($accounttoshow) || $accounttoshow == 'NotDefined') + { + print ''.$langs->trans("BankAccountNotDefined").''; } + else print $accounttoshow;*/ + print ""; + //var_dump($tabpay[$key]); + print $langs->trans("Bank"); + print ' '.$val['bank_account_ref']; + if (! empty($val['soclib'])) { + print " - " . $val['soclib']; + } + print "" . $val["type_payment"] . "" . ($mt >= 0 ? price($mt) : '') . "" . ($mt < 0 ? price(- $mt) : '') . "
" . $date . "" . $ref . ""; - $accountoshow = length_accounta($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + $account_ledger = $k; + // Try to force general ledger account depending on type + if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; + if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; + if ($tabtype[$key] == 'payment_expensereport') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; + if ($tabtype[$key] == 'payment_salary') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; + if ($tabtype[$key] == 'payment_vat') $account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT; + $accounttoshow = length_accounta($account_ledger); + if (empty($accounttoshow) || $accounttoshow == 'NotDefined') { - print ''.$langs->trans("ThirdpartyAccountNotDefined").''; + if ($tabtype[$key] == 'unknown') + { + // We will accept writing, but into a waiting account + print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will a waiting account + } + else + { + // We will refuse writing + $errorstring='UnknownAccountForThirdpartyBlocking'; + if ($tabtype[$key] == 'payment') $errorstring='MainAccountForCustomersNotDefined'; + if ($tabtype[$key] == 'payment_supplier') $errorstring='MainAccountForSuppliersNotDefined'; + if ($tabtype[$key] == 'payment_expensereport') $errorstring='MainAccountForUsersNotDefined'; + if ($tabtype[$key] == 'payment_salary') $errorstring='MainAccountForUsersNotDefined'; + if ($tabtype[$key] == 'payment_vat') $errorstring='MainAccountForVatPaymentNotDefined'; + print ''.$langs->trans($errorstring).''; + } + } + else print $accounttoshow; + print ""; + if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary'))) // Type of payment with subledger + { + $accounttoshowsubledger = length_accounta($k); + if ($accounttoshow != $accounttoshowsubledger) + { + if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') + { + /*var_dump($tabpay[$key]); + var_dump($tabtype[$key]); + var_dump($tabbq[$key]);*/ + //print ''.$langs->trans("ThirdpartyAccountNotDefined").''; + print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown").''; + } + else print $accounttoshowsubledger; + } } - else print $accountoshow; print "" . $reflabel . ' ' . $val['soclib'] . "" . $val["type_payment"] . "
" . $date . "" . $ref . ""; - if (empty($accountoshow) || $accountoshow == 'NotDefined') + /*if (empty($accounttoshow) || $accounttoshow == 'NotDefined') + { + print ''.$langs->trans("WaitAccountNotDefined").''; + } + else */ print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE); + print ""; + /*if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') { print ''.$langs->trans("WaitAccountNotDefined").''; } else print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE); + */ print "" . $reflabel . " " . $val["type_payment"] . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "
"; + print '
'; llxFooter(); } $db->close(); + + + +/** + * Return source for doc_ref of a bank transaction + * + * @param string $val Array of val + * @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...) + * @return string|unknown + */ +function getSourceDocRef($val, $typerecord) +{ + global $db, $langs; + + // Defined the docref into $ref (We start with $val['ref'] by default and we complete according to other data) + // WE MUST HAVE SAME REF FOR ALL LINES WE WILL RECORD INTO THE BOOKKEEPING + $reflabel = $val['ref']; + if ($reflabel == '(SupplierInvoicePayment)' || $reflabel == '(SupplierInvoicePaymentBack)') { + $reflabel = $langs->trans('Supplier'); + } + if ($reflabel == '(CustomerInvoicePayment)' || $reflabel == '(CustomerInvoicePaymentBack)') { + $reflabel = $langs->trans('Customer'); + } + if ($reflabel == '(SocialContributionPayment)') { + $reflabel = $langs->trans('SocialContribution'); + } + if ($reflabel == '(DonationPayment)') { + $reflabel = $langs->trans('Donation'); + } + if ($reflabel == '(SubscriptionPayment)') { + $reflabel = $langs->trans('Subscription'); + } + if ($reflabel == '(ExpenseReportPayment)') { + $reflabel = $langs->trans('Employee'); + } + if ($reflabel == '(payment_salary)') { + $reflabel = $langs->trans('Employee'); + } + $ref=$reflabel; + if ($typerecord == 'payment') + { + $sqlmid = 'SELECT payfac.fk_facture as id, f.facnumber as ref'; + $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f"; + $sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=" . $val["paymentid"]; + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) { + $ref=$langs->trans("Invoice"); + while ($objmid = $db->fetch_object($resultmid)) + { + $ref.=' '.$objmid->ref; + } + } + else dol_print_error($db); + } + elseif ($typerecord == 'payment_supplier') + { + $sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref'; + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfac, ".MAIN_DB_PREFIX."facture_fourn as f"; + $sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=" . $val["paymentsupplierid"]; + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) { + $ref=$langs->trans("SupplierInvoice"); + while($objmid = $db->fetch_object($resultmid)) + { + $ref.=' '.$objmid->ref; + } + } + else dol_print_error($db); + } + elseif ($typerecord == 'payment_expensereport') + { + $sqlmid = 'SELECT e.rowid as id, e.ref'; + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_expensereport as pe, " . MAIN_DB_PREFIX . "expensereport as e"; + $sqlmid .= " WHERE pe.rowid=" . $val["paymentexpensereport"]." AND pe.fk_expensereport = e.rowid"; + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) { + $ref=$langs->trans("ExpenseReport"); + while($objmid = $db->fetch_object($resultmid)) + { + $ref.=' '.$objmid->ref; + } + } + else dol_print_error($db); + } + elseif ($typerecord == 'payment_salary') + { + $sqlmid = 'SELECT s.rowid as ref'; + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_salary as s"; + $sqlmid .= " WHERE s.rowid=" . $val["paymentsalid"]; + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) { + $ref=$langs->trans("SalaryPayment"); + while ($objmid = $db->fetch_object($resultmid)) + { + $ref.=' '.$objmid->ref; + } + } + else dol_print_error($db); + } + elseif ($typerecord == 'payment_vat') + { + $sqlmid = 'SELECT v.rowid as ref'; + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "tva as v"; + $sqlmid .= " WHERE v.rowid=" . $val["paymentvatid"]; + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) { + $ref=$langs->trans("PaymentVat"); + while ($objmid = $db->fetch_object($resultmid)) + { + $ref.=' '.$objmid->ref; + } + } + else dol_print_error($db); + } + elseif ($typerecord == 'payment_donation') + { + $sqlmid = 'SELECT payd.fk_donation as ref'; + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_donation as payd"; + $sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"]; + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) { + $ref=$langs->trans("Donation").' '; + while ($objmid = $db->fetch_object($resultmid)) + { + $ref.=' '.$objmid->ref; + } + } + else dol_print_error($db); + } + elseif ($typerecord == 'payment_various') + { + $sqlmid = 'SELECT v.rowid as ref'; + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_various as v"; + $sqlmid .= " WHERE v.rowid=" . $val["paymentvariousid"]; + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) { + $ref=$langs->trans("VariousPayment"); + while ($objmid = $db->fetch_object($resultmid)) + { + $ref.=' '.$objmid->ref; + } + } + else dol_print_error($db); + } + + return $ref; +} diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 1a18e89792a..f5ad584399e 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -2,7 +2,7 @@ /* Copyright (C) 2007-2010 Laurent Destailleur * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry @@ -36,12 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("trips"); +$langs->loadLangs(array("commercial", "compta","bills","other","accountancy","trips","errors")); $id_journal = GETPOST('id_journal', 'int'); $action = GETPOST('action','aZ09'); @@ -52,6 +47,8 @@ $date_startyear = GETPOST('date_startyear'); $date_endmonth = GETPOST('date_endmonth'); $date_endday = GETPOST('date_endday'); $date_endyear = GETPOST('date_endyear'); +$in_bookkeeping = GETPOST('in_bookkeeping'); +if ($in_bookkeeping == '') $in_bookkeeping = 'notyet'; $now = dol_now(); @@ -89,7 +86,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $idpays = $mysoc->country_id; $sql = "SELECT er.rowid, er.ref, er.date_debut as de,"; -$sql .= " erd.rowid as erdid, erd.comments, erd.total_ttc, erd.tva_tx, erd.total_ht, erd.total_tva, erd.fk_code_ventilation, erd.vat_src_code, "; +$sql .= " erd.rowid as erdid, erd.comments, erd.total_ht, erd.total_tva, erd.total_localtax1, erd.total_localtax2, erd.tva_tx, erd.total_ttc, erd.fk_code_ventilation, erd.vat_src_code, "; $sql .= " u.rowid as uid, u.firstname, u.lastname, u.accountancy_code as user_accountancy_account,"; $sql .= " f.accountancy_code, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; //$sql .= " ct.accountancy_code_buy as account_tva"; @@ -104,24 +101,31 @@ $sql .= " AND erd.fk_code_ventilation > 0"; $sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy if ($date_start && $date_end) $sql .= " AND er.date_debut >= '" . $db->idate($date_start) . "' AND er.date_debut <= '" . $db->idate($date_end) . "'"; +if ($in_bookkeeping == 'already') + $sql .= " AND er.rowid IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='expense_report')"; +if ($in_bookkeeping == 'notyet') + $sql .= " AND er.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='expense_report')"; $sql .= " ORDER BY er.date_debut"; -dol_syslog('accountancy/journal/expensereportsjournal.php:: $sql=' . $sql); +dol_syslog('accountancy/journal/expensereportsjournal.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { - $num = $db->num_rows($result); - - // Variables - $account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT)) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"); - $account_vat = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : $langs->trans("CodeNotDef"); $taber = array (); $tabht = array (); $tabtva = array (); $def_tva = array (); $tabttc = array (); + $tablocaltax1 = array (); + $tablocaltax2 = array (); $tabuser = array (); + $num = $db->num_rows($result); + + // Variables + $account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT)) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'; + $account_vat = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : 'NotDefined'; + $i = 0; while ( $i < $num ) { $obj = $db->fetch_object($result); @@ -132,6 +136,8 @@ if ($result) { $vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code?' ('.$obj->vat_src_code.')':''), $mysoc, $mysoc, 0); $compta_tva = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $account_vat); + $compta_localtax1 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); + $compta_localtax2 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); // Define array to display all VAT rates that use this accounting account $compta_tva if (price2num($obj->tva_tx) || ! empty($obj->vat_src_code)) @@ -143,9 +149,19 @@ if ($result) { $taber[$obj->rowid]["ref"] = $obj->ref; $taber[$obj->rowid]["comments"] = $obj->comments; $taber[$obj->rowid]["fk_expensereportdet"] = $obj->erdid; + + // Avoid warnings + if (! isset($tabttc[$obj->rowid][$compta_user])) $tabttc[$obj->rowid][$compta_user] = 0; + if (! isset($tabht[$obj->rowid][$compta_fees])) $tabht[$obj->rowid][$compta_fees] = 0; + if (! isset($tabtva[$obj->rowid][$compta_tva])) $tabtva[$obj->rowid][$compta_tva] = 0; + if (! isset($tablocaltax1[$obj->rowid][$compta_localtax1])) $tablocaltax1[$obj->rowid][$compta_localtax1] = 0; + if (! isset($tablocaltax2[$obj->rowid][$compta_localtax2])) $tablocaltax2[$obj->rowid][$compta_localtax2] = 0; + $tabttc[$obj->rowid][$compta_user] += $obj->total_ttc; $tabht[$obj->rowid][$compta_fees] += $obj->total_ht; $tabtva[$obj->rowid][$compta_tva] += $obj->total_tva; + $tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1; + $tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2; $tabuser[$obj->rowid] = array ( 'id' => $obj->uid, 'name' => dolGetFirstLastname($obj->firstname, $obj->lastname), @@ -163,7 +179,7 @@ if ($action == 'writebookkeeping') { $now = dol_now(); $error = 0; - foreach ($taber as $key => $val) + foreach ($taber as $key => $val) // Loop on each expense report { $errorforline = 0; @@ -174,7 +190,6 @@ if ($action == 'writebookkeeping') { { foreach ( $tabttc[$key] as $k => $mt ) { if ($mt) { - // get compte id and label $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_ref = $val["ref"]; @@ -184,11 +199,11 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = $val["fk_expensereportdet"]; $bookkeeping->subledger_account = $tabuser[$key]['user_accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['user_accountancy_code']; - $bookkeeping->label_operation = $tabuser[$key]['name']; $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; + $bookkeeping->label_operation = $tabuser[$key]['name']; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; - $bookkeeping->debit = ($mt <= 0) ? $mt : 0; + $bookkeeping->debit = ($mt <= 0) ? -$mt : 0; $bookkeeping->credit = ($mt > 0) ? $mt : 0; $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; @@ -200,7 +215,7 @@ if ($action == 'writebookkeeping') { { $error++; $errorforline++; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); } else { @@ -217,8 +232,6 @@ if ($action == 'writebookkeeping') { if (! $errorforline) { foreach ( $tabht[$key] as $k => $mt ) { - $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch(null, $k, true); if ($mt) { // get compte id and label $accountingaccount = new AccountingAccount($db); @@ -232,8 +245,8 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = $val["fk_expensereportdet"]; $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; - $bookkeeping->label_operation = $accountingaccount->label; $bookkeeping->numero_compte = $k; + $bookkeeping->label_operation = $accountingaccount->label; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt > 0) ? $mt : 0; @@ -248,7 +261,7 @@ if ($action == 'writebookkeeping') { { $error++; $errorforline++; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); } else { @@ -265,9 +278,15 @@ if ($action == 'writebookkeeping') { // VAT if (! $errorforline) { - // var_dump($tabtva); - foreach ( $tabtva[$key] as $k => $mt ) { - if ($mt) { + $listoftax=array(0, 1, 2); + foreach($listoftax as $numtax) + { + $arrayofvat = $tabtva; + if ($numtax == 1) $arrayofvat = $tablocaltax1; + if ($numtax == 2) $arrayofvat = $tablocaltax2; + + foreach ( $arrayofvat[$key] as $k => $mt ) { + if ($mt) { // get compte id and label $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -278,8 +297,8 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = $val["fk_expensereportdet"]; $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; - $bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]); $bookkeeping->numero_compte = $k; + $bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]); $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt > 0) ? $mt : 0; @@ -294,7 +313,7 @@ if ($action == 'writebookkeeping') { { $error++; $errorforline++; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); } else { @@ -303,6 +322,7 @@ if ($action == 'writebookkeeping') { setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } + } } } } @@ -323,7 +343,7 @@ if ($action == 'writebookkeeping') { } } - if (empty($error) && count($tabpay)) { + if (empty($error) && count($tabpay) > 0) { setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } elseif (count($tabpay) == $error) @@ -336,6 +356,21 @@ if ($action == 'writebookkeeping') { } $action=''; + + // Must reload data, so we make a redirect + if (count($tabpay) != $error) + { + $param='id_journal='.$id_journal; + $param.='&date_startday='.$date_startday; + $param.='&date_startmonth='.$date_startmonth; + $param.='&date_startyear='.$date_startyear; + $param.='&date_endday='.$date_endday; + $param.='&date_endmonth='.$date_endmonth; + $param.='&date_endyear='.$date_endyear; + $param.='&in_bookeeping='.$in_bookeeping; + header("Location: ".$_SERVER['PHP_SELF'].($param?'?'.$param:'')); + exit; + } } /* @@ -347,7 +382,7 @@ $form = new Form($db); $userstatic = new User($db); // Export -/*if ($action == 'export_csv') { +/*if ($action == 'exportcsv') { $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; @@ -463,29 +498,36 @@ if (empty($action) || $action == 'view') { $nomlink = ''; $periodlink = ''; $exportlink = ''; - $builddate = time(); + $builddate=dol_now(); $description.= $langs->trans("DescJournalOnlyBindedVisible").'
'; - $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); + $listofchoices=array('already'=>$langs->trans("AlreadyInGeneralLedger"), 'notyet'=>$langs->trans("NotYetInGeneralLedger")); + $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("AlreadyInGeneralLedger").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1); $varlink = 'id_journal=' . $id_journal; journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); - /*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) { - print ''; - } else { - print ''; - }*/ - + // Button to write into Ledger + if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { + print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); + print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + } print '
'; - print ''; + if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { + print ''; + } + else { + print ''; + } + //print ''; print '
'; + // TODO Avoid using js. We can use a direct link with $param print ' '; @@ -570,13 +565,15 @@ if (empty($action) || $action == 'view') { print '
'; $i = 0; + print '
'; print ""; print ""; print ""; print ""; print ""; print ""; - print ""; + print ""; + print ""; print ""; print ""; print "\n"; @@ -584,19 +581,52 @@ if (empty($action) || $action == 'view') { $r = ''; $invoicestatic = new FactureFournisseur($db); + $companystatic = new Fournisseur($db); foreach ( $tabfac as $key => $val ) { $invoicestatic->id = $key; $invoicestatic->ref = $val["ref"]; + $invoicestatic->type = $val["type"]; $invoicestatic->ref = $val["refsologest"]; $invoicestatic->refsupplier = $val["refsuppliersologest"]; - $invoicestatic->type = $val["type"]; $invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32)); $date = dol_print_date($val["date"], 'day'); + // Third party + foreach ( $tabttc[$key] as $k => $mt ) { + print ''; + print ""; + print ""; + print ""; + $companystatic->id = $tabcompany[$key]['id']; + $companystatic->name = $tabcompany[$key]['name']; + $companystatic->supplier_code = $tabcompany[$key]['code_supplier']; + // Account + print "'; + // Subledger account + print "'; + print ""; + print '"; + print '"; + print ""; + } // Product / Service foreach ( $tabht[$key] as $k => $mt ) { $accountingaccount = new AccountingAccount($db); @@ -607,6 +637,7 @@ if (empty($action) || $action == 'view') { print ""; print ""; print ""; + // Account print ""; + // Subledger account + print "'; $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; print ""; - // print ""; print '"; print '"; print ""; @@ -626,54 +659,42 @@ if (empty($action) || $action == 'view') { } // VAT - foreach ( $tabtva[$key] as $k => $mt ) { - if ($mt) { + $listoftax = array(0, 1, 2); + foreach ($listoftax as $numtax) { + $arrayofvat = $tabtva; + if ($numtax == 1) $arrayofvat = $tablocaltax1; + if ($numtax == 2) $arrayofvat = $tablocaltax2; + + foreach ( $arrayofvat[$key] as $k => $mt ) { + if ($mt) { print ''; print ""; print ""; print ""; + // Account print ""; - print ""; + // Subledger account + print "'; + print ""; print '"; print '"; print ""; } - } - - // Third party - foreach ( $tabttc[$key] as $k => $mt ) { - print ''; - print ""; - print ""; - print ""; - $companystatic->id = $tabcompany[$key]['id']; - $companystatic->name = $tabcompany[$key]['name']; - print ""; - print ""; - // print ""; - print '"; - print '"; - print ""; } } print "
" . $langs->trans("Date") . "" . $langs->trans("Piece") . ' (' . $langs->trans("InvoiceRef") . ")" . $langs->trans("AccountAccounting") . "" . $langs->trans("Type") . "" . $langs->trans("SubledgerAccount") . "" . $langs->trans("Label") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
" . $date . "" . $invoicestatic->getNomUrl(1) . ""; + $accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER); + if (empty($accountoshow) || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("MainAccountForCustomersNotDefined").''; + } + else print $accountoshow; + print '"; + $accountoshow = length_accounta($k); + if (empty($accountoshow) || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("ThirdpartyAccountNotDefined").''; + } + else print $accountoshow; + print '" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("SubledgerAccount") . "' . ($mt < 0 ? - price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "
" . $date . "" . $invoicestatic->getNomUrl(1) . ""; $accountoshow = length_accountg($k); if (empty($accountoshow) || $accountoshow == 'NotDefined') @@ -615,10 +646,12 @@ if (empty($action) || $action == 'view') { } else print $accountoshow; print ""; + print '" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $accountingaccount->label . "" . $accountingaccount->label . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
" . $date . "" . $invoicestatic->getNomUrl(1) . ""; $accountoshow = length_accountg($k); if (empty($accountoshow) || $accountoshow == 'NotDefined') { - print ''.$langs->trans("VatAccountNotDefined").''; + print ''.$langs->trans("VATAccountNotDefined").''; } else print $accountoshow; print "" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]). ""; + print '" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).($numtax?' - Localtax '.$numtax:''); + print "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
" . $date . "" . $invoicestatic->getNomUrl(1) . ""; - $accountoshow = length_accounta($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("ThirdpartyAccountNotDefined").''; } - else print $accountoshow; - print "" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("subledger_account") . "" . $langs->trans("ThirdParty"); - // print ' (' . $companystatic->getNomUrl(0, 'supplier', 16) . ')'; - // print "' . ($mt < 0 ? - price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "
"; + print '
'; // End of page llxFooter(); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index cf92905e041..c5cd4f53910 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -2,7 +2,7 @@ /* Copyright (C) 2007-2010 Laurent Destailleur * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2013-2016 Florian Henry @@ -28,6 +28,7 @@ * \ingroup Advanced accountancy * \brief Page with sells journal */ + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; @@ -38,12 +39,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; -$langs->load("commercial"); -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); +$langs->loadLangs(array("commercial", "compta","bills","other","accountancy","errors")); $id_journal = GETPOST('id_journal', 'int'); $action = GETPOST('action','aZ09'); @@ -54,6 +50,8 @@ $date_startyear = GETPOST('date_startyear'); $date_endmonth = GETPOST('date_endmonth'); $date_endday = GETPOST('date_endday'); $date_endyear = GETPOST('date_endyear'); +$in_bookkeeping = GETPOST('in_bookkeeping'); +if ($in_bookkeeping == '') $in_bookkeeping = 'notyet'; $now = dol_now(); @@ -91,8 +89,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $idpays = $mysoc->country_id; -$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client,"; -$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,"; +$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr,"; +$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,"; $sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; //$sql .= " ct.accountancy_code_sell as account_tva"; @@ -113,6 +111,10 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND fd.product_type IN (0,1)"; if ($date_start && $date_end) $sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'"; +if ($in_bookkeeping == 'already') + $sql .= " AND f.rowid IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; +if ($in_bookkeeping == 'notyet') + $sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; $sql .= " ORDER BY f.datef"; dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG); @@ -123,13 +125,15 @@ if ($result) { $tabtva = array (); $def_tva = array (); $tabttc = array (); + $tablocaltax1 = array (); + $tablocaltax2 = array (); $tabcompany = array (); $num = $db->num_rows($result); // Variables - $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"); - $cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"); + $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'; + $cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : 'NotDefined'; $i = 0; while ( $i < $num ) { @@ -141,13 +145,15 @@ if ($result) { $compta_prod = $obj->compte; if (empty($compta_prod)) { if ($obj->product_type == 0) - $compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"); + $compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : 'NotDefined'; else - $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"); + $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : 'NotDefined'; } $vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code?' ('.$obj->vat_src_code.')':''), $mysoc, $mysoc, 0); $compta_tva = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); + $compta_localtax1 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); + $compta_localtax2 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); // Define array to display all VAT rates that use this accounting account $compta_tva if (price2num($obj->tva_tx) || ! empty($obj->vat_src_code)) @@ -172,6 +178,7 @@ if ($result) { // Invoice lines $tabfac[$obj->rowid]["date"] = $db->jdate($obj->df); + $tabfac[$obj->rowid]["datereg"] = $db->jdate($obj->dlr); $tabfac[$obj->rowid]["ref"] = $obj->facnumber; $tabfac[$obj->rowid]["type"] = $obj->type; $tabfac[$obj->rowid]["description"] = $obj->label_compte; @@ -181,10 +188,14 @@ if ($result) { if (! isset($tabttc[$obj->rowid][$compta_soc])) $tabttc[$obj->rowid][$compta_soc] = 0; if (! isset($tabht[$obj->rowid][$compta_prod])) $tabht[$obj->rowid][$compta_prod] = 0; if (! isset($tabtva[$obj->rowid][$compta_tva])) $tabtva[$obj->rowid][$compta_tva] = 0; + if (! isset($tablocaltax1[$obj->rowid][$compta_localtax1])) $tablocaltax1[$obj->rowid][$compta_localtax1] = 0; + if (! isset($tablocaltax2[$obj->rowid][$compta_localtax2])) $tablocaltax2[$obj->rowid][$compta_localtax2] = 0; $tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc * $situation_ratio; $tabht[$obj->rowid][$compta_prod] += $obj->total_ht * $situation_ratio; $tabtva[$obj->rowid][$compta_tva] += $obj->total_tva * $situation_ratio; + $tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1 * $situation_ratio; + $tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2 * $situation_ratio; $tabcompany[$obj->rowid] = array ( 'id' => $obj->socid, 'name' => $obj->name, @@ -203,7 +214,7 @@ if ($action == 'writebookkeeping') { $now = dol_now(); $error = 0; - foreach ( $tabfac as $key => $val ) { // Loop on each invoice + foreach ($tabfac as $key => $val) { // Loop on each invoice $errorforline = 0; @@ -230,6 +241,7 @@ if ($action == 'writebookkeeping') { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; + $bookkeeping->date_lim_reglement = $val["datereg"]; $bookkeeping->doc_ref = $val["ref"]; $bookkeeping->date_create = $now; $bookkeeping->doc_type = 'customer_invoice'; @@ -239,11 +251,11 @@ if ($action == 'writebookkeeping') { $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; $bookkeeping->subledger_label = ''; // TODO To complete $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("subledger_account"); + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount"); $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt >= 0) ? $mt : 0; - $bookkeeping->credit = ($mt < 0) ? $mt : 0; + $bookkeeping->credit = ($mt < 0) ? -$mt : 0; $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; @@ -254,7 +266,7 @@ if ($action == 'writebookkeeping') { { $error++; $errorforline++; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); } else { @@ -277,11 +289,12 @@ if ($action == 'writebookkeeping') { if ($accountingaccount->fetch(null, $k, true)) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; + $bookkeeping->date_lim_reglement = $val["datereg"]; $bookkeeping->doc_ref = $val["ref"]; $bookkeeping->date_create = $now; $bookkeeping->doc_type = 'customer_invoice'; $bookkeeping->fk_doc = $key; - $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add; + $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_client; $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; @@ -289,7 +302,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; - $bookkeeping->debit = ($mt < 0) ? $mt : 0; + $bookkeeping->debit = ($mt < 0) ? -$mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; @@ -301,7 +314,7 @@ if ($action == 'writebookkeeping') { { $error++; $errorforline++; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); } else { @@ -319,41 +332,50 @@ if ($action == 'writebookkeeping') { // var_dump($tabtva); if (! $errorforline) { - foreach ( $tabtva[$key] as $k => $mt ) { - if ($mt) { - $bookkeeping = new BookKeeping($db); - $bookkeeping->doc_date = $val["date"]; - $bookkeeping->doc_ref = $val["ref"]; - $bookkeeping->date_create = $now; - $bookkeeping->doc_type = 'customer_invoice'; - $bookkeeping->fk_doc = $key; - $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add - $bookkeeping->thirdparty_code = $companystatic->code_client; - $bookkeeping->subledger_account = ''; - $bookkeeping->subledger_label = ''; - $bookkeeping->numero_compte = $k; - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]); - $bookkeeping->montant = $mt; - $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; - $bookkeeping->debit = ($mt < 0) ? $mt : 0; - $bookkeeping->credit = ($mt >= 0) ? $mt : 0; - $bookkeeping->code_journal = $journal; - $bookkeeping->journal_label = $journal_label; - $bookkeeping->fk_user_author = $user->id; + $listoftax=array(0, 1, 2); + foreach($listoftax as $numtax) + { + $arrayofvat = $tabtva; + if ($numtax == 1) $arrayofvat = $tablocaltax1; + if ($numtax == 2) $arrayofvat = $tablocaltax2; - $result = $bookkeeping->create($user); - if ($result < 0) { - if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists - { - $error++; - $errorforline++; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); - } - else - { - $error++; - $errorforline++; - setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); + foreach ( $arrayofvat[$key] as $k => $mt ) { + if ($mt) { + $bookkeeping = new BookKeeping($db); + $bookkeeping->doc_date = $val["date"]; + $bookkeeping->date_lim_reglement = $val["datereg"]; + $bookkeeping->doc_ref = $val["ref"]; + $bookkeeping->date_create = $now; + $bookkeeping->doc_type = 'customer_invoice'; + $bookkeeping->fk_doc = $key; + $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add + $bookkeeping->thirdparty_code = $companystatic->code_client; + $bookkeeping->subledger_account = ''; + $bookkeeping->subledger_label = ''; + $bookkeeping->numero_compte = $k; + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]) . ($numtax?' - Localtax '.$numtax:''); + $bookkeeping->montant = $mt; + $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; + $bookkeeping->debit = ($mt < 0) ? -$mt : 0; + $bookkeeping->credit = ($mt >= 0) ? $mt : 0; + $bookkeeping->code_journal = $journal; + $bookkeeping->journal_label = $journal_label; + $bookkeeping->fk_user_author = $user->id; + + $result = $bookkeeping->create($user); + if ($result < 0) { + if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists + { + $error++; + $errorforline++; + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + } + else + { + $error++; + $errorforline++; + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); + } } } } @@ -390,6 +412,21 @@ if ($action == 'writebookkeeping') { } $action=''; + + // Must reload data, so we make a redirect + if (count($tabpay) != $error) + { + $param='id_journal='.$id_journal; + $param.='&date_startday='.$date_startday; + $param.='&date_startmonth='.$date_startmonth; + $param.='&date_startyear='.$date_startyear; + $param.='&date_endday='.$date_endday; + $param.='&date_endmonth='.$date_endmonth; + $param.='&date_endyear='.$date_endyear; + $param.='&in_bookeeping='.$in_bookeeping; + header("Location: ".$_SERVER['PHP_SELF'].($param?'?'.$param:'')); + exit; + } } @@ -401,7 +438,7 @@ if ($action == 'writebookkeeping') { $form = new Form($db); // Export -/*if ($action == 'export_csv') { +if ($action == 'exportcsv') { $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; @@ -409,119 +446,85 @@ $form = new Form($db); include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; $companystatic = new Client($db); + $invoicestatic = new Facture($db); - // Model Cegid Expert Export - if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) { - $sep = ";"; + foreach ( $tabfac as $key => $val ) + { + $companystatic->id = $tabcompany[$key]['id']; + $companystatic->name = $tabcompany[$key]['name']; + $companystatic->client = $tabcompany[$key]['code_client']; - foreach ( $tabfac as $key => $val ) { - $companystatic->id = $tabcompany[$key]['id']; - $companystatic->name = $tabcompany[$key]['name']; - $companystatic->client = $tabcompany[$key]['code_client']; + $invoicestatic->id = $key; + $invoicestatic->ref = $val["ref"]; - $invoicestatic->id = $key; - $invoicestatic->ref = $val["ref"]; + $date = dol_print_date($val["date"], 'day'); - $date = dol_print_date($val["date"], '%d%m%Y'); - - foreach ( $tabttc[$key] as $k => $mt ) { - print $date . $sep; - print $sell_journal . $sep; - print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep; - print length_accounta(html_entity_decode($k)) . $sep; - print ($mt < 0 ? 'C' : 'D') . $sep; - print ($mt <= 0 ? price(- $mt) : $mt) . $sep; - print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("subledger_account") . $sep; - print $val["ref"]; - print "\n"; - } - - // Product / Service - foreach ( $tabht[$key] as $k => $mt ) { - $accountingaccount_static = new AccountingAccount($db); - if ($accountingaccount_static->fetch(null, $k, true)) { - print $date . $sep; - print $sell_journal . $sep; - print length_accountg(html_entity_decode($k)) . $sep; - print $sep; - print ($mt < 0 ? 'D' : 'C') . $sep; - print ($mt <= 0 ? price(- $mt) : $mt) . $sep; - print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount_static->label . $sep; - print $val["ref"]; - print "\n"; - } - } - - // TVA - foreach ( $tabtva[$key] as $k => $mt ) { - if ($mt) { - print $date . $sep; - print $sell_journal . $sep; - print length_accountg(html_entity_decode($k)) . $sep; - print $sep; - print ($mt < 0 ? 'D' : 'C') . $sep; - print ($mt <= 0 ? price(- $mt) : $mt) . $sep; - print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . $sep; - // print $langs->trans("VAT") . $sep; - print $val["ref"]; - print "\n"; - } - } + // Third party + foreach ($tabttc[$key] as $k => $mt) { + print '"' . $key . '"' . $sep; + print '"' . $date . '"' . $sep; + print '"' . $val["ref"] . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep; + print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; + print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep; + print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; + print '"' . $langs->trans("Code_tiers") . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers") . '"' . $sep; + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; + print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; + print '"' . $sell_journal . '"'; + print "\n"; } - } elseif ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) { - // Model Classic Export - foreach ( $tabfac as $key => $val ) { - $companystatic->id = $tabcompany[$key]['id']; - $companystatic->name = $tabcompany[$key]['name']; - $companystatic->client = $tabcompany[$key]['code_client']; - $invoicestatic->id = $key; - $invoicestatic->ref = $val["ref"]; - - $date = dol_print_date($val["date"], 'day'); - - foreach ( $tabttc[$key] as $k => $mt ) { + // Product / Service + foreach ($tabht[$key] as $k => $mt) { + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch(null, $k, true); + if ($mt) { + print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; - print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("subledger_account") . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep; + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; + print " " . $sep; + print '"' . utf8_decode(dol_trunc($accountingaccount->label, 32)) . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; + print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; - print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; + print '"' . $sell_journal . '"'; print "\n"; } + } - // Product / Service - foreach ( $tabht[$key] as $k => $mt ) { - $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch(null, $k, true); + // VAT + $listoftax = array(0, 1, 2); + foreach ($listoftax as $numtax) { + $arrayofvat = $tabtva; + if ($numtax == 1) $arrayofvat = $tablocaltax1; + if ($numtax == 2) $arrayofvat = $tablocaltax2; + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { + print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($companystatic->name, 16) . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; - print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; - print '"' . ($mt >= 0 ? price($mt) : '') . '"'; - print "\n"; - } - } - - // VAT - foreach ( $tabtva[$key] as $k => $mt ) { - if ($mt) { - print '"' . $date . '"' . $sep; - print '"' . $val["ref"] . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . '"' . $sep; + print " " . $sep; + print '"' . $langs->trans("VAT") . ' - ' . $def_tva[$key] . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . join(', ',$def_tva[$key][$k]) . ($numtax?' - Localtax '.$numtax:'') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; - print '"' . ($mt >= 0 ? price($mt) : '') . '"'; + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; + print '"' . $sell_journal . '"'; print "\n"; } } } } } -*/ + if (empty($action) || $action == 'view') { @@ -532,50 +535,47 @@ if (empty($action) || $action == 'view') { $nomlink = ''; $periodlink = ''; $exportlink = ''; - $builddate = time(); - //$description = $langs->trans("DescSellsJournal") . '
'; + $builddate=dol_now(); $description.= $langs->trans("DescJournalOnlyBindedVisible").'
'; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); else $description .= $langs->trans("DepositsAreIncluded"); - $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); + + $listofchoices=array('already'=>$langs->trans("AlreadyInGeneralLedger"), 'notyet'=>$langs->trans("NotYetInGeneralLedger")); + $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("AlreadyInGeneralLedger").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1); $varlink = 'id_journal=' . $id_journal; journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); - /*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) { - print ''; - } else { - print ''; - }*/ - // Button to write into Ledger if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); - print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); } print '
'; if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { print ''; } else { - print ''; + print ''; } + print ''; print '
'; + // TODO Avoid using js. We can use a direct link with $param print ' '; @@ -585,12 +585,14 @@ if (empty($action) || $action == 'view') { print '
'; $i = 0; + print '
'; print ""; print ""; print ""; print ""; print ""; print ""; + print ""; print ""; print ""; print ""; @@ -616,7 +618,17 @@ if (empty($action) || $action == 'view') { print ""; $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; - $companystatic->client = $tabcompany[$key]['code_client']; + $companystatic->customer_code = $tabcompany[$key]['code_client']; + // Account + print "'; + // Subledger account print "'; - print ""; - print ""; - print ""; + print ""; + print '"; + print '"; print ""; } @@ -643,6 +653,7 @@ if (empty($action) || $action == 'view') { print ""; print ""; print ""; + // Account print ""; - // print ""; + // Subledger account + print "'; + $companystatic->id = $tabcompany[$key]['id']; + $companystatic->name = $tabcompany[$key]['name']; print ""; print ""; print ""; @@ -660,31 +675,42 @@ if (empty($action) || $action == 'view') { } // VAT - foreach ( $tabtva[$key] as $k => $mt ) { - if ($mt) { - print ''; - print ""; - print ""; - print ""; - print "'; + print ""; + print ""; + print ""; + // Account + print ""; + // Subledger account + print "'; + print ""; + print '"; + print '"; + print ""; } - else print $accountoshow; - print ""; - print ""; - // print ""; - print ""; - print ""; - print ""; } } } print "
" . $langs->trans("Date") . "" . $langs->trans("Piece") . ' (' . $langs->trans("InvoiceRef") . ")" . $langs->trans("AccountAccounting") . "" . $langs->trans("SubledgerAccount") . "" . $langs->trans("Label") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "" . $invoicestatic->getNomUrl(1) . ""; + $accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER); + if (empty($accountoshow) || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("MainAccountForCustomersNotDefined").''; + } + else print $accountoshow; + print '"; $accountoshow = length_accounta($k); if (empty($accountoshow) || $accountoshow == 'NotDefined') @@ -624,12 +636,10 @@ if (empty($action) || $action == 'view') { print ''.$langs->trans("ThirdpartyAccountNotDefined").''; } else print $accountoshow; - // print "" . $langs->trans("ThirdParty"); - // print ' (' . $companystatic->getNomUrl(0, 'customer', 16) . ')'; print '" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("subledger_account") . "" . ($mt >= 0 ? price($mt) : '') . "" . ($mt < 0 ? price(- $mt) : '') . "" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount") . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
" . $date . "" . $invoicestatic->getNomUrl(1) . ""; $accountoshow = length_accountg($k); if (empty($accountoshow) || $accountoshow == 'NotDefined') @@ -651,7 +662,11 @@ if (empty($action) || $action == 'view') { } else print $accountoshow; print "" . $accountingaccount->label . ""; + print '" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "
" . $date . "" . $invoicestatic->getNomUrl(1) . ""; - $accountoshow = length_accountg($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("VATAccountNotDefined").''; + $listoftax = array(0, 1, 2); + foreach ($listoftax as $numtax) { + $arrayofvat = $tabtva; + if ($numtax == 1) $arrayofvat = $tablocaltax1; + if ($numtax == 2) $arrayofvat = $tablocaltax2; + + foreach ( $arrayofvat[$key] as $k => $mt ) { + if ($mt) { + print '
" . $date . "" . $invoicestatic->getNomUrl(1) . ""; + $accountoshow = length_accountg($k); + if (empty($accountoshow) || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("VATAccountNotDefined").''; + } + else print $accountoshow; + print ""; + print '" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).($numtax?' - Localtax '.$numtax:''); + print "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "
" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]); - print "" . $langs->trans("VAT") . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "
"; + print '
'; // End of page llxFooter(); diff --git a/htdocs/accountancy/report/result.php b/htdocs/accountancy/report/result.php deleted file mode 100644 index 801ba0a2007..00000000000 --- a/htdocs/accountancy/report/result.php +++ /dev/null @@ -1,268 +0,0 @@ - - * Copyright (C) 2016 Alexandre Spangaro - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/accountancy/report/result.php - * \ingroup Advanced accountancy - * \brief Page for accounting result - */ -require '../../main.inc.php'; - -// Class -require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; - -$error = 0; - -// Langs -$langs->load("accountancy"); -$langs->load("compta"); - -$mesg = ''; -$action = GETPOST('action','aZ09'); -$cat_id = GETPOST('account_category'); -$selectcpt = GETPOST('cpt_bk'); -$id = GETPOST('id', 'int'); -$rowid = GETPOST('rowid', 'int'); -$cancel = GETPOST('cancel'); - -// Filter -$year = GETPOST('year','int'); -if ($year == 0) { - $year_current = strftime("%Y", time()); - $year_start = $year_current; -} else { - $year_current = $year; - $year_start = $year; -} - -if($cat_id == 0){ - $cat_id = null; -} - -// Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accounting->comptarapport->lire) - accessforbidden(); - -$AccCat = new AccountancyCategory($db); - - -/* - * View - */ - -llxheader('', $langs->trans('ReportInOut')); - -$formaccounting = new FormAccounting($db); -$form = new Form($db); - -$textprevyear = '' . img_previous() . ''; -$textnextyear = ' ' . img_next() . ''; - -print load_fiche_titre($langs->trans('ReportInOut'), $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, 'title_accountancy'); - -$moreforfilter=''; - -print '
'; -print ''."\n"; - -$months = array( $langs->trans("JanuaryMin"), - $langs->trans("FebruaryMin"), - $langs->trans("MarchMin"), - $langs->trans("AprilMin"), - $langs->trans("MayMin"), - $langs->trans("JuneMin"), - $langs->trans("JulyMin"), - $langs->trans("AugustMin"), - $langs->trans("SeptemberMin"), - $langs->trans("OctoberMin"), - $langs->trans("NovemberMin"), - $langs->trans("DecemberMin"), - ); - -print ''; -print ''; -print ''; -print ''; -print ''; -foreach($months as $k => $v){ - print ''; -} -print ''; - -$cats = $AccCat->getCatsCpts(); -if ($cats < 0) dol_print_error($db, $AccCat->error, $AccCat->errors); - -$catsCalcule = $AccCat->getCatsCal(); -if ($catsCalcule < 0) dol_print_error($db, $AccCat->error, $AccCat->errors); - -$j=1; -$sommes = array(); - -if (!empty($cats)) -{ - foreach ($cats as $name_cat => $cpts) - { - print ""; - print ''; - print "\n"; - $position = -1; - $code = -1; - foreach($cpts as $i => $cpt){ - - $position = $cpt['position']; - $code = $cpt['code']; - - $return = $AccCat->getResult($cpt['account_number'], 0, $year_current -1, $cpt['dc']); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultNP=0; - } else { - $resultNP=$AccCat->sdc; - } - - $return = $AccCat->getResult($cpt['account_number'], 0, $year_current, $cpt['dc']); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultN=0; - } else { - $resultN=$AccCat->sdc; - } - $sommes[$code]['NP'] += $resultNP; - $sommes[$code]['N'] += $resultN; - print ''; - print ''; - print ''; - print ''; - print ''; - - foreach($months as $k => $v){ - $return = $AccCat->getResult($cpt['account_number'], $k+1, $year_current, $cpt['dc']); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultM=0; - } else { - $resultM=$AccCat->sdc; - } - $sommes[$code]['M'][$k] += $resultM; - print ''; - } - - print "\n"; - } - - // If it's a calculated catgory - $p = $position + 1; - if(array_key_exists($p, $catsCalcule)){ - $formula = $catsCalcule[$p]['formula']; - - print ""; - print ''; - - $vars = array(); - - // Previous Fiscal year (N-1) - foreach($sommes as $code => $det){ - $vars[$code] = $det['NP']; - } - $result = strtr($formula, $vars); - eval( '$result = (' . $result . ');' ); - print ''; - $code = $catsCalcule[$p]['code']; // code categorie de calcule - $sommes[$code]['NP'] += $result; - - // Current fiscal year (N) - foreach($sommes as $code => $det){ - $vars[$code] = $det['N']; - } - $result = strtr($formula, $vars); - eval( '$result = (' . $result . ');' ); - print ''; - $sommes[$code]['N'] += $result; - - // Detail by month - foreach($months as $k => $v){ - foreach($sommes as $code => $det){ - $vars[$code] = $det['M'][$k]; - } - $result = strtr($formula, $vars); - eval( '$result = (' . $result . ');' ); - print ''; - $sommes[$code]['M'][$k] += $result; - } - - //print ''; - print "\n"; - unset($catsCalcule[$p]); // j'élimine la catégorie calculée après affichage - } - $j++; - } - - // Others calculed category - foreach($catsCalcule as $p => $catc) - { - $formula = $catsCalcule[$p]['formula']; - - print ""; - print ''; - - $vars = array(); - - // Previous Fiscal year (N-1) - foreach($sommes as $code => $det){ - $vars[$code] = $det['NP']; - } - $result = strtr($formula, $vars); - eval( '$result = (' . $result . ');' ); - print ''; - $code = $catsCalcule[$p]['code']; // code categorie de calcule - $sommes[$code]['NP'] += $result; - - // Current fiscal year (N) - foreach($sommes as $code => $det){ - $vars[$code] = $det['N']; - } - $result = strtr($formula, $vars); - eval( '$result = (' . $result . ');' ); - print ''; - $sommes[$code]['N'] += $result; - - // Detail by month - foreach($months as $k => $v){ - foreach($sommes as $code => $det){ - $vars[$code] = $det['M'][$k]; - } - $result = strtr($formula, $vars); - eval( '$result = (' . $result . ');' ); - print ''; - $sommes[$code]['M'][$k] += $result; - } - - //print ''; - print "\n"; - } -} - -print "
'.$langs->trans("Account").''.$langs->trans("Description").'N-1'.$langs->trans("NReal").''.$langs->trans($v).'
' . $name_cat . '
' . $cpt['account_number'] . '' . $cpt['name_cpt'] . '' . price($resultNP) . '' . price($resultN) . '' . price($resultM) . '
' . $catsCalcule[$p]['label'] . '' . price($result) . '' . price($result) . '' . price($result) . '' . $catsCalcule[$p]['formula'] . '
' . $catsCalcule[$p]['label'] . '' . price($result) . '' . price($result) . '' . price($result) . '' . $catsCalcule[$p]['formula'] . '
"; -print '
'; - -llxFooter(); -$db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index b73c40ced74..d36ae5e2543 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -22,9 +22,9 @@ * */ /** - * \file htdocs/accountancy/supplier/card.php - * \ingroup Accountancy - * \brief Card supplier ventilation + * \file htdocs/accountancy/supplier/card.php + * \ingroup Advanced accountancy + * \brief Card supplier ventilation */ require '../../main.inc.php'; @@ -44,7 +44,7 @@ $id = GETPOST('id'); if ($user->societe_id > 0) accessforbidden(); - + /* * Actions */ @@ -97,14 +97,14 @@ if (! empty($id)) { $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn "; $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; $sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy - + dol_syslog("/accounting/supplier/card.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); - + if ($result) { $num_lines = $db->num_rows($result); $i = 0; - + if ($num_lines) { $objp = $db->fetch_object($result); diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index fb5f28fc27d..74f071836aa 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -21,12 +21,13 @@ /** * \file htdocs/accountancy/supplier/index.php * \ingroup Advanced accountancy - * \brief Home supplier ventilation + * \brief Home supplier journalization page */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; // Langs $langs->load("compta"); @@ -55,7 +56,7 @@ if ($year == 0) { } // Validate History -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'aZ09'); /* @@ -93,6 +94,8 @@ if ($action == 'validatehistory') { $sql1 .= " AND fd.fk_code_ventilation = 0"; } + dol_syslog('htdocs/accountancy/supplier/index.php'); + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -102,29 +105,6 @@ if ($action == 'validatehistory') { $db->commit(); setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs'); } -} elseif ($action == 'fixaccountancycode') { - $error = 0; - $db->begin(); - - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd"; - $sql1 .= " SET fk_code_ventilation = 0"; - $sql1 .= ' WHERE fd.fk_code_ventilation NOT IN '; - $sql1 .= ' (SELECT accnt.rowid '; - $sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt'; - $sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst'; - $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; - - dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); - - $resql1 = $db->query($sql1); - if (! $resql1) { - $error ++; - $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); - } else { - $db->commit(); - setEventMessage($langs->trans('Done'), 'mesgs'); - } } elseif ($action == 'cleanaccountancycode') { $error = 0; $db->begin(); @@ -137,7 +117,7 @@ if ($action == 'validatehistory') { $sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")"; $sql1.= ")"; - dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); + dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG); $resql1 = $db->query($sql1); if (! $resql1) { @@ -159,45 +139,56 @@ llxHeader('', $langs->trans("SuppliersVentilation")); $textprevyear = '' . img_previous() . ''; $textnextyear = ' ' . img_next() . ''; -print load_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy'); +print load_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy'); print $langs->trans("DescVentilSupplier") . '
'; print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '
'; print '
'; -//print '
'; -// TODO Remove this. Should be done always. -if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '' . $langs->trans("CleanFixHistory", $year_current) . ''; -//print '
'; +// Clean database +$db->begin(); +$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd"; +$sql1 .= " SET fk_code_ventilation = 0"; +$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN '; +$sql1 .= ' (SELECT accnt.rowid '; +$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt'; +$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst'; +$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; +dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); +$resql1 = $db->query($sql1); +if (! $resql1) { + $error ++; + $db->rollback(); + setEventMessage($db->lasterror(), 'errors'); +} else { + $db->commit(); +} +// End clean database + + +$y = $year_current; $buttonbind = '' . $langs->trans("ValidateHistory") . ''; $buttonreset = '' . $langs->trans("CleanHistory", $year_current) . ''; - -$y = $year_current; - -$var = true; - - -print '
'; - print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); +print '
'; print ''; -print ''; +print ''; print ''; for($i = 1; $i <= 12; $i ++) { print ''; } print ''; -$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,"; -$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; +$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,"; +$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,"; for($i = 1; $i <= 12; $i ++) { $sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; } -$sql .= " ROUND(SUM(ffd.total_ht),2) as total"; +$sql .= " SUM(ffd.total_ht) as total"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation"; @@ -208,15 +199,27 @@ $sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We d $sql .= " AND aa.account_number IS NULL"; $sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; -dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql); +dol_syslog('htdocs/accountancy/supplier/index.php'); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); while ( $row = $db->fetch_row($resql)) { - print ''; - print ''; + print ''; + print ''; for($i = 2; $i <= 12; $i ++) { print ''; } @@ -229,8 +232,7 @@ if ($resql) { print $db->lasterror(); // Show last sql error } print "
' . $langs->trans("Account") . '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . length_accountg($row[0]) . '' . $row[1] . '
'; + if ($row[0] == 'tobind') + { + print $langs->trans("Unknown"); + } + else print length_accountg($row[0]); + print ''; + if ($row[0] == 'tobind') + { + print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); + } + else print $row[1]; + print '' . price($row[$i]) . '
\n"; - - +print '
'; print '
'; @@ -238,20 +240,21 @@ print '
'; print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), $buttonreset, ''); +print '
'; print ''; -print ''; +print ''; print ''; for($i = 1; $i <= 12; $i ++) { print ''; } print ''; -$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,"; -$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; +$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,"; +$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,"; for($i = 1; $i <= 12; $i ++) { $sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; } -$sql .= " ROUND(SUM(ffd.total_ht),2) as total"; +$sql .= " SUM(ffd.total_ht) as total"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation"; @@ -262,16 +265,28 @@ $sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We d $sql .= " AND aa.account_number IS NOT NULL"; $sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; -dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql); +dol_syslog('htdocs/accountancy/supplier/index.php'); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); while ( $row = $db->fetch_row($resql)) { - print ''; - print ''; - for($i = 2; $i <= 12; $i ++) { + print ''; + print ''; + for($i = 2; $i <= 12; $i ++) { print ''; } print ''; @@ -283,7 +298,7 @@ if ($resql) { print $db->lasterror(); // Show last sql error } print "
' . $langs->trans("Account") . '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . length_accountg($row[0]) . '' . $row[1] . '
'; + if ($row[0] == 'tobind') + { + print $langs->trans("Unknown"); + } + else print length_accountg($row[0]); + print ''; + if ($row[0] == 'tobind') + { + print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); + } + else print $row[1]; + print '' . price($row[$i]) . '' . price($row[13]) . '
\n"; - +print '
'; @@ -295,6 +310,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print_fiche_titre($langs->trans("OtherInfo"), '', ''); print "
\n"; + print '
'; print ''; print ''; for($i = 1; $i <= 12; $i ++) { @@ -306,7 +322,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. for($i = 1; $i <= 12; $i ++) { $sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; } - $sql .= " ROUND(SUM(ffd.total_ht),2) as total"; + $sql .= " SUM(ffd.total_ht) as total"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'"; @@ -314,7 +330,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. $sql .= " AND ff.fk_statut > 0 "; $sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy - dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql); + dol_syslog('htdocs/accountancy/supplier/index.php'); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -335,6 +351,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print $db->lasterror(); // Show last sql error } print "
' . $langs->trans("Total") . '
\n"; + print '
'; } diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 9c7a72cb94c..66e6928da07 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -52,6 +52,8 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); +$search_country = GETPOST('search_country', 'alpha'); +$search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); @@ -84,7 +86,7 @@ $formaccounting = new FormAccounting($db); */ // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_lineid = ''; $search_ref = ''; @@ -94,6 +96,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_amount = ''; $search_account = ''; $search_vat = ''; + $search_country = ''; + $search_tvaintra = ''; } if (is_array($changeaccount) && count($changeaccount) > 0) { @@ -149,13 +153,16 @@ print ''; + +dol_fiche_end(); +llxFooter(); + +$db->close(); \ No newline at end of file diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 926a3651362..04e002602bb 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -44,7 +44,7 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='ficheinter'; @@ -221,9 +221,38 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') } else { setEventMessages($langs->trans("Error"), null, 'errors'); } +} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') { + $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', + $conf->entity); + + if (!$res > 0) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') { + $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', + $conf->entity); + + if (!$res > 0) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } } + /* * View */ @@ -431,7 +460,7 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ""; @@ -439,7 +468,7 @@ foreach ($dirmodels as $reldir) else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -451,7 +480,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -495,7 +524,6 @@ print "
"; /* * Other options - * */ print load_fiche_titre($langs->trans("OtherOptions"),'',''); @@ -559,6 +587,7 @@ print '/>'; print ''; print ''; print "\n"; +print ''; // Use services duration print '
'; print ''; @@ -575,6 +604,40 @@ print ''; print ''; print '
'; +// Use duration +print '
'; +print ''; +print ''; +print ''; +print ''; +print $langs->trans("UseDurationOnFichinter"); +print ''; +print ''; +print 'global->FICHINTER_WITHOUT_DURATION?' checked':'') . '>'; +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'; +// use date without hour +print '
'; +print ''; +print ''; +print ''; +print ''; +print $langs->trans("UseDateWithoutHourOnFichinter"); +print ''; +print ''; +print 'global->FICHINTER_DATE_WITHOUT_HOUR?' checked':'') . '>'; +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'; + + print ''; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index f764f40c054..56efe2b5d7d 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -55,7 +55,7 @@ if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); * Action */ -if (GETPOST('cancel')) +if (GETPOST('cancel','alpha')) { $action=''; } diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 9ac33f1cc3d..65b38970a6e 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -70,13 +70,13 @@ if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) print $langs->trans("SetupDescription1").' '; print $langs->trans("AreaForAdminOnly").' '; -print $langs->trans("SetupDescription2", $langs->trans("MenuCompanySetup"), $langs->trans("Modules"))."

"; +print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."

"; print '
'; // Show info setup company if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; -print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->trans("Setup"), $langs->trans("MenuCompanySetup")); +print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); if (! empty($setupcompanynotcomplete)) { $langs->load("errors"); @@ -88,7 +88,7 @@ print '
'; print '
'; // Show info setup module -print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->trans("Setup"), $langs->trans("Modules")); +print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled { $langs->load("errors"); diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 1d4b5cee8d4..36b0d4d0df1 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -101,25 +101,24 @@ if ($action == 'edit') print ''; clearstatcache(); - $var=true; print ''; print ''; - + print ''; - + print ''; - + print ''; - + print ''; @@ -135,25 +134,23 @@ if ($action == 'edit') } else { - $var=true; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
'; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'; print ''; - + print ''; - + print ''; - + print ''; - + print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index fe41afabfb8..24e2772ae0d 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -44,7 +44,7 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='delivery'; @@ -385,7 +385,7 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ""; @@ -393,7 +393,7 @@ foreach ($dirmodels as $reldir) else { print ""; } @@ -405,7 +405,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 6b8126bd977..aa859b18a7e 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -46,13 +46,18 @@ if ($action == 'test' || $action == 'send') } $substitutionarrayfortest=array( -'__LOGIN__' => $user->login, -'__ID__' => 'TESTIdRecord', -'__EMAIL__' => 'TESTEMail', -'__LASTNAME__' => 'TESTLastname', -'__FIRSTNAME__' => 'TESTFirstname', -'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), -//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet +'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, +'__ID__' => 'RecipientIdRecord', +//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails +'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'':'', +'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails +'__LOGIN__' => 'RecipientLogin', +'__LASTNAME__' => 'RecipientLastname', +'__FIRSTNAME__' => 'RecipientFirstname', +'__ADDRESS__'=> 'RecipientAddress', +'__ZIP__'=> 'RecipientZip', +'__TOWN_'=> 'RecipientTown', +'__COUNTRY__'=> 'RecipientCountry' ); complete_substitutions_array($substitutionarrayfortest, $langs); @@ -114,7 +119,7 @@ $server=! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_S if (! $server) $server='127.0.0.1'; -$wikihelp='EN:Setup EMails|FR:Paramétrage EMails|ES:Configuración EMails'; +$wikihelp='EN:Setup_EMails|FR:Paramétrage_EMails|ES:Configuración_EMails'; llxHeader('',$langs->trans("Setup"),$wikihelp); print load_fiche_titre($langs->trans("EMailsSetup"),'','title_setup'); @@ -127,6 +132,14 @@ $head[$h][1] = $langs->trans("OutGoingEmailSetup"); $head[$h][2] = 'common'; $h++; +if ($conf->mailing->enabled) +{ + $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; + $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing"); + $head[$h][2] = 'common_emailing'; + $h++; +} + $head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php"; $head[$h][1] = $langs->trans("DictionaryEMailTemplates"); $head[$h][2] = 'templates'; @@ -238,7 +251,7 @@ if ($action == 'edit') $var=true; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.'
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.'
'; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.'
\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print "
'; - print ''; + print ''; // Disable @@ -462,7 +475,7 @@ else $var=true; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print ''; + print ''; // Disable @@ -676,6 +689,8 @@ else print '
'; print load_fiche_titre($action == 'testhtml'?$langs->trans("DoTestSendHTML"):$langs->trans("DoTestSend")); + dol_fiche_head(''); + // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); @@ -714,7 +729,7 @@ else print $formmail->get_form('addfile','removefile'); - print '
'; + dol_fiche_end(); } } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php new file mode 100644 index 00000000000..b98661edab5 --- /dev/null +++ b/htdocs/admin/mails_emailing.php @@ -0,0 +1,643 @@ + + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2016 Jonathan TISSEAU + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/admin/mails.php + * \brief Page to setup emails sending + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + +$langs->load("companies"); +$langs->load("products"); +$langs->load("admin"); +$langs->load("mails"); +$langs->load("other"); +$langs->load("errors"); + +$action=GETPOST('action','alpha'); + +if (! $user->admin) accessforbidden(); + +$usersignature=$user->signature; +// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html. +if ($action == 'test' || $action == 'send') +{ + $usersignature=dol_string_nohtmltag($usersignature); +} + +$substitutionarrayfortest=array( +'__LOGIN__' => $user->login, +'__ID__' => 'TESTIdRecord', +'__EMAIL__' => 'TESTEMail', +'__LASTNAME__' => 'TESTLastname', +'__FIRSTNAME__' => 'TESTFirstname', +'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), +//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet +); +complete_substitutions_array($substitutionarrayfortest, $langs); + + + +/* + * Actions + */ + +if ($action == 'update' && empty($_POST["cancel"])) +{ + // Send mode parameters + dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"),'chaine',0,'',$conf->entity); + + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} + + +// Actions to send emails +$id=0; +$actiontypecode=''; // Not an event for agenda +$trigger_name=''; // Disable triggers +$paramname='id'; +$mode='emailfortest'; +$trackid=(($action == 'testhtml')?"testhtml":"test"); +$sendcontext='emailing'; // Force to use dedicated context of setup for emailing +include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; + +if ($action == 'presend' && GETPOST('trackid') == 'test') $action='test'; +if ($action == 'presend' && GETPOST('trackid') == 'testhtml') $action='testhtml'; + + + + +/* + * View + */ + +$linuxlike=1; +if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; +if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; + +if (empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING)) $conf->global->MAIN_MAIL_SENDMODE_EMAILING='default'; +$port=! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:ini_get('smtp_port'); +if (! $port) $port=25; +$server=! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:ini_get('SMTP'); +if (! $server) $server='127.0.0.1'; + + +$wikihelp='EN:Setup_EMails|FR:Paramétrage_EMails|ES:Configuración_EMails'; +llxHeader('',$langs->trans("Setup"),$wikihelp); + +print load_fiche_titre($langs->trans("EMailsSetup"),'','title_setup'); + + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/mails.php"; +$head[$h][1] = $langs->trans("OutGoingEmailSetup"); +$head[$h][2] = 'common'; +$h++; + +if ($conf->mailing->enabled) +{ + $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; + $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing"); + $head[$h][2] = 'common_emailing'; + $h++; +} + +$head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php"; +$head[$h][1] = $langs->trans("DictionaryEMailTemplates"); +$head[$h][2] = 'templates'; +$h++; + + +// List of sending methods +$listofmethods=array(); +$listofmethods['default']=$langs->trans('DefaultOutgoingEmailSetup'); +$listofmethods['mail']='PHP mail function'; +//$listofmethods['simplemail']='Simplemail class'; +$listofmethods['smtps']='SMTP/SMTPS socket library'; +$listofmethods['swiftmailer']='Swift Mailer socket library'; + + +if ($action == 'edit') +{ + $form=new Form($db); + + if ($conf->use_javascript_ajax) + { + print "\n".''."\n"; + } + + print '
'; + print ''; + print ''; + + dol_fiche_head($head, 'common_emailing', '', -1); + + print $langs->trans("EMailsDesc")."
\n"; + print "
\n"; + + + clearstatcache(); + $var=true; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print ''; + + // Method + + print ''; + + // Host server + + print ''; + + // Port + + print ''; + + // ID + if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) + { + + $mainstmpid=(! empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING)?$conf->global->MAIN_MAIL_SMTPS_ID_EMAILING:''); + print ''; + } + + // PW + if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) + { + + $mainsmtppw=(! empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING)?$conf->global->MAIN_MAIL_SMTPS_PW_EMAILING:''); + print ''; + } + + // TLS + + print ''; + + // STARTTLS + + print ''; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_MAIL_SENDMODE").''; + + // SuperAdministrator access only + if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) + { + print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING',$listofmethods,$conf->global->MAIN_MAIL_SENDMODE_EMAILING); + } + else + { + $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; + if (empty($text)) $text = $langs->trans("Undefined"); + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print ''; + } + print '
'; + if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') + { + print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); + print ''; + print $langs->trans("SeeLocalSendMailSetup"); + } + else + { + $mainserver = (! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:''); + $smtpserver = ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined"); + if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); + else print $langs->trans("MAIN_MAIL_SMTP_SERVER",$smtpserver); + print ''; + // SuperAdministrator access only + if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) + { + print ''; + print ''; + print ''.$langs->trans("SeeLocalSendMailSetup").''; + } + else + { + $text = ! empty($mainserver) ? $mainserver : $smtpserver; + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print ''; + } + } + print '
'; + if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') + { + print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); + print ''; + print $langs->trans("SeeLocalSendMailSetup"); + } + else + { + $mainport = (! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); + $smtpport = ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined"); + if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); + else print $langs->trans("MAIN_MAIL_SMTP_PORT",$smtpport); + print ''; + // SuperAdministrator access only + if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) + { + print ''; + print ''; + print ''.$langs->trans("SeeLocalSendMailSetup").''; + } + else + { + $text = (! empty($mainport) ? $mainport : $smtpport); + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print ''; + } + } + print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''; + // SuperAdministrator access only + if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) + { + print ''; + } + else + { + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING,$htmltext,1,'superadmin'); + print ''; + } + print '
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''; + // SuperAdministrator access only + if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) + { + print ''; + } + else + { + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING,$htmltext,1,'superadmin'); + print ''; + } + print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) + { + if (function_exists('openssl_open')) + { + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING',(! empty($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING:0),1); + } + else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } + else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) + { + if (function_exists('openssl_open')) + { + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING',(! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING:0),1); + } + else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } + else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; + + print ''; +} +else +{ + dol_fiche_head($head, 'common_emailing', '', -1); + + print $langs->trans("EMailsDesc")."
\n"; + print "
\n"; + + + $var=true; + + print ''; + print ''; + + // Method + + print ''; + + if (! empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + // Host server + + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) + { + print ''; + } + else + { + print ''; + } + + // Port + + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) + { + print ''; + } + else + { + print ''; + } + + // SMTPS ID + + if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) + { + print ''; + } + + // SMTPS PW + + if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) + { + print ''; + } + + // TLS + + print ''; + + // STARTTLS + + print ''; + } + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_MAIL_SENDMODE").''; + $text=$listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; + if (empty($text)) $text=$langs->trans("Undefined").img_warning(); + print $text; + print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID_EMAILING.'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) + { + if (function_exists('openssl_open')) + { + print yn($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING); + } + else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } + else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) + { + if (function_exists('openssl_open')) + { + print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING); + } + else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } + else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
'; + + dol_fiche_end(); + + + if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) + { + print '
'; + /* + // Warning 1 + if ($linuxlike) + { + $sendmailoption=ini_get('mail.force_extra_parameters'); + if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) + { + print info_admin($langs->trans("SendmailOptionNotComplete")); + } + }*/ + // Warning 2 + print info_admin($langs->trans("SendmailOptionMayHurtBuggedMTA")); + } + + + // Boutons actions + print '
'; + + print ''.$langs->trans("Modify").''; + + if (! empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || ! $linuxlike) + { + if (function_exists('fsockopen') && $port && $server) + { + print ''.$langs->trans("DoTestServerAvailability").''; + } + } + else + { + print ''.$langs->trans("DoTestServerAvailability").''; + } + + print ''.$langs->trans("DoTestSend").''; + + if (! empty($conf->fckeditor->enabled)) + { + print ''.$langs->trans("DoTestSendHTML").''; + } + } + + print '
'; + + + if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && ! in_array($action, array('testconnect', 'test', 'testhtml'))) + { + $text = $langs->trans("WarningPHPMail"); + print info_admin($text); + } + + // Run the test to connect + if ($action == 'testconnect') + { + print load_fiche_titre($langs->trans("DoTestServerAvailability")); + + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mail = new CMailFile('','','',''); + $result=$mail->check_server_port($server,$port); + if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort",$server,$port).'
'; + else + { + $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort",$server,$port); + + if ($mail->error) { + $errormsg .= ' - '.$mail->error; + } + + setEventMessages($errormsg, null, 'errors'); + } + print '
'; + } + + // Show email send test form + if ($action == 'test' || $action == 'testhtml') + { + print '
'; + print load_fiche_titre($action == 'testhtml'?$langs->trans("DoTestSendHTML"):$langs->trans("DoTestSend")); + + dol_fiche_head(''); + + // Cree l'objet formulaire mail + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM); + $formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM); + $formmail->trackid=(($action == 'testhtml')?"testhtml":"test"); + $formmail->withfromreadonly=0; + $formmail->withsubstit=0; + $formmail->withfrom=1; + $formmail->witherrorsto=1; + $formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1)); + $formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty + $formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty + $formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test")); + $formmail->withtopicreadonly=0; + $formmail->withfile=2; + $formmail->withbody=(isset($_POST['message'])?$_POST['message']:($action == 'testhtml'?$langs->transnoentities("PredefinedMailTestHtml"):$langs->transnoentities("PredefinedMailTest"))); + $formmail->withbodyreadonly=0; + $formmail->withcancel=1; + $formmail->withdeliveryreceipt=1; + $formmail->withfckeditor=($action == 'testhtml'?1:0); + $formmail->ckeditortoolbar='dolibarr_mailings'; + // Tableau des substitutions + $formmail->substit=$substitutionarrayfortest; + // Tableau des parametres complementaires du post + $formmail->param["action"]="send"; + $formmail->param["models"]="body"; + $formmail->param["mailid"]=0; + $formmail->param["returnurl"]=$_SERVER["PHP_SELF"]; + + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + } + + print $formmail->get_form('addfile','removefile'); + + dol_fiche_end(); + } +} + + +llxFooter(); + +$db->close(); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 123877f7f4e..c9b8120bd0f 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -28,8 +28,8 @@ /** * \file htdocs/admin/mails_templates.php - * \ingroup setup - * \brief Page to administer data tables + * \ingroup core + * \brief Page to administer emails templates */ require '../main.inc.php'; @@ -45,14 +45,20 @@ $langs->load("errors"); $langs->load("admin"); $langs->load("main"); $langs->load("mails"); +$langs->load("languages"); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); $id=GETPOST('id','int'); $rowid=GETPOST('rowid','alpha'); $search_label=GETPOST('search_label','alpha'); +$search_type_template=GETPOST('search_type_template','alpha'); +$search_topic=GETPOST('search_topic','alpha'); +$search_lang=GETPOST('search_lang','alpha'); +$search_fk_user=GETPOST('search_fk_user','intcomma'); +$search_topic=GETPOST('search_topic','alpha'); -$allowed=$user->admin; +$allowed=1; if (! $allowed) accessforbidden(); $acts[0] = "activate"; @@ -67,7 +73,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -85,17 +91,17 @@ $tabsqlsort[25]="label ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[25]= "label,type_template,private,position,topic,content"; +$tabfield[25]= "label,type_template,lang,fk_user,private,position,topic,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfield[25].=',content_lines'; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[25]= "label,type_template,private,position,topic,content"; +$tabfieldvalue[25]= "label,type_template,fk_user,lang,private,position,topic,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldvalue[25].=',content_lines'; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[25]= "label,type_template,private,position,topic,content"; +$tabfieldinsert[25]= "label,type_template,fk_user,lang,private,position,topic,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldinsert[25].=',content_lines'; $tabfieldinsert[25].=',entity'; // Must be at end because not into other arrays @@ -144,16 +150,19 @@ $sourceList=array(); // We save list of template email Dolibarr can manage. This list can found by a grep into code on "->param['models']" $elementList = array(); -if ($conf->propal->enabled) $elementList['propal_send']=$langs->trans('MailToSendProposal'); -if ($conf->commande->enabled) $elementList['order_send']=$langs->trans('MailToSendOrder'); -if ($conf->facture->enabled) $elementList['facture_send']=$langs->trans('MailToSendInvoice'); -if ($conf->expedition->enabled) $elementList['shipping_send']=$langs->trans('MailToSendShipment'); -if ($conf->ficheinter->enabled) $elementList['fichinter_send']=$langs->trans('MailToSendIntervention'); +if ($conf->propal->enabled) $elementList['propal_send']=$langs->trans('MailToSendProposal'); +if ($conf->commande->enabled) $elementList['order_send']=$langs->trans('MailToSendOrder'); +if ($conf->facture->enabled) $elementList['facture_send']=$langs->trans('MailToSendInvoice'); +if ($conf->expedition->enabled) $elementList['shipping_send']=$langs->trans('MailToSendShipment'); +if ($conf->ficheinter->enabled) $elementList['fichinter_send']=$langs->trans('MailToSendIntervention'); if ($conf->supplier_proposal->enabled) $elementList['supplier_proposal_send']=$langs->trans('MailToSendSupplierRequestForQuotation'); -if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder'); -if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice'); -if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty'); -if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract'); +if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder'); +if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice'); +if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty'); +if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract'); +$elementList['all']=$langs->trans('VisibleEverywhere'); +$elementList['none']=$langs->trans('VisibleNowhere'); + $parameters=array('elementList'=>$elementList); $reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks @@ -170,8 +179,8 @@ $id = 25; * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -180,9 +189,13 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_label=''; + $search_type_template=''; + $search_lang=''; + $search_fk_user=''; + $search_topic=''; $toselect=''; $search_array_options=array(); } @@ -204,7 +217,7 @@ if (empty($reshook)) if ($value == 'content') $value='content-'.$rowid; if ($value == 'content_lines') $value='content_lines-'.$rowid; - if (! isset($_POST[$value]) || $_POST[$value]=='') + if ((! isset($_POST[$value]) || $_POST[$value]=='' || $_POST[$value]=='-1') && $value != 'lang' && $value != 'fk_user') { $ok=0; $fieldnamekey=$listfield[$f]; @@ -213,7 +226,11 @@ if (empty($reshook)) if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments'; if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; if ($fieldnamekey == 'note') $fieldnamekey = 'Note'; - if ($fieldnamekey == 'type') $fieldnamekey = 'Type'; + if ($fieldnamekey == 'type_template') $fieldnamekey = 'TypeOfTemplate'; + if ($fieldnamekey == 'fk_user') $fieldnamekey = 'Owner'; + if ($fieldnamekey == 'private') $fieldnamekey = 'Private'; + if ($fieldnamekey == 'position') $fieldnamekey = 'Position'; + if ($fieldnamekey == 'topic') $fieldnamekey = 'Topic'; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } @@ -253,15 +270,17 @@ if (empty($reshook)) $i=0; foreach ($listfieldinsert as $f => $value) { - //var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value); - if ($value == 'entity') { - $_POST[$listfieldvalue[$i]] = $conf->entity; - } + $keycode=$listfieldvalue[$i]; + if ($value == 'lang') $keycode='langcode'; + + //var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value); + if ($value == 'entity') $_POST[$keycode] = $conf->entity; if ($i) $sql.=","; - if ($value == 'private' && ! is_numeric($_POST[$listfieldvalue[$i]])) $_POST[$listfieldvalue[$i]]='0'; - if ($value == 'position' && ! is_numeric($_POST[$listfieldvalue[$i]])) $_POST[$listfieldvalue[$i]]='1'; - if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = '' - else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; + if ($value == 'fk_user' && ! ($_POST[$keycode] > 0)) $_POST[$keycode]=''; + if ($value == 'private' && ! is_numeric($_POST[$keycode])) $_POST[$keycode]='0'; + if ($value == 'position' && ! is_numeric($_POST[$keycode])) $_POST[$keycode]='1'; + if ($_POST[$keycode] == '' || ($keycode == 'langcode' && empty($_POST[$keycode]))) $sql.="null"; // For vat, we want/accept code = '' + else $sql.="'".$db->escape($_POST[$keycode])."'"; $i++; } $sql.=",1)"; @@ -301,15 +320,17 @@ if (empty($reshook)) $i = 0; foreach ($listfieldmodify as $field) { - if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid]; + $keycode=$listfieldvalue[$i]; + if ($field == 'lang') $keycode='langcode'; + + if ($field == 'fk_user' && ! ($_POST['fk_user'] > 0)) $_POST['fk_user']=''; + if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid]; if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid]; - if ($field == 'entity') { - $_POST[$listfieldvalue[$i]] = $conf->entity; - } + if ($field == 'entity') $_POST[$keycode] = $conf->entity; if ($i) $sql.=","; $sql.= $field."="; - if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = '' - else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; + if ($_POST[$keycode] == '' || ($keycode == 'langcode' && empty($_POST[$keycode]))) $sql.="null"; // For vat, we want/accept code = '' + else $sql.="'".$db->escape($_POST[$keycode])."'"; $i++; } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; @@ -405,10 +426,22 @@ print load_fiche_titre($titre,$linkback,$titlepicto); $h = 0; -$head[$h][0] = DOL_URL_ROOT."/admin/mails.php"; -$head[$h][1] = $langs->trans("OutGoingEmailSetup"); -$head[$h][2] = 'common'; -$h++; + +if ($user->admin && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) +{ + $head[$h][0] = DOL_URL_ROOT."/admin/mails.php"; + $head[$h][1] = $langs->trans("OutGoingEmailSetup"); + $head[$h][2] = 'common'; + $h++; + + if (! empty($conf->mailing->enabled)) + { + $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; + $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing"); + $head[$h][2] = 'common_emailing'; + $h++; + } +} $head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php"; $head[$h][1] = $langs->trans("DictionaryEMailTemplates"); @@ -426,18 +459,23 @@ if ($action == 'delete') //var_dump($elementList); -$sql="SELECT rowid as rowid, label, type_template, private, position, topic, content_lines, content, active"; +$sql="SELECT rowid as rowid, label, type_template, lang, fk_user, private, position, topic, content_lines, content, active"; $sql.=" FROM ".MAIN_DB_PREFIX."c_email_templates"; $sql.=" WHERE entity IN (".getEntity('email_template').")"; -if ($search_label) $sql.=natural_search('label', $search_label); - -if ($search_country_id > 0) +if (! $user->admin) { - if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; - else $sql.=" WHERE "; - $sql.= " c.rowid = ".$search_country_id; + $sql.=" AND (private = 0 OR (private = 1 AND fk_user = ".$user->id."))"; // Show only public and private to me + $sql.=" AND (active = 1 OR fk_user = ".$user->id.")"; // Show only active or owned by me } - +if (empty($conf->global->MAIN_MULTILANGS)) +{ + $sql.= " AND (lang = '".$langs->defaultlang."' OR lang IS NULL)"; +} +if ($search_label) $sql.=natural_search('label', $search_label); +if ($search_type_template != '' && $search_type_template != '-1') $sql.=natural_search('type_template', $search_type_template); +if ($search_lang) $sql.=natural_search('lang', $search_lang); +if ($search_fk_user != '' && $search_fk_user != '-1') $sql.=natural_search('fk_user', $search_fk_user, 2); +if ($search_topic) $sql.=natural_search('topic', $search_topic); if ($sortfield) { // If sort order is "country", we use country_code instead @@ -461,29 +499,27 @@ $sql.=$db->plimit($listlimit+1,$offset); $fieldlist=explode(',',$tabfield[$id]); -print '
'; -print ''; -print ''; - -print ''; - // Form to add a new line $alabelisused=0; $var=false; -$fieldlist=explode(',',$tabfield[$id]); +print ''; +print ''; +print ''; -if ($action != 'edit') +print '
'; +print '
'; + +// Line to enter new values (title) +print ''; +foreach ($fieldlist as $field => $value) { - // Line for title - print ''; - foreach ($fieldlist as $field => $value) - { // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate $align="left"; + if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner");} if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } @@ -491,6 +527,8 @@ if ($action != 'edit') if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($fieldlist[$field]=='content') { $valuetoshow=''; } if ($fieldlist[$field]=='content_lines') { $valuetoshow=''; } + if ($fieldlist[$field]=='private') { $align='center'; } + if ($fieldlist[$field]=='position') { $align='center'; } if ($valuetoshow != '') { @@ -505,97 +543,96 @@ if ($action != 'edit') print ''; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; - } +} +print ''; +print ''; - print ''; - print ''; +// Line to enter new values (input fields) +print ""; - // Line to enter new values - print ""; - - $obj = new stdClass(); - // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd')) - { - foreach ($fieldlist as $key=>$val) - { - if (GETPOST($val) != '') - $obj->$val=GETPOST($val); - } - } - - $tmpaction = 'create'; - $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks - $error=$hookmanager->error; $errors=$hookmanager->errors; - - if (empty($reshook)) - { - if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit') - { - fieldList($fieldlist,$obj,$tabname[$id],'hide'); - } - else - { - fieldList($fieldlist,$obj,$tabname[$id],'add'); - } - } - - print ''; - print ""; - - $fieldsforcontent = array('content'); - if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) - { - $fieldsforcontent = array('content', 'content_lines'); - } - foreach ($fieldsforcontent as $tmpfieldlist) - { - print ''; - if ($tmpfieldlist == 'content') - { - print ''; - } - //else print ''; - print ''; - } - - - - $colspan=count($fieldlist)+1; - //print ''; // Keep   to have a line with enough height +$obj = new stdClass(); +// If data was already input, we define them in obj to populate input fields. +if (GETPOST('actionadd')) +{ + foreach ($fieldlist as $key => $val) { + if (GETPOST($val) != '') + $obj->$val = GETPOST($val); + } } +$tmpaction = 'create'; +$parameters = array( + 'fieldlist' => $fieldlist, + 'tabname' => $tabname[$id] +); +$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks +$error = $hookmanager->error; +$errors = $hookmanager->errors; + +if (empty($reshook)) +{ + if ($tabname[$id] == MAIN_DB_PREFIX . 'c_email_templates' && $action == 'edit') { + fieldList($fieldlist, $obj, $tabname[$id], 'hide'); + } else { + fieldList($fieldlist, $obj, $tabname[$id], 'add'); + } +} + +print ''; +print ""; + +$fieldsforcontent = array('content'); +if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('content','content_lines'); } +foreach ($fieldsforcontent as $tmpfieldlist) +{ + print ''; + if ($tmpfieldlist == 'content') { + print ''; + } + // else print ''; + print ''; +} + + + +$colspan=count($fieldlist)+1; +//print ''; // Keep   to have a line with enough height + print '
'; +print ''; +print '
'; - print ''; - print '
'; - print '
'; - if ($tmpfieldlist == 'content') print ''.$form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'
'; - if ($tmpfieldlist == 'content_lines') print ''.$form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'
'; - - if ($context != 'hide') - { - //print ''; - $okforextended=true; - if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended=false; - $doleditor = new DolEditor($tmpfieldlist, (! empty($obj->{$tmpfieldlist})?$obj->{$tmpfieldlist}:''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%'); - print $doleditor->Create(1); - } - else print ' '; - print '
'; - if ($action != 'edit') - { - print ''; - } - print '
 
'; +print '
'; + if ($tmpfieldlist == 'content') + print '' . $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '
'; + if ($tmpfieldlist == 'content_lines') + print '' . $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '
'; + + if ($context != 'hide') { + // print ''; + $okforextended = true; + if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) + $okforextended = false; + $doleditor = new DolEditor($tmpfieldlist, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%'); + print $doleditor->Create(1); + } else + print ' '; + print '
'; + if ($action != 'edit') { + print ''; + } + print '
 
'; +print ''; + print '
'; print '
'; + print '
'; print ''; print ''; +print '
'; print ''; // List of available record in database @@ -628,12 +665,28 @@ if ($resql) foreach ($fieldlist as $field => $value) { if ($value == 'label') print ''; + elseif ($value == 'lang') + { + print ''; + } + elseif ($value == 'fk_user') + { + print ''; + } + elseif ($value == 'topic') print ''; elseif (! in_array($value, array('content', 'content_lines'))) print ''; } if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print ''; print ''; // Action column - print ''; @@ -658,12 +711,15 @@ if ($resql) */ $valuetoshow=ucfirst($fieldlist[$field]); // By defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate + if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;} if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; } + if ($fieldlist[$field]=='private') { $align='center'; } + if ($fieldlist[$field]=='position') { $align='center'; } // Affiche nom du champ if ($showfield) @@ -687,13 +743,13 @@ if ($resql) // Lines with values while ($i < $num) { - $obj = $db->fetch_object($resql); - //print_r($obj); + print ''; + if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { - $tmpaction='edit'; + $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -724,15 +780,16 @@ if ($resql) // Show value for field if ($showfield) { - print ''; + print ''; - print ''; - + if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; + $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); + print $doleditor->Create(1); + print ''; + print ''; + print ''; + print ''; } } } @@ -756,19 +813,46 @@ if ($resql) { $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; } + if ($value == 'lang' && $valuetoshow) + { + $valuetoshow = $valuetoshow.' - '.$langs->trans("Language_".$valuetoshow); + } + if ($value == 'fk_user') + { + if ($valuetoshow > 0) + { + $fuser=new User($db); + $fuser->fetch($valuetoshow); + $valuetoshow = $fuser->getNomUrl(1); + } + } + if ($value == 'private') + { + $align="center"; + } + if ($value == 'position') + { + $align="center"; + } $class='tddict'; // Show value for field if ($showfield) { - print ''; + print ''; + print ''; } } } // Can an entry be erased or disabled ? $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default - $canbemodified=$iserasable; + if (! $user->admin && $obj->fk_user != $user->id) + { + $iserasable=0; + $canbedisabled=0; + $canbemodified=0; + } $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if ($param) $url .= '&'.$param; @@ -777,28 +861,21 @@ if ($resql) // Active print '"; // Modify link - if ($canbemodified) print ''; - else print ''; + if ($canbemodified) print ''; + else print ''; // Delete link if ($iserasable) { - print ''; } - else print ''; + else print ''; /* $fieldsforcontent = array('content'); @@ -840,6 +917,7 @@ else { } print '
'; + print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1); + print ''; + $restrictid=array(); + if (! $user->admin) $restrictid=array($user->id); + //var_dump($restrictid); + print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth200'); + print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'; // To create an artificial CR for the current tr we are on + print '
'; // To create an artificial CR for the current tr we are on $okforextended = true; - if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) - $okforextended = false; - $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); - print $doleditor->Create(1); - print ''.$valuetoshow.''.$valuetoshow.''; if ($canbedisabled) print ''.$actl[$obj->active].''; - else - { - if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); - else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); - else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); - else print $langs->trans("AlwaysActive"); - } print "'.img_edit().' '.img_edit().''; - if ($user->admin) print ''.img_delete().''; + print ''; + print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ' 
'; +print '
'; print '
'; @@ -861,7 +939,7 @@ $db->close(); */ function fieldList($fieldlist, $obj='', $tabname='', $context='') { - global $conf,$langs,$db; + global $conf, $langs, $user, $db; global $form; global $region_id; global $elementList,$sourceList,$localtax_typeList; @@ -869,35 +947,99 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); - if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); foreach ($fieldlist as $field => $value) { - if ($fieldlist[$field] == 'lang') + if ($fieldlist[$field] == 'fk_user') { print ''; - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang'); + if ($user->admin) + { + print $form->select_dolusers($obj->{$fieldlist[$field]}, 'fk_user', 1, null, 0, '', null, 0, 0, 1, '', 0, '', 'maxwidth200'); + } + else + { + if ($context == 'add') // I am not admin and we show the add form + { + print $user->getNomUrl(1); // Me + $forcedvalue=$user->id; + } + else + { + if ($obj && ! empty($obj->{$fieldlist[$field]}) && $obj->{$fieldlist[$field]} > 0) + { + $fuser=new User($db); + $fuser->fetch($obj->{$fieldlist[$field]}); + print $fuser->getNomUrl(1); + $forcedvalue=$fuser->id; + } + else + { + $forcedvalue=$obj->{$fieldlist[$field]}; + } + } + $keyname=$fieldlist[$field]; + print ''; + } + print ''; + } + elseif ($fieldlist[$field] == 'lang') + { + print ''; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $selectedlang = $langs->defaultlang; + if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]}; + print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1); + } + else + { + if (! empty($obj->{$fieldlist[$field]})) + { + print $obj->{$fieldlist[$field]}.' - '.$langs->trans('Language_'.$obj->{$fieldlist[$field]}); + } + $keyname=$fieldlist[$field]; + if ($keyname == 'lang') $keyname='langcode'; // Avoid conflict with lang param + print ''; + } print ''; } // Le type de template elseif ($fieldlist[$field] == 'type_template') { print ''; - print $form->selectarray('type_template', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + if ($context == 'edit' && ! empty($obj->{$fieldlist[$field]}) && ! in_array($obj->{$fieldlist[$field]}, array_keys($elementList))) + { + // Current tempalte type is an unknown type, so we must keep it as it is. + print ''; + print $obj->{$fieldlist[$field]}; + } + else + { + print $form->selectarray('type_template', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1); + } print ''; } elseif (in_array($fieldlist[$field], array('content','content_lines'))) continue; else { - print ''; - $size=''; $class=''; + $size=''; $class=''; $classtd=''; if ($fieldlist[$field]=='code') $class='maxwidth100'; - if ($fieldlist[$field]=='private') $class='maxwidth50'; - if ($fieldlist[$field]=='position') $class='maxwidth50'; + if ($fieldlist[$field]=='private') { $class='maxwidth50'; $classtd='center'; } + if ($fieldlist[$field]=='position') { $class='maxwidth50'; $classtd='center'; } if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent'; if ($fieldlist[$field]=='topic') $class='quatrevingtpercent'; if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" '; - print ''; + + print ''; + if ($fieldlist[$field]=='private' && empty($user->admin)) + { + print ''; + } + else + { + print ''; + } print ''; } } diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index db03407fed1..cd236d85122 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -83,27 +83,27 @@ if ($action == 'update') } } } - + $menu = new Menubase($db); - $result=$menu->fetch($_POST['menuId']); + $result=$menu->fetch(GETPOST('menuId', 'int')); if ($result > 0) { - $menu->titre=$_POST['titre']; - $menu->leftmenu=$_POST['leftmenu']; - $menu->url=$_POST['url']; - $menu->langs=$_POST['langs']; - $menu->position=$_POST['position']; - $menu->enabled=$_POST['enabled']; - $menu->perms=$_POST['perms']; - $menu->target=$_POST['target']; - $menu->user=$_POST['user']; - if (is_numeric($_POST['menuIdParent'])) + $menu->titre=GETPOST('titre', 'alpha'); + $menu->leftmenu=GETPOST('leftmenu', 'alpha'); + $menu->url=GETPOST('url','alpha'); + $menu->langs=GETPOST('langs','alpha'); + $menu->position=GETPOST('position','int'); + $menu->enabled=GETPOST('enabled','alpha'); + $menu->perms=GETPOST('perms','alpha'); + $menu->target=GETPOST('target','alpha'); + $menu->user=GETPOST('user','alpha'); + if (is_numeric(GETPOST('menuIdParent','alpha'))) { - $menu->fk_menu=$_POST['menuIdParent']; + $menu->fk_menu=GETPOST('menuIdParent','alpha'); } else { - if ($_POST['type'] == 'top') $menu->fk_menu=0; + if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0; else $menu->fk_menu=-1; $menu->fk_mainmenu=$mainmenu; $menu->fk_leftmenu=$leftmenu; @@ -123,7 +123,6 @@ if ($action == 'update') { setEventMessages($menu->error, $menu->errors, 'errors'); } - $_GET["menuId"] = $_POST['menuId']; $action = "edit"; } else @@ -148,9 +147,9 @@ if ($action == 'add') } $leftmenu=''; $mainmenu=''; - if (! empty($_POST['menuId']) && ! is_numeric($_POST['menuId'])) + if (GETPOST('menuId','int') && ! is_numeric(GETPOST('menuId','int'))) { - $tmp=explode('&',$_POST['menuId']); + $tmp=explode('&',GETPOST('menuId','int')); foreach($tmp as $s) { if (preg_match('/fk_mainmenu=/',$s)) @@ -197,7 +196,7 @@ if ($action == 'add') $action = 'create'; $error++; } - if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left') + if (! $error && ! $_POST['menuId'] && $_POST['type'] == 'left') { setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors'); $action = 'create'; @@ -207,23 +206,23 @@ if ($action == 'add') if (! $error) { $menu = new Menubase($db); - $menu->menu_handler=preg_replace('/_menu$/','',$_POST['menu_handler']); - $menu->type=$_POST['type']; - $menu->titre=$_POST['titre']; - $menu->url=$_POST['url']; - $menu->langs=$_POST['langs']; - $menu->position=$_POST['position']; - $menu->enabled=$_POST['enabled']; - $menu->perms=$_POST['perms']; - $menu->target=$_POST['target']; - $menu->user=$_POST['user']; - if (is_numeric($_POST['menuId'])) + $menu->menu_handler=preg_replace('/_menu$/','',GETPOST('menu_handler','aZ09')); + $menu->type=GETPOST('type','alpha'); + $menu->titre=GETPOST('titre','alpha'); + $menu->url=GETPOST('url','alpha'); + $menu->langs=GETPOST('langs','alpha'); + $menu->position=GETPOST('position','int'); + $menu->enabled=GETPOST('enabled','alpha'); + $menu->perms=GETPOST('perms','alpha'); + $menu->target=GETPOST('target','alpha'); + $menu->user=GETPOST('user','alpha'); + if (is_numeric(GETPOST('menuId','int'))) { - $menu->fk_menu=$_POST['menuId']; + $menu->fk_menu=GETPOST('menuId','int'); } else { - if ($_POST['type'] == 'top') $menu->fk_menu=0; + if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0; else $menu->fk_menu=-1; $menu->fk_mainmenu=$mainmenu; $menu->fk_leftmenu=$leftmenu; @@ -232,7 +231,7 @@ if ($action == 'add') $result=$menu->create($user); if ($result > 0) { - header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$_POST['menu_handler']); + header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler','aZ09')); exit; } else @@ -305,17 +304,17 @@ if ($action == 'create') '; print load_fiche_titre($langs->trans("NewMenu"),'','title_setup'); - - print '
'; + + print ''; print ''; dol_fiche_head(); - + print ''; // Id - $parent_rowid = $_GET['menuId']; - if ($_GET['menuId']) + $parent_rowid = GETPOST('menuId', 'int'); + if (GETPOST('menuId', 'int')) { $sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int'); $res = $db->query($sql); @@ -375,40 +374,40 @@ if ($action == 'create') } else { - print ''; + print ''; } print ''; // Title - print ''; + print ''; // URL - print ''; + print ''; // Langs print ''; // Position - print ''; + print ''; // Target print ''; // Enabled - print ''; + print ''; // Perms - print ''; + print ''; print '
'.$langs->trans('DetailMenuIdParent'); print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def'; print '
'.$langs->trans('Title').''.$langs->trans('DetailTitre').'
'.$langs->trans('Title').''.$langs->trans('DetailTitre').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
'.$langs->trans('Position').''.$langs->trans('DetailPosition').'
'.$langs->trans('Position').''.$langs->trans('DetailPosition').'
'.$langs->trans('Target').''.$langs->trans('DetailTarget').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'; dol_fiche_end(); - + // Boutons print '
'; print ''; @@ -426,14 +425,14 @@ elseif ($action == 'edit') print ''; print ''; print ''; - print ''; + print ''; dol_fiche_head(); - + print ''; $menu = new Menubase($db); - $result=$menu->fetch($_GET['menuId']); + $result=$menu->fetch(GETPOST('menuId', 'int')); //var_dump($menu); // Id @@ -472,20 +471,20 @@ elseif ($action == 'edit') //print ''; // Title - print ''; + print ''; // Url print ''; // Langs - print ''; + print ''; // Position print ''; // Target print ''; @@ -502,7 +501,7 @@ elseif ($action == 'edit') print '
'.$langs->trans('Level').''.$menu->level.''.$langs->trans('DetailLevel').'
'.$langs->trans('Title').''.$langs->trans('DetailTitre').'
'.$langs->trans('Title').''.$langs->trans('DetailTitre').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
'.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
'.$langs->trans('Position').''.$langs->trans('DetailPosition').'
'.$langs->trans('Target').''.$langs->trans('DetailTarget').'
'; dol_fiche_end(); - + // Bouton print '
'; print ''; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index ed5f56954c0..c3211fc2d75 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -289,14 +289,14 @@ if ($conf->use_javascript_ajax) - la chaine a afficher ie: data[]= array (index, index parent, chaine ) */ - + //il faut d'abord declarer un element racine de l'arbre $data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>''); - + //puis tous les elements enfants - $sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.module"; + $sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.position, m.module"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql.= " WHERE menu_handler = '".$db->escape($menu_handler_to_search)."'"; $sql.= " AND entity = ".$conf->entity; @@ -313,6 +313,7 @@ if ($conf->use_javascript_ajax) { if (! empty($menu['langs'])) $langs->load($menu['langs']); $titre = $langs->trans($menu['titre']); + $data[] = array( 'rowid'=>$menu['rowid'], 'module'=>$menu['module'], @@ -322,6 +323,7 @@ if ($conf->use_javascript_ajax) 'leftmenu'=>$menu['leftmenu'], 'fk_mainmenu'=>$menu['fk_mainmenu'], 'fk_leftmenu'=>$menu['fk_leftmenu'], + 'position'=>$menu['position'], 'entry'=>'
'. '   '.$titre.''. ''. @@ -329,28 +331,34 @@ if ($conf->use_javascript_ajax) ''.img_edit_add('default').' '. ''.img_delete('default').' '. '     '. - ''.img_picto("Monter","1uparrow").''.img_picto("Descendre","1downarrow").''. - '
' + ''.img_picto("Up","1uparrow").''.img_picto("Down","1downarrow").''. + '', + 'buttons'=>''.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. + ''.img_edit_add('default').' '. + ''.img_delete('default').' '. + '     '. + ''.img_picto("Up","1uparrow").''.img_picto("Down","1downarrow").'' ); $i++; } } global $tree_recur_alreadyadded; // This var was def into tree_recur - - // Appelle de la fonction recursive (ammorce) - // avec recherche depuis la racine. + //var_dump($data); - tree_recur($data, $data[0], 0, 'iddivjstree'); // $data[0] is virtual record 'racine' - + + // Appelle de la fonction recursive (ammorce) avec recherche depuis la racine. + //tree_recur($data, $data[0], 0, 'iddivjstree', 0, 1); // use this to get info on name and foreign keys of menu entry + tree_recur($data, $data[0], 0, 'iddivjstree', 0, 0); // $data[0] is virtual record 'racine' + print ''; - + print ''; - + print ''; - - + + // Process remaining records (records that are not linked to root by any path) $remainingdata = array(); foreach($data as $datar) @@ -358,30 +366,29 @@ if ($conf->use_javascript_ajax) if (empty($datar['rowid']) || $tree_recur_alreadyadded[$datar['rowid']]) continue; $remainingdata[] = $datar; } - + if (count($remainingdata)) { print ''; - + print ''; print ''; print ''; print ''; - + print ''; - print ''; - + print ''; - + print '
'.$langs->trans("NotTopTreeMenuPersonalized").'
'; - + print ''; foreach($remainingdata as $datar) { $father = array('rowid'=>$datar['rowid'],'title'=>"???",'mainmenu'=>$datar['fk_mainmenu'],'leftmenu'=>$datar['fk_leftmenu'],'fk_mainmenu'=>'','fk_leftmenu'=>''); //print 'Start with rowid='.$datar['rowid'].' mainmenu='.$father ['mainmenu'].' leftmenu='.$father ['leftmenu'].'
'."\n"; tree_recur($data, $father, 0, 'iddivjstree'.$datar['rowid'], 1, 1); } - + print '
'; } diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 21e3afb3921..e0caaba0a93 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -35,7 +35,8 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is n require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->load("errors"); $langs->load("admin"); @@ -225,20 +226,6 @@ asort($orders); //var_dump($modules); - -$h = 0; - -$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=desc'; -$head[$h][1] = $langs->trans("Description"); -$head[$h][2] = 'desc'; -$h++; - -$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=feature'; -$head[$h][1] = $langs->trans("TechnicalServicesProvided"); -$head[$h][2] = 'feature'; -$h++; - - $i=0; foreach($orders as $tmpkey => $tmpvalue) { @@ -257,11 +244,33 @@ $special = $objMod->special; $tab=explode('_',$value); $familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3]; + + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=desc'; +$head[$h][1] = $langs->trans("Description"); +$head[$h][2] = 'desc'; +$h++; + +$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=feature'; +$head[$h][1] = $langs->trans("TechnicalServicesProvided"); +$head[$h][2] = 'feature'; +$h++; + +if ($objMod->isCoreOrExternalModule() == 'external') +{ + $head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=changelog'; + $head[$h][1] = $langs->trans("ChangeLog"); + $head[$h][2] = 'changelog'; + $h++; +} + // Check filters $modulename=$objMod->getName(); $moduledesc=$objMod->getDesc(); $moduleauthor=$objMod->getPublisher(); - +$moduledir=strtolower(preg_replace('/^mod/i','',get_class($objMod))); print '
'; @@ -363,18 +372,20 @@ if ($mode == 'feature') if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby); else $text.=$langs->trans("None"); - $text.='


'; + $text.='

'; - $text.=''.$langs->trans("AddRemoveTabs").': '; - if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) + $text.='
'.$langs->trans("AddDataTables").': '; + $sqlfiles = dol_dir_list(dol_buildpath($moduledir.'/sql/'), 'files', 0, 'llx.*\.sql', array('\.key\.sql')); + if (count($sqlfiles) > 0) { - $i=0; - foreach($objMod->tabs as $val) - { - $tmp=explode(':',$val,3); - $text.=($i?', ':'').$tmp[0].':'.$tmp[1]; - $i++; - } + $text.=$langs->trans("Yes").' ('; + $i=0; + foreach($sqlfiles as $val) + { + $text.=($i?', ':'').preg_replace('/\.sql$/','',preg_replace('/llx_/','',$val['name'])); + $i++; + } + $text.=')'; } else $text.=$langs->trans("No"); @@ -394,13 +405,24 @@ if ($mode == 'feature') $text.='
'; - $text.='
'.$langs->trans("AddBoxes").': '; - if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) + $text.='
'.$langs->trans("AddData").': '; + $filedata = dol_buildpath($moduledir.'/sql/data.sql'); + if (dol_is_file($filedata)) + { + $text.=$langs->trans("Yes").' ('.$moduledir.'/sql/data.sql'.')'; + } + else $text.=$langs->trans("No"); + + $text.='
'; + + $text.='
'.$langs->trans("AddRemoveTabs").': '; + if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) { $i=0; - foreach($objMod->boxes as $val) + foreach($objMod->tabs as $val) { - $text.=($i?', ':'').($val['file']?$val['file']:$val[0]); + $tmp=explode(':',$val,3); + $text.=($i?', ':'').$tmp[0].':'.$tmp[1]; $i++; } } @@ -441,9 +463,40 @@ if ($mode == 'feature') $text.='
'; $text.='
'.$langs->trans("AddTriggers").': '; + $moreinfoontriggerfile=''; if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers']) { - $text.=$langs->trans("Yes"); + $yesno='Yes'; + } + else + { + $yesno='No'; + } + require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; + $interfaces = new Interfaces($db); + $triggers = $interfaces->getTriggersList(array((($objMod->isCoreOrExternalModule() == 'external')?'/'.$moduledir:'').'/core/triggers')); + foreach($triggers as $triggercursor) + { + if ($triggercursor['module'] == $moduledir) + { + $yesno='Yes'; + $moreinfoontriggerfile=' ('.$triggercursor['relpath'].')'; + } + } + + $text.=$langs->trans($yesno).$moreinfoontriggerfile; + + $text.='
'; + + $text.='
'.$langs->trans("AddBoxes").': '; + if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) + { + $i=0; + foreach($objMod->boxes as $val) + { + $text.=($i?', ':'').($val['file']?$val['file']:$val[0]); + $i++; + } } else $text.=$langs->trans("No"); @@ -536,6 +589,13 @@ if ($mode == 'feature') } +if ($mode == 'changelog') +{ + $changelog=$objMod->getChangeLog(); + if ($changelog) $text.='
'.$changelog.'
'; + else $text.='
'.$langs->trans("NotAvailable").'
'; +} + print $text; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 23d87791103..53c497c74fe 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php'; $langs->load("errors"); $langs->load("admin"); @@ -46,6 +47,17 @@ $search_status=GETPOST('search_status','alpha'); $search_nature=GETPOST('search_nature','alpha'); $search_version=GETPOST('search_version','alpha'); + +// For dolistore search +$options = array(); +$options['per_page'] = 20; +$options['categorie'] = GETPOST('categorie', 'int') + 0; +$options['start'] = GETPOST('start', 'int') + 0; +$options['end'] = GETPOST('end', 'int') + 0; +$options['search'] = GETPOST('search_keyword', 'alpha'); +$dolistore = new Dolistore($options); + + if (! $user->admin) accessforbidden(); @@ -207,8 +219,19 @@ if ($action == 'set' && $user->admin) //var_dump($resarray);exit; if ($resarray['nbperms'] > 0) { - $msg = $langs->trans('ModuleEnabledAdminMustCheckRights'); - setEventMessages($msg, null, 'warnings'); + $tmpsql="SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."user WHERE admin <> 1"; + $resqltmp=$db->query($tmpsql); + if ($resqltmp) + { + $obj=$db->fetch_object($resqltmp); + //var_dump($obj->nb);exit; + if ($obj && $obj->nb > 1) + { + $msg = $langs->trans('ModuleEnabledAdminMustCheckRights'); + setEventMessages($msg, null, 'warnings'); + } + } + else dol_print_error($db); } } header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:'')); @@ -229,6 +252,11 @@ if ($action == 'reset' && $user->admin) * View */ +$form = new Form($db); + +$morejs = array("/admin/dolistore/js/dolistore.js.php"); +$morecss = array("/admin/dolistore/css/dolistore.css"); + // Set dir where external modules are installed if (! dol_is_dir($dirins)) { @@ -236,10 +264,8 @@ if (! dol_is_dir($dirins)) } $dirins_ok=(dol_is_dir($dirins)); -$form = new Form($db); - $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$help_url); +llxHeader('',$langs->trans("Setup"),$help_url, '', '', '', $morejs, $morecss, 0, 0); $arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers")); $arrayofwarnings=array(); // Array of warning each module want to show when activated @@ -412,24 +438,9 @@ print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'title_setup'); if ($mode=='common') print ''.$langs->trans("ModulesDesc")."
\n"; if ($mode=='marketplace') print ''.$langs->trans("ModulesMarketPlaceDesc")."
\n"; if ($mode=='deploy') print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."
\n"; +if ($mode=='develop') print ''.$langs->trans("ModulesDevelopDesc")."
\n"; - -$h = 0; - -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=common"; -$head[$h][1] = $langs->trans("AvailableModules"); -$head[$h][2] = 'common'; -$h++; - -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=marketplace"; -$head[$h][1] = $langs->trans("ModulesMarketPlaces"); -$head[$h][2] = 'marketplace'; -$h++; - -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=deploy"; -$head[$h][1] = $langs->trans("AddExtensionThemeModuleOrOther"); -$head[$h][2] = 'deploy'; -$h++; +$head = modules_prepare_head(); print "
\n"; @@ -806,7 +817,6 @@ if ($mode == 'marketplace') print ''.$langs->trans("URL").''; print ''; - print "\n"; $url='https://www.dolistore.com'; print ''; @@ -814,17 +824,63 @@ if ($mode == 'marketplace') print ''.$url.''; print ''; - - print "\n"; - $url='https://partners.dolibarr.org'; - print ''; - print ''.$langs->trans("DoliPartnersDesc").''; - print ''.$url.''; - print ''; - print "\n"; dol_fiche_end(); + + print '
'; + + if (empty($conf->global->MAIN_DISABLE_DOLISTORE_SEARCH) && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + print ''.$langs->trans('DOLISTOREdescriptionLong').'

'; + + $previouslink = $dolistore->get_previous_link(); + $nextlink = $dolistore->get_next_link(); + + print '
' + + ?> + + +
trans('Keyword') ?>: +
+
+
+ + trans('Reset') ?> + +   +
+
+ +
+ + +
'; + print '
'; + + ?> + +
+
    + get_categories(); ?> +
+
+
+ + + get_products($categorie); ?> + +
+
+ + '.$urldolibarrmodules.''; + $message=''; + if (! empty($allowonlineinstall)) + { + if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt))) + { + $message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); + $allowfromweb=-1; + } + else + { + if ($dirins_ok) + { + if (! is_writable(dol_osencode($dirins))) + { + $langs->load("errors"); + $message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins)); + $allowfromweb=0; + } + } + else + { + $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); + $allowfromweb=0; + } + } + } + else + { + $message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock')); + $allowfromweb=0; + } - $fullurl=''.$urldolibarrmodules.''; - $message=''; - if (! empty($allowonlineinstall)) - { - if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt))) - { - $message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); - $allowfromweb=-1; - } - else - { - if ($dirins_ok) - { - if (! is_writable(dol_osencode($dirins))) - { - $langs->load("errors"); - $message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins)); - $allowfromweb=0; - } - } - else - { + if ($allowfromweb < 1) + { + print $langs->trans("SomethingMakeInstallFromWebNotPossible"); + print $message; + //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); + print '
'; + } - $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); - $allowfromweb=0; - } - } - } - else - { - $message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock')); - $allowfromweb=0; - } + print '
'; - if ($allowfromweb < 1) - { - print $langs->trans("SomethingMakeInstallFromWebNotPossible"); - print $message; - //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); - print '
'; - } + if ($allowfromweb >= 0) + { + if ($allowfromweb == 1) + { + //print $langs->trans("ThisIsProcessToFollow").'
'; + } + else + { + print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; + print ''.$langs->trans("StepNb",1).': '; + print $langs->trans("FindPackageFromWebSite",$fullurl).'
'; + print ''.$langs->trans("StepNb",2).': '; + print $langs->trans("DownloadPackageFromWebSite",$fullurl).'
'; + print ''.$langs->trans("StepNb",3).': '; + } - print '
'; + if ($allowfromweb == 1) + { + print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; - if ($allowfromweb >= 0) - { - if ($allowfromweb == 1) - { - //print $langs->trans("ThisIsProcessToFollow").'
'; - } - else - { - print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; - print ''.$langs->trans("StepNb",1).': '; - print $langs->trans("FindPackageFromWebSite",$fullurl).'
'; - print ''.$langs->trans("StepNb",2).': '; - print $langs->trans("DownloadPackageFromWebSite",$fullurl).'
'; - print ''.$langs->trans("StepNb",3).': '; - } + print '
'; - if ($allowfromweb == 1) - { - print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; + print '
'; + print ''; + print ''; + print $langs->trans("YouCanSubmitFile").' '; + print ''; + print '
'; - print '
'; + print '
'; + print '
'; - print '
'; - print ''; - print ''; - print $langs->trans("YouCanSubmitFile").' '; - print ''; - print '
'; + print '
'; + } + else + { + print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; + print ''.$langs->trans("StepNb",4).': '; + print $langs->trans("SetupIsReadyForUse").'
'; + } + } - print '
'; - print '
'; + if (! empty($result['return'])) + { + print '
'; - print '
'; - } - else - { - print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; - print ''.$langs->trans("StepNb",4).': '; - print $langs->trans("SetupIsReadyForUse").'
'; - } - } + foreach($result['return'] as $value) + { + echo $value.'
'; + } + } + dol_fiche_end(); +} - if (! empty($result['return'])) - { - print '
'; +if ($mode == 'develop') +{ + dol_fiche_head($head, $mode, '', -1); - foreach($result['return'] as $value) - { - echo $value.'
'; - } - } + // Marketplace + print "\n"; + print "\n"; + //print ''; + print ''; + print ''; + print ''; - dol_fiche_end(); + print "\n"; + $url='https://partners.dolibarr.org'; + print ''; + print ''; + print ''; + print ''; + + print "
'.$langs->trans("Logo").''.$langs->trans("DevelopYourModuleDesc").''.$langs->trans("URL").'
'.$langs->trans("DoliPartnersDesc").''.$url.'
\n"; + + dol_fiche_end(); } diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index ac5ab678109..c6d00501015 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -100,7 +100,7 @@ elseif ($action == 'update_currency') if ($submit == $langs->trans('Modify')) { $fk_multicurrency = GETPOST('fk_multicurrency', 'int'); - $rate = GETPOST('rate', 'float'); + $rate = price2num(GETPOST('rate', 'alpha')); $currency = new MultiCurrency($db); if ($currency->fetch($fk_multicurrency) > 0) @@ -178,7 +178,7 @@ print ''.$langs->trans("Value").''."\n"; print ''; -print ''.$langs->transnoentitiesnoconv("multicurrency_useRateOnDocumentDate").''; +print ''.$langs->transnoentitiesnoconv("MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE").''; print ' '; print ''; print '
'; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 73fb3d91587..04427f636cd 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -55,7 +55,7 @@ if ($action == 'setvalue' && $user->admin) $result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity); if ($result < 0) $error++; - if (! $error) + if (! $error && is_array($_POST)) { //var_dump($_POST); foreach($_POST as $key => $val) @@ -172,7 +172,7 @@ $var=true; $i=0; foreach($listofnotifiedevents as $notifiedevent) { - + $label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder'); @@ -183,7 +183,7 @@ foreach($listofnotifiedevents as $notifiedevent) if ($i) print ', '; print $label; - + $i++; } print ''; @@ -213,7 +213,7 @@ $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); $var=true; foreach($listofnotifiedevents as $notifiedevent) { - + $label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder'); diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 061b9d50f6a..2ef7a500268 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -36,7 +36,7 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='invoice'; if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php'; @@ -188,7 +188,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; } print ''; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 6698be8b01f..a7ed12a5336 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2012-2105 Juanjo Menent + * Copyright (C) 2012-2107 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,7 +56,7 @@ if ($cancel) { if ($action == 'update') { dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity); - + dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", $_POST["MAIN_PDF_MARGIN_LEFT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", $_POST["MAIN_PDF_MARGIN_RIGHT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"],'chaine',0,'',$conf->entity); @@ -74,7 +74,11 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity); - + + + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -130,7 +134,8 @@ if ($action == 'edit') // Edit // Misc options print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'
'; - $var=true; + + print '
'; print ''; print ''; @@ -138,7 +143,7 @@ if ($action == 'edit') // Edit if (empty($selected)) $selected=dol_getDefaultFormat(); // Show pdf format - + print ''; @@ -155,26 +160,28 @@ if ($action == 'edit') // Edit print ''; - + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DictionaryPaperFormat").''; print $formadmin->select_paper_format($selected,'MAIN_PDF_FORMAT'); print '
'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").''; print ''; print '
'; + print '
'; print '
'; // Addresses print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'
'; - $var=true; + + print '
'; print ''; print ''; // Hide VAT Intra on address - + print ''; // Show prof id 1 in address into pdf - + if (! $noCountryCode) { $pid1=$langs->transcountry("ProfId1",$mysoc->country_code); @@ -192,7 +199,7 @@ if ($action == 'edit') // Edit } // Show prof id 2 in address into pdf - + if (! $noCountryCode) { $pid2=$langs->transcountry("ProfId2",$mysoc->country_code); @@ -210,7 +217,7 @@ if ($action == 'edit') // Edit } // Show prof id 3 in address into pdf - + if (! $noCountryCode) { $pid3=$langs->transcountry("ProfId3",$mysoc->country_code); @@ -228,7 +235,7 @@ if ($action == 'edit') // Edit } // Show prof id 4 in address into pdf - + if (! $noCountryCode) { $pid4=$langs->transcountry("ProfId4",$mysoc->country_code); @@ -246,51 +253,88 @@ if ($action == 'edit') // Edit } print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("ShowVATIntaInAddress").''; print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1); print '
'; + print '
'; print '
'; + // Localtaxes + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $locales =''; + $text=''; + + if ($mysoc->useLocalTax(1)) + { + $locales = $langs->transcountry("LT1",$mysoc->country_code); + $text ='' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . ''; + $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1); + $text .= ''; + } + + if ($mysoc->useLocalTax(2)) + { + $locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code); + + $text.= '' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . ''; + $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1); + $text.= ''; + } + + print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); + + print ''; + print ''; + print $text; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; + + } + // Other print load_fiche_titre($langs->trans("Other"),'','').'
'; - $var=true; - print ''; + + print '
'; + print '
'; print ''; // Hide any PDF informations - + print ''; //Desc - + print ''; //Ref - + print ''; //Details - + print ''; // Place customer adress to the ISO location - + print ''; - - + + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("HideAnyVATInformationOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); print '
'.$langs->trans("HideDescOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1); print '
'.$langs->trans("HideRefOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1); print '
'.$langs->trans("HideDetailsOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1); print '
'.$langs->trans("PlaceCustomerAddressToIsoLocation").''; print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1); print '
'.$langs->trans("ShowDetailsInPDFPageFoot").''; print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS); print '
'; + print '
'; print '
'; print ''; @@ -303,17 +347,16 @@ if ($action == 'edit') // Edit } else // Show { - $var=true; - // Misc options print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'',''); - - + + + print '
'; print ''; print ''; // Show pdf format - + print ''; - - + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DictionaryPaperFormat").''; $pdfformatlabel=''; @@ -352,24 +395,26 @@ else // Show print '
'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").''; print empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM; print '
'; + print '
'; print '
'; print load_fiche_titre($langs->trans("PDFAddressForging"),'',''); - print ''; + + print '
'; + print '
'; print ''; // Hide Intra VAT on address - + print ''; // Show prof id 1 in address into pdf - + if (! $noCountryCode) { $pid1=$langs->transcountry("ProfId1",$mysoc->country_code); @@ -387,7 +432,7 @@ else // Show } // Show prof id 2 in address into pdf - + if (! $noCountryCode) { $pid2=$langs->transcountry("ProfId2",$mysoc->country_code); @@ -405,7 +450,7 @@ else // Show } // Show prof id 3 in address into pdf - + if (! $noCountryCode) { $pid3=$langs->transcountry("ProfId3",$mysoc->country_code); @@ -423,7 +468,7 @@ else // Show } // Show prof id 4 in address into pdf - + if (! $noCountryCode) { $pid4=$langs->transcountry("ProfId4",$mysoc->country_code); @@ -441,18 +486,52 @@ else // Show } print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("ShowVATIntaInAddress").''; print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1); print '
'."\n"; + print '
'; print '
'; + // Localtaxes + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $locales =''; + $text=''; + + if ($mysoc->useLocalTax(1)) + { + $locales = $langs->transcountry("LT1",$mysoc->country_code); + $text ='' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . ''; + $text .= yn($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX,1); + $text .= ''; + } + + if ($mysoc->useLocalTax(2)) + { + $locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code); + + $text.= '' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . ''; + $text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX,1); + $text.= ''; + } + + print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); + + print ''; + print ''; + print $text; + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; + + } + // Other print load_fiche_titre($langs->trans("Other"),'',''); - $var=true; + + print '
'; print ''; print ''; - // Encrypt and protect PDF - + print ''; print ''; // Hide any PDF informations - + print ''; //Desc - + print ''; //Ref - + print ''; //Details - + print ''; - + print ''; - - + + print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; $text = $langs->trans("ProtectAndEncryptPdfFiles"); @@ -480,48 +559,51 @@ else // Show print '
'.$langs->trans("HideAnyVATInformationOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1); print '
'.$langs->trans("HideDescOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1); print '
'.$langs->trans("HideRefOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); print '
'.$langs->trans("HideDetailsOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); print '
'.$langs->trans("PlaceCustomerAddressToIsoLocation").''; print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION,1); print '
'.$langs->trans("ShowDetailsInPDFPageFoot").''; print $arraydetailsforpdffoot[$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS]; print '
'; + print '
'; /* * Library */ + print '
'; print load_fiche_titre($langs->trans("Library")); + print '
'; print ''."\n"; print ''."\n"; @@ -529,10 +611,9 @@ else // Show print ''."\n"; print "\n"; - $var=false; if (! empty($dolibarr_pdf_force_fpdf)) { - + print ''."\n"; print ''."\n"; print ''; } - + print ''."\n"; print ''."\n"; print ''."\n"; print "
'.$langs->trans("Value").'
dolibarr_pdf_force_fpdf'; @@ -541,7 +622,7 @@ else // Show print '
'.$langs->trans("LibraryToBuildPDF").''; @@ -580,6 +661,7 @@ else // Show print '
\n"; + print '
'; if (! empty($dolibarr_pdf_force_fpdf)) { diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 86108be0136..f368010078b 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir) else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 2f90145f3cc..b3434d0bd7a 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -43,7 +43,7 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='propal'; /* @@ -443,7 +443,7 @@ foreach ($dirmodels as $reldir) else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -455,7 +455,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 8c1b1fa5b07..161ef427265 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Juanjo Menent * @@ -103,6 +103,7 @@ else if ($action == 'delete') exit; } + /* * View */ @@ -130,6 +131,7 @@ dol_fiche_head($head, 'file', $langs->trans("Security"), -1); // Upload options $var=false; +print '
'; print ''; print ''; print ''; @@ -192,6 +194,7 @@ print ""; print ''; print '
'.$langs->trans("Parameters").'
'; +print '
'; dol_fiche_end(); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 6d65af336b9..d3ea8b9a63e 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -44,7 +44,7 @@ accessforbidden(); $type=GETPOST('type', 'alpha'); $value=GETPOST('value', 'alpha'); $action=GETPOST('action', 'alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $specimenthirdparty=new Societe($db); $specimenthirdparty->initAsSpecimen(); @@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir) //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") //{ // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; /*} @@ -411,7 +411,7 @@ foreach ($dirmodels as $reldir) else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -421,11 +421,11 @@ foreach ($dirmodels as $reldir) { //print img_picto($langs->trans("Default"),'on'); // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').''; } else { - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 21b3de68835..6b99bb1c39c 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -45,7 +45,7 @@ $type=GETPOST('type', 'alpha'); $value=GETPOST('value', 'alpha'); $label = GETPOST('label','alpha'); $action=GETPOST('action', 'alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $specimenthirdparty=new Societe($db); $specimenthirdparty->initAsSpecimen(); @@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir) print ''."\n"; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; } @@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir) else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -445,7 +445,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 4227f4d4221..c83b60cab63 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -39,7 +39,7 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='supplier_payment'; @@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; } print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 4e7efa4d922..44d8b2f3627 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -38,7 +38,7 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='supplier_proposal'; $error=0; @@ -423,7 +423,7 @@ foreach ($dirmodels as $reldir) else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -435,7 +435,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 4d32e10b174..8ddae2a3d5b 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -46,6 +46,7 @@ print load_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup'); print $langs->trans("FileCheckDesc").'

'; // Version +print '
'; print ''; print ''."\n"; print ''."\n"; @@ -63,6 +64,7 @@ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) { } print ''."\n"; print '
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.'
'; +print '
'; print '
'; @@ -133,7 +135,7 @@ if (GETPOST('target') == 'local') if (GETPOST('target') == 'remote') { $xmlarray = getURLContent($xmlremote); - + // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404') { @@ -147,20 +149,21 @@ if (GETPOST('target') == 'remote') setEventMessages($errormsg, null, 'errors'); $error++; } -} - +} + if ($xml) { $checksumconcat = array(); $file_list = array(); $out = ''; - + // Forced constants if (is_object($xml->dolibarr_constants[0])) { $out.=load_fiche_titre($langs->trans("ForcedConstants")); - + + $out.='
'; $out.=''; $out.=''; $out.=''; @@ -175,13 +178,13 @@ if ($xml) $constname=$constant['name']; $constvalue=(string) $constant; $constvalue = (empty($constvalue)?'0':$constvalue); - // Value found + // Value found $value=''; if ($constname && $conf->global->$constname != '') $value=$conf->global->$constname; $valueforchecksum=(empty($value)?'0':$value); - + $checksumconcat[]=$valueforchecksum; - + $i++; $out.=''; $out.='' . "\n"; @@ -196,10 +199,11 @@ if ($xml) $out.=''; } $out.='
#
'.$i.'
'.$langs->trans("None").'
'; - + $out.='
'; + $out.='
'; } - + // Scan htdocs if (is_object($xml->dolibarr_htdocs_dir[0])) { @@ -223,10 +227,11 @@ if ($xml) $file_list['added'][]=array('filename'=>$tmprelativefilename, 'md5'=>$md5newfile); } } - + // Files missings $out.=load_fiche_titre($langs->trans("FilesMissing")); - + + $out.='
'; $out.=''; $out.=''; $out.=''; @@ -247,18 +252,20 @@ if ($xml) $out.="\n"; } } - else + else { $out.=''; - } + } $out.='
#
'.$langs->trans("None").'
'; + $out.='
'; $out.='
'; // Files modified $out.=load_fiche_titre($langs->trans("FilesModified")); - + $totalsize=0; + $out.='
'; $out.=''; $out.=''; $out.=''; @@ -295,18 +302,20 @@ if ($xml) $out.='' . "\n"; $out.="\n"; } - else + else { $out.=''; } $out.='
#
'.$langs->trans("None").'
'; - + $out.='
'; + $out.='
'; - + // Files added $out.=load_fiche_titre($langs->trans("FilesAdded")); - + $totalsize = 0; + $out.='
'; $out.=''; $out.=''; $out.=''; @@ -348,8 +357,9 @@ if ($xml) $out.=''; } $out.='
#
'.$langs->trans("None").'
'; - - + $out.='
'; + + // Show warning if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3)) { @@ -358,7 +368,7 @@ if ($xml) else { setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings'); - } + } } else { @@ -374,9 +384,9 @@ if ($xml) $file_list = array(); $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list }*/ - - - asort($checksumconcat); // Sort list of checksum + + + asort($checksumconcat); // Sort list of checksum //var_dump($checksumconcat); $checksumget = md5(join(',',$checksumconcat)); $checksumtoget = trim((string) $xml->dolibarr_htdocs_dir_checksum); @@ -397,10 +407,10 @@ if ($xml) { print ''.$checksumget.''; } - + print '
'; print '
'; - + // Output detail print $out; } @@ -434,7 +444,7 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathre { $filename = $path.$file['name']; $file_list['insignature'][] = $filename; - + //if (preg_match('#'.$exclude.'#', $filename)) continue; if (!file_exists($pathref.'/'.$filename)) diff --git a/htdocs/admin/system/web.php b/htdocs/admin/system/web.php index d1864b1b409..7a5816ad3e8 100644 --- a/htdocs/admin/system/web.php +++ b/htdocs/admin/system/web.php @@ -40,26 +40,27 @@ if (!$user->admin) accessforbidden(); * View */ -llxHeader(); +llxHeader('', $langs->trans("InfoWebServer")); print load_fiche_titre($langs->trans("InfoWebServer"),'','title_setup'); +print '
'; print ''; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; +print '\n"; +print '\n"; +print '\n"; +print '\n"; +print '\n"; +print '\n"; +print '\n"; $labeluser=dol_getwebuser('user'); $labelgroup=dol_getwebuser('group'); if ($labeluser && $labelgroup) { - print "\n"; + print '\n"; } print '
".$langs->trans("Parameter")."".$langs->trans("Value")."
".$langs->trans("Version")."".$_SERVER["SERVER_SOFTWARE"]."
".$langs->trans("VirtualServerName")."" . $_SERVER["SERVER_NAME"] . "
".$langs->trans("IP")."".$_SERVER["SERVER_ADDR"]."
".$langs->trans("Port")."" . $_SERVER["SERVER_PORT"] . "
".$langs->trans("DocumentRootServer")."".$_SERVER["DOCUMENT_ROOT"]."
".$langs->trans("DataRootServer")."" . DOL_DATA_ROOT . "
'.$langs->trans("Parameter")."".$langs->trans("Value")."
'.$langs->trans("Version")."".$_SERVER["SERVER_SOFTWARE"]."
'.$langs->trans("VirtualServerName")."" . $_SERVER["SERVER_NAME"] . "
'.$langs->trans("IP")."".$_SERVER["SERVER_ADDR"]."
'.$langs->trans("Port")."" . $_SERVER["SERVER_PORT"] . "
'.$langs->trans("DocumentRootServer")."".$_SERVER["DOCUMENT_ROOT"]."
'.$langs->trans("DataRootServer")."" . DOL_DATA_ROOT . "
".$langs->trans("WebUserGroup")."".$labeluser.'/'.$labelgroup."
'.$langs->trans("WebUserGroup")."".$labeluser.'/'.$labelgroup."
'; - +print '
'; llxFooter(); diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 6b0bf70bf64..c09ab8ed3f9 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -116,7 +116,7 @@ print load_fiche_titre($langs->trans("Backup"),'','title_setup'); print '
'; print $langs->trans("BackupDesc",DOL_DATA_ROOT); print '
'; -print '

'; +print '
'; ?> @@ -465,13 +465,17 @@ if (! empty($_SESSION["commandbackuplastdone"])) } ?> -
+
'; +print ''; +print ''; + + ?> -
+
+
@@ -481,6 +485,7 @@ $result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'backup/ print '
'; ?> +
diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index fec00bd490c..f390c192159 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -70,7 +70,7 @@ print load_fiche_titre($langs->trans("Restore"),'','title_setup'); print '
'; print $langs->trans("RestoreDesc",DOL_DATA_ROOT); print '
'; -print '

'; +print '
'; ?>
@@ -156,7 +156,7 @@ if (in_array($type, array('mysql', 'mysqli'))) print '
'; print '
'; print ajax_autoselect('restorecommand'); - + if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '
'.$langs->trans("UnHidePassword").''; //else print '
'.$langs->trans("HidePassword").''; ?> diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index ebc4061fe6d..7e2fa8ee79d 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -88,6 +88,7 @@ if (!empty($ExecTimeLimit)) @set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64 error_reporting($err); } +$MemoryLimit=0; if (!empty($MemoryLimit)) { @ini_set('memory_limit', $MemoryLimit); @@ -120,10 +121,10 @@ $utils = new Utils($db); // MYSQL if ($what == 'mysql') { - + $cmddump=GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg $cmddump=dol_sanitizePathName($cmddump); - + if (! empty($dolibarr_main_restrict_os_commands)) { $arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands); @@ -142,13 +143,13 @@ if ($what == 'mysql') $errormsg=$langs->trans('CommandIsNotInsideAllowedCommands'); } } - + if (! $errormsg && $cmddump) { dolibarr_set_const($db, 'SYSTEMTOOLS_MYSQLDUMP', $cmddump,'chaine',0,'',$conf->entity); } - if (! $errormsg) + if (! $errormsg) { $utils->dumpDatabase(GETPOST('compression','alpha'), $what, 0, $file); $errormsg=$utils->error; @@ -172,13 +173,13 @@ if ($what == 'postgresql') { $cmddump=GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg $cmddump=dol_sanitizePathName($cmddump); - + if (! $errormsg && $cmddump) { dolibarr_set_const($db, 'SYSTEMTOOLS_POSTGRESQLDUMP', $cmddump,'chaine',0,'',$conf->entity); } - if (! $errormsg) + if (! $errormsg) { $utils->dumpDatabase(GETPOST('compression','alpha'), $what, 0, $file); $errormsg=$utils->error; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index fc1d2b72fdf..ac520ce22b3 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -100,7 +100,7 @@ $date_endyear = $tmp['year']; $now=dol_now(); // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $date_start=-1; $date_end=-1; @@ -260,11 +260,11 @@ if ($result) print ''; - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Code"),$_SERVER["PHP_SELF"],"e.type","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("IP"),$_SERVER["PHP_SELF"],"e.ip","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"u.login","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"e.description","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"e.dateevent","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Code",$_SERVER["PHP_SELF"],"e.type","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("IP",$_SERVER["PHP_SELF"],"e.ip","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("User",$_SERVER["PHP_SELF"],"u.login","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Description",$_SERVER["PHP_SELF"],"e.description","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 56db6eb2ad7..6106fbe8dd8 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -47,7 +47,7 @@ $langs->load("other"); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -128,12 +128,12 @@ if ($savehandler == 'files') { print ''; print ''; - print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"login","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("SessionId"),$_SERVER["PHP_SELF"],"id","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateModification"),$_SERVER["PHP_SELF"],"datem","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Age"),$_SERVER["PHP_SELF"],"age","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Raw"),$_SERVER["PHP_SELF"],"raw","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Login",$_SERVER["PHP_SELF"],"login","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("SessionId",$_SERVER["PHP_SELF"],"id","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"datec","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("DateModification",$_SERVER["PHP_SELF"],"datem","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Age",$_SERVER["PHP_SELF"],"age","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Raw",$_SERVER["PHP_SELF"],"raw","","",'align="left"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; @@ -141,7 +141,7 @@ if ($savehandler == 'files') foreach ($listofsessions as $key => $sessionentry) { - + print ''; diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index 7a5cb30ae75..bc328e951d4 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -31,7 +31,7 @@ if (! $user->admin) $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); -$choice=GETPOST('choice'); +$choice=GETPOST('choice','aZ09'); // Define filelog to discard it from purge diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index be48bd0c8f4..e2d2db9e659 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -64,8 +64,8 @@ $hookmanager->initHooks(array('admintranslation','globaladmin')); * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -74,7 +74,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $transkey=''; $transvalue=''; @@ -88,7 +88,45 @@ if ($action == 'setMAIN_ENABLE_OVERWRITE_TRANSLATION') else dolibarr_set_const($db, 'MAIN_ENABLE_OVERWRITE_TRANSLATION', 0, 'chaine', 0, '', $conf->entity); } -if ($action == 'add' || (GETPOST('add') && $action != 'update')) +if ($action == 'update') +{ + if ($transvalue == '') + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors'); + $error++; + } + if (! $error) + { + $db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".GETPOST('rowid','int'); + $result = $db->query($sql); + if ($result > 0) + { + $db->commit(); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + $action=""; + $transkey=""; + $transvalue=""; + } + else + { + + $db->rollback(); + if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + setEventMessages($langs->trans("WarningAnEntryAlreadyExistForTransKey"), null, 'warnings'); + } + else + { + setEventMessages($db->lasterror(), null, 'errors'); + } + $action=''; + } + } +} + +if ($action == 'add') { $error=0; @@ -162,6 +200,7 @@ if ($action == 'delete') * View */ +$form = new Form($db); $formadmin = new FormAdmin($db); $wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración'; @@ -208,7 +247,6 @@ print 'entity) && $debug)?'? if ($optioncss != '') print ''; print ''; print ''; -print ''; print ''; print ''; print ''; @@ -229,16 +267,16 @@ if ($mode == 'overwrite') print '
'; - print ''; - print ''; + print ''; print ''; + print '
'; print '
'; print ''; - print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Key"),$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("NewTranslationStringToShow"),$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder); - //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); + print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Key",$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("NewTranslationStringToShow",$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder); + //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); print ''; print "\n"; @@ -246,13 +284,16 @@ if ($mode == 'overwrite') // Line to add new record print "\n"; + $disablededit=''; + if ($action == 'edit') $disablededit=' disabled'; + print ''."\n"; print ''; // Limit to superadmin /*if (! empty($conf->multicompany->enabled) && !$user->entity) @@ -268,7 +309,7 @@ if ($mode == 'overwrite') print ''; //} $disabled=''; - if (empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) $disabled=' disabled="disabled"'; + if ($action == 'edit' || empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) $disabled=' disabled="disabled"'; print ''; print "\n"; print ''; @@ -306,11 +347,30 @@ if ($mode == 'overwrite') print ''; print ''; */ - print $obj->transvalue; + if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) + { + print ''; + } + else + { + print $obj->transvalue; + } print ''; print ''; print "\n"; @@ -319,8 +379,8 @@ if ($mode == 'overwrite') } } - print '
'; - print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, 0, 'maxwidthonsmartphone', 1); + print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, $disablededit?1:0, 'maxwidthonsmartphone', 1); print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
'; - print ''.img_delete().''; + if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) + { + print ''; + print ''; + print '   '; + print ''; + } + else + { + print ''.img_edit().''; + print '   '; + print ''.img_delete().''; + } print '
'; + print '
'; } @@ -387,16 +447,16 @@ if ($mode == 'searchkey') if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.')'; print print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n"; - print ''; print ''; print ''; + print '
'; print ''; print ''; - print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).''; - print_liste_field_titre($langs->trans("Key"),$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CurrentTranslationString"),$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder); - //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); + print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).''; + print_liste_field_titre("Key",$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("CurrentTranslationString",$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder); + //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity",$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); print ''; print "\n"; @@ -465,7 +525,7 @@ if ($mode == 'searchkey') } print '
'; - print ''; + print '
'; } dol_fiche_end(); diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 0dddfb3c4af..58ca4e0eded 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -27,6 +27,10 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); +$sortfield='file'; +$sortorder='ASC'; + + /* * Action */ @@ -50,20 +54,21 @@ print "
\n"; $interfaces = new Interfaces($db); $triggers = $interfaces->getTriggersList(); +$param = ''; $align = ''; print '
'; -print ' - - - - - -'; +print '
'.$langs->trans("File").''.$langs->trans("Active").' 
'; +print ''; +print getTitleFieldOfList($langs->trans("File"), 0, $_SERVER["PHP_SELF"], 'file', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; +print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, '', $sortfield, $sortorder, '', 1)."\n"; +print getTitleFieldOfList($langs->trans("Active"), 0, $_SERVER["PHP_SELF"], 'active', "", $param, 'align="center"', $sortfield, $sortorder, '', 1)."\n"; +print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; +print ''; $var=True; foreach ($triggers as $trigger) { - + print ''; print ''; print ''; diff --git a/htdocs/admin/websites.php b/htdocs/admin/websites.php index 1dc91786ada..4f829db31df 100644 --- a/htdocs/admin/websites.php +++ b/htdocs/admin/websites.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2017 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,8 +25,10 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +require_once DOL_DOCUMENT_ROOT.'/websites/class/website.class.php'; $langs->load("errors"); $langs->load("admin"); @@ -35,7 +37,6 @@ $langs->load("website"); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); -$id=GETPOST('id','int'); $rowid=GETPOST('rowid','alpha'); $id=1; @@ -47,24 +48,21 @@ $acts[1] = "disable"; $actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); $actl[1] = img_picto($langs->trans("Activated"),'switch_on'); -$listoffset=GETPOST('listoffset'); -$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; $status = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } -$offset = $listlimit * $page ; +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admin')); -// This page is a generic page to edit dictionaries -// Put here declaration of dictionaries properties - // Name of SQL tables of dictionaries $tabname=array(); $tabname[1] = MAIN_DB_PREFIX."website"; @@ -75,7 +73,7 @@ $tablib[1] = "Websites"; // Requests to extract data $tabsql=array(); -$tabsql[1] = "SELECT f.rowid as rowid, f.entity, f.ref, f.description, f.status FROM ".MAIN_DB_PREFIX."website as f"; +$tabsql[1] = "SELECT f.rowid as rowid, f.entity, f.ref, f.description, f.virtualhost, f.status FROM ".MAIN_DB_PREFIX."website as f"; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -83,15 +81,15 @@ $tabsqlsort[1] ="ref ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[1] = "ref,description"; +$tabfield[1] = "ref,description,virtualhost"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[1] = "ref,description"; +$tabfieldvalue[1] = "ref,description,virtualhost"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[1] = "ref,description,entity"; +$tabfieldinsert[1] = "ref,description,virtualhost,entity"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on @@ -105,7 +103,7 @@ $tabcond[1] = (! empty($conf->websites->enabled)); // List of help for fields $tabhelp=array(); -$tabhelp[1] = array(); +$tabhelp[1] = array('ref'=>$langs->trans("EnterAnyCode"), 'virtualhost'=>$langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/websites/websiteref')); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); @@ -116,8 +114,8 @@ $tabfieldcheck[1] = array(); $elementList = array(); $sourceList=array(); -// Actions add or modify an entry into a dictionary -if (GETPOST('actionadd') || GETPOST('actionmodify')) +// Actions add or modify a website +if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) { $listfield=explode(',',$tabfield[$id]); $listfieldinsert=explode(',',$tabfieldinsert[$id]); @@ -128,16 +126,29 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=1; foreach ($listfield as $f => $value) { - if (! isset($_POST[$value]) || $_POST[$value]=='') // Fields that are not mandatory + if ((! isset($_POST[$value]) || $_POST[$value]=='') + && (! in_array($listfield[$f], array('virtualhost')))) // Fields that are not mandatory { $ok=0; $fieldnamekey=$listfield[$f]; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); + } + if ($value == 'ref' && ! preg_match('/^[a-z0-9_\-\.]+$/i', $_POST[$value])) + { + $ok=0; + $fieldnamekey=$listfield[$f]; + setEventMessages($langs->transnoentities("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities($fieldnamekey)), null, 'errors'); } } - + + // Clean parameters + if (! empty($_POST['ref'])) + { + $websitekey=strtolower($_POST['ref']); + } + // Si verif ok et action add, on ajoute la ligne - if ($ok && GETPOST('actionadd')) + if ($ok && GETPOST('actionadd','alpha')) { if ($tabrowid[$id]) { @@ -155,6 +166,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } } + /* $website=new Website($db); + $website->ref= + $website->description= + $website->virtualhost= + $website->create($user); */ + // Add new entry $sql = "INSERT INTO ".$tabname[$id]." ("; // List of fields @@ -173,6 +190,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'entity') { $_POST[$listfieldvalue[$i]] = $conf->entity; } + if ($value == 'ref') { + $_POST[$listfieldvalue[$i]] = strtolower($_POST[$listfieldvalue[$i]]); + } if ($i) $sql.=","; if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; @@ -184,8 +204,31 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $result = $db->query($sql); if ($result) // Add is ok { + global $dolibarr_main_data_root; + $pathofwebsite=$dolibarr_main_data_root.'/websites/'.$websitekey; + $filehtmlheader=$pathofwebsite.'/htmlheader.html'; + $filecss=$pathofwebsite.'/styles.css.php'; + $filetpl=$pathofwebsite.'/page'.$pageid.'.tpl.php'; + $fileindex=$pathofwebsite.'/index.php'; + + // Css file + $csscontent = ''."\n"; + $csscontent.= ''."\n"; + $csscontent.= '"."\n"; + $csscontent.= ''."\n"; + $csscontent.= 'body { margin: 0; }'."\n"; + + dol_syslog("Save file css into ".$filecss); + + dol_mkdir($pathofwebsite); + $result = file_put_contents($filecss, $csscontent); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filecss, octdec($conf->global->MAIN_UMASK)); + setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); - $_POST=array('id'=>$id); // Clean $_POST array, we keep only + unset($_POST); // Clean $_POST array, we keep only } else { @@ -199,11 +242,17 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } // Si verif ok et action modify, on modifie la ligne - if ($ok && GETPOST('actionmodify')) + if ($ok && GETPOST('actionmodify','alpha')) { if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } + $db->begin(); + + $website=new Website($db); + $rowid=GETPOST('rowid','int'); + $website->fetch($rowid); + // Modify entry $sql = "UPDATE ".$tabname[$id]." SET "; // Modifie valeur des champs @@ -229,15 +278,52 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) dol_syslog("actionmodify", LOG_DEBUG); //print $sql; $resql = $db->query($sql); - if (! $resql) + if ($resql) { - setEventMessages($db->error(), null, 'errors'); + $newname = dol_sanitizeFileName(GETPOST('ref','aZ09')); + if ($newname != $website->ref) + { + $srcfile=DOL_DATA_ROOT.'/websites/'.$website->ref; + $destfile=DOL_DATA_ROOT.'/websites/'.$newname; + + if (dol_is_dir($destfile)) + { + $error++; + setEventMessages($langs->trans('ErrorDirAlreadyExists', $destfile), null, 'errors'); + } + else + { + @rename($srcfile, $destfile); + + // We must now rename $website->ref into $newname inside files + $arrayreplacement = array($website->ref.'/htmlheader.html' => $newname.'/htmlheader.html'); + $listofilestochange = dol_dir_list($destfile, 'files', 0, '\.php$'); + foreach ($listofilestochange as $key => $value) + { + dolReplaceInFile($value['fullname'], $arrayreplacement); + } + } + } + } + else + { + $error++; + setEventMessages($db->lasterror(), null, 'errors'); + } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); } } //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } -if (GETPOST('actioncancel')) +if (GETPOST('actioncancel','alpha')) { //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } @@ -247,9 +333,9 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } - $sql = "DELETE from ".MAIN_DB_PREFIX."website_pages WHERE fk_website ='".$rowid."'"; + $sql = "DELETE from ".MAIN_DB_PREFIX."website_page WHERE fk_website ='".$rowid."'"; $result = $db->query($sql); - + $sql = "DELETE from ".MAIN_DB_PREFIX."website WHERE rowid ='".$rowid."'"; $result = $db->query($sql); if (! $result) @@ -321,12 +407,12 @@ print "
\n"; // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&id='.$id, $langs->trans('DeleteWebsite'), $langs->trans('ConfirmDeleteWebsite'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid, $langs->trans('DeleteWebsite'), $langs->trans('ConfirmDeleteWebsite'), 'confirm_delete','',0,1); } //var_dump($elementList); /* - * Show a dictionary + * Show website list */ if ($id) { @@ -350,12 +436,12 @@ if ($id) $sql.=" ORDER BY "; } $sql.=$tabsqlsort[$id]; - $sql.=$db->plimit($listlimit+1,$offset); + $sql.=$db->plimit($limit+1, $offset); //print $sql; $fieldlist=explode(',',$tabfield[$id]); - print '
'; + print ''; print ''; print '
'.$trigger['picto'].''.$trigger['file'].'
'; @@ -381,16 +467,18 @@ if ($id) { print ''; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; } - if ($id == 4) print ''; print ''; print ''; @@ -399,11 +487,11 @@ if ($id) $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd')) + if (GETPOST('actionadd','alpha')) { foreach ($fieldlist as $key=>$val) { - if (GETPOST($val)) + if (GETPOST($val,'alpha')) $obj->$val=GETPOST($val); } } @@ -434,8 +522,7 @@ if ($id) - // List of available values in database - dol_syslog("htdocs/admin/dict", LOG_DEBUG); + // List of websites in database $resql=$db->query($sql); if ($resql) { @@ -444,21 +531,13 @@ if ($id) if ($num) { print '
'; - - print ''; + + print ''; print ''; print ''; print ''; - + print '
'; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; - else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); + elseif (! empty($tabhelp[$id][$value])) + { + if ($value == 'virtualhost') print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, 'tooltipvirtual'); + else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); + } else print $valuetoshow; print ''; - print ''; print '
'; - - // There is several pages - if ($num > $listlimit) - { - print ''; - } // Title of lines print ''; @@ -486,11 +565,11 @@ if ($id) // Affiche nom du champ if ($showfield) { - print getTitleFieldOfList($valuetoshow,0,$_SERVER["PHP_SELF"],($sortable?$fieldlist[$field]:''),($page?'page='.$page.'&':'').'&id='.$id,"","align=".$align,$sortfield,$sortorder); + print getTitleFieldOfList($valuetoshow,0,$_SERVER["PHP_SELF"],($sortable?$fieldlist[$field]:''),($page?'page='.$page.'&':''),"","align=".$align,$sortfield,$sortorder); } } - print getTitleFieldOfList($langs->trans("Status"),0,$_SERVER["PHP_SELF"],"status",($page?'page='.$page.'&':'').'&id='.$id,"",'align="center"',$sortfield,$sortorder); + print getTitleFieldOfList($langs->trans("Status"),0,$_SERVER["PHP_SELF"],"status",($page?'page='.$page.'&':''),"",'align="center"',$sortfield,$sortorder); print getTitleFieldOfList(''); print getTitleFieldOfList(''); print ''; @@ -539,7 +618,7 @@ if ($id) // Can an entry be erased or disabled ? $iserasable=1;$isdisable=1; // true by default - $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&id='.$id.'&'; + $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&'; // Active print '
'; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$id, ($num > $listlimit), ''); - print '
'; @@ -558,9 +637,9 @@ if ($id) } $i++; } - + print '
'; - + print ''; } } diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index af104fd4bfe..c730760898d 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -77,11 +77,11 @@ $workflowcodes=array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('family'=>'create', 'position'=>10, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'), 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('family'=>'create', 'position'=>20, 'enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'), // Automatic classification - 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'), - 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'), + 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>''), + 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'order','warning'=>''), // For the following 2 options, if module invoice is disabled, they does not exists, so "Classify billed" for order must be done manually from order card. - 'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>40, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), - 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>50, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'), + 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>50, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>''), + 'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>40, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>''), 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->expedition->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'), ); diff --git a/htdocs/api/README.md b/htdocs/api/README.md index b4ff7a89f7b..0b773888882 100644 --- a/htdocs/api/README.md +++ b/htdocs/api/README.md @@ -1,41 +1,54 @@ -API REST howto -============== +API REST +======== -This directory contains files to make Dolibarr a server of REST Web Services. -It depends on external library Restler. +## Integrate your ERP with any other applications using Dolibarr APIs + +This module provides the service to make Dolibarr a server of REST Web Services. It depends on external library Restler. + +Extract any data or push insert, update or delete record using our new REST APIs. Using standard HTTP and Json format, it is compatible with any language (PHP, Java, Ruby, Python, C#, C++, JavaScript, JQuery, Basic, ...). Use the embedded APIs explorer tool to test APIs or get generated URLs to use in your own code. -Explore the api ---------------- +
+ Dolibarr API explorer +
-You can explore API method by using web interface : https://**yourdolibarr.tld**/mydolibarr/api/admin/explorer.php (replace **yourdolibarr.tld** by real hostname of your Dolibarr installation) -Access to the API + +Explore the APIs +---------------- + +You can explore all available APIs by using the API explorer : [**yourdolibarr.tld**/api/index.php/explorer](../api/index.php/explorer) (replace **yourdolibarr.tld** by real hostname of your Dolibarr installation) + + +Access to an API ----------------- -> **Warning : access to the API should (or better : must!) be secured with SSL connection** +> **Warning : access to any API should (or better : must!) be secured with SSL connection** -To access to the API you need a token to identify. When you access the API for the first time, you need to log in with user name and password to get a token. **Only** this token will allow to access API with. +To access to the API you need a token to identify. **Only** this token will allow to access API with. +The token is dedicated to a user and it **must** be put into requests as **DOLAPIKEY** parameter in HTTP header (or among URL parameters, but this is less secured). -To log in with the API, use this uri : https://**yourdolibarr.tld**/mydolibarr/api/index.php/login?login=**username**&password=**password** (replace bold strings with real values) +To get a token you can: -The token will be saved by Dolibarr for next user accesses to the API and it **must** be put into request uri as **api_key** parameter. +* Edit the user card to set the value of token. Each user can have a different token. +* or Call the *login* API with login and password. This will return the value of token for the user used to login. Then call other services with -https://**yourdolibarr.tld**/mydolibarr/api/index.php/otherservice?api_key=**api_key** +https://**yourdolibarr.tld**/mydolibarr/api/index.php/otherservice?DOLAPIKEY=**api_key** -Develop the API ---------------- +Develop an API +-------------- The API uses Lucarast Restler framework. Please check documentation https://www.luracast.com/products/restler and examples http://help.luracast.com/restler/examples/ + Github contains also usefull informations : https://github.com/Luracast/Restler -To implement it into Dolibarr, we need to create a specific class for object we want to use. A skeleton file is available into /dev directory : *skeleton_api_class.class.php* +To implement it into Dolibarr, you need to create a specific class for object we want to use. A skeleton file is available into /modulebuilder/class directory : *api_mymodule_class.class.php* The API class file must be put into object class directory, with specific file name. By example, API class file for '*myobject*' must be put as : /htdocs/*myobject*/class/api_*myobject*.class.php. Class must be named **MyobjectApi**. -If a module provide several object, use a different name for '*myobject*' and put the file into the same directory. +If a module provide several object, use a different name for *'myobject'* and put the file into the same directory. **Define url for methods** diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 190e24d326c..40e00d01ffd 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -42,10 +42,11 @@ class DolibarrApi /** * Constructor * - * @param DoliDb $db Database handler - * @param string $cachedir Cache dir + * @param DoliDb $db Database handler + * @param string $cachedir Cache dir + * @param boolean $refreshCache Update cache */ - function __construct($db, $cachedir='') + function __construct($db, $cachedir='', $refreshCache=false) { global $conf; @@ -54,7 +55,7 @@ class DolibarrApi $this->db = $db; $production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true ); - $this->r = new Restler($production_mode); + $this->r = new Restler($production_mode, $refreshCache); $this->r->setAPIVersion(1); } @@ -66,7 +67,7 @@ class DolibarrApi * * @return array */ - /* Disabled, most APIs does not share same signature for method index + /* Disabled, most APIs does not share same signature for method index function index() { return array( @@ -93,9 +94,9 @@ class DolibarrApi unset($object->linkedObjects); unset($object->lines); // should be ->lines - + unset($object->fields); - + unset($object->oldline); unset($object->error); @@ -175,7 +176,7 @@ class DolibarrApi * @throws RestException */ static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') { - + // Features/modules to check $featuresarray = array($resource); if (preg_match('/&/', $resource)) { diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index 407f94ac915..b2dcfefa49f 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -80,25 +80,25 @@ class DolibarrApiAccess implements iAuthenticate { dol_syslog($key.' - '.$val); }*/ - + // api key can be provided in url with parameter api_key=xxx or ni header with header DOLAPIKEY:xxx $api_key = ''; - if (isset($_GET['api_key'])) + if (isset($_GET['api_key'])) { // TODO Add option to disable use of api key on url. Return errors if used. $api_key = $_GET['api_key']; // For backward compatibility } - if (isset($_GET['DOLAPIKEY'])) + if (isset($_GET['DOLAPIKEY'])) { // TODO Add option to disable use of api key on url. Return errors if used. $api_key = $_GET['DOLAPIKEY']; // With GET method } - if (isset($_SERVER['HTTP_DOLAPIKEY'])) + if (isset($_SERVER['HTTP_DOLAPIKEY'])) // Param DOLAPIKEY in header can be read with HTTP_DOLAPIKEY { $api_key = $_SERVER['HTTP_DOLAPIKEY']; // With header method (recommanded) } - - if ($api_key) + + if ($api_key) { $sql = "SELECT u.login, u.datec, u.api_key, "; $sql.= " u.tms as date_modification, u.entity"; diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index 9b965e24c33..c6b71e8b25c 100644 --- a/htdocs/api/class/api_login.class.php +++ b/htdocs/api/class/api_login.class.php @@ -34,25 +34,25 @@ class Login /** * Login * - * Request the API token for a couple username / password. + * Request the API token for a couple username / password. * Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file). - * Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page). - * + * Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page). + * * @param string $login User login * @param string $password User password - * @param int $entity Entity (when multicompany module is used). Empty means 1=first company. + * @param string $entity Entity (when multicompany module is used). '' means 1=first company. * @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access) * @return array Response status and user token * * @throws RestException - * + * * @url GET / * @url POST / */ - public function index($login, $password, $entity=0, $reset=0) { + public function index($login, $password, $entity='', $reset=0) { global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; - + // Authentication mode if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication = 'http,dolibarr'; @@ -62,6 +62,8 @@ class Login // Set authmode $authmode = explode(',', $dolibarr_main_authentication); + if ($entity == '') $entity=1; + include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; $login = checkLoginPassEntity($login, $password, $entity, $authmode); if (empty($login)) @@ -70,21 +72,21 @@ class Login } $token = 'failedtogenerateorgettoken'; - + $tmpuser=new User($this->db); - $tmpuser->fetch(0, $login); - + $tmpuser->fetch(0, $login, 0, 0, $entity); + // Renew the hash if (empty($tmpuser->api_key) || $reset) { // Generate token for user $token = dol_hash($login.uniqid().$conf->global->MAIN_API_KEY,1); - + // We store API token into database $sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql.= " SET api_key = '".$this->db->escape($token)."'"; $sql.= " WHERE login = '".$this->db->escape($login)."'"; - + dol_syslog(get_class($this)."::login", LOG_DEBUG); // No log $result = $this->db->query($sql); if (!$result) @@ -96,13 +98,14 @@ class Login { $token = $tmpuser->api_key; } - + //return token return array( 'success' => array( 'code' => 200, 'token' => $token, - 'message' => 'Welcome ' . $login.($reset?' - Token is new':' - This is your token (generated by a previous call). You can use it to make any REST API call, or enter it into the DOLAPIKEY field to use the Dolibarr API explorer.') + 'entity' => $tmpuser->entity, + 'message' => 'Welcome ' . $login.($reset?' - Token is new':' - This is your token (generated by a previous call). You can use it to make any REST API call, or enter it into the DOLAPIKEY field to use the Dolibarr API explorer.') ) ); } diff --git a/htdocs/api/index.php b/htdocs/api/index.php index c1233295674..5d8763c7bfe 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -21,13 +21,21 @@ * \defgroup api Module DolibarrApi * \brief API loader * Search files htdocs//class/api_.class.php - * \file htdocs/api/indexphp - * - * @todo User authentication with api_key + * \file htdocs/api/index.php */ -if (! defined("NOLOGIN")) define("NOLOGIN",'1'); -if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) + $DOLAPIENTITY = $_SERVER['HTTP_DOLAPIENTITY']; $entity=(! empty($DOLAPIENTITY) ? (int) $DOLAPIENTITY : (! empty($DOLAPIENTITY) ? (int) $DOLAPIENTITY : 1)); @@ -71,7 +79,31 @@ if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($ } -$api = new DolibarrApi($db); + + +// Analyze URLs +// index.php/explorer do a redirect to index.php/explorer/ +// index.php/explorer/ called by swagger to build explorer page +// index.php/explorer/.../....png|.css|.js called by swagger for resources to build explorer page +// index.php/explorer/resources.json called by swagger to get list of all services +// index.php/explorer/resources.json/xxx called by swagger to get detail of services xxx +// index.php/xxx called by any REST client to run API + + +preg_match('/index\.php\/([^\/]+)(.*)$/', $_SERVER["PHP_SELF"], $reg); +// .../index.php/categories?sortfield=t.rowid&sortorder=ASC + + +// Set the flag to say to refresh (when we reload the explorer, production must be for API call only) +$refreshcache=false; +if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) +{ + $refreshcache=true; +} + + +$api = new DolibarrApi($db, '', $refreshcache); +//var_dump($api->r->apiVersionMap); // Enable the Restler API Explorer. // See https://github.com/Luracast/Restler-API-Explorer for more info. @@ -83,110 +115,82 @@ $api->r->addAuthenticationClass('DolibarrApiAccess',''); // Define accepted mime types UploadFormat::$allowedMimeTypes = array('image/jpeg', 'image/png', 'text/plain', 'application/octet-stream'); -$listofapis = array(); -$modulesdir = dolGetModulesDirs(); -foreach ($modulesdir as $dir) + +// Call Explorer file for all APIs definitions +if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) { - /* - * Search available module - */ - //dol_syslog("Scan directory ".$dir." for API modules"); + // Scan all API files to load them - $handle=@opendir(dol_osencode($dir)); - if (is_resource($handle)) + $listofapis = array(); + + $modulesdir = dolGetModulesDirs(); + foreach ($modulesdir as $dir) { - while (($file = readdir($handle))!==false) + // Search available module + dol_syslog("Scan directory ".$dir." for module descriptor to after search for API files"); + + $handle=@opendir(dol_osencode($dir)); + if (is_resource($handle)) { - if (is_readable($dir.$file) && preg_match("/^mod(.*)\.class\.php$/i",$file,$reg)) + while (($file = readdir($handle))!==false) { - $module = strtolower($reg[1]); - $moduledirforclass = $module; - $moduleforperm = $module; - - if ($module == 'propale') { - $moduledirforclass = 'comm/propal'; - $moduleforperm='propal'; - } - elseif ($module == 'agenda') { - $moduledirforclass = 'comm/action'; - } - elseif ($module == 'adherent') { - $moduledirforclass = 'adherents'; - } - elseif ($module == 'banque') { - $moduledirforclass = 'compta/bank'; - } - elseif ($module == 'categorie') { - $moduledirforclass = 'categories'; - } - elseif ($module == 'facture') { - $moduledirforclass = 'compta/facture'; - } - elseif ($module == 'project') { - $moduledirforclass = 'projet'; - } - elseif ($module == 'task') { - $moduledirforclass = 'projet'; - } - elseif ($module == 'stock') { - $moduledirforclass = 'product/stock'; - } - elseif ($module == 'fournisseur') { - $moduledirforclass = 'fourn'; - } - //dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass); - - // Defined if module is enabled - $enabled=true; - if (empty($conf->$moduleforperm->enabled)) $enabled=false; - - if ($enabled) + if (is_readable($dir.$file) && preg_match("/^mod(.*)\.class\.php$/i",$file,$regmod)) { - /* - * If exists, load the API class for enable module - * - * Search files named api_.class.php into /htdocs//class directory - * - * @todo : use getElementProperties() function ? - */ - $dir_part = dol_buildpath('/'.$moduledirforclass.'/class/'); + $module = strtolower($regmod[1]); + $moduledirforclass = getModuleDirForApiClass($module); + $moduleforperm = $module; + if ($module == 'propale') { $moduleforperm='propal'; } - $handle_part=@opendir(dol_osencode($dir_part)); - if (is_resource($handle_part)) + //dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass); + + // Defined if module is enabled + $enabled=true; + if (empty($conf->$moduleforperm->enabled)) $enabled=false; + + if ($enabled) { - while (($file_searched = readdir($handle_part))!==false) - { - if ($file_searched == 'api_access.class.php') continue; + // If exists, load the API class for enable module + // Search files named api_.class.php into /htdocs//class directory + // @todo : use getElementProperties() function ? + $dir_part = dol_buildpath('/'.$moduledirforclass.'/class/'); - // Support of the deprecated API. - if (is_readable($dir_part.$file_searched) && preg_match("/^api_deprecated_(.*)\.class\.php$/i",$file_searched,$reg)) + $handle_part=@opendir(dol_osencode($dir_part)); + if (is_resource($handle_part)) + { + while (($file_searched = readdir($handle_part))!==false) { - $classname = ucwords($reg[1]).'Api'; - require_once $dir_part.$file_searched; - if (class_exists($classname)) + if ($file_searched == 'api_access.class.php') continue; + + // Support of the deprecated API. + if (is_readable($dir_part.$file_searched) && preg_match("/^api_deprecated_(.*)\.class\.php$/i",$file_searched,$regapi)) { - //dol_syslog("Found deprecated API by index.php: classname=".$classname." for module ".$dir." into ".$dir_part.$file_searched); - $api->r->addAPIClass($classname, '/'); + $classname = ucwords($regapi[1]).'Api'; + require_once $dir_part.$file_searched; + if (class_exists($classname)) + { + //dol_syslog("Found deprecated API by index.php: classname=".$classname." for module ".$dir." into ".$dir_part.$file_searched); + $api->r->addAPIClass($classname, '/'); + } + else + { + dol_syslog("We found an api_xxx file (".$file_searched.") but class ".$classname." does not exists after loading file", LOG_WARNING); + } } - else + elseif (is_readable($dir_part.$file_searched) && preg_match("/^api_(.*)\.class\.php$/i",$file_searched,$regapi)) { - dol_syslog("We found an api_xxx file (".$file_searched.") but class ".$classname." does not exists after loading file", LOG_WARNING); - } - } - elseif (is_readable($dir_part.$file_searched) && preg_match("/^api_(.*)\.class\.php$/i",$file_searched,$reg)) - { - $classname = ucwords($reg[1]); - $classname = str_replace('_', '', $classname); - require_once $dir_part.$file_searched; - if (class_exists($classname)) - { - //dol_syslog("Found API by index.php: classname=".$classname." for module ".$dir." into ".$dir_part.$file_searched); - $listofapis[] = $classname; - } - else - { - dol_syslog("We found an api_xxx file (".$file_searched.") but class ".$classname." does not exists after loading file", LOG_WARNING); + $classname = ucwords($regapi[1]); + $classname = str_replace('_', '', $classname); + require_once $dir_part.$file_searched; + if (class_exists($classname)) + { + //dol_syslog("Found API by index.php: classname=".$classname." for module ".$dir." into ".$dir_part.$file_searched); + $listofapis[] = $classname; + } + else + { + dol_syslog("We found an api_xxx file (".$file_searched.") but class ".$classname." does not exists after loading file", LOG_WARNING); + } } } } @@ -195,20 +199,61 @@ foreach ($modulesdir as $dir) } } } + + // Sort the classes before adding them to Restler. + // The Restler API Explorer shows the classes in the order they are added and it's a mess if they are not sorted. + sort($listofapis); + foreach ($listofapis as $classname) + { + $api->r->addAPIClass($classname); + } } -// Sort the classes before adding them to Restler. The Restler API Explorer -// shows the classes in the order they are added and it's a mess if they are -// not sorted. -sort($listofapis); -//var_dump($listofapis); -foreach ($listofapis as $classname) +// Call one APIs or one definition of an API +if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json' && preg_match('/^\/resources.json\/(.+)$/', $reg[2], $regbis) && $regbis[1] != 'root'))) { - $api->r->addAPIClass($classname); + $module = $reg[1]; + if ($module == 'explorer') // If we call page to explore details of a service + { + $module = $regbis[1]; + } + + // Load a dedicated API file + dol_syslog("Load a dedicated API file"); + + $module=strtolower($module); + $moduledirforclass = getModuleDirForApiClass($module); + + if (in_array($module, array('category','contact','customer','invoice','order','product','thirdparty','user'))) // Old Apis + { + $classfile = $module; + if ($module == 'customer') { $classfile = 'thirdparty'; } + if ($module == 'order') { $classfile = 'commande'; } + $dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_deprecated_'.$classfile.'.class.php'); + $classname=ucwords($module); + if ($module == 'customer') { $classname='Thirdparty'; } + if ($module == 'order') { $classname='Commande'; } + //var_dump($classfile);var_dump($classname);exit; + + require_once $dir_part_file; + if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/'); + } + else + { + $classfile = str_replace('_', '', $module); + if ($module == 'supplierinvoices') $classfile = 'supplier_invoices'; + if ($module == 'supplierorders') $classfile = 'supplier_orders'; + $dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php'); + $classname=ucwords($module); + + require_once $dir_part_file; + if (class_exists($classname)) $api->r->addAPIClass($classname); + } } // TODO If not found, redirect to explorer -//var_dump($api); +//var_dump($api->r->apiVersionMap); +//exit; // Call API (we suppose we found it) $api->r->handle(); diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index b6a022db898..eca126697cc 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -40,7 +40,28 @@ function printBookmarksList($aDb, $aLangs) $langs->load("bookmarks"); - $url= $_SERVER["PHP_SELF"].(dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):''); + $url= $_SERVER["PHP_SELF"]; + + if (! empty($_SERVER["QUERY_STRING"])) + { + $url.=(dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):''); + } + else + { + global $sortfield,$sortorder; + $tmpurl=''; + // No urlencode, all param $url will be urlencoded later + if ($sortfield) $tmpurl.=($tmpurl?'&':'').'sortfield='.$sortfield; + if ($sortorder) $tmpurl.=($tmpurl?'&':'').'sortorder='.$sortorder; + if (is_array($_POST)) + { + foreach($_POST as $key => $val) + { + if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val; + } + } + $url.=($tmpurl?'?'.$tmpurl:''); + } $ret = ''; @@ -55,7 +76,8 @@ function printBookmarksList($aDb, $aLangs) // Url to go on create new bookmark page if ($user->rights->bookmark->creer) { - $urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); + //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); + $urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); $ret.= ''; } // Menu with all bookmarks diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index a9d4a39ef85..2c3b200b4e4 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -39,6 +39,7 @@ $id=GETPOST("id"); $action=GETPOST("action","alpha"); $title=GETPOST("title","alpha"); $url=GETPOST("url","alpha"); +$urlsource=GETPOST("urlsource","alpha"); $target=GETPOST("target","alpha"); $userid=GETPOST("userid","int"); $position=GETPOST("position","int"); @@ -62,9 +63,9 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update') $error = 0; - if (GETPOST("cancel")) + if (GETPOST('cancel','alpha')) { - if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php')); + if (empty($backtopage)) $backtopage=($urlsource?$urlsource:((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php')); header("Location: ".$backtopage); exit; } @@ -97,7 +98,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update') if ($res > 0) { - if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):DOL_URL_ROOT.'/bookmarks/list.php'); + if (empty($backtopage)) $backtopage=($urlsource?$urlsource:((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php')); header("Location: ".$backtopage); exit; } @@ -121,6 +122,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update') } } + /* * View */ @@ -153,15 +155,15 @@ if ($action == 'create') print load_fiche_titre($langs->trans("NewBookmark")); - dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark'); + dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), 0, 'bookmark'); print ''; print ''; dol_set_focus('#titlebookmark'); - + // Url - print ''; + print ''; // Target print ''; print "\n"; diff --git a/htdocs/cashdesk/javascript/dhtml.js b/htdocs/cashdesk/javascript/dhtml.js index 7f5df55a767..db05855a3b2 100644 --- a/htdocs/cashdesk/javascript/dhtml.js +++ b/htdocs/cashdesk/javascript/dhtml.js @@ -51,26 +51,14 @@ function file(fichier) { } -// Affichage des donnees aTexte dans le bloc identifie par aId -function afficheDonnees(aId, aTexte) { - - document.getElementById(aId).innerHTML = aTexte; - -} - - // aCible : id du bloc de destination; aCode : argument a passer a la page php chargee du traitement et de l'affichage function verifResultat(aCible, aCode, iLimit) { if (aCode != '' && aCode.length >= iLimit) { if (texte = file('facturation_dhtml.php?code='+escape(aCode))) { - - afficheDonnees (aCible, texte); - + document.getElementById(aCible).innerHTML = texte; } else - - afficheDonnees (aCible, ''); - + document.getElementById(aCible).innerHTML = ''; } } diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 580012847f5..3f0a0f4c371 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -42,11 +42,10 @@ $langs->load("cashdesk"); +
'.$langs->trans("BookmarkTitle").''.$langs->trans("SetHereATitleForLink").'
'.$langs->trans("UrlOrLink").''.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'
'.$langs->trans("UrlOrLink").''.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'
'.$langs->trans("BehaviourOnClick").''; @@ -219,14 +221,14 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) } - dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark'); + dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0); print '
'; - + print '
'; print ''; @@ -304,7 +306,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) print '
'; print '
'; - + dol_fiche_end(); if ($action == 'edit') diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 26eabc5a5ed..b72089e61b8 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -32,7 +32,7 @@ class Bookmark extends CommonObject public $table_element='bookmark'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'bookmark'; - + var $db; var $id; @@ -111,7 +111,7 @@ class Bookmark extends CommonObject $this->url=trim($this->url); $this->title=trim($this->title); if (empty($this->position)) $this->position=0; - + $now=dol_now(); $this->db->begin(); @@ -119,14 +119,12 @@ class Bookmark extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_user,dateb,url,target"; $sql.= ",title,favicon,position"; $sql.= ",entity"; - if ($this->fk_soc) $sql.=",fk_soc"; $sql.= ") VALUES ("; - $sql.= ($this->fk_user > 0?"'".$this->fk_user."'":"0").","; + $sql.= ($this->fk_user > 0 ? $this->fk_user:"0").","; $sql.= " '".$this->db->idate($now)."',"; - $sql.= " '".$this->url."', '".$this->target."',"; - $sql.= " '".$this->db->escape($this->title)."', '".$this->favicon."', '".$this->position."'"; - $sql.= ", '".$conf->entity."'"; - if ($this->fk_soc) $sql.=",".$this->fk_soc; + $sql.= " '".$this->db->escape($this->url)."', '".$this->db->escape($this->target)."',"; + $sql.= " '".$this->db->escape($this->title)."', '".$this->db->escape($this->favicon)."', '".$this->db->escape($this->position)."'"; + $sql.= ", ".$this->db->escape($conf->entity); $sql.= ")"; dol_syslog("Bookmark::update", LOG_DEBUG); @@ -170,7 +168,7 @@ class Bookmark extends CommonObject if (empty($this->position)) $this->position=0; $sql = "UPDATE ".MAIN_DB_PREFIX."bookmark"; - $sql.= " SET fk_user = ".($this->fk_user > 0?"'".$this->fk_user."'":"0"); + $sql.= " SET fk_user = ".($this->fk_user > 0 ? $this->fk_user :"0"); $sql.= " ,dateb = '".$this->db->idate($this->datec)."'"; $sql.= " ,url = '".$this->db->escape($this->url)."'"; $sql.= " ,target = '".$this->db->escape($this->target)."'"; @@ -243,5 +241,5 @@ class Bookmark extends CommonObject { return ''; } - + } diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index a192076e88a..c9387561837 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -101,19 +101,19 @@ if ($resql) if ($optioncss != '') $param ='&optioncss='.$optioncss; $moreforfilter=''; - + print '
'; print ''."\n"; - + print ""; //print ""; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","", $param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"title","", $param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Link"),'',''); - print_liste_field_titre($langs->trans("Target"),'','','','','align="center"'); - print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","", $param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","", $param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","", $param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"bid","", $param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"title","", $param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Link",'',''); + print_liste_field_titre("Target",'','','','','align="center"'); + print_liste_field_titre("Owner",$_SERVER["PHP_SELF"],"u.lastname","", $param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"b.dateb","", $param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Position",$_SERVER["PHP_SELF"],"b.position","", $param,'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; @@ -122,7 +122,7 @@ if ($resql) { $obj = $db->fetch_object($resql); - + print ''; // Id @@ -209,7 +209,7 @@ if ($resql) } print "
 
"; print '
'; - + $db->free($resql); } else diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index c34e8596f01..d4149619aae 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -260,10 +260,6 @@ p.titre { padding: 0; } -.resultats_dhtml { - width: 400px; - position: absolute; -} /* --------------------- Combo lists ------------------- */ .select_design { diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 8f6af8b6d4d..4269bb92199 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -105,7 +105,7 @@ print '
'; $disabled=0; $langs->load("companies"); if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice -print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1); +print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3)', !$disabled, 0, 0); //print ''; print '
trans("FilterRefOrLabelOrBC"); ?>trans("Designation"); ?>
+ onfocus="javascript: this.select();" /> trans("CategoriesSetup"),$linkback,'title_setup') $head=categoriesadmin_prepare_head(); -dol_fiche_head($head, 'setup', $langs->trans("Categories"), 0, 'category'); +dol_fiche_head($head, 'setup', $langs->trans("Categories"), -1, 'category'); print ''; diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 2bc9f205334..c72ef73e970 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); $attrname=GETPOST('attrname', 'alpha'); -$elementtype='categories'; //Must be the $element of the class that manage extrafield +$elementtype='categorie'; //Must be the $element of the class that manage extrafield if (!$user->admin) accessforbidden(); @@ -68,7 +68,7 @@ print load_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'title_setup') $head = categoriesadmin_prepare_head(); -dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), 0, 'category'); +dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), -1, 'category'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 60ef207bb48..5cbe56554dd 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -42,34 +42,48 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; */ class Categorie extends CommonObject { - // Categories types - const TYPE_PRODUCT = 0; // TODO Replace with value 'product' - const TYPE_SUPPLIER = 1; // TODO Replace this value with 'supplier' - const TYPE_CUSTOMER = 2; // TODO Replace this value with 'customer' - const TYPE_MEMBER = 3; // TODO Replace this value with 'member' - const TYPE_CONTACT = 4; // TODO Replace this value with 'contact' - const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user' - const TYPE_ACCOUNT = 5; // TODO Replace this value with 'bank_account' - const TYPE_PROJECT = 6; + // Categories types (we use string because we want to accept any modules/types in a future) + const TYPE_PRODUCT = 'product'; + const TYPE_SUPPLIER = 'supplier'; + const TYPE_CUSTOMER = 'customer'; + const TYPE_MEMBER = 'member'; + const TYPE_CONTACT = 'contact'; + const TYPE_USER = 'user'; + const TYPE_PROJECT = 'project'; + const TYPE_ACCOUNT = 'bank_account'; const TYPE_BANK_LINE = 'bank_line'; + public $picto = 'category'; /** * @var array ID mapping from type string * - * @note This array should be remove in future, once previous constants are moved to the string value. + * @note This array should be remove in future, once previous constants are moved to the string value. Deprecated */ private $MAP_ID = array( - 'product' => 0, - 'supplier' => 1, - 'customer' => 2, - 'member' => 3, - 'contact' => 4, - 'user' => 4, - 'account' => 5, - 'project' => 6, + 'product' => 0, + 'supplier' => 1, + 'customer' => 2, + 'member' => 3, + 'contact' => 4, + 'bank_account' => 5, + 'project' => 6, + 'user' => 7, + 'bank_line' => 8, ); + public static $MAP_ID_TO_CODE = array( + 0 => 'product', + 1 => 'supplier', + 2 => 'customer', + 3 => 'member', + 4 => 'contact', + 5 => 'bank_account', + 6 => 'project', + 7 => 'user', + 8 => 'bank_line', + ); + /** * @var array Foreign keys mapping from type string * @@ -81,9 +95,10 @@ class Categorie extends CommonObject 'supplier' => 'soc', 'member' => 'member', 'contact' => 'socpeople', - 'user' => 'user', - 'account' => 'account', - 'project' => 'project', + 'user' => 'user', + 'account' => 'account', // old for bank_account + 'bank_account' => 'account', + 'project' => 'project', ); /** * @var array Category tables mapping from type string @@ -96,9 +111,10 @@ class Categorie extends CommonObject 'supplier' => 'fournisseur', 'member' => 'member', 'contact' => 'contact', - 'user' => 'user', - 'account' => 'account', - 'project' => 'project', + 'user' => 'user', + 'account' => 'account', // old for bank_account + 'bank_account'=> 'account', + 'project' => 'project', ); /** * @var array Object class mapping from type string @@ -112,8 +128,9 @@ class Categorie extends CommonObject 'member' => 'Adherent', 'contact' => 'Contact', 'user' => 'User', - 'account' => 'Account', - 'project' => 'Project', + 'account' => 'Account', // old for bank account + 'bank_account' => 'Account', + 'project' => 'Project', ); /** * @var array Object table mapping from type string @@ -127,12 +144,12 @@ class Categorie extends CommonObject 'member' => 'adherent', 'contact' => 'socpeople', 'user' => 'user', - 'account' => 'bank_account', - 'project' => 'projet', + 'account' => 'bank_account', + 'project' => 'projet', ); public $element='category'; - public $table_element='categories'; + public $table_element='categorie'; public $fk_parent; public $label; @@ -177,15 +194,16 @@ class Categorie extends CommonObject * * @param int $id Id of category * @param string $label Label of category - * @param string $type Type of category + * @param string $type Type of category ('product', '...') or (0, 1, ...) * @return int <0 if KO, >0 if OK */ - function fetch($id,$label='',$type='') + function fetch($id, $label='', $type=null) { global $conf; // Check parameters if (empty($id) && empty($label)) return -1; + if (! is_numeric($type)) $type=$this->MAP_ID[$type]; $sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; @@ -196,7 +214,7 @@ class Categorie extends CommonObject else { $sql.= " WHERE label = '".$this->db->escape($label)."' AND entity IN (".getEntity('category').")"; - if ($type) $sql.= " AND type = '".$this->db->escape($type)."'"; + if (! is_null($type)) $sql.= " AND type = ".$this->db->escape($type); } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); @@ -253,6 +271,10 @@ class Categorie extends CommonObject global $conf,$langs,$hookmanager; $langs->load('categories'); + $type=$this->type; + + if (! is_numeric($type)) $type=$this->MAP_ID[$type]; + $error=0; dol_syslog(get_class($this).'::create', LOG_DEBUG); @@ -289,7 +311,7 @@ class Categorie extends CommonObject $sql.= " import_key,"; $sql.= " entity"; $sql.= ") VALUES ("; - $sql.= $this->fk_parent.","; + $sql.= $this->db->escape($this->fk_parent).","; $sql.= "'".$this->db->escape($this->label)."',"; $sql.= "'".$this->db->escape($this->description)."',"; $sql.= "'".$this->db->escape($this->color)."',"; @@ -297,10 +319,10 @@ class Categorie extends CommonObject { $sql.= ($this->socid != -1 ? $this->socid : 'null').","; } - $sql.= "'".$this->visible."',"; - $sql.= $this->type.","; + $sql.= "'".$this->db->escape($this->visible)."',"; + $sql.= $this->db->escape($type).","; $sql.= (! empty($this->import_key)?"'".$this->db->escape($this->import_key)."'":'null').","; - $sql.= $conf->entity; + $sql.= $this->db->escape($conf->entity); $sql.= ")"; $res = $this->db->query($sql); @@ -447,9 +469,10 @@ class Categorie extends CommonObject * Delete a category from database * * @param User $user Object user that ask to delete - * @return int <0 KO >0 OK + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int <0 KO >0 OK */ - function delete($user) + function delete($user, $notrigger=0) { global $conf,$langs; @@ -462,6 +485,14 @@ class Categorie extends CommonObject $this->db->begin(); + if (! $error && ! $notrigger) + { + // Call trigger + $result=$this->call_trigger('CATEGORY_DELETE',$user); + if ($result < 0) $error++; + // End call triggers + } + /* FIX #1317 : Check for child category and move up 1 level*/ if (! $error) { @@ -580,25 +611,16 @@ class Categorie extends CommonObject $this->error=$this->db->lasterror(); $error++; } - else + } + + // Removed extrafields + if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->deleteExtraFields(); + if ($result < 0) { - // Removed extrafields - if (! $error) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR); - } - } - } - // Call trigger - $result=$this->call_trigger('CATEGORY_DELETE',$user); - if ($result < 0) { $error++; } - // End call triggers + $error++; + dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR); } } @@ -617,12 +639,11 @@ class Categorie extends CommonObject /** * Link an object to the category * - * @param CommonObject $obj Object to link to category - * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') - * - * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked + * @param CommonObject $obj Object to link to category + * @param string $type Type of category ('product', ...) + * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked */ - function add_type($obj,$type) + function add_type($obj, $type) { global $user,$langs,$conf; @@ -839,13 +860,12 @@ class Categorie extends CommonObject /** * Check for the presence of an object in a category * - * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') - * @param int $object_id id of the object to search - * - * @return int number of occurrences + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') + * @param int $object_id Id of the object to search + * @return int Number of occurrences * @see getObjectsInCateg */ - function containsObject($type, $object_id ) + function containsObject($type, $object_id) { $sql = "SELECT COUNT(*) as nb FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type]; $sql .= " WHERE fk_categorie = " . $this->id . " AND fk_" . $this->MAP_CAT_FK[$type] . " = " . $object_id; @@ -932,24 +952,16 @@ class Categorie extends CommonObject * fulllabel = nom avec chemin complet de la categorie * fullpath = chemin complet compose des id * - * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member'). - * Old mode (0, 1, 2, ...) is deprecated. - * @param int $markafterid Removed all categories including the leaf $markafterid in category tree. + * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...). + * @param int $markafterid Removed all categories including the leaf $markafterid in category tree. * - * @return array Array of categories. this->cats and this->motherof are set. + * @return array Array of categories. this->cats and this->motherof are set. */ function get_full_arbo($type, $markafterid=0) { global $conf, $langs; - // For backward compatibility - if (is_numeric($type)) - { - // We want to reverse lookup - $map_type = array_flip($this->MAP_ID); - $type = $map_type[$type]; - dol_syslog( get_class( $this ) . "::get_full_arbo(): numeric types are deprecated, please use string instead", LOG_WARNING); - } + if (! is_numeric($type)) $type = $this->MAP_ID[$type]; $this->cats = array(); @@ -963,7 +975,7 @@ class Categorie extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'"; $sql .= " WHERE c.entity IN (" . getEntity( 'category', 1 ) . ")"; - $sql .= " AND c.type = " . $this->MAP_ID[$type]; + $sql .= " AND c.type = " . $type; dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG); $resql = $this->db->query($sql); @@ -1087,7 +1099,7 @@ class Categorie extends CommonObject /** * Returns all categories * - * @param int $type Type of category + * @param int $type Type of category (0, 1, ...) * @param boolean $parent Just parent categories if true * @return array Table of Object Category */ @@ -1150,13 +1162,17 @@ class Categorie extends CommonObject */ function already_exists() { + $type=$this->type; + + if (! is_numeric($type)) $type=$this->MAP_ID[$type]; + /* We have to select any rowid from llx_categorie which category's mother and label * are equals to those of the calling category */ $sql = "SELECT c.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie as c "; $sql.= " WHERE c.entity IN (".getEntity('category').")"; - $sql.= " AND c.type = ".$this->type; + $sql.= " AND c.type = ".$type; $sql.= " AND c.fk_parent = ".$this->fk_parent; $sql.= " AND c.label = '".$this->db->escape($this->label)."'"; @@ -1174,11 +1190,11 @@ class Categorie extends CommonObject */ if($obj[0] > 0 && $obj[0] != $this->id) { - dol_syslog(get_class($this)."::already_exists category with name=".$this->label." exist rowid=".$obj[0]." current_id=".$this->id, LOG_DEBUG); + dol_syslog(get_class($this)."::already_exists category with name=".$this->label." and parent ".$this->fk_parent." exists: rowid=".$obj[0]." current_id=".$this->id, LOG_DEBUG); return 1; } } - dol_syslog(get_class($this)."::already_exists no category with same name=".$this->label." rowid=".$obj[0]." current_id=".$this->id, LOG_DEBUG); + dol_syslog(get_class($this)."::already_exists no category with same name=".$this->label." and same parent ".$this->fk_parent." than category id=".$this->id, LOG_DEBUG); return 0; } else @@ -1191,7 +1207,7 @@ class Categorie extends CommonObject /** * Returns the top level categories (which are not girls) * - * @param int $type Type of category + * @param int $type Type of category (0, 1, ...) * @return array */ function get_main_categories($type=null) @@ -1329,26 +1345,19 @@ class Categorie extends CommonObject * Return list of categories (object instances or labels) linked to element of id $id and type $type * Should be named getListOfCategForObject * - * @param int $id Id of element - * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. - * @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category - * labels, 'id'= Get array of category IDs - * @return mixed Array of category objects or < 0 if KO + * @param int $id Id of element + * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...) + * @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category + * labels, 'id'= Get array of category IDs + * @return mixed Array of category objects or < 0 if KO */ function containing($id, $type, $mode='object') { $cats = array(); - // For backward compatibility - if (is_numeric($type)) - { - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); - // We want to reverse lookup - $map_type = array_flip($this->MAP_ID); - $type = $map_type[$type]; - } + if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; - if ($type == Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code + if ($type === Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code { // Load bank groups $sql = "SELECT c.label, c.rowid"; @@ -1539,17 +1548,32 @@ class Categorie extends CommonObject dol_mkdir($dir); } - if (file_exists($dir)) - { - $originImage = $dir . $file['name']; - - // Cree fichier en taille origine - dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0); - - if (file_exists($originImage)) + if (file_exists($dir)) { + if (is_array($file['name']) && count($file['name']) > 0) { - // Create thumbs - $this->addThumbs($originImage); + $nbfile = count($file['name']); + for ($i = 0; $i <= $nbfile; $i ++) { + + $originImage = $dir . $file['name'][$i]; + + // Cree fichier en taille origine + dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0); + + if (file_exists($originImage)) { + // Create thumbs + $this->addThumbs($originImage); + } + } + } else { + $originImage = $dir . $file['name']; + + // Cree fichier en taille origine + dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0); + + if (file_exists($originImage)) { + // Create thumbs + $this->addThumbs($originImage); + } } } } diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 59bee88b75b..4ccd9116d74 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -36,7 +36,7 @@ $ref=GETPOST('ref'); $type=GETPOST('type'); $action=GETPOST('action','aZ09'); $confirm=GETPOST('confirm'); -$cancel=GETPOST('cancel'); +$cancel=GETPOST('cancel','alpha'); $socid=GETPOST('socid','int'); $label=GETPOST('label'); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index ea4d60e9b5b..149eb160a78 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -39,6 +39,8 @@ $id=GETPOST('id','int'); $type=(GETPOST('type','aZ09') ? GETPOST('type','aZ09') : Categorie::TYPE_PRODUCT); $catname=GETPOST('catname','alpha'); +if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility + /* * View @@ -52,9 +54,9 @@ elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCat elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; } elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; } elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; } -elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='account'; } -elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; } +elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; } elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; } +elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; } else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; } $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index e99e081e015..e6047ed2149 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -42,6 +42,8 @@ $type=GETPOST('type'); $action=GETPOST('action','aZ09'); $confirm=GETPOST('confirm'); +if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility + if ($id == "") { dol_print_error('','Missing parameter id'); @@ -100,15 +102,16 @@ if ($object->id) elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort"); elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort"); - else $title=$langs->trans("Category"); + elseif ($type == Categorie::TYPE_USER) $title=$langs->trans("UsersCategoriesShort"); + else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); dol_fiche_head($head, 'photos', $title, -1, 'category'); - + $linkback = ''.$langs->trans("BackToList").''; - + $object->ref = $object->label; $morehtmlref='
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); @@ -117,9 +120,9 @@ if ($object->id) $morehtmlref.=$way."
\n"; } $morehtmlref.='
'; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - + /* * Confirmation de la suppression de photo */ @@ -129,7 +132,7 @@ if ($object->id) } print '
'; - + print '
'; print '
'; print '
'; @@ -148,7 +151,7 @@ if ($object->id) print "
\n"; print ''; - + print dol_fiche_end(); @@ -258,7 +261,7 @@ if ($object->id) } print '
'; - + if ($nbphoto < 1) { print '
'.$langs->trans("NoPhotoYet")."
"; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 7dbe6325e1d..40b40eab921 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -35,11 +35,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("categories"); $langs->load("languages"); -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action=GETPOST('action','alpha'); -$cancel=GETPOST('cancel','alpha'); -$type=GETPOST('type'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action','alpha'); +$cancel = GETPOST('cancel','alpha'); +$type = GETPOST('type','aZ09'); + +if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility // Security check $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); @@ -153,6 +155,7 @@ elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategor elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort"); elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort"); +elseif ($type == Categorie::TYPE_USER) $title=$langs->trans("UsersCategoriesShort"); else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); @@ -256,9 +259,9 @@ if ($action == 'edit') print ''; } } - + print '
'; - + print '
'; print ''; print '     '; @@ -271,7 +274,7 @@ if ($action == 'edit') else if ($action != 'add') { if ($cnt_trans) print '
'; - + if (! empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 11aff01dc99..75a9215e18d 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -34,15 +34,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("categories"); -$id=GETPOST('id','int'); -$ref=GETPOST('ref'); -$type=GETPOST('type'); +$id = GETPOST('id','int'); +$label= GETPOST('label','alpha'); +$type = GETPOST('type','az09'); $action=GETPOST('action','aZ09'); -$confirm=GETPOST('confirm'); +$confirm = GETPOST('confirm','alpha'); $removeelem = GETPOST('removeelem','int'); -$elemid=GETPOST('elemid'); +$elemid = GETPOST('elemid','alpha'); -if ($id == "") +if ($id == "" && $label == "") { dol_print_error('','Missing parameter id'); exit(); @@ -52,7 +52,7 @@ if ($id == "") $result = restrictedArea($user, 'categorie', $id, '&category'); $object = new Categorie($db); -$result=$object->fetch($id); +$result=$object->fetch($id, $label); $object->fetch_optionals($id,$extralabels); if ($result <= 0) { @@ -61,6 +61,7 @@ if ($result <= 0) } $type=$object->type; +if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); @@ -187,6 +188,7 @@ elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategor elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort"); elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort"); +elseif ($type == Categorie::TYPE_USER) $title=$langs->trans("ProjectsCategoriesShort"); else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); @@ -195,7 +197,7 @@ $head = categories_prepare_head($object,$type); dol_fiche_head($head, 'card', $title, -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; - +$object->next_prev_filter=" type = ".$object->type; $object->ref = $object->label; $morehtmlref='
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); @@ -205,7 +207,7 @@ foreach ($ways as $way) } $morehtmlref.='
'; -dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); +dol_banner_tab($object, 'label', $linkback, ($user->societe_id?0:1), 'label', 'label', $morehtmlref, '', 0, '', '', 1); /* diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index ea7abde4151..7f08beff955 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -49,7 +49,7 @@ function llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); print ''; - + // top menu and left menu area if (empty($conf->dol_hide_topmenu)) { @@ -108,7 +108,7 @@ if (empty($action)) $action='preview'; */ if (GETPOST('refreshsite')) $pageid=0; // If we change the site, we reset the pageid. -if (GETPOST('refreshpage')) $action='preview'; +if (GETPOST('refreshpage')) $action='preview'; // Add a collab page @@ -146,7 +146,7 @@ if ($action == 'add') { $db->rollback(); } - + $action = 'preview'; $id = $objectpage->id; } @@ -173,7 +173,7 @@ if ($action == 'delete') { $db->commit(); setEventMessages($langs->trans("PageDeleted", $objectpage->pageurl, $website), null, 'mesgs'); - + header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website); exit; } @@ -218,7 +218,7 @@ print '
'; if (count($object->records) > 0) { // ***** Part for web sites - + print '
'; print $langs->trans("Website").': '; print '
'; @@ -252,20 +252,20 @@ if (count($object->records) > 0) $dataroot=DOL_DATA_ROOT.'/websites/'.$website; if (! empty($object->virtualhost)) $virtualurl=$object->virtualhost; } - + if ($website && $action == 'preview') { $disabled=''; if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; - + print '   '; - + //print ''; print ''; print ''; print ''; } - + print '
'; // Button for websites @@ -279,7 +279,7 @@ if (count($object->records) > 0) $htmltext=$langs->trans("SetHereVirtualHost", $dataroot); print $form->textwithpicto('', $htmltext); print '
'; - + $urlext=$virtualurl; $urlint=$urlwithroot.'/public/websites/index.php?website='.$website; //if (! empty($object->virtualhost)) @@ -288,7 +288,7 @@ if (count($object->records) > 0) print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); print ''; //} - + print 'transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">'; print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot), 1, 'preview'); print ''; @@ -300,12 +300,12 @@ if (count($object->records) > 0) if (preg_match('/^create/',$action)) print ''; if (preg_match('/^edit/',$action)) print ''; } - + print ''; // ***** Part for pages - + if ($website) { print ''; @@ -313,13 +313,13 @@ if (count($object->records) > 0) $array=$objectpage->fetchAll($object->id); if (! is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors); $atleastonepage=(is_array($array) && count($array) > 0); - + print '
'; print '
'; print $langs->trans("Page").': '; print '
'; print '
'; - + if ($action != 'add') { $out=''; @@ -336,7 +336,7 @@ if (count($object->records) > 0) } $pageid=$homepageid?$homepageid:$firstpageid; // We choose home page and if not defined yet, we take first page } - + foreach($array as $key => $valpage) { $out.='
'; print '
'; print '
'; @@ -389,17 +389,17 @@ if (count($object->records) > 0) { $websitepage = new WebSitePage($db); $websitepage->fetch($pageid); - + $realpage=$urlwithroot.'/public/websites/index.php?website='.$website.'&page='.$pageid; $pagealias = $websitepage->pageurl; - + print '
'; print ''; //print ''; $htmltext=$langs->trans("WEBSITE_PAGENAME", $pagealias); print $form->textwithpicto('', $htmltext); print '
'; - + if (! empty($object->virtualhost)) { $urlext=$virtualurl.'/'.$pagealias.'.php'; @@ -413,12 +413,12 @@ if (count($object->records) > 0) print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); print ''; } - + print 'transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot), 1, 'preview'); + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot), 1, 'preview'); print ''; // View page in new Tab //print ''; - + // TODO Add js to save alias like we save virtual host name and use dynamic virtual host for url of id=previewpageext } if (! in_array($action, array('editcss','editmenu','create'))) @@ -427,7 +427,7 @@ if (count($object->records) > 0) if (preg_match('/^create/',$action)) print ''; if (preg_match('/^edit/',$action)) print ''; } - + print '
'; if ($action == 'preview') @@ -454,7 +454,7 @@ if (count($object->records) > 0) }, context: document.body }); - + jQuery("#previewsiteext").attr("href",newurl); jQuery("#previewpageext").attr("href",newpage); }); @@ -483,15 +483,15 @@ if ($action == 'editcontent') /* * Editing global variables not related to a specific theme */ - + $csscontent = @file_get_contents($filecss); - + $contentforedit = ''; /*$contentforedit.=''."\n";*/ $contentforedit .= $objectpage->content; - + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('PAGE_CONTENT',$contentforedit,'',500,'Full','',true,true,true,ROWS_5,'90%'); $doleditor->Create(0, '', false); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 5e38a85898e..7b1c81af59c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -38,11 +38,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; -if (! empty($conf->projet->enabled)) -{ - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -} +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("companies"); @@ -580,11 +577,18 @@ if ($action == 'mupdate') } +// Actions to delete doc +$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); +$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete)); +include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + /* * View */ +$formproject=new FormProjets($db); + $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); @@ -666,7 +670,7 @@ if ($action == 'create') } // Title - print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired titlefieldcreate"':'').'>'.$langs->trans("Title").''; + print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired titlefieldcreate"':'').'>'.$langs->trans("Label").''; // Full day print ''.$langs->trans("EventOnFullDay").''; @@ -710,7 +714,7 @@ if ($action == 'create') // Location if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''.$langs->trans("Location").''; + print ''.$langs->trans("Location").''; } // Assigned to @@ -786,8 +790,6 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled)) { - $formproject=new FormProjets($db); - // Projet associe $langs->load("projects"); @@ -955,13 +957,20 @@ if ($id > 0) // Type of event if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''.$langs->trans("Type").''; - $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); + print ''.$langs->trans("Type").''; + if ($object->type_code != 'AC_OTH_AUTO') + { + $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); + } + else + { + print ''.$langs->trans("Action".$object->type_code); + } print ''; } // Title - print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").''; + print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").''; // Full day event print ''.$langs->trans("EventOnFullDay").'fulldayevent?' checked':'').'>'; @@ -1045,7 +1054,7 @@ if ($id > 0) // Location if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''.$langs->trans("Location").''; + print ''.$langs->trans("Location").''; } // Assigned to @@ -1126,8 +1135,6 @@ if ($id > 0) // Project if (! empty($conf->projet->enabled)) { - $formproject=new FormProjets($db); - $langs->load("projects"); print ''.$langs->trans("Project").''; @@ -1210,7 +1217,6 @@ if ($id > 0) $out.=''.$langs->trans("ViewDay").''; $linkback.=$out; - $morehtmlref='
'; // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); @@ -1475,7 +1481,7 @@ if ($id > 0) */ $filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id; - $urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id; + $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed=$user->rights->agenda->myactions->create; $delallowed=$user->rights->agenda->myactions->delete; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 8243268574c..b59d47adb9e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -38,7 +38,7 @@ class ActionComm extends CommonObject public $table_rowid = 'id'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='action'; - + /** * Id of the event * @var int @@ -168,7 +168,7 @@ class ActionComm extends CommonObject var $email_subject; var $errors_to; - + /** * Constructor * @@ -296,23 +296,23 @@ class ActionComm extends CommonObject $sql.= "elementtype,"; $sql.= "entity"; $sql.= ") VALUES ("; - $sql.= "'".$this->db->idate($now)."',"; - $sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").","; - $sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").","; - $sql.= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '')?"'".$this->durationp."'":"null").","; // deprecated + $sql.= "'".$this->db->idate($now)."', "; + $sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").", "; + $sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").", "; + $sql.= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '')?"'".$this->db->escape($this->durationp)."'":"null").", "; // deprecated $sql.= (isset($this->type_id)?$this->type_id:"null").","; - $sql.= (isset($this->type_code)?" '".$this->type_code."'":"null").","; - $sql.= ((isset($this->socid) && $this->socid > 0)?" '".$this->socid."'":"null").","; - $sql.= ((isset($this->fk_project) && $this->fk_project > 0)?" '".$this->fk_project."'":"null").","; - $sql.= " '".$this->db->escape($this->note)."',"; - $sql.= ((isset($this->contactid) && $this->contactid > 0)?"'".$this->contactid."'":"null").","; - $sql.= (isset($user->id) && $user->id > 0 ? "'".$user->id."'":"null").","; - $sql.= ($userownerid>0?"'".$userownerid."'":"null").","; - $sql.= ($userdoneid>0?"'".$userdoneid."'":"null").","; - $sql.= "'".$this->db->escape($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".$this->db->escape($this->location)."','".$this->punctual."',"; - $sql.= "'".$this->transparency."',"; - $sql.= (! empty($this->fk_element)?$this->fk_element:"null").","; - $sql.= (! empty($this->elementtype)?"'".$this->elementtype."'":"null").","; + $sql.= (isset($this->type_code)?" '".$this->db->escape($this->type_code)."'":"null").", "; + $sql.= ((isset($this->socid) && $this->socid > 0) ? $this->socid:"null").", "; + $sql.= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project:"null").", "; + $sql.= " '".$this->db->escape($this->note)."', "; + $sql.= ((isset($this->contactid) && $this->contactid > 0) ? $this->contactid:"null").", "; + $sql.= (isset($user->id) && $user->id > 0 ? $user->id:"null").", "; + $sql.= ($userownerid>0 ? $userownerid:"null").", "; + $sql.= ($userdoneid>0 ? $userdoneid:"null").", "; + $sql.= "'".$this->db->escape($this->label)."','".$this->db->escape($this->percentage)."','".$this->db->escape($this->priority)."','".$this->db->escape($this->fulldayevent)."','".$this->db->escape($this->location)."','".$this->db->escape($this->punctual)."', "; + $sql.= "'".$this->db->escape($this->transparency)."', "; + $sql.= (! empty($this->fk_element)?$this->fk_element:"null").", "; + $sql.= (! empty($this->elementtype)?"'".$this->db->escape($this->elementtype)."'":"null").", "; $sql.= $conf->entity; $sql.= ")"; @@ -444,7 +444,7 @@ class ActionComm extends CommonObject $u->fetch($fuser); $fuser = $u; } - else + else { $fuser = $user; } @@ -657,11 +657,11 @@ class ActionComm extends CommonObject $this->error=$this->db->lasterror(); $error++; } - + if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources"; $sql.= " WHERE fk_actioncomm=".$this->id; - + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res=$this->db->query($sql); if ($res < 0) { @@ -669,7 +669,7 @@ class ActionComm extends CommonObject $error++; } } - + // Removed extrafields if (! $error) { $result=$this->deleteExtraFields(); @@ -758,11 +758,11 @@ class ActionComm extends CommonObject $sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null"); $sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null'); - $sql.= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null"); // deprecated + $sql.= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->db->escape($this->durationp)."'":"null"); // deprecated $sql.= ", note = ".($this->note ? "'".$this->db->escape($this->note)."'":"null"); - $sql.= ", fk_project =". ($this->fk_project > 0 ? "'".$this->fk_project."'":"null"); - $sql.= ", fk_soc =". ($socid > 0 ? "'".$socid."'":"null"); - $sql.= ", fk_contact =". ($contactid > 0 ? "'".$contactid."'":"null"); + $sql.= ", fk_project =". ($this->fk_project > 0 ? $this->fk_project:"null"); + $sql.= ", fk_soc =". ($socid > 0 ? $socid:"null"); + $sql.= ", fk_contact =". ($contactid > 0 ? $contactid:"null"); $sql.= ", priority = '".$this->db->escape($this->priority)."'"; $sql.= ", fulldayevent = '".$this->db->escape($this->fulldayevent)."'"; $sql.= ", location = ".($this->location ? "'".$this->db->escape($this->location)."'":"null"); @@ -770,8 +770,8 @@ class ActionComm extends CommonObject $sql.= ", fk_user_mod = ".$user->id; $sql.= ", fk_user_action=".($userownerid > 0 ? "'".$userownerid."'":"null"); $sql.= ", fk_user_done=".($userdoneid > 0 ? "'".$userdoneid."'":"null"); - if (! empty($this->fk_element)) $sql.= ", fk_element=".($this->fk_element?$this->fk_element:"null"); - if (! empty($this->elementtype)) $sql.= ", elementtype=".($this->elementtype?"'".$this->elementtype."'":"null"); + if (! empty($this->fk_element)) $sql.= ", fk_element=".($this->fk_element?$this->db->escape($this->fk_element):"null"); + if (! empty($this->elementtype)) $sql.= ", elementtype=".($this->elementtype?"'".$this->db->escape($this->elementtype)."'":"null"); $sql.= " WHERE id=".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -860,9 +860,10 @@ class ActionComm extends CommonObject * @param string $filter Other filter * @param string $sortfield Sort on this field * @param string $sortorder ASC or DESC + * @param string $limit Limit number of answers * @return array or string Error string if KO, array with actions if OK */ - static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='', $sortorder='') + static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='datep', $sortorder='DESC', $limit=0) { global $conf, $langs; @@ -879,6 +880,7 @@ class ActionComm extends CommonObject } if (! empty($filter)) $sql.= $filter; if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder); + if ($limit) $sql.=$db->plimit($limit); dol_syslog(get_class()."::getActions", LOG_DEBUG); $resql=$db->query($sql); @@ -936,7 +938,7 @@ class ActionComm extends CommonObject $response->label = $langs->trans("ActionsToDo"); $response->url = DOL_URL_ROOT.'/comm/action/listactions.php?status=todo&mainmenu=agenda'; if ($user->rights->agenda->allactions->read) $response->url.='&filtert=-1'; - $response->img = img_object('',"action"); + $response->img = img_object('',"action",'class="inline-block valigntextmiddle"'); // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) @@ -1091,7 +1093,7 @@ class ActionComm extends CommonObject else if ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3'); else if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6'); } - + return ''; } @@ -1112,20 +1114,20 @@ class ActionComm extends CommonObject global $conf, $langs, $user, $hookmanager; if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - + $label = $this->label; if (empty($label)) $label=$this->libelle; // For backward compatibility $result=''; - + // Set label of typ $labeltype = ($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label; if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL'); } - - + + $tooltip = '' . $langs->trans('ShowAction'.$objp->code) . ''; if (! empty($this->ref)) $tooltip .= '
' . $langs->trans('Ref') . ': ' . $this->ref; @@ -1137,7 +1139,7 @@ class ActionComm extends CommonObject $tooltip .= '
' . $langs->trans('Location') . ': ' . $this->location; $linkclose=''; - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) $linkclose = ' style="background-color:#'.$this->type_color.'"'; if (empty($notooltip)) @@ -1149,7 +1151,7 @@ class ActionComm extends CommonObject } $linkclose.=' title="'.dol_escape_htmltag($tooltip, 1).'"'; $linkclose.=' class="'.$classname.' classfortooltip"'; - + if (! is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; @@ -1161,17 +1163,17 @@ class ActionComm extends CommonObject $linkclose = ($hookmanager->resPrint ? $hookmanager->resPrint : $linkclose); } else $linkclose.=' class="'.$classname.'"'; - + $url=''; - if ($option=='birthday') + if ($option=='birthday') $url = DOL_URL_ROOT.'/contact/perso.php?id='.$this->id; - else + else $url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id; - + $linkstart = ''; $linkend=''; - + //print 'rrr'.$this->libelle.'-'.$withpicto; if ($withpicto == 2) @@ -1194,7 +1196,7 @@ class ActionComm extends CommonObject { $libelle.=(($this->type_code && $libelle!=$langs->transnoentities("Action".$this->type_code) && $langs->transnoentities("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->transnoentities("Action".$this->type_code).')':''); } - $result.=$linkstart.img_object(($notooltip?'':$langs->trans("ShowAction").': '.$libelle), ($overwritepicto?$overwritepicto:'action'), ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend; + $result.=$linkstart.img_object(($notooltip?'':$langs->trans("ShowAction").': '.$libelle), ($overwritepicto?$overwritepicto:'action'), ($notooltip?'class="valigntextbottom"':'class="classfortooltip valigntextbottom"'), 0, 0, $notooltip?0:1).$linkend; } if ($withpicto==1) $result.=' '; $result.=$linkstart.$libelleshort.$linkend; @@ -1279,7 +1281,7 @@ class ActionComm extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; // We must filter on assignement table - if ($filters['logint'] || $filters['login']) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; + if ($filters['logint']) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; $sql.= " WHERE a.fk_action=c.id"; $sql.= " AND a.entity IN (".getEntity('agenda').")"; foreach ($filters as $key => $value) @@ -1291,20 +1293,34 @@ class ActionComm extends CommonObject if ($key == 'idto') $sql.=" AND a.id <= ".(is_numeric($value)?$value:0); if ($key == 'project') $sql.=" AND a.fk_project=".(is_numeric($value)?$value:0); // We must filter on assignement table - if ($key == 'logint' || $key == 'login') $sql.= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; + if ($key == 'logint') $sql.= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; if ($key == 'logina') { $logina=$value; + $condition='='; + if (preg_match('/^!/',$logina)) + { + $logina=preg_replace('/^!/','',$logina); + $condition='<>'; + } $userforfilter=new User($this->db); - $result=$userforfilter->fetch('',$value); - $sql.= " AND a.fk_user_author = ".$userforfilter->id; + $result=$userforfilter->fetch('',$logina); + if ($result > 0) $sql.= " AND a.fk_user_author ".$condition." ".$userforfilter->id; + elseif ($result < 0 || $condition == '=') $sql.= " AND a.fk_user_author = 0"; } - if ($key == 'logint' || $key == 'login') + if ($key == 'logint') { $logint=$value; + $condition='='; + if (preg_match('/^!/',$logint)) + { + $logint=preg_replace('/^!/','',$logint); + $condition='<>'; + } $userforfilter=new User($this->db); - $result=$userforfilter->fetch('',$value); - $sql.= " AND ar.fk_element = ".$userforfilter->id; + $result=$userforfilter->fetch('',$logint); + if ($result > 0) $sql.= " AND ar.fk_element = ".$userforfilter->id; + elseif ($result < 0 || $condition == '=') $sql.= " AND ar.fk_element = 0"; } } $sql.= " AND a.datep IS NOT NULL"; // To exclude corrupted events and avoid errors in lightning/sunbird import @@ -1484,5 +1500,32 @@ class ActionComm extends CommonObject return $this->datep && ($this->datep < ($now - $conf->agenda->warning_delay)); } + + /** + * Send reminders by emails + * CAN BE A CRON TASK + * + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function sendEmailsReminder() + { + global $conf, $langs; + + $this->output = ''; + $this->error=''; + + if (empty($conf->global->AGENDA_REMINDER_EMAIL)) + { + $this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Agenda")); + return 0; + } + + dol_syslog(__METHOD__, LOG_DEBUG); + + + + return 0; + } + } diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 30eeb2ffe8e..1e54db9d449 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -124,7 +124,7 @@ if ($object->id > 0) dol_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action'); $linkback = img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"'); - $linkback.= ''.$langs->trans("BackToList").''; + $linkback.= ''.$langs->trans("BackToList").''; // Link to other agenda views $out=''; @@ -137,7 +137,7 @@ if ($object->id > 0) $out.=''.$langs->trans("ViewWeek").''; $out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"'); $out.=''.$langs->trans("ViewDay").''; - + $linkback.=$out; $morehtmlref='
'; @@ -161,13 +161,13 @@ if ($object->id > 0) } } $morehtmlref.='
'; - + dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref); - + print '
'; - + print '
'; - + // Affichage fiche action en mode visu print ''; @@ -228,7 +228,7 @@ if ($object->id > 0) print '
'; print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '
'; - if (in_array($user->id,array_keys($listofuserid))) + if (in_array($user->id,array_keys($listofuserid))) { print '
'; print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody @@ -237,7 +237,7 @@ if ($object->id > 0) print ' '; print '
'; - + print ''; // Construit liste des fichiers @@ -255,7 +255,7 @@ if ($object->id > 0) print '
'; print '
'; - + dol_fiche_end(); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 76a53924ad5..bda7dd7a594 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -129,10 +129,13 @@ $hookmanager->initHooks(array('agenda')); if (GETPOST("viewlist") || $action == 'show_list') { $param=''; - foreach($_POST as $key => $val) + if (is_array($_POST)) { - if ($key=='token') continue; - $param.='&'.$key.'='.urlencode($val); + foreach($_POST as $key => $val) + { + if ($key=='token') continue; + $param.='&'.$key.'='.urlencode($val); + } } //print $param; header("Location: ".DOL_URL_ROOT.'/comm/action/listactions.php?'.$param); @@ -142,10 +145,13 @@ if (GETPOST("viewlist") || $action == 'show_list') if (GETPOST("viewperuser") || $action == 'show_peruser') { $param=''; - foreach($_POST as $key => $val) + if (is_array($_POST)) { - if ($key=='token') continue; - $param.='&'.$key.'='.urlencode($val); + foreach($_POST as $key => $val) + { + if ($key=='token') continue; + $param.='&'.$key.'='.urlencode($val); + } } //print $param; header("Location: ".DOL_URL_ROOT.'/comm/action/peruser.php?'.$param); @@ -537,8 +543,10 @@ $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); + + $MAXONSAMEPAGE=10000; // Useless to have more. Protection to avoid memory overload when high number of event (for example after a mass import) $i=0; - while ($i < $num) + while ($i < $num && $i < $MAXONSAMEPAGE) { $obj = $db->fetch_object($resql); diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 01094a78164..c77c4279439 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -59,9 +59,9 @@ else if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); $search_title=GETPOST('search_title','alpha'); -$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); -$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear')); -$dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear')); +$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int')); +$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int')); +$dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int')); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); @@ -80,7 +80,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; if (! $sortorder) { @@ -120,10 +120,13 @@ $hookmanager->initHooks(array('agendalist')); if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday")) { $param=''; - foreach($_POST as $key => $val) - { - $param.='&'.$key.'='.urlencode($val); - } + if (is_array($_POST)) + { + foreach($_POST as $key => $val) + { + $param.='&'.$key.'='.urlencode($val); + } + } //print $param; header("Location: ".DOL_URL_ROOT.'/comm/action/index.php?'.$param); exit; @@ -134,7 +137,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $actioncode=''; $search_title=''; @@ -168,7 +171,7 @@ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&con if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($actioncode != '') $param.="&actioncode=".$actioncode; if ($resourceid > 0) $param.="&resourceid=".$resourceid; -if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; +if ($status != '' && $status > -1) $param.="&status=".$status; if ($filter) $param.="&filter=".$filter; if ($filtert) $param.="&filtert=".$filtert; if ($socid) $param.="&socid=".$socid; @@ -177,6 +180,13 @@ if ($pid) $param.="&projectid=".$pid; if ($type) $param.="&type=".$type; if ($usergroup) $param.="&usergroup=".$usergroup; if ($optioncss != '') $param.='&optioncss='.$optioncss; +if ($search_title != '') $param.='&search_title='.$search_title; +if (GETPOST('datestartday','int')) $param.='&datestartday='.GETPOST('datestartday','int'); +if (GETPOST('datestartmonth','int')) $param.='&datestartmonth='.GETPOST('datestartmonth','int'); +if (GETPOST('datestartyear','int')) $param.='&datestartyear='.GETPOST('datestartyear','int'); +if (GETPOST('dateendday','int')) $param.='&dateendday='.GETPOST('dateendday','int'); +if (GETPOST('dateendmonth','int')) $param.='&dateendmonth='.GETPOST('dateendmonth','int'); +if (GETPOST('dateendyear','int')) $param.='&dateendyear='.GETPOST('dateendyear','int'); $sql = "SELECT"; if ($usergroup > 0) $sql.=" DISTINCT"; @@ -338,6 +348,19 @@ if ($resql) if ($usergroup) $nav.=''; print $nav; + if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) + { + $tmpforcreatebutton=dol_getdate(dol_now(), true); + + $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + + //$param='month='.$monthshown.'&year='.$year; + $hourminsec='100000'; + $link = ''; + $link.= $langs->trans("NewAction"); + $link.= ''; + } + print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, -1 * $nbtotalofrecords, '', 0, $nav, '', $limit); $moreforfilter=''; @@ -371,17 +394,17 @@ if ($resql) print "\n"; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder); //if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder); - if (! empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) print_liste_field_titre($langs->trans("LinkedObject"),$_SERVER["PHP_SELF"],"a.fk_element",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("DateStart",$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder); + print_liste_field_titre("DateEnd",$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder); + print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Contact",$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder); + if (! empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) print_liste_field_titre("LinkedObject",$_SERVER["PHP_SELF"],"a.fk_element",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("ActionsOwnedByShort",$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre(""); print "\n"; @@ -497,19 +520,19 @@ if ($resql) print ''; } - // User to do + // User owner print ''; if ($obj->fk_user_action > 0) { $userstatic->fetch($obj->fk_user_action); - print $userstatic->getNomUrl(1); + print $userstatic->getNomUrl(-1); } else print ' '; print ''; // Status/Percent $datep=$db->jdate($obj->datep); - print ''.$actionstatic->LibStatut($obj->percent,3,1,$datep).''; + print ''.$actionstatic->LibStatut($obj->percent,3,0,$datep).''; print ''; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index cd96a4fa8ad..b10ab8dc05b 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -30,15 +30,17 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; -$filter = GETPOST("filter",'',3); +$filter = GETPOST("filter",'alpha',3); $filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id; @@ -55,7 +57,7 @@ $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page","int"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="a.datec"; @@ -82,9 +84,9 @@ $month=GETPOST("month","int")?GETPOST("month","int"):date("m"); $week=GETPOST("week","int")?GETPOST("week","int"):date("W"); $day=GETPOST("day","int")?GETPOST("day","int"):date("d"); $pid=GETPOST("projectid","int",3); -$status=GETPOST("status"); -$type=GETPOST("type"); -$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$status=GETPOST("status",'alpha'); +$type=GETPOST("type",'alpha'); +$maxprint=((GETPOST("maxprint",'int')!='')?GETPOST("maxprint",'int'):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('actioncode','array')) { @@ -93,22 +95,22 @@ if (GETPOST('actioncode','array')) } else { - $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE)); + $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode","alpha")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); -$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); +$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int')); if ($dateselect > 0) { - $day=GETPOST('dateselectday'); - $month=GETPOST('dateselectmonth'); - $year=GETPOST('dateselectyear'); + $day=GETPOST('dateselectday','int'); + $month=GETPOST('dateselectmonth','int'); + $year=GETPOST('dateselectyear','int'); } $tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS; $tmparray=explode('-',$tmp); -$begin_h = GETPOST('begin_h')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9); -$end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18); +$begin_h = GETPOST('begin_h','int')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9); +$end_h = GETPOST('end_h','int')?GETPOST('end_h','int'):($tmparray[1] != '' ? $tmparray[1] : 18); if ($begin_h < 0 || $begin_h > 23) $begin_h = 9; if ($end_h < 1 || $end_h > 24) $end_h = 18; if ($end_h <= $begin_h) $end_h = $begin_h + 1; @@ -124,13 +126,13 @@ if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $ac if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') { $action='show_month'; $day=''; } // View by month -if (GETPOST('viewweek') || $action == 'show_week') { +if (GETPOST('viewweek','alpha') || $action == 'show_week') { $action='show_week'; $week=($week?$week:date("W")); $day=($day?$day:date("d")); } // View by week -if (GETPOST('viewday') || $action == 'show_day') { +if (GETPOST('viewday','alpha') || $action == 'show_day') { $action='show_day'; $day=($day?$day:date("d")); } // View by day -if (GETPOST('viewyear') || $action == 'show_year') { +if (GETPOST('viewyear','alpha') || $action == 'show_year') { $action='show_year'; } // View by year @@ -161,12 +163,12 @@ if ($action =='delete_action') * View */ -$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; -llxHeader('',$langs->trans("Agenda"),$help_url); - $form=new Form($db); $companystatic=new Societe($db); +$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; +llxHeader('',$langs->trans("Agenda"),$help_url); + $now=dol_now(); $nowarray=dol_getdate($now); $nowyear=$nowarray['year']; @@ -354,7 +356,7 @@ $sql.= ' a.datep2,'; $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; -$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,'; +$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,'; $sql.= ' ca.code, ca.color'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; @@ -456,11 +458,14 @@ if ($resql) continue; } + $datep=$db->jdate($obj->datep); + $datep2=$db->jdate($obj->datep2); + // Create a new object action $event=new ActionComm($db); $event->id=$obj->id; - $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date - $event->datef=$db->jdate($obj->datep2); + $event->datep=$datep; // datep and datef are GMT date + $event->datef=$datep2; $event->type_code=$obj->code; $event->type_color=$obj->color; //$event->libelle=$obj->label; // deprecated @@ -469,12 +474,13 @@ if ($resql) //$event->author->id=$obj->fk_user_author; // user id of creator $event->authorid=$obj->fk_user_author; // user id of creator $event->userownerid=$obj->fk_user_action; // user id of owner - $event->fetch_userassigned(); // This load $event->userassigned $event->priority=$obj->priority; $event->fulldayevent=$obj->fulldayevent; $event->location=$obj->location; $event->transparency=$obj->transparency; + $event->fk_project=$obj->fk_project; + $event->socid=$obj->fk_soc; $event->contactid=$obj->fk_contact; //$event->societe->id=$obj->fk_soc; // deprecated @@ -487,15 +493,15 @@ if ($resql) // They are date start and end of action but modified to not be outside calendar view. if ($event->percentage <= 0) { - $event->date_start_in_calendar=$event->datep; - if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef; - else $event->date_end_in_calendar=$event->datep; + $event->date_start_in_calendar=$datep; + if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar=$datep2; + else $event->date_end_in_calendar=$datep; } else - { - $event->date_start_in_calendar=$event->datep; - if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef; - else $event->date_end_in_calendar=$event->datep; + { + $event->date_start_in_calendar=$datep; + if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar=$datep2; + else $event->date_end_in_calendar=$datep; } // Define ponctual property if ($event->date_start_in_calendar == $event->date_end_in_calendar) @@ -508,10 +514,14 @@ if ($resql) $event->date_start_in_calendar >= $lastdaytoshow) { // This record is out of visible range + unset($event); } else { - if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; + //print $i.' - '.dol_print_date($this->date_start_in_calendar, 'dayhour').' - '.dol_print_date($this->date_end_in_calendar, 'dayhour').'
'."\n"; + $event->fetch_userassigned(); // This load $event->userassigned + + if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1); // Add an entry in actionarray for each day @@ -881,11 +891,37 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s } $cases1[$h][$event->id]['string'].=' - '.$event->label; $cases1[$h][$event->id]['typecode']=$event->type_code; - if ($event->socid) - { - //$cases1[$h][$event->id]['string'].='xxx'; - } $cases1[$h][$event->id]['color']=$color; + if ($event->fk_project > 0) + { + if (empty($cache_project[$event->fk_project])) + { + $tmpproj=new Project($db); + $tmpproj->fetch($event->fk_project); + $cache_project[$event->fk_project]=$tmpproj; + } + $cases1[$h][$event->id]['string'].=', '.$langs->trans("Project").': '.$cache_project[$event->fk_project]->ref.' - '.$cache_project[$event->fk_project]->title; + } + if ($event->socid > 0) + { + if (empty($cache_thirdparty[$event->socid])) + { + $tmpthirdparty=new Societe($db); + $tmpthirdparty->fetch($event->socid); + $cache_thirdparty[$event->socid]=$tmpthirdparty; + } + $cases1[$h][$event->id]['string'].=', '.$cache_thirdparty[$event->socid]->name; + } + if ($event->contactid > 0) + { + if (empty($cache_contact[$event->contactid])) + { + $tmpcontact=new Contact($db); + $tmpcontact->fetch($event->contactid); + $cache_contact[$event->contactid]=$tmpcontact; + } + $cases1[$h][$event->id]['string'].=', '.$cache_contact[$event->contactid]->getFullName($langs); + } } if ($event->date_start_in_calendar < $c && $dateendtouse > $b) { @@ -901,11 +937,37 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s } $cases2[$h][$event->id]['string'].=' - '.$event->label; $cases2[$h][$event->id]['typecode']=$event->type_code; - if ($event->socid) - { - //$cases2[$h][$event->id]['string'].='xxx'; - } $cases2[$h][$event->id]['color']=$color; + if ($event->fk_project > 0) + { + if (empty($cache_project[$event->fk_project])) + { + $tmpproj=new Project($db); + $tmpproj->fetch($event->fk_project); + $cache_project[$event->fk_project]=$tmpproj; + } + $cases2[$h][$event->id]['string'].=', '.$langs->trans("Project").': '.$cache_project[$event->fk_project]->ref.' - '.$cache_project[$event->fk_project]->title; + } + if ($event->socid > 0) + { + if (empty($cache_thirdparty[$event->socid])) + { + $tmpthirdparty=new Societe($db); + $tmpthirdparty->fetch($event->socid); + $cache_thirdparty[$event->socid]=$tmpthirdparty; + } + $cases2[$h][$event->id]['string'].=', '.$cache_thirdparty[$event->socid]->name; + } + if ($event->contactid > 0) + { + if (empty($cache_contact[$event->contactid])) + { + $tmpcontact=new Contact($db); + $tmpcontact->fetch($event->contactid); + $cache_contact[$event->contactid]=$tmpcontact; + } + $cases2[$h][$event->id]['string'].=', '.$cache_contact[$event->contactid]->getFullName($langs); + } } } else @@ -928,6 +990,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s } } + // Now output $casesX for ($h = $begin_h; $h < $end_h; $h++) { $color1='';$color2=''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 42fb67c8bde..792d4f9760d 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -30,15 +30,17 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; -$filter = GETPOST("filter",'',3); +$filter = GETPOST("filter",'alpha',3); $filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id; @@ -55,7 +57,7 @@ $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page","int"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="a.datec"; @@ -82,9 +84,9 @@ $month=GETPOST("month","int")?GETPOST("month","int"):date("m"); $week=GETPOST("week","int")?GETPOST("week","int"):date("W"); $day=GETPOST("day","int")?GETPOST("day","int"):date("d"); $pid=GETPOST("projectid","int",3); -$status=GETPOST("status"); -$type=GETPOST("type"); -$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$status=GETPOST("status",'alpha'); +$type=GETPOST("type",'alpha'); +$maxprint=((GETPOST("maxprint",'int')!='')?GETPOST("maxprint",'int'):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('actioncode','array')) { @@ -93,29 +95,30 @@ if (GETPOST('actioncode','array')) } else { - $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE)); + $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode","alpha")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); -$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); + +$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int')); if ($dateselect > 0) { - $day=GETPOST('dateselectday'); - $month=GETPOST('dateselectmonth'); - $year=GETPOST('dateselectyear'); + $day=GETPOST('dateselectday','int'); + $month=GETPOST('dateselectmonth','int'); + $year=GETPOST('dateselectyear','int'); } $tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS; $tmparray=explode('-',$tmp); -$begin_h = GETPOST('begin_h')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9); -$end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18); +$begin_h = GETPOST('begin_h','int')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9); +$end_h = GETPOST('end_h','int')?GETPOST('end_h','int'):($tmparray[1] != '' ? $tmparray[1] : 18); if ($begin_h < 0 || $begin_h > 23) $begin_h = 9; if ($end_h < 1 || $end_h > 24) $end_h = 18; if ($end_h <= $begin_h) $end_h = $begin_h + 1; $tmp=empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)?'1-5':$conf->global->MAIN_DEFAULT_WORKING_DAYS; $tmparray=explode('-',$tmp); -$begin_d = GETPOST('begin_d')?GETPOST('begin_d','int'):($tmparray[0] != '' ? $tmparray[0] : 1); -$end_d = GETPOST('end_d')?GETPOST('end_d'):($tmparray[1] != '' ? $tmparray[1] : 5); +$begin_d = GETPOST('begin_d','int')?GETPOST('begin_d','int'):($tmparray[0] != '' ? $tmparray[0] : 1); +$end_d = GETPOST('end_d','int')?GETPOST('end_d','int'):($tmparray[1] != '' ? $tmparray[1] : 5); if ($begin_d < 1 || $begin_d > 7) $begin_d = 1; if ($end_d < 1 || $end_d > 7) $end_d = 7; if ($end_d < $begin_d) $end_d = $begin_d + 1; @@ -123,13 +126,13 @@ if ($end_d < $begin_d) $end_d = $begin_d + 1; if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); -if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') { +if (GETPOST('viewcal','alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') { $action='show_month'; $day=''; } // View by month -if (GETPOST('viewweek') || $action == 'show_week') { +if (GETPOST('viewweek','alpha') || $action == 'show_week') { $action='show_week'; $week=($week?$week:date("W")); $day=($day?$day:date("d")); } // View by week -if (GETPOST('viewday') || $action == 'show_day') { +if (GETPOST('viewday','alpha') || $action == 'show_day') { $action='show_day'; $day=($day?$day:date("d")); } // View by day @@ -160,12 +163,12 @@ if ($action =='delete_action') * View */ -$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; -llxHeader('',$langs->trans("Agenda"),$help_url); - $form=new Form($db); $companystatic=new Societe($db); +$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; +llxHeader('',$langs->trans("Agenda"),$help_url); + $now=dol_now(); $nowarray=dol_getdate($now); $nowyear=$nowarray['year']; @@ -361,7 +364,7 @@ $sql.= ' a.datep2,'; $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; -$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,'; +$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,'; $sql.= ' ca.code, ca.color'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; @@ -418,14 +421,14 @@ else { // To limit array $sql.= " AND ("; - $sql.= " (a.datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; // Start 7 days before - $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; // End 7 days after + 3 to go from 28 to 31 + $sql.= " (a.datep BETWEEN '".$db->idate($firstdaytoshow-(60*60*24*2))."'"; // Start 2 day before $firstdaytoshow + $sql.= " AND '".$db->idate($lastdaytoshow+(60*60*24*2))."')"; // End 2 day after $lastdaytoshow $sql.= " OR "; - $sql.= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; - $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; + $sql.= " (a.datep2 BETWEEN '".$db->idate($firstdaytoshow-(60*60*24*2))."'"; + $sql.= " AND '".$db->idate($lastdaytoshow+(60*60*24*2))."')"; $sql.= " OR "; - $sql.= " (a.datep < '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; - $sql.= " AND a.datep2 > '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; + $sql.= " (a.datep < '".$db->idate($firstdaytoshow-(60*60*24*2))."'"; + $sql.= " AND a.datep2 > '".$db->idate($lastdaytoshow+(60*60*24*2))."')"; $sql.= ')'; } if ($type) $sql.= " AND ca.id = ".$type; @@ -444,13 +447,14 @@ if ($filtert > 0 || $usergroup > 0) } // Sort on date $sql.= ' ORDER BY fk_user_action, datep'; //fk_user_action -//print $sql; +//print $sql;exit; dol_syslog("comm/action/peruser.php", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); + $i=0; while ($i < $num) { @@ -463,11 +467,14 @@ if ($resql) continue; } + $datep=$db->jdate($obj->datep); + $datep2=$db->jdate($obj->datep2); + // Create a new object action $event=new ActionComm($db); $event->id=$obj->id; - $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date - $event->datef=$db->jdate($obj->datep2); + $event->datep=$datep; // datep and datef are GMT date + $event->datef=$datep2; $event->type_code=$obj->code; $event->type_color=$obj->color; //$event->libelle=$obj->label; // deprecated @@ -476,12 +483,13 @@ if ($resql) //$event->author->id=$obj->fk_user_author; // user id of creator $event->authorid=$obj->fk_user_author; // user id of creator $event->userownerid=$obj->fk_user_action; // user id of owner - $event->fetch_userassigned(); // This load $event->userassigned $event->priority=$obj->priority; $event->fulldayevent=$obj->fulldayevent; $event->location=$obj->location; $event->transparency=$obj->transparency; + $event->fk_project=$obj->fk_project; + $event->socid=$obj->fk_soc; $event->contactid=$obj->fk_contact; //$event->societe->id=$obj->fk_soc; // deprecated @@ -494,15 +502,15 @@ if ($resql) // They are date start and end of action but modified to not be outside calendar view. if ($event->percentage <= 0) { - $event->date_start_in_calendar=$event->datep; - if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef; - else $event->date_end_in_calendar=$event->datep; + $event->date_start_in_calendar=$datep; + if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar=$datep2; + else $event->date_end_in_calendar=$datep; } else { - $event->date_start_in_calendar=$event->datep; - if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef; - else $event->date_end_in_calendar=$event->datep; + $event->date_start_in_calendar=$datep; + if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar=$datep2; + else $event->date_end_in_calendar=$datep; } // Define ponctual property if ($event->date_start_in_calendar == $event->date_end_in_calendar) @@ -515,10 +523,14 @@ if ($resql) $event->date_start_in_calendar >= $lastdaytoshow) { // This record is out of visible range + unset($event); } else { - if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; + //print $i.' - '.dol_print_date($this->date_start_in_calendar, 'dayhour').' - '.dol_print_date($this->date_end_in_calendar, 'dayhour').'
'."\n"; + $event->fetch_userassigned(); // This load $event->userassigned + + if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1); // Add an entry in actionarray for each day @@ -548,6 +560,7 @@ if ($resql) $i++; } + $db->free($resql); } else { @@ -729,8 +742,8 @@ foreach ($usernames as $username) { $var = ! $var; echo ""; - echo ''; - print $username->getNomUrl(-1,'',0,0,24,1,''); + echo ''; + print $username->getNomUrl(-1,'',0,0,20,1,''); print ''; $tmpday = $sav; @@ -865,11 +878,12 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & global $theme_datacolor; // Array with a list of different we can use (come from theme) global $cachethirdparties, $cachecontacts, $colorindexused; global $begin_h, $end_h; + global $cache_project, $cache_thirdparty, $cache_contact; $cases1 = array(); // Color first half hour $cases2 = array(); // Color second half hour - $curtime = dol_mktime(0, 0, 0, $month, $day, $year); + $curtime = dol_mktime(0, 0, 0, $month, $day, $year, false, 0); $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); @@ -980,13 +994,39 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour'); else $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour'); } - $cases1[$h][$event->id]['string'].=' - '.$event->label; + if ($event->label) $cases1[$h][$event->id]['string'].=' - '.$event->label; $cases1[$h][$event->id]['typecode']=$event->type_code; - if ($event->socid) - { - //$cases1[$h][$event->id]['string'].='xxx'; - } $cases1[$h][$event->id]['color']=$color; + if ($event->fk_project > 0) + { + if (empty($cache_project[$event->fk_project])) + { + $tmpproj=new Project($db); + $tmpproj->fetch($event->fk_project); + $cache_project[$event->fk_project]=$tmpproj; + } + $cases1[$h][$event->id]['string'].=', '.$langs->trans("Project").': '.$cache_project[$event->fk_project]->ref.' - '.$cache_project[$event->fk_project]->title; + } + if ($event->socid > 0) + { + if (empty($cache_thirdparty[$event->socid])) + { + $tmpthirdparty=new Societe($db); + $tmpthirdparty->fetch($event->socid); + $cache_thirdparty[$event->socid]=$tmpthirdparty; + } + $cases1[$h][$event->id]['string'].=', '.$cache_thirdparty[$event->socid]->name; + } + if ($event->contactid > 0) + { + if (empty($cache_contact[$event->contactid])) + { + $tmpcontact=new Contact($db); + $tmpcontact->fetch($event->contactid); + $cache_contact[$event->contactid]=$tmpcontact; + } + $cases1[$h][$event->id]['string'].=', '.$cache_contact[$event->contactid]->getFullName($langs); + } } if ($event->date_start_in_calendar < $c && $dateendtouse > $b) { @@ -1000,13 +1040,39 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour'); else $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour'); } - $cases2[$h][$event->id]['string'].=' - '.$event->label; + if ($event->label) $cases2[$h][$event->id]['string'].=' - '.$event->label; $cases2[$h][$event->id]['typecode']=$event->type_code; - if ($event->socid) - { - //$cases2[$h][$event->id]['string'].='xxx'; - } $cases2[$h][$event->id]['color']=$color; + if ($event->fk_project > 0) + { + if (empty($cache_project[$event->fk_project])) + { + $tmpproj=new Project($db); + $tmpproj->fetch($event->fk_project); + $cache_project[$event->fk_project]=$tmpproj; + } + $cases2[$h][$event->id]['string'].=', '.$langs->trans("Project").': '.$cache_project[$event->fk_project]->ref.' - '.$cache_project[$event->fk_project]->title; + } + if ($event->socid > 0) + { + if (empty($cache_thirdparty[$event->socid])) + { + $tmpthirdparty=new Societe($db); + $tmpthirdparty->fetch($event->socid); + $cache_thirdparty[$event->socid]=$tmpthirdparty; + } + $cases2[$h][$event->id]['string'].=', '.$cache_thirdparty[$event->socid]->name; + } + if ($event->contactid > 0) + { + if (empty($cache_contact[$event->contactid])) + { + $tmpcontact=new Contact($db); + $tmpcontact->fetch($event->contactid); + $cache_contact[$event->contactid]=$tmpcontact; + } + $cases2[$h][$event->id]['string'].=', '.$cache_contact[$event->contactid]->getFullName($langs); + } } } else @@ -1029,6 +1095,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } } + // Now output $casesX for ($h = $begin_h; $h < $end_h; $h++) { $color1='';$color2=''; diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index e83506d8206..dcda4e0cf04 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -42,7 +42,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="a.datep"; diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 72e2dbadff4..6547f453b21 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -52,7 +52,7 @@ $object = new Address($db); */ // Cancel -if (GETPOST("cancel") && ! empty($backtopage)) +if (GETPOST('cancel','alpha') && ! empty($backtopage)) { header("Location: ".$backtopage); exit; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index a51ef902eb6..1b3d231382c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Alexandre Spangaro @@ -35,8 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; @@ -72,7 +73,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="nom"; -$cancelbutton = GETPOST('cancel'); +$cancelbutton = GETPOST('cancel','alpha'); $object = new Client($db); $extrafields = new ExtraFields($db); @@ -206,7 +207,7 @@ if ($id > 0 && empty($object->id)) { // Load data of third party $res=$object->fetch($id); - if ($object->id <= 0) dol_print_error($db,$object->error); + if ($object->id <= 0) dol_print_error($db,$object->error,$object->errors); } $title=$langs->trans("CustomerCard"); @@ -330,25 +331,27 @@ if ($id > 0) print ""; print ''; - // Compte bancaire par défaut - print ''; - print ''; - print '
'; - print $langs->trans('PaymentBankAccount'); - print ''; - if (($action != 'editbankaccount') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; - print ''; - if ($action == 'editbankaccount') + if (! empty($conf->banque->enabled)) { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1); + // Compte bancaire par défaut + print ''; + print ''; + print '
'; + print $langs->trans('PaymentBankAccount'); + print ''; + if (($action != 'editbankaccount') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; + print ''; + if ($action == 'editbankaccount') + { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1); + } + else + { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'none'); + } + print ""; + print ''; } - else - { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'none'); - } - print ""; - print ''; - // Relative discounts (Discounts-Drawbacks-Rebates) print ''; @@ -534,81 +537,86 @@ if ($id > 0) $boxstat.=''; $boxstat.=''; $boxstat.='
'; - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { - // Box proposals - $tmp = $object->getOutstandingProposals(); - $outstandingOpened=$tmp['opened']; - $outstandingTotal=$tmp['total_ht']; - $outstandingTotalIncTax=$tmp['total_ttc']; - $text=$langs->trans("OverAllProposals"); - $link=''; - $icon='bill'; - if ($link) $boxstat.=''; - $boxstat.='
'; - $boxstat.=''.img_object("",$icon).' '.$text.'
'; - $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; - $boxstat.='
'; - if ($link) $boxstat.='
'; + // Box proposals + $tmp = $object->getOutstandingProposals(); + $outstandingOpened=$tmp['opened']; + $outstandingTotal=$tmp['total_ht']; + $outstandingTotalIncTax=$tmp['total_ttc']; + $text=$langs->trans("OverAllProposals"); + $link=''; + $icon='bill'; + if ($link) $boxstat.=''; + $boxstat.='
'; + $boxstat.=''.img_object("",$icon).' '.$text.'
'; + $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; + $boxstat.='
'; + if ($link) $boxstat.='
'; } - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { - // Box proposals - $tmp = $object->getOutstandingOrders(); - $outstandingOpened=$tmp['opened']; - $outstandingTotal=$tmp['total_ht']; - $outstandingTotalIncTax=$tmp['total_ttc']; - $text=$langs->trans("OverAllOrders"); - $link=''; - $icon='bill'; - if ($link) $boxstat.=''; - $boxstat.='
'; - $boxstat.=''.img_object("",$icon).' '.$text.'
'; - $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; - $boxstat.='
'; - if ($link) $boxstat.='
'; + // Box proposals + $tmp = $object->getOutstandingOrders(); + $outstandingOpened=$tmp['opened']; + $outstandingTotal=$tmp['total_ht']; + $outstandingTotalIncTax=$tmp['total_ttc']; + $text=$langs->trans("OverAllOrders"); + $link=''; + $icon='bill'; + if ($link) $boxstat.=''; + $boxstat.='
'; + $boxstat.=''.img_object("",$icon).' '.$text.'
'; + $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; + $boxstat.='
'; + if ($link) $boxstat.='
'; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { - $tmp = $object->getOutstandingBills(); - $outstandingOpened=$tmp['opened']; - $outstandingTotal=$tmp['total_ht']; - $outstandingTotalIncTax=$tmp['total_ttc']; + $tmp = $object->getOutstandingBills(); + $outstandingOpened=$tmp['opened']; + $outstandingTotal=$tmp['total_ht']; + $outstandingTotalIncTax=$tmp['total_ttc']; + $text=$langs->trans("OverAllInvoices"); + $link=''; + $icon='bill'; + if ($link) $boxstat.=''; + $boxstat.='
'; + $boxstat.=''.img_object("",$icon).' '.$text.'
'; + $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; + $boxstat.='
'; + if ($link) $boxstat.='
'; - $text=$langs->trans("OverAllInvoices"); - $link=''; - $icon='bill'; - if ($link) $boxstat.=''; - $boxstat.='
'; - $boxstat.=''.img_object("",$icon).' '.$text.'
'; - $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; - $boxstat.='
'; - if ($link) $boxstat.='
'; + // Box outstanding bill + $warn = ''; + if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpened) + { + $warn = ' '.img_warning($langs->trans("OutstandingBillReached")); + } + $text=$langs->trans("CurrentOutstandingBill"); + $link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id; + $icon='bill'; + if ($link) $boxstat.=''; + $boxstat.='
'; + $boxstat.=''.img_object("",$icon).' '.$text.'
'; + $boxstat.=''.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.''; + $boxstat.='
'; + if ($link) $boxstat.='
'; + } - // Box outstanding bill - $warn = ''; - if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpened) - { - $warn = ' '.img_warning($langs->trans("OutstandingBillReached")); - } - $text=$langs->trans("CurrentOutstandingBill"); - $link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id; - $icon='bill'; - if ($link) $boxstat.=''; - $boxstat.='
'; - $boxstat.=''.img_object("",$icon).' '.$text.'
'; - $boxstat.=''.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.''; - $boxstat.='
'; - if ($link) $boxstat.='
'; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreBoxStatsCustomer', $parameters, $object, $action); + if(empty($reshook)){ + $boxstat.= $hookmanager->resPrint; } $boxstat.='
'; $boxstat.='
'; - print $boxstat; + print $boxstat; $now=dol_now(); @@ -946,6 +954,107 @@ if ($id > 0) } } + /* + * Last invoices templates + */ + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) + { + $invoicetemplate = new FactureRec($db); + + $sql = 'SELECT f.rowid as id, f.titre as ref, f.amount'; + $sql.= ', f.total as total_ht'; + $sql.= ', f.tva as total_tva'; + $sql.= ', f.total_ttc'; + $sql.= ', f.datec as dc'; + $sql.= ', f.date_last_gen'; + $sql.= ', f.frequency'; + $sql.= ', f.unit_frequency'; + $sql.= ', f.suspended as suspended'; + $sql.= ', s.nom, s.rowid as socid'; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f"; + $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= ' GROUP BY f.rowid, f.titre, f.amount, f.total, f.tva, f.total_ttc,'; + $sql.= ' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,'; + $sql.= ' f.suspended,'; + $sql.= ' s.nom, s.rowid'; + $sql.= " ORDER BY f.date_last_gen, f.datec DESC"; + + $resql=$db->query($sql); + if ($resql) + { + $var=true; + $num = $db->num_rows($resql); + $i = 0; + if ($num > 0) + { + print ''; + + print ''; + print ''; + print ''; + } + + while ($i < $num && $i < $MAXLIST) + { + $objp = $db->fetch_object($resql); + + print ''; + print ''; + if ($objp->frequency && $objp->date_last_gen > 0) + { + print ''; + } + else + { + if ($objp->dc > 0) + { + print ''; + } + else + { + print ''; + } + } + print ''; + + if (! empty($conf->global->MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES)) + { + print ''; + } + + print ''; + print "\n"; + $i++; + } + $db->free($resql); + + if ($num > 0) print "
'; + print '
'.$langs->trans("LatestCustomerTemplateInvoices",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.'
'; + $invoicetemplate->id = $objp->id; + $invoicetemplate->ref = $objp->ref; + $invoicetemplate->suspended = $objp->suspended; + $invoicetemplate->frequency = $objp->frequency; + $invoicetemplate->unit_frequency = $objp->unit_frequency; + $invoicetemplate->total_ht = $objp->total_ht; + $invoicetemplate->total_tva = $objp->total_tva; + $invoicetemplate->total_ttc = $objp->total_ttc; + print $invoicetemplate->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->date_last_gen),'day').''.dol_print_date($db->jdate($objp->dc),'day').'!!!'; + print price($objp->total_ht); + print ''; + print price($objp->total_ttc); + print ''; + print $langs->trans('FrequencyPer_'.$invoicetemplate->unit_frequency, $invoicetemplate->frequency).' - '; + print ($invoicetemplate->LibStatut($invoicetemplate->frequency,$invoicetemplate->suspended,5,0)); + print '
"; + } + else + { + dol_print_error($db); + } + } + /* * Last invoices */ diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index a13ffe61c76..5c160bfab16 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -126,14 +126,14 @@ if ($resql) print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,"",$num); print '
'; - + print ''; print ''; - print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Email")); - print_liste_field_titre($langs->trans("Phone")); + print_liste_field_titre("Lastname",$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder); + print_liste_field_titre("Firstname",$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder); + print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder); + print_liste_field_titre("Email"); + print_liste_field_titre("Phone"); print "\n"; print ''; @@ -150,7 +150,7 @@ if ($resql) { $obj = $db->fetch_object($resql); - + print ''; print '
'.img_object($langs->trans("ShowContact"),"contact"); @@ -168,9 +168,9 @@ if ($resql) $i++; } print "
"; - + print '
'; - + $db->free($resql); } else diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 81c29f687ce..39d1b7c8d8d 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -22,6 +22,8 @@ * \brief Page to define emailing targets */ +if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/mailing.class.php'; @@ -66,7 +68,7 @@ $search_email = GETPOST("search_email"); $template_id = GETPOST('template_id', 'int'); // Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x")) { +if (GETPOST('button_removefilter_x','alpha')) { $search_nom = ''; $search_prenom = ''; $search_email = ''; @@ -404,14 +406,8 @@ if ($_POST["button_removefilter"]) { * View */ -$extrajs = array ( - '/includes/jquery/plugins/multiselect/js/ui.multiselect.js' -); -$extracss = array ( - '/includes/jquery/plugins/multiselect/css/ui.multiselect.css', -); -llxHeader('', $langs->trans("MailAdvTargetRecipients"), '', '', '', '', $extrajs, $extracss); +llxHeader('', $langs->trans("MailAdvTargetRecipients")); print ''; - $return .= ''; - - if ($showempty) - $return .= ''; - - // Find if keys is in selected array value - if (is_array($selected_array) && count($selected_array)>0) { - $intersect_array = array_intersect_key($options_array, array_flip($selected_array)); - } else { - $intersect_array=array(); - } - - if (count($options_array) > 0) { - foreach ($options_array as $keyoption => $valoption) { - // If key is in intersect table then it have to e selected - $selected = ''; - if (count ( $intersect_array ) > 0) { - if (array_key_exists ( $keyoption, $intersect_array )) { - $selected = ' selected="selected"'; - } - } - $return .= '' . $valoption . ''; - } - } - - $return .= ''; - + $form=new Form($this->db); + $return = $form->multiselectarray($htmlname, $options_array, $selected_array,0,0,'',0,295); return $return; } @@ -448,7 +407,7 @@ class FormAdvTargetEmailing extends Form dol_print_error($this->db); } - return $this->advMultiselectarray ( $htmlname, $options_array, $selected_array ); + return $this->advMultiselectarray( $htmlname, $options_array, $selected_array ); } /** diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index fb513c99b9b..82cb53fdfbf 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -109,7 +109,7 @@ if ($result) $param = "&sall=".urlencode($sall); if ($filteremail) $param.='&filteremail='.urlencode($filteremail); - + print '
'; if ($optioncss != '') print ''; print ''; @@ -117,9 +117,9 @@ if ($result) print ''; print ''; print ''; - + $moreforfilter = ''; - + print '
'; print ''."\n"; @@ -142,24 +142,24 @@ if ($result) print "\n"; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"m.titre",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"m.date_creat",$param,"",'align="center"',$sortfield,$sortorder); - if (! $filteremail) print_liste_field_titre($langs->trans("NbOfEMails"),$_SERVER["PHP_SELF"],"m.nbemail",$param,"",'align="center"',$sortfield,$sortorder); - if (! $filteremail) print_liste_field_titre($langs->trans("DateLastSend"),$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); - else print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"m.titre",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"m.date_creat",$param,"",'align="center"',$sortfield,$sortorder); + if (! $filteremail) print_liste_field_titre("NbOfEMails",$_SERVER["PHP_SELF"],"m.nbemail",$param,"",'align="center"',$sortfield,$sortorder); + if (! $filteremail) print_liste_field_titre("DateLastSend",$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); + else print_liste_field_titre("DateSending",$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - - + + $email=new Mailing($db); while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - + print ""; print ''; } print '' . "\n"; @@ -1739,7 +1742,7 @@ if ($action == 'create') // Proposal card - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; @@ -1748,6 +1751,7 @@ if ($action == 'create') $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' ('.$langs->trans("OtherProposals").')'; // Project if (! empty($conf->projet->enabled)) { @@ -2369,7 +2373,7 @@ if ($action == 'create') // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'propal', $socid); + $somethingshown = $formactions->showactions($object, 'propal', $socid, 1); print '
'; } diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 2f067f46b18..42dbdbf9d2c 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -24,14 +24,14 @@ require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; /** * API class for orders * - * @access protected + * @access protected * @class DolibarrApiAccess {@requires user,external} */ class Proposals extends DolibarrApi { /** - * @var array $FIELDS Mandatory fields, checked when create and update object + * @var array $FIELDS Mandatory fields, checked when create and update object */ static $FIELDS = array( 'socid' @@ -56,36 +56,36 @@ class Proposals extends DolibarrApi * Get properties of a commercial proposal object * * Return an array with commercial proposal informations - * + * * @param int $id ID of commercial proposal * @return array|mixed data without useless information * * @throws RestException */ function get($id) - { + { if(! DolibarrApiAccess::$user->rights->propal->lire) { throw new RestException(401); } - + $result = $this->propal->fetch($id); if( ! $result ) { throw new RestException(404, 'Commercial Proposal not found'); } - + if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $this->propal->fetchObjectLinked(); return $this->_cleanObjectDatas($this->propal); } /** * List commercial proposals - * + * * Get a list of commercial proposals - * + * * @param string $sortfield Sort field * @param string $sortorder Sort order * @param int $limit Limit for list @@ -96,12 +96,12 @@ class Proposals extends DolibarrApi */ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $thirdparty_ids = '', $sqlfilters = '') { global $db, $conf; - + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; - + // If the internal user must only see his customers, force searching by him $search_sale = 0; if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id; @@ -109,7 +109,7 @@ class Proposals extends DolibarrApi $sql = "SELECT t.rowid"; if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) $sql.= " FROM ".MAIN_DB_PREFIX."propal as t"; - + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql.= ' WHERE t.entity IN ('.getEntity('propal').')'; @@ -122,7 +122,7 @@ class Proposals extends DolibarrApi $sql .= " AND sc.fk_user = ".$search_sale; } // Add sql filters - if ($sqlfilters) + if ($sqlfilters) { if (! DolibarrApi::_checkFilters($sqlfilters)) { @@ -131,7 +131,7 @@ class Proposals extends DolibarrApi $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; } - + $sql.= $db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) @@ -144,7 +144,7 @@ class Proposals extends DolibarrApi } $result = $db->query($sql); - + if ($result) { $num = $db->num_rows($result); @@ -195,7 +195,7 @@ class Proposals extends DolibarrApi if ($this->propal->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, "Error creating order", array_merge(array($this->propal->error), $this->propal->errors)); } - + return $this->propal->id; } @@ -203,21 +203,21 @@ class Proposals extends DolibarrApi * Get lines of a commercial proposal * * @param int $id Id of commercial proposal - * + * * @url GET {id}/lines - * - * @return int + * + * @return int */ function getLines($id) { if(! DolibarrApiAccess::$user->rights->propal->lire) { throw new RestException(401); } - + $result = $this->propal->fetch($id); if( ! $result ) { throw new RestException(404, 'Commercial Proposal not found'); } - + if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -233,22 +233,22 @@ class Proposals extends DolibarrApi * Add a line to given commercial proposal * * @param int $id Id of commercial proposal to update - * @param array $request_data Commercial proposal line data - * + * @param array $request_data Commercial proposal line data + * * @url POST {id}/lines - * - * @return int + * + * @return int */ function postLine($id, $request_data = NULL) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); } - + $result = $this->propal->fetch($id); if( ! $result ) { throw new RestException(404, 'Commercial Proposal not found'); } - + if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -294,22 +294,22 @@ class Proposals extends DolibarrApi * * @param int $id Id of commercial proposal to update * @param int $lineid Id of line to update - * @param array $request_data Commercial proposal line data - * + * @param array $request_data Commercial proposal line data + * * @url PUT {id}/lines/{lineid} - * - * @return object + * + * @return object */ function putLine($id, $lineid, $request_data = NULL) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); } - + $result = $this->propal->fetch($id); if( ! $result ) { throw new RestException(404, 'Proposal not found'); } - + if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -352,21 +352,21 @@ class Proposals extends DolibarrApi * * @param int $id Id of commercial proposal to update * @param int $lineid Id of line to delete - * + * * @url DELETE {id}/lines/{lineid} - * - * @return int + * + * @return int */ function delLine($id, $lineid) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); } - + $result = $this->propal->fetch($id); if( ! $result ) { throw new RestException(404, 'Proposal not found'); } - + if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -382,20 +382,20 @@ class Proposals extends DolibarrApi * Update commercial proposal general fields (won't touch lines of commercial proposal) * * @param int $id Id of commercial proposal to update - * @param array $request_data Datas - * - * @return int + * @param array $request_data Datas + * + * @return int */ function put($id, $request_data = NULL) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); } - + $result = $this->propal->fetch($id); if( ! $result ) { throw new RestException(404, 'Proposal not found'); } - + if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -403,18 +403,18 @@ class Proposals extends DolibarrApi if ($field == 'id') continue; $this->propal->$field = $value; } - + if($this->propal->update($id, DolibarrApiAccess::$user,1,'','','update')) return $this->get($id); - + return false; } - + /** * Delete commercial proposal * * @param int $id Commercial proposal ID - * + * * @return array */ function delete($id) @@ -426,32 +426,32 @@ class Proposals extends DolibarrApi if( ! $result ) { throw new RestException(404, 'Commercial Proposal not found'); } - + if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + if( ! $this->propal->delete(DolibarrApiAccess::$user)) { throw new RestException(500, 'Error when delete Commercial Proposal : '.$this->propal->error); } - + return array( 'success' => array( 'code' => 200, 'message' => 'Commercial Proposal deleted' ) ); - + } - + /** * Validate a commercial proposal - * + * * @param int $id Commercial proposal ID * @param int $notrigger Use {} - * + * * @url POST {id}/validate - * + * * @return array * FIXME An error 403 is returned if the request has an empty body. * Error message: "Forbidden: Content type `text/plain` is not supported." @@ -469,11 +469,11 @@ class Proposals extends DolibarrApi if( ! $result ) { throw new RestException(404, 'Commercial Proposal not found'); } - + if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $result = $this->propal->valid(DolibarrApiAccess::$user, $notrigger); if ($result == 0) { throw new RestException(500, 'Error nothing done. May be object is already validated'); @@ -481,30 +481,30 @@ class Proposals extends DolibarrApi if ($result < 0) { throw new RestException(500, 'Error when validating Commercial Proposal: '.$this->propal->error); } - + return array( 'success' => array( 'code' => 200, - 'message' => 'Commercial Proposal validated' + 'message' => 'Commercial Proposal validated (Ref='.$this->propal->ref.')' ) ); } - + /** * Validate fields before create or update object - * + * * @param array $data Array with data to verify - * @return array + * @return array * @throws RestException */ function _validate($data) { $propal = array(); - foreach (Orders::$FIELDS as $field) { + foreach (Proposals::$FIELDS as $field) { if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $propal[$field] = $data[$field]; - + } return $propal; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 11aa3c95b95..ec89ad69fa4 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -254,7 +254,7 @@ class Propal extends CommonObject $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; $vat_src_code = ''; // May be defined into tva_tx - + $localtax1_tx = get_localtax($tva_tx,1,$mysoc,$this->thirdparty,$tva_npr); $localtax2_tx = get_localtax($tva_tx,2,$mysoc,$this->thirdparty,$tva_npr); @@ -433,7 +433,7 @@ class Propal extends CommonObject // Check parameters if ($type < 0) return -1; - + if ($this->statut == self::STATUS_DRAFT) { $this->db->begin(); @@ -618,9 +618,10 @@ class Propal extends CommonObject * @param array $array_options extrafields array * @param string $fk_unit Code of the unit to use. Null to use the default one * @param double $pu_ht_devise Unit price in currency + * @param int $notrigger disable line update trigger * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise = 0) + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise = 0, $notrigger=0) { global $mysoc; @@ -745,7 +746,7 @@ class Propal extends CommonObject $this->line->multicurrency_total_tva = $multicurrency_total_tva; $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; - $result=$this->line->update(); + $result=$this->line->update($notrigger); if ($result > 0) { // Reorder if child line @@ -909,23 +910,23 @@ class Propal extends CommonObject $sql.= $this->socid; $sql.= ", 0"; $sql.= ", ".$this->remise; - $sql.= ", ".($this->remise_percent?$this->db->escape($this->remise_percent):'null'); - $sql.= ", ".($this->remise_absolue?$this->db->escape($this->remise_absolue):'null'); + $sql.= ", ".($this->remise_percent?$this->db->escape($this->remise_percent):'NULL'); + $sql.= ", ".($this->remise_absolue?$this->db->escape($this->remise_absolue):'NULL'); $sql.= ", 0"; $sql.= ", 0"; $sql.= ", '".$this->db->idate($this->date)."'"; $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", '(PROV)'"; - $sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null"); + $sql.= ", ".($user->id > 0 ? "'".$user->id."'":"NULL"); $sql.= ", '".$this->db->escape($this->note_private)."'"; $sql.= ", '".$this->db->escape($this->note_public)."'"; $sql.= ", '".$this->db->escape($this->modelpdf)."'"; - $sql.= ", ".($this->fin_validite!=''?"'".$this->db->idate($this->fin_validite)."'":"null"); - $sql.= ", ".$this->cond_reglement_id; - $sql.= ", ".$this->mode_reglement_id; + $sql.= ", ".($this->fin_validite!=''?"'".$this->db->idate($this->fin_validite)."'":"NULL"); + $sql.= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'NULL'); + $sql.= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL'); $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); $sql.= ", '".$this->db->escape($this->ref_client)."'"; - $sql.= ", ".($this->date_livraison!=''?"'".$this->db->idate($this->date_livraison)."'":"null"); + $sql.= ", ".($this->date_livraison!=''?"'".$this->db->idate($this->date_livraison)."'":"NULL"); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:'NULL'); $sql.= ", ".$this->availability_id; $sql.= ", ".$this->demand_reason_id; @@ -1392,17 +1393,17 @@ class Propal extends CommonObject return -1; } } - + /** * Load array lines - * + * * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ function fetch_lines($only_product=0) { $this->lines=array(); - + $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; $sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,'; $sql.= ' d.fk_unit,'; @@ -1422,7 +1423,7 @@ class Propal extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $num = $this->db->num_rows($result); - + $i = 0; while ($i < $num) { @@ -1489,9 +1490,9 @@ class Propal extends CommonObject //print "xx $i ".$this->lines[$i]->fk_product; $i++; } - + $this->db->free($result); - + return 1; } else @@ -2305,7 +2306,7 @@ class Propal extends CommonObject if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->thirdparty->default_lang); + $newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } //$ret=$object->fetch($id); // Reload to get new records @@ -2361,7 +2362,7 @@ class Propal extends CommonObject $this->db->begin(); $sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET fk_statut = '.self::STATUS_BILLED; - $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT.' ;'; + $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; dol_syslog(__METHOD__, LOG_DEBUG); $resql=$this->db->query($sql); @@ -2779,7 +2780,7 @@ class Propal extends CommonObject function availability($availability_id, $notrigger=0) { global $user; - + if ($this->statut >= self::STATUS_DRAFT) { $error=0; @@ -3277,13 +3278,14 @@ class Propal extends CommonObject /** * Return clicable link of object (with eventually picto) * - * @param int $withpicto Add picto into link - * @param string $option Where point the link ('expedition', 'document', ...) - * @param string $get_params Parametres added to url - * @param int $notooltip 1=Disable tooltip - * @return string String with URL + * @param int $withpicto Add picto into link + * @param string $option Where point the link ('expedition', 'document', ...) + * @param string $get_params Parametres added to url + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL */ - function getNomUrl($withpicto=0,$option='', $get_params='', $notooltip=0) + function getNomUrl($withpicto=0, $option='', $get_params='', $notooltip=0, $save_lastsearch_value=-1) { global $langs, $conf, $user; @@ -3318,6 +3320,14 @@ class Propal extends CommonObject if ($option == 'document') { $url = DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params; } + + if ($option != 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } } $linkclose=''; @@ -3352,9 +3362,9 @@ class Propal extends CommonObject function getLinesArray() { // TODO Duplicate with fetch_lines ? Wich one to keep ? - + $this->lines = array(); - + $sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,'; $sql.= ' pt.qty, pt.vat_src_code, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; $sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,'; @@ -3492,7 +3502,7 @@ class Propal extends CommonObject /** * Class to manage commercial proposal lines */ -class PropaleLigne extends CommonObjectLine +class PropaleLigne extends CommonObjectLine { public $element='propaldet'; public $table_element='propaldet'; @@ -3762,28 +3772,28 @@ class PropaleLigne extends CommonObjectLine $sql.= ' date_start, date_end'; $sql.= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc)'; $sql.= " VALUES (".$this->fk_propal.","; - $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; + $sql.= " ".($this->fk_parent_line>0?"'".$this->db->escape($this->fk_parent_line)."'":"null").","; $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " '".$this->db->escape($this->desc)."',"; - $sql.= " ".($this->fk_product?"'".$this->fk_product."'":"null").","; - $sql.= " '".$this->product_type."',"; - $sql.= " ".($this->fk_remise_except?"'".$this->fk_remise_except."'":"null").","; + $sql.= " ".($this->fk_product?"'".$this->db->escape($this->fk_product)."'":"null").","; + $sql.= " '".$this->db->escape($this->product_type)."',"; + $sql.= " ".($this->fk_remise_except?"'".$this->db->escape($this->fk_remise_except)."'":"null").","; $sql.= " ".price2num($this->qty).","; - $sql.= " ".(empty($this->vat_src_code)?"''":"'".$this->vat_src_code."'").","; + $sql.= " ".(empty($this->vat_src_code)?"''":"'".$this->db->escape($this->vat_src_code)."'").","; $sql.= " ".price2num($this->tva_tx).","; $sql.= " ".price2num($this->localtax1_tx).","; $sql.= " ".price2num($this->localtax2_tx).","; - $sql.= " '".$this->localtax1_type."',"; - $sql.= " '".$this->localtax2_type."',"; + $sql.= " '".$this->db->escape($this->localtax1_type)."',"; + $sql.= " '".$this->db->escape($this->localtax2_type)."',"; $sql.= " ".($this->subprice?price2num($this->subprice):"null").","; $sql.= " ".price2num($this->remise_percent).","; - $sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").","; + $sql.= " ".(isset($this->info_bits)?"'".$this->db->escape($this->info_bits)."'":"null").","; $sql.= " ".price2num($this->total_ht).","; $sql.= " ".price2num($this->total_tva).","; $sql.= " ".price2num($this->total_localtax1).","; $sql.= " ".price2num($this->total_localtax2).","; $sql.= " ".price2num($this->total_ttc).","; - $sql.= " ".(!empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").","; + $sql.= " ".(!empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null").","; $sql.= " ".(isset($this->pa_ht)?"'".price2num($this->pa_ht)."'":"null").","; $sql.= ' '.$this->special_code.','; $sql.= ' '.$this->rang.','; @@ -3965,7 +3975,7 @@ class PropaleLigne extends CommonObjectLine $sql.= ", total_localtax1=".price2num($this->total_localtax1).""; $sql.= ", total_localtax2=".price2num($this->total_localtax2).""; } - $sql.= ", fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null"); + $sql.= ", fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null"); $sql.= ", buy_price_ht=".price2num($this->pa_ht); if (strlen($this->special_code)) $sql.= ", special_code=".$this->special_code; $sql.= ", fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 3e9e5a1205d..01e851769a7 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -155,10 +155,10 @@ if ($object->id > 0) // Proposal card - - $linkback = '' . $langs->trans("BackToList") . ''; - - + + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -199,12 +199,12 @@ if ($object->id > 0) } } $morehtmlref.='
'; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_fiche_end(); - - + + // Contacts lines (modules that overwrite templates must declare this into descriptor) $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); foreach($dirtpls as $reldir) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 0c68a292109..3a9f3a98e26 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -45,7 +45,6 @@ $ref = GETPOST('ref','alpha'); $socid=''; if (! empty($user->societe_id)) { - $action=''; $socid = $user->societe_id; } $result = restrictedArea($user, 'propal', $id); @@ -103,7 +102,7 @@ if ($object->id > 0) // Proposal card - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index d8af8fb87a8..a94eeaa092c 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -66,7 +66,7 @@ $object->info($object->id); // Proposal card -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; @@ -122,6 +122,6 @@ dol_print_object_info($object); print '
'; dol_fiche_end(); - + llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 39ee93fd9cd..909b0f3ebc8 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -73,16 +73,17 @@ $search_zip=GETPOST('search_zip','alpha'); $search_state=trim(GETPOST("search_state")); $search_country=GETPOST("search_country",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); -$viewstatut=GETPOST('viewstatut'); +$search_day=GETPOST("search_day","int"); +$search_month=GETPOST("search_month","int"); +$search_year=GETPOST("search_year","int"); + +$viewstatut=GETPOST('viewstatut','alpha'); $optioncss = GETPOST('optioncss','alpha'); -$object_statut=GETPOST('propal_statut'); +$object_statut=GETPOST('propal_statut','alpha'); $sall=GETPOST('sall', 'alphanohtml'); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); -$day=GETPOST("day","int"); -$month=GETPOST("month","int"); -$year=GETPOST("year","int"); $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); @@ -168,8 +169,8 @@ $object = new Propal($db); // To be passed as parameter of executeHooks that nee * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -178,7 +179,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_categ=''; $search_user=''; @@ -197,9 +198,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_type=''; $search_country=''; $search_type_thirdparty=''; - $year=''; - $month=''; - $day=''; + $search_year=''; + $search_month=''; + $search_day=''; $viewstatut=''; $object_statut=''; $toselect=''; @@ -295,18 +296,18 @@ if ($viewstatut != '' && $viewstatut != '-1') { $sql.= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')'; } -if ($month > 0) +if ($search_month > 0) { - if ($year > 0 && empty($day)) - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; - else if ($year > 0 && ! empty($day)) - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + if ($search_year > 0 && empty($search_day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + else if ($search_year > 0 && ! empty($search_day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else - $sql.= " AND date_format(p.datep, '%m') = '".$db->escape($month)."'"; + $sql.= " AND date_format(p.datep, '%m') = '".$db->escape($search_month)."'"; } -else if ($year > 0) +else if ($search_year > 0) { - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; } if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale); if ($search_user > 0) @@ -320,8 +321,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -355,6 +357,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfProposals') . ' - '.$soc->name; + if (empty($search_societe)) $search_societe = $soc->name; } else { @@ -369,9 +372,10 @@ if ($resql) if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sall) $param.='&sall='.urlencode($sall); - if ($month) $param.='&month='.urlencode($month); - if ($year) $param.='&year='.urlencode($year); - if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_day) $param.='&search_day='.urlencode($search_day); + if ($search_month) $param.='&search_month='.urlencode($search_month); + if ($search_year) $param.='&search_year='.urlencode($search_year); + if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_refcustomer) $param.='&search_refcustomer='.urlencode($search_refcustomer); if ($search_societe) $param.='&search_societe='.urlencode($search_societe); if ($search_user > 0) $param.='&search_user='.urlencode($search_user); @@ -416,7 +420,7 @@ if ($resql) { $langs->load("mails"); - if (! GETPOST('cancel')) + if (! GETPOST('cancel','alpha')) { $objecttmp=new Propal($db); $listofselectedid=array(); @@ -611,19 +615,18 @@ if ($resql) // Date if (! empty($arrayfields['p.date']['checked'])) { - print '
'; } // Date end if (! empty($arrayfields['p.fin_validite']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['p.total_ht']['checked'])) { @@ -734,7 +737,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -755,7 +758,6 @@ if ($resql) { $obj = $db->fetch_object($resql); - $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; @@ -768,7 +770,7 @@ if ($resql) print '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 0c9d97fc299..7987555e569 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -210,7 +210,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -234,7 +234,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -558,7 +558,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -602,7 +602,7 @@ if (empty($reshook)) } // Close proposal - else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) + else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel','alpha')) { if (! GETPOST('statut')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); @@ -622,7 +622,7 @@ if (empty($reshook)) } // Reopen proposal - else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) + else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel','alpha')) { // prevent browser refresh from reopening proposal several times if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) @@ -663,7 +663,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -833,8 +833,8 @@ if (empty($reshook)) if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; - if (empty($newlang) && GETPOST('lang_id')) - $newlang = GETPOST('lang_id'); + if (empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); if (empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { @@ -920,7 +920,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -1065,7 +1065,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -1106,7 +1106,7 @@ if (empty($reshook)) } } - else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel')) + else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel','alpha')) { header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition exit(); @@ -1250,6 +1250,8 @@ $now = dol_now(); // Add new proposal if ($action == 'create') { + $currency_code = $conf->currency; + print load_fiche_titre($langs->trans("NewProp")); $soc = new Societe($db); @@ -1374,6 +1376,7 @@ if ($action == 'create') }); '; } + print ' '.$langs->trans("AddThirdParty").''; print '
'; + print ''; //print $langs->trans('Month').': '; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; //print ' '.$langs->trans('Year').': '; - $syear = $year; - $formother->select_year($syear,'year',1, 20, 5); + $formother->select_year($search_year,'search_year',1, 20, 5); print '  
'; // Picto + Ref print ''; // Warning $warnornote=''; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index ec1dac31c24..29fc43b0899 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -56,7 +56,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, /* - * View + * View */ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); @@ -79,13 +79,13 @@ if ($id > 0 || ! empty($ref)) $cssclass='titlefield'; //if ($action == 'editnote_public') $cssclass='titlefieldcreate'; //if ($action == 'editnote_private') $cssclass='titlefieldcreate'; - - + + // Proposal card - - $linkback = '' . $langs->trans("BackToList") . ''; - - + + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -126,17 +126,17 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
'; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; print '
'; - + $cssclass="titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; print '
'; - + dol_fiche_end(); } } diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 5c74c8374a0..273862f68bf 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -92,7 +92,7 @@ dol_mkdir($dir); $stats = new PropaleStats($db, $socid, ($userid>0?$userid:0), $mode); -if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$object_status.')'; +if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$db->escape($object_status).')'; // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); @@ -299,7 +299,7 @@ foreach ($data as $val) while (! empty($year) && $oldyear > $year+1) { // If we have empty year $oldyear--; - + print ''; print ''; print ''; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index bca371977a7..1ad4612d879 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -46,7 +46,7 @@ $backtopage = GETPOST('backtopage','alpha'); * Actions */ -if (GETPOST('cancel') && ! empty($backtopage)) +if (GETPOST('cancel','alpha') && ! empty($backtopage)) { header("Location: ".$backtopage); exit; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 9964db9ecde..04eb2583fb5 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -49,7 +49,7 @@ if ($user->societe_id > 0) * Actions */ -if (GETPOST('cancel') && ! empty($backtopage)) +if (GETPOST('cancel','alpha') && ! empty($backtopage)) { header("Location: ".$backtopage); exit; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index a10de641ea1..040b1e200d8 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -208,8 +208,8 @@ if (empty($reshook)) // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) - $newlang = GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { @@ -398,6 +398,7 @@ if (empty($reshook)) } // Now we create same links to contact than the ones found on origin object + /* Useless, already into the create if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) { $originforcontact = $object->origin; @@ -420,7 +421,7 @@ if (empty($reshook)) } } else dol_print_error($resqlcontact); - } + }*/ // Hooks $parameters = array('objFrom' => $srcobject); @@ -801,8 +802,8 @@ if (empty($reshook)) if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; - if (empty($newlang) && GETPOST('lang_id')) - $newlang = GETPOST('lang_id'); + if (empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); if (empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { @@ -1015,8 +1016,8 @@ if (empty($reshook)) // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) - $newlang = GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { @@ -1060,7 +1061,7 @@ if (empty($reshook)) } } - else if ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel') == $langs->trans('Cancel')) { + else if ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) { header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -1102,7 +1103,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -1155,7 +1156,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -1440,7 +1441,6 @@ if ($action == 'create' && $user->rights->commande->creer) $note_private = $object->getDefaultCreateValueFor('note_private'); $note_public = $object->getDefaultCreateValueFor('note_public'); } - $absolute_discount=$soc->getAvailableDiscounts(); print ''; @@ -1467,7 +1467,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; - // Client + // Thirdparty print ''; print ''; if ($socid > 0) { @@ -1477,7 +1477,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; } else { print ''; } print '' . "\n"; @@ -1915,7 +1916,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Order card - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; @@ -1924,6 +1925,7 @@ if ($action == 'create' && $user->rights->commande->creer) $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' ('.$langs->trans("OtherOrders").')'; // Project if (! empty($conf->projet->enabled)) { @@ -2039,7 +2041,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; } else { print $object->date ? dol_print_date($object->date, 'day') : ' '; - if ($object->hasDelay() && empty($object->date_livraison)) { + if ($object->hasDelay() && ! empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } @@ -2589,7 +2591,7 @@ if ($action == 'create' && $user->rights->commande->creer) // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'order', $socid); + $somethingshown = $formactions->showactions($object, 'order', $socid, 1); print '
'; } diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index a1330a7be04..d4b4502d4ed 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -80,8 +80,8 @@ class Orders extends DolibarrApi return $this->_cleanObjectDatas($this->commande); } - - + + /** * List orders * @@ -101,7 +101,7 @@ class Orders extends DolibarrApi global $db, $conf; $obj_ret = array(); - + // case of external user, $thirdparty_ids param is ignored and replaced by user's socid $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; @@ -125,7 +125,7 @@ class Orders extends DolibarrApi $sql .= " AND sc.fk_user = ".$search_sale; } // Add sql filters - if ($sqlfilters) + if ($sqlfilters) { if (! DolibarrApi::_checkFilters($sqlfilters)) { @@ -134,7 +134,7 @@ class Orders extends DolibarrApi $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; } - + $sql.= $db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) @@ -490,7 +490,7 @@ class Orders extends DolibarrApi return array( 'success' => array( 'code' => 200, - 'message' => 'Order validated' + 'message' => 'Order validated (Ref='.$this->commande->ref.')' ) ); } @@ -502,14 +502,14 @@ class Orders extends DolibarrApi * @return array Array of cleaned object properties */ function _cleanObjectDatas($object) { - + $object = parent::_cleanObjectDatas($object); - + unset($object->address); - + return $object; } - + /** * Validate fields before create or update object * diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 93df2f1aa0b..a13e626fe20 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -65,9 +65,8 @@ class Commande extends CommonOrder public $contactid; /** - * Status of the order. Check the following constants: + * Status of the order * @var int - * @see Commande::STATUS_CANCELED, Commande::STATUS_DRAFT, Commande::STATUS_ACCEPTED, Commande::STATUS_CLOSED */ public $statut; /** @@ -706,10 +705,10 @@ class Commande extends CommonOrder // Clean parameters $this->brouillon = 1; // set command as draft - + // $date_commande is deprecated $date = ($this->date_commande ? $this->date_commande : $this->date); - + // Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); @@ -776,11 +775,11 @@ class Commande extends CommonOrder $sql.= ", ".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null"); $sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null"); $sql.= ", '".$this->db->escape($this->modelpdf)."'"; - $sql.= ", ".($this->cond_reglement_id>0?"'".$this->cond_reglement_id."'":"null"); - $sql.= ", ".($this->mode_reglement_id>0?"'".$this->mode_reglement_id."'":"null"); + $sql.= ", ".($this->cond_reglement_id>0?$this->cond_reglement_id:"null"); + $sql.= ", ".($this->mode_reglement_id>0?$this->mode_reglement_id:"null"); $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); - $sql.= ", ".($this->availability_id>0?"'".$this->availability_id."'":"null"); - $sql.= ", ".($this->demand_reason_id>0?"'".$this->demand_reason_id."'":"null"); + $sql.= ", ".($this->availability_id>0?$this->availability_id:"null"); + $sql.= ", ".($this->demand_reason_id>0?$this->demand_reason_id:"null"); $sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null"); $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:'NULL'); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:'NULL'); @@ -921,7 +920,8 @@ class Commande extends CommonOrder foreach ($exp->linkedObjectsIds['commande'] as $key => $value) { $originforcontact = 'commande'; - $originidforcontact = $value->id; + if (is_object($value)) $originidforcontact = $value->id; + else $originidforcontact = $value; break; // We take first one } } @@ -1001,7 +1001,7 @@ class Commande extends CommonOrder $this->db->begin(); - // get extrafields so they will be clone + // get lines so they will be clone foreach($this->lines as $line) $line->fetch_optionals($line->rowid); @@ -1359,10 +1359,10 @@ class Commande extends CommonOrder $this->line->vat_src_code=$vat_src_code; $this->line->tva_tx=$txtva; - $this->line->localtax1_tx=$txlocaltax1; - $this->line->localtax2_tx=$txlocaltax2; - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->localtax1_tx=$localtaxes_type[1]; + $this->line->localtax2_tx=$localtaxes_type[3]; + $this->line->localtax1_type=$localtaxes_type[0]; + $this->line->localtax2_type=$localtaxes_type[2]; $this->line->fk_product=$fk_product; $this->line->product_type=$product_type; $this->line->fk_remise_except=$fk_remise_except; @@ -1411,7 +1411,7 @@ class Commande extends CommonOrder if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); // Mise a jour informations denormalisees au niveau de la commande meme - $result=$this->update_price(1,'auto'); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. + $result=$this->update_price(1,'auto',0,$mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. if ($result > 0) { $this->db->commit(); @@ -1468,7 +1468,7 @@ class Commande extends CommonOrder $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; $vat_src_code = ''; // May be defined into tva_tx - + $localtax1_tx=get_localtax($tva_tx,1,$this->thirdparty,$mysoc,$tva_npr); $localtax2_tx=get_localtax($tva_tx,2,$this->thirdparty,$mysoc,$tva_npr); @@ -1798,7 +1798,7 @@ class Commande extends CommonOrder $line->product_type = $objp->product_type; $line->qty = $objp->qty; - $line->vat_src_code = $objp->vat_src_code; + $line->vat_src_code = $objp->vat_src_code; $line->tva_tx = $objp->tva_tx; $line->localtax1_tx = $objp->localtax1_tx; $line->localtax2_tx = $objp->localtax2_tx; @@ -2234,7 +2234,7 @@ class Commande extends CommonOrder $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."commande"; - $sql.= " SET date_commande = ".($date ? $this->db->idate($date) : 'null'); + $sql.= " SET date_commande = ".($date ? "'".$this->db->idate($date)."'" : 'null'); $sql.= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; dol_syslog(__METHOD__, LOG_DEBUG); @@ -2778,9 +2778,10 @@ class Commande extends CommonOrder * @param array $array_options extrafields array * @param string $fk_unit Code of the unit to use. Null to use the default one * @param double $pu_ht_devise Amount in currency + * @param int $notrigger disable line update trigger * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null, $pu_ht_devise = 0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null, $pu_ht_devise = 0, $notrigger=0) { global $conf, $mysoc, $langs, $user; @@ -2935,7 +2936,7 @@ class Commande extends CommonOrder $this->line->array_options=$array_options; } - $result=$this->line->update($user); + $result=$this->line->update($user, $notrigger); if ($result > 0) { // Reorder if child line @@ -3106,7 +3107,7 @@ class Commande extends CommonOrder $error = 0; dol_syslog(get_class($this) . "::delete ".$this->id, LOG_DEBUG); - + $this->db->begin(); if (! $error && ! $notrigger) @@ -3243,7 +3244,8 @@ class Commande extends CommonOrder $response->nbtodo++; $generic_commande->statut = $obj->fk_statut; - $generic_commande->date_livraison = $obj->delivery_date; + $generic_commande->date_commande = $this->db->jdate($obj->date_commande); + $generic_commande->date_livraison = $this->db->jdate($obj->delivery_date); if ($generic_commande->hasDelay()) { $response->nbtodolate++; @@ -3369,24 +3371,33 @@ class Commande extends CommonOrder /** * Return clicable link of object (with eventually picto) * - * @param int $withpicto Add picto into link - * @param int $option Where point the link (0=> main card, 1,2 => shipment) - * @param int $max Max length to show - * @param int $short ??? - * @param int $notooltip 1=Disable tooltip - * @return string String with URL + * @param int $withpicto Add picto into link + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param int $max Max length to show + * @param int $short ??? + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL */ - function getNomUrl($withpicto=0,$option=0,$max=0,$short=0,$notooltip=0) + function getNomUrl($withpicto=0, $option='', $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1) { global $conf, $langs, $user; if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - + $result=''; - if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; + if (! empty($conf->expedition->enabled) && ($option == '1' || $option == '2')) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; else $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id; + if ($option !== 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } + if ($short) return $url; $picto = 'order'; @@ -3418,7 +3429,7 @@ class Commande extends CommonOrder $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.=' class="classfortooltip"'; } - + $linkstart = ''; $linkend=''; @@ -3984,18 +3995,18 @@ class OrderLine extends CommonOrderLine $sql.= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc'; $sql.= ')'; $sql.= " VALUES (".$this->fk_commande.","; - $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; + $sql.= " ".($this->fk_parent_line>0?"'".$this->db->escape($this->fk_parent_line)."'":"null").","; $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " '".$this->db->escape($this->desc)."',"; $sql.= " '".price2num($this->qty)."',"; - $sql.= " ".(empty($this->vat_src_code)?"''":"'".$this->vat_src_code."'").","; + $sql.= " ".(empty($this->vat_src_code)?"''":"'".$this->db->escape($this->vat_src_code)."'").","; $sql.= " '".price2num($this->tva_tx)."',"; $sql.= " '".price2num($this->localtax1_tx)."',"; $sql.= " '".price2num($this->localtax2_tx)."',"; - $sql.= " '".$this->localtax1_type."',"; - $sql.= " '".$this->localtax2_type."',"; + $sql.= " '".$this->db->escape($this->localtax1_type)."',"; + $sql.= " '".$this->db->escape($this->localtax2_type)."',"; $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; - $sql.= " '".$this->product_type."',"; + $sql.= " '".$this->db->escape($this->product_type)."',"; $sql.= " '".price2num($this->remise_percent)."',"; $sql.= " ".($this->subprice!=''?"'".price2num($this->subprice)."'":"null").","; $sql.= " ".($this->price!=''?"'".price2num($this->price)."'":"null").","; @@ -4005,7 +4016,7 @@ class OrderLine extends CommonOrderLine $sql.= ' '.$this->rang.','; $sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").','; $sql.= ' '.price2num($this->pa_ht).','; - $sql.= " '".$this->info_bits."',"; + $sql.= " '".$this->db->escape($this->info_bits)."',"; $sql.= " '".price2num($this->total_ht)."',"; $sql.= " '".price2num($this->total_tva)."',"; $sql.= " '".price2num($this->total_localtax1)."',"; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index fe37a630c5d..0eb4ed2cd63 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -142,16 +142,16 @@ if ($id > 0 || ! empty($ref)) if ($object->fetch($id, $ref) > 0) { $object->fetch_thirdparty(); - + $head = commande_prepare_head($object); dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order'); - + // Order card - - $linkback = '' . $langs->trans("BackToList") . ''; - - + + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -191,7 +191,7 @@ if ($id > 0 || ! empty($ref)) } } } - $morehtmlref.='
'; + $morehtmlref.=''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 8aa699fed71..205efc3ad91 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -120,11 +120,11 @@ if ($resql) print '
'; - print $objectstatic->getNomUrl(1); + print $objectstatic->getNomUrl(1, '', '', 0, 1); print '
0?'&userid='.$userid:'').'">'.$oldyear.'0
' . $langs->trans('Customer') . ''; - print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // reload page to retrieve customer informations if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) { @@ -1491,6 +1491,7 @@ if ($action == 'create' && $user->rights->commande->creer) }); '; } + print ' '.$langs->trans("AddThirdParty").''; print '
'; print ''; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","","",'valign="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder); + print_liste_field_titre("Town",$_SERVER["PHP_SELF"],"s.town","","",'valign="center"',$sortfield,$sortorder); + print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("AccountancyCode",$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder); print "\n"; // Lignes des champs de filtre @@ -146,7 +146,7 @@ if ($resql) print ''; - + print "\n"; $var=true; @@ -155,7 +155,7 @@ if ($resql) { $obj = $db->fetch_object($resql); - + print ''; print ''; } print '' . "\n"; @@ -3075,6 +3128,7 @@ else if ($id > 0 || ! empty($ref)) $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' ('.$langs->trans("OtherBills").')'; // Project if (! empty($conf->projet->enabled)) { @@ -3153,6 +3207,14 @@ else if ($id > 0 || ! empty($ref)) $facthatreplace->fetch($objectidnext); print ' (' . $langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)) . ')'; } + + if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) { + $discount = new DiscountAbsolute($db); + $result = $discount->fetch(0, $object->id); + if ($result > 0){ + print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'
'; + } + } print ''; // Relative and absolute discounts @@ -4102,11 +4164,11 @@ else if ($id > 0 || ! empty($ref)) if ($objectidnext) { print '
' . $langs->trans('DoPayment') . '
'; } else { - if ($resteapayer == 0) { - print '
' . $langs->trans('DoPayment') . '
'; - } else { + //if ($resteapayer == 0) { + // print '
' . $langs->trans('DoPayment') . '
'; + //} else { print ''; - } + //} } } @@ -4185,7 +4247,7 @@ else if ($id > 0 || ! empty($ref)) { if (! $objectidnext && count($object->lines) > 0) { - print ''; + print ''; } } @@ -4231,7 +4293,7 @@ else if ($id > 0 || ! empty($ref)) print '
'; // Select mail models is same action as presend - if (GETPOST('modelselected')) { + if (GETPOST('modelselected','alpha')) { $action = 'presend'; } if ($action != 'prerelance' && $action != 'presend') @@ -4253,16 +4315,15 @@ else if ($id > 0 || ! empty($ref)) $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - // Link for paypal payment - if (! empty($conf->paypal->enabled) && $object->statut != 0) { - include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php'; - print showPaypalPaymentUrl('invoice', $object->ref); - } - // Link for stripe payment - if (! empty($conf->stripe->enabled) && $object->statut != 0) { - include_once DOL_DOCUMENT_ROOT . '/stripe/lib/stripe.lib.php'; - print showStripePaymentUrl('invoice', $object->ref); + // Show online payment link + $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); + + if ($object->statut != 0 && $useonlinepayment) + { + print '
'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + print showOnlinePaymentUrl('invoice', $object->ref); } print '
'; @@ -4270,7 +4331,7 @@ else if ($id > 0 || ! empty($ref)) // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'invoice', $socid); + $somethingshown = $formactions->showactions($object, 'invoice', $socid, 1); print '
'; } @@ -4318,7 +4379,7 @@ else if ($id > 0 || ! empty($ref)) // Build document if it not exists if (! $file || ! is_readable($file)) { - $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + $result = $object->generateDocument(GETPOST('model','alpha') ? GETPOST('model','alpha') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { dol_print_error($db, $object->error, $object->errors); exit(); @@ -4338,7 +4399,7 @@ else if ($id > 0 || ! empty($ref)) include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); - $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); + $formmail->fromtype = (GETPOST('fromtype','alpha')?GETPOST('fromtype','alpha'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); if($formmail->fromtype === 'user'){ $formmail->fromid = $user->id; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 55304136ed6..f841fc80050 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -22,14 +22,14 @@ /** * API class for invoices * - * @access protected + * @access protected * @class DolibarrApiAccess {@requires user,external} */ class Invoices extends DolibarrApi { /** * - * @var array $FIELDS Mandatory fields, checked when create and update object + * @var array $FIELDS Mandatory fields, checked when create and update object */ static $FIELDS = array( 'socid' @@ -54,23 +54,23 @@ class Invoices extends DolibarrApi * Get properties of a invoice object * * Return an array with invoice informations - * + * * @param int $id ID of invoice * @return array|mixed data without useless information * * @throws RestException */ function get($id) - { + { if(! DolibarrApiAccess::$user->rights->facture->lire) { throw new RestException(401); } - + $result = $this->invoice->fetch($id); if( ! $result ) { throw new RestException(404, 'Invoice not found'); } - + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -80,9 +80,9 @@ class Invoices extends DolibarrApi /** * List invoices - * + * * Get a list of invoices - * + * * @param string $sortfield Sort field * @param string $sortorder Sort order * @param int $limit Limit for list @@ -96,12 +96,12 @@ class Invoices extends DolibarrApi */ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') { global $db, $conf; - + $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; - + // If the internal user must only see his customers, force searching by him $search_sale = 0; if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id; @@ -109,7 +109,7 @@ class Invoices extends DolibarrApi $sql = "SELECT t.rowid"; if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) $sql.= " FROM ".MAIN_DB_PREFIX."facture as t"; - + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql.= ' WHERE t.entity IN ('.getEntity('facture').')'; @@ -117,7 +117,7 @@ class Invoices extends DolibarrApi if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale - + // Filter by status if ($status == 'draft') $sql.= " AND t.fk_statut IN (0)"; if ($status == 'unpaid') $sql.= " AND t.fk_statut IN (1)"; @@ -129,7 +129,7 @@ class Invoices extends DolibarrApi $sql .= " AND sc.fk_user = ".$search_sale; } // Add sql filters - if ($sqlfilters) + if ($sqlfilters) { if (! DolibarrApi::_checkFilters($sqlfilters)) { @@ -138,7 +138,7 @@ class Invoices extends DolibarrApi $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; } - + $sql.= $db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) @@ -174,10 +174,10 @@ class Invoices extends DolibarrApi } return $obj_ret; } - + /** * Create invoice object - * + * * @param array $request_data Request datas * @return int ID of invoice */ @@ -188,7 +188,7 @@ class Invoices extends DolibarrApi } // Check mandatory fields $result = $this->_validate($request_data); - + foreach($request_data as $field => $value) { $this->invoice->$field = $value; } @@ -203,7 +203,7 @@ class Invoices extends DolibarrApi } $this->invoice->lines = $lines; }*/ - + if ($this->invoice->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, "Error creating invoice", array_merge(array($this->invoice->error), $this->invoice->errors)); } @@ -214,20 +214,20 @@ class Invoices extends DolibarrApi * Update invoice * * @param int $id Id of invoice to update - * @param array $request_data Datas - * @return int + * @param array $request_data Datas + * @return int */ function put($id, $request_data = NULL) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); } - + $result = $this->invoice->fetch($id); if( ! $result ) { throw new RestException(404, 'Invoice not found'); } - + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -236,13 +236,13 @@ class Invoices extends DolibarrApi if ($field == 'id') continue; $this->invoice->$field = $value; } - + if($this->invoice->update($id, DolibarrApiAccess::$user)) return $this->get ($id); - + return false; } - + /** * Delete invoice * @@ -258,16 +258,16 @@ class Invoices extends DolibarrApi if( ! $result ) { throw new RestException(404, 'Invoice not found'); } - + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + if( $this->invoice->delete($id) < 0) { throw new RestException(500); } - + return array( 'success' => array( 'code' => 200, @@ -275,13 +275,76 @@ class Invoices extends DolibarrApi ) ); } - + + /** + * Validate an order + * + * @param int $id Order ID + * @param int $idwarehouse Warehouse ID + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * + * @url POST {id}/validate + * + * @return array + * FIXME An error 403 is returned if the request has an empty body. + * Error message: "Forbidden: Content type `text/plain` is not supported." + * Workaround: send this in the body + * { + * "idwarehouse": 0, + * "notrigger": 0 + * } + */ + function validate($id, $idwarehouse=0, $notrigger=0) + { + if(! DolibarrApiAccess::$user->rights->facture->creer) { + throw new RestException(401); + } + $result = $this->invoice->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Invoice not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger); + if ($result == 0) { + throw new RestException(500, 'Error nothing done. May be object is already validated'); + } + if ($result < 0) { + throw new RestException(500, 'Error when validating Invoice: '.$this->invoice->error); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Invoice validated (Ref='.$this->invoice->ref.')' + ) + ); + } + + /** + * Clean sensible object datas + * + * @param object $object Object to clean + * @return array Array of cleaned object properties + */ + function _cleanObjectDatas($object) { + + $object = parent::_cleanObjectDatas($object); + + unset($object->address); + + return $object; + } + /** * Validate fields before create or update object - * + * * @param array|null $data Datas to validate * @return array - * + * * @throws RestException */ function _validate($data) @@ -294,5 +357,5 @@ class Invoices extends DolibarrApi } return $invoice; } - + } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 6bc88e47490..b12f848323d 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** - * Classe de gestion des factures recurrentes/Modeles + * Class to manage invoice templates */ class FactureRec extends CommonInvoice { @@ -43,7 +43,7 @@ class FactureRec extends CommonInvoice public $table_element_line='facturedet_rec'; public $fk_element='fk_facture'; public $picto='bill'; - + var $entity; var $number; var $date; @@ -58,7 +58,10 @@ class FactureRec extends CommonInvoice var $date_when; var $nb_gen_done; var $nb_gen_max; - + + var $frequency; + var $unit_frequency; + var $rang; var $special_code; @@ -91,20 +94,20 @@ class FactureRec extends CommonInvoice // Clean parameters $this->titre=trim($this->titre); $this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice; - + // No frequency defined then no next date to execution - if (empty($this->frequency)) + if (empty($this->frequency)) { $this->frequency=0; $this->date_when=NULL; } - - + + $this->frequency=abs($this->frequency); $this->nb_gen_done=0; $this->nb_gen_max=empty($this->nb_gen_max)?0:$this->nb_gen_max; $this->auto_validate=empty($this->auto_validate)?0:$this->auto_validate; - + $this->db->begin(); // Charge facture modele @@ -138,7 +141,7 @@ class FactureRec extends CommonInvoice $sql.= ", nb_gen_max"; $sql.= ", auto_validate"; $sql.= ") VALUES ("; - $sql.= "'".$this->titre."'"; + $sql.= "'".$this->db->escape($this->titre)."'"; $sql.= ", ".$facsrc->socid; $sql.= ", ".$conf->entity; $sql.= ", '".$this->db->idate($now)."'"; @@ -146,11 +149,11 @@ class FactureRec extends CommonInvoice $sql.= ", ".(!empty($facsrc->remise)?$this->remise:'0'); $sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL"); $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); - $sql.= ", '".$user->id."'"; + $sql.= ", '".$this->db->escape($user->id)."'"; $sql.= ", ".(! empty($facsrc->fk_project)?"'".$facsrc->fk_project."'":"null"); $sql.= ", ".(! empty($facsrc->fk_account)?"'".$facsrc->fk_account."'":"null"); - $sql.= ", '".$facsrc->cond_reglement_id."'"; - $sql.= ", '".$facsrc->mode_reglement_id."'"; + $sql.= ", '".$this->db->escape($facsrc->cond_reglement_id)."'"; + $sql.= ", '".$this->db->escape($facsrc->mode_reglement_id)."'"; $sql.= ", ".$this->usenewprice; $sql.= ", ".$this->frequency; $sql.= ", '".$this->db->escape($this->unit_frequency)."'"; @@ -197,7 +200,7 @@ class FactureRec extends CommonInvoice $error++; } } - + // Add object linked if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) { @@ -210,7 +213,7 @@ class FactureRec extends CommonInvoice $error++; } } - } + } if ($error) { @@ -248,7 +251,7 @@ class FactureRec extends CommonInvoice */ function fetch($rowid, $ref='', $ref_ext='', $ref_int='') { - $sql = 'SELECT f.rowid, f.entity, f.titre, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; + $sql = 'SELECT f.rowid, f.entity, f.titre, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; $sql.= ', f.date_lim_reglement as dlr'; $sql.= ', f.note_private, f.note_public, f.fk_user_author'; @@ -268,7 +271,7 @@ class FactureRec extends CommonInvoice if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; */ - + $result = $this->db->query($sql); if ($result) { @@ -281,6 +284,7 @@ class FactureRec extends CommonInvoice $this->titre = $obj->titre; $this->ref = $obj->titre; $this->ref_client = $obj->ref_client; + $this->suspended = $obj->suspended; $this->type = $obj->type; $this->datep = $obj->dp; $this->date = $obj->df; @@ -297,7 +301,6 @@ class FactureRec extends CommonInvoice $this->close_code = $obj->close_code; $this->close_note = $obj->close_note; $this->socid = $obj->fk_soc; - $this->statut = $obj->fk_statut; $this->date_lim_reglement = $this->db->jdate($obj->dlr); $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; @@ -326,6 +329,14 @@ class FactureRec extends CommonInvoice if ($this->statut == self::STATUS_DRAFT) $this->brouillon = 1; + + // Retreive all extrafield for thirdparty + // fetch optionals attributes and labels + require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + $extrafields=new ExtraFields($this->db); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); + $this->fetch_optionals($this->id,$extralabels); + /* * Lines */ @@ -361,8 +372,8 @@ class FactureRec extends CommonInvoice { return $this->fetch_lines(); } - - + + /** * Recupere les lignes de factures predefinies dans this->lines * @@ -386,7 +397,7 @@ class FactureRec extends CommonInvoice $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; $sql.= ' WHERE l.fk_facture = '.$this->id; $sql.= ' ORDER BY l.rang'; - + dol_syslog('FactureRec::fetch_lines', LOG_DEBUG); $result = $this->db->query($sql); if ($result) @@ -396,7 +407,7 @@ class FactureRec extends CommonInvoice while ($i < $num) { $objp = $this->db->fetch_object($result); - $line = new FactureLigne($this->db); + $line = new FactureLigneRec($this->db); $line->id = $objp->rowid; $line->rowid = $objp->rowid; @@ -431,11 +442,20 @@ class FactureRec extends CommonInvoice $line->special_code = $objp->special_code; $line->fk_unit = $objp->fk_unit; $line->fk_contract_line = $objp->fk_contract_line; - + // Ne plus utiliser $line->price = $objp->price; $line->remise = $objp->remise; + + // Retreive all extrafield for thirdparty + // fetch optionals attributes and labels + require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + $extrafieldsline=new ExtraFields($line->db); + $extrafieldsline=$extrafieldsline->fetch_name_optionals_label($line->table_element,true); + $extralabelsline = $line->fetch_optionals($line->id,$extrafieldsline); + + $this->lines[$i] = $line; $i++; @@ -460,22 +480,28 @@ class FactureRec extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - function delete($user, $notrigger=0, $idwarehouse=-1) + function delete(User $user, $notrigger=0, $idwarehouse=-1) { $rowid=$this->id; - + dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); - + $error=0; $this->db->begin(); - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid; dol_syslog($sql); if ($this->db->query($sql)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_rec WHERE rowid = ".$rowid; dol_syslog($sql); - if (! $this->db->query($sql)) + if ($this->db->query($sql)) + { + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) $error=-3; + } + else { $this->error=$this->db->lasterror(); $error=-1; @@ -486,7 +512,7 @@ class FactureRec extends CommonInvoice $this->error=$this->db->lasterror(); $error=-2; } - + if (! $error) { $this->db->commit(); @@ -525,7 +551,7 @@ class FactureRec extends CommonInvoice function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null) { global $mysoc; - + $facid=$this->id; dol_syslog(get_class($this)."::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG); @@ -551,11 +577,14 @@ class FactureRec extends CommonInvoice if (empty($remise_percent)) $remise_percent=0; $qty=price2num($qty); if (! $info_bits) $info_bits=0; - $pu_ht=price2num($pu_ht); - $pu_ttc=price2num($pu_ttc); - $txtva=price2num($txtva); - $txlocaltax1 = price2num($txlocaltax1); - $txlocaltax2 = price2num($txlocaltax2); + $pu_ht = price2num($pu_ht); + $pu_ttc = price2num($pu_ttc); + $txtva = price2num($txtva); + $txlocaltax1 = price2num($txlocaltax1); + $txlocaltax2 = price2num($txlocaltax2); + if (empty($txtva)) $txtva=0; + if (empty($txlocaltax1)) $txlocaltax1=0; + if (empty($txlocaltax2)) $txlocaltax2=0; if ($price_base_type=='HT') { @@ -578,7 +607,7 @@ class FactureRec extends CommonInvoice $total_ttc = $tabprice[2]; $total_localtax1=$tabprice[9]; $total_localtax2=$tabprice[10]; - + $product_type=$type; if ($fk_product) { @@ -641,9 +670,10 @@ class FactureRec extends CommonInvoice dol_syslog(get_class($this)."::addline", LOG_DEBUG); if ($this->db->query($sql)) { + $lineId = $this->db->last_insert_id(MAIN_DB_PREFIX."facturedet_rec"); $this->id=$facid; $this->update_price(); - return 1; + return $lineId; } else { @@ -679,12 +709,12 @@ class FactureRec extends CommonInvoice function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null) { global $mysoc; - + $facid=$this->id; - + dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - + // Check parameters if ($type < 0) return -1; @@ -709,7 +739,7 @@ class FactureRec extends CommonInvoice $txtva=price2num($txtva); $txlocaltax1 = price2num($txlocaltax1); $txlocaltax2 = price2num($txlocaltax2); - + if ($price_base_type=='HT') { $pu=$pu_ht; @@ -718,7 +748,7 @@ class FactureRec extends CommonInvoice { $pu=$pu_ttc; } - + // Calcul du total TTC et de la TVA pour la ligne a partir de // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker @@ -730,7 +760,7 @@ class FactureRec extends CommonInvoice $total_ttc = $tabprice[2]; $total_localtax1=$tabprice[9]; $total_localtax2=$tabprice[10]; - + $product_type=$type; if ($fk_product) { @@ -738,7 +768,7 @@ class FactureRec extends CommonInvoice $result=$product->fetch($fk_product); $product_type=$product->type; } - + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET "; $sql.= "fk_facture = '".$facid."'"; $sql.= ", label=".(! empty($label)?"'".$this->db->escape($label)."'":"null"); @@ -778,12 +808,12 @@ class FactureRec extends CommonInvoice return -1; } } - } - - + } + + /** - * Return the next date of - * + * Return the next date of + * * @return timestamp false if KO, timestamp if OK */ function getNextDate() @@ -791,27 +821,27 @@ class FactureRec extends CommonInvoice if (empty($this->date_when)) return false; return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency); } - + /** * Create all recurrents invoices (for all entities if multicompany is used). * A result may also be provided into this->output. - * - * WARNING: This method change context $conf->entity to be in correct context for each recurring invoice found. - * - * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) + * + * WARNING: This method change context $conf->entity to be in correct context for each recurring invoice found. + * + * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ function createRecurringInvoices() { global $conf, $langs, $db, $user; - + $langs->load("bills"); - + $nb_create=0; - + $now = dol_now(); $tmparray=dol_getdate($now); $today = dol_mktime(23,59,59,$tmparray['mon'],$tmparray['mday'],$tmparray['year']); // Today is last second of current day - + dol_syslog("createRecurringInvoices"); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_rec'; $sql.= ' WHERE frequency > 0'; // A recurring invoice is an invoice with a frequency @@ -819,30 +849,30 @@ class FactureRec extends CommonInvoice $sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)'; $sql.= $db->order('entity', 'ASC'); //print $sql;exit; - + $resql = $db->query($sql); if ($resql) { $i=0; $num = $db->num_rows($resql); - + if ($num) $this->output.=$langs->trans("FoundXQualifiedRecurringInvoiceTemplate", $num)."\n"; else $this->output.=$langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); - + $saventity = $conf->entity; - + while ($i < $num) // Loop on each template invoice { $line = $db->fetch_object($resql); $db->begin(); - + $facturerec = new FactureRec($db); $facturerec->fetch($line->rowid); - + // Set entity context $conf->entity = $facturerec->entity; - + dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity); $error=0; @@ -850,12 +880,13 @@ class FactureRec extends CommonInvoice $facture = new Facture($db); $facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice $facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice - + $facture->type = self::TYPE_STANDARD; $facture->brouillon = 1; $facture->date = $facturerec->date_when; // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; - + $facture->suspended = 0; + $invoiceidgenerated = $facture->create($user); if ($invoiceidgenerated <= 0) { @@ -888,16 +919,16 @@ class FactureRec extends CommonInvoice $i++; } - + $conf->entity = $saventity; // Restore entity context } else dol_print_error($db); - + $this->output=trim($this->output); - + return $error?$error:0; } - + /** * Return clicable name (with picto eventually) * @@ -914,13 +945,13 @@ class FactureRec extends CommonInvoice $result=''; $label=$langs->trans("ShowInvoice").': '.$this->ref; - + $url = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id; - + if ($short) return $url; - + $picto='bill'; - + $link = ''; $linkend=''; @@ -932,6 +963,95 @@ class FactureRec extends CommonInvoice return $result; } + /** + * Return label of object status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @param integer $alreadypaid Not used + * @return string Label + */ + function getLibStatut($mode=0,$alreadypaid=-1) + { + return $this->LibStatut($this->frequency?1:0, $this->suspended, $mode, $alreadypaid, $this->type); + } + + /** + * Renvoi le libelle d'un statut donne + * + * @param int $recur Is it a recurring invoice ? + * @param int $status Id status (suspended or not) + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=long label + picto + * @param int $alreadypaid Not used + * @param int $type Type invoice + * @return string Libelle du statut + */ + function LibStatut($recur,$status,$mode=0,$alreadypaid=-1,$type=0) + { + global $langs; + $langs->load('bills'); + + //print "$recur,$status,$mode,$alreadypaid,$type"; + if ($mode == 0) + { + $prefix=''; + if ($recur) + { + if ($status == 1) return $langs->trans('Suspended'); // credit note + else return $langs->trans('Active'); + } + else return $langs->trans("Draft"); + } + if ($mode == 1) + { + $prefix='Short'; + if ($recur) + { + if ($status == 1) return $langs->trans('Suspended'); + else return $langs->trans('Active'); + } + else return $langs->trans("Draft"); + } + if ($mode == 2) + { + if ($recur) + { + if ($status == 1) return img_picto($langs->trans('Suspended'),'statut6').' '.$langs->trans('Suspended'); + else return img_picto($langs->trans('Active'),'statut4').' '.$langs->trans('Active'); + } + else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); + } + if ($mode == 3) + { + if ($recur) + { + $prefix='Short'; + if ($status == 1) return img_picto($langs->trans('Suspended'),'statut6'); + else return img_picto($langs->trans('Active'),'statut4'); + } + else return img_picto($langs->trans('Draft'),'statut0'); + } + if ($mode == 4) + { + $prefix=''; + if ($recur) + { + if ($type == 1) return img_picto($langs->trans('Suspended'),'statut6').' '.$langs->trans('Suspended'); + else return img_picto($langs->trans('Active'),'statut4').' '.$langs->trans('Active'); + } + else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); + } + if ($mode == 5 || $mode == 6) + { + $prefix=''; + if ($mode == 5) $prefix='Short'; + if ($recur) + { + if ($status == 1) return ''.$langs->trans('Suspended').' '.img_picto($langs->trans('Suspended'),'statut6'); + else return ''.$langs->trans('Active').' '.img_picto($langs->trans('Active'),'statut4'); + } + else return $langs->trans('Draft').' '.img_picto($langs->trans('Active'),'statut0'); + } + } /** * Initialise an instance with random values. @@ -952,7 +1072,7 @@ class FactureRec extends CommonInvoice // Load array of products prodids $num_prods = 0; $prodids = array(); - + $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= " WHERE entity IN (".getEntity('product').")"; @@ -1065,7 +1185,7 @@ class FactureRec extends CommonInvoice $this->lines[$xnbp]=$line; $xnbp++; } - + $this->usenewprice = 1; } @@ -1085,7 +1205,7 @@ class FactureRec extends CommonInvoice return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } - + /** * Update frequency and unit * @@ -1109,12 +1229,12 @@ class FactureRec extends CommonInvoice $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET frequency = '.($frequency?$this->db->escape($frequency):'null'); - if (!empty($unit)) + if (!empty($unit)) { $sql.= ', unit_frequency = \''.$this->db->escape($unit).'\''; } $sql.= ' WHERE rowid = '.$this->id; - + dol_syslog(get_class($this)."::setFrequencyAndUnit", LOG_DEBUG); if ($this->db->query($sql)) { @@ -1128,7 +1248,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the next date of execution * @@ -1161,7 +1281,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the maximum period * @@ -1175,9 +1295,9 @@ class FactureRec extends CommonInvoice dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined",LOG_ERR); return -1; } - + if (empty($nb)) $nb=0; - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET nb_gen_max = '.$nb; $sql.= ' WHERE rowid = '.$this->id; @@ -1194,7 +1314,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the auto validate invoice * @@ -1208,7 +1328,7 @@ class FactureRec extends CommonInvoice dol_syslog(get_class($this)."::setAutoValidate was called on objet with property table_element not defined",LOG_ERR); return -1; } - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET auto_validate = '.$validate; $sql.= ' WHERE rowid = '.$this->id; @@ -1235,43 +1355,205 @@ class FactureRec extends CommonInvoice */ class FactureLigneRec extends CommonInvoiceLine { - + public $element='facturedetrec'; + public $table_element='facturedet_rec'; + /** * Delete line in database * - * @return int <0 if KO, >0 if OK + * @param User $user Object user + * @param int $notrigger Disable triggers + * @return int <0 if KO, >0 if OK */ - function delete() + function delete(User $user, $notrigger = false) { - global $conf,$langs,$user; - - $error=0; - - $this->db->begin(); - - // Call trigger - /*$result=$this->call_trigger('LINEBILLREC_DELETE',$user); - if ($result < 0) - { - $this->db->rollback(); - return -1; - }*/ - // End call triggers - - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id); - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if ($this->db->query($sql) ) - { - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -1; - } + $error=0; + + $this->db->begin(); + + if (! $error) { + if (! $notrigger) { + // Call triggers + $result=$this->call_trigger('LINEBILLREC_DELETE', $user); + if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail + // End call triggers + } + } + + if (! $error) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id; + + $res = $this->db->query($sql); + if($res===false) { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + + // Commit or rollback + if ($error) { + $this->db->rollback(); + return -1; + } else { + $this->db->commit(); + return 1; + } } - + + + /** + * Recupere les lignes de factures predefinies dans this->lines + * + * @param int $rowid Id of invoice + * @return int 1 if OK, < 0 if KO + */ + function fetch($rowid) + { + $sql = 'SELECT l.rowid, l.fk_facture ,l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,'; + $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,'; + $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_ttc,'; + $sql.= ' l.rang, l.special_code,'; + $sql.= ' l.fk_unit, l.fk_contract_line,'; + $sql.= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet_rec as l'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; + $sql.= ' WHERE l.rowid = '.$rowid; + $sql.= ' ORDER BY l.rang'; + + dol_syslog('FactureRec::fetch', LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + + $objp = $this->db->fetch_object($result); + + $this->id = $objp->rowid; + $this->label = $objp->custom_label; // Label line + $this->desc = $objp->description; // Description line + $this->description = $objp->description; // Description line + $this->product_type = $objp->product_type; // Type of line + $this->ref = $objp->product_ref; // Ref product + $this->product_ref = $objp->product_ref; // Ref product + $this->libelle = $objp->product_label; // deprecated + $this->product_label = $objp->product_label; // Label product + $this->product_desc = $objp->product_desc; // Description product + $this->fk_product_type = $objp->fk_product_type; // Type of product + $this->qty = $objp->qty; + $this->price = $objp->price; + $this->subprice = $objp->subprice; + $this->fk_facture = $objp->fk_facture; + $this->vat_src_code = $objp->vat_src_code; + $this->tva_tx = $objp->tva_tx; + $this->localtax1_tx = $objp->localtax1_tx; + $this->localtax2_tx = $objp->localtax2_tx; + $this->localtax1_type = $objp->localtax1_type; + $this->localtax2_type = $objp->localtax2_type; + $this->remise_percent = $objp->remise_percent; + $this->fk_remise_except = $objp->fk_remise_except; + $this->fk_product = $objp->fk_product; + $this->info_bits = $objp->info_bits; + $this->total_ht = $objp->total_ht; + $this->total_tva = $objp->total_tva; + $this->total_ttc = $objp->total_ttc; + $this->code_ventilation = $objp->fk_code_ventilation; + $this->rang = $objp->rang; + $this->special_code = $objp->special_code; + $this->fk_unit = $objp->fk_unit; + $this->fk_contract_line = $objp->fk_contract_line; + + + $this->db->free($result); + return 1; + } + else + { + $this->error=$this->db->lasterror(); + return -3; + } + } + + + /** + * Update a line to invoice_rec. + * + * @return int <0 if KO, Id of line if OK + */ + function update() + { + global $user; + + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + + if ($fk_product) + { + $product=new Product($this->db); + $result=$product->fetch($fk_product); + $product_type=$product->type; + } + + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET "; + $sql.= " fk_facture = ".$this->fk_facture; + $sql.= ", label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); + $sql.= ", description='".$this->db->escape($this->desc)."'"; + $sql.= ", price=".price2num($this->price); + $sql.= ", qty=".price2num($this->qty); + $sql.= ", tva_tx=".price2num($this->tva_tx); + $sql.= ", vat_src_code='".$this->db->escape($this->vat_src_code)."'"; + $sql.= ", localtax1_tx=".price2num($this->localtax1_tx); + $sql.= ", localtax1_type='".$this->db->escape($this->localtax1_type)."'"; + $sql.= ", localtax2_tx=".price2num($this->localtax2_tx); + $sql.= ", localtax2_type='".$this->db->escape($this->localtax2_type)."'"; + $sql.= ", fk_product=".($this->fk_product > 0 ? $this->fk_product :"null"); + $sql.= ", product_type=".$this->product_type; + $sql.= ", remise_percent='".price2num($this->remise_percent)."'"; + $sql.= ", subprice='".price2num($this->subprice)."'"; + $sql.= ", total_ht='".price2num($this->total_ht)."'"; + $sql.= ", total_tva='".price2num($this->total_tva)."'"; + $sql.= ", total_localtax1='".price2num($this->total_localtax1)."'"; + $sql.= ", total_localtax2='".price2num($this->total_localtax2)."'"; + $sql.= ", total_ttc='".price2num($this->total_ttc)."'"; + $sql.= ", rang=".$this->rang; + $sql.= ", special_code=".$this->special_code; + $sql.= ", fk_unit=".($this->fk_unit ?"'".$this->db->escape($this->fk_unit )."'":"null"); + $sql.= ", fk_contract_line=".($this->fk_contract_line?$this->fk_contract_line:"null"); + + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::updateline", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('LINEBILL_REC_UPDATE',$user); + if ($result < 0) + { + $this->db->rollback(); + return -2; + } + // End call triggers + } + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -2; + } + + } + } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ce441ee213e..ef1ca35bde3 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -286,6 +286,8 @@ class Facture extends CommonInvoice $result=$_facrec->fetch($this->fac_rec); $result=$_facrec->fetchObjectLinked(); // This load $_facrec->linkedObjectsIds + $originaldatewhen = $_facrec->date_when; + $this->socid = $_facrec->socid; // Invoice created on same thirdparty than template $this->entity = $_facrec->entity; // Invoice created in same entity than template @@ -315,6 +317,8 @@ class Facture extends CommonInvoice $this->note_private=trim($this->note_private); $this->note_private=dol_concatdesc($this->note_private, $langs->trans("GeneratedFromRecurringInvoice", $_facrec->ref)); + $this->array_options=$_facrec->array_options; + //if (! $this->remise) $this->remise = 0; if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; $this->brouillon = 1; @@ -359,8 +363,13 @@ class Facture extends CommonInvoice '__INVOICE_PREVIOUS_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, -1, 'y'), '%Y'), '__INVOICE_YEAR__' => dol_print_date($this->date, '%Y'), '__INVOICE_NEXT_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y'), + // Only for tempalte invoice + '__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => dol_print_date($originaldatewhen, 'dayhour'), + '__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => dol_print_date(dol_time_plus_duree($originaldatewhen, $_facrec->frequency, $_facrec->unit_frequency), 'dayhour') ); + //var_dump($substitutionarray);exit; + $substitutionisok=true; complete_substitutions_array($substitutionarray, $outputlangs); @@ -430,7 +439,6 @@ class Facture extends CommonInvoice $sql.= ", ".(double) $this->multicurrency_tx; $sql.=")"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -440,7 +448,6 @@ class Facture extends CommonInvoice $this->ref='(PROV'.$this->id.')'; $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $error++; @@ -489,7 +496,8 @@ class Facture extends CommonInvoice foreach ($exp->linkedObjectsIds['commande'] as $key => $value) { $originforcontact = 'commande'; - $originidforcontact = $value->id; + if (is_object($value)) $originidforcontact = $value->id; + else $originidforcontact = $value; break; // We take first one } } @@ -654,7 +662,7 @@ class Facture extends CommonInvoice null, 0, $_facrec->lines[$i]->label, - null, + empty($_facrec->lines[$i]->array_options)?null:$_facrec->lines[$i]->array_options, $_facrec->lines[$i]->situation_percent, '', $_facrec->lines[$i]->fk_unit @@ -749,6 +757,15 @@ class Facture extends CommonInvoice // Charge facture source $facture=new Facture($this->db); + $this->fetch_optionals(); + if(!empty($this->array_options)){ + $facture->array_options = $this->array_options; + } + + foreach($this->lines as &$line){ + $line->fetch_optionals();//fetch extrafields + } + $facture->fk_facture_source = $this->fk_facture_source; $facture->type = $this->type; $facture->socid = $this->socid; @@ -774,7 +791,7 @@ class Facture extends CommonInvoice $facture->situation_final = $this->situation_final; // Loop on each line of new invoice - foreach($facture->lines as $i => $line) + foreach($facture->lines as $i => $tmpline) { $facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid; if ($invertdetail) @@ -2044,7 +2061,12 @@ class Facture extends CommonInvoice dol_syslog(get_class($this)."::validate no draft status", LOG_WARNING); return 0; } - + if (count($this->lines) <= 0) + { + $langs->load("errors"); + $this->error=$langs->trans("ErrorObjectMustHaveLinesToBeValidated", $this->ref); + return -1; + } if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->facture->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->facture->invoice_advance->validate))) { @@ -2652,9 +2674,10 @@ class Facture extends CommonInvoice * @param int $situation_percent Situation advance percentage * @param string $fk_unit Code of the unit to use. Null to use the default one * @param double $pu_ht_devise Unit price in currency + * @param int $notrigger disable line update trigger * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=100, $fk_unit = null, $pu_ht_devise = 0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=100, $fk_unit = null, $pu_ht_devise = 0, $notrigger=0) { global $conf,$user; // Deprecation warning @@ -2812,7 +2835,7 @@ class Facture extends CommonInvoice $this->line->array_options=$array_options; } - $result=$this->line->update($user); + $result=$this->line->update($user, $notrigger); if ($result > 0) { // Reorder if child line @@ -3819,6 +3842,9 @@ class Facture extends CommonInvoice $line->total_ht=-100; $line->total_ttc=-119.6; $line->total_tva=-19.6; + $line->multicurrency_total_ht=-200; + $line->multicurrency_total_ttc=-239.2; + $line->multicurrency_total_tva=-39.2; } else if ($xnbp == 2) // UP is negative (free line) { @@ -3827,6 +3853,9 @@ class Facture extends CommonInvoice $line->total_ttc=-119.6; $line->total_tva=-19.6; $line->remise_percent=0; + $line->multicurrency_total_ht=-200; + $line->multicurrency_total_ttc=-239.2; + $line->multicurrency_total_tva=-39.2; } else if ($xnbp == 3) // Discount is 50% (product line) { @@ -3835,6 +3864,9 @@ class Facture extends CommonInvoice $line->total_ht=50; $line->total_ttc=59.8; $line->total_tva=9.8; + $line->multicurrency_total_ht=100; + $line->multicurrency_total_ttc=119.6; + $line->multicurrency_total_tva=19.6; $line->remise_percent=50; } else // (product line) @@ -3844,15 +3876,24 @@ class Facture extends CommonInvoice $line->total_ht=100; $line->total_ttc=119.6; $line->total_tva=19.6; - $line->remise_percent=00; + $line->multicurrency_total_ht=200; + $line->multicurrency_total_ttc=239.2; + $line->multicurrency_total_tva=39.2; + $line->remise_percent=0; } $this->lines[$xnbp]=$line; - $xnbp++; + $this->total_ht += $line->total_ht; $this->total_tva += $line->total_tva; $this->total_ttc += $line->total_ttc; + + $this->multicurrency_total_ht += $line->multicurrency_total_ht; + $this->multicurrency_total_tva += $line->multicurrency_total_tva; + $this->multicurrency_total_ttc += $line->multicurrency_total_ttc; + + $xnbp++; } $this->revenuestamp = 0; @@ -3868,6 +3909,9 @@ class Facture extends CommonInvoice $line->total_ht=0; $line->total_ttc=0; // 90 * 1.196 $line->total_tva=0; + $line->multicurrency_total_ht=0; + $line->multicurrency_total_ttc=0; + $line->multicurrency_total_tva=0; $prodid = mt_rand(1, $num_prods); $line->fk_product=$prodids[$prodid]; @@ -4402,16 +4446,16 @@ class FactureLigne extends CommonInvoiceLine $sql.= ' fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc'; $sql.= ')'; $sql.= " VALUES (".$this->fk_facture.","; - $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; + $sql.= " ".($this->fk_parent_line>0 ? $this->fk_parent_line:"null").","; $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " '".$this->db->escape($this->desc)."',"; $sql.= " ".price2num($this->qty).","; - $sql.= " ".(empty($this->vat_src_code)?"''":"'".$this->vat_src_code."'").","; + $sql.= " ".(empty($this->vat_src_code)?"''":"'".$this->db->escape($this->vat_src_code)."'").","; $sql.= " ".price2num($this->tva_tx).","; $sql.= " ".price2num($this->localtax1_tx).","; $sql.= " ".price2num($this->localtax2_tx).","; - $sql.= " '".$this->localtax1_type."',"; - $sql.= " '".$this->localtax2_type."',"; + $sql.= " '".$this->db->escape($this->localtax1_type)."',"; + $sql.= " '".$this->db->escape($this->localtax2_type)."',"; $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; $sql.= " ".$this->product_type.","; $sql.= " ".price2num($this->remise_percent).","; @@ -4424,7 +4468,7 @@ class FactureLigne extends CommonInvoiceLine $sql.= ' '.$this->special_code.','; $sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").','; $sql.= ' '.price2num($this->pa_ht).','; - $sql.= " '".$this->info_bits."',"; + $sql.= " '".$this->db->escape($this->info_bits)."',"; $sql.= " ".price2num($this->total_ht).","; $sql.= " ".price2num($this->total_tva).","; $sql.= " ".price2num($this->total_ttc).","; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 2899e3fae56..a34705c8476 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -85,13 +85,11 @@ class PaymentTerm // extends CommonObject if (isset($this->decalage)) $this->decalage=trim($this->decalage); - // Check parameters // Put here code to add control on parameters values // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_payment_term("; - $sql.= "rowid,"; $sql.= "code,"; $sql.= "sortorder,"; @@ -101,21 +99,16 @@ class PaymentTerm // extends CommonObject $sql.= "type_cdr,"; $sql.= "nbjour,"; $sql.= "decalage"; - - $sql.= ") VALUES ("; - - $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->rowid."'").","; + $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->db->escape($this->rowid)."'").","; $sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").","; - $sql.= " ".(! isset($this->sortorder)?'NULL':"'".$this->sortorder."'").","; - $sql.= " ".(! isset($this->active)?'NULL':"'".$this->active."'").","; + $sql.= " ".(! isset($this->sortorder)?'NULL':"'".$this->db->escape($this->sortorder)."'").","; + $sql.= " ".(! isset($this->active)?'NULL':"'".$this->db->escape($this->active)."'").","; $sql.= " ".(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").","; $sql.= " ".(! isset($this->libelle_facture)?'NULL':"'".$this->db->escape($this->libelle_facture)."'").","; - $sql.= " ".(! isset($this->type_cdr)?'NULL':"'".$this->type_cdr."'").","; - $sql.= " ".(! isset($this->nbjour)?'NULL':"'".$this->nbjour."'").","; - $sql.= " ".(! isset($this->decalage)?'NULL':"'".$this->decalage."'").""; - - + $sql.= " ".(! isset($this->type_cdr)?'NULL':"'".$this->db->escape($this->type_cdr)."'").","; + $sql.= " ".(! isset($this->nbjour)?'NULL':"'".$this->db->escape($this->nbjour)."'").","; + $sql.= " ".(! isset($this->decalage)?'NULL':"'".$this->db->escape($this->decalage)."'").""; $sql.= ")"; $this->db->begin(); @@ -285,7 +278,6 @@ class PaymentTerm // extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."c_payment_term SET"; - $sql.= " code=".(isset($this->code)?"'".$this->db->escape($this->code)."'":"null").","; $sql.= " sortorder=".(isset($this->sortorder)?$this->sortorder:"null").","; $sql.= " active=".(isset($this->active)?$this->active:"null").","; @@ -294,8 +286,6 @@ class PaymentTerm // extends CommonObject $sql.= " type_cdr=".(isset($this->type_cdr)?$this->type_cdr:"null").","; $sql.= " nbjour=".(isset($this->nbjour)?$this->nbjour:"null").","; $sql.= " decalage=".(isset($this->decalage)?$this->decalage:"null").""; - - $sql.= " WHERE rowid=".$this->id; $this->db->begin(); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index b6c77207952..1ab0d7ceb93 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -49,7 +49,6 @@ $confirm=GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id) { - $action=''; $socid = $user->societe_id; } $result=restrictedArea($user,'facture',$id,''); @@ -72,9 +71,11 @@ if ($object->fetch($id)) $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); } + /* * Actions */ + include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; @@ -100,7 +101,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill'); $totalpaye = $object->getSommePaiement(); - + // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -109,11 +110,11 @@ if ($id > 0 || ! empty($ref)) $totalsize+=$file['size']; } - + // Invoice content - + $linkback = '' . $langs->trans("BackToList") . ''; - + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -154,14 +155,14 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
'; - + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status - + dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0); print '
'; print '
'; - + print '
'; print ''; print '
'; diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 0996907b245..d69ec07360a 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -44,7 +44,6 @@ $ref = GETPOST('ref'); // Security check if ($user->societe_id) { - $action=''; $socid = $user->societe_id; } $result=restrictedArea($user,'commande',$id,''); @@ -101,12 +100,12 @@ if ($id > 0 || ! empty($ref)) { $totalsize+=$file['size']; } - + // Order card - - $linkback = '' . $langs->trans("BackToList") . ''; - - + + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -147,25 +146,25 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
'; - + // Order card - + $linkback = '' . $langs->trans("BackToList") . ''; - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + print '
'; print '
'; - + print ''; print ''; print ''; print "
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
\n"; - + print "
\n"; - + print dol_fiche_end(); $modulepart = 'commande'; diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 02b631c4c8a..05adc9def54 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -65,7 +65,7 @@ dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), -1, 'order'); // Order card -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; // Ref customer diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 73fa9c5b66e..13841b108d9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -51,12 +51,12 @@ $show_files=GETPOST('show_files','int'); $confirm=GETPOST('confirm','alpha'); $toselect = GETPOST('toselect', 'array'); -$orderyear=GETPOST("orderyear","int"); -$ordermonth=GETPOST("ordermonth","int"); -$orderday=GETPOST("orderday","int"); -$deliveryyear=GETPOST("deliveryyear","int"); -$deliverymonth=GETPOST("deliverymonth","int"); -$deliveryday=GETPOST("deliveryday","int"); +$search_orderyear=GETPOST("search_orderyear","int"); +$search_ordermonth=GETPOST("search_ordermonth","int"); +$search_orderday=GETPOST("search_orderday","int"); +$search_deliveryyear=GETPOST("search_deliveryyear","int"); +$search_deliverymonth=GETPOST("search_deliverymonth","int"); +$search_deliveryday=GETPOST("search_deliveryday","int"); $search_product_category=GETPOST('search_product_category','int'); $search_ref=GETPOST('search_ref','alpha')!=''?GETPOST('search_ref','alpha'):GETPOST('sref','alpha'); $search_ref_customer=GETPOST('search_ref_customer','alpha'); @@ -149,8 +149,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -162,7 +162,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_categ=''; $search_user=''; @@ -180,17 +180,22 @@ if (empty($reshook)) $search_total_ht=''; $search_total_vat=''; $search_total_ttc=''; - $orderyear=''; - $ordermonth=''; - $orderday=''; - $deliveryday=''; - $deliverymonth=''; - $deliveryyear=''; + $search_orderyear=''; + $search_ordermonth=''; + $search_orderday=''; + $search_deliveryday=''; + $search_deliverymonth=''; + $search_deliveryyear=''; $viewstatut=''; $billed=''; $toselect=''; $search_array_options=array(); } + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') + || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + { + $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } // Mass actions $objectclass='Commande'; @@ -371,7 +376,7 @@ if (empty($reshook)) } - $cmd->classifyBilled($user); + //$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module. if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object; else $TFact[$object->id] = $object; @@ -499,31 +504,31 @@ if ($viewstatut <> '') $sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed } } -if ($ordermonth > 0) +if ($search_ordermonth > 0) { - if ($orderyear > 0 && empty($orderday)) - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,$ordermonth,false))."' AND '".$db->idate(dol_get_last_day($orderyear,$ordermonth,false))."'"; - else if ($orderyear > 0 && ! empty($orderday)) - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $orderday, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $orderday, $orderyear))."'"; + if ($search_orderyear > 0 && empty($search_orderday)) + $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($search_orderyear,$search_ordermonth,false))."' AND '".$db->idate(dol_get_last_day($search_orderyear,$search_ordermonth,false))."'"; + else if ($search_orderyear > 0 && ! empty($search_orderday)) + $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_ordermonth, $search_orderday, $search_orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_ordermonth, $search_orderday, $search_orderyear))."'"; else - $sql.= " AND date_format(c.date_commande, '%m') = '".$ordermonth."'"; + $sql.= " AND date_format(c.date_commande, '%m') = '".$search_ordermonth."'"; } -else if ($orderyear > 0) +else if ($search_orderyear > 0) { - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,1,false))."' AND '".$db->idate(dol_get_last_day($orderyear,12,false))."'"; + $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($search_orderyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_orderyear,12,false))."'"; } -if ($deliverymonth > 0) +if ($search_deliverymonth > 0) { - if ($deliveryyear > 0 && empty($deliveryday)) - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,$deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,$deliverymonth,false))."'"; - else if ($deliveryyear > 0 && ! empty($deliveryday)) - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $deliverymonth, $deliveryday, $deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $deliverymonth, $deliveryday, $deliveryyear))."'"; + if ($search_deliveryyear > 0 && empty($search_deliveryday)) + $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_deliveryyear,$search_deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($search_deliveryyear,$search_deliverymonth,false))."'"; + else if ($search_deliveryyear > 0 && ! empty($search_deliveryday)) + $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_deliverymonth, $search_deliveryday, $search_deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_deliverymonth, $search_deliveryday, $search_deliveryyear))."'"; else - $sql.= " AND date_format(c.date_livraison, '%m') = '".$deliverymonth."'"; + $sql.= " AND date_format(c.date_livraison, '%m') = '".$search_deliverymonth."'"; } -else if ($deliveryyear > 0) +else if ($search_deliveryyear > 0) { - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,12,false))."'"; + $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_deliveryyear,12,false))."'"; } if ($search_town) $sql.= natural_search('s.town', $search_town); if ($search_zip) $sql.= natural_search("s.zip",$search_zip); @@ -541,8 +546,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -573,6 +579,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfOrders') . ' - '.$soc->name; + if (empty($search_company)) $search_company = $soc->name; } else { @@ -605,12 +612,12 @@ if ($resql) if ($sall) $param.='&sall='.$sall; if ($socid > 0) $param.='&socid='.$socid; if ($viewstatut != '') $param.='&viewstatut='.$viewstatut; - if ($orderday) $param.='&orderday='.$orderday; - if ($ordermonth) $param.='&ordermonth='.$ordermonth; - if ($orderyear) $param.='&orderyear='.$orderyear; - if ($deliveryday) $param.='&deliveryday='.$deliveryday; - if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth; - if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear; + if ($search_orderday) $param.='&search_orderday='.$search_orderday; + if ($search_ordermonth) $param.='&search_ordermonth='.$search_ordermonth; + if ($search_orderyear) $param.='&search_orderyear='.$search_orderyear; + if ($search_deliveryday) $param.='&search_deliveryday='.$search_deliveryday; + if ($search_deliverymonth) $param.='&search_deliverymonth='.$search_deliverymonth; + if ($search_deliveryyear) $param.='&search_deliveryyear='.$search_deliveryyear; if ($search_ref) $param.='&search_ref='.$search_ref; if ($search_company) $param.='&search_company='.$search_company; if ($search_ref_customer) $param.='&search_ref_customer='.$search_ref_customer; @@ -659,7 +666,7 @@ if ($resql) { $langs->load("mails"); - if (! GETPOST('cancel')) + if (! GETPOST('cancel','alpha')) { $objecttmp=new Commande($db); $listofselectedid=array(); @@ -754,7 +761,7 @@ if ($resql) //var_dump($_REQUEST); print ''; - print ''; + print '
'; print ''; print ''; print ''; print ''; print '
'; print $langs->trans('DateInvoice'); @@ -776,7 +783,15 @@ if ($resql) print $langs->trans('ValidateInvoices'); print ''; - print $form->selectyesno('valdate_invoices', 1, 1); + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + { + print $form->selectyesno('valdate_invoices', 0, 1, 1); + print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; + } + else + { + print $form->selectyesno('valdate_invoices', 0, 1); + } print '
'; @@ -838,7 +853,7 @@ if ($resql) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); print '
'; print ''."\n"; @@ -894,17 +909,17 @@ if ($resql) if (! empty($arrayfields['c.date_commande']['checked'])) { print ''; } if (! empty($arrayfields['c.date_delivery']['checked'])) { print ''; } if (! empty($arrayfields['c.total_ht']['checked'])) @@ -976,6 +991,7 @@ if ($resql) Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"), Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), + -3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"), Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort") ); print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4); @@ -1021,7 +1037,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -1033,7 +1049,7 @@ if ($resql) if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'],$_SERVER["PHP_SELF"],"c.fk_statut","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'],$_SERVER["PHP_SELF"],'c.facture','',$param,'align="center"',$sortfield,$sortorder,''); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'',$param,'align="center"',$sortfield,$sortorder,'maxwidthsearch '); print ''."\n"; $total=0; @@ -1075,7 +1091,7 @@ if ($resql) print '
'; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5); + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($search_orderyear?$search_orderyear:-1,'search_orderyear',1, 20, 5); print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5); + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($search_deliveryyear?$search_deliveryyear:-1,'search_deliveryyear',1, 20, 5); print '
'; print ''; // Show shippable Icon (create subloop, so may be slow) diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 79475c75917..0d42cc69611 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -72,16 +72,16 @@ $form = new Form($db); if ($id > 0 || ! empty($ref)) { $object->fetch_thirdparty(); - + $head = commande_prepare_head($object); - + dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), -1, 'order'); // Order card - - $linkback = '' . $langs->trans("BackToList") . ''; - - + + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -122,20 +122,20 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
'; - - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
'; print '
'; - - + + $cssclass="titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; print '
'; - + dol_fiche_end(); } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index fa9f810b036..83ec75043c3 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -602,12 +602,12 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) print '
'; - print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$obj->fk_statut)); + print $generic_commande->getNomUrl(1, ($viewstatut != 2?0:$obj->fk_statut), 0, 0, 0, 1); print '
'; print ''; - print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','','&socid='.$socid,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','','&socid='.$socid,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','','&socid='.$socid, 'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','','&socid='.$socid, 'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Status'),'','','','','align="right"'); - print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"'); + print_liste_field_titre('Ref',$_SERVER["PHP_SELF"],'c.ref','','&socid='.$socid,'',$sortfield,$sortorder); + print_liste_field_titre('RefCustomerOrder',$_SERVER["PHP_SELF"],'c.ref_client','','&socid='.$socid,'',$sortfield,$sortorder); + print_liste_field_titre('OrderDate',$_SERVER["PHP_SELF"],'c.date_commande','','&socid='.$socid, 'align="center"',$sortfield,$sortorder); + print_liste_field_titre('DeliveryDate',$_SERVER["PHP_SELF"],'c.date_livraison','','&socid='.$socid, 'align="center"',$sortfield,$sortorder); + print_liste_field_titre('Status','','','','','align="right"'); + print_liste_field_titre('GenerateBill','','','','','align="center"'); print ''; // Lignes des champs de filtre diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index ed9f8906804..6a8b57e3707 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -88,11 +88,11 @@ dol_mkdir($dir); $stats = new CommandeStats($db, $socid, $mode, ($userid>0?$userid:0)); if ($mode == 'customer') { - if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; + if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')'; } if ($mode == 'supplier') { - if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; + if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')'; } diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index d9dd8241248..cd4d659d743 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; @@ -46,17 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -$langs->load("banks"); -$langs->load("bills"); -$langs->load("categories"); -$langs->load("companies"); -$langs->load("margins"); -$langs->load("salaries"); -$langs->load("loan"); -$langs->load("donations"); -$langs->load("trips"); -$langs->load("members"); -$langs->load("compta"); +$langs->loadLangs(array("banks","bills","categories","companies","margins","salaries","loan","donations","trips","members","compta","accountancy")); $id = GETPOST('id','int'); $ref = GETPOST('ref','alpha'); @@ -84,6 +75,7 @@ $debit=GETPOST("debit",'alpha'); $credit=GETPOST("credit",'alpha'); $type=GETPOST("type",'alpha'); $account=GETPOST("account",'int'); +$accountancy_code=GETPOST('accountancy_code', 'alpha'); $bid=GETPOST("bid","int"); $search_dt_start = dol_mktime(0, 0, 0, GETPOST('search_start_dtmonth', 'int'), GETPOST('search_start_dtday', 'int'), GETPOST('search_start_dtyear', 'int')); $search_dt_end = dol_mktime(0, 0, 0, GETPOST('search_end_dtmonth', 'int'), GETPOST('search_end_dtday', 'int'), GETPOST('search_end_dtyear', 'int')); @@ -108,7 +100,7 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder='ASC'; -if (! $sortfield) $sortfield='b.datev'; +if (! $sortfield) $sortfield='b.datev, b.dateo, b.rowid'; $mode_balance_ok=false; //if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid')) // TODO Manage balance when account not selected @@ -169,8 +161,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -178,7 +170,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_dt_start=''; $search_dt_end=''; @@ -276,11 +268,11 @@ if (GETPOST('save') && $id && ! $cancel && $user->rights->banque->modifier) $amount = - price2num($_POST["adddebit"]); } - $dateop = dol_mktime(12,0,0,$_POST["opmonth"],$_POST["opday"],$_POST["opyear"]); - $operation=$_POST["operation"]; - $num_chq=$_POST["num_chq"]; - $label=$_POST["label"]; - $cat1=$_POST["cat1"]; + $dateop = dol_mktime(12,0,0,$_POST["opmonth"],$_POST["opday"],$_POST["opyear"]); + $operation = GETPOST("operation",'alpha'); + $num_chq = GETPOST("num_chq",'alpha'); + $label = GETPOST("label",'alpha'); + $cat1 = GETPOST("cat1",'alpha'); if (! $dateop) { $error++; @@ -290,15 +282,24 @@ if (GETPOST('save') && $id && ! $cancel && $user->rights->banque->modifier) $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Type")), null, 'errors'); } + if (! $label) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Label")), null, 'errors'); + } if (! $amount) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors'); } + /*if (! empty($conf->accounting->enabled) && (empty($accountancy_code) || $accountancy_code == '-1')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors'); + $error++; + }*/ if (! $error) { $object->fetch($id); - $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user); + $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user, '', '', $accountancy_code); if ($insertid > 0) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); @@ -331,6 +332,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->m $form = new Form($db); $formother = new FormOther($db); +$formaccounting = new FormAccounting($db); $companystatic=new Societe($db); $bankaccountstatic=new Account($db); @@ -365,6 +367,7 @@ if (!empty($debit)) $param.='&debit='.$debit; if (!empty($credit)) $param.='&credit='.$credit; if (!empty($account)) $param.='&account='.$account; if (!empty($search_num_releve)) $param.='&search_num_releve='.urlencode($search_num_releve); +if ($search_conciliated != '') $param.='&search_conciliated='.urlencode($search_conciliated); if (!empty($bid)) $param.='&bid='.$bid; if (dol_strlen($search_dt_start) > 0) $param .= '&search_start_dtmonth=' . GETPOST('search_start_dtmonth', 'int') . '&search_start_dtday=' . GETPOST('search_start_dtday', 'int') . '&search_start_dtyear=' . GETPOST('search_start_dtyear', 'int'); if (dol_strlen($search_dt_end) > 0) $param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int'); @@ -408,19 +411,32 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); + /* * Buttons actions */ + if ($action != 'reconcile') { print '
'; if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - if ($user->rights->banque->modifier) { - print ''.$langs->trans("AddBankRecord").''; - } else { - print ''.$langs->trans("AddBankRecord").''; + if (! empty($conf->global->BANK_USE_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments + { + if ($user->rights->banque->modifier) { + print ''.$langs->trans("AddBankRecord").''; + } else { + print ''.$langs->trans("AddBankRecord").''; + } + } + else // If direct entries is not done using miscellaneous payments + { + if ($user->rights->banque->modifier) { + print ''.$langs->trans("AddBankRecord").''; + } else { + print ''.$langs->trans("AddBankRecord").''; + } } } else @@ -431,11 +447,12 @@ if ($id > 0 || ! empty($ref)) if ($object->canBeConciliated() > 0) { // If not cash account and can be reconciliate if ($user->rights->banque->consolidate) { - print ''.$langs->trans("Conciliate").''; + print ''.$langs->trans("Conciliate").''; } else { print ''.$langs->trans("Conciliate").''; } } + print '
'; } } @@ -491,8 +508,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -588,7 +606,7 @@ if ($resql) // print '
'; print '
'; print ''.$langs->trans("InputReceiptNumber").': '; - print ''; // The only default value is value we just entered + print ''; // The only default value is value we just entered print '
'; if ($options) { print $langs->trans("EventualyAddCategory").': '; @@ -632,10 +650,75 @@ if ($resql) { dol_print_error($db); } + /** + * Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not) + */ + if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE == 1) { + print ' + + '; + } print '

'; // print '
'; } + // Form to add a transaction with no invoice + if ($user->rights->banque->modifier && $action == 'addline') + { + print load_fiche_titre($langs->trans("AddBankRecordLong"),'',''); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + /*if (! empty($conf->accounting->enabled)) + { + print ''; + }*/ + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + /*if (! empty($conf->accounting->enabled)) + { + print ''; + }*/ + print ''; + + print '
'.$langs->trans("Date").' '.$langs->trans("Type").''.$langs->trans("Numero").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''; + print $langs->trans("AccountAccounting"); + print ' 
'; + $form->select_date(empty($dateop)?-1:$dateop,'op',0,0,0,'transaction'); + print ''; + $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1); + print ''; + print ''; + print ''; + if ($options) { + print '
'.$langs->trans("Rubrique").': '; + print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); + } + print '
'; + print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1, ''); + print ''; + print '
'; + print ''; + print '
'; + print '
'; + } + /// ajax to adjust value date with plus and less picto print ' '; } + print ' '.$langs->trans("AddThirdParty").''; print '
'; print ''; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 221167a485a..98fc2cd2f62 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -40,19 +40,25 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; $langs->load('bills'); $langs->load('compta'); $langs->load('admin'); $langs->load('other'); +$action = GETPOST('action','alpha'); +$massaction = GETPOST('massaction','alpha'); +$show_files = GETPOST('show_files','int'); +$confirm = GETPOST('confirm','alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'invoicetemplatelist'; // To manage different context of search + // Security check $id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int')); -$confirm = GETPOST('confirm', 'alpha'); -$cancel = GETPOST('cancel', 'alpha'); $lineid=GETPOST('lineid','int'); $ref=GETPOST('ref','alpha'); -$action=GETPOST('action', 'alpha'); if ($user->societe_id) $socid=$user->societe_id; $objecttype = 'facture_rec'; if ($action == "create" || $action == "add") $objecttype = ''; @@ -98,7 +104,7 @@ $hookmanager->initHooks(array('invoicereccard','globalcard')); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('facture'); +$extralabels = $extrafields->fetch_name_optionals_label('facture_rec'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); $permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php @@ -112,10 +118,11 @@ $arrayfields=array( 'f.tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>1), 'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1), 'f.frequency'=>array('label'=>$langs->trans("RecurringInvoiceTemplate"), 'checked'=>1), - 'f.nb_gen_done'=>array('label'=>$langs->trans("NbGeneration"), 'checked'=>1), + 'f.nb_gen_done'=>array('label'=>$langs->trans("NbOfGenerationDone"), 'checked'=>1), 'f.date_last_gen'=>array('label'=>$langs->trans("DateLastGeneration"), 'checked'=>1), 'f.date_when'=>array('label'=>$langs->trans("NextDateToExecution"), 'checked'=>1), - 'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>100), + 'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), ); // Extra fields @@ -132,13 +139,19 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { - if (GETPOST('cancel')) $action=''; + if (GETPOST('cancel','alpha')) $action=''; + + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Set note include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once @@ -148,7 +161,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once // Do we click on purge search criteria ? - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $search_ref=''; $search_societe=''; @@ -165,6 +178,14 @@ if (empty($reshook)) $search_array_options=array(); } + // Mass actions + /*$objectclass='MyObject'; + $objectlabel='MyObject'; + $permtoread = $user->rights->mymodule->read; + $permtodelete = $user->rights->mymodule->delete; + $uploaddir = $conf->mymodule->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/ + // Create predefined invoice if ($action == 'add') { @@ -279,7 +300,7 @@ if (empty($reshook)) // Delete if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer) { - $object->delete(); + $object->delete($user); header("Location: " . $_SERVER['PHP_SELF'] ); exit; } @@ -375,6 +396,28 @@ if (empty($reshook)) setEventMessages($line->error, $line->errors, 'errors'); } } + else if ($action == 'update_extras') + { + // Fill array 'array_options' with data from update form + $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + if ($ret < 0) + $error ++; + + if (! $error) { + + $result = $object->insertExtraFields(); + if ($result < 0) { + $error ++; + } + } else if ($reshook < 0) + $error ++; + + if ($error) { + $action = 'edit_extras'; + setEventMessages($object->error, $object->errors, 'errors'); + } + } // Add a new line if ($action == 'addline' && $user->rights->facture->creer) @@ -517,7 +560,7 @@ if (empty($reshook)) $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); $tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx)); - + // if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ? if (! empty($price_ht)) { @@ -545,8 +588,8 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if (empty($newlang) && GETPOST('lang_id')) - $newlang = GETPOST('lang_id'); + if (empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); if (empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) @@ -625,7 +668,7 @@ if (empty($reshook)) // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -685,7 +728,7 @@ if (empty($reshook)) } } - elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel')) + elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel','alpha')) { if (! $object->fetch($id) > 0) dol_print_error($db); $object->fetch_thirdparty(); @@ -718,6 +761,18 @@ if (empty($reshook)) $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + + $objectline = new FactureLigneRec($db); + if ($objectline->fetch(GETPOST('lineid'))) + { + $objectline->array_options=$array_options; + $result=$objectline->insertExtraFields(); + if ($result < 0) + { + setEventMessages($langs->trans('Error').$result, null, 'errors'); + } + } + // Unset extrafield if (is_array($extralabelsline)) { @@ -810,8 +865,8 @@ if (empty($reshook)) // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) - $newlang = GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { @@ -880,6 +935,7 @@ $form = new Form($db); $formother = new FormOther($db); if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); +$invoicerectmp = new FactureRec($db); $now = dol_now(); $tmparray=dol_getdate($now); @@ -905,7 +961,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(); + dol_fiche_head(null, '', '', 0); $rowspan=4; if (! empty($conf->projet->enabled)) $rowspan++; @@ -939,10 +995,13 @@ if ($action == 'create') '__INVOICE_NEXT_MONTH_TEXT__' => $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')', '__INVOICE_PREVIOUS_YEAR__' => $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'),'%Y').')', '__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%Y').')', - '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')' + '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')', + // Only on template invoices + '__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')', + '__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency),'dayhour').')', ); $substitutionarray['__(TransKey)__']=$langs->trans("TransKey"); - + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; foreach($substitutionarray as $key => $val) { @@ -952,10 +1011,10 @@ if ($action == 'create') // Public note print '
'; - print ''; - print ''; - print ''; print '"; } print "
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'; + print ''; print $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'); print ''; + print ''; $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); @@ -963,7 +1022,7 @@ if ($action == 'create') if (empty($user->societe_id)) { print '
'; + print ''; print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'); print ''; @@ -1000,19 +1059,21 @@ if ($action == 'create') // Bank account if ($object->fk_account > 0) { - print "
".$langs->trans('RIB').""; + print "
".$langs->trans('BankAccount').""; $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); print "
"; - print '

'; + dol_fiche_end(); // Autogeneration $title = $langs->trans("Recurrence"); - print load_fiche_titre($title, '', 'calendar'); + print load_fiche_titre(' '.$title, '', ''); + + dol_fiche_head(null, '', '', 0); print ''; @@ -1040,7 +1101,8 @@ if ($action == 'create') print "
"; - print '

'; + dol_fiche_end(); + $title = $langs->trans("ProductsAndServices"); if (empty($conf->service->enabled)) @@ -1078,8 +1140,6 @@ if ($action == 'create') } print "\n"; - dol_fiche_end(); - print '
'; print '     '; print ''; @@ -1257,10 +1317,13 @@ else '__INVOICE_NEXT_MONTH_TEXT__' => $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')', '__INVOICE_PREVIOUS_YEAR__' => $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'),'%Y').')', '__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')', - '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')' + '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')', + // Only on template invoices + '__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')', + '__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency),'dayhour').')', ); $substitutionarray['__(TransKey)__']=$langs->trans("TransKey"); - + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; foreach($substitutionarray as $key => $val) { @@ -1291,7 +1354,7 @@ else print ''; print '
'; print $langs->trans('RIB'); print ''; - if (($action != 'editbankaccount') && $user->rights->commande->creer && ! empty($object->brouillon)) + if (($action != 'editbankaccount') && $user->rights->facture->creer && ! empty($object->brouillon)) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; print ''; @@ -1306,6 +1369,11 @@ else print ""; print ''; + + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + print ''; print '
'; @@ -1323,7 +1391,7 @@ else print ''; print ''; - + // if "frequency" is empty or = 0, the reccurence is disabled print '"; - if (! $i) $totalarray['nbfield']++; + print '"; + if (! $i) $totalarray['nbfield']++; } // Action column diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 55ff4dad6e3..bf54e4f58ab 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -84,11 +84,11 @@ dol_mkdir($dir); $stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0)); if ($mode == 'customer') { - if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')'; + if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; } if ($mode == 'supplier') { - if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')'; + if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; } // Build graphic number of object @@ -299,7 +299,7 @@ foreach ($data as $val) while ($year && $oldyear > $year+1) { // If we have empty year $oldyear--; - + print ''; print ''; print ''; @@ -310,7 +310,7 @@ foreach ($data as $val) print ''; print ''; } - + print ''; print ''; print ''; diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index 2e7858fdb08..44d5ec2ced5 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -36,7 +36,7 @@ $var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - + $trclass=($var?'pair':'impair'); if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> @@ -44,13 +44,17 @@ foreach($linkedObjectBlock as $key => $objectlink) - + - + facture->enabled) && $user->rights->facture->lire) print ''; $total_ttc += $obj->total_ttc; - $total += $obj->total; + $total += $obj->total_ht; $totalam += $obj->am; $i++; diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index fbd391ffe2a..5934ca71afb 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -84,16 +84,16 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $date_start=dol_get_first_day($pastmonthyear,$pastmonth,false); $date_end=dol_get_last_day($pastmonthyear,$pastmonth,false); } -$nom=$langs->trans("PurchasesJournal"); -$nomlink=''; +$name=$langs->trans("PurchasesJournal"); $periodlink=''; $exportlink=''; -$builddate=time(); +$builddate=dol_now(); $description=$langs->trans("DescPurchasesJournal").'
'; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); + +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink); $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index fd0c45be7cd..f4b027b5016 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -89,15 +89,14 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $nom=$langs->trans("SellsJournal"); -$nomlink=''; $periodlink=''; $exportlink=''; -$builddate=time(); +$builddate=dol_now(); $description=$langs->trans("DescSellsJournal").'
'; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink); $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; @@ -170,7 +169,7 @@ if ($result) $prev_progress = 0; if ($obj->type==Facture::TYPE_SITUATION) { // Avoid divide by 0 - if ($obj->situation_percent == 0) { + if ($obj->situation_percent == 0) { $situation_ratio = 0; } else { $prev_progress = $line->get_prev_progress($obj->rowid); // id on invoice diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index e59b2c6ce2b..570942590c2 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -87,12 +87,12 @@ class Localtax extends CommonObject $sql.= " '".$this->db->idate($this->tms)."',"; $sql.= " '".$this->db->idate($this->datep)."',"; $sql.= " '".$this->db->idate($this->datev)."',"; - $sql.= " '".$this->amount."',"; - $sql.= " '".$this->label."',"; - $sql.= " '".$this->note."',"; - $sql.= " ".($this->fk_bank <= 0 ? "NULL" : "'".$this->fk_bank."'").","; - $sql.= " '".$this->fk_user_creat."',"; - $sql.= " '".$this->fk_user_modif."'"; + $sql.= " '".$this->db->escape($this->amount)."',"; + $sql.= " '".$this->db->escape($this->label)."',"; + $sql.= " '".$this->db->escape($this->note)."',"; + $sql.= " ".($this->fk_bank <= 0 ? "NULL" : "'".$this->db->escape($this->fk_bank)."'").","; + $sql.= " '".$this->db->escape($this->fk_user_creat)."',"; + $sql.= " '".$this->db->escape($this->fk_user_modif)."'"; $sql.= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -151,9 +151,9 @@ class Localtax extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."localtax SET"; $sql.= " localtaxtype=".$this->ltt.","; - $sql.= " tms=".$this->db->idate($this->tms).","; - $sql.= " datep=".$this->db->idate($this->datep).","; - $sql.= " datev=".$this->db->idate($this->datev).","; + $sql.= " tms='".$this->db->idate($this->tms)."',"; + $sql.= " datep='".$this->db->idate($this->datep)."',"; + $sql.= " datev='".$this->db->idate($this->datev)."',"; $sql.= " amount=".price2num($this->amount).","; $sql.= " label='".$this->db->escape($this->label)."',"; $sql.= " note='".$this->db->escape($this->note)."',"; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 40a5805f2b3..70d52c3d9d3 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -115,7 +115,7 @@ if ($calc==0 || $calc==1) // Calculate on invoice for goods and services if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')'; - $builddate=time(); + $builddate=dol_now(); $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("Description"); @@ -133,7 +133,7 @@ if ($calc==2) // Invoice for goods, payment for services if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')'; - $builddate=time(); + $builddate=dol_now(); $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("Description"); @@ -142,7 +142,7 @@ if ($calc==2) // Invoice for goods, payment for services $productsup=$langs->trans("Description"); $amountsup=$langs->trans("AmountHT"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code); @@ -169,7 +169,7 @@ if($calc ==0 || $calc == 2) $parameters["end"] = $date_end; $parameters["direction"] = 'sell'; $parameters["type"] = 'localtax'.$local; - + // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -183,7 +183,7 @@ if($calc ==0 || $calc == 2) { if(($min == 0 or ($min > 0 && $coll->amount > $min)) && ($local==1?$coll->localtax1:$coll->localtax2) !=0) { - + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { @@ -247,7 +247,7 @@ if($calc ==0 || $calc == 1){ $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy'); $parameters["direction"] = 'buy'; $parameters["type"] = 'localtax'.$local; - + $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (is_array($coll_list)) { @@ -258,7 +258,7 @@ if($calc ==0 || $calc == 1){ { if(($min == 0 or ($min > 0 && $coll->amount > $min)) && ($local==1?$coll->localtax1:$coll->localtax2) != 0) { - + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 13c753db464..5e18c786c18 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -54,8 +54,9 @@ if (empty($year)) $year_current = $year; $year_start = $year; } -$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); -$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); + +$date_start = dol_mktime( 0, 0, 0, GETPOST( "date_startmonth" ), GETPOST( "date_startday" ), GETPOST( "date_startyear" ) ); +$date_end = dol_mktime( 23, 59, 59, GETPOST( "date_endmonth" ), GETPOST( "date_endday" ), GETPOST( "date_endyear" ) ); // Quarter if (empty($date_start) || empty($date_end)) // We define date_start and date_end { @@ -92,12 +93,9 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); - - -/* +/** * View */ - $morequerystring=''; $listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday'); foreach($listofparams as $param) @@ -118,6 +116,7 @@ $paymentfourn_static=new PaiementFourn($db); $fsearch.=' '; $fsearch.=' '; +$fsearch.=' '; $calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local; @@ -137,7 +136,7 @@ if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); $description.=$fsearch; - $builddate=time(); + $builddate=dol_now(); $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("ProductOrService"); @@ -165,7 +164,7 @@ if ($conf->global->$calc==2) // Invoice for goods, payment for services if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); else $description.=' '.$langs->trans("DepositsAreIncluded"); $description.=$fsearch; - $builddate=time(); + $builddate=dol_now(); $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("ProductOrService"); @@ -178,7 +177,7 @@ if ($conf->global->$calc==2) // Invoice for goods, payment for services $vatsup=$langs->trans("VATPaid"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); if($local==1){ @@ -196,9 +195,8 @@ $total = 0; $i=0; // Load arrays of datas -$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell'); -$x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy'); - +$x_coll = tax_by_date('localtax' . $local, $db, 0, 0, $date_start, $date_end, $modetax, 'sell'); +$x_paye = tax_by_date('localtax' . $local, $db, 0, 0, $date_start, $date_end, $modetax, 'buy'); echo '
'.$title.'
'; print ''; } + // Status + if (! empty($arrayfields['status']['checked'])) + { + print ''; + } // Action column print ''; print "\n"; + print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER['PHP_SELF'],"f.titre","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER['PHP_SELF'],"s.nom","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountHT"),$_SERVER['PHP_SELF'],"f.total","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountVAT"),$_SERVER['PHP_SELF'],"f.tva","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER['PHP_SELF'],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RecurringInvoiceTemplate"),$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['f.nb_gen_done']['checked'])) - { - print_liste_field_titre($langs->trans("NbOfGenerationDone"),$_SERVER['PHP_SELF'],"f.nb_gen_done","",$param,'align="center"',$sortfield,$sortorder); - } - print_liste_field_titre($langs->trans("DateLastGeneration"),$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("NextDateToExecution"),$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre(''); // Field may contains ling text + if (! empty($arrayfields['f.titre']['checked'])) print_liste_field_titre($arrayfields['f.titre']['label'],$_SERVER['PHP_SELF'],"f.titre","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER['PHP_SELF'],"s.nom","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['f.total']['checked'])) print_liste_field_titre($arrayfields['f.total']['label'],$_SERVER['PHP_SELF'],"f.total","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['f.tva']['checked'])) print_liste_field_titre($arrayfields['f.tva']['label'],$_SERVER['PHP_SELF'],"f.tva","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['f.frequency']['checked'])) print_liste_field_titre($arrayfields['f.frequency']['label'],$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['f.nb_gen_done']['checked'])) print_liste_field_titre($arrayfields['f.nb_gen_done']['label'],$_SERVER['PHP_SELF'],"f.nb_gen_done","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['f.date_last_gen']['checked'])) print_liste_field_titre($arrayfields['f.date_last_gen']['label'],$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['f.date_when']['checked'])) print_liste_field_titre($arrayfields['f.date_when']['label'],$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER['PHP_SELF'],"f.datec","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER['PHP_SELF'],"f.tms","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['status']['checked'])) print_liste_field_titre($arrayfields['status']['label'],$_SERVER['PHP_SELF'],"","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; print "\n"; - - + + if ($num > 0) { $var=true; @@ -1800,26 +1883,78 @@ else { $objp = $db->fetch_object($resql); - print ''; - - print '\n"; - $companystatic->id=$objp->socid; $companystatic->name=$objp->name; - print ''; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''; + $invoicerectmp->id=$objp->id; + $invoicerectmp->frequency=$objp->frequency; + $invoicerectmp->suspend=$objp->suspend; + $invoicerectmp->unit_frequency=$objp->unit_frequency; + + print ''; + + if (! empty($arrayfields['f.titre']['checked'])) + { + print '\n"; + } + if (! empty($arrayfields['s.nom']['checked'])) + { + print ''; + } + if (! empty($arrayfields['f.total']['checked'])) + { + print ''."\n"; + } + if (! empty($arrayfields['f.tva']['checked'])) + { + print ''."\n"; + } + if (! empty($arrayfields['f.total_ttc']['checked'])) + { + print ''."\n"; + } + if (! empty($arrayfields['f.frequency']['checked'])) + { + print ''; + } if (! empty($arrayfields['f.nb_gen_done']['checked'])) { - print ''; + print ''; } - print ''; - print ''; - + if (! empty($arrayfields['f.date_last_gen']['checked'])) + { + print ''; + } + if (! empty($arrayfields['f.date_when']['checked'])) + { + print ''; + } + if (! empty($arrayfields['f.datec']['checked'])) + { + print ''; + } + if (! empty($arrayfields['f.tms']['checked'])) + { + print ''; + } + if (! empty($arrayfields['status']['checked'])) + { + print ''; + } + // Action column print ''; + else + { + $colspan=1; + foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } + print ''; + } print "
'; @@ -1349,7 +1417,7 @@ else { if ($object->frequency > 0) { - print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); + print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); } else { @@ -1557,23 +1625,24 @@ else /* * List mode */ - $sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency,"; - $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when"; + $sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,"; + $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when,"; + $sql.= " f.datec, f.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f"; if (! $user->rights->societe->client->voir && ! $socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity = ".$conf->entity; + $sql.= ' AND f.entity IN ('.getEntity('facture').')'; if (! $user->rights->societe->client->voir && ! $socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($search_ref) $sql .= natural_search('f.titre', $search_ref); if ($search_societe) $sql .= natural_search('s.nom', $search_societe); - if ($search_frequency) $sql .= natural_search('f.frequency', $search_frequency); if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1); if ($search_montant_vat != '') $sql.= natural_search('f.tva', $search_montant_vat, 1); if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); + if ($search_frequency > 0) $sql.= natural_search('f.frequency', $search_frequency); if ($search_frequency == '1') $sql.= ' AND f.frequency > 0'; if ($search_frequency == '0') $sql.= ' AND (f.frequency IS NULL or f.frequency = 0)'; @@ -1605,23 +1674,24 @@ else } $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) - { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); - } + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); + } - $sql.= $db->order($sortfield, $sortorder); - $sql.= $db->plimit($limit+1,$offset); + $sql.= $db->order($sortfield, $sortorder); + $sql.= $db->plimit($limit+1,$offset); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $param='&socid='.$socid; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($socid) $param.='&socid='.$socid; if ($day) $param.='&day='.$day; if ($month) $param.='&month='.$month; if ($year) $param.='&year=' .$year; @@ -1631,9 +1701,9 @@ else if ($search_ref) $param.='&search_ref=' .$search_ref; if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; - if ($search_montant_vat != '') $param.='&search_montant_vat='.$search_montant_vat; + if ($search_montant_vat != '') $param.='&search_montant_vat='.$search_montant_vat; if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; - if ($search_frequency) $param.='&search_frequency=' .$search_frequency; + if ($search_frequency > 0) $param.='&search_frequency=' .$search_frequency; if ($option) $param.="&option=".$option; if ($optioncss != '') $param.='&optioncss='.$optioncss; // Add $param from extra fields @@ -1646,14 +1716,20 @@ else $massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); - print '
'."\n"; + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + //$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + + print ''."\n"; if ($optioncss != '') print ''; print ''; + print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; + print ''; print_barre_liste($langs->trans("RepeatableInvoices"),$page,$_SERVER['PHP_SELF'],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png',0,'','',$limit); @@ -1769,6 +1845,12 @@ else print '
'; print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0, 'checkforselect', 1); @@ -1776,23 +1858,24 @@ else print '
'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre; - print "'.$companystatic->getNomUrl(1,'customer').''.price($objp->total).''.price($objp->total_vat).''.price($objp->total_ttc).''.yn($objp->frequency?1:0).'
'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre; + print "'.$companystatic->getNomUrl(1,'customer').''.price($objp->total).''.price($objp->total_vat).''.price($objp->total_ttc).''.yn($objp->frequency?1:0).''.($objp->frequency ? $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') : '').''; + print ($objp->frequency ? $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') : ''.$langs->trans('NA').''); + print ''.($objp->frequency ? dol_print_date($objp->date_last_gen,'day') : '').''.($objp->frequency ? dol_print_date($objp->date_when,'day') : '').''; + print ($objp->frequency ? dol_print_date($db->jdate($objp->date_last_gen),'day') : ''.$langs->trans('NA').''); + print ''; + print ($objp->frequency ? dol_print_date($db->jdate($objp->date_when),'day') : ''.$langs->trans('NA').''); + print ''; + print dol_print_date($db->jdate($objp->datec),'dayhour'); + print ''; + print dol_print_date($db->jdate($objp->tms),'dayhour'); + print ''; + print $invoicerectmp->getLibStatut(3,0); + print ''; if ($user->rights->facture->creer) { @@ -1842,7 +1977,12 @@ else $i++; } } - else print '
'.$langs->trans("NoneF").'
'.$langs->trans("NoRecordFound").'
"; print ""; diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 56f89a83154..fd43cc42982 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -39,6 +39,8 @@ $ref=GETPOST("ref",'alpha'); * View */ +$form = new Form($db); + $title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Info'); $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $helpurl); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 513c6854eb8..15a79d7fdd9 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -181,8 +181,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -191,7 +191,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha')) // All tests are required to be compatible with all browsers { $search_user=''; $search_sale=''; @@ -474,8 +474,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -531,6 +532,7 @@ if ($resql) { $soc = new Societe($db); $soc->fetch($socid); + if (empty($search_societe)) $search_societe = $soc->name; } $param='&socid='.$socid; @@ -594,6 +596,7 @@ if ($resql) $i = 0; print ''."\n"; + if ($optioncss != '') print ''; print ''; print ''; @@ -609,7 +612,7 @@ if ($resql) { $langs->load("mails"); - if (! GETPOST('cancel')) + if (! GETPOST('cancel','alpha')) { $objecttmp=new Facture($db); $listofselectedid=array(); @@ -977,7 +980,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -1253,10 +1256,10 @@ if ($resql) // Status if (! empty($arrayfields['f.fk_statut']['checked'])) { - print '
'; - print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type); - print "'; + print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type); + print "
0?'&userid='.$userid:'').'">'.$oldyear.'0
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].'trans("RepeatableInvoice"); ?> getNomUrl(1); ?> date,'day'); ?>date_when,'day'); ?> rights->facture->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } ?> + getLibStatut(3); + ?> + ">transnoentitiesnoconv("RemoveLink")); ?>
'; @@ -338,7 +336,7 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - + print ''; // Ref @@ -501,7 +499,7 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - + print ''; // Ref diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index cdc5eb2e545..7a494113090 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -99,7 +99,7 @@ if (empty($reshook)) $atleastonepaymentnotnull = 0; // Generate payment array and check if there is payment higher than invoice and payment date before invoice date - $tmpinvoice=new Facture($db); + $tmpinvoice=new Facture($db); foreach ($_POST as $key => $value) { if (substr($key,0,7) == 'amount_') @@ -188,7 +188,7 @@ if (empty($reshook)) setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors'); $error++; } - + // Check if payments in both currency if ($totalpayment > 0 && $multicurrency_totalpayment > 0) { @@ -228,7 +228,7 @@ if (empty($reshook)) $newvalue = price2num($value,'MT'); $amounts[$key] = -$newvalue; } - + foreach ($multicurrency_amounts as $key => $value) // How payment is dispatch { $newvalue = price2num($value,'MT'); @@ -319,7 +319,7 @@ llxHeader('', $langs->trans("Payment")); if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement') { $facture = new Facture($db); - $result=$facture->fetch($facid); + $result = $facture->fetch($facid); if ($result >= 0) { @@ -389,7 +389,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { subJson[n["name"]] = n["value"]; }); - + return subJson; } function callForResult(imgId) @@ -516,31 +516,31 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; - + print '
'.$langs->trans('Comments').''; print '
'; dol_fiche_end(); - + /* * List of unpaid invoices */ - + $sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type, '; $sql.= ' f.datef as df, f.fk_soc as socid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; - + if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS)) { $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON (f.fk_soc = s.rowid)'; } - + $sql.= ' WHERE f.entity = '.$conf->entity; $sql.= ' AND (f.fk_soc = '.$facture->socid; - + if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS) && !empty($facture->thirdparty->parent)) { $sql.= ' OR f.fk_soc IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'societe WHERE parent = '.$facture->thirdparty->parent.')'; } - + $sql.= ') AND f.paye = 0'; $sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled if ($facture->type != 2) @@ -577,7 +577,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie //print ''; print '
'; print ''; - + print ''; print ''; print ''; @@ -585,11 +585,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (!empty($conf->multicurrency->enabled)) print ''; if (!empty($conf->multicurrency->enabled)) print ''; if (!empty($conf->multicurrency->enabled)) print ''; + if (!empty($conf->multicurrency->enabled)) print ''; print ''; print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) print ''; print ''; print "\n"; @@ -602,7 +602,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie while ($i < $num) { $objp = $db->fetch_object($resql); - + $soc = new Societe($db); $soc->fetch($objp->socid); @@ -614,9 +614,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $deposits=$invoice->getSumDepositsUsed(); $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); - + // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) + if (!empty($conf->multicurrency->enabled)) { $multicurrency_payment = $invoice->getSommePaiement(1); $multicurrency_creditnotes=$invoice->getSumCreditNotesUsed(1); @@ -624,7 +624,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $multicurrency_alreadypayed=price2num($multicurrency_payment + $multicurrency_creditnotes + $multicurrency_deposits,'MT'); $multicurrency_remaintopay=price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits,'MT'); } - + print ''; print '\n"; - + // Currency if (!empty($conf->multicurrency->enabled)) print '\n"; - + // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) + if (!empty($conf->multicurrency->enabled)) { print ''; - + // Multicurrency Price print ''; - + // Multicurrency Price print ''; + + print '"; } - + // Price print ''; - + // Received or paid back print '"; - // Multicurrency Price - if (! empty($conf->multicurrency->enabled)) - { - print '"; - } - // Warning - print ''; if (!empty($conf->multicurrency->enabled)) print ''; if (!empty($conf->multicurrency->enabled)) print ''; + if (!empty($conf->multicurrency->enabled)) print ''; print ''; print ''; print ''; - print ''; - if (!empty($conf->multicurrency->enabled)) print ''; + print ''; // Autofilled print ''; print "\n"; } @@ -802,9 +798,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; if (!empty($totalpayment)) $text=$langs->trans('ConfirmCustomerPayment',$totalpayment,$langs->trans("Currency".$conf->currency)); - if (!empty($multicurrency_totalpayment)) + if (!empty($multicurrency_totalpayment)) { - $text.='
'.$langs->trans('ConfirmCustomerPayment',$multicurrency_totalpayment,$langs->trans("paymentInInvoiceCurrency")); + $text.='
'.$langs->trans('ConfirmCustomerPayment',$multicurrency_totalpayment,$langs->trans("paymentInInvoiceCurrency")); } if (GETPOST('closepaidinvoices')) { @@ -854,17 +850,17 @@ if (! GETPOST('action','aZ09')) print_barre_liste($langs->trans('Payments'), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num); print '
'.$arraytitle.''.$langs->trans('Date').''.$langs->trans('MulticurrencyAmountTTC').''.$multicurrencyalreadypayedlabel.''.$multicurrencyremaindertopay.''.$langs->trans('MulticurrencyPaymentAmount').''.$langs->trans('AmountTTC').''.$alreadypayedlabel.''.$remaindertopay.''.$langs->trans('PaymentAmount').''.$langs->trans('MulticurrencyPaymentAmount').' 
'; @@ -634,36 +634,59 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Date print ''.dol_print_date($db->jdate($objp->df),'day')."'.$objp->multicurrency_code."'; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $objp->multicurrency_total_ttc); print ''; - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { print price($sign * $multicurrency_payment); if ($multicurrency_creditnotes) print '+'.price($multicurrency_creditnotes); if ($multicurrency_deposits) print '+'.price($multicurrency_deposits); } print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay); print ''; + + // Add remind multicurrency amount + $namef = 'multicurrency_amount_'.$objp->facid; + $nameRemain = 'multicurrency_remain_'.$objp->facid; + + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) + { + if ($action != 'add_paiement') + { + if (!empty($conf->use_javascript_ajax)) + print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); + print ''; + print ''; + } + else + { + print ''; + print ''; + } + } + print "'.price($sign * $objp->total_ttc).''.price($sign * $paiement); if ($creditnotes) print '+'.price($creditnotes); @@ -685,7 +708,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { if (!empty($conf->use_javascript_ajax)) print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'"); - print ''; + print ''; print ''; } else @@ -695,35 +718,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print "'; - - // Add remind multicurrency amount - $namef = 'multicurrency_amount_'.$objp->facid; - $nameRemain = 'multicurrency_remain_'.$objp->facid; - - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) - { - if ($action != 'add_paiement') - { - if (!empty($conf->use_javascript_ajax)) - print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); - print ''; - print ''; - } - else - { - print ''; - print ''; - } - } - print "'; + print ''; //print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."
"; if ($amounts[$invoice->id] && (abs($amounts[$invoice->id]) > abs($amountsresttopay[$invoice->id])) || $multicurrency_amounts[$invoice->id] && (abs($multicurrency_amounts[$invoice->id]) > abs($multicurrency_amountsresttopay[$invoice->id]))) @@ -744,7 +740,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $totalrecudeposits+=$deposits; $i++; } - + if ($i > 1) { // Print total @@ -754,14 +750,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (!empty($conf->multicurrency->enabled)) print '
'.price($sign * $total_ttc).''.price($sign * $totalrecu); if ($totalrecucreditnote) print '+'.price($totalrecucreditnote); if ($totalrecudeposits) print '+'.price($totalrecudeposits); print ''.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).' 
'; print ''; - print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'facnumber','','','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder); + print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'facnumber','','','',$sortfield,$sortorder); + print_liste_field_titre('Date',$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder); + print_liste_field_titre('Type',$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder); + print_liste_field_titre('Amount',$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - + print ''; print '\n"; print '\n"; diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php index 0fe627cf7ac..370fbdfdd05 100644 --- a/htdocs/compta/paiement/avalider.php +++ b/htdocs/compta/paiement/avalider.php @@ -101,17 +101,17 @@ if ($resql) print '
'.$objp->facnumber."'.dol_print_date($db->jdate($objp->dp))."
'; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.rowid","","",'width="60"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","","",'width="80" align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"c.libelle","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"p.rowid","","",'width="60"',$sortfield,$sortorder); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"dp","","",'width="80" align="center"',$sortfield,$sortorder); + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.libelle","","","",$sortfield,$sortorder); + print_liste_field_titre("AmountTTC",$_SERVER["PHP_SELF"],"c.libelle","","",'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - + print ''; print ''; print '\n"; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index b5767a6f0bc..01787ca3372 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -373,7 +373,7 @@ if ($action == 'new') { $paymentstatic=new Paiement($db); $accountlinestatic=new AccountLine($db); - + $lines = array(); $now=dol_now(); @@ -474,7 +474,7 @@ if ($action == 'new') $moreforfilter=''; print '
'; print '
'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."
'."\n"; - + print ''; print ''."\n"; print '\n"; @@ -529,18 +529,18 @@ if ($action == 'new') print ' '; } print ''; - + print '' ; print ''; - + $i++; } } print "
'.$langs->trans("DateChequeReceived").''.$langs->trans("ChequeNumber")."'; print ''; print '
"; print '
'; - + print '
'; if ($user->rights->banque->cheque) { @@ -563,15 +563,15 @@ else $accountstatic->fetch($object->account_id); $linkback=''.$langs->trans("BackToList").''; - + $morehtmlref=''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
'; print '
'; - + print ''; print ''; print ''; */ - + print ''; @@ -648,7 +648,7 @@ else print ''; - + // List of cheques $sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,"; $sql.= " b.dateo as date, b.datec as datec, b.banque,"; @@ -670,16 +670,16 @@ else print '
'; @@ -626,7 +626,7 @@ else print '
'.$langs->trans('Account').''; print $accountstatic->getNomUrl(1); print '
'; $param="&id=".$object->id; - + print ''; - print_liste_field_titre($langs->trans("Cheques"),'','','','','width="30"'); - print_liste_field_titre($langs->trans("DateChequeReceived"),$_SERVER["PHP_SELF"],"b.dateo,b.rowid", "",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"b.num_chq", "",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CheckTransmitter"),$_SERVER["PHP_SELF"],"b.emetteur", "",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Bank"),$_SERVER["PHP_SELF"],"b.banque", "",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Payment"),$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Cheques",'','','','','width="30"'); + print_liste_field_titre("DateChequeReceived",$_SERVER["PHP_SELF"],"b.dateo,b.rowid", "",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Numero",$_SERVER["PHP_SELF"],"b.num_chq", "",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("CheckTransmitter",$_SERVER["PHP_SELF"],"b.emetteur", "",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Bank",$_SERVER["PHP_SELF"],"b.banque", "",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Payment",$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("LineRecord",$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; $i=1; @@ -692,7 +692,7 @@ else if (! isset($accounts[$objp->bid])) $accounts[$objp->bid]=0; $accounts[$objp->bid] += 1; - + print ''; print ''; print ''; // Date operation @@ -735,13 +735,13 @@ else { print 'rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').''; } - if ($objp->statut == 2) + if ($objp->statut == 2) { print '   '.img_picto($langs->trans('CheckRejected'),'statut8').''; } print ''; print ''; - + $i++; } } @@ -751,7 +751,7 @@ else print $langs->trans("None"); print ''; } - + print "
'.$i.''.dol_print_date($db->jdate($objp->date),'day').'
"; print "
"; } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 20afa14e0ca..808d2cbb00b 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -861,7 +861,7 @@ class RemiseCheque extends CommonObject if ($user->rights->banque->cheque) { $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql.= " SET date_bordereau = ".($date ? $this->db->idate($date) : 'null'); + $sql.= " SET date_bordereau = ".($date ? "'".$this->db->idate($date)."'" : 'null'); $sql.= " WHERE rowid = ".$this->id; dol_syslog("RemiseCheque::set_date", LOG_DEBUG); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index aeed72d93d1..d08b6c734cc 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -68,7 +68,7 @@ $accountstatic=new Account($db); */ // If click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_ref=''; $search_amount=''; @@ -172,12 +172,12 @@ if ($resql) print "\n"; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bc.ref","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("NbOfCheques"),$_SERVER["PHP_SELF"],"bc.nbcheque","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"bc.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"bc.statut","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"bc.ref","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("NbOfCheques",$_SERVER["PHP_SELF"],"bc.nbcheque","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"bc.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"bc.statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index d6031ae1685..b089cac6aab 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -42,7 +42,7 @@ class Cpaiement /** */ - + public $code; public $libelle; public $type; @@ -52,7 +52,7 @@ class Cpaiement /** */ - + /** * Constructor @@ -79,7 +79,7 @@ class Cpaiement $error = 0; // Clean parameters - + if (isset($this->code)) { $this->code = trim($this->code); } @@ -99,14 +99,14 @@ class Cpaiement $this->module = trim($this->module); } - + // Check parameters // Put here code to add control on parameters values // Insert request $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '('; - + $sql.= 'id,'; $sql.= 'code,'; $sql.= 'libelle,'; @@ -115,9 +115,9 @@ class Cpaiement $sql.= 'accountancy_code,'; $sql.= 'module'; - + $sql .= ') VALUES ('; - + $sql .= ' '.(! isset($this->id)?'NULL':$this->id).','; $sql .= ' '.(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").','; $sql .= ' '.(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").','; @@ -126,7 +126,7 @@ class Cpaiement $sql .= ' '.(! isset($this->accountancy_code)?'NULL':"'".$this->db->escape($this->accountancy_code)."'").','; $sql .= ' '.(! isset($this->module)?'NULL':"'".$this->db->escape($this->module)."'"); - + $sql .= ')'; $this->db->begin(); @@ -198,7 +198,7 @@ class Cpaiement $obj = $this->db->fetch_object($resql); $this->id = $obj->id; - + $this->code = $obj->code; $this->libelle = $obj->libelle; $this->type = $obj->type; @@ -206,7 +206,7 @@ class Cpaiement $this->accountancy_code = $obj->accountancy_code; $this->module = $obj->module; - + } $this->db->free($resql); @@ -238,7 +238,7 @@ class Cpaiement dol_syslog(__METHOD__, LOG_DEBUG); // Clean parameters - + if (isset($this->code)) { $this->code = trim($this->code); } @@ -258,7 +258,7 @@ class Cpaiement $this->module = trim($this->module); } - + // Check parameters // Put here code to add a control on parameters values @@ -356,8 +356,8 @@ class Cpaiement return 1; } } - - + + /** * Initialise object with example values * Id must be 0 if object instance is a specimen @@ -367,7 +367,7 @@ class Cpaiement public function initAsSpecimen() { $this->id = 0; - + $this->code = ''; $this->libelle = ''; $this->type = ''; @@ -375,7 +375,7 @@ class Cpaiement $this->accountancy_code = ''; $this->module = ''; - + } } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index f4e61380a9c..8e67825c085 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -337,6 +337,24 @@ class Paiement extends CommonObject $error++; } } + } + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $ret = $invoice->fetch($id); // Reload to get new records + + $result = $invoice->generateDocument($invoice->modelpdf, $outputlangs); + if ($result < 0) { + setEventMessages($invoice->error, $invoice->errors, 'errors'); + $error++; + } + } } } diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index ec2bbc78fc6..dd03cb86df9 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -3,8 +3,9 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,14 +32,15 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; $langs->load("bills"); $langs->load("compta"); // Security check -$facid =GETPOST('facid','int'); -$socid =GETPOST('socid','int'); -$userid=GETPOST('userid','int'); +$facid = GETPOST('facid','int'); +$socid = GETPOST('socid','int'); +$userid = GETPOST('userid','int'); $day = GETPOST('day','int'); $month = GETPOST('month','int'); $year = GETPOST('year','int'); @@ -77,7 +79,7 @@ $extrafields = new ExtraFields($db); * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { $search_ref=""; $search_account=""; @@ -129,7 +131,7 @@ else $sql = "SELECT DISTINCT p.rowid, p.ref, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives $sql.= " p.statut, p.num_paiement,"; $sql.= " c.code as paiement_code,"; - $sql.= " ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.accountancy_journal as accountancy_journal,"; + $sql.= " ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal,"; $sql.= " s.rowid as socid, s.nom as name"; // Add fields for extrafields foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; @@ -177,7 +179,7 @@ else if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'"; if ($search_payment_num != '') $sql .= natural_search('p.num_paiement', $search_payment_num); - if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1); + if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1); if ($search_company) $sql .= natural_search('s.nom', $search_company); // Add where from hooks $parameters=array(); @@ -211,7 +213,7 @@ if ($resql) $param.=($search_amount?"&search_amount=".urlencode($search_amount):""); $param.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):""); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - + print ''; if ($optioncss != '') print ''; print ''; @@ -220,9 +222,9 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords,'title_accountancy.png', 0, '', '', $limit); - + print '
'; print ''."\n"; @@ -266,26 +268,26 @@ if ($resql) print "\n"; print ''; - print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"p.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"p.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.libelle","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Numero",$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder); if (! empty($conf->banque->enabled)) { - print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); } - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder); - + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder); + //print_liste_field_titre("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder); + $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - - if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'align="right"',$sortfield,$sortorder); + + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"p.statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); @@ -314,7 +316,7 @@ if ($resql) // Type print ''; - + // Payment number print ''; @@ -329,7 +331,11 @@ if ($resql) $accountstatic->label=$objp->blabel; $accountstatic->number=$objp->number; $accountstatic->account_number=$objp->account_number; - $accountstatic->accountancy_journal=$objp->accountancy_journal; + + $accountingjournal = new AccountingJournal($db); + $accountingjournal->fetch($objp->accountancy_journal); + $accountstatic->accountancy_journal = $accountingjournal->code; + print $accountstatic->getNomUrl(1); } else print ' '; diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index a185f0aba6e..3e6427f6ac2 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -56,10 +56,10 @@ if ($action == 'builddoc') $rap = new pdf_paiement($db); $outputlangs = $langs; - if (GETPOST('lang_id')) + if (GETPOST('lang_id','aZ09')) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang(GETPOST('lang_id')); + $outputlangs->setDefaultLang(GETPOST('lang_id','aZ09')); } // We save charset_output to restore it because write_file can change it if needed for diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 9a5585c2513..2a91ae13bfc 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -57,7 +57,7 @@ $search_ref = GETPOST('search_ref','alpha'); * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_ref=""; } @@ -125,9 +125,9 @@ if ($result) print ''; print ''; - print_liste_field_titre($langs->trans("WithdrawalsReceipts"),$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"'); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"p.datec","","",'class="liste_titre" align="center"'); - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"","","",'align="center"'); + print_liste_field_titre("WithdrawalsReceipts",$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"'); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"p.datec","","",'class="liste_titre" align="center"'); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"","","",'align="center"'); print "\n"; while ($i < min($num,$limit)) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 1a0435862ea..20d7b0232e9 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -308,9 +308,9 @@ if ($id > 0) print"\n\n"; print '
'.$langs->trans("PaymentTypeShort".$objp->paiement_code).''.$objp->num_paiement.'
'; print ''; - print_liste_field_titre($langs->trans("Lines"),$_SERVER["PHP_SELF"],"pl.rowid",'',$urladd); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd); - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","",$urladd,'align="right"'); + print_liste_field_titre("Lines",$_SERVER["PHP_SELF"],"pl.rowid",'',$urladd); + print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",'',$urladd); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"pl.amount","",$urladd,'align="right"'); print_liste_field_titre(''); print "\n"; @@ -354,7 +354,7 @@ if ($id > 0) print ''; $total += $obj->amount; - + $i++; } diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index dd453bd7f4e..04ec746d7f6 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -106,14 +106,14 @@ if ($resql) } print ''; - + print '
'; print ''; - print_liste_field_titre($langs->trans("Bill"), $_SERVER["PHP_SELF"]); - print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"]); - print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "", "", $param, 'align="right"'); - print_liste_field_titre($langs->trans("DateRequest"), $_SERVER["PHP_SELF"], "", "", $param, 'align="center"'); + print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]); + print_liste_field_titre("Company", $_SERVER["PHP_SELF"]); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"'); + print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"'); print_liste_field_titre(''); print ''; @@ -136,7 +136,7 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - + print ''; // Ref facture @@ -157,7 +157,7 @@ if ($resql) print ''; print ''; - + print ''; $i++; } diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 996a1aabe88..437af529ad9 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -171,16 +171,16 @@ if ($result) print ''; $massactionbutton=''; - + print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit); - + print"\n\n"; print '
'.dol_print_date($db->jdate($obj->date_demande),'day').'
'; print ''; - print_liste_field_titre($langs->trans("Bill"),$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("StatusDebitCredit"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder); + print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("StatusDebitCredit",$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; @@ -194,12 +194,12 @@ if ($result) $invoicetmp->id = $obj->facid; $invoicetmp->ref = $obj->ref; - + $thirdpartytmp->id = $obj->socid; $thirdpartytmp->name = $obj->name; - + print ''; - + print "\n"; @@ -228,13 +228,13 @@ if ($result) } print ""; - + print ""; - + print "\n"; $total += $obj->total_ttc; - + $i++; } diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 933c23b0e7e..20ac3d18082 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -251,7 +251,7 @@ if ($id) - if ($page == -1) { $page = 0 ; } + if ($page == -1 || $page == null) { $page = 0 ; } $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 208be88aeae..245903101cf 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -65,7 +65,7 @@ $ligne=new LignePrelevement($db,$user); * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_line=""; $search_bon=""; @@ -149,13 +149,13 @@ if ($result) print ''; print ''; - print_liste_field_titre($langs->trans("Line"),$_SERVER["PHP_SELF"]); - print_liste_field_titre($langs->trans("WithdrawalsReceipts"),$_SERVER["PHP_SELF"],"p.ref"); - print_liste_field_titre($langs->trans("Bill"),$_SERVER["PHP_SELF"],"f.facnumber",'',$urladd); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom"); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client",'','','align="center"'); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"p.datec","","",'align="center"'); - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","","",'align="right"'); + print_liste_field_titre("Line",$_SERVER["PHP_SELF"]); + print_liste_field_titre("WithdrawalsReceipts",$_SERVER["PHP_SELF"],"p.ref"); + print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"f.facnumber",'',$urladd); + print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom"); + print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client",'','','align="center"'); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"p.datec","","",'align="center"'); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"pl.amount","","",'align="right"'); print_liste_field_titre(''); print "\n"; diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 0f737a50f22..3c18207f451 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -89,9 +89,9 @@ if ($result) print"\n\n"; print '
"; print $invoicetmp->getNomUrl(1); print "
'; print ''; - print_liste_field_titre($langs->trans("Line"),$_SERVER["PHP_SELF"],"p.ref",'',$urladd); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd); - print_liste_field_titre($langs->trans("Reason"),$_SERVER["PHP_SELF"],"pr.motif","",$urladd); + print_liste_field_titre("Line",$_SERVER["PHP_SELF"],"p.ref",'',$urladd); + print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",'',$urladd); + print_liste_field_titre("Reason",$_SERVER["PHP_SELF"],"pr.motif","",$urladd); print "\n"; $total = 0; @@ -110,7 +110,7 @@ if ($result) print ''; print "\n"; - + $i++; } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 62ee285d70b..8b67cf318c7 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Dourseanud @@ -23,8 +23,9 @@ */ /** - * \file htdocs/compta/resultat/clientfourn.php - * \brief Page reporting + * \file htdocs/compta/resultat/clientfourn.php + * \ingroup compta, accountancy + * \brief Page reporting */ require '../../main.inc.php'; @@ -33,18 +34,17 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; +$langs->loadLangs(array('compta','bills','donation','salaries','accountancy')); -$langs->load("bills"); -$langs->load("donation"); -$langs->load("salaries"); - -$date_startmonth=GETPOST('date_startmonth'); -$date_startday=GETPOST('date_startday'); -$date_startyear=GETPOST('date_startyear'); -$date_endmonth=GETPOST('date_endmonth'); -$date_endday=GETPOST('date_endday'); -$date_endyear=GETPOST('date_endyear'); +$date_startmonth=GETPOST('date_startmonth','int'); +$date_startday=GETPOST('date_startday','int'); +$date_startyear=GETPOST('date_startyear','int'); +$date_endmonth=GETPOST('date_endmonth','int'); +$date_endday=GETPOST('date_endday','int'); +$date_endyear=GETPOST('date_endyear','int'); +$showaccountdetail = GETPOST('showaccountdetail','aZ09')?GETPOST('showaccountdetail','aZ09'):'no'; // Security check $socid = GETPOST('socid','int'); @@ -60,11 +60,11 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortfield) $sortfield='s.nom, s.rowid'; +//if (! $sortfield) $sortfield='s.nom, s.rowid'; if (! $sortorder) $sortorder='ASC'; // Date range -$year=GETPOST("year"); +$year=GETPOST('year','int'); if (empty($year)) { $year_current = strftime("%Y",dol_now()); @@ -77,7 +77,8 @@ if (empty($year)) } $date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); $date_end=dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); -// Quarter + +// We define date_start and date_end if (empty($date_start) || empty($date_end)) // We define date_start and date_end { $q=GETPOST("q")?GETPOST("q"):0; @@ -105,25 +106,47 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } -else -{ - // TODO We define q -} +// $date_start and $date_end are defined. We force $start_year and $nbofyear +$tmps=dol_getdate($date_start); +$start_year = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $start_year) + 1; +//var_dump($start_year." ".$end_year." ".$nbofyear); + +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') +$modecompta = $conf->global->ACCOUNTING_MODE; +if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; +if (GETPOST("modecompta",'alpha')) $modecompta=GETPOST("modecompta",'alpha'); + +$AccCat = new AccountancyCategory($db); -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') -$modecompta=(GETPOST("modecompta")?GETPOST("modecompta"):$conf->global->ACCOUNTING_MODE); /* * View */ +$months = array( + $langs->trans("JanuaryMin"), + $langs->trans("FebruaryMin"), + $langs->trans("MarchMin"), + $langs->trans("AprilMin"), + $langs->trans("MayMin"), + $langs->trans("JuneMin"), + $langs->trans("JulyMin"), + $langs->trans("AugustMin"), + $langs->trans("SeptemberMin"), + $langs->trans("OctoberMin"), + $langs->trans("NovemberMin"), + $langs->trans("DecemberMin"), +); + llxHeader(); $form=new Form($db); -$nomlink=''; $periodlink=''; $exportlink=''; @@ -133,34 +156,53 @@ $total_ttc=0; // Affiche en-tete de rapport if ($modecompta=="CREANCES-DETTES") { - $name=$langs->trans("AnnualByCompaniesDueDebtMode"); + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups"); $calcmode=$langs->trans("CalcModeDebt"); - $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink=''.img_previous().' '.img_next().''; + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesResultDue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else { - $name=$langs->trans("AnnualByCompaniesInputOutputMode"); +elseif ($modecompta=="RECETTES-DEPENSES") +{ + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups"); $calcmode=$langs->trans("CalcModeEngagement"); - $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink=''.img_previous().' '.img_next().''; + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesResultInOut"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } +elseif ($modecompta=="BOOKKEEPING") +{ + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups"); + $calcmode=$langs->trans("CalcModeBookkeeping"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $arraylist=array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All")); + $period.='     '.$langs->trans("DetailByAccount").' '. $form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0); + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $description=$langs->trans("RulesResultBookkeepingPredefined"); + $description.=' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("Chartofaccounts")).')'; + $builddate=dol_now(); + //$exportlink=$langs->trans("NotYetAvailable"); +} $hselected = 'report'; -report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -176,452 +218,316 @@ if ($date_endyear) $param.='&date_endyear='.$date_startyear; print '
'.$rej->motifs[$obj->motif].'
'; print ''; +print_liste_field_titre("PredefinedGroups", $_SERVER["PHP_SELF"], 's.nom, s.rowid','',$param,'',$sortfield,$sortorder,'width200 '); print_liste_field_titre(''); -print_liste_field_titre($langs->trans("Name"), $_SERVER["PHP_SELF"],'s.nom, s.rowid','',$param,'',$sortfield,$sortorder); -if ($modecompta == 'CREANCES-DETTES') +if ($modecompta == 'BOOKKEEPING') { - print_liste_field_titre($langs->trans("AmountHT"), $_SERVER["PHP_SELF"],'amount_ht','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"],'amount','',$param,'align="right"',$sortfield,$sortorder); +} +else +{ + if ($modecompta == 'CREANCES-DETTES') + { + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"],'amount_ht','',$param,'align="right"',$sortfield,$sortorder); + } + print_liste_field_titre("AmountTTC", $_SERVER["PHP_SELF"],'amount_ttc','',$param,'align="right"',$sortfield,$sortorder); } -print_liste_field_titre($langs->trans("AmountTTC"), $_SERVER["PHP_SELF"],'amount_ttc','',$param,'align="right"',$sortfield,$sortorder); print "\n"; -/* - * Factures clients - */ -print ''; -if ($modecompta == 'CREANCES-DETTES') + +if ($modecompta == 'BOOKKEEPING') { - $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - $sql.= " AND f.type IN (0,1,2,5)"; - else - $sql.= " AND f.type IN (0,1,2,3,5)"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; -} -else -{ - /* - * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les - * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) - */ - $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; - $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " WHERE p.rowid = pf.fk_paiement"; - $sql.= " AND pf.fk_facture = f.rowid"; - $sql.= " AND f.fk_soc = s.rowid"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; -} -$sql.= " AND f.entity = ".$conf->entity; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql.= " GROUP BY s.nom, s.rowid"; -$sql.= $db->order($sortfield, $sortorder); + $predefinedgroupwhere = "("; + //$predefinedgroupwhere.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))"; + $predefinedgroupwhere.= " (pcg_type = 'EXPENSE')"; + $predefinedgroupwhere.= " OR "; + //$predefinedgroupwhere.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))"; + $predefinedgroupwhere.= " (pcg_type = 'INCOME')"; + $predefinedgroupwhere.= ")"; -dol_syslog("get customer invoices", LOG_DEBUG); -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $i = 0; - while ($i < $num) - { - $objp = $db->fetch_object($result); - - print ''; - print "\n"; + $charofaccountstring = $conf->global->CHARTOFACCOUNTS; + $charofaccountstring=dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); - if ($modecompta == 'CREANCES-DETTES') - print "\n"; - print "\n"; - - $total_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); - $total_ttc += $objp->amount_ttc; - print "\n"; - $i++; - } - $db->free($result); -} else { - dol_print_error($db); -} - -// On ajoute les paiements clients anciennes version, non lie par paiement_facture -if ($modecompta != 'CREANCES-DETTES') -{ - $sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; - $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; - $sql.= " WHERE pf.rowid IS NULL"; - $sql.= " AND p.fk_bank = b.rowid"; - $sql.= " AND b.fk_account = ba.rowid"; - $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - $sql.= " GROUP BY name, idp"; - $sql.= " ORDER BY name"; - - dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG); - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) - { - $objp = $db->fetch_object($result); - - - print ''; - print "\n"; - print "\n"; - - $total_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); - $total_ttc += $objp->amount_ttc; - - print "\n"; - $i++; - } - } - $db->free($result); - } else { - dol_print_error($db); - } -} - -if ($total_ttc == 0) -{ - print ''; - print ''; - print ''; -} - -print ''; -if ($modecompta == 'CREANCES-DETTES') - print ''; -print ''; -print ''; - - -/* - * Suppliers invoices - */ -if ($modecompta == 'CREANCES-DETTES') -{ - $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - $sql.= " AND f.type IN (0,1,2)"; - else - $sql.= " AND f.type IN (0,1,2,3)"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; -} -else -{ - $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; - $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " ON pf.fk_facturefourn = f.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s"; - $sql.= " ON f.fk_soc = s.rowid"; - $sql.= " WHERE p.rowid = pf.fk_paiementfourn "; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; -} -$sql.= " AND f.entity = ".$conf->entity; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql .= " GROUP BY s.nom, s.rowid"; -$sql.= $db->order($sortfield, $sortorder); - -print ''; - -$subtotal_ht = 0; -$subtotal_ttc = 0; -dol_syslog("get suppliers invoices", LOG_DEBUG); -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num > 0) - { - while ($i < $num) - { - $objp = $db->fetch_object($result); - - print ''; - print "\n"; - - if ($modecompta == 'CREANCES-DETTES') - print "\n"; - print "\n"; - - $total_ht -= (isset($objp->amount_ht)?$objp->amount_ht:0); - $total_ttc -= $objp->amount_ttc; - $subtotal_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); - $subtotal_ttc += $objp->amount_ttc; - - print "\n"; - $i++; - } - } - else - { - print ''; - print ''; - print ''; - } - - $db->free($result); -} else { - dol_print_error($db); -} -print ''; -if ($modecompta == 'CREANCES-DETTES') - print ''; -print ''; -print ''; - - - -/* - * Charges sociales non deductibles - */ - -print ''; - -if ($modecompta == 'CREANCES-DETTES') -{ - $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; -} -else -{ - $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; -} -$sql.= " AND cs.entity = ".$conf->entity; -$sql.= " GROUP BY c.libelle, c.id"; -$newsortfield = $sortfield; -if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id'; -if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; -if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; -$sql.= $db->order($newsortfield, $sortorder); - -dol_syslog("get social contributions deductible=0", LOG_DEBUG); -$result=$db->query($sql); -$subtotal_ht = 0; -$subtotal_ttc = 0; -if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - $total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; - - print ''; - print ''; - if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; - print ''; - $i++; - } - } - else { - print ''; - print ''; - print ''; - } -} else { - dol_print_error($db); -} -print ''; -if ($modecompta == 'CREANCES-DETTES') - print ''; -print ''; -print ''; - - -/* - * Charges sociales deductibles - */ - -print ''; - -if ($modecompta == 'CREANCES-DETTES') -{ - $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - $sql.= " AND cs.entity = ".$conf->entity; -} -else -{ - $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - $sql.= " AND cs.entity = ".$conf->entity; -} -$sql.= " GROUP BY c.libelle, c.id"; -$newsortfield = $sortfield; -if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id'; -if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; -if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; -$sql.= $db->order($newsortfield, $sortorder); - -dol_syslog("get social contributions deductible=1", LOG_DEBUG); -$result=$db->query($sql); -$subtotal_ht = 0; -$subtotal_ttc = 0; -if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - $total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; - - print ''; - print ''; - if ($modecompta == 'CREANCES-DETTES') - print ''; - print ''; - print ''; - $i++; - } - } - else { - print ''; - print ''; - print ''; - } -} else { - dol_print_error($db); -} -print ''; -if ($modecompta == 'CREANCES-DETTES') - print ''; -print ''; -print ''; - -if ($mysoc->tva_assuj == 'franchise') // Non assujetti -{ - // Total - print ''; - print ''; - print ''; - - print ''; - if ($modecompta == 'CREANCES-DETTES') - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; -} - - -/* - * Salaries - */ - -if (! empty($conf->salaries->enabled)) -{ - if ($modecompta == 'CREANCES-DETTES') { - $column = 'p.datev'; - } else { - $column = 'p.datep'; - } - - print ''; - $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; - $sql.= " WHERE p.entity = ".$conf->entity; + $sql = "SELECT f.thirdparty_code as name, -1 as socid, aa.pcg_type, aa.pcg_subtype, sum(f.credit - f.debit) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as f"; + $sql.= ", ".MAIN_DB_PREFIX."accounting_account as aa"; + $sql.= " WHERE f.numero_compte = aa.account_number"; + //$sql.= " AND fk_statut in (1,2)"; + $sql.= " AND ".$predefinedgroupwhere; + $sql.= " AND aa.fk_pcg_version = '".$charofaccountstring."'"; if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + $sql.= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY pcg_type, pcg_subtype, name, socid"; + $sql.= $db->order($sortfield, $sortorder); - $sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'u.firstname, u.lastname'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get payment salaries"); - $result=$db->query($sql); - $subtotal_ht = 0; - $subtotal_ttc = 0; - if ($result) + $oldpcgtype = ''; + $oldpcgsubtype = ''; + + dol_syslog("get bookkeeping entries", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num > 0) + { + while ($i < $num) + { + $objp = $db->fetch_object($result); + + if ($objp->pcg_type != $oldpcgtype) + { + print ''; + $oldpcgtype = $objp->pcg_type; + } + + print ''; + print ''; + print '\n"; + print '\n"; + print "\n"; + + $total_ht += (isset($objp->amount)?$objp->amount:0); + $total_ttc += (isset($objp->amount)?$objp->amount:0); + + // Loop on detail of all accounts + // This make 14 calls for each detail of account (NP, N and month m) + if ($showaccountdetail != 'no') + { + $tmppredefinedgroupwhere="pcg_type = '".$db->escape($objp->pcg_type)."' AND pcg_subtype = '".$db->escape($objp->pcg_subtype)."'"; + $tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$charofaccountstring."'"; + //$tmppredefinedgroupwhere.= " AND thirdparty_code = '".$db->escape($objp->name)."'"; + + // Get cpts of category/group + $cpts = $AccCat->getCptsCat(0, $tmppredefinedgroupwhere); + + foreach($cpts as $i => $cpt) + { + $return = $AccCat->getResult($cpt['account_number'], 0, $date_start, $date_end, $cpt['dc']); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultN=0; + } else { + $resultN=$AccCat->sdc; + } + + + if ($showaccountdetail == 'all' || $resultN > 0) + { + print ''; + print ''; + print ''; + print ''; + print "\n"; + } + } + } + + $i++; + } + } + else + { + print ''; + } + } + else dol_print_error($db); +} +else +{ + /* + * Factures clients + */ + print ''; + + if ($modecompta == 'CREANCES-DETTES') { + $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $sql.= " AND f.type IN (0,1,2,5)"; + else + $sql.= " AND f.type IN (0,1,2,3,5)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + elseif ($modecompta == 'RECETTES-DEPENSES') + { + /* + * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les + * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) + */ + $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; + $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " WHERE p.rowid = pf.fk_paiement"; + $sql.= " AND pf.fk_facture = f.rowid"; + $sql.= " AND f.fk_soc = s.rowid"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql.= " AND f.fk_soc = ".$socid; + $sql.= " GROUP BY name, socid"; + $sql.= $db->order($sortfield, $sortorder); + + dol_syslog("get customer invoices", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { $num = $db->num_rows($result); $i = 0; - if ($num) + while ($i < $num) + { + $objp = $db->fetch_object($result); + + print ''; + print "\n"; + + if ($modecompta == 'CREANCES-DETTES') + print "\n"; + print "\n"; + + $total_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); + $total_ttc += $objp->amount_ttc; + print "\n"; + $i++; + } + $db->free($result); + } else { + dol_print_error($db); + } + + // On ajoute les paiements clients anciennes version, non lie par paiement_facture + if ($modecompta == 'RECETTES-DEPENSES') + { + $sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; + $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; + $sql.= " WHERE pf.rowid IS NULL"; + $sql.= " AND p.fk_bank = b.rowid"; + $sql.= " AND b.fk_account = ba.rowid"; + $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY name, idp"; + $sql.= " ORDER BY name"; + + dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num) { + while ($i < $num) + { + $objp = $db->fetch_object($result); + + + print ''; + print "\n"; + print "\n"; + + $total_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); + $total_ttc += $objp->amount_ttc; + + print "\n"; + $i++; + } + } + $db->free($result); + } else { + dol_print_error($db); + } + } + + if ($total_ttc == 0) + { + print ''; + print ''; + print ''; + } + + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + + + /* + * Suppliers invoices + */ + if ($modecompta == 'CREANCES-DETTES') + { + $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $sql.= " AND f.type IN (0,1,2)"; + else + $sql.= " AND f.type IN (0,1,2,3)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + elseif ($modecompta == 'RECETTES-DEPENSES') + { + $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; + $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " ON pf.fk_facturefourn = f.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s"; + $sql.= " ON f.fk_soc = s.rowid"; + $sql.= " WHERE p.rowid = pf.fk_paiementfourn "; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql.= " AND f.fk_soc = ".$socid; + $sql .= " GROUP BY name, socid"; + $sql.= $db->order($sortfield, $sortorder); + + print ''; + + $subtotal_ht = 0; + $subtotal_ttc = 0; + dol_syslog("get suppliers invoices", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num > 0) { while ($i < $num) { - $obj = $db->fetch_object($result); - - $total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; + $objp = $db->fetch_object($result); print ''; + print "\n"; - print "\n"; + if ($modecompta == 'CREANCES-DETTES') + print "\n"; + print "\n"; - if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; - print ''; + $total_ht -= (isset($objp->amount_ht)?$objp->amount_ht:0); + $total_ttc -= $objp->amount_ttc; + $subtotal_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); + $subtotal_ttc += $objp->amount_ttc; + + print "\n"; $i++; } } @@ -631,9 +537,9 @@ if (! empty($conf->salaries->enabled)) print ''; print ''; } - } - else - { + + $db->free($result); + } else { dol_print_error($db); } print ''; @@ -641,377 +547,638 @@ if (! empty($conf->salaries->enabled)) print ''; print ''; print ''; -} -/* - * Expense - */ -if (! empty($conf->expensereport->enabled)) -{ - $langs->load('trips'); - if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; - $sql.= " WHERE p.entity = ".getEntity('expensereport'); - $sql.= " AND p.fk_statut>=5"; - $column='p.date_valid'; - } else { - $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht, sum(p.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; - $sql.= " WHERE p.entity = ".getEntity('expensereport'); - $sql.= " AND p.fk_statut>=5"; + /* + * Charges sociales non deductibles + */ - $column='pe.datep'; - } + print ''; - print ''; - - if (! empty($date_start) && ! empty($date_end)) + if ($modecompta == 'CREANCES-DETTES') { - $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; + $sql.= " AND c.deductible = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } - - $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.ref'; - $sql.= $db->order($newsortfield, $sortorder); + elseif ($modecompta == 'RECETTES-DEPENSES') + { + $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; + $sql.= " AND c.deductible = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + $sql.= " AND cs.entity = ".$conf->entity; + $sql.= " GROUP BY c.libelle, c.id"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - dol_syslog("get expense report outcome"); + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get social contributions deductible=0", LOG_DEBUG); $result=$db->query($sql); $subtotal_ht = 0; $subtotal_ttc = 0; - if ($result) - { + if ($result) { $num = $db->num_rows($result); - if ($num) - { - while ($obj = $db->fetch_object($result)) - { - $total_ht -= $obj->amount_ht; - $total_ttc -= $obj->amount_ttc; - $subtotal_ht += $obj->amount_ht; - $subtotal_ttc += $obj->amount_ttc; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); - print ''; + $total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; - print "\n"; - - if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; - print ''; - } - } - else - { - print ''; - print ''; - print ''; - } - } - else - { - dol_print_error($db); + print ''; + print ''; + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + $i++; + } + } + else { + print ''; + print ''; + print ''; + } + } else { + dol_print_error($db); } print ''; if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; - print ''; -} + print ''; + print ''; -/* - * Donations - */ -if (! empty($conf->don->enabled)) -{ - print ''; + /* + * Charges sociales deductibles + */ + + print ''; + if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; - $sql.= " WHERE p.entity = ".$conf->entity; - $sql.= " AND fk_statut in (1,2)"; + $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; + $sql.= " AND c.deductible = 1"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; + $sql.= " AND cs.entity = ".$conf->entity; } - else + elseif ($modecompta == 'RECETTES-DEPENSES') { - $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; - $sql.= " WHERE p.entity = ".getEntity('donation'); - $sql.= " AND fk_statut >= 2"; + $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; + $sql.= " AND c.deductible = 1"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql.= " AND cs.entity = ".$conf->entity; } - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; - $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.societe, p.firstname, p.lastname, dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); + $sql.= " GROUP BY c.libelle, c.id"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); - dol_syslog("get dunning"); + dol_syslog("get social contributions deductible=1", LOG_DEBUG); $result=$db->query($sql); $subtotal_ht = 0; $subtotal_ttc = 0; - if ($result) + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + $total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + print ''; + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + $i++; + } + } + else { + print ''; + print ''; + print ''; + } + } else { + dol_print_error($db); + } + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + + if ($mysoc->tva_assuj == 'franchise') // Non assujetti { - $num = $db->num_rows($result); - $i = 0; - if ($num) + // Total + print ''; + print ''; + print ''; + + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + } + + + /* + * Salaries + */ + + if (! empty($conf->salaries->enabled)) + { + print ''; + + if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { - while ($i < $num) + if ($modecompta == 'CREANCES-DETTES') { + $column = 'p.datev'; + } else { + $column = 'p.datep'; + } + + $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; + $sql.= " WHERE p.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + + $sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'u.firstname, u.lastname'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + } + + dol_syslog("get payment salaries"); + $result=$db->query($sql); + $subtotal_ht = 0; + $subtotal_ttc = 0; + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + print ''; + + print "\n"; + + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + $i++; + } + } + else + { + print ''; + print ''; + print ''; + } + } + else + { + dol_print_error($db); + } + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + } + + + /* + * Expense + */ + + if (! empty($conf->expensereport->enabled)) + { + if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') + { + $langs->load('trips'); + if ($modecompta == 'CREANCES-DETTES') { + $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; + $sql.= " WHERE p.entity = ".getEntity('expensereport'); + $sql.= " AND p.fk_statut>=5"; + + $column='p.date_valid'; + } else { + $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht, sum(p.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; + $sql.= " WHERE p.entity = ".getEntity('expensereport'); + $sql.= " AND p.fk_statut>=5"; + + $column='pe.datep'; + } + + if (! empty($date_start) && ! empty($date_end)) { - $obj = $db->fetch_object($result); + $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + } - $total_ht += $obj->amount; - $total_ttc += $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; + $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.ref'; + $sql.= $db->order($newsortfield, $sortorder); + } + print ''; + + dol_syslog("get expense report outcome"); + $result=$db->query($sql); + $subtotal_ht = 0; + $subtotal_ttc = 0; + if ($result) + { + $num = $db->num_rows($result); + if ($num) + { + while ($obj = $db->fetch_object($result)) + { + $total_ht -= $obj->amount_ht; + $total_ttc -= $obj->amount_ttc; + $subtotal_ht += $obj->amount_ht; + $subtotal_ttc += $obj->amount_ttc; + + print ''; + + print "\n"; + + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + } + } + else + { print ''; - - print "\n"; - - if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; + print ''; print ''; - $i++; } } else { - print ''; - print ''; - print ''; + dol_print_error($db); + } + print ''; + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + } + + /* + * Donations + */ + + if (! empty($conf->don->enabled)) + { + print ''; + + if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') + { + if ($modecompta == 'CREANCES-DETTES') + { + $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; + $sql.= " WHERE p.entity = ".$conf->entity; + $sql.= " AND fk_statut in (1,2)"; + } + else + { + $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; + $sql.= " WHERE p.entity = ".getEntity('donation'); + $sql.= " AND fk_statut >= 2"; + } + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; + } + $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.societe, p.firstname, p.lastname, dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get dunning"); + $result=$db->query($sql); + $subtotal_ht = 0; + $subtotal_ttc = 0; + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $total_ht += $obj->amount; + $total_ttc += $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + print ''; + + print "\n"; + + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + $i++; + } + } + else + { + print ''; + print ''; + print ''; + } + } + else + { + dol_print_error($db); + } + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + } + + + /* + * VAT + */ + + print ''; + $subtotal_ht = 0; + $subtotal_ttc = 0; + + if ($conf->tax->enabled && ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES')) + { + if ($modecompta == 'CREANCES-DETTES') + { + // TVA a payer + $amount=0; + $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.tva) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $sql.= " AND f.type IN (0,1,2,5)"; + else + $sql.= " AND f.type IN (0,1,2,3,5)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " GROUP BY dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get vat to pay", LOG_DEBUG); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $amount -= $obj->amount; + //$total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + //$subtotal_ht -= $obj->amount; + $subtotal_ttc -= $obj->amount; + $i++; + } + } + } else { + dol_print_error($db); + } + print ''; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + + // TVA a recuperer + $amount=0; + $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $sql.= " AND f.type IN (0,1,2)"; + else + $sql.= " AND f.type IN (0,1,2,3)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " GROUP BY dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get vat received back", LOG_DEBUG); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $amount += $obj->amount; + //$total_ht += $obj->amount; + $total_ttc += $obj->amount; + //$subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); + } + print ''; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + } + else + { + // VAT really already paid + $amount=0; + $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE amount > 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; + $sql.= " AND t.entity = ".$conf->entity; + $sql.= " GROUP BY dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get vat really paid", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + $amount -= $obj->amount; + $total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + $subtotal_ht -= $obj->amount; + $subtotal_ttc -= $obj->amount; + + $i++; + } + } + $db->free($result); + } else { + dol_print_error($db); + } + print ''; + print "\n"; + if ($modecompta == 'CREANCES-DETTES') + print "\n"; + print "\n"; + print "\n"; + + // VAT really received + $amount=0; + $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE amount < 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; + $sql.= " AND t.entity = ".$conf->entity; + $sql.= " GROUP BY dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get vat really received back", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + $amount += $obj->amount; + $total_ht += $obj->amount; + $total_ttc += $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + $i++; + } + } + $db->free($result); + } + else + { + dol_print_error($db); + } + print ''; + print "\n"; + if ($modecompta == 'CREANCES-DETTES') + print "\n"; + print "\n"; + print "\n"; } } - else + + if ($mysoc->tva_assuj != 'franchise') // Assujetti { - dol_print_error($db); + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; } - print ''; - if ($modecompta == 'CREANCES-DETTES') - print ''; - print ''; - print ''; -} - -/* - * VAT - */ - -print ''; -$subtotal_ht = 0; -$subtotal_ttc = 0; - -if ($modecompta == 'CREANCES-DETTES') -{ - // TVA a payer - $amount=0; - $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.tva) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - $sql.= " AND f.type IN (0,1,2,5)"; - else - $sql.= " AND f.type IN (0,1,2,3,5)"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get vat to pay", LOG_DEBUG); - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($result); - - $amount -= $obj->amount; - //$total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - //$subtotal_ht -= $obj->amount; - $subtotal_ttc -= $obj->amount; - $i++; - } - } - } else { - dol_print_error($db); - } - print ''; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - - // TVA a recuperer - $amount=0; - $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - $sql.= " AND f.type IN (0,1,2)"; - else - $sql.= " AND f.type IN (0,1,2,3)"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get vat received back", LOG_DEBUG); - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($result); - - $amount += $obj->amount; - //$total_ht += $obj->amount; - $total_ttc += $obj->amount; - //$subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } - print ''; - print "\n"; - print "\n"; - print "\n"; - print "\n"; -} -else -{ - // VAT really already paid - $amount=0; - $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE amount > 0"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; - $sql.= " AND t.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get vat really paid", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - $amount -= $obj->amount; - $total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - $subtotal_ht -= $obj->amount; - $subtotal_ttc -= $obj->amount; - - $i++; - } - } - $db->free($result); - } else { - dol_print_error($db); - } - print ''; - print "\n"; - if ($modecompta == 'CREANCES-DETTES') - print "\n"; - print "\n"; - print "\n"; - - // VAT really received - $amount=0; - $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE amount < 0"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; - $sql.= " AND t.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get vat really received back", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - $amount += $obj->amount; - $total_ht += $obj->amount; - $total_ttc += $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; - - $i++; - } - } - $db->free($result); - } - else - { - dol_print_error($db); - } - print ''; - print "\n"; - if ($modecompta == 'CREANCES-DETTES') - print "\n"; - print "\n"; - print "\n"; -} - - -if ($mysoc->tva_assuj != 'franchise') // Assujetti -{ - print ''; - if ($modecompta == 'CREANCES-DETTES') - print ''; - print ''; - print ''; } $action = "balanceclient"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 6043a7cbec5..49d8766127e 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -21,34 +21,88 @@ */ /** - * \file htdocs/compta/resultat/index.php - * \brief Page reporting result + * \file htdocs/compta/resultat/index.php + * \ingroup compta, accountancy + * \brief Page reporting result */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +$langs->loadLangs(array('compta','bills','donation','salaries')); + +$date_startmonth=GETPOST('date_startmonth','int'); +$date_startday=GETPOST('date_startday','int'); +$date_startyear=GETPOST('date_startyear','int'); +$date_endmonth=GETPOST('date_endmonth','int'); +$date_endday=GETPOST('date_endday','int'); +$date_endyear=GETPOST('date_endyear','int'); -$year_start=GETPOST('year_start'); -$year_current = strftime("%Y",time()); $nbofyear=4; -if (! $year_start) { - $year_start = $year_current - ($nbofyear-1); - $year_end = $year_current; + +// Date range +$year=GETPOST('year','int'); +if (empty($year)) +{ + $year_current = strftime("%Y",dol_now()); + $month_current = strftime("%m",dol_now()); + $year_start = $year_current - ($nbofyear - 1); +} else { + $year_current = $year; + $month_current = strftime("%m",dol_now()); + $year_start = $year - ($nbofyear - 1); } -else { - $year_end=$year_start + ($nbofyear-1); +$date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); +$date_end=dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); + +// We define date_start and date_end +if (empty($date_start) || empty($date_end)) // We define date_start and date_end +{ + $q=GETPOST("q")?GETPOST("q"):0; + if ($q==0) + { + // We define date_start and date_end + $year_end=$year_start + ($nbofyear - 1); + $month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); + if (! GETPOST('month')) + { + if (! GETPOST("year") && $month_start > $month_current) + { + $year_start--; + $year_end--; + } + $month_end=$month_start-1; + if ($month_end < 1) $month_end=12; + else $year_end++; + } + else $month_end=$month_start; + $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false); + } + if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); } + if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); } + if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } + if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } +// $date_start and $date_end are defined. We force $start_year and $nbofyear +$tmps=dol_getdate($date_start); +$start_year = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $start_year) + 1; +//var_dump($start_year." ".$end_year." ".$nbofyear); + // Security check $socid = GETPOST('socid','int'); if ($user->societe_id > 0) $socid = $user->societe_id; if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat'); if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport'); - -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') -$modecompta=(GETPOST("modecompta")?GETPOST("modecompta"):$conf->global->ACCOUNTING_MODE); +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') +$modecompta = $conf->global->ACCOUNTING_MODE; +if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; +if (GETPOST("modecompta",'alpha')) $modecompta=GETPOST("modecompta",'alpha'); /* @@ -59,41 +113,55 @@ llxHeader(); $form=new Form($db); -$nomlink=''; $exportlink=''; // Affiche en-tete du rapport if ($modecompta == 'CREANCES-DETTES') { - $nom=$langs->trans("AnnualSummaryDueDebtMode"); + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $period="$year_start - $year_end"; - $periodlink=($year_start?"".img_previous()."".img_next()."":""); + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); $description.='
'.$langs->trans("RulesResultDue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.="
".$langs->trans("DepositsAreNotIncluded"); else $description.="
".$langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else { - $nom=$langs->trans("AnnualSummaryInputOutputMode"); +else if ($modecompta=="RECETTES-DEPENSES") { + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - $period="$year_start - $year_end"; - $periodlink=($year_start?"".img_previous()."".img_next()."":""); + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); $description.='
'.$langs->trans("RulesResultInOut"); - $builddate=time(); + $builddate=dol_now(); + //$exportlink=$langs->trans("NotYetAvailable"); +} +else if ($modecompta=="BOOKKEEPING") +{ + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear"); + $calcmode=$langs->trans("CalcModeBookkeeping"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $periodlink=($year_start?"".img_previous()."".img_next()."":""); + $description=$langs->trans("RulesAmountOnInOutBookkeepingRecord"); + $description.=' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("Chartofaccounts")).')'; + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } $hselected='report'; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -103,93 +171,119 @@ if (! empty($conf->accounting->enabled)) /* * Factures clients */ + $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - $sql = "SELECT sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; - else $sql.= " AND f.type IN (0,1,2,3,5)"; -} -else -{ - /* - * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les - * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) - */ - $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; - $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " WHERE p.rowid = pf.fk_paiement"; - $sql.= " AND pf.fk_facture = f.rowid"; -} -$sql.= " AND f.entity = ".$conf->entity; -if ($socid) $sql.= " AND f.fk_soc = $socid"; -$sql.= " GROUP BY dm"; -$sql.= " ORDER BY dm"; - -//print $sql; -dol_syslog("get customers invoices", LOG_DEBUG); -$result=$db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - while ($i < $num) + if ($modecompta == 'CREANCES-DETTES') { - $row = $db->fetch_object($result); - $encaiss[$row->dm] = (isset($row->amount_ht)?$row->amount_ht:0); - $encaiss_ttc[$row->dm] = $row->amount_ttc; - $i++; + $sql = "SELECT sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; + else $sql.= " AND f.type IN (0,1,2,3,5)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + else if ($modecompta=="RECETTES-DEPENSES") + { + /* + * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les + * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) + */ + $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; + $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " WHERE p.rowid = pf.fk_paiement"; + $sql.= " AND pf.fk_facture = f.rowid"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } - $db->free($result); -} -else { - dol_print_error($db); -} -// On ajoute les paiements clients anciennes version, non lies par paiement_facture -if ($modecompta != 'CREANCES-DETTES') -{ - $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; - $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; - $sql.= " WHERE pf.rowid IS NULL"; - $sql.= " AND p.fk_bank = b.rowid"; - $sql.= " AND b.fk_account = ba.rowid"; - $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql.= " AND f.fk_soc = $socid"; $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; - dol_syslog("get old customers payments not linked to invoices", LOG_DEBUG); - $result = $db->query($sql); - if ($result) { + //print $sql; + dol_syslog("get customers invoices", LOG_DEBUG); + $result=$db->query($sql); + if ($result) + { $num = $db->num_rows($result); $i = 0; while ($i < $num) { $row = $db->fetch_object($result); - - if (! isset($encaiss[$row->dm])) $encaiss[$row->dm]=0; - $encaiss[$row->dm] += (isset($row->amount_ht)?$row->amount_ht:0); - - if (! isset($encaiss_ttc[$row->dm])) $encaiss_ttc[$row->dm]=0; - $encaiss_ttc[$row->dm] += $row->amount_ttc; - + $encaiss[$row->dm] = (isset($row->amount_ht)?$row->amount_ht:0); + $encaiss_ttc[$row->dm] = $row->amount_ttc; $i++; } + $db->free($result); } else { dol_print_error($db); } } +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table +} + +if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) +{ + // On ajoute les paiements clients anciennes version, non lies par paiement_facture + if ($modecompta != 'CREANCES-DETTES') + { + $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; + $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; + $sql.= " WHERE pf.rowid IS NULL"; + $sql.= " AND p.fk_bank = b.rowid"; + $sql.= " AND b.fk_account = ba.rowid"; + $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; + $sql.= " ORDER BY dm"; + + dol_syslog("get old customers payments not linked to invoices", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_object($result); + + if (! isset($encaiss[$row->dm])) $encaiss[$row->dm]=0; + $encaiss[$row->dm] += (isset($row->amount_ht)?$row->amount_ht:0); + + if (! isset($encaiss_ttc[$row->dm])) $encaiss_ttc[$row->dm]=0; + $encaiss_ttc[$row->dm] += $row->amount_ttc; + + $i++; + } + } + else { + dol_print_error($db); + } + } + else if ($modecompta=="RECETTES-DEPENSES") + { + // Nothing from this table + } +} +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table +} /* @@ -198,231 +292,275 @@ if ($modecompta != 'CREANCES-DETTES') $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; -} -else -{ - $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; - $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; - $sql.= " WHERE f.rowid = pf.fk_facturefourn"; - $sql.= " AND p.rowid = pf.fk_paiementfourn"; -} -$sql.= " AND f.entity = ".$conf->entity; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql.= " GROUP BY dm"; - -dol_syslog("get suppliers invoices", LOG_DEBUG); -$result=$db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - while ($i < $num) + if ($modecompta == 'CREANCES-DETTES') { - $row = $db->fetch_object($result); - - if (! isset($decaiss[$row->dm])) $decaiss[$row->dm]=0; - $decaiss[$row->dm] = (isset($row->amount_ht)?$row->amount_ht:0); - - if (! isset($decaiss_ttc[$row->dm])) $decaiss_ttc[$row->dm]=0; - $decaiss_ttc[$row->dm] = $row->amount_ttc; - - $i++; + $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; + else $sql.= " AND f.type IN (0,1,2,3)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + else if ($modecompta=="RECETTES-DEPENSES") + { + $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; + $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; + $sql.= " WHERE f.rowid = pf.fk_facturefourn"; + $sql.= " AND p.rowid = pf.fk_paiementfourn"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql.= " AND f.fk_soc = ".$socid; + $sql.= " GROUP BY dm"; + + dol_syslog("get suppliers invoices", LOG_DEBUG); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_object($result); + + if (! isset($decaiss[$row->dm])) $decaiss[$row->dm]=0; + $decaiss[$row->dm] = (isset($row->amount_ht)?$row->amount_ht:0); + + if (! isset($decaiss_ttc[$row->dm])) $decaiss_ttc[$row->dm]=0; + $decaiss_ttc[$row->dm] = $row->amount_ttc; + + $i++; + } + $db->free($result); + } + else { + dol_print_error($db); } - $db->free($result); } -else { - dol_print_error($db); +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table } + /* * TVA */ + $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - // TVA a payer - $sql = "SELECT sum(f.tva) as amount, date_format(f.datef,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; - else $sql.= " AND f.type IN (0,1,2,3,5)"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; + if ($modecompta == 'CREANCES-DETTES') + { + // TVA a payer + $sql = "SELECT sum(f.tva) as amount, date_format(f.datef,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; + else $sql.= " AND f.type IN (0,1,2,3,5)"; + $sql.= " AND f.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; - dol_syslog("get vat to pay", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); + dol_syslog("get vat to pay", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; - $i++; + $i++; + } } + } else { + dol_print_error($db); + } + // TVA a recuperer + $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; + else $sql.= " AND f.type IN (0,1,2,3)"; + $sql.= " AND f.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; + + dol_syslog("get vat to receive back", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; + $encaiss[$obj->dm] += $obj->amount; + + if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; + $encaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); } - } else { - dol_print_error($db); } - // TVA a recuperer - $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; + else if ($modecompta=="RECETTES-DEPENSES") + { + // TVA reellement deja payee + $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE amount > 0"; + $sql.= " AND t.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; - dol_syslog("get vat to receive back", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); + dol_syslog("get vat really paid", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); - if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; - $encaiss[$obj->dm] += $obj->amount; + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; - if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; - $encaiss_ttc[$obj->dm] += $obj->amount; + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; - $i++; + $i++; + } } + } else { + dol_print_error($db); + } + // TVA recuperee + $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE amount < 0"; + $sql.= " AND t.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; + + dol_syslog("get vat really received back", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; + $encaiss[$obj->dm] += $obj->amount; + + if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; + $encaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); } - } else { - dol_print_error($db); } } -else { - // TVA reellement deja payee - $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE amount > 0"; - $sql.= " AND t.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - - dol_syslog("get vat really paid", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } - // TVA recuperee - $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE amount < 0"; - $sql.= " AND t.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - - dol_syslog("get vat really received back", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; - $encaiss[$obj->dm] += $obj->amount; - - if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; - $encaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table } /* * Charges sociales non deductibles */ + $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; -} -else -{ - $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; -} -$sql.= " AND cs.entity = ".$conf->entity; -$sql.= " GROUP BY c.libelle, dm"; - -dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); -$result=$db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } + if ($modecompta == 'CREANCES-DETTES') + { + $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; + $sql.= " AND c.deductible = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; + } + else if ($modecompta=="RECETTES-DEPENSES") + { + $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; + $sql.= " AND c.deductible = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + + $sql.= " AND cs.entity = ".$conf->entity; + $sql.= " GROUP BY c.libelle, dm"; + + dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; + + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); } -} else { - dol_print_error($db); } +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table +} + /* * Charges sociales deductibles @@ -430,108 +568,120 @@ if ($result) { $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; -} -else -{ - $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; -} -$sql.= " AND cs.entity = ".$conf->entity; -$sql.= " GROUP BY c.libelle, dm"; - -dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); -$result=$db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } + if ($modecompta == 'CREANCES-DETTES') + { + $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; + $sql.= " AND c.deductible = 1"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; + } + else if ($modecompta=="RECETTES-DEPENSES") + { + $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; + $sql.= " AND c.deductible = 1"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + + $sql.= " AND cs.entity = ".$conf->entity; + $sql.= " GROUP BY c.libelle, dm"; + + dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; + + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); } -} else { - dol_print_error($db); } -$action = "balance"; -$object = array(&$encaiss, &$encaiss_ttc, &$decaiss, &$decaiss_ttc); -$parameters["mode"] = $modecompta; -// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('externalbalance')); -$reshook=$hookmanager->executeHooks('addReportInfo',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table +} /* * Salaries */ -if (! empty($conf->salaries->enabled)) +if (! empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - if ($modecompta == 'CREANCES-DETTES') { - $column = 'p.datev'; - } else { - $column = 'p.datep'; - } + if ($modecompta == 'CREANCES-DETTES') $column = 'p.datev'; + if ($modecompta == "RECETTES-DEPENSES") $column = 'p.datep'; - $subtotal_ht = 0; - $subtotal_ttc = 0; - $sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; - $sql.= " WHERE p.entity = ".$conf->entity; - $sql.= " GROUP BY p.label, dm"; + $subtotal_ht = 0; + $subtotal_ttc = 0; + $sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount"; + $sql .= " FROM " . MAIN_DB_PREFIX . "payment_salary as p"; + $sql .= " WHERE p.entity = " . $conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'"; + $sql .= " GROUP BY p.label, dm"; - dol_syslog("get social salaries payments"); - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($result); + dol_syslog("get social salaries payments"); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var = false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; + if (! isset($decaiss[$obj->dm])) + $decaiss[$obj->dm] = 0; + $decaiss[$obj->dm] += $obj->amount; - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; + if (! isset($decaiss_ttc[$obj->dm])) + $decaiss_ttc[$obj->dm] = 0; + $decaiss_ttc[$obj->dm] += $obj->amount; - $i++; - } - } - } - else - { - dol_print_error($db); - } + $i ++; + } + } + } else { + dol_print_error($db); + } +} +elseif ($modecompta == "BOOKKEEPING") +{ + // Nothing from this table } -if (! empty($conf->expensereport->enabled)) + +/* + * Expense reports + */ + +if (! empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { $langs->load('trips'); + if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; @@ -540,8 +690,10 @@ if (! empty($conf->expensereport->enabled)) $sql.= " AND p.fk_statut>=5"; $column='p.date_valid'; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'"; - } else { + } elseif ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; @@ -551,6 +703,8 @@ if (! empty($conf->expensereport->enabled)) $sql.= " AND p.fk_statut>=5"; $column='pe.datep'; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'"; } $sql.= " GROUP BY dm"; @@ -579,12 +733,18 @@ if (! empty($conf->expensereport->enabled)) { dol_print_error($db); } + } +elseif ($modecompta == 'BOOKKEEPING') { + // Nothing from this table +} + /* * Donation get dunning paiement */ -if (! empty($conf->don->enabled)) + +if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { $subtotal_ht = 0; $subtotal_ttc = 0; @@ -594,15 +754,20 @@ if (! empty($conf->don->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " AND fk_statut in (1,2)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; } - else { - $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; + elseif ($modecompta == 'RECETTES-DEPENSES') { + $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('donation'); $sql.= " AND fk_statut >= 2"; - } + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND pe.datep >= '".$db->idate($date_start)."' AND pe.datep <= '".$db->idate($date_end)."'"; + } + $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; dol_syslog("get donation payments"); @@ -633,6 +798,78 @@ if (! empty($conf->don->enabled)) dol_print_error($db); } } +elseif ($modecompta == 'BOOKKEEPING') { + // Nothing from this table +} + + + +/* + * Request in mode BOOKKEEPING + */ + +if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) +{ + $subtotal_ht = 0; + $subtotal_ttc = 0; + + $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa"; + $sql.= " WHERE b.numero_compte = aa.account_number AND b.entity = ".$conf->entity; + //$sql.= " AND fk_statut in (1,2)"; + $sql.= " AND ("; + //$sql.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))"; + $sql.= " (pcg_type = 'EXPENSE')"; + $sql.= " OR "; + //$sql.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))"; + $sql.= " (pcg_type = 'INCOME')"; + $sql.= ")"; + //$sql.= " AND code_journal in ('VT', 'AC')"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND b.doc_date >= '".$db->idate($date_start)."' AND b.doc_date <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, dm"; + + //print $sql; + + dol_syslog("get bookkeeping record"); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; + $encaiss[$obj->dm] += $obj->debit; + + if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; + $encaiss_ttc[$obj->dm] += $obj->credit; + + $i++; + } + } + } + else + { + dol_print_error($db); + } +} + + + +$action = "balance"; +$object = array(&$encaiss, &$encaiss_ttc, &$decaiss, &$decaiss_ttc); +$parameters["mode"] = $modecompta; +// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('externalbalance')); +$reshook=$hookmanager->executeHooks('addReportInfo',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + /* * Show result array diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php new file mode 100644 index 00000000000..3de3cea5d0f --- /dev/null +++ b/htdocs/compta/resultat/result.php @@ -0,0 +1,513 @@ + + * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2018 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/compta/resultat/result.php + * \ingroup compta, accountancy + * \brief Page for accounting result + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; + +$langs->loadLangs(array('compta','bills','donation','salaries','accountancy')); + +$error = 0; + +$mesg = ''; +$action = GETPOST('action','aZ09'); +$cat_id = GETPOST('account_category'); +$selectcpt = GETPOST('cpt_bk'); +$id = GETPOST('id', 'int'); +$rowid = GETPOST('rowid', 'int'); +$cancel = GETPOST('cancel','alpha'); +$showaccountdetail = GETPOST('showaccountdetail','aZ09')?GETPOST('showaccountdetail','aZ09'):'no'; + + +$date_startmonth=GETPOST('date_startmonth','int'); +$date_startday=GETPOST('date_startday','int'); +$date_startyear=GETPOST('date_startyear','int'); +$date_endmonth=GETPOST('date_endmonth','int'); +$date_endday=GETPOST('date_endday','int'); +$date_endyear=GETPOST('date_endyear','int'); + +$nbofyear=1; + +// Date range +$year=GETPOST('year','int'); +if (empty($year)) +{ + $year_current = strftime("%Y", dol_now()); + $month_current = strftime("%m", dol_now()); + $year_start = $year_current - ($nbofyear - 1); +} else { + $year_current = $year; + $month_current = strftime("%m", dol_now()); + $year_start = $year - ($nbofyear - 1); +} +$date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); +$date_end=dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); + +// We define date_start and date_end +if (empty($date_start) || empty($date_end)) // We define date_start and date_end +{ + $q=GETPOST("q")?GETPOST("q"):0; + if ($q==0) + { + // We define date_start and date_end + $year_end=$year_start + ($nbofyear - 1); + $month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); + $date_startmonth = $month_start; + if (! GETPOST('month')) + { + if (! GETPOST("year") && $month_start > $month_current) + { + $year_start--; + $year_end--; + } + $month_end=$month_start-1; + if ($month_end < 1) $month_end=12; + else $year_end++; + } + else $month_end=$month_start; + $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false); + } + if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); } + if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); } + if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } + if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } +} + +if (($date_start < dol_time_plus_duree($date_end, -1, 'y')) || ($date_start > $date_end)) +{ + $date_end = dol_time_plus_duree($date_start - 1, 1, 'y'); +} + +// $date_start and $date_end are defined. We force $start_year and $nbofyear +$tmps=dol_getdate($date_start); +$start_year = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $start_year) + 1; + +$date_start_previous = dol_time_plus_duree($date_start, -1, 'y'); +$date_end_previous = dol_time_plus_duree($date_end, -1, 'y'); + +//var_dump($date_start." ".$date_end." ".$date_start_previous." ".$date_end_previous." ".$nbofyear); + + +if($cat_id == 0){ + $cat_id = null; +} + +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') +$modecompta = $conf->global->ACCOUNTING_MODE; +if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; +if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta",'alpha'); + +// Security check +if ($user->societe_id > 0) + accessforbidden(); +if (! $user->rights->accounting->comptarapport->lire) + accessforbidden(); + +$AccCat = new AccountancyCategory($db); + + +/* + * View + */ + +$months = array( + $langs->trans("JanuaryMin"), + $langs->trans("FebruaryMin"), + $langs->trans("MarchMin"), + $langs->trans("AprilMin"), + $langs->trans("MayMin"), + $langs->trans("JuneMin"), + $langs->trans("JulyMin"), + $langs->trans("AugustMin"), + $langs->trans("SeptemberMin"), + $langs->trans("OctoberMin"), + $langs->trans("NovemberMin"), + $langs->trans("DecemberMin"), +); + +llxheader('', $langs->trans('ReportInOut')); + +$formaccounting = new FormAccounting($db); +$form = new Form($db); + +$textprevyear = '' . img_previous() . ''; +$textnextyear = ' ' . img_next() . ''; + + + +// Affiche en-tete de rapport +if ($modecompta=="CREANCES-DETTES") +{ + $name=$langs->trans("AnnualByAccountDueDebtMode"); + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + //$periodlink=''.img_previous().' '.img_next().''; + $description=$langs->trans("RulesResultDue"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + else $description.= $langs->trans("DepositsAreIncluded"); + $builddate=dol_now(); + //$exportlink=$langs->trans("NotYetAvailable"); +} +else if ($modecompta=="RECETTES-DEPENSES") { + $name=$langs->trans("AnnualByAccountInputOutputMode"); + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + //$periodlink=''.img_previous().' '.img_next().''; + $description=$langs->trans("RulesResultInOut"); + $builddate=dol_now(); + //$exportlink=$langs->trans("NotYetAvailable"); +} +else if ($modecompta=="BOOKKEEPING") +{ + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups"); + $calcmode=$langs->trans("CalcModeBookkeeping"); + //$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $arraylist=array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All")); + $period.='     '.$langs->trans("DetailByAccount").' '. $form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0); + $periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $start_year . " " . $textnextyear ; + $exportlink = ''; + $description=$langs->trans("RulesResultBookkeepingPersonalized"). + $description.=' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("AccountingCategory")).')'; + //if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + //else $description.= $langs->trans("DepositsAreIncluded"); + $builddate=dol_now(); +} + +report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'action' => ''), $calcmode); + + +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') +{ + print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); +} + + +$moreforfilter=''; + +print '
'; +print '
'.$langs->trans("CustomersInvoices").'
 ".$langs->trans("Bills").' '.$objp->name."".price($objp->amount_ht)."".price($objp->amount_ttc)."
 ".$langs->trans("Bills")." ".$langs->trans("Other")." (".$langs->trans("PaymentsNotLinkedToInvoice").")\n"; - - if ($modecompta == 'CREANCES-DETTES') - print "".price($objp->amount_ht)."".price($objp->amount_ttc)."
 '.$langs->trans("None").'
'.price($total_ht).''.price($total_ttc).'
'.$langs->trans("SuppliersInvoices").'
 ".$langs->trans("Bills")." socid."\">".$objp->name."".price(-$objp->amount_ht)."".price(-$objp->amount_ttc)."
 '.$langs->trans("None").'
'.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
'.$langs->trans("SocialContributionsNondeductibles").'
 '.$obj->label.''.price(-$obj->amount).''.price(-$obj->amount).'
 '.$langs->trans("None").'
'.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
'.$langs->trans("SocialContributionsDeductibles").'
 '.$obj->label.''.price(-$obj->amount).''.price(-$obj->amount).'
 '.$langs->trans("None").'
'.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
 
'.$langs->trans("Profit").''.price($total_ht).''.price($total_ttc).'
 
'.$langs->trans("Salaries").'
'.$objp->pcg_type.'
 '.$objp->pcg_type.($objp->pcg_subtype != 'XXXXXX'?' - '.$objp->pcg_subtype:'').($objp->name?' ('.$objp->name.')':'')."'.price($objp->amount)."
    ' . length_accountg($cpt['account_number']) . ' - ' . $cpt['account_label'] . '' . price($resultN) . '
'.$langs->trans("NoRecordFound").'
'.$langs->trans("CustomersInvoices").'
 ".$langs->trans("Bills").' '.$objp->name."".price($objp->amount_ht)."".price($objp->amount_ttc)."
 ".$langs->trans("Bills")." ".$langs->trans("Other")." (".$langs->trans("PaymentsNotLinkedToInvoice").")\n"; + + if ($modecompta == 'CREANCES-DETTES') + print "".price($objp->amount_ht)."".price($objp->amount_ttc)."
 '.$langs->trans("None").'
'.price($total_ht).''.price($total_ttc).'
'.$langs->trans("SuppliersInvoices").'
 ".$langs->trans("Bills")." socid."\">".$objp->name."".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."".price(-$objp->amount_ht)."".price(-$objp->amount_ttc)."'.price(-$obj->amount).''.price(-$obj->amount).'
'.$langs->trans("None").'
'.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
'.$langs->trans("SocialContributionsNondeductibles").'
'.$langs->trans("ExpenseReport").'
 ".$langs->trans("ExpenseReport")." userid."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount_ht).''.price(-$obj->amount_ttc).'
 '.$langs->trans("None").'
 '.$obj->label.''.price(-$obj->amount).''.price(-$obj->amount).'
 '.$langs->trans("None").'
'.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
'.price(-$subtotal_ttc).'
'.$langs->trans("Donations").'
'.$langs->trans("SocialContributionsDeductibles").'
 '.$obj->label.''.price(-$obj->amount).''.price(-$obj->amount).'
 '.$langs->trans("None").'
'.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
 
'.$langs->trans("Profit").''.price($total_ht).''.price($total_ttc).'
 
'.$langs->trans("Salaries").'
 ".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount).''.price(-$obj->amount).'
 '.$langs->trans("None").'
'.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
'.$langs->trans("ExpenseReport").'
 ".$langs->trans("ExpenseReport")." userid."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount_ht).''.price(-$obj->amount_ttc).'
 ".$langs->trans("Donation")." name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."'.price($obj->amount).''.price($obj->amount).''.$langs->trans("None").'
 '.$langs->trans("None").'
'.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
'.$langs->trans("Donations").'
 ".$langs->trans("Donation")." name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."'.price($obj->amount).''.price($obj->amount).'
 '.$langs->trans("None").'
'.price($subtotal_ht).''.price($subtotal_ttc).'
'.$langs->trans("VAT").'
 ".$langs->trans("VATToPay")." ".price($amount)."
 ".$langs->trans("VATToCollect")." ".price($amount)."
 ".$langs->trans("VATPaid")."".price($amount)."".price($amount)."
 ".$langs->trans("VATCollected")."".price($amount)."".price($amount)."
 '.price(price2num($subtotal_ttc,'MT')).'
'.price($subtotal_ht).''.price($subtotal_ttc).'
'.$langs->trans("VAT").'
 ".$langs->trans("VATToPay")." ".price($amount)."
 ".$langs->trans("VATToCollect")." ".price($amount)."
 ".$langs->trans("VATPaid")."".price($amount)."".price($amount)."
 ".$langs->trans("VATCollected")."".price($amount)."".price($amount)."
 '.price(price2num($subtotal_ttc,'MT')).'
'."\n"; + +print ''; +print ''; +print ''; +print ''; +print ''; +foreach($months as $k => $v){ + if (($k+1) >= $date_startmonth) + { + print ''; + } +} +foreach($months as $k => $v){ + if (($k+1) < $date_startmonth) + { + print ''; + } +} +print ''; + +if ($modecompta == 'CREANCES-DETTES') +{ + //if (! empty($date_start) && ! empty($date_end)) + // $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; +} +else if ($modecompta=="RECETTES-DEPENSES") +{ + //if (! empty($date_start) && ! empty($date_end)) + // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; +} +else if ($modecompta=="BOOKKEEPING") +{ + + //All categories + $cats = $AccCat->getCats(); + if ($catsCalcule < 0) dol_print_error($db, $AccCat->error, $AccCat->errors); + + $j=1; + $sommes = array(); + $totPerAccount = array(); + + foreach ($cats as $cat) // Loop on each group + { + if (!empty($cat['category_type'])) // category calculed + { + // When we enter here, $sommes was filled by group of accounts + + $formula = $cat['formula']; + + print ''; + + // Year NP + print ''; + + $vars = array(); + + // Previous Fiscal year (N-1) + foreach($sommes as $code => $det){ + $vars[$code] = $det['NP']; + } + + + $result = strtr($formula, $vars); + + //var_dump($result); + //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1); + //var_dump($r); + + print ''; + + // Year N + $code = $cat['code']; // code of categorie ('VTE', 'MAR', ...) + $sommes[$code]['NP'] += $r; + + // Current fiscal year (N) + if (is_array($sommes) && ! empty($sommes)){ + foreach($sommes as $code => $det){ + $vars[$code] = $det['N']; + } + } + + $result = strtr($formula, $vars); + + //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1); + + print ''; + $sommes[$code]['N'] += $r; + + // Detail by month + foreach($months as $k => $v) + { + if (($k+1) >= $date_startmonth) + { + foreach($sommes as $code => $det){ + $vars[$code] = $det['M'][$k]; + } + $result = strtr($formula, $vars); + + //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1); + + print ''; + $sommes[$code]['M'][$k] += $r; + } + } + foreach($months as $k => $v) + { + if (($k+1) < $date_startmonth) + { + foreach($sommes as $code => $det){ + $vars[$code] = $det['M'][$k]; + } + $result = strtr($formula, $vars); + + //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1); + + print ''; + $sommes[$code]['M'][$k] += $r; + } + } + + + print "\n"; + + //var_dump($sommes); + } + else // normal category + { + $totCat = array(); + $totCat['NP'] = 0; + $totCat['N'] = 0; + $totCat['M'] = array(); + foreach($months as $k => $v) + { + $totCat['M'][$k] = 0; + } + + // Get cpts of category/group + $cpts = $AccCat->getCptsCat($cat['rowid']); + + print ""; + + // Column group + print ''; + + $code = $cat['code']; + + // Set value into column NPrevious, N and each month M ($totCat) + // This make 14 calls for each detail of account (NP, N and month m) + foreach($cpts as $i => $cpt) + { + // N-1 + $return = $AccCat->getResult($cpt['account_number'], 0, $date_start_previous, $date_end_previous, $cpt['dc']); + + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultNP=0; + } else { + $resultNP=$AccCat->sdc; + } + + //N + $return = $AccCat->getResult($cpt['account_number'], 0, $date_start, $date_end, $cpt['dc']); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultN=0; + } else { + $resultN=$AccCat->sdc; + } + + $totCat['NP'] += $resultNP; + $totCat['N'] += $resultN; + $sommes[$code]['NP'] += $resultNP; + $sommes[$code]['N'] += $resultN; + $totPerAccount[$cpt['account_number']]['NP'] = $resultNP; + $totPerAccount[$cpt['account_number']]['N'] = $resultN; + + foreach($months as $k => $v) + { + $return = $AccCat->getResult($cpt['account_number'], $k+1, $date_start, $date_end, $cpt['dc']); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultM=0; + } else { + $resultM=$AccCat->sdc; + } + $totCat['M'][$k] += $resultM; + $sommes[$code]['M'][$k] += $resultM; + $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM; + } + } + + // Now output columns for row $code ('VTE', 'MAR', ...) + print ''; + print ''; + + // Each month + foreach($totCat['M'] as $k => $v){ + if (($k+1) >= $date_startmonth) print ''; + } + foreach($totCat['M'] as $k => $v){ + if (($k+1) < $date_startmonth) print ''; + } + + print "\n"; + + // Loop on detail of all accounts + // This make 14 calls for each detail of account (NP, N and month m) + if ($showaccountdetail != 'no') + { + foreach($cpts as $i => $cpt) + { + $resultNP=$totPerAccount[$cpt['account_number']]['NP']; + $resultN=$totPerAccount[$cpt['account_number']]['N']; + + if ($showaccountdetail == 'all' || $resultN > 0) + { + print ''; + print ''; + print ''; + print ''; + print ''; + + // Make one call for each month + foreach($months as $k => $v) + { + if (($k+1) >= $date_startmonth) + { + $resultM=$totPerAccount[$cpt['account_number']]['M'][$k]; + print ''; + } + } + foreach($months as $k => $v) + { + if (($k+1) < $date_startmonth) + { + $resultM=$totPerAccount[$cpt['account_number']]['M'][$k]; + print ''; + } + } + + print "\n"; + } + } + } + } + } +} + +print "
'.$langs->trans("AccountingCategory").''.$langs->trans("PreviousPeriod").''.$langs->trans("SelectedPeriod").''.$langs->trans($v).''.$langs->trans($v).'
'; + print $cat['code']; + print ''; + print $cat['label']; + print '' . price($r) . '' . price($r) . '' . price($r) . '' . price($r) . '
'; + print $cat['code']; + print ''; + print $cat['label']; + if (count($cpts) > 0) // Show example of 5 first accounting accounts + { + $i=0; + foreach($cpts as $cpt) + { + if ($i > 5) + { + print '...)'; + break; + } + if ($i > 0) print ', '; + else print ' ('; + print $cpt['account_number']; + $i++; + } + if ($i <= 5) print ')'; + } + else + { + print ' - '.$langs->trans("GroupIsEmptyCheckSetup").''; + } + print '' . price($totCat['NP']) . '' . price($totCat['N']) . '' . price($v) . '' . price($v) . '
'; + print '     ' . length_accountg($cpt['account_number']); + print ' - '; + print $cpt['account_label']; + print '' . price($resultNP) . '' . price($resultN) . '' . price($resultM) . '' . price($resultM) . '
"; +print '
'; + +llxFooter(); +$db->close(); \ No newline at end of file diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 45bde4bcd32..2b8b6a6fe5b 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -44,7 +44,7 @@ $action=GETPOST('action','aZ09'); // Security check $socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'salaries', '', '', ''); +$result = restrictedArea($user, 'salaries', '', '', 'payment'); $object = new PaymentSalary($db); diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index d3f76a84bdf..7fbbaf43d48 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -34,7 +34,7 @@ class PaymentSalary extends CommonObject //public $element='payment_salary'; //!< Id that identify managed objects //public $table_element='payment_salary'; //!< Name of table without prefix where object is stored public $picto='payment'; - + public $tms; public $fk_user; public $datep; @@ -97,18 +97,18 @@ class PaymentSalary extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."payment_salary SET"; - $sql.= " tms=".$this->db->idate($this->tms).","; + $sql.= " tms='".$this->db->idate($this->tms)."',"; $sql.= " fk_user=".$this->fk_user.","; - $sql.= " datep=".$this->db->idate($this->datep).","; - $sql.= " datev=".$this->db->idate($this->datev).","; + $sql.= " datep='".$this->db->idate($this->datep)."',"; + $sql.= " datev='".$this->db->idate($this->datev)."',"; $sql.= " amount=".price2num($this->amount).","; $sql.= " fk_typepayment=".$this->fk_typepayment."',"; $sql.= " num_payment='".$this->db->escape($this->num_payment)."',"; $sql.= " label='".$this->db->escape($this->label)."',"; - $sql.= " datesp=".$this->db->idate($this->datesp).","; - $sql.= " dateep=".$this->db->idate($this->dateep).","; + $sql.= " datesp='".$this->db->idate($this->datesp)."',"; + $sql.= " dateep='".$this->db->idate($this->dateep)."',"; $sql.= " note='".$this->db->escape($this->note)."',"; - $sql.= " fk_bank=".($this->fk_bank > 0 ? "'".$this->fk_bank."'":"null").","; + $sql.= " fk_bank=".($this->fk_bank > 0 ? "'".$this->db->escape($this->fk_bank)."'":"null").","; $sql.= " fk_user_author=".$this->fk_user_author.","; $sql.= " fk_user_modif=".$this->fk_user_modif; @@ -344,18 +344,18 @@ class PaymentSalary extends CommonObject $sql.= ", entity"; $sql.= ") "; $sql.= " VALUES ("; - $sql.= "'".$this->fk_user."'"; + $sql.= "'".$this->db->escape($this->fk_user)."'"; $sql.= ", '".$this->db->idate($this->datep)."'"; $sql.= ", '".$this->db->idate($this->datev)."'"; $sql.= ", ".$this->amount; $sql.= ", ".($this->salary > 0 ? $this->salary : "null"); - $sql.= ", '".$this->type_payment."'"; - $sql.= ", '".$this->num_payment."'"; + $sql.= ", '".$this->db->escape($this->type_payment)."'"; + $sql.= ", '".$this->db->escape($this->num_payment)."'"; if ($this->note) $sql.= ", '".$this->db->escape($this->note)."'"; $sql.= ", '".$this->db->escape($this->label)."'"; $sql.= ", '".$this->db->idate($this->datesp)."'"; $sql.= ", '".$this->db->idate($this->dateep)."'"; - $sql.= ", '".$user->id."'"; + $sql.= ", '".$this->db->escape($user->id)."'"; $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", NULL"; $sql.= ", ".$conf->entity; @@ -548,7 +548,7 @@ class PaymentSalary extends CommonObject } } - + /** * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) * @@ -559,7 +559,7 @@ class PaymentSalary extends CommonObject { return $this->LibStatut($this->statut,$mode); } - + /** * Renvoi le libelle d'un statut donne * @@ -570,7 +570,7 @@ class PaymentSalary extends CommonObject function LibStatut($status,$mode=0) { global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage - + $langs->load('compta'); /*if ($mode == 0) { @@ -609,5 +609,5 @@ class PaymentSalary extends CommonObject }*/ return ''; } - + } diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php index 678442453c6..03cef9c07e8 100644 --- a/htdocs/compta/salaries/document.php +++ b/htdocs/compta/salaries/document.php @@ -91,7 +91,7 @@ if ($object->id) $head=salaries_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), 0, 'payment'); + dol_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), -1, 'payment'); // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index e87fc932c50..f7c722e3e1d 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -73,7 +73,13 @@ else $typeid=$_REQUEST['typeid']; } -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers + + +/* + * Actions + */ + +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $search_ref=""; $search_label=""; @@ -82,6 +88,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $typeid=""; } + /* * View */ @@ -151,23 +158,23 @@ if ($result) print ''; print ''; print ''; - + print_barre_liste($langs->trans("SalariesPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); - + print '
'; print ''."\n"; print ''; // Ref print ''; // Employee print ''; // Label - print ''; + print ''; // Date print ''; // Type @@ -182,30 +189,30 @@ if ($result) print ''; } // Amount - print ''; + print ''; print ''; - + print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); - if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("BankAccount"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Employee",$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + print "\n"; while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - + print ''; $userstatic->id=$obj->uid; @@ -238,11 +245,11 @@ if ($result) $accountstatic->id=$obj->bid; $accountstatic->ref=$obj->bref; $accountstatic->number=$obj->bnumber; - + if (! empty($conf->accounting->enabled)) { $accountstatic->account_number=$obj->account_number; - + $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($obj->fk_accountancy_journal); diff --git a/htdocs/compta/salaries/info.php b/htdocs/compta/salaries/info.php index 05dc7835b68..ddb79845748 100644 --- a/htdocs/compta/salaries/info.php +++ b/htdocs/compta/salaries/info.php @@ -55,7 +55,7 @@ $object->info($id); $head = salaries_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("SalaryPayment"), 0, 'payment'); +dol_fiche_head($head, 'info', $langs->trans("SalaryPayment"), -1, 'payment'); $linkback = ''.$langs->trans("BackToList").''; @@ -72,6 +72,8 @@ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, print '
'; print '
'; +print '
'; + print '
'; - print ''; + print ''; print ''; - print ''; + print ''; print ' '; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print '
'; dol_print_object_info($object); print '
'; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 630197cfc78..0ab82a7cae3 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -67,7 +67,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) { if ($object->paye) { $result = $object->set_unpaid($user); - if ($result > 0) + if ($result > 0) { header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); exit(); @@ -350,7 +350,7 @@ if ($action == 'create') print ''.$langs->trans("Project").''; $numproject=$formproject->select_projects(-1, $projectid,'fk_project',0,0,1,1); - + print ''; } @@ -405,7 +405,7 @@ if ($id > 0) $head=tax_prepare_head($object); $totalpaye = $object->getSommePaiement(); - + // Clone confirmation if ($action === 'clone') { @@ -473,21 +473,21 @@ if ($id > 0) $morehtmlref.=''; } } - } + } $morehtmlref.='
'; - + $linkback = '' . $langs->trans("BackToList") . ''; - + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status - + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); - + print '
'; print '
'; print '
'; - + print ''; - + // Type print '"; print ""; @@ -588,7 +588,7 @@ if ($id > 0) if ($resql) { $totalpaye = 0; - + $num = $db->num_rows($resql); $i = 0; $total = 0; print '
'.$langs->trans("Type")."".$object->type_libelle."
'; @@ -598,14 +598,14 @@ if ($id > 0) print ''; print ''; print ''; - + $var=true; if ($num > 0) { while ($i < $num) { $objp = $db->fetch_object($resql); - + print "'; print '\n"; @@ -619,18 +619,18 @@ if ($id > 0) } else { - + print ''; } - + //if ($object->status == ChargeSociales::STATUS_DRAFT) //{ print "\n"; print "\n"; - + $resteapayer = $object->amount - $totalpaye; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; - + print ""; print '\n"; //} @@ -640,12 +640,12 @@ if ($id > 0) else { dol_print_error($db); - } - + } + print ''; print ''; print ''; - + print '
'; dol_fiche_end(); diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index cf359d691ec..83fe7d8b6b6 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -/** +/** * Classe permettant la gestion des paiements des charges * La tva collectee n'est calculee que sur les factures payees. */ @@ -36,7 +36,7 @@ class ChargeSociales extends CommonObject public $table='chargesociales'; public $table_element='chargesociales'; public $picto = 'bill'; - + /** * {@inheritdoc} */ @@ -110,7 +110,7 @@ class ChargeSociales extends CommonObject $this->paye = $obj->paye; $this->periode = $this->db->jdate($obj->periode); $this->import_key = $this->import_key; - + $this->db->free($resql); return 1; @@ -171,8 +171,8 @@ class ChargeSociales extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, date_creation)"; $sql.= " VALUES (".$this->type; - $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); - $sql.= ", ".($this->mode_reglement_id>0?"'".$this->mode_reglement_id."'":"NULL"); + $sql.= ", ".($this->fk_account>0 ? $this->fk_account:'NULL'); + $sql.= ", ".($this->mode_reglement_id>0 ? $this->mode_reglement_id:"NULL"); $sql.= ", '".$this->db->escape($this->lib)."'"; $sql.= ", '".$this->db->idate($this->date_ech)."'"; $sql.= ", '".$this->db->idate($this->periode)."'"; @@ -378,7 +378,7 @@ class ChargeSociales extends CommonObject if ($return) return 1; else return -1; } - + /** * Retourne le libelle du statut d'une charge (impaye, payee) * @@ -445,7 +445,7 @@ class ChargeSociales extends CommonObject if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); } - + return "Error, mode/status not found"; } diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 2ab2cb1c172..8723541efda 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -71,7 +71,7 @@ else $typeid=$_REQUEST['typeid']; } -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $search_ref=""; $search_label=""; @@ -154,7 +154,7 @@ if ($resql) print ''; print ''; print ''; - + if ($year) { $center=($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":""); @@ -177,7 +177,7 @@ if ($resql) { print '
'; print '
'.$langs->trans("Type").''.$langs->trans("Amount").'
"; print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."
'.$langs->trans("None").'
".$langs->trans("AlreadyPaid")." :".price($totalpaye)."
".$langs->trans("AmountExpected")." :".price($object->amount)."
".$langs->trans("RemainderToPay")." :'.price($resteapayer)."
'."\n"; - + print ''; // Ref print '\n"; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"id","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"cs.libelle","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"periode","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cs.paye","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"id","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"cs.libelle","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"periode","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("DateDue",$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"cs.paye","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + $i=0; $totalarray=array(); while ($i < min($num,$limit)) @@ -258,7 +258,7 @@ if ($resql) if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; $totalarray['totalttc'] += $obj->amount; - + // Due date print ''; @@ -285,7 +285,7 @@ if ($resql) print ''; print ''; } - + print '
'; @@ -209,16 +209,16 @@ if ($resql) print "
'.dol_print_date($db->jdate($obj->date_ech), 'day').'
'; print '
'; } diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 91334134a2c..b67c844a7b9 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -60,6 +60,8 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) * View */ +$form = new Form($db); + if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } $title = $langs->trans("SocialContribution") . ' - ' . $langs->trans("Info"); diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 6c88305f72e..879e9b69ee7 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -88,7 +88,7 @@ print ''; print ''; print ''; -if ($mode != 'sconly') +if ($mode != 'sconly') { $center=($year?''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."":""); print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$center,$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit, 1); @@ -116,14 +116,14 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ''; - print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LabelContrib"),$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("TypeContrib"),$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="140px"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("LabelContrib",$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("TypeContrib",$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="140px"',$sortfield,$sortorder); + print_liste_field_titre("ExpectedToPay",$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $sql = "SELECT c.id, c.libelle as lib,"; @@ -246,12 +246,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $total = 0 ; print '
'; print ''; - print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="140px"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="140px"',$sortfield,$sortorder); + print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("ExpectedToPay",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $var=1; while ($i < $num) @@ -260,7 +260,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $total = $total + $obj->amount; - + print ''; print ''."\n"; @@ -348,12 +348,12 @@ while($j<$numlt) $total = 0 ; print '
'.dol_print_date($db->jdate($obj->dm),'day').'
'; print ''; - print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datep","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder); + print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("ExpectedToPay",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"pv.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $var=1; while ($i < $num) @@ -362,7 +362,7 @@ while($j<$numlt) $total = $total + $obj->amount; - + print ''; print ''."\n"; @@ -408,7 +408,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $sal = new PaymentSalary($db); print "
"; - + print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary"; @@ -430,12 +430,12 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $total = 0 ; print '
'.dol_print_date($db->jdate($obj->dm),'day').'
'; print ''; - print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder); + print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("ExpectedToPay",$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $var=1; while ($i < $num) @@ -444,7 +444,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $total = $total + $obj->amount; - + print ''; print ''."\n"; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index ee6e7f1be27..f367f8ee436 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->load("products"); $langs->load("categories"); @@ -143,12 +143,14 @@ foreach($allparams as $key => $value) { /* * View */ + llxHeader(); + $form=new Form($db); $formother = new FormOther($db); // Show report header -$nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByProductsAndServices"); +$name=$langs->trans("SalesTurnover").', '.$langs->trans("ByProductsAndServices"); if ($modecompta=="CREANCES-DETTES") { $calcmode=$langs->trans("CalcModeDebt"); @@ -163,7 +165,7 @@ if ($modecompta=="CREANCES-DETTES") { $description.= $langs->trans("DepositsAreIncluded"); } - $builddate=time(); + $builddate=dol_now(); } else { $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; @@ -173,17 +175,20 @@ if ($modecompta=="CREANCES-DETTES") { $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } + +$name=array(); + // SQL request $catotal=0; $catotal_ht=0; @@ -266,7 +271,7 @@ if ($modecompta == 'CREANCES-DETTES') print '
'; print '
'.dol_print_date($db->jdate($obj->dateep),'day').'
'."\n"; - + // Category filter print ''; print ''; - + print ''; - + // Array header print ""; print_liste_field_titre( @@ -357,7 +362,7 @@ if ($modecompta == 'CREANCES-DETTES') if (count($name)) { foreach($name as $key=>$value) { - + print ''; // Product @@ -369,15 +374,15 @@ if ($modecompta == 'CREANCES-DETTES') } print "\n"; - + // Quantity print ''; - + // Percent; print ''; - + // Amount w/o VAT print ''; - + // Amount with VAT print ''; - + // Percent; print ''; - + // TODO: statistics? - + print "\n"; $i++; } @@ -423,7 +428,7 @@ if ($modecompta == 'CREANCES-DETTES') } print "
'; @@ -283,11 +288,11 @@ if ($modecompta == 'CREANCES-DETTES') print $langs->trans("Type"). ': '; $form->select_type_of_lines(isset($selected_type)?$selected_type:-1,'search_type',1,1,1); print ''; print ''; print '
".$linkname."'; print $qty[$key]; print ''.($qtytotal > 0 ? round(100 * $qty[$key] / $qtytotal, 2).'%' : ' ').''; /*if ($key > 0) { @@ -388,7 +393,7 @@ if ($modecompta == 'CREANCES-DETTES') print price($amount_ht[$key]); //print ''; print ''; /*if ($key > 0) { @@ -399,12 +404,12 @@ if ($modecompta == 'CREANCES-DETTES') print price($amount[$key]); //print ''; print ''.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : ' ').'
"; print '
'; - + print ''; } else { // $modecompta != 'CREANCES-DETTES' diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index ad9a8fbd346..4904f1ee5ca 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -131,12 +131,11 @@ foreach($allparams as $key => $value) { llxHeader(); - $form=new Form($db); // Show report header if ($modecompta=="CREANCES-DETTES") { - $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); + $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -144,30 +143,32 @@ if ($modecompta=="CREANCES-DETTES") { $description=$langs->trans("RulesCADue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } else { - $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); + $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink="".img_previous()." ".img_next().""; $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } +$name=array(); + // Show array print '
'; // Extra parameters management @@ -350,9 +351,9 @@ if (count($amount)) { } $i = 0; - + foreach($arrayforsort as $key => $value) { - + print ''; // Third party diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index b9fcf6b7aa3..f59b6fc454f 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->load("companies"); $langs->load("categories"); @@ -165,7 +165,7 @@ $formother = new FormOther($db); // Show report header if ($modecompta=="CREANCES-DETTES") { - $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); + $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -173,35 +173,37 @@ if ($modecompta=="CREANCES-DETTES") $description=$langs->trans("RulesCADue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } else { - $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); + $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().' '.img_next().''; $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } +$name=array(); + // Show Array $catotal=0; if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays,"; $sql.= " sum(f.total) as amount, sum(f.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; - if ($selected_cat === -2) // Without any category + if ($selected_cat === -2) // Without any category { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; } @@ -219,7 +221,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } - if ($selected_cat === -2) // Without any category + if ($selected_cat === -2) // Without any category { $sql.=" AND cs.fk_soc is null"; } @@ -239,7 +241,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if ($selected_cat === -2) // Without any category + if ($selected_cat === -2) // Without any category { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; } @@ -253,7 +255,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } - if ($selected_cat === -2) // Without any category + if ($selected_cat === -2) // Without any category { $sql.=" AND cs.fk_soc is null"; } @@ -360,7 +362,28 @@ print ''; print ''; print ''; print ''; - // Array titles + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print $form->select_country($search_country, 'search_country'); +//print ''; +print ''; +print ' '; +print ' '; +print ' '; +print ' '; +print ''; + +// Array titles print ""; print_liste_field_titre( $langs->trans("Company"), @@ -442,27 +465,6 @@ print_liste_field_titre( ); print "\n"; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print $form->select_country($search_country, 'search_country'); -//print ''; -print ''; -print ' '; -print ' '; -print ' '; -print ' '; -print ''; - -$var=true; if (count($amount)) { $arrayforsort=$name; @@ -517,7 +519,7 @@ if (count($amount)) { } foreach($arrayforsort as $key=>$value) { - + print ''; // Third party diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 19c106a44dc..335cf581740 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2017 Olivier Geffroy * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,21 +25,69 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + +$langs->loadLangs(array('compta','bills','donation','salaries')); + +$date_startmonth=GETPOST('date_startmonth'); +$date_startday=GETPOST('date_startday'); +$date_startyear=GETPOST('date_startyear'); +$date_endmonth=GETPOST('date_endmonth'); +$date_endday=GETPOST('date_endday'); +$date_endyear=GETPOST('date_endyear'); -$year_start=GETPOST("year_start"); -$year_current = strftime("%Y",time()); $nbofyear=4; -if (! $year_start) { - $year_start = $year_current - ($nbofyear-1); - $year_end = $year_current; + +// Date range +$year=GETPOST('year','int'); +if (empty($year)) +{ + $year_current = strftime("%Y",dol_now()); + $month_current = strftime("%m",dol_now()); + $year_start = $year_current - ($nbofyear - 1); +} else { + $year_current = $year; + $month_current = strftime("%m",dol_now()); + $year_start = $year - ($nbofyear - 1); } -else { - $year_end=$year_start + ($nbofyear-1); +$date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); +$date_end=dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); + +// We define date_start and date_end +if (empty($date_start) || empty($date_end)) // We define date_start and date_end +{ + $q=GETPOST("q")?GETPOST("q"):0; + if ($q==0) + { + // We define date_start and date_end + $year_end=$year_start + ($nbofyear - 1); + $month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); + if (! GETPOST('month')) + { + if (! GETPOST("year") && $month_start > $month_current) + { + $year_start--; + $year_end--; + } + $month_end=$month_start-1; + if ($month_end < 1) $month_end=12; + else $year_end++; + } + else $month_end=$month_start; + $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false); + } + if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); } + if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); } + if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } + if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } + $userid=GETPOST('userid','int'); $socid = GETPOST('socid','int'); -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') + +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') $modecompta = $conf->global->ACCOUNTING_MODE; +if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta",'alpha'); // Security check @@ -54,38 +103,57 @@ if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accountin */ llxHeader(); + $form=new Form($db); // Affiche en-tete du rapport if ($modecompta=="CREANCES-DETTES") { - $nom=$langs->trans("SalesTurnover"); + $name=$langs->trans("SalesTurnover"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $period="$year_start - $year_end"; + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCADue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else { - $nom=$langs->trans("SalesTurnover"); +else if ($modecompta=="RECETTES-DEPENSES") +{ + $name=$langs->trans("SalesTurnover"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - $period="$year_start - $year_end"; + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } +else if ($modecompta=="BOOKKEEPING") +{ + $name=$langs->trans("SalesTurnover"); + $calcmode=$langs->trans("CalcModeBookkeeping"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $description=$langs->trans("RulesCADue"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + else $description.= $langs->trans("DepositsAreIncluded"); + $builddate=dol_now(); + //$exportlink=$langs->trans("NotYetAvailable"); +} + $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -98,8 +166,10 @@ if ($modecompta == 'CREANCES-DETTES') $sql.= " WHERE f.fk_statut in (1,2)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; else $sql.= " AND f.type IN (0,1,2,3,5)"; + $sql.= " AND f.entity = ".$conf->entity; +if ($socid) $sql.= " AND f.fk_soc = ".$socid; } -else +else if ($modecompta=="RECETTES-DEPENSES") { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les @@ -111,9 +181,19 @@ else $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; $sql.= " WHERE p.rowid = pf.fk_paiement"; $sql.= " AND pf.fk_facture = f.rowid"; -} -$sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; +} +else if ($modecompta=="BOOKKEEPING") +{ + $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b"; + $sql.= " WHERE b.numero_compte IN (SELECT a.account_number" ; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_account as a"; + $sql.= " WHERE a.fk_accounting_category = 1 ) " ; // todo sql with accounting category, but we need to define category in turnover +} + + $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; @@ -222,7 +302,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) { $mois_modulo = $mois;// ajout if($mois>12){$mois_modulo = $mois-12;} // ajout - + print ''; print "".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B").""; @@ -312,7 +392,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) /* for ($mois = 1 ; $mois < 13 ; $mois++) { - + print ''; print "".dol_print_date(dol_mktime(12,0,0,$mois,1,2000),"%B").""; @@ -480,8 +560,8 @@ print '
'; $totalam_Rac += $obj->am; $i++; } - - print "Facture a encaisser : ".price($total_ttc_Rac)."<-- bug ici car n'exclut pas le deja r�gl� des factures partiellement r�gl�es"; + + print "Facture a encaisser : ".price($total_ttc_Rac)."<-- bug ici car n'exclut pas le deja r?gl? des factures partiellement r?gl?es"; } $db->free($resql); } @@ -530,7 +610,7 @@ print ''; $total_pr += $obj->total_ttc-$obj->tot_fttc; $i++; } - + print "Signe et non facture:".price($total_pr)."<-- bug ici, ca devrait exclure le deja facture"; } $db->free($resql); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 045284bd47c..5d170faf67e 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -106,12 +106,12 @@ class Tva extends CommonObject $sql.= " '".$this->db->idate($now)."',"; $sql.= " '".$this->db->idate($this->datep)."',"; $sql.= " '".$this->db->idate($this->datev)."',"; - $sql.= " '".$this->amount."',"; - $sql.= " '".$this->label."',"; - $sql.= " '".$this->note."',"; - $sql.= " ".($this->fk_bank <= 0 ? "NULL" : "'".$this->fk_bank."'").","; - $sql.= " '".$this->fk_user_creat."',"; - $sql.= " '".$this->fk_user_modif."'"; + $sql.= " '".$this->db->escape($this->amount)."',"; + $sql.= " '".$this->db->escape($this->label)."',"; + $sql.= " '".$this->db->escape($this->note)."',"; + $sql.= " ".($this->fk_bank <= 0 ? "NULL" : "'".$this->db->escape($this->fk_bank)."'").","; + $sql.= " '".$this->db->escape($this->fk_user_creat)."',"; + $sql.= " '".$this->db->escape($this->fk_user_modif)."'"; $sql.= ")"; @@ -173,18 +173,15 @@ class Tva extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."tva SET"; - - $sql.= " tms=".$this->db->idate($this->tms).","; - $sql.= " datep=".$this->db->idate($this->datep).","; - $sql.= " datev=".$this->db->idate($this->datev).","; + $sql.= " tms='".$this->db->idate($this->tms)."',"; + $sql.= " datep='".$this->db->idate($this->datep)."',"; + $sql.= " datev='".$this->db->idate($this->datev)."',"; $sql.= " amount=".price2num($this->amount).","; $sql.= " label='".$this->db->escape($this->label)."',"; $sql.= " note='".$this->db->escape($this->note)."',"; $sql.= " fk_bank=".$this->fk_bank.","; $sql.= " fk_user_creat=".$this->fk_user_creat.","; - $sql.= " fk_user_modif=".$this->fk_user_modif.""; - - + $sql.= " fk_user_modif=".($this->fk_user_modif>0?$this->fk_user_modif:$user->id).""; $sql.= " WHERE rowid=".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -538,11 +535,11 @@ class Tva extends CommonObject $sql.= "'".$this->db->idate($this->datep)."'"; $sql.= ", '".$this->db->idate($this->datev)."'"; $sql.= ", ".$this->amount; - $sql.= ", '".$this->type_payment."'"; - $sql.= ", '".$this->num_payment."'"; + $sql.= ", '".$this->db->escape($this->type_payment)."'"; + $sql.= ", '".$this->db->escape($this->num_payment)."'"; if ($this->note) $sql.=", '".$this->db->escape($this->note)."'"; if ($this->label) $sql.=", '".$this->db->escape($this->label)."'"; - $sql.= ", '".$user->id."'"; + $sql.= ", '".$this->db->escape($user->id)."'"; $sql.= ", NULL"; $sql.= ", ".$conf->entity; $sql.= ")"; @@ -580,7 +577,7 @@ class Tva extends CommonObject } else { $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs($this->amount), '', '', $user); } - + // Update fk_bank into llx_tva. So we know vat line used to generate bank transaction if ($bank_line_id > 0) { @@ -731,7 +728,7 @@ class Tva extends CommonObject { return $this->LibStatut($this->statut,$mode); } - + /** * Renvoi le libelle d'un statut donne * diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 0ede7fa091e..276f801d05b 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -160,7 +160,7 @@ if ($modetax==1) { // Calculate on invoice for goods and services . $langs->trans('AddExtraReport') . '' . '
'; - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); $elementcust=$langs->trans("CustomersInvoices"); @@ -204,7 +204,7 @@ if ($modetax==0) { // Invoice for goods, payment for services . $langs->trans('AddExtraReport') . '' . '
'; - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); $elementcust=$langs->trans("CustomersInvoices"); @@ -220,7 +220,7 @@ if ($modetax==0) { // Invoice for goods, payment for services $vatsup.=' ('.$langs->trans("ToGetBack").')'; } } -report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); @@ -260,7 +260,7 @@ if (is_array($coll_list)) { $i = 1; foreach ($coll_list as $coll) { if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { if($coll->assuj == '1') { @@ -340,7 +340,7 @@ if (is_array($coll_list)) { $i = 1; foreach ($coll_list as $coll) { if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - + $intra = str_replace($find,$replace,$coll->tva_intra); if (empty($intra)) { if ($coll->assuj == '1') { diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 105bfcb2bf6..89accf57492 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -83,7 +83,7 @@ function pt ($db, $sql, $date) while ($i < $num) { $obj = $db->fetch_object($result); - + print ''; print ''.$obj->dm."\n"; $total = $total + $obj->mm; @@ -117,7 +117,7 @@ $textprevyear="".img_previo $textnextyear=" ".img_next($langs->trans("Next"), 'class="valignbottom"').""; print $conf->dol_optimize_smallscreen; -print load_fiche_titre($langs->trans("VAT"), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png'); +print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png'); print $langs->trans("VATReportBuildWithOptionDefinedInModule").'
'; print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')
'; @@ -147,14 +147,14 @@ for ($m = 1 ; $m < 13 ; $m++ ) { $coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m); $coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m); - + $action = "tva"; $object = array(&$coll_listsell, &$coll_listbuy); $parameters["mode"] = $modetax; $parameters["year"] = $y; $parameters["month"] = $m; $parameters["type"] = 'vat'; - + // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -171,7 +171,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) break; } - + print ''; print ''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").''; @@ -220,22 +220,67 @@ print ''; print '
'; + print load_fiche_titre($langs->trans("VATPaid"), '', ''); /* * Payed */ -$sql = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm"; +$sql = "SELECT SUM(amount) as mm, date_format(f.datep,'%Y-%m') as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as f"; $sql.= " WHERE f.entity = ".$conf->entity; -$sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'"; -$sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'"; +$sql.= " AND f.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'"; +$sql.= " AND f.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'"; $sql.= " GROUP BY dm ORDER BY dm ASC"; pt($db, $sql,$langs->trans("Year")." $y"); +print '
'; + + + +if (! empty($conf->global->MAIN_FEATURES_LEVEL)) +{ + /* + * Recap + */ + + print load_fiche_titre($langs->trans("VATRecap"), '', ''); // need to add translation + + $sql1 = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y') as dm"; + $sql1 .= " FROM " . MAIN_DB_PREFIX . "tva as f"; + $sql1 .= " WHERE f.entity = " . $conf->entity; + $sql1 .= " AND f.datev >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'"; + $sql1 .= " AND f.datev <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'"; + $sql1 .= " GROUP BY dm ORDER BY dm ASC"; + + $result = $db->query($sql1); + if ($result) { + $obj = $db->fetch_object($result); + print ''; + + print ""; + print ''; // need to add translation + print ''; + print "\n"; + + print ""; + print ''; + print '\n"; + print "\n"; + + $restopay = $total - $obj->mm; + print ""; + print ''; // need to add translation + print ''; + print "\n"; + + print '
' . $langs->trans("VATDue") . '' . price(price2num($total, 'MT')) . '
' . $langs->trans("VATPaid") . '' . price(price2num($obj->mm, 'MT')) . "
' . $langs->trans("VATRestopay") . '' . price(price2num($restopay, 'MT')) . '
'; + } +} + print '
'; llxFooter(); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 513eb25ff7e..c622881d273 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -133,7 +133,7 @@ $fsearch.=' '; // Affiche en-tete du rapport if ($modetax==1) // Calculate on invoice for goods and services { - $nom=$langs->trans("VATReportByQuartersInDueDebtMode"); + $name=$langs->trans("VATReportByQuartersInDueDebtMode"); $calcmode=$langs->trans("CalcModeVATDebt"); $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -152,7 +152,7 @@ if ($modetax==1) // Calculate on invoice for goods and services if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); $description.=$fsearch; - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); // Customers invoices @@ -172,7 +172,7 @@ if ($modetax==1) // Calculate on invoice for goods and services } if ($modetax==0) // Invoice for goods, payment for services { - $nom=$langs->trans("VATReportByQuartersInInputOutputMode"); + $name=$langs->trans("VATReportByQuartersInInputOutputMode"); $calcmode=$langs->trans("CalcModeVATEngagement"); $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -192,7 +192,7 @@ if ($modetax==0) // Invoice for goods, payment for services //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); // Customers invoices @@ -210,7 +210,7 @@ if ($modetax==0) // Invoice for goods, payment for services if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); @@ -396,7 +396,7 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - + print ''; // Ref @@ -553,7 +553,7 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - + print ''; // Ref diff --git a/htdocs/compta/tva/quarter_report.php b/htdocs/compta/tva/quarter_report.php index a3d902ed3f3..4c054923837 100644 --- a/htdocs/compta/tva/quarter_report.php +++ b/htdocs/compta/tva/quarter_report.php @@ -146,7 +146,7 @@ $fsearch.=' '; // Affiche en-tete du rapport if ($modetax==1) { // Calculate on invoice for goods and services - $nom=$langs->trans("VATReportByQuartersInDueDebtMode"); + $name=$langs->trans("VATReportByQuartersInDueDebtMode"); $calcmode=$langs->trans("CalcModeVATDebt"); $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -174,7 +174,7 @@ if ($modetax==1) { // Calculate on invoice for goods and services $description.='
'.$langs->trans("DepositsAreIncluded"); } $description.=$fsearch; - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); $elementcust=$langs->trans("CustomersInvoices"); @@ -195,7 +195,7 @@ if ($modetax==1) { // Calculate on invoice for goods and services } } if ($modetax==0) { // Invoice for goods, payment for services - $nom=$langs->trans("VATReportByQuartersInInputOutputMode"); + $name=$langs->trans("VATReportByQuartersInInputOutputMode"); $calcmode=$langs->trans("CalcModeVATEngagement"); $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -224,7 +224,7 @@ if ($modetax==0) { // Invoice for goods, payment for services //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; - $builddate=time(); + $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); $elementcust=$langs->trans("CustomersInvoices"); @@ -244,7 +244,7 @@ if ($modetax==0) { // Invoice for goods, payment for services $vatsup.=' ('.$langs->trans("ToGetBack").')'; } } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); @@ -373,18 +373,18 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print ''.$langs->trans("AmountHTVATRealReceived").''; print ''.$vatcust.''; print ''; - + $action = "tvadetail"; $parameters["mode"] = $modetax; $parameters["start"] = $date_start; $parameters["end"] = $date_end; $parameters["type"] = 'vat'; - + $object = array(&$x_coll, &$x_paye, &$x_both); // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - + foreach (array_keys($x_coll) as $rate) { $subtot_coll_total_ht = 0; $subtot_coll_vat = 0; @@ -408,7 +408,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $type=1; } - + print ''; // Ref @@ -576,7 +576,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $type=1; } - + print ''; // Ref diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 44c45a65dc7..0d4d827e694 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -74,7 +74,7 @@ else $typeid=$_REQUEST['typeid']; } -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { $search_ref=""; $search_label=""; @@ -156,9 +156,9 @@ if ($result) print ''; print ''; print ''; - + print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit); - + print '
'; print ''; @@ -190,16 +190,16 @@ if ($result) print "\n"; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateValue"),$_SERVER["PHP_SELF"],"dv","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); - if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("DateValue",$_SERVER["PHP_SELF"],"dv","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); @@ -252,7 +252,7 @@ if ($result) $i++; } - + $colspan=5; if (! empty($conf->banque->enabled)) $colspan++; print ''; @@ -261,7 +261,7 @@ if ($result) print "
'.$langs->trans("Total").'
"; print '
'; - + print ''; $db->free($result); diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 74ec89bf5d1..04c62107e83 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -115,14 +115,14 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { // Cancel - if (GETPOST("cancel") && ! empty($backtopage)) + if (GETPOST('cancel','alpha') && ! empty($backtopage)) { header("Location: ".$backtopage); exit; } // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $actioncode=''; $search_agenda_label=''; @@ -211,7 +211,7 @@ else dol_fiche_head($head, 'agenda', $title, -1, 'contact'); $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
'; if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { @@ -223,42 +223,42 @@ else else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany"); } $morehtmlref.='
'; - + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); - + print '
'; - + print '
'; - + $object->info($id); print dol_print_object_info($object, 1); - + print '
'; - + print dol_fiche_end(); - + // Actions buttons - + $objcon=$object; $object->fetch_thirdparty(); $objthirdparty=$object->thirdparty; - + $out=''; $permok=$user->rights->agenda->myactions->create; if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; } - - + + print '
'; - + if (! empty($conf->agenda->enabled)) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) @@ -270,22 +270,22 @@ else print ''.$langs->trans("AddAction").''; } } - + print '
'; - + if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) { $param='&id='.$id; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - - + + print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'',''); - + // List of all actions $filters=array(); $filters['search_agenda_label']=$search_agenda_label; - + show_actions_done($conf,$langs,$db,$objthirdparty,$object,0,$actioncode, '', $filters, $sortfield, $sortorder); } } diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 3d6b792d99b..b5df91ce210 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -79,18 +79,18 @@ abstract class ActionsContactCardCommon */ function getObject($id) { - $ret = $this->getInstanceDao(); + /*$ret = $this->getInstanceDao(); if (is_object($this->object) && method_exists($this->object,'fetch')) { if (! empty($id)) $this->object->fetch($id); } else - { + {*/ $object = new Contact($this->db); if (! empty($id)) $object->fetch($id); $this->object = $object; - } + //} } /** diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index 30a52469da2..bfcb5a21142 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -75,6 +75,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon */ function assign_values(&$action, $id) { + global $limit, $offset, $sortfield, $sortorder; global $conf, $db, $langs, $user; global $form; @@ -113,14 +114,14 @@ class ActionsContactCardDefault extends ActionsContactCardCommon if ($action == 'list') { - $this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']); + $this->LoadListDatas($limit, $offset, $sortfield, $sortorder); } } /** - * Fetch datas list + * Fetch datas list and save into ->list_datas * * @param int $limit Limit number of responses * @param int $offset Offset for first response diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index fbd27b0d841..7dffd99f8bf 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -91,7 +91,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { // Cancel - if (GETPOST("cancel") && ! empty($backtopage)) + if (GETPOST('cancel','alpha') && ! empty($backtopage)) { header("Location: ".$backtopage); exit; @@ -625,7 +625,7 @@ else // EMail if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party print ''; - print 'email).'">'; + print 'email).'">'; if (! empty($conf->mailing->enabled)) { print ''; @@ -860,7 +860,7 @@ else // EMail print ''; - print 'email).'">'; + print 'email).'">'; if (! empty($conf->mailing->enabled)) { $langs->load("mails"); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index b80a300431a..2329ae63685 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -108,7 +108,7 @@ class Contact extends CommonObject $this->db = $db; $this->statut = 1; // By default, status is enabled } - + /** * Load indicators into this->nb for board * @@ -117,10 +117,10 @@ class Contact extends CommonObject function load_state_board() { global $user; - + $this->nb=array(); $clause = "WHERE"; - + $sql = "SELECT count(sp.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; if (!$user->rights->societe->client->voir && !$user->societe_id) @@ -133,7 +133,7 @@ class Contact extends CommonObject $sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')'; $sql.= " AND (sp.priv='0' OR (sp.priv='1' AND sp.fk_user_creat=".$user->id."))"; if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id; - + $resql=$this->db->query($sql); if ($resql) { @@ -200,7 +200,7 @@ class Contact extends CommonObject $sql.= " ".(! empty($this->canvas)?"'".$this->db->escape($this->canvas)."'":"null").","; $sql.= " ".$conf->entity.","; $sql.= "'".$this->db->escape($this->ref_ext)."',"; - $sql.= " ".(! empty($this->import_key)?"'".$this->import_key."'":"null"); + $sql.= " ".(! empty($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null"); $sql.= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -319,9 +319,9 @@ class Contact extends CommonObject $sql .= ", jabberid = ".(isset($this->jabberid)?"'".$this->db->escape($this->jabberid)."'":"null"); $sql .= ", priv = '".$this->db->escape($this->priv)."'"; $sql .= ", statut = ".$this->statut; - $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"NULL"); - $sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"NULL"); - $sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"0"); + $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape($user->id)."'":"NULL"); + $sql .= ", default_lang=".($this->default_lang?"'".$this->db->escape($this->default_lang)."'":"NULL"); + $sql .= ", no_email=".($this->no_email?"'".$this->db->escape($this->no_email)."'":"0"); $sql .= " WHERE rowid=".$this->db->escape($id); dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -410,7 +410,9 @@ class Contact extends CommonObject { global $conf,$langs; - // Object classes + $info = array(); + + // Object classes $info["objectclass"]=explode(',',$conf->global->LDAP_CONTACT_OBJECT_CLASS); $this->fullname=$this->getFullName($langs); @@ -486,11 +488,11 @@ class Contact extends CommonObject $result=false; $this->db->begin(); - + // Mis a jour contact $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET"; $sql.= " birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null"); - $sql.= ", photo = ".($this->photo? "'".$this->photo."'" : "null"); + $sql.= ", photo = ".($this->photo? "'".$this->db->escape($this->photo)."'" : "null"); if ($user) $sql .= ", fk_user_modif=".$user->id; $sql.= " WHERE rowid=".$this->db->escape($id); @@ -544,7 +546,7 @@ class Contact extends CommonObject if ($result < 0) { $error++; } // End call triggers } - + if (! $error) { $this->db->commit(); @@ -659,7 +661,7 @@ class Contact extends CommonObject $this->canvas = $obj->canvas; $this->import_key = $obj->import_key; - + // Define gender according to civility $this->setGenderFromCivility(); @@ -735,7 +737,7 @@ class Contact extends CommonObject /** * Set property ->gender from property ->civility_id - * + * * @return void */ function setGenderFromCivility() @@ -746,8 +748,8 @@ class Contact extends CommonObject } else if(in_array($this->civility_id, array('MME','MLE'))) { $this->gender = 'woman'; } - } - + } + /** * Load number of elements the contact is used as a link for * ref_facturation @@ -1007,13 +1009,13 @@ class Contact extends CommonObject if ($this->phone_perso) $phonelist[]=$this->phone_perso; $label.= '
' . $langs->trans("Phone") . ': '.join(', ',$phonelist); $label.= '
' . $langs->trans("Address") . ': '.dol_format_address($this, 1, ' ', $langs); - + $link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label=$langs->trans("ShowContact"); - $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.= ' class="classfortooltip">'; @@ -1029,15 +1031,15 @@ class Contact extends CommonObject if ($reshook > 0) $linkclose = $hookmanager->resPrint; $link.=$linkclose; - + $linkend=''; - + if ($option == 'xxx') { $link = ''; $linkend=''; } - + if ($withpicto) $result.=($link.img_object($label, 'contact', 'class="classfortooltip"').$linkend.' '); $result.=$link.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$linkend; return $result; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1293a258fab..ebf7bc611f9 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -48,12 +48,15 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $contactid,''); $sall=GETPOST('sall', 'alphanohtml'); +$search_cti=preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars +$search_phone=GETPOST("search_phone"); + +$search_id=trim(GETPOST("search_id","int")); $search_firstlast_only=GETPOST("search_firstlast_only"); $search_lastname=GETPOST("search_lastname"); $search_firstname=GETPOST("search_firstname"); $search_societe=GETPOST("search_societe"); $search_poste=GETPOST("search_poste"); -$search_phone=GETPOST("search_phone"); $search_phone_perso=GETPOST("search_phone_perso"); $search_phone_pro=GETPOST("search_phone_pro"); $search_phone_mobile=GETPOST("search_phone_mobile"); @@ -66,6 +69,7 @@ $search_categ_thirdparty=GETPOST("search_categ_thirdparty",'int'); $search_categ_supplier=GETPOST("search_categ_supplier",'int'); $search_status=GETPOST("search_status",'int'); $search_type=GETPOST('search_type','alpha'); +$search_import_key = GETPOST("search_import_key","alpha"); if ($search_status=='') $search_status=1; // always display activ customer first $optioncss = GETPOST('optioncss','alpha'); @@ -132,22 +136,24 @@ $fieldstosearchall = array( // Definition of fields for list $arrayfields=array( - 'p.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), - 'p.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'p.poste'=>array('label'=>$langs->trans("PostOrFunction"), 'checked'=>1), - 'p.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0), - 'p.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), - 'p.phone'=>array('label'=>$langs->trans("Phone"), 'checked'=>1), - 'p.phone_perso'=>array('label'=>$langs->trans("PhonePerso"), 'checked'=>0), - 'p.phone_mobile'=>array('label'=>$langs->trans("PhoneMobile"), 'checked'=>1), - 'p.fax'=>array('label'=>$langs->trans("Fax"), 'checked'=>1), - 'p.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1), - 'p.skype'=>array('label'=>$langs->trans("Skype"), 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))), - 'p.thirdparty'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)), - 'p.priv'=>array('label'=>$langs->trans("ContactVisibility"), 'checked'=>1, 'position'=>200), - 'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), - 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'p.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'p.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0)), + 'p.lastname'=>array('label'=>"Lastname", 'checked'=>1), + 'p.firstname'=>array('label'=>"Firstname", 'checked'=>1), + 'p.poste'=>array('label'=>"PostOrFunction", 'checked'=>1), + 'p.town'=>array('label'=>"Town", 'checked'=>0), + 'p.zip'=>array('label'=>"Zip", 'checked'=>0), + 'p.phone'=>array('label'=>"Phone", 'checked'=>1), + 'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0), + 'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1), + 'p.fax'=>array('label'=>"Fax", 'checked'=>1), + 'p.email'=>array('label'=>"EMail", 'checked'=>1), + 'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))), + 'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)), + 'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200), + 'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500), + 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 'p.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), + 'p.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100), ); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) @@ -170,8 +176,8 @@ if (($id > 0 || ! empty($ref)) && $action != 'add') * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -186,6 +192,7 @@ if (empty($reshook)) if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter')) // All tests are required to be compatible with all browsers { $sall=""; + $search_id=''; $search_firstlast_only=""; $search_lastname=""; $search_firstname=""; @@ -203,6 +210,7 @@ if (empty($reshook)) $search_categ=''; $search_categ_thirdparty=''; $search_categ_supplier=''; + $search_import_key=''; $toselect=''; $search_array_options=array(); } @@ -272,53 +280,27 @@ if ($search_categ > 0) $sql.= " AND cc.fk_categorie = ".$db->escape($search_ca if ($search_categ == -2) $sql.= " AND cc.fk_categorie IS NULL"; if ($search_categ_thirdparty > 0) $sql.= " AND cs.fk_categorie = ".$db->escape($search_categ_thirdparty); if ($search_categ_thirdparty == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_categ_supplier > 0) $sql.= " AND cs2.fk_categorie = ".$db->escape($search_categ_supplier); -if ($search_categ_supplier == -2) $sql.= " AND cs2.fk_categorie IS NULL"; +if ($search_categ_supplier > 0) $sql.= " AND cs2.fk_categorie = ".$db->escape($search_categ_supplier); +if ($search_categ_supplier == -2) $sql.= " AND cs2.fk_categorie IS NULL"; -if ($search_firstlast_only) { - $sql .= natural_search(array('p.lastname','p.firstname'), $search_firstlast_only); -} -if ($search_lastname) { // filter on lastname - $sql .= natural_search('p.lastname', $search_lastname); -} -if ($search_firstname) { // filter on firstname - $sql .= natural_search('p.firstname', $search_firstname); -} -if ($search_societe) { // filtre sur la societe - $sql .= natural_search('s.nom', $search_societe); -} -if (strlen($search_poste)) { // filtre sur la societe - $sql .= natural_search('p.poste', $search_poste); -} -if (strlen($search_phone)) -{ - $sql .= " AND (p.phone LIKE '%".$db->escape($search_phone)."%' OR p.phone_perso LIKE '%".$db->escape($search_phone)."%' OR p.phone_mobile LIKE '%".$db->escape($search_phone)."%')"; -} -if (strlen($search_phone_perso)) -{ - $sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phone_perso)."%'"; -} -if (strlen($search_phone_pro)) -{ - $sql .= " AND p.phone LIKE '%".$db->escape($search_phone_pro)."%'"; -} -if (strlen($search_phone_mobile)) -{ - $sql .= " AND p.phone_mobile LIKE '%".$db->escape($search_phone_mobile)."%'"; -} -if (strlen($search_fax)) -{ - $sql .= " AND p.fax LIKE '%".$db->escape($search_fax)."%'"; -} -if (strlen($search_email)) // filtre sur l'email -{ - $sql .= " AND p.email LIKE '%".$db->escape($search_email)."%'"; -} -if (strlen($search_skype)) // filtre sur skype -{ - $sql .= " AND p.skype LIKE '%".$db->escape($search_skype)."%'"; -} -if ($search_status != '' && $search_status >= 0) $sql .= " AND p.statut = ".$db->escape($search_status); +if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall); +if (strlen($search_phone)) $sql.= natural_search(array('p.phone', 'p.phone_perso', 'p.phone_mobile'), $search_phone); +if (strlen($search_cti)) $sql.= natural_search(array('p.phone', 'p.phone_perso', 'p.phone_mobile'), $search_cti); +if (strlen($search_firstlast_only)) $sql.= natural_search(array('p.lastname', 'p.firstname'), $search_firstlast_only); + +if ($search_id > 0) $sql.= natural_search("p.rowid",$search_id,1); +if ($search_lastname) $sql.= natural_search('p.lastname', $search_lastname); +if ($search_firstname) $sql.= natural_search('p.firstname', $search_firstname); +if ($search_societe) $sql.= natural_search('s.nom', $search_societe); +if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_poste); +if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso); +if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone); +if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile); +if (strlen($search_fax)) $sql.= natural_search('p.phone_fax', $search_fax); +if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype); +if (strlen($search_email)) $sql.= natural_search('p.email', $search_email); +if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status); +if ($search_import_key) $sql.= natural_search("p.import_key",$search_import_key); if ($type == "o") // filtre sur type { $sql .= " AND p.fk_soc IS NULL"; @@ -335,10 +317,6 @@ else if ($type == "p") // filtre sur type { $sql .= " AND s.client IN (2, 3)"; } -if ($sall) -{ - $sql .= natural_search(array_keys($fieldstosearchall), $sall); -} if (! empty($socid)) { $sql .= " AND s.rowid = ".$socid; @@ -350,8 +328,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -391,7 +370,7 @@ $num = $db->num_rows($result); $arrayofselected=is_array($toselect)?$toselect:array(); -if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) +if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $seearch_cti != '')) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -411,6 +390,7 @@ if (!empty($search_categ)) $param.='&search_categ='.urlencode($search_categ); if (!empty($search_categ_thirdparty)) $param.='&search_categ_thirdparty='.urlencode($search_categ_thirdparty); if (!empty($search_categ_supplier)) $param.='&search_categ_supplier='.urlencode($search_categ_supplier); if ($sall != '') $param.='&sall='.urlencode($sall); +if ($search_id > 0) $param.= "&search_id=".urlencode($search_id); if ($search_lastname != '') $param.='&search_lastname='.urlencode($search_lastname); if ($search_firstname != '') $param.='&search_firstname='.urlencode($search_firstname); if ($search_societe != '') $param.='&search_societe='.urlencode($search_societe); @@ -424,6 +404,7 @@ if ($search_fax != '') $param.='&search_fax='.urlencode($search_fax); if ($search_email != '') $param.='&search_email='.urlencode($search_email); if ($search_status != '') $param.='&search_status='.urlencode($search_status); if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv); +if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key); if ($optioncss != '') $param.='&optioncss='.$optioncss; // Add $param from extra fields foreach ($search_array_options as $key => $val) @@ -508,6 +489,12 @@ print ''; +if (! empty($arrayfields['p.rowid']['checked'])) +{ + print ''; +} if (! empty($arrayfields['p.lastname']['checked'])) { print ''; } +if (! empty($arrayfields['p.import_key']['checked'])) +{ + print ''; +} // Action column print ''; // Ligne des titres print ''; -if (! empty($arrayfields['p.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.lastname", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.firstname']['checked'])) print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.zip']['checked'])) print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"p.zip", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.town']['checked'])) print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"p.town", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.poste']['checked'])) print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.phone']['checked'])) print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field_titre($langs->trans("PhonePerso"),$_SERVER["PHP_SELF"],"p.phone_perso", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.email']['checked'])) print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.skype']['checked'])) print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.thirdparty']['checked'])) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder); -if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder); +if (! empty($arrayfields['p.rowid']['checked'])) print_liste_field_titre($arrayfields['p.rowid']['label'], $_SERVER["PHP_SELF"],"p.rowid","",$param,"",$sortfield,$sortorder); +if (! empty($arrayfields['p.lastname']['checked'])) print_liste_field_titre($arrayfields['p.lastname']['label'],$_SERVER["PHP_SELF"],"p.lastname", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.firstname']['checked'])) print_liste_field_titre($arrayfields['p.firstname']['label'],$_SERVER["PHP_SELF"],"p.firstname", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.zip']['checked'])) print_liste_field_titre($arrayfields['p.zip']['label'],$_SERVER["PHP_SELF"],"p.zip", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.town']['checked'])) print_liste_field_titre($arrayfields['p.town']['label'],$_SERVER["PHP_SELF"],"p.town", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.poste']['checked'])) print_liste_field_titre($arrayfields['p.poste']['label'],$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.phone']['checked'])) print_liste_field_titre($arrayfields['p.phone']['label'],$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field_titre($arrayfields['p.phone_perso']['label'],$_SERVER["PHP_SELF"],"p.phone_perso", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'],$_SERVER["PHP_SELF"],"p.phone_mobile", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($arrayfields['p.fax']['label'],$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.email']['checked'])) print_liste_field_titre($arrayfields['p.email']['label'],$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.skype']['checked'])) print_liste_field_titre($arrayfields['p.skype']['label'],$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.thirdparty']['checked'])) print_liste_field_titre($arrayfields['p.thirdparty']['label'],$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder); +if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($arrayfields['p.priv']['label'],$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -666,17 +660,18 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } // Hook fields -$parameters=array('arrayfields'=>$arrayfields); +$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['p.statut']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'align="center"',$sortfield,$sortorder); +if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); +if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); +if (! empty($arrayfields['p.statut']['checked'])) print_liste_field_titre($arrayfields['p.statut']['label'],$_SERVER["PHP_SELF"],"p.statut","",$param,'align="center"',$sortfield,$sortorder); +if (! empty($arrayfields['p.import_key']['checked'])) print_liste_field_titre($arrayfields['p.import_key']['label'],$_SERVER["PHP_SELF"],"p.import_key","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -701,7 +696,15 @@ while ($i < min($num,$limit)) $contactstatic->zip=$obj->zip; $contactstatic->town=$obj->town; - // Name + // ID + if (! empty($arrayfields['p.rowid']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + } + // Name if (! empty($arrayfields['p.lastname']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } + if (! empty($arrayfields['p.import_key']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + } - // Action column + // Action column print ''; } print ''."\n"; @@ -1312,6 +1319,11 @@ else { print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); + } + if ($action == 'activate') + { + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ActivateAllOnContract"),$langs->trans("ConfirmActivateAllOnContract"),"confirm_activate",'',0,1); + } /* @@ -1482,7 +1494,7 @@ else $sql.= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,"; $sql.= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,"; $sql.= " cd.fk_unit,"; - $sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity"; + $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $sql.= " WHERE cd.rowid = ".$object->lines[$cursorline-1]->id; @@ -1513,7 +1525,7 @@ else if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { print ''; - // Libelle + // Label if ($objp->fk_product > 0) { print '\n"; + print '\n"; } // TVA print ''; @@ -1918,9 +1940,11 @@ else /** * Disable a contract line */ - print ''; + print ''."\n"; + print ''; print ''; + print ''; print '
'; + print ''; + print ''; @@ -629,10 +616,16 @@ if (! empty($arrayfields['p.tms']['checked'])) // Status if (! empty($arrayfields['p.statut']['checked'])) { - print ''; + print ''; print $form->selectarray('search_status', array('-1'=>'', '0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print ''; + print ''; + print ''; $searchpicto=$form->showFilterButtons(); @@ -643,19 +636,20 @@ print '
'; + print $obj->rowid; + print "'; @@ -836,8 +839,15 @@ while ($i < min($num,$limit)) print ''.$contactstatic->getLibStatut(3).''; + print $obj->import_key; + print "'; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index b2ab3bf3cb8..5b109c7b0d7 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -312,7 +312,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; - if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); if (empty($newlang)) $newlang=$srcobject->thirdparty->default_lang; if (! empty($newlang)) { @@ -585,7 +585,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -636,7 +636,7 @@ if (empty($reshook)) } } - else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel')) + else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha')) { $objectline = new ContratLigne($db); if ($objectline->fetch(GETPOST('elrowid'))) @@ -752,7 +752,13 @@ if (empty($reshook)) // Close all lines else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) { - $object->cloture($user); + $object->closeAll($user); + } + + // Close all lines + else if ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer) + { + $object->activateAll($user); } else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) @@ -816,7 +822,7 @@ if (empty($reshook)) } elseif ($action=='setref_supplier') { - $cancelbutton = GETPOST('cancel'); + $cancelbutton = GETPOST('cancel','alpha'); if (!$cancelbutton) { $result = $object->fetch($id); @@ -840,7 +846,7 @@ if (empty($reshook)) } elseif ($action=='setref_customer') { - $cancelbutton = GETPOST('cancel'); + $cancelbutton = GETPOST('cancel','alpha'); if (!$cancelbutton) { @@ -865,7 +871,7 @@ if (empty($reshook)) } elseif ($action=='setref') { - $cancelbutton = GETPOST('cancel'); + $cancelbutton = GETPOST('cancel','alpha'); if (!$cancelbutton) { $result = $object->fetch($id); @@ -889,7 +895,7 @@ if (empty($reshook)) } elseif ($action=='setdate_contrat') { - $cancelbutton = GETPOST('cancel'); + $cancelbutton = GETPOST('cancel','alpha'); if (!$cancelbutton) { $result = $object->fetch($id); @@ -922,7 +928,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -1153,6 +1159,7 @@ if ($action == 'create') { print ''; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); + print ' '.$langs->trans("AddThirdParty").''; print '
'; @@ -1521,19 +1533,21 @@ else $productstatic->type=$objp->ptype; $productstatic->ref=$objp->pref; $productstatic->entity=$objp->pentity; - $text = $productstatic->getNomUrl(1,'',20); - if ($objp->label) + $productstatic->label=$objp->plabel; + $text = $productstatic->getNomUrl(1,'',20); + if ($objp->plabel) { $text .= ' - '; - $productstatic->ref=$objp->label; - $text .= $productstatic->getNomUrl(0,'',16); + //$productstatic->ref=$objp->label; + //$text .= $productstatic->getNomUrl(0,'',16); + $text .= $objp->plabel; } $description = $objp->description; // Add description in form if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) { - $text .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + $text .= (! empty($objp->description) && $objp->description!=$objp->plabel)?'
'.dol_htmlentitiesbr($objp->description):''; $description = ''; // Already added into main visible desc } @@ -1543,7 +1557,7 @@ else } else { - print '
'.dol_htmlentitiesbr($objp->description)."'.img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description)."'; @@ -1614,7 +1628,7 @@ else print $langs->trans("DateStartPlanned").': '; if ($objp->date_debut) { - print dol_print_date($db->jdate($objp->date_debut)); + print dol_print_date($db->jdate($objp->date_debut), 'day'); // Warning si date prevu passee et pas en service if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) { $warning_delay=$conf->contrat->services->inactifs->warning_delay / 3600 / 24; @@ -1627,7 +1641,7 @@ else print $langs->trans("DateEndPlanned").': '; if ($objp->date_fin) { - print dol_print_date($db->jdate($objp->date_fin)); + print dol_print_date($db->jdate($objp->date_fin), 'day'); if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) { $warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24; $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); @@ -1782,7 +1796,7 @@ else { $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); - $comment = GETPOST('comment'); + $comment = GETPOST('comment','alpha'); $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); print '
'; } @@ -1794,8 +1808,16 @@ else { $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); - $comment = GETPOST('comment'); - $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); + $comment = GETPOST('comment','alpha'); + + if (empty($dateactend)) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEndReal")), null, 'errors'); + } + else + { + $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne','int')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); + } print '
'; } @@ -1838,21 +1860,21 @@ else // Si pas encore active if (! $objp->date_debut_reelle) { print $langs->trans("DateStartReal").': '; - if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle); + if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle, 'day'); else print $langs->trans("ContractStatusNotRunning"); } // Si active et en cours if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) { print $langs->trans("DateStartReal").': '; - print dol_print_date($objp->date_debut_reelle); + print dol_print_date($objp->date_debut_reelle, 'day'); } // Si desactive if ($objp->date_debut_reelle && $objp->date_fin_reelle) { print $langs->trans("DateStartReal").': '; - print dol_print_date($objp->date_debut_reelle); + print dol_print_date($objp->date_debut_reelle, 'day'); print '  -  '; print $langs->trans("DateEndReal").': '; - print dol_print_date($objp->date_fin_reelle); + print dol_print_date($objp->date_fin_reelle, 'day'); } if (! empty($objp->comment)) print "
".$objp->comment; print '
'; @@ -1957,7 +1981,7 @@ else print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -206,7 +207,7 @@ $listofstatus=array(0,4,4,5); $bool=false; foreach($listofstatus as $status) { if (empty($conf->use_javascript_ajax)) - { + { print ''; print ''; print ''; @@ -267,7 +268,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) print ''; //$tot_ttc+=$obj->total_ttc; $i++; - + } } else @@ -327,7 +328,7 @@ if ($result) while ($i < $num) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($result); print ''; print ''; print ''; print ''; print ''; // Ref diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 94f4229e0db..a1ff6417f92 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -33,8 +33,8 @@ // Build doc if ($action == 'builddoc' && $permissioncreate) { - - if (is_numeric(GETPOST('model'))) + + if (is_numeric(GETPOST('model','alpha'))) { $error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model")); } @@ -48,18 +48,18 @@ if ($action == 'builddoc' && $permissioncreate) dol_print_error('Object must have been loaded by a fetch'); exit; }*/ - + // Save last template used to generate document - if (GETPOST('model')) + if (GETPOST('model','alpha')) { $object->setDocModel($user, GETPOST('model','alpha')); } - + // Special case to force bank account //if (property_exists($object, 'fk_bank')) //{ - if (GETPOST('fk_bank')) { // this field may come from an external module - $object->fk_bank = GETPOST('fk_bank'); + if (GETPOST('fk_bank','int')) { // this field may come from an external module + $object->fk_bank = GETPOST('fk_bank','int'); } else if (! empty($object->fk_account)) { $object->fk_bank = $object->fk_account; } @@ -68,7 +68,7 @@ if ($action == 'builddoc' && $permissioncreate) $outputlangs = $langs; $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->thirdparty->default_lang)) $newlang=$object->thirdparty->default_lang; // for proposal, order, invoice, ... if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->default_lang)) $newlang=$object->default_lang; // for thirdparty if (! empty($newlang)) @@ -76,13 +76,13 @@ if ($action == 'builddoc' && $permissioncreate) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - + // To be sure vars is defined if (empty($hidedetails)) $hidedetails=0; if (empty($hidedesc)) $hidedesc=0; if (empty($hideref)) $hideref=0; if (empty($moreparams)) $moreparams=null; - + $result= $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); if ($result <= 0) { diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 63218dde739..7d20f124277 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -30,15 +30,15 @@ $dellinkid = GETPOST('dellinkid','int'); $addlinkid = GETPOST('idtolinkto','int'); // Link invoice to order -if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel') && $id > 0 && $addlinkid > 0) +if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel','alpha') && $id > 0 && $addlinkid > 0) { $object->fetch($id); $object->fetch_thirdparty(); - $result = $object->add_object_linked(GETPOST('addlink'), $addlinkid); + $result = $object->add_object_linked(GETPOST('addlink','alpha'), $addlinkid); } // Delete link -if ($action == 'dellink' && ! empty($permissiondellink) && ! GETPOST('cancel') && $dellinkid > 0) +if ($action == 'dellink' && ! empty($permissiondellink) && ! GETPOST('cancel','alpha') && $dellinkid > 0) { $result=$object->deleteObjectLinked(0, '', 0, '', $dellinkid); if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index b34cbe886ab..433288606ec 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * or see http://www.gnu.org/ - * + * * $elementype must be defined. */ @@ -25,6 +25,7 @@ $maxsizestring=255; $maxsizeint=10; +$mesg=array(); $extrasize=GETPOST('size','int'); $type=GETPOST('type','alpha'); @@ -158,12 +159,11 @@ if ($action == 'add') $params['options'][$key] = $value; } } - $result=$extrafields->addExtraField( GETPOST('attrname', 'alpha'), GETPOST('label', 'alpha'), $type, - GETPOST('pos', 'alpha'), + GETPOST('pos', 'int'), $extrasize, $elementtype, (GETPOST('unique', 'alpha')?1:0), @@ -174,7 +174,9 @@ if ($action == 'add') (GETPOST('perms', 'alpha')?GETPOST('perms', 'alpha'):''), (GETPOST('list', 'alpha')?1:0), (GETPOST('ishidden', 'alpha')?1:0), - GETPOST('computed_value','alpha') + GETPOST('computed_value','alpha'), + (GETPOST('entitycurrentorall', 'alpha')?0:''), + GETPOST('langfile', 'alpha') ); if ($result > 0) { @@ -335,7 +337,9 @@ if ($action == 'update') (GETPOST('list', 'alpha')?1:0), (GETPOST('ishidden', 'alpha')?1:0), GETPOST('default_value','alpha'), - GETPOST('computed_value','alpha') + GETPOST('computed_value','alpha'), + (GETPOST('entitycurrentorall', 'alpha')?0:''), + GETPOST('langfile') ); if ($result > 0) { diff --git a/htdocs/core/actions_fetchobject.inc.php b/htdocs/core/actions_fetchobject.inc.php index 520d3c2d6da..7c25fbe7981 100644 --- a/htdocs/core/actions_fetchobject.inc.php +++ b/htdocs/core/actions_fetchobject.inc.php @@ -28,9 +28,9 @@ // $cancel must be defined // $id or $ref must be defined (object is loaded in this file with fetch) -if (($id > 0 || (! empty($ref) && ! in_array($action, array('create','createtask')))) && empty($cancel)) +if (($id > 0 || (! empty($ref) && ! in_array($action, array('create', 'createtask', 'add')))) && empty($cancel)) { - $ret = $object->fetch($id,$ref); + $ret = $object->fetch($id, $ref); if ($ret > 0) { $object->fetch_thirdparty(); @@ -38,7 +38,8 @@ if (($id > 0 || (! empty($ref) && ! in_array($action, array('create','createtask } else { - setEventMessages($object->error, $object->errors, 'errors'); + if (empty($object->error) && ! count($object->errors)) setEventMessages('Fetch on object return an error without filling $object->error nor $object->errors', null, 'errors'); + else setEventMessages($object->error, $object->errors, 'errors'); $action=''; } } diff --git a/htdocs/core/actions_lineupdown.inc.php b/htdocs/core/actions_lineupdown.inc.php index 825bdac1615..bcf251e0763 100644 --- a/htdocs/core/actions_lineupdown.inc.php +++ b/htdocs/core/actions_lineupdown.inc.php @@ -35,7 +35,7 @@ if ($action == 'up' && $permissiontoedit) // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -57,7 +57,7 @@ if ($action == 'down' && $permissiontoedit) // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index f21c41d828d..981de037c13 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -30,9 +30,9 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($object->id) { if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) - dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); + $result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); else - dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); + $result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); } } elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) @@ -176,7 +176,7 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave')) setEventMessages($langs->trans("FileRenamed"), null); } - else + else { $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 20b3d155a27..6750aa5de38 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2017 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ // $objectclass and $$objectlabel must be defined // $parameters, $object, $action must be defined for the hook. +// $permtoread, $permtocreate and $permtodelete may be defined // $uploaddir may be defined (example to $conf->projet->dir_output."/";) // $toselect may be defined @@ -82,7 +83,7 @@ if (! $error && $massaction == 'confirm_presend') $result=$objecttmp->fetch($toselectid); if ($result > 0) { - $listoinvoicesid[$toselectid]=$toselectid; + $listofobjectid[$toselectid]=$toselectid; $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; $listofobjectref[$thirdpartyid][$toselectid]=$objecttmp; @@ -90,6 +91,8 @@ if (! $error && $massaction == 'confirm_presend') } //var_dump($listofobjectthirdparties);exit; + + // Loop on each thirdparty foreach ($listofobjectthirdparties as $thirdpartyid) { $result = $thirdparty->fetch($thirdpartyid); @@ -99,62 +102,90 @@ if (! $error && $massaction == 'confirm_presend') exit; } - // Define recipient $sendto and $sendtocc + $sendto=''; + $sendtocc=''; + $sendtobcc=''; + $sendtoid = array(); + + // Define $sendto + $receiver=$_POST['receiver']; + if (! is_array($receiver)) + { + if ($receiver == '-1') $receiver=array(); + else $receiver=array($receiver); + } + $tmparray=array(); if (trim($_POST['sendto'])) { - // Recipient is provided into free text - $sendto = trim($_POST['sendto']); - $sendtoid = 0; + // Recipients are provided into free text + $tmparray[] = trim($_POST['sendto']); } - elseif ($_POST['receiver'] != '-1') + if (count($receiver)>0) { - // Recipient was provided from combo list - if ($_POST['receiver'] == 'thirdparty') // Id of third party - { - $sendto = $thirdparty->email; - $sendtoid = 0; - } - else // Id du contact - { - $sendto = $thirdparty->contact_get_property((int) $_POST['receiver'],'email'); - $sendtoid = $_POST['receiver']; - } + foreach($receiver as $key=>$val) + { + // Recipient was provided from combo list + if ($val == 'thirdparty') // Id of third party + { + $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>'; + } + elseif ($val) // Id du contact + { + $tmparray[] = $thirdparty->contact_get_property((int) $val,'email'); + $sendtoid[] = $val; + } + } } + $sendto=implode(',',$tmparray); + + // Define $sendtocc + $receivercc=$_POST['receivercc']; + if (! is_array($receivercc)) + { + if ($receivercc == '-1') $receivercc=array(); + else $receivercc=array($receivercc); + } + $tmparray=array(); if (trim($_POST['sendtocc'])) { - $sendtocc = trim($_POST['sendtocc']); + $tmparray[] = trim($_POST['sendtocc']); } - elseif ($_POST['receivercc'] != '-1') + if (count($receivercc) > 0) { - // Recipient was provided from combo list - if ($_POST['receivercc'] == 'thirdparty') // Id of third party - { - $sendtocc = $thirdparty->email; - } - else // Id du contact - { - $sendtocc = $thirdparty->contact_get_property((int) $_POST['receivercc'],'email'); - } + foreach($receivercc as $key=>$val) + { + // Recipient was provided from combo list + if ($val == 'thirdparty') // Id of third party + { + $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>'; + } + elseif ($val) // Id du contact + { + $tmparray[] = $thirdparty->contact_get_property((int) $val,'email'); + //$sendtoid[] = $val; TODO Add also id of contact in CC ? + } + } } + $sendtocc=implode(',',$tmparray); - //var_dump($listofobjectref[$thirdpartyid]); // Array of invoice for this thirdparty - + //var_dump($listofobjectref);exit; $attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array()); - $listofqualifiedinvoice=array(); + $listofqualifiedid=array(); $listofqualifiedref=array(); foreach($listofobjectref[$thirdpartyid] as $objectid => $object) { - //var_dump($object); //var_dump($thirdpartyid.' - '.$objectid.' - '.$object->statut); if ($objectclass == 'Facture' && $object->statut != Facture::STATUS_VALIDATED) { + $langs->load("errors"); $nbignored++; $resaction.='
'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$object->ref).'

'; continue; // Payment done or started or canceled } if ($objectclass == 'Commande' && $object->statut == Commande::STATUS_DRAFT) { + $langs->load("errors"); $nbignored++; $resaction.='
'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$object->ref).'

'; continue; @@ -193,7 +224,7 @@ if (! $error && $massaction == 'confirm_presend') ); } - $listofqualifiedinvoice[$objectid]=$object; + $listofqualifiedid[$objectid]=$object; $listofqualifiedref[$objectid]=$object->ref; } else @@ -208,7 +239,8 @@ if (! $error && $massaction == 'confirm_presend') //var_dump($listofqualifiedref); } - if (count($listofqualifiedinvoice) > 0) + // Loop on each qualified objects of the thirdparty + if (count($listofqualifiedid) > 0) { $langs->load("commercial"); @@ -235,17 +267,35 @@ if (! $error && $massaction == 'confirm_presend') $subject = GETPOST('subject'); $message = GETPOST('message'); $sendtocc = GETPOST('sentocc'); - $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); + $sendtobcc = ''; + if ($objectclass == 'Propale') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO); + if ($objectclass == 'Commande') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO); + if ($objectclass == 'Facture') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); + if ($objectclass == 'Supplier_Proposal') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO); + if ($objectclass == 'CommandeFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO); + if ($objectclass == 'FactureFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO); + $substitutionarray=array( - '__ID__' => join(', ',array_keys($listofqualifiedinvoice)), + '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, + '__ID__' => join(', ',array_keys($listofqualifiedid)), '__EMAIL__' => $thirdparty->email, '__CHECK_READ__' => '', '__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility '__ORDERREF__' => join(', ',$listofqualifiedref), // For backward compatibility '__PROPREF__' => join(', ',$listofqualifiedref), // For backward compatibility '__REF__' => join(', ',$listofqualifiedref), - '__REFCLIENT__' => $thirdparty->name + '__REFCLIENT__' => $thirdparty->name, + '__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?dol_string_nohtmltag($user->signature):'') + /* not available on all object + /'__FIRSTNAME__'=>(is_object($object)?$object->firstname:''), + '__LASTNAME__'=>(is_object($object)?$object->lastname:''), + '__FULLNAME__'=>(is_object($object)?$object->getFullName($langs):''), + '__ADDRESS__'=>(is_object($object)?$object->address:''), + '__ZIP__'=>(is_object($object)?$object->zip:''), + '__TOWN_'=>(is_object($object)?$object->town:''), + '__COUNTRY__'=>(is_object($object)?$object->country:''), + */ ); $subject=make_substitutions($subject, $substitutionarray); @@ -257,7 +307,7 @@ if (! $error && $massaction == 'confirm_presend') //var_dump($filepath); - // Send mail + // Send mail (substitutionarray must be done just before this) require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); if ($mailfile->error) @@ -274,7 +324,7 @@ if (! $error && $massaction == 'confirm_presend') $error=0; // Insert logs into agenda - foreach($listofqualifiedinvoice as $invid => $object) + foreach($listofqualifiedid as $objid => $object) { /*if ($objectclass == 'Propale') $actiontypecode='AC_PROP'; if ($objectclass == 'Commande') $actiontypecode='AC_COM'; @@ -297,7 +347,7 @@ if (! $error && $massaction == 'confirm_presend') $object->sendtoid = 0; $object->actionmsg = $actionmsg; // Long text $object->actionmsg2 = $actionmsg2; // Short text - $object->fk_element = $invid; + $object->fk_element = $objid; $object->elementtype = $object->element; // Appel des triggers @@ -372,7 +422,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $result=$objecttmp->fetch($toselectid); if ($result > 0) { - $listoinvoicesid[$toselectid]=$toselectid; + $listofobjectid[$toselectid]=$toselectid; $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; $listofobjectref[$toselectid]=$objecttmp->ref; @@ -380,7 +430,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se } $arrayofinclusion=array(); - foreach($listofobjectref as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/'); + foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote($tmppdf.'.pdf','/').'$'; $listoffiles = dol_dir_list($uploaddir,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true); // build list of files with full path @@ -400,7 +450,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se // Define output language (Here it is not used because we do only merging existing PDF) $outputlangs = $langs; $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { @@ -408,26 +458,26 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $outputlangs->setDefaultLang($newlang); } - if(!empty($conf->global->USE_PDFTK_FOR_PDF_CONCAT)) { + if (!empty($conf->global->USE_PDFTK_FOR_PDF_CONCAT)) + { // Create output dir if not exists - dol_mkdir($diroutputmassaction); - - // Defined name of merged file - $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); - $filename=preg_replace('/\s/','_',$filename); - - // Save merged file - if ($filter=='paye:0') - { - if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); - else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); - } - if ($year) $filename.='_'.$year; - if ($month) $filename.='_'.$month; + dol_mkdir($diroutputmassaction); + + // Defined name of merged file + $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); + $filename=preg_replace('/\s/','_',$filename); + + // Save merged file + if ($filter=='paye:0') + { + if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); + else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); + } + if ($year) $filename.='_'.$year; + if ($month) $filename.='_'.$month; if (count($files)>0) { - $now=dol_now(); $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; @@ -442,22 +492,21 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); - $langs->load("exports"); - setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); + $langs->load("exports"); + setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); } else { setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); } - } else { // Create empty PDF $pdf=pdf_getInstance(); if (class_exists('TCPDF')) { - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); } $pdf->SetFont(pdf_getPDFFont($outputlangs)); @@ -466,15 +515,15 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se // Add all others foreach($files as $file) { - // Charge un document PDF depuis un fichier. - $pagecount = $pdf->setSourceFile($file); - for ($i = 1; $i <= $pagecount; $i++) - { - $tplidx = $pdf->importPage($i); - $s = $pdf->getTemplatesize($tplidx); - $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); - $pdf->useTemplate($tplidx); - } + // Charge un document PDF depuis un fichier. + $pagecount = $pdf->setSourceFile($file); + for ($i = 1; $i <= $pagecount; $i++) + { + $tplidx = $pdf->importPage($i); + $s = $pdf->getTemplatesize($tplidx); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tplidx); + } } // Create output dir if not exists @@ -487,18 +536,18 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se // Save merged file if ($filter=='paye:0') { - if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); - else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); + if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); + else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); } if ($year) $filename.='_'.$year; if ($month) $filename.='_'.$month; if ($pagecount) { - $now=dol_now(); - $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; - $pdf->Output($file,'F'); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); + $now=dol_now(); + $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; + $pdf->Output($file,'F'); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); $langs->load("exports"); setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); @@ -524,6 +573,66 @@ if ($action == 'remove_file') $action=''; } +// Validate records +if (! $error && $massaction == 'validate' && $permtocreate) +{ + if ($object->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) + { + $langs->load("errors"); + setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); + $error++; + } + if (! $error) + { + $db->begin(); + + $objecttmp=new $objectclass($db); + $nbok = 0; + foreach($toselect as $toselectid) + { + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + //if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); + //else + $result = $objecttmp->validate($user); + if ($result == 0) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorObjectMustHaveStatusDraftToBeValidated", $objecttmp->ref), null, 'errors'); + $error++; + break; + } + elseif ($result < 0) + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + else $nbok++; + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (! $error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } + //var_dump($listofobjectthirdparties);exit; + } +} + // Delete records if (! $error && $massaction == 'delete' && $permtodelete) { @@ -533,7 +642,7 @@ if (! $error && $massaction == 'delete' && $permtodelete) $nbok = 0; foreach($toselect as $toselectid) { - $result=$objecttmp->fetch($toselectid); + $result=$objecttmp->fetch($toselectid); if ($result > 0) { if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 786c1c0db9d..a16e0437952 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -32,7 +32,7 @@ /* * Add file in email form */ -if (GETPOST('addfile')) +if (GETPOST('addfile','alpha')) { $trackid = GETPOST('trackid','aZ09'); @@ -68,7 +68,7 @@ if (! empty($_POST['removedfile']) && empty($_POST['removAll'])) /* * Remove all files in email form */ -if (GETPOST('removAll')) +if (GETPOST('removAll','alpha')) { $trackid = GETPOST('trackid','aZ09'); @@ -344,8 +344,31 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO } } - // Send mail - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid); + $substitutionarray=array( + '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, + '__ID__' => (is_object($object)?$object->id:''), + '__EMAIL__' => $sendto, + '__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'':'', + '__REF__' => (is_object($object)?$object->ref:''), + '__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?dol_string_nohtmltag($user->signature):'') + /* not available on all object + /'__FIRSTNAME__'=>(is_object($object)?$object->firstname:''), + '__LASTNAME__'=>(is_object($object)?$object->lastname:''), + '__FULLNAME__'=>(is_object($object)?$object->getFullName($langs):''), + '__ADDRESS__'=>(is_object($object)?$object->address:''), + '__ZIP__'=>(is_object($object)?$object->zip:''), + '__TOWN_'=>(is_object($object)?$object->town:''), + '__COUNTRY__'=>(is_object($object)?$object->country:''), + */ + ); + + $subject=make_substitutions($subject, $substitutionarray); + $message=make_substitutions($message, $substitutionarray); + + // Send mail (substitutionarray must be done just before this) + if (empty($sendcontext)) $sendcontext = 'standard'; + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'', $sendcontext); + if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); @@ -391,6 +414,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $object->trackid = $trackid; $object->fk_element = $object->id; $object->elementtype = $object->element; + if (is_array($attachedfiles) && count($attachedfiles)>0) { + $object->attachedfiles = $attachedfiles; + } // Call of triggers if (! empty($trigger_name)) diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index 03b33b19eb1..eadce1dc74c 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2017 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,31 +17,62 @@ */ /** - * \file htdocs/core/actions_setnotes.inc.php + * \file htdocs/core/actions_setmoduleoptions.inc.php * \brief Code for actions on setting notes of object page */ // $action must be defined -// $_FILES may be defined +// $arrayofparameters must be set for action 'update' +// $nomessageinupdate can be set to 1 // $nomessageinsetmoduleoptions can be set to 1 +if ($action == 'update' && is_array($arrayofparameters)) +{ + $db->begin(); + + $ok=True; + foreach($arrayofparameters as $key => $val) + { + $result=dolibarr_set_const($db,$key,GETPOST($key, 'alpha'),'chaine',0,'',$conf->entity); + if ($result < 0) + { + $ok=False; + break; + } + } + + if (! $error) + { + $db->commit(); + if (empty($nomessageinupdate)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + if (empty($nomessageinupdate)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors'); + } +} + // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) if ($action == 'setModuleOptions') { $db->begin(); // Process common param fields - foreach($_POST as $key => $val) + if (is_array($_POST)) { - if (preg_match('/^param(\d*)$/', $key, $reg)) // Works for POST['param'], POST['param1'], POST['param2'], ... + foreach($_POST as $key => $val) { - $param=GETPOST("param".$reg[1],'alpha'); - $value=GETPOST("value".$reg[1],'alpha'); - if ($param) + if (preg_match('/^param(\d*)$/', $key, $reg)) // Works for POST['param'], POST['param1'], POST['param2'], ... { - $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; + $param=GETPOST("param".$reg[1],'alpha'); + $value=GETPOST("value".$reg[1],'alpha'); + if ($param) + { + $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } } } } diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 3fa76891124..39f63683575 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -28,7 +28,7 @@ // $id must be defined (object is loaded in this file with fetch) // Set public note -if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel')) +if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel','alpha')) { if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($object->id)) $object->fetch($id); // Fetch may not be already done @@ -36,7 +36,7 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // Set public note -else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel')) +else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel','alpha')) { if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($object->id)) $object->fetch($id); // Fetch may not be already done diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 709d07c0832..203bd71e645 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -32,7 +32,6 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); - if (! isset($mode) || $mode != 'noajax') // For ajax call { require_once '../../main.inc.php'; @@ -40,11 +39,12 @@ if (! isset($mode) || $mode != 'noajax') // For ajax call require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; - $action=GETPOST('action','aZ09'); - $file=urldecode(GETPOST('file')); - $section=GETPOST("section"); - $module=GETPOST("module"); - $urlsource=GETPOST("urlsource"); + $action=GETPOST('action','aZ09'); + $file=urldecode(GETPOST('file','alpha')); + $section=GETPOST("section",'alpha'); + $module=GETPOST("module",'alpha'); + $urlsource=GETPOST("urlsource",'alpha'); + $search_doc_ref=GETPOST('search_doc_ref','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -56,7 +56,9 @@ if (! isset($mode) || $mode != 'noajax') // For ajax call if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; - $upload_dir = dirname(str_replace("../","/", $conf->ecm->dir_output.'/'.$file)); + $rootdirfordoc = $conf->ecm->dir_output; + + $upload_dir = dirname(str_replace("../", "/", $rootdirfordoc.'/'.$file)); $ecmdir = new EcmDirectory($db); $result=$ecmdir->fetch($section); @@ -68,7 +70,9 @@ if (! isset($mode) || $mode != 'noajax') // For ajax call } else // For no ajax call { - $ecmdir = new EcmDirectory($db); + $rootdirfordoc = $conf->ecm->dir_output; + + $ecmdir = new EcmDirectory($db); $relativepath=''; if ($section > 0) { @@ -80,7 +84,7 @@ else // For no ajax call } } $relativepath=$ecmdir->getRelativePath(); - $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + $upload_dir = $rootdirfordoc.'/'.$relativepath; } if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; @@ -95,8 +99,7 @@ if ($user->societe_id > 0) $socid = $user->societe_id; //print 'xxx'.$upload_dir; // Security: -// On interdit les remontees de repertoire ainsi que les pipe dans -// les noms de fichiers. +// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers. if (preg_match('/\.\./',$upload_dir) || preg_match('/[<>|]/',$upload_dir)) { dol_syslog("Refused to deliver file ".$upload_dir); @@ -105,6 +108,16 @@ if (preg_match('/\.\./',$upload_dir) || preg_match('/[<>|]/',$upload_dir)) exit; } +// Check permissions +if ($modulepart == 'ecm') +{ + if (! $user->rights->ecm->read) accessforbidden(); +} +if ($modulepart == 'medias') +{ + // Always allowed +} + /* * Action @@ -153,7 +166,7 @@ if ($type == 'directory') $excludefiles = array('^SPECIMEN\.pdf$','^\.','(\.meta|_preview.*\.png)$','^temp$','^payments$','^CVS$','^thumbs$'); $sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC); - // Right area. If module is defined, we are in automatic ecm. + // Right area. If module is defined here, we are in automatic ecm. $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport'); // TODO change for multicompany sharing @@ -188,35 +201,65 @@ if ($type == 'directory') if (in_array($module, $automodules)) { $param.='&module='.$module; + if (isset($search_doc_ref) && $search_doc_ref != '') $param.='&search_doc_ref='.$search_doc_ref; + $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); if ($module == 'company') $excludefiles[]='^contact$'; // The subdir 'contact' contains files of contacts with no id of thirdparty. - $filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1); - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); + $filter=preg_quote($search_doc_ref, '/'); + $filearray=dol_dir_list($upload_dir, "files", 1, $filter, $excludefiles, $sortfield, $sorting,1); + + $perm=$user->rights->ecm->upload; + + $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$perm,1,$textifempty,$maxlengthname,$url,1); } // Manual list else { - $relativepath=$ecmdir->getRelativePath(); - $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + if ($module == 'medias') + { + $relativepath=GETPOST('file','alpha'); + $upload_dir = $dolibarr_main_data_root.'/medias/'.$relativepath; + } + else + { + $relativepath=$ecmdir->getRelativePath(); + $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + } // If $section defined with value 0 - if ($section === '0') + if (($section === '0' || empty($section)) && ($module != 'medias')) { $filearray=array(); } - else $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','(\.meta|_preview.*\.png)$','^temp$','^CVS$'),$sortfield, $sorting,1); + else + { + $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','(\.meta|_preview.*\.png)$','^temp$','^CVS$'),$sortfield, $sorting,1); + } if ($section) { $param.='§ion='.$section; + if (isset($search_doc_ref) && $search_doc_ref != '') $param.='&search_doc_ref='.$search_doc_ref; + $textifempty = $langs->trans('NoFileFound'); } else if ($section === '0') $textifempty='
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")); - $formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url); + if ($module == 'medias') + { + $modulepart='medias'; + $perm=($user->rights->websites->creer || $user->rights->emailing->creer); + } + else + { + $modulepart='ecm'; + $perm=$user->rights->ecm->upload; + } + + $formfile->list_of_documents($filearray,'',$modulepart,$param,1,$relativepath,$perm,1,$textifempty,$maxlengthname,'',$url); } } diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 14b05c75905..c376bee9da3 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -45,13 +45,14 @@ if ($selecteddir != '/') $selecteddir = preg_replace('/\/$/','',$selecteddir); $langs->load("ecm"); -// Define selecteddir (fullpath). +// Define fullpathselecteddir. +$fullpathselecteddir=''; if ($modulepart == 'ecm') $fullpathselecteddir=$conf->ecm->dir_output.'/'.($selecteddir != '/' ? $selecteddir : ''); +if ($modulepart == 'medias') $fullpathselecteddir=$dolibarr_main_data_root.'/medias/'.($selecteddir != '/' ? $selecteddir : ''); // Security: -// On interdit les remontees de repertoire ainsi que les pipe dans -// les noms de fichiers. +// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers. if (preg_match('/\.\./',$fullpathselecteddir) || preg_match('/[<>|]/',$fullpathselecteddir)) { dol_syslog("Refused to deliver file ".$original_file); @@ -63,9 +64,12 @@ if (preg_match('/\.\./',$fullpathselecteddir) || preg_match('/[<>|]/',$fullpaths // Check permissions if ($modulepart == 'ecm') { - if (! $user->rights->ecm->read) accessforbidden(); + if (! $user->rights->ecm->read) accessforbidden(); +} +if ($modulepart == 'medias') +{ + // Always allowed } - /* @@ -97,7 +101,8 @@ foreach($sqltree as $keycursor => $val) if (file_exists($fullpathselecteddir)) { $files = @scandir($fullpathselecteddir); - if ($files) + + if ($files) { natcasesort($files); if ( count($files) > 2 ) /* The 2 accounts for . and .. */ diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index 65620c5429c..e5bfb674e8f 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -71,3 +71,27 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ exit; } +if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') +{ + // Increase date + $al = new AccountLine($db); + $al->dateo_next(GETPOST('rowid','int')); + $al->fetch(GETPOST('rowid','int')); + + print ''.dol_print_date($db->jdate($al->dateo),"day").''; + + exit; +} + +if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') +{ + // Decrease date + $al =new AccountLine($db); + $al->dateo_previous(GETPOST('rowid','int')); + $al->fetch(GETPOST('rowid','int')); + + print ''.dol_print_date($db->jdate($al->dateo),"day").''; + + exit; +} + diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 2e837fcbaae..2d92bc8f938 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -31,8 +31,17 @@ if (! isset($usedbyinclude) || empty($usedbyinclude)) if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); + if (! defined('NOREDIRECTBYMAINTOLOGIN')) define('NOREDIRECTBYMAINTOLOGIN','1'); $res=@include '../../main.inc.php'; + if ($res == 'ERROR_NOT_LOGGED') + { + $langs->load("other"); + $arrayresult['jumptologin']=array('img'=>'object_generic', 'label'=>$langs->trans("JumpToLogin"), 'text'=>' '.$langs->trans("JumpToLogin"), 'url'=>DOL_URL_ROOT.'/index.php'); + print json_encode($arrayresult); + if (is_object($db)) $db->close(); + exit; + } } include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 8d8b2962688..02b1d1880c8 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -83,193 +83,109 @@ class box_activity extends ModeleBoxes $cachetime = 3600; $fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'-r'.($user->rights->societe->client->voir?'1':'0').'.cache'; $now = dol_now(); - $nbofyears=2; + $nbofperiod=3; - if (! empty($conf->global->MAIN_BOX_ACTIVITY_DURATION)) $nbofyears=$conf->global->MAIN_BOX_ACTIVITY_DURATION; - $textHead = $langs->trans("Activity").' - '.$langs->trans("LastXMonthRolling", $nbofyears*12); + if (! empty($conf->global->MAIN_BOX_ACTIVITY_DURATION)) $nbofperiod=$conf->global->MAIN_BOX_ACTIVITY_DURATION; + $textHead = $langs->trans("Activity").' - '.$langs->trans("LastXMonthRolling", $nbofperiod); $this->info_box_head = array( 'text' => $textHead, 'limit'=> dol_strlen($textHead), ); // compute the year limit to show - $tmpdate= dol_time_plus_duree(dol_now(), -1*$nbofyears, "y"); + $tmpdate= dol_time_plus_duree(dol_now(), -1*$nbofperiod, "m"); $cumuldata = array(); - // list the summary of the bills - if (! empty($conf->facture->enabled) && $user->rights->facture->lire) + + // list the summary of the propals + if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $facturestatic=new Facture($db); + include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; + $propalstatic=new Propal($db); - $cachedir = DOL_DATA_ROOT.'/facture/temp'; - $filename = '/boxactivity-invoice'.$fileid; + $cachedir = DOL_DATA_ROOT.'/propale/temp'; + $filename = '/boxactivity-propal'.$fileid; + $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); + $data = array(); + if ($refresh) + { + $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb"; + $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ")"; + $sql.= " WHERE p.entity = ".$conf->entity; + $sql.= " AND p.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; + $sql.= " AND p.datep >= '".$db->idate($tmpdate)."'"; + $sql.= " AND p.date_cloture IS NULL"; // just unclosed + $sql.= " GROUP BY p.fk_statut"; + $sql.= " ORDER BY p.fk_statut DESC"; - $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); - $data = array(); - if ($refresh) - { - $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; - $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= ")"; - $sql.= " WHERE f.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; - $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1"; - $sql.= " GROUP BY f.fk_statut"; - $sql.= " ORDER BY f.fk_statut DESC"; + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $j=0; - while ($j < $num) { - $data[$j]=$db->fetch_object($result); - $j++; - } - if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { - dol_filecache($cachedir, $filename, $data); - } - $db->free($result); - } else { - dol_print_error($db); - } - } else { - $data = dol_readcachefile($cachedir, $filename); - } + $j=0; + while ($j < $num) { + $data[$j]=$db->fetch_object($result); + $j++; + } + if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { + dol_filecache($cachedir, $filename, $data); + } + $db->free($result); + } else { + dol_print_error($db); + } + } + else + { + $data = dol_readcachefile($cachedir, $filename); + } - $cumuldata=array_merge($cumuldata, $data); - if (! empty($data)) { - $j=0; - while ($line < count($cumuldata)) { - $billurl="viewstatut=2&paye=1&year=".$data[$j]->annee; - $this->info_box_contents[$line][0] = array( - 'td' => 'align="left" width="16"', - 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), - 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", - 'logo' => 'bill', - ); + $cumuldata=array_merge($cumuldata, $data); + if (! empty($data)) + { + $j=0; + while ($line < count($cumuldata)) + { + $this->info_box_contents[$line][0] = array( + 'td' => 'align="left" width="16"', + 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, + 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), + 'logo' => 'object_propal' + ); - $this->info_box_contents[$line][1] = array( - 'td' => '', - 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee, - ); + $this->info_box_contents[$line][1] = array( + 'td' => '', + 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), + ); - $this->info_box_contents[$line][2] = array( - 'td' => 'class="right"', - 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), - 'text' => $data[$j]->nb, - 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", - ); + $this->info_box_contents[$line][2] = array( + 'td' => 'class="right"', + 'text' => $data[$j]->nb, + 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), + 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, + ); + $totalnb += $data[$j]->nb; - $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', - 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency) - ); + $this->info_box_contents[$line][3] = array( + 'td' => 'class="right"', + 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), + ); + $totalMnt += $data[$j]->Mnttot; + $this->info_box_contents[$line][4] = array( + 'td' => 'align="right" width="18"', + 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3), + ); - // We add only for the current year - if ($data[$j]->annee == date("Y")) { - $totalnb += $data[$j]->nb; - $totalMnt += $data[$j]->Mnttot; - } - $this->info_box_contents[$line][4] = array( - 'td' => 'align="right" width="18"', - 'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3), - ); - $line++; - $j++; - } - if (count($data)==0) - $this->info_box_contents[$line][0] = array( - 'td' => 'align="center"', - 'text'=>$langs->trans("NoRecordedInvoices"), - ); - } - - $cachedir = DOL_DATA_ROOT.'/facture/temp'; - $filename = '/boxactivity-invoice2'.$fileid; - - $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); - - if ($refresh) { - $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND paye=0"; - $sql.= " GROUP BY f.fk_statut"; - $sql.= " ORDER BY f.fk_statut DESC"; - - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $j=0; - while ($j < $num) { - $data[$j]=$db->fetch_object($result); - $j++; - } - if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { - dol_filecache($cachedir, $filename, $data); - } - $db->free($result); - } else { - dol_print_error($db); - } - } else { - $data = dol_readcachefile($cachedir, $filename); - } - - $cumuldata=array_merge($cumuldata, $data); - if (! empty($data)) { - $j=0; - - while ($line < count($cumuldata)) { - $billurl="viewstatut=".$data[$j]->fk_statut."&paye=0"; - $this->info_box_contents[$line][0] = array( - 'td' => 'align="left" width="16"', - 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), - 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", - 'logo' => 'bill', - ); - - $this->info_box_contents[$line][1] = array( - 'td' => '', - 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), - ); - - $this->info_box_contents[$line][2] = array( - 'td' => 'class="right"', - 'text' => $data[$j]->nb, - 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), - 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", - ); - $totalnb += $data[$j]->nb; - $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', - 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), - ); - $totalMnt += $objp->Mnttot; - $this->info_box_contents[$line][4] = array( - 'td' => 'align="right" width="18"', - 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3), - ); - $line++; - $j++; - } - if ($num==0) - $this->info_box_contents[$line][0] = array( - 'td' => 'align="center"', - 'text'=>$langs->trans("NoRecordedInvoices"), - ); - } else { - $this->info_box_contents[0][0] = array( - 'td' => '', - 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), - ); - } + $line++; + $j++; + } + } } // list the summary of the orders @@ -293,12 +209,10 @@ class box_activity extends ModeleBoxes if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'"; - $sql.= " AND c.facture=0"; $sql.= " GROUP BY c.fk_statut"; $sql.= " ORDER BY c.fk_statut DESC"; $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); $j=0; @@ -357,94 +271,182 @@ class box_activity extends ModeleBoxes } } - // list the summary of the propals - if (! empty($conf->propal->enabled) && $user->rights->propale->lire) + + // list the summary of the bills + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { - include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; - $propalstatic=new Propal($db); + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $facturestatic=new Facture($db); - $cachedir = DOL_DATA_ROOT.'/propale/temp'; - $filename = '/boxactivity-propal'.$fileid; - $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); - $data = array(); - if ($refresh) - { - $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb"; - $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= ")"; - $sql.= " WHERE p.entity = ".$conf->entity; - $sql.= " AND p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; - $sql.= " AND p.datep >= '".$db->idate($tmpdate)."'"; - $sql.= " AND p.date_cloture IS NULL"; // just unclosed - $sql.= " GROUP BY p.fk_statut"; - $sql.= " ORDER BY p.fk_statut DESC"; + // part 1 + $cachedir = DOL_DATA_ROOT.'/facture/temp'; + $filename = '/boxactivity-invoice'.$fileid; - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); + $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); + $data = array(); + if ($refresh) + { + $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; + $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ")"; + $sql.= " WHERE f.entity = ".$conf->entity; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; + $sql.= " AND f.fk_soc = s.rowid"; + $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1"; + $sql.= " GROUP BY f.fk_statut"; + $sql.= " ORDER BY f.fk_statut DESC"; - $j=0; - while ($j < $num) { - $data[$j]=$db->fetch_object($result); - $j++; - } - if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { - dol_filecache($cachedir, $filename, $data); - } - $db->free($result); - } else { - dol_print_error($db); - } - } - else - { - $data = dol_readcachefile($cachedir, $filename); - } + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $j=0; + while ($j < $num) { + $data[$j]=$db->fetch_object($result); + $j++; + } + if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { + dol_filecache($cachedir, $filename, $data); + } + $db->free($result); + } else { + dol_print_error($db); + } + } else { + $data = dol_readcachefile($cachedir, $filename); + } - $cumuldata=array_merge($cumuldata, $data); - if (! empty($data)) - { - $j=0; - while ($line < count($cumuldata)) - { - $this->info_box_contents[$line][0] = array( - 'td' => 'align="left" width="16"', - 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, - 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), - 'logo' => 'object_propal' - ); + $cumuldata=array_merge($cumuldata, $data); + if (! empty($data)) { + $j=0; + while ($line < count($cumuldata)) { + $billurl="search_status=2&paye=1&year=".$data[$j]->annee; + $this->info_box_contents[$line][0] = array( + 'td' => 'align="left" width="16"', + 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), + 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", + 'logo' => 'bill', + ); - $this->info_box_contents[$line][1] = array( - 'td' => '', - 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), - ); + $this->info_box_contents[$line][1] = array( + 'td' => '', + 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee, + ); - $this->info_box_contents[$line][2] = array( - 'td' => 'class="right"', - 'text' => $data[$j]->nb, - 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), - 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, - ); - $totalnb += $data[$j]->nb; + $this->info_box_contents[$line][2] = array( + 'td' => 'class="right"', + 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), + 'text' => $data[$j]->nb, + 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", + ); - $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', - 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), - ); - $totalMnt += $data[$j]->Mnttot; - $this->info_box_contents[$line][4] = array( - 'td' => 'align="right" width="18"', - 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3), - ); + $this->info_box_contents[$line][3] = array( + 'td' => 'class="right"', + 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency) + ); - $line++; - $j++; - } - } + // We add only for the current year + if ($data[$j]->annee == date("Y")) { + $totalnb += $data[$j]->nb; + $totalMnt += $data[$j]->Mnttot; + } + $this->info_box_contents[$line][4] = array( + 'td' => 'align="right" width="18"', + 'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3), + ); + $line++; + $j++; + } + if (count($data)==0) + $this->info_box_contents[$line][0] = array( + 'td' => 'align="center"', + 'text'=>$langs->trans("NoRecordedInvoices"), + ); + } + + // part 2 + $cachedir = DOL_DATA_ROOT.'/facture/temp'; + $filename = '/boxactivity-invoice2'.$fileid; + + $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); + + if ($refresh) { + $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= " AND f.fk_soc = s.rowid"; + $sql.= " AND paye=0"; + $sql.= " GROUP BY f.fk_statut"; + $sql.= " ORDER BY f.fk_statut DESC"; + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $j=0; + while ($j < $num) { + $data[$j]=$db->fetch_object($result); + $j++; + } + if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { + dol_filecache($cachedir, $filename, $data); + } + $db->free($result); + } else { + dol_print_error($db); + } + } else { + $data = dol_readcachefile($cachedir, $filename); + } + + $cumuldata=array_merge($cumuldata, $data); + if (! empty($data)) { + $j=0; + + while ($line < count($cumuldata)) { + $billurl="search_status=".$data[$j]->fk_statut."&paye=0"; + $this->info_box_contents[$line][0] = array( + 'td' => 'align="left" width="16"', + 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), + 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", + 'logo' => 'bill', + ); + + $this->info_box_contents[$line][1] = array( + 'td' => '', + 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), + ); + + $this->info_box_contents[$line][2] = array( + 'td' => 'class="right"', + 'text' => $data[$j]->nb, + 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), + 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", + ); + $totalnb += $data[$j]->nb; + $this->info_box_contents[$line][3] = array( + 'td' => 'class="right"', + 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), + ); + $totalMnt += $objp->Mnttot; + $this->info_box_contents[$line][4] = array( + 'td' => 'align="right" width="18"', + 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3), + ); + $line++; + $j++; + } + if ($num==0) + $this->info_box_contents[$line][0] = array( + 'td' => 'align="center"', + 'text'=>$langs->trans("NoRecordedInvoices"), + ); + } else { + $this->info_box_contents[0][0] = array( + 'td' => '', + 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), + ); + } } // Add the sum in the bottom of the boxes diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index ccdcfbdbe5a..1795f7c6f2f 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -27,7 +27,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class to manage the box to show last services lines + * Class to manage the box to show last contracted products/services lines */ class box_services_contracts extends ModeleBoxes { @@ -72,6 +72,8 @@ class box_services_contracts extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; + $form = new Form($db); + $this->info_box_head = array('text' => $langs->trans("BoxLastProductsInContract",$max)); if ($user->rights->service->lire && $user->rights->contrat->lire) @@ -79,11 +81,12 @@ class box_services_contracts extends ModeleBoxes $contractstatic=new Contrat($db); $contratlignestatic=new ContratLigne($db); $thirdpartytmp = new Societe($db); + $productstatic = new Product($db); $sql = "SELECT s.nom as name, s.rowid as socid,"; $sql.= " c.rowid, c.ref, c.statut as contract_status,"; - $sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut, cd.label, cd.description, cd.product_type as type,"; - $sql.= " p.rowid as product_id, p.ref as product_ref"; + $sql.= " cd.rowid as cdid, cd.label, cd.description, cd.tms as datem, cd.statut, cd.product_type as type,"; + $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as plabel, p.fk_product_type as ptype, p.entity"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."contrat as c ON s.rowid = c.fk_soc"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; @@ -140,8 +143,41 @@ class box_services_contracts extends ModeleBoxes } } + // Label + if ($objp->product_id > 0) + { + $productstatic->id=$objp->product_id; + $productstatic->type=$objp->ptype; + $productstatic->ref=$objp->product_ref; + $productstatic->entity=$objp->pentity; + $productstatic->label=$objp->plabel; + $text = $productstatic->getNomUrl(1,'',20); + if ($objp->plabel) + { + $text .= ' - '; + //$productstatic->ref=$objp->label; + //$text .= $productstatic->getNomUrl(0,'',16); + $text .= $objp->plabel; + } + $description = $objp->description; + + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + //$text .= (! empty($objp->description) && $objp->description!=$objp->plabel)?'
'.dol_htmlentitiesbr($objp->description):''; + $description = ''; // Already added into main visible desc + } + + $s = $form->textwithtooltip($text,$description,3,'','',$cursorline,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); + } + else + { + $s = img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description); + } + + $this->info_box_contents[$i][] = array('td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"', - 'text' => $contratlignestatic->getNomUrl(1), + 'text' => $s, 'asis' => 1 ); diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index d83f0e80cba..9c496964942 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -375,6 +375,133 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" return ''; } + + /** + * Return list of widget. Function used by admin page htdoc/admin/widget. + * List is sorted by widget filename so by priority to run. + * + * @param array $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only. + * @return array Array list of widget + */ + static function getWidgetsList($forcedirwidget=null) + { + global $conf, $langs, $db; + + $files = array(); + $fullpath = array(); + $relpath = array(); + $iscoreorexternal = array(); + $modules = array(); + $orders = array(); + $i = 0; + + $dirwidget=array_merge(array('/core/boxes/')); + if (is_array($forcedirwidget)) + { + $dirwidget=$forcedirwidget; + } + + foreach($dirwidget as $reldir) + { + $dir=dol_buildpath($reldir,0); + $newdir=dol_osencode($dir); + + // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php at each call) + if (! is_dir($newdir)) continue; + + $handle=opendir($newdir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($newdir.'/'.$file) && preg_match('/^(.+)\.php/',$file,$reg)) + { + if (preg_match('/\.back$/',$file)) continue; + + $part1=$reg[1]; + + $modName = ucfirst($reg[1]); + //print "file=$file"; print "modName=$modName"; exit; + if (in_array($modName,$modules)) + { + $langs->load("errors"); + print '
'.$langs->trans("Error").' : '.$langs->trans("ErrorDuplicateWidget",$modName,"").'
'; + } + else + { + try { + include_once $newdir.'/'.$file; + } + catch(Exception $e) + { + print $e->getMessage(); + } + } + + $files[$i] = $file; + $fullpath[$i] = $dir.'/'.$file; + $relpath[$i] = preg_replace('/^\//','',$reldir).'/'.$file; + $iscoreorexternal[$i] = ($reldir == '/core/boxes/'?'internal':'external'); + $modules[$i] = $modName; + $orders[$i] = $part1; // Set sort criteria value + + $i++; + } + } + closedir($handle); + } + } + + asort($orders); + + $widget = array(); + $j = 0; + + // Loop on each widget + foreach ($orders as $key => $value) + { + $modName = $modules[$key]; + if (empty($modName)) continue; + + if (! class_exists($modName)) + { + print 'Error: A widget file was found but its class "'.$modName.'" was not found.'."
\n"; + continue; + } + + $objMod = new $modName($db); + if (is_object($objMod)) + { + // Define disabledbyname and disabledbymodule + $disabledbyname=0; + $module=''; + + // Check if widget file is disabled by name + if (preg_match('/NORUN$/i',$files[$key])) $disabledbyname=1; + + // We set info of modules + $widget[$j]['picto'] = $objMod->picto?img_object('',$objMod->picto):img_object('','generic'); + $widget[$j]['file'] = $files[$key]; + $widget[$j]['fullpath'] = $fullpath[$key]; + $widget[$j]['relpath'] = $relpath[$key]; + $widget[$j]['iscoreorexternal'] = $iscoreorexternal[$key]; + //$widget[$j]['version'] = $objMod->getVersion(); + $widget[$j]['status'] = img_picto($langs->trans("Active"),'tick'); + if ($disabledbyname > 0 || $disabledbymodule > 1) $widget[$j]['status'] = ''; + + $text =''.$langs->trans("Description").':
'; + $text.=$objMod->boxlabel.'
'; + $text.='
'.$langs->trans("Status").':
'; + if ($disabledbymodule == 2) $text.=$langs->trans("HooksDisabledAsModuleDisabled",$module).'
'; + + $widget[$j]['info'] = $text; + } + $j++; + } + return $widget; + } + + } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 3b3efe96fb0..e382f5c8198 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -39,7 +39,7 @@ class CMailFile public $sendcontext; public $sendmode; public $sendsetup; - + var $subject; // Topic: Subject of email var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '' or 'John Doe ' or ''). Note that with gmail smtps, value here is forced by google to account (but not the reply-to). // Sender: Who send the email ("Sender" has sent emails on behalf of "From"). @@ -115,14 +115,15 @@ class CMailFile global $conf, $dolibarr_main_data_root; $this->sendcontext = $sendcontext; - + + // Define this->sendmode $this->sendmode = ''; - if ($this->sendcontext == 'emailing') $this->sendmode = $conf->global->EMAILING_MAIL_SENDMODE; + if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + $this->sendmode = $conf->global->MAIN_MAIL_SENDMODE_EMAILING; + } if (empty($this->sendmode)) $this->sendmode=$conf->global->MAIN_MAIL_SENDMODE; if (empty($this->sendmode)) $this->sendmode='mail'; - - $this->sendsetup = array(); - // We define end of line (RFC 821). $this->eol="\r\n"; @@ -145,7 +146,7 @@ class CMailFile $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars) dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG); - dol_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG); + dol_syslog("CMailFile::CMailfile: subject=".$subject.", deliveryreceipt=".$deliveryreceipt.", msgishtml=".$msgishtml, LOG_DEBUG); if (empty($subject)) { @@ -157,7 +158,7 @@ class CMailFile { dol_syslog("CMailFile::CMailfile: Try to send an email with empty body"); $msg='.'; // Avoid empty message (with empty message conten show a multipart structure) - } + } // Detect if message is HTML (use fast method) if ($msgishtml == -1) @@ -170,6 +171,16 @@ class CMailFile $this->msgishtml = $msgishtml; } + global $dolibarr_main_url_root; + + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + // Replace relative /viewimage to absolute path + $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep); + if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html. // Detect images @@ -230,7 +241,7 @@ class CMailFile $this->addr_bcc = $addr_bcc; $this->deliveryreceipt = $deliveryreceipt; $this->trackid = $trackid; - + $smtp_headers = $this->write_smtpheaders(); if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n @@ -339,7 +350,7 @@ class CMailFile $this->phpmailer->SetReplyTo($this->getValidAddress($from,0,1)); // Set property with this->phpmailer->setReplyTo after constructor if you want to use another value than the From // TODO Add trackid into smtp header // TODO if (! empty($moreinheader)) ... - + if (! empty($this->html)) { if (!empty($css)) @@ -487,9 +498,7 @@ class CMailFile { require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); - $hookmanager->initHooks(array( - 'maildao' - )); + $hookmanager->initHooks(array('maildao')); $reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (! empty($reshook)) { @@ -532,6 +541,22 @@ class CMailFile return false; } + $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER'; + $keyforsmtpport ='MAIN_MAIL_SMTP_PORT'; + $keyforsmtpid ='MAIN_MAIL_SMTPS_ID'; + $keyforsmtppw ='MAIN_MAIL_SMTPS_PW'; + $keyfortls ='MAIN_MAIL_EMAIL_TLS'; + $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS'; + if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING'; + $keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING'; + $keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING'; + $keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING'; + $keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING'; + $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING'; + } + // Action according to choosed sending method if ($this->sendmode == 'mail') { @@ -548,9 +573,9 @@ class CMailFile @ini_set('sendmail_from',$this->getValidAddress($this->addr_from,2)); } - // Forcage parametres - if (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)) ini_set('SMTP',$conf->global->MAIN_MAIL_SMTP_SERVER); - if (! empty($conf->global->MAIN_MAIL_SMTP_PORT)) ini_set('smtp_port',$conf->global->MAIN_MAIL_SMTP_PORT); + // Force parameters + if (! empty($conf->global->$keyforsmtpserver)) ini_set('SMTP',$conf->global->$keyforsmtpserver); + if (! empty($conf->global->$keyforsmtpport)) ini_set('smtp_port',$conf->global->$keyforsmtpport); $dest=$this->getValidAddress($this->addr_to,2); if (! $dest) @@ -610,9 +635,9 @@ class CMailFile @ini_restore('sendmail_from'); } - // Forcage parametres - if (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)) ini_restore('SMTP'); - if (! empty($conf->global->MAIN_MAIL_SMTP_PORT)) ini_restore('smtp_port'); + // Restore parameters + if (! empty($conf->global->$keyforsmtpserver)) ini_restore('SMTP'); + if (! empty($conf->global->$keyforsmtpport)) ini_restore('smtp_port'); } else if ($this->sendmode == 'smtps') { @@ -622,28 +647,30 @@ class CMailFile $this->smtps->setTransportType(0); // Only this method is coded in SMTPs library // Clean parameters - if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP'); - if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port'); - - // TODO Manage alternative parameters + if (empty($conf->global->$keyforsmtpserver)) $conf->global->$keyforsmtpserver=ini_get('SMTP'); + if (empty($conf->global->$keyforsmtpport)) $conf->global->$keyforsmtpport=ini_get('smtp_port'); // If we use SSL/TLS - $server=$conf->global->MAIN_MAIL_SMTP_SERVER; - if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $server='ssl://'.$server; - $port=$conf->global->MAIN_MAIL_SMTP_PORT; + $server=$conf->global->$keyforsmtpserver; + $secure=''; + if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $secure='ssl'; + if (! empty($conf->global->$keyforstarttls) && function_exists('openssl_open')) $secure='tls'; + $server=($secure?$secure.'://':'').$server; + + $port=$conf->global->$keyforsmtpport; $this->smtps->setHost($server); $this->smtps->setPort($port); // 25, 465...; $loginid=''; $loginpass=''; - if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) + if (! empty($conf->global->$keyforsmtpid)) { - $loginid = $conf->global->MAIN_MAIL_SMTPS_ID; + $loginid = $conf->global->$keyforsmtpid; $this->smtps->setID($loginid); } - if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) + if (! empty($conf->global->$keyforsmtppw)) { - $loginpass = $conf->global->MAIN_MAIL_SMTPS_PW; + $loginpass = $conf->global->$keyforsmtppw; $this->smtps->setPW($loginpass); } @@ -651,14 +678,14 @@ class CMailFile $from=$this->smtps->getFrom('org'); if (! $from) { - $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->MAIN_MAIL_SMTP_PORT."
Sender address '$from' invalid"; + $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
Sender address '$from' invalid"; dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); $res=false; } $dest=$this->smtps->getTo(); if (! $dest) { - $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->MAIN_MAIL_SMTP_PORT."
Recipient address '$dest' invalid"; + $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
Recipient address '$dest' invalid"; dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); $res=false; } @@ -666,7 +693,7 @@ class CMailFile if ($res) { if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->smtps->setDebug(true); - + $result=$this->smtps->sendMsg(); //print $result; @@ -684,26 +711,24 @@ class CMailFile } else if ($this->sendmode == 'swiftmailer') { - // Use Swift Mailer library // ------------------------------------------ require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; - // Forcage parametres - if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP'); - if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port'); + // Clean parameters + if (empty($conf->global->$keyforsmtpserver)) $conf->global->$keyforsmtpserver=ini_get('SMTP'); + if (empty($conf->global->$keyforsmtpport)) $conf->global->$keyforsmtpport=ini_get('smtp_port'); // If we use SSL/TLS - $server=$conf->global->MAIN_MAIL_SMTP_SERVER; + $server=$conf->global->$keyforsmtpserver; $secure=''; - //var_dump(stream_get_transports()); - if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $secure='ssl'; - if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $secure='tls'; + if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $secure='ssl'; + if (! empty($conf->global->$keyforstarttls) && function_exists('openssl_open')) $secure='tls'; - $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->MAIN_MAIL_SMTP_PORT, $secure); + $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->$keyforsmtpport, $secure); - if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) $this->transport->setUsername($conf->global->MAIN_MAIL_SMTPS_ID); - if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) $this->transport->setPassword($conf->global->MAIN_MAIL_SMTPS_PW); + if (! empty($conf->global->$keyforsmtpid)) $this->transport->setUsername($conf->global->$keyforsmtpid); + if (! empty($conf->global->$keyforsmtppw)) $this->transport->setPassword($conf->global->$keyforsmtppw); //$smtps->_msgReplyTo = 'reply@web.com'; // Create the Mailer using your created Transport @@ -1026,7 +1051,7 @@ class CMailFile $out.= $this->eol; $out.= "--" . $this->related_boundary . $this->eol; } - + if (! $this->atleastoneimage && $strContentAltText && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part { $out.= "Content-Type: multipart/alternative; boundary=\"".$this->alternative_boundary."\"".$this->eol; @@ -1036,7 +1061,7 @@ class CMailFile $out.= $this->eol.$strContentAltText.$this->eol; $out.= "--" . $this->alternative_boundary . $this->eol; } - + $out.= "Content-Type: text/html; charset=".$conf->file->character_set_client.$this->eol; $out.= $this->eol.$strContent.$this->eol; @@ -1154,13 +1179,30 @@ class CMailFile function check_server_port($host,$port) { global $conf; + $_retVal=0; $timeout=5; // Timeout in seconds if (function_exists('fsockopen')) { + $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER'; + $keyforsmtpport ='MAIN_MAIL_SMTP_PORT'; + $keyforsmtpid ='MAIN_MAIL_SMTPS_ID'; + $keyforsmtppw ='MAIN_MAIL_SMTPS_PW'; + $keyfortls ='MAIN_MAIL_EMAIL_TLS'; + $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS'; + if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING'; + $keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING'; + $keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING'; + $keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING'; + $keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING'; + $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING'; + } + // If we use SSL/TLS - if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $host='ssl://'.$host; + if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $host='ssl://'.$host; // tls smtp start with no encryption //if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; @@ -1355,7 +1397,7 @@ class CMailFile if ($email) { $i++; - + $newemail=''; if ($format == 4) { diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 4456df76f83..0a149feabf4 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -42,6 +42,7 @@ class CSMSFile var $priority; var $class; var $message; + var $nostop; /** @@ -81,6 +82,7 @@ class CSMSFile $this->priority=$priority; $this->class=$class; $this->message=$msg; + $this->nostop=false; } @@ -107,6 +109,7 @@ class CSMSFile if (empty($conf->global->MAIN_DISABLE_ALL_SMS)) { + // Action according to choosed sending method if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') // Backward compatibility @deprecated { @@ -118,6 +121,7 @@ class CSMSFile $sms->deferred=$this->deferred; $sms->priority=$this->priority; $sms->class=$this->class; + $sms->nostop=$this->nostop; $res=$sms->SmsSend(); if ($res <= 0) @@ -129,7 +133,7 @@ class CSMSFile { dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); //var_dump($res); // 1973128 - $this->dump_sms_result($res); + if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res); } } else if (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module' @@ -147,6 +151,7 @@ class CSMSFile $sms->priority=$this->priority; $sms->class=$this->class; $sms->message=$this->message; + $sms->nostop=$this->nostop; $res=$sms->SmsSend(); $this->error = $sms->error; @@ -159,7 +164,7 @@ class CSMSFile { dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); //var_dump($res); // 1973128 - $this->dump_sms_result($res); + if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res); } } catch(Exception $e) @@ -207,6 +212,7 @@ class CSMSFile fputs($fp, "Priority: ".$this->priority."\n"); fputs($fp, "Class: ".$this->class."\n"); fputs($fp, "Deferred: ".$this->deferred."\n"); + fputs($fp, "DisableStop: ".$this->nostop."\n"); fputs($fp, "Message:\n".$this->message); fclose($fp); diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index d0e6dfe190a..7964510c91c 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -88,11 +88,11 @@ class Ccountry // extends CommonObject $sql.= "label,"; $sql.= "active"; $sql.= ") VALUES ("; - $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->rowid."'").","; + $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->db->escape($this->rowid)."'").","; $sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").","; $sql.= " ".(! isset($this->code_iso)?'NULL':"'".$this->db->escape($this->code_iso)."'").","; $sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").","; - $sql.= " ".(! isset($this->active)?'NULL':"'".$this->active."'").""; + $sql.= " ".(! isset($this->active)?'NULL':"'".$this->db->escape($this->active)."'").""; $sql.= ")"; $this->db->begin(); diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 00394b0e03f..535200ab95a 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -318,34 +318,6 @@ abstract class CommonDocGenerator return $array_other; } - - - - /** - * Define array with couple subtitution key => subtitution value - * - * @param Object $object Dolibarr Object - * @param Translate $outputlangs Language object for output - * @param boolean $recursive Want to fetch child array or child object - * @return array Array of substitution key->code - */ - function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) { - $array_other = array(); - if(!empty($object)) { - foreach($object as $key => $value) { - if(!empty($value)) { - if(!is_array($value) && !is_object($value)) { - $array_other['object_'.$key] = $value; - } - if(is_array($value) && $recursive){ - $array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false); - } - } - } - } - return $array_other; - } - /** @@ -402,18 +374,26 @@ abstract class CommonDocGenerator $array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs), $array_key.'_total_localtax2_locale'=>price($object->total_localtax2, 0, $outputlangs), $array_key.'_total_ttc_locale'=>price($object->total_ttc, 0, $outputlangs), - $array_key.'_total_discount_ht_locale' => price($object->getTotalDiscount(), 0, $outputlangs), + $array_key.'_total_ht'=>price2num($object->total_ht), $array_key.'_total_vat'=>(! empty($object->total_vat)?price2num($object->total_vat):price2num($object->total_tva)), $array_key.'_total_localtax1'=>price2num($object->total_localtax1), $array_key.'_total_localtax2'=>price2num($object->total_localtax2), $array_key.'_total_ttc'=>price2num($object->total_ttc), - $array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()), + + $array_key.'_multicurrency_code' => price2num($object->multicurrency_code), + $array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx), + $array_key.'_multicurrency_total_ht' => price2num($object->multicurrency_total_ht), + $array_key.'_multicurrency_total_tva' => price2num($object->multicurrency_total_tva), + $array_key.'_multicurrency_total_ttc' => price2num($object->multicurrency_total_ttc), + $array_key.'_multicurrency_total_ht_locale' => price($object->multicurrency_total_ht, 0, $outputlangs), + $array_key.'_multicurrency_total_tva_locale' => price($object->multicurrency_total_tva, 0, $outputlangs), + $array_key.'_multicurrency_total_ttc_locale' => price($object->multicurrency_total_ttc, 0, $outputlangs), $array_key.'_note_private'=>$object->note, $array_key.'_note_public'=>$object->note_public, $array_key.'_note'=>$object->note_public, // For backward compatibility - + // Payments $array_key.'_already_payed_locale'=>price($sumpayed, 0, $outputlangs), $array_key.'_already_payed'=>price2num($sumpayed), @@ -421,27 +401,38 @@ abstract class CommonDocGenerator $array_key.'_already_deposit'=>price2num($sumdeposit), $array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs), $array_key.'_already_creditnote'=>price2num($sumcreditnote), - + $array_key.'_already_payed_all_locale'=>price(price2num($sumpayed + $sumdeposit + $sumcreditnote, 'MT'), 0, $outputlangs), - $array_key.'already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'), - + $array_key.'_already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'), + // Remain to pay with all know infrmation (except open direct debit requests) $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT'), 0, $outputlangs), $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT') ); + if (method_exists($object, 'getTotalDiscount')) { + $resarray[$array_key.'_total_discount_ht_locale'] = price($object->getTotalDiscount(), 0, $outputlangs); + $resarray[$array_key.'_total_discount_ht'] = price2num($object->getTotalDiscount()); + } else { + $resarray[$array_key.'_total_discount_ht_locale'] = ''; + $resarray[$array_key.'_total_discount_ht'] = ''; + } + // Add vat by rates - foreach ($object->lines as $line) + if (is_array($object->lines) && count($object->lines)>0) { - // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility - if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0; - $resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva; - $resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]); - // $vatformated is vat without not expected chars (so 20, or 8.5 or 5.99 for example) - $vatformated=vatrate($line->tva_tx); - if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0; - $resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva; - $resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]); + foreach ($object->lines as $line) + { + // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility + if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0; + $resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva; + $resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]); + // $vatformated is vat without not expected chars (so 20, or 8.5 or 5.99 for example) + $vatformated=vatrate($line->tva_tx); + if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0; + $resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva; + $resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]); + } } // Retrieve extrafields if (is_array($object->array_options) && count($object->array_options)) @@ -493,6 +484,16 @@ abstract class CommonDocGenerator 'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'), 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs), 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'), + + 'line_multicurrency_code' => price2num($line->multicurrency_code), + 'line_multicurrency_subprice' => price2num($line->multicurrency_subprice), + 'line_multicurrency_total_ht' => price2num($line->multicurrency_total_ht), + 'line_multicurrency_total_tva' => price2num($line->multicurrency_total_tva), + 'line_multicurrency_total_ttc' => price2num($line->multicurrency_total_ttc), + 'line_multicurrency_subprice_locale' => price($line->multicurrency_subprice, 0, $outputlangs), + 'line_multicurrency_total_ht_locale' => price($line->multicurrency_total_ht, 0, $outputlangs), + 'line_multicurrency_total_tva_locale' => price($line->multicurrency_total_tva, 0, $outputlangs), + 'line_multicurrency_total_ttc_locale' => price($line->multicurrency_total_ttc, 0, $outputlangs), ); // Retrieve extrafields @@ -601,6 +602,33 @@ abstract class CommonDocGenerator ); } + + /** + * Define array with couple subtitution key => subtitution value + * + * @param Object $object Dolibarr Object + * @param Translate $outputlangs Language object for output + * @param boolean $recursive Want to fetch child array or child object + * @return array Array of substitution key->code + */ + function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) { + $array_other = array(); + if(!empty($object)) { + foreach($object as $key => $value) { + if(!empty($value)) { + if(!is_array($value) && !is_object($value)) { + $array_other['object_'.$key] = $value; + } + if(is_array($value) && $recursive){ + $array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false); + } + } + } + } + return $array_other; + } + + /** * Fill array with couple extrafield key => extrafield value * diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3c902495118..54a907a3c0f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -334,23 +334,23 @@ abstract class CommonObject // No constructor as it is an abstract class - /** - * Check an object id/ref exists - * If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch - * + /** + * Check an object id/ref exists + * If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch + * * @param string $element String of element ('product', 'facture', ...) * @param int $id Id of object * @param string $ref Ref of object to check * @param string $ref_ext Ref ext of object to check * @return int <0 if KO, 0 if OK but not found, >0 if OK and exists - */ - static function isExistingObject($element, $id, $ref='', $ref_ext='') - { - global $db,$conf; + */ + static function isExistingObject($element, $id, $ref='', $ref_ext='') + { + global $db,$conf; $sql = "SELECT rowid, ref, ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX.$element; - $sql.= " WHERE entity IN (".getEntity($element, true).")" ; + $sql.= " WHERE entity IN (".getEntity($element).")" ; if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; @@ -371,17 +371,17 @@ abstract class CommonObject else return 0; } return -1; - } + } - /** - * Method to output saved errors - * - * @return string String with errors - */ - function errorsToString() - { - return $this->error.(is_array($this->errors)?(($this->error!=''?', ':'').join(', ',$this->errors)):''); - } + /** + * Method to output saved errors + * + * @return string String with errors + */ + function errorsToString() + { + return $this->error.(is_array($this->errors)?(($this->error!=''?', ':'').join(', ',$this->errors)):''); + } /** * Return full name (civility+' '+name+' '+lastname) @@ -580,8 +580,8 @@ abstract class CommonObject $sql = "SELECT tc.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql.= " WHERE tc.element='".$this->db->escape($this->element)."'"; - $sql.= " AND tc.source='".$source."'"; - $sql.= " AND tc.code='".$type_contact."' AND tc.active=1"; + $sql.= " AND tc.source='".$this->db->escape($source)."'"; + $sql.= " AND tc.code='".$this->db->escape($type_contact)."' AND tc.active=1"; //print $sql; $resql=$this->db->query($sql); if ($resql) @@ -600,47 +600,63 @@ abstract class CommonObject $datecreate = dol_now(); - $this->db->begin(); + // Socpeople must have already been added by some a trigger, then we have to check it to avoid DB_ERROR_RECORD_ALREADY_EXISTS error + $TListeContacts=$this->liste_contact(-1, $source); + $already_added=false; + if(!empty($TListeContacts)) { + foreach($TListeContacts as $array_contact) { + if($array_contact['status'] == 4 && $array_contact['id'] == $fk_socpeople && $array_contact['fk_c_type_contact'] == $id_type_contact) { + $already_added=true; + break; + } + } + } - // Insertion dans la base - $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact"; - $sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) "; - $sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ; - $sql.= "'".$this->db->idate($datecreate)."'"; - $sql.= ", 4, ". $id_type_contact; - $sql.= ")"; + if(!$already_added) { - $resql=$this->db->query($sql); - if ($resql) - { - if (! $notrigger) - { - $result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user); - if ($result < 0) + $this->db->begin(); + + // Insertion dans la base + $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact"; + $sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) "; + $sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ; + $sql.= "'".$this->db->idate($datecreate)."'"; + $sql.= ", 4, ". $id_type_contact; + $sql.= ")"; + + $resql=$this->db->query($sql); + if ($resql) + { + if (! $notrigger) { + $result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + } + + $this->db->commit(); + return 1; + } + else + { + if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $this->error=$this->db->errno(); + $this->db->rollback(); + echo 'err rollback'; + return -2; + } + else + { + $this->error=$this->db->error(); $this->db->rollback(); return -1; } - } - - $this->db->commit(); - return 1; - } - else - { - if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $this->error=$this->db->errno(); - $this->db->rollback(); - return -2; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - } + } + } else return 0; } /** @@ -1293,7 +1309,7 @@ abstract class CommonObject * Load properties id_previous and id_next * * @param string $filter Optional filter. Example: " AND (t.field1 = 'aa' OR t.field2 = 'bb')" - * @param int $fieldid Name of field to use for the select MAX and MIN + * @param string $fieldid Name of field to use for the select MAX and MIN * @param int $nodbprefix Do not include DB prefix to forge table name * @return int <0 if KO, >0 if OK */ @@ -1306,6 +1322,7 @@ abstract class CommonObject dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined"); return -1; } + if ($fieldid == 'none') return 1; // this->ismultientitymanaged contains // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -2247,6 +2264,8 @@ abstract class CommonObject $error=0; + $multicurrency_tx = !empty($this->multicurrency_tx) ? $this->multicurrency_tx : 1; + // Define constants to find lines to sum $fieldtva='total_tva'; $fieldlocaltax1='total_localtax1'; @@ -2299,7 +2318,6 @@ abstract class CommonObject $obj = $this->db->fetch_object($resql); // Note: There is no check on detail line and no check on total, if $forcedroundingmode = 'none' - $multicurrency_tx = !empty($this->multicurrency_tx) ? $this->multicurrency_tx : 1; if ($forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto' { $localtax_array=array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx); @@ -2317,11 +2335,14 @@ abstract class CommonObject } } - $this->total_ht += $obj->total_ht; // The only field visible at end of line detail + $this->total_ht += $obj->total_ht; // The field visible at end of line detail $this->total_tva += $obj->total_tva; $this->total_localtax1 += $obj->total_localtax1; $this->total_localtax2 += $obj->total_localtax2; $this->total_ttc += $obj->total_ttc; + $this->multicurrency_total_ht += $obj->multicurrency_total_ht; // The field visible at end of line detail + $this->multicurrency_total_tva += $obj->multicurrency_total_tva; + $this->multicurrency_total_ttc += $obj->multicurrency_total_ttc; if (! isset($total_ht_by_vats[$obj->vatrate])) $total_ht_by_vats[$obj->vatrate]=0; if (! isset($total_tva_by_vats[$obj->vatrate])) $total_tva_by_vats[$obj->vatrate]=0; @@ -2330,7 +2351,7 @@ abstract class CommonObject $total_tva_by_vats[$obj->vatrate] += $obj->total_tva; $total_ttc_by_vats[$obj->vatrate] += $obj->total_ttc; - if ($forcedroundingmode == '1') // Check if we need adjustement onto line for vat + if ($forcedroundingmode == '1') // Check if we need adjustement onto line for vat. TODO This works on the company currency but not on multicurrency { $tmpvat=price2num($total_ht_by_vats[$obj->vatrate] * $obj->vatrate / 100, 'MT', 1); $diff=price2num($total_tva_by_vats[$obj->vatrate]-$tmpvat, 'MT', 1); @@ -2354,26 +2375,25 @@ abstract class CommonObject } // Add revenue stamp to total - $this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0; + $this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0; + $this->multicurrency_total_ttc += isset($this->revenuestamp)?($this->revenuestamp * $multicurrency_tx):0; // Situations totals - if ($this->situation_cycle_ref && $this->situation_counter > 1) { + if ($this->situation_cycle_ref && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) { $prev_sits = $this->get_prev_sits(); - foreach ($prev_sits as $sit) { + foreach ($prev_sits as $sit) { // $sit is an object Facture loaded with a fetch. $this->total_ht -= $sit->total_ht; $this->total_tva -= $sit->total_tva; $this->total_localtax1 -= $sit->total_localtax1; $this->total_localtax2 -= $sit->total_localtax2; $this->total_ttc -= $sit->total_ttc; + $this->multicurrency_total_ht -= $sit->multicurrency_total_ht; + $this->multicurrency_total_tva -= $sit->multicurrency_total_tva; + $this->multicurrency_total_ttc -= $sit->multicurrency_total_ttc; } } - // Multicurrency - $this->multicurrency_total_ht += $this->total_ht * $multicurrency_tx; - $this->multicurrency_total_tva += $this->total_tva * $multicurrency_tx; - $this->multicurrency_total_ttc += $this->total_ttc * $multicurrency_tx; - $this->db->free($resql); // Now update global field total_ht, total_ttc and tva @@ -2387,7 +2407,7 @@ abstract class CommonObject if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='total_tva'; if ($this->element == 'propal') $fieldttc='total'; if ($this->element == 'expensereport') $fieldtva='total_tva'; - if ($this->element == 'supplier_proposal') $fieldttc='total'; + if ($this->element == 'supplier_proposal') $fieldttc='total'; if (empty($nodatabaseupdate)) { @@ -2455,9 +2475,9 @@ abstract class CommonObject $sql.= ", targettype"; $sql.= ") VALUES ("; $sql.= $origin_id; - $sql.= ", '".$origin."'"; + $sql.= ", '".$this->db->escape($origin)."'"; $sql.= ", ".$this->id; - $sql.= ", '".$this->element."'"; + $sql.= ", '".$this->db->escape($this->element)."'"; $sql.= ")"; dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); @@ -2939,6 +2959,8 @@ abstract class CommonObject */ function isObjectUsed($id=0) { + global $langs; + if (empty($id)) $id=$this->id; // Check parameters @@ -2948,10 +2970,19 @@ abstract class CommonObject return -1; } + $arraytoscan = $this->childtables; + // For backward compatibility, we check if array is old format array('table1', 'table2', ...) + $tmparray=array_keys($this->childtables); + if (is_numeric($tmparray[0])) + { + $arraytoscan = array_flip($this->childtables); + } + // Test if child exists $haschild=0; - foreach($this->childtables as $table) + foreach($arraytoscan as $table => $elementname) { + //print $id.'-'.$table.'-'.$elementname.'
'; // Check if third party can be deleted $sql = "SELECT COUNT(*) as nb from ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$this->fk_element." = ".$id; @@ -2959,19 +2990,24 @@ abstract class CommonObject if ($resql) { $obj=$this->db->fetch_object($resql); - $haschild+=$obj->nb; - //print 'Found into table '.$table; - if ($haschild) break; // We found at least on, we stop here + if ($obj->nb > 0) + { + $langs->load("errors"); + //print 'Found into table '.$table.', type '.$langs->transnoentitiesnoconv($elementname).', haschild='.$haschild; + $haschild += $obj->nb; + $this->errors[]=$langs->trans("ErrorRecordHasAtLeastOneChildOfType", $langs->transnoentitiesnoconv($elementname)); + break; // We found at least one, we stop here + } } else { - $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); return -1; } } if ($haschild > 0) { - $this->error="ErrorRecordHasChildren"; + $this->errors[]="ErrorRecordHasChildren"; return $haschild; } else return 0; @@ -3510,7 +3546,7 @@ abstract class CommonObject $outputlangs = $langs; $newlang=''; - if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); if (! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && empty($newlang)) $newlang=$this->thirdparty->default_lang; // For language to language of customer if (! empty($newlang)) { @@ -3776,11 +3812,11 @@ abstract class CommonObject $sql.= ", mandatory"; $sql.= ") VALUES ("; $sql.= $resource_id; - $sql.= ", '".$resource_type."'"; - $sql.= ", '".$this->id."'"; - $sql.= ", '".$this->element."'"; - $sql.= ", '".$busy."'"; - $sql.= ", '".$mandatory."'"; + $sql.= ", '".$this->db->escape($resource_type)."'"; + $sql.= ", '".$this->db->escape($this->id)."'"; + $sql.= ", '".$this->db->escape($this->element)."'"; + $sql.= ", '".$this->db->escape($busy)."'"; + $sql.= ", '".$this->db->escape($mandatory)."'"; $sql.= ")"; dol_syslog(get_class($this)."::add_element_resource", LOG_DEBUG); @@ -3859,7 +3895,7 @@ abstract class CommonObject * * @param string $modelspath Relative folder where generators are placed * @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf') for example. - * @param Translate $outputlangs Language to use + * @param Translate $outputlangs Output language to use * @param int $hidedetails 1 to hide details. 0 by default * @param int $hidedesc 1 to hide product description. 0 by default * @param int $hideref 1 to hide product reference. 0 by default @@ -3868,7 +3904,7 @@ abstract class CommonObject */ protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null) { - global $conf, $langs; + global $conf, $langs, $user; $srctemplatepath=''; @@ -3886,7 +3922,6 @@ abstract class CommonObject $srctemplatepath=$tmp[1]; } - // Search template files $file=''; $classname=''; $filefound=0; $dirmodels=array('/'); @@ -3931,7 +3966,7 @@ abstract class CommonObject // Now we add first model found in directories scanned $listofdir=explode(',',$dirtoscan); - foreach($listofdir as $key=>$tmpdir) + foreach($listofdir as $key => $tmpdir) { $tmpdir=trim($tmpdir); $tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir); @@ -3978,7 +4013,10 @@ abstract class CommonObject $arrayofrecords = array(); // The write_file of templates of adherent class need this $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, $moreparams); } - else $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); + else + { + $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); + } if ($resultwritefile > 0) { @@ -3988,6 +4026,58 @@ abstract class CommonObject require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_delete_preview($this); + // Index file in database + if (! empty($obj->result['fullpath'])) + { + $destfull = $obj->result['fullpath']; + $upload_dir = dirname($destfull); + $destfile = basename($destfull); + $rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir); + + if (! preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir + { + $filename = basename($destfile); + $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); + $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); + + include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; + $ecmfile=new EcmFiles($this->db); + $result = $ecmfile->fetch(0, '', ($rel_dir?$rel_dir.'/':'').$filename); + if ($result > 0) + { + $ecmfile->label = md5_file(dol_osencode($destfull)); + $ecmfile->fullpath_orig = ''; + $ecmfile->gen_or_uploaded = 'generated'; + $ecmfile->description = ''; // indexed content + $ecmfile->keyword = ''; // keyword content + $result = $ecmfile->update($user); + if ($result < 0) + { + setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); + } + } + else + { + $ecmfile->filepath = $rel_dir; + $ecmfile->filename = $filename; + $ecmfile->label = md5_file(dol_osencode($destfull)); + $ecmfile->fullpath_orig = ''; + $ecmfile->gen_or_uploaded = 'generated'; + $ecmfile->description = ''; // indexed content + $ecmfile->keyword = ''; // keyword content + $result = $ecmfile->create($user); + if ($result < 0) + { + setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); + } + } + } + } + else + { + dol_syslog('Method ->write_file was called on object '.get_class($obj).' and return a success but the return array ->result["fullpath"] was not set.', LOG_WARNING); + } + // Success in building document. We build meta file. dol_meta_create($this); @@ -4123,7 +4213,7 @@ abstract class CommonObject * * @param int $rowid Id of line. Use the id of object if not defined. Deprecated. Function must be called without parameters. * @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters. - * @return int <0 if error, 0 if no optionals to find nor found, 1 if a line is found and optional loaded + * @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded */ function fetch_optionals($rowid=null,$optionsArray=null) { @@ -4136,7 +4226,7 @@ abstract class CommonObject if (! is_array($optionsArray)) { - // $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page. + // If $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page. // TODO Use of existing extrafield is not yet ready (must mutualize code that use extrafields in form first) // global $extrafields; //if (! is_object($extrafields)) @@ -4153,8 +4243,11 @@ abstract class CommonObject $optionsArray = $extrafields->attributes[$this->table_element]['label']; } + $table_element = $this->table_element; + if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility + // Request to get complementary values - if (count($optionsArray) > 0) + if (is_array($optionsArray) && count($optionsArray) > 0) { $sql = "SELECT rowid"; foreach ($optionsArray as $name => $label) @@ -4164,7 +4257,7 @@ abstract class CommonObject $sql.= ", ".$name; } } - $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields"; + $sql.= " FROM ".MAIN_DB_PREFIX.$table_element."_extrafields"; $sql.= " WHERE fk_object = ".$rowid; dol_syslog(get_class($this)."::fetch_optionals get extrafields data for ".$this->table_element, LOG_DEBUG); @@ -4210,7 +4303,10 @@ abstract class CommonObject { $this->db->begin(); - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id; + $table_element = $this->table_element; + if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility + + $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$table_element."_extrafields WHERE fk_object = ".$this->id; dol_syslog(get_class($this)."::deleteExtraFields delete", LOG_DEBUG); $resql=$this->db->query($sql_del); if (! $resql) @@ -4272,17 +4368,23 @@ abstract class CommonObject } elseif ($value=='') { - $this->array_options[$key] = null; + $new_array_options[$key] = null; } break; + /*case 'select': // Not required, we chosed value='0' for undefined values + if ($value=='-1') + { + $this->array_options[$key] = null; + } + break;*/ case 'price': - $this->array_options[$key] = price2num($this->array_options[$key]); + $new_array_options[$key] = price2num($this->array_options[$key]); break; case 'date': - $this->array_options[$key]=$this->db->idate($this->array_options[$key]); + $new_array_options[$key] = $this->db->idate($this->array_options[$key]); break; case 'datetime': - $this->array_options[$key]=$this->db->idate($this->array_options[$key]); + $new_array_options[$key] = $this->db->idate($this->array_options[$key]); break; case 'link': $param_list=array_keys($attributeParam ['options']); @@ -4298,7 +4400,7 @@ abstract class CommonObject if (is_numeric($value)) $res=$object->fetch($value); else $res=$object->fetch('',$value); - if ($res > 0) $this->array_options[$key]=$object->id; + if ($res > 0) $new_array_options[$key]=$object->id; else { $this->error="Ref '".$value."' for object '".$object->element."' not found"; @@ -4316,11 +4418,14 @@ abstract class CommonObject } $this->db->begin(); - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id; + $table_element = $this->table_element; + if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility + + $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$table_element."_extrafields WHERE fk_object = ".$this->id; dol_syslog(get_class($this)."::insertExtraFields delete", LOG_DEBUG); $this->db->query($sql_del); - $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."_extrafields (fk_object"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX.$table_element."_extrafields (fk_object"; foreach($new_array_options as $key => $value) { $attributeKey = substr($key,8); // Remove 'options_' prefix @@ -4335,9 +4440,9 @@ abstract class CommonObject // Add field o fattribut if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) { - if ($this->array_options[$key] != '') + if ($new_array_options[$key] != '') { - $sql.=",'".$this->db->escape($this->array_options[$key])."'"; + $sql.=",'".$this->db->escape($new_array_options[$key])."'"; } else { @@ -4405,6 +4510,12 @@ abstract class CommonObject $this->array_options["options_".$key] = null; } break; + /*case 'select': // Not required, we chosed value='0' for undefined values + if ($value=='-1') + { + $this->array_options[$key] = null; + } + break;*/ case 'price': $this->array_options["options_".$key] = price2num($this->array_options["options_".$key]); break; @@ -4473,6 +4584,9 @@ abstract class CommonObject $e = 0; foreach($extrafields->attribute_label as $key=>$label) { + // Load language if required + if (! empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + if (is_array($params) && count($params)>0) { if (array_key_exists('colspan',$params)) { $colspan=$params['colspan']; @@ -4525,10 +4639,13 @@ abstract class CommonObject $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]); } + $labeltoshow = $langs->trans($label); if($extrafields->attribute_required[$key]) - $label = ''.$label.''; + { + $labeltoshow = ''.$labeltoshow.''; + } + $out .= '
'; - $out .= ''; $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; $out .='"; - print ""; + print '"; print " + + '; print "
'.$langs->trans("Comment").''.$langs->trans("Comment").''; print '   '; print ''; @@ -2033,7 +2057,7 @@ else if ($user->rights->contrat->creer) print ''; else print ''; } - if ($object->statut == 1 && $nbofservices) + if ($object->statut == 1) { if ($user->rights->contrat->creer) print ''; else print ''; @@ -2058,6 +2082,10 @@ else print ''; } + if ($object->nbofservicesclosed > 0) + { + print ''; + } if ($object->nbofservicesclosed < $nbofservices) { //if (! $numactive) @@ -2108,9 +2136,9 @@ else print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); print '
'; @@ -2118,7 +2146,7 @@ else // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'contract', $socid); + $somethingshown = $formactions->showactions($object, 'contract', $socid, 1); print '
'; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 608f5614cd8..6e9fc443e03 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -228,7 +228,7 @@ class Contrat extends CommonObject */ function active_line($user, $line_id, $date, $date_end='', $comment='') { - $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); + return $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); } @@ -243,17 +243,67 @@ class Contrat extends CommonObject */ function close_line($user, $line_id, $date_end, $comment='') { - $this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); + return $this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); } + /** + * Open all lines of a contract + * + * @param User $user Object User making action + * @param int|string $date_start Date start (now if empty) + * @return int <0 if KO, >0 if OK + */ + function activateAll($user, $date_start='') + { + if (empty($date_start)) $date_start = dol_now(); + + $this->db->begin(); + + // Load lines + $this->fetch_lines(); + + $ok=true; + foreach($this->lines as $contratline) + { + // Open lines not already open + if ($contratline->statut != 4) + { + $result = $contratline->active_line($user, $date_start, -1); + if ($result < 0) + { + $ok=false; + break; + } + } + } + + if ($this->statut == 0) + { + $result=$this->validate($user); + if ($result < 0) $ok=false; + } + + if ($ok) + { + $this->db->commit(); + return 1; + } + else + { + dol_print_error($this->db,'Error in activateAll function'); + $this->db->rollback(); + return -1; + } + } + /** * Close all lines of a contract * - * @param User $user Object User making action - * @return void + * @param User $user Object User making action + * @return int <0 if KO, >0 if OK */ - function cloture($user) + function closeAll($user) { $this->db->begin(); @@ -263,7 +313,7 @@ class Contrat extends CommonObject $ok=true; foreach($this->lines as $contratline) { - // Close line not already closed + // Close lines not already closed if ($contratline->statut != 5) { $contratline->date_cloture=dol_now(); @@ -287,11 +337,13 @@ class Contrat extends CommonObject if ($ok) { $this->db->commit(); + return 1; } else { - dol_print_error($this->db,'Error in cloture function'); + dol_print_error($this->db,'Error in closeAll function'); $this->db->rollback(); + return -1; } } @@ -876,7 +928,7 @@ class Contrat extends CommonObject $sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL"); $sql.= ",".($this->commercial_suivi_id>0?$this->commercial_suivi_id:"NULL"); $sql.= ",".($this->fk_project>0?$this->fk_project:"NULL"); - $sql.= ", ".(dol_strlen($this->ref)<=0 ? "null" : "'".$this->ref."'"); + $sql.= ", ".(dol_strlen($this->ref)<=0 ? "null" : "'".$this->db->escape($this->ref)."'"); $sql.= ", ".$conf->entity; $sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL"); $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); @@ -920,8 +972,8 @@ class Contrat extends CommonObject { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $result=$this->insertExtraFields(); - if ($result < 0) + $result=$this->insertExtraFields(); + if ($result < 0) { $error++; } @@ -1279,6 +1331,24 @@ class Contrat extends CommonObject } } + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + // Commit or rollback if ($error) { @@ -1343,7 +1413,8 @@ class Contrat extends CommonObject if (empty($info_bits)) $info_bits=0; if (empty($pu_ht) || ! is_numeric($pu_ht)) $pu_ht=0; if (empty($pu_ttc)) $pu_ttc=0; - if (empty($txlocaltax1) || ! is_numeric($txlocaltax1)) $txlocaltax1=0; + if (empty($txtva) || ! is_numeric($txtva)) $txtva=0; + if (empty($txlocaltax1) || ! is_numeric($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2) || ! is_numeric($txlocaltax2)) $txlocaltax2=0; if ($price_base_type=='HT') @@ -1446,6 +1517,8 @@ class Contrat extends CommonObject $resql=$this->db->query($sql); if ($resql) { + $contractlineid = $this->db->last_insert_id(MAIN_DB_PREFIX."contratdet"); + $result=$this->update_statut($user); if ($result > 0) { @@ -1454,7 +1527,7 @@ class Contrat extends CommonObject { $contractline = new ContratLigne($this->db); $contractline->array_options=$array_options; - $contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $contractline->id=$contractlineid; $result=$contractline->insertExtraFields(); if ($result < 0) { @@ -1468,13 +1541,20 @@ class Contrat extends CommonObject $result=$this->call_trigger('LINECONTRACT_INSERT',$user); if ($result < 0) { - $this->db->rollback(); - return -1; + $error++; } // End call triggers + } + if ($error) + { + $this->db->rollback(); + return -1; + } + else + { $this->db->commit(); - return 1; + return $contractlineid; } } else @@ -1633,8 +1713,8 @@ class Contrat extends CommonObject if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used { $contractline = new ContratLigne($this->db); - $contractline->array_options=$array_option; - $contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $contractline->array_options=$array_options; + $contractline->id= $rowid; $result=$contractline->insertExtraFields(); if ($result < 0) { @@ -1817,18 +1897,20 @@ class Contrat extends CommonObject $text=''; if ($mode == 4) { - $text=($this->nbofserviceswait+$this->nbofservicesopened+$this->nbofservicesexpired+$this->nbofservicesclosed); + $text =''; + $text.=($this->nbofserviceswait+$this->nbofservicesopened+$this->nbofservicesexpired+$this->nbofservicesclosed); $text.=' '.$langs->trans("Services"); $text.=':     '; + $text.=''; } $text.=($mode == 7?'
':''); - $text.=($mode != 7 || $this->nbofserviceswait > 0) ? $this->nbofserviceswait.' '.$line->LibStatut(0,3).(($this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; + $text.=($mode != 7 || $this->nbofserviceswait > 0) ? ($this->nbofserviceswait.$line->LibStatut(0,3,-1,'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; $text.=($mode == 7?'
':''); - $text.=($mode != 7 || $this->nbofservicesopened > 0) ? $this->nbofservicesopened.' '.$line->LibStatut(4,3,0).(($this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; + $text.=($mode != 7 || $this->nbofservicesopened > 0) ? ($this->nbofservicesopened.$line->LibStatut(4,3,0,'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; $text.=($mode == 7?'
':''); - $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? $this->nbofservicesexpired.' '.$line->LibStatut(4,3,1).(($this->nbofservicesclosed)?'   ':'') : ''; + $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? ($this->nbofservicesexpired.$line->LibStatut(4,3,1,'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesclosed)?'   ':'') : ''; $text.=($mode == 7?'
':''); - $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? $this->nbofservicesclosed.' '.$line->LibStatut(5,3) : ''; + $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? ($this->nbofservicesclosed.$line->LibStatut(5,3,-1,'class="paddingleft2 inline-block valigntextbottom"')) : ''; $text.=($mode == 7?'
':''); return $text; } @@ -2500,9 +2582,10 @@ class ContratLigne extends CommonObjectLine * @param int $statut Id statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $expired 0=Not expired, 1=Expired, -1=Both or unknown + * @param string $moreatt More attribute * @return string Libelle */ - function LibStatut($statut,$mode,$expired=-1) + function LibStatut($statut,$mode,$expired=-1,$moreatt='') { global $langs; $langs->load("contracts"); @@ -2532,11 +2615,11 @@ class ContratLigne extends CommonObjectLine } if ($mode == 3) { - if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0'); } - if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4'); } - if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4'); } - if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3'); } - if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6'); } + if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0',$moreatt); } + if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4',$moreatt); } + if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4',$moreatt); } + if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3',$moreatt); } + if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6',$moreatt); } } if ($mode == 4) { @@ -2789,7 +2872,7 @@ class ContratLigne extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET"; $sql.= " fk_contrat=".$this->fk_contrat.","; - $sql.= " fk_product=".($this->fk_product?"'".$this->fk_product."'":'null').","; + $sql.= " fk_product=".($this->fk_product?"'".$this->db->escape($this->fk_product)."'":'null').","; $sql.= " statut=".$this->statut.","; $sql.= " label='".$this->db->escape($this->label)."',"; $sql.= " description='".$this->db->escape($this->description)."',"; @@ -2926,16 +3009,16 @@ class ContratLigne extends CommonObjectLine if ($this->date_fin_validite > 0) { $sql.= ",date_fin_validite"; } $sql.= ") VALUES ($this->fk_contrat, '', '" . $this->db->escape($this->description) . "',"; $sql.= ($this->fk_product>0 ? $this->fk_product : "null").","; - $sql.= " '".$this->qty."',"; - $sql.= " '".$this->vat_src_code."',"; - $sql.= " '".$this->tva_tx."',"; - $sql.= " '".$this->localtax1_tx."',"; - $sql.= " '".$this->localtax2_tx."',"; - $sql.= " '".$this->localtax1_type."',"; - $sql.= " '".$this->localtax2_type."',"; + $sql.= " '".$this->db->escape($this->qty)."',"; + $sql.= " '".$this->db->escape($this->vat_src_code)."',"; + $sql.= " '".$this->db->escape($this->tva_tx)."',"; + $sql.= " '".$this->db->escape($this->localtax1_tx)."',"; + $sql.= " '".$this->db->escape($this->localtax2_tx)."',"; + $sql.= " '".$this->db->escape($this->localtax1_type)."',"; + $sql.= " '".$this->db->escape($this->localtax2_type)."',"; $sql.= " ".price2num($this->remise_percent).",".price2num($this->subprice).","; $sql.= " ".price2num($this->total_ht).",".price2num($this->total_tva).",".price2num($this->total_localtax1).",".price2num($this->total_localtax2).",".price2num($this->total_ttc).","; - $sql.= " '".$this->info_bits."',"; + $sql.= " '".$this->db->escape($this->info_bits)."',"; $sql.= " ".price2num($this->price_ht).",".price2num($this->remise).","; if ($this->fk_fournprice > 0) $sql.= ' '.$this->fk_fournprice.','; else $sql.= ' null,'; @@ -2979,11 +3062,11 @@ class ContratLigne extends CommonObjectLine /** * Activate a contract line * - * @param User $user Objet User who activate contract - * @param int $date Date d'ouverture - * @param int|string $date_end Date fin prevue - * @param string $comment A comment typed by user - * @return int <0 if KO, >0 if OK + * @param User $user Objet User who activate contract + * @param int $date Date activation + * @param int|string $date_end Date planned end. Use '-1' to keep it unchanged. + * @param string $comment A comment typed by user + * @return int <0 if KO, >0 if OK */ function active_line($user, $date, $date_end = '', $comment = '') { @@ -3002,7 +3085,7 @@ class ContratLigne extends CommonObjectLine $sql = "UPDATE " . MAIN_DB_PREFIX . "contratdet SET statut = 4,"; $sql .= " date_ouverture = " . (dol_strlen($date) != 0 ? "'" . $this->db->idate($date) . "'" : "null") . ","; - $sql .= " date_fin_validite = " . (dol_strlen($date_end) != 0 ? "'" . $this->db->idate($date_end) . "'" : "null") . ","; + if ($date_end >= 0) $sql .= " date_fin_validite = " . (dol_strlen($date_end) != 0 ? "'" . $this->db->idate($date_end) . "'" : "null") . ","; $sql .= " fk_user_ouverture = " . $user->id . ","; $sql .= " date_cloture = null,"; $sql .= " commentaire = '" . $this->db->escape($comment) . "'"; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 509467cc822..2d818f8001d 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -30,6 +30,7 @@ require_once (DOL_DOCUMENT_ROOT."/product/class/product.class.php"); $langs->load("products"); $langs->load("companies"); +$langs->load("contracts"); $sortfield=GETPOST('sortfield','alpha'); $sortorder=GETPOST('sortorder','alpha'); @@ -186,7 +187,7 @@ foreach($listofstatus as $status) $dataseries[]=array('label'=>$staticcontratligne->LibStatut($status,1,($bool?1:0)),'data'=>(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0)); if (empty($conf->use_javascript_ajax)) { - + print '
'.$staticcontratligne->LibStatut($status,0,($bool?1:0)).''.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'
'.$staticcontratligne->LibStatut($status,0,($bool?1:0)).''.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'
'; @@ -393,7 +394,7 @@ if ($resql) while ($i < min($num,$max)) { $obj = $db->fetch_object($resql); - + print '
'; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); @@ -473,7 +474,7 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - + print '
'; @@ -553,7 +554,7 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - + print '
'; diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php index 35cca237b21..95ab0b9ca25 100644 --- a/htdocs/contrat/info.php +++ b/htdocs/contrat/info.php @@ -39,8 +39,10 @@ $result = restrictedArea($user, 'contrat', $id, ''); /* -* View -*/ + * View + */ + +$form = new Form($db); llxHeader('',$langs->trans("Contract"),""); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index a526a9bd78c..beba40103af 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -136,8 +136,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Action */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -146,7 +146,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $day=''; $month=''; @@ -255,8 +255,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -306,6 +307,13 @@ if ($resql) $arrayofselected=is_array($toselect)?$toselect:array(); + if ($socid > 0) + { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_name)) $search_name = $soc->name; + } + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -537,7 +545,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index aea03a73df5..cd445e682eb 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -140,8 +140,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -152,8 +152,9 @@ if (empty($reshook)) // Selection of new fields include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { + $search_product_category=0; $search_name=""; $search_contract=""; $search_service=""; @@ -176,6 +177,8 @@ if (empty($reshook)) $filter_opcloture=""; $mode=''; $filter=''; + $toselect=''; + $search_array_options=array(); } } @@ -223,7 +226,7 @@ if ($mode == "5") $sql.= " AND cd.statut = 5"; if ($filter == "expired") $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'"; if ($filter == "notexpired") $sql.= " AND cd.date_fin_validite >= '".$db->idate($now)."'"; if ($search_name) $sql.= " AND s.nom LIKE '%".$db->escape($search_name)."%'"; -if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'"; +if ($search_contract) $sql.= " AND c.ref LIKE '%".$db->escape($search_contract)."%' "; if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; $filter_dateouvertureprevue=dol_mktime(0,0,0,$opouvertureprevuemonth,$opouvertureprevueday,$opouvertureprevueyear); @@ -332,7 +335,7 @@ if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights- $moreforfilter.='
'; $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter.='
'; } @@ -374,7 +377,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -523,7 +526,6 @@ while ($i < min($num,$limit)) $contractstatic->ref=$obj->ref?$obj->ref:$obj->cid; - print '
'.$labeltoshow.''.$langs->trans($label).''; @@ -4630,18 +4747,17 @@ abstract class CommonObject /** * Get buy price to use for margin calculation. This function is called when buy price is unknown. - * set buy price = sell price if ForceBuyingPriceIfNull configured, + * Set buy price = sell price if ForceBuyingPriceIfNull configured, * else if calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice * else if calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice * else set min buy price as buy price * - * @param float $unitPrice product unit price - * @param float $discountPercent line discount percent - * @param int $fk_product product id - * - * @return float <0 if ko, buyprice if ok + * @param float $unitPrice Product unit price + * @param float $discountPercent Line discount percent + * @param int $fk_product Product id + * @return float <0 if KO, buyprice if OK */ - public function defineBuyPrice($unitPrice = 0, $discountPercent = 0, $fk_product = 0) + public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0) { global $conf; @@ -4710,17 +4826,7 @@ abstract class CommonObject return $buyPrice; } - /** - * Function test if type is date - * - * @param array $info content informations of field - * @return bool - */ - protected function isDate($info) - { - if(isset($info['type']) && $info['type']=='date') return true; - else return false; - } + /** * Function test if type is array @@ -4754,13 +4860,26 @@ abstract class CommonObject else return false; } + + /** + * Function test if type is date + * + * @param array $info content informations of field + * @return bool + */ + public function isDate($info) + { + if(isset($info['type']) && ($info['type']=='date' || $info['type']=='datetime' || $info['type']=='timestamp')) return true; + else return false; + } + /** * Function test if type is integer * * @param array $info content informations of field * @return bool */ - protected function isInt($info) + public function isInt($info) { if(is_array($info)) { @@ -4776,11 +4895,11 @@ abstract class CommonObject * @param array $info content informations of field * @return bool */ - protected function isFloat($info) + public function isFloat($info) { if(is_array($info)) { - if(isset($info['type']) && $info['type']=='float') return true; + if (isset($info['type']) && (preg_match('/^(double|real)/i', $info['type']))) return true; else return false; } else return false; @@ -4792,7 +4911,7 @@ abstract class CommonObject * @param array $info content informations of field * @return bool */ - protected function isText($info) + public function isText($info) { if(is_array($info)) { @@ -4819,83 +4938,58 @@ abstract class CommonObject } /** - * Function to prepare the values to insert + * Function to prepare the values to insert. + * Note $this->${field} are set by the page that make the createCommon or the updateCommon. * * @return array */ private function set_save_query() { - $query=array(); - foreach ($this->fields as $field=>$info) + global $conf; + + $queryarray=array(); + foreach ($this->fields as $field=>$info) // Loop on definition of fields { + // Depending on field type ('datetime', ...) if($this->isDate($info)) { if(empty($this->{$field})) { - $query[$field] = NULL; + $queryarray[$field] = NULL; } else { - $query[$field] = $this->db->idate($this->{$field}); + $queryarray[$field] = $this->db->idate($this->{$field}); } } else if($this->isArray($info)) { - $query[$field] = serialize($this->{$field}); + $queryarray[$field] = serialize($this->{$field}); } else if($this->isInt($info)) { - $query[$field] = (int) price2num($this->{$field}); + if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field]=$conf->entity; + else + { + $queryarray[$field] = (int) price2num($this->{$field}); + if (empty($queryarray[$field])) $queryarray[$field]=0; // May be reset to null later if property 'notnull' is -1 for this field. + } } else if($this->isFloat($info)) { - $query[$field] = (double) price2num($this->{$field}); - } - elseif($this->isNull($info)) - { - $query[$field] = (is_null($this->{$field}) || (empty($this->{$field}) && $this->{$field}!==0 && $this->{$field}!=='0') ? null : $this->{$field}); + $queryarray[$field] = (double) price2num($this->{$field}); + if (empty($queryarray[$field])) $queryarray[$field]=0; } else { - $query[$field] = $this->{$field}; + $queryarray[$field] = $this->{$field}; } + + if ($info['type'] == 'timestamp' && empty($queryarray[$field])) unset($queryarray[$field]); + if (! empty($info['notnull']) && $info['notnull'] == -1 && empty($queryarray[$field])) $queryarray[$field] = null; } - return $query; - } - - /** - * Create object into database - * - * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int <0 if KO, Id of created object if OK - */ - public function createCommon(User $user, $notrigger = false) - { - - $fields = array_merge(array('datec'=>$this->db->idate(dol_now())), $this->set_save_query()); - - foreach ($fields as $k => $v) { - - $keys[] = $k; - $values[] = $this->quote($v); - - } - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.' - ( '.implode( ",", $keys ).' ) - VALUES ( '.implode( ",", $values ).' ) '; - $res = $this->db->query( $sql ); - if($res===false) { - - return false; - } - - // TODO Add triggers - - return true; - + return $queryarray; } /** @@ -4903,41 +4997,42 @@ abstract class CommonObject * * @param stdClass $obj Contain data of object from database */ - private function set_vars_by_db(&$obj) + private function setVarsFromFetchObj(&$obj) { - foreach ($this->fields as $field => $info) - { - if($this->isDate($info)) - { - if(empty($obj->{$field}) || $obj->{$field} === '0000-00-00 00:00:00' || $obj->{$field} === '1000-01-01 00:00:00') $this->{$field} = 0; - else $this->{$field} = strtotime($obj->{$field}); - } - elseif($this->isArray($info)) - { - $this->{$field} = @unserialize($obj->{$field}); - // Hack for data not in UTF8 - if($this->{$field } === FALSE) @unserialize(utf8_decode($obj->{$field})); - } - elseif($this->isInt($info)) - { - $this->{$field} = (int) $obj->{$field}; - } - elseif($this->isFloat($info)) - { - $this->{$field} = (double) $obj->{$field}; - } - elseif($this->isNull($info)) - { - $val = $obj->{$field}; - // zero is not null - $this->{$field} = (is_null($val) || (empty($val) && $val!==0 && $val!=='0') ? null : $val); - } - else - { - $this->{$field} = $obj->{$field}; - } + foreach ($this->fields as $field => $info) + { + if($this->isDate($info)) + { + if(empty($obj->{$field}) || $obj->{$field} === '0000-00-00 00:00:00' || $obj->{$field} === '1000-01-01 00:00:00') $this->{$field} = 0; + else $this->{$field} = strtotime($obj->{$field}); + } + elseif($this->isArray($info)) + { + $this->{$field} = @unserialize($obj->{$field}); + // Hack for data not in UTF8 + if($this->{$field } === FALSE) @unserialize(utf8_decode($obj->{$field})); + } + elseif($this->isInt($info)) + { + if ($field == 'rowid') $this->id = (int) $obj->{$field}; + else $this->{$field} = (int) $obj->{$field}; + } + elseif($this->isFloat($info)) + { + $this->{$field} = (double) $obj->{$field}; + } + elseif($this->isNull($info)) + { + $val = $obj->{$field}; + // zero is not null + $this->{$field} = (is_null($val) || (empty($val) && $val!==0 && $val!=='0') ? null : $val); + } + else + { + $this->{$field} = $obj->{$field}; + } - } + } } /** @@ -4947,41 +5042,117 @@ abstract class CommonObject */ private function get_field_list() { - $keys = array_keys($this->fields); - return implode(',', $keys); + $keys = array_keys($this->fields); + return implode(',', $keys); } + /** + * Add quote to field value if necessary + * + * @param string|int $value Value to protect + * @param array $fieldsentry Properties of field + * @return string + */ + protected function quote($value, $fieldsentry) { + if (is_null($value)) return 'NULL'; + else if (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value"); + else return "'".$this->db->escape($value)."'"; + } + + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function createCommon(User $user, $notrigger = false) + { + $error = 0; + + $now=dol_now(); + + $fieldvalues = $this->set_save_query(); + if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation']=$this->db->idate($now); + if (array_key_exists('fk_user_creat', $fieldvalues) && ! ($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat']=$user->id; + unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert. + + $keys=array(); + $values = array(); + foreach ($fieldvalues as $k => $v) { + $keys[] = $k; + $values[] = $this->quote($v, $this->fields[$k]); + } + + $this->db->begin(); + + if (! $error) + { + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element; + $sql.= ' ('.implode( ", ", $keys ).')'; + $sql.= ' VALUES ('.implode( ", ", $values ).')'; + + $res = $this->db->query($sql); + if ($res===false) { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + + if (! $error && ! $notrigger) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); + + if (!$notrigger) { + // Call triggers + $result=$this->call_trigger(strtoupper(get_class($this)).'_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers + } + } + + // Commit or rollback + if ($error) { + $this->db->rollback(); + return -1; + } else { + $this->db->commit(); + return $this->id; + } + } + + /** * Load object in memory from the database * - * @param int $id Id object - * @param string $ref Ref - * - * @return int <0 if KO, 0 if not found, >0 if OK + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK */ public function fetchCommon($id, $ref = null) { - if (empty($id) && empty($ref)) return false; - $sql = 'SELECT '.$this->get_field_list().', datec, tms'; + $sql = 'SELECT '.$this->get_field_list(); $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element; if(!empty($id)) $sql.= ' WHERE rowid = '.$id; - else $sql.= ' WHERE ref = \''.$this->quote($ref).'\''; + else $sql.= " WHERE ref = ".$this->quote($ref, $this->fields['ref']); $res = $this->db->query($sql); if ($res) { if ($obj = $this->db->fetch_object($res)) { - $this->id = $id; - $this->set_vars_by_db($obj); - - $this->datec = $this->db->idate($obj->datec); - $this->tms = $this->db->idate($obj->tms); - - return $this->id; + if ($obj) + { + $this->setVarsFromFetchObj($obj); + return $this->id; + } + else + { + return 0; + } } else { @@ -5003,78 +5174,114 @@ abstract class CommonObject * * @param User $user User that modifies * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, >0 if OK */ public function updateCommon(User $user, $notrigger = false) { - $fields = $this->set_save_query(); + $error = 0; - foreach ($fields as $k => $v) { + $fieldvalues = $this->set_save_query(); + unset($fieldvalues['rowid']); // We don't update this field, it is the key to define which record to update. + foreach ($fieldvalues as $k => $v) { if (is_array($key)){ $i=array_search($k, $key); if ( $i !== false) { - $where[] = $key[$i].'=' . $this->quote( $v ) ; + $where[] = $key[$i].'=' . $this->quote($v, $this->fields[$k]); continue; } } else { if ( $k == $key) { - $where[] = $k.'=' .$this->quote( $v ) ; + $where[] = $k.'=' .$this->quote($v, $this->fields[$k]); continue; } } - - $tmp[] = $k.'='.$this->quote($v); + $tmp[] = $k.'='.$this->quote($v, $this->fields[$k]); } $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode( ',', $tmp ).' WHERE rowid='.$this->id ; - $res = $this->db->query( $sql ); - if($res===false) { - //error - return false; + $this->db->begin(); + if (! $error) + { + $res = $this->db->query($sql); + if ($res===false) + { + $error++; + $this->errors[] = $this->db->lasterror(); + } } - // TODO Add triggers + if (! $error && ! $notrigger) { + // Call triggers + $result=$this->call_trigger(strtoupper(get_class($this)).'_MODIFY',$user); + if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail + // End call triggers + } - return true; + // Commit or rollback + if ($error) { + $this->db->rollback(); + return -1; + } else { + $this->db->commit(); + return $this->id; + } } /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int <0 if KO, >0 if OK + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK */ public function deleteCommon(User $user, $notrigger = false) { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id; + $error=0; - $res = $this->db->query( $sql ); - if($res===false) { - return false; + $this->db->begin(); + + if (! $error) { + if (! $notrigger) { + // Call triggers + $result=$this->call_trigger(strtoupper(get_class($this)).'_DELETE', $user); + if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail + // End call triggers + } + } + + if (! $error) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id; + + $res = $this->db->query($sql); + if($res===false) { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + + // Commit or rollback + if ($error) { + $this->db->rollback(); + return -1; + } else { + $this->db->commit(); + return 1; } - - // TODO Add triggers - - return true; } /** - * Add quote to field value if necessary + * Initialise object with example values + * Id must be 0 if object instance is a specimen * - * @param string|int $value value to protect - * @return string|int + * @return void */ - protected function quote($value) { - - if(is_null($value)) return 'NULL'; - else if(is_numeric($value)) return $value; - else return "'".$this->db->escape( $value )."'"; + public function initAsSpecimenCommon() + { + $this->id = 0; + // TODO... } } - diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 77c24ff4109..ad224fec97d 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -83,11 +83,12 @@ class Conf $this->file = new stdClass(); $this->db = new stdClass(); $this->global = new stdClass(); - $this->mycompany = new stdClass(); - $this->admin = new stdClass(); + $this->mycompany = new stdClass(); + $this->admin = new stdClass(); $this->user = new stdClass(); $this->syslog = new stdClass(); $this->browser = new stdClass(); + $this->medias = new stdClass(); $this->multicompany = new stdClass(); //! Charset for HTML output and for storing data in memory @@ -96,7 +97,7 @@ class Conf // First level object // TODO Remove this part. $this->expedition_bon = new stdClass(); - $this->livraison_bon = new stdClass(); + $this->livraison_bon = new stdClass(); $this->fournisseur = new stdClass(); $this->product = new stdClass(); $this->service = new stdClass(); @@ -106,12 +107,12 @@ class Conf $this->propal = new stdClass(); $this->facture = new stdClass(); $this->contrat = new stdClass(); - $this->usergroup = new stdClass(); + $this->usergroup = new stdClass(); $this->adherent = new stdClass(); $this->bank = new stdClass(); $this->notification = new stdClass(); $this->mailing = new stdClass(); - $this->expensereport = new stdClass(); + $this->expensereport = new stdClass(); } @@ -322,6 +323,10 @@ class Conf $this->propal->dir_output=$rootfordata."/propale"; $this->propal->dir_temp=$rootfordata."/propale/temp"; + // For medias storage + $this->medias->multidir_output = array($this->entity => $rootfordata."/medias"); + $this->medias->multidir_temp = array($this->entity => $rootfordata."/medias/temp"); + // Exception: Some dir are not the name of module. So we keep exception here for backward compatibility. // Sous module bons d'expedition @@ -579,6 +584,9 @@ class Conf $conf->global->AGENDA_DEFAULT_FILTER_TYPE='0'; // 'AC_NON_AUTO' does not exists when AGENDA_DEFAULT_FILTER_TYPE is not on. } + $conf->global->MAIN_MODULE_DOLISTORE_API_SRV='https://www.dolistore.com'; + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY='dolistorecatalogpublickey1234567'; + // For backward compatibility if (isset($this->product)) $this->produit=$this->product; if (isset($this->facture)) $this->invoice=$this->facture; diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index a2a84d3b9ed..ae2adde87d4 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -85,10 +85,10 @@ class Cstate // extends CommonObject $sql.= "nom,"; $sql.= "active"; $sql.= ") VALUES ("; - $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->rowid."'").","; + $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->db->escape($this->rowid)."'").","; $sql.= " ".(! isset($this->code_departement)?'NULL':"'".$this->db->escape($this->code_departement)."'").","; $sql.= " ".(! isset($this->nom)?'NULL':"'".$this->db->escape($this->nom)."'").","; - $sql.= " ".(! isset($this->active)?'NULL':"'".$this->active."'").""; + $sql.= " ".(! isset($this->active)?'NULL':"'".$this->db->escape($this->active)."'").""; $sql.= ")"; $this->db->begin(); diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index c7894c7c848..b3bb750bd80 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -91,10 +91,10 @@ class Ctypent // extends CommonObject $sql.= ") VALUES ("; - $sql.= " ".(! isset($this->id)?'NULL':"'".$this->id."'").","; + $sql.= " ".(! isset($this->id)?'NULL':"'".$this->db->escape($this->id)."'").","; $sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").","; $sql.= " ".(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").","; - $sql.= " ".(! isset($this->active)?'NULL':"'".$this->active."'").","; + $sql.= " ".(! isset($this->active)?'NULL':"'".$this->db->active($this->active)."'").","; $sql.= " ".(! isset($this->module)?'NULL':"'".$this->db->escape($this->module)."'").""; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 41c5d67688c..16cb219f718 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -64,7 +64,7 @@ class DiscountAbsolute * @param int $fk_facture_source fk_facture_source * @return int <0 if KO, =0 if not found, >0 if OK */ - function fetch($rowid,$fk_facture_source=0) + function fetch($rowid, $fk_facture_source=0) { global $conf; @@ -158,7 +158,7 @@ class DiscountAbsolute $sql.= ")"; $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',"; $sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.","; - $sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null"); + $sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null"); $sql.= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -386,7 +386,7 @@ class DiscountAbsolute function getSumDepositsUsed($invoice, $multicurrency=0) { dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG); - + if ($invoice->element == 'facture' || $invoice->element == 'invoice') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; @@ -407,7 +407,7 @@ class DiscountAbsolute dol_print_error($this->error); return -1; } - + $resql=$this->db->query($sql); if ($resql) { @@ -432,7 +432,7 @@ class DiscountAbsolute function getSumCreditNotesUsed($invoice, $multicurrency=0) { dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG); - + if ($invoice->element == 'facture' || $invoice->element == 'invoice') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; @@ -453,7 +453,7 @@ class DiscountAbsolute dol_print_error($this->error); return -1; } - + $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index a7e404383ea..723ae0d47b1 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -48,22 +48,23 @@ class DolEditor /** * Create an object to build an HTML area to edit a large string content * - * @param string $htmlname HTML name of WYSIWIG field - * @param string $content Content of WYSIWIG field - * @param int $width Width in pixel of edit area (auto by default) - * @param int $height Height in pixel of edit area (200px by default) - * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly') - * @param string $toolbarlocation Where bar is stored : - * 'In' each window has its own toolbar - * 'Out:name' share toolbar into the div called 'name' - * @param boolean $toolbarstartexpanded Bar is visible or not at start - * @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. - * @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor) - * @param int $rows Size of rows for textarea tool - * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') - * @param int $readonly 0=Read/Edit, 1=Read only + * @param string $htmlname HTML name of WYSIWIG field + * @param string $content Content of WYSIWIG field + * @param int $width Width in pixel of edit area (auto by default) + * @param int $height Height in pixel of edit area (200px by default) + * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly'). + * @param string $toolbarlocation Where bar is stored : + * 'In' each window has its own toolbar + * 'Out:name' share toolbar into the div called 'name' + * @param boolean $toolbarstartexpanded Bar is visible or not at start + * @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. + * @param boolean|string $okforextendededitor True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. + * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". + * @param int $rows Size of rows for textarea tool + * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') + * @param int $readonly 0=Read/Edit, 1=Read only */ - function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0) + function __construct($htmlname, $content, $width='', $height=200, $toolbarname='Basic', $toolbarlocation='In', $toolbarstartexpanded=false, $uselocalbrowser=true, $okforextendededitor=true, $rows=0, $cols=0, $readonly=0) { global $conf,$langs; @@ -80,8 +81,9 @@ class DolEditor $this->readonly=$readonly; // Check if extended editor is ok. If not we force textarea - if (empty($conf->fckeditor->enabled) || ! $okforextendededitor) $this->tool = 'textarea'; - if ($conf->dol_use_jmobile) $this->tool = 'textarea'; // TODO ckeditor ko with jmobile + if ((empty($conf->fckeditor->enabled) && $okforextendededitor != 'ace') || empty($okforextendededitor)) $this->tool = 'textarea'; + if ($okforextendededitor === 'ace') $this->tool='ace'; + //if ($conf->dol_use_jmobile) $this->tool = 'textarea'; // ckeditor and ace seems ok with mobile // Define content and some properties if ($this->tool == 'ckeditor') @@ -100,7 +102,7 @@ class DolEditor $this->editor->Height = $height; if (! empty($width)) $this->editor->Width = $width; $this->editor->ToolbarSet = $shorttoolbarname; // Profile of this toolbar set is deinfed into theme/mytheme/ckeditor/config.js - $this->editor->Config['AutoDetectLanguage'] = 'true'; + $this->editor->Config['AutoDetectLanguage'] = 'true'; // Language of user (browser) $this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In'; $this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded; @@ -122,7 +124,7 @@ class DolEditor } // Define some properties - if (in_array($this->tool,array('textarea','ckeditor'))) + if (in_array($this->tool,array('textarea','ckeditor','ace'))) { $this->content = $content; $this->htmlname = $htmlname; @@ -141,11 +143,13 @@ class DolEditor * Output depends on this->tool (fckeditor, ckeditor, textarea, ...) * * @param int $noprint 1=Return HTML string instead of printing it to output - * @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });" - * @param boolean $disallowAnyContent Disallow to use any content. true=restrict to a predefined list of allowed elements. + * @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });". Used by CKEditor only. + * @param boolean $disallowAnyContent Disallow to use any content. true=restrict to a predefined list of allowed elements. Used by CKEditor only. + * @param string $titlecontent Show title content before editor area. Used by ACE editor only. + * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) * @return void|string */ - function Create($noprint=0,$morejs='',$disallowAnyContent=true) + function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='') { global $conf,$langs; @@ -160,13 +164,14 @@ class DolEditor if ($this->tool == 'fckeditor') // not used anymore { - $found=1; + $found=1; $this->editor->Create(); } if (in_array($this->tool,array('textarea','ckeditor'))) { $found=1; - //$out.= ''; @@ -196,7 +201,7 @@ class DolEditor htmlEncodeOutput :'.$htmlencode_force.', allowedContent :'.($disallowAnyContent?'false':'true').', extraAllowedContent : \'\', - fullPage : '.($fullpage?'true':'false').', + fullPage : '.($fullpage?'true':'false').', toolbar: \''.$this->toolbarname.'\', toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').', width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').', @@ -242,11 +247,83 @@ class DolEditor filebrowserImageWindowHeight : \'500\''; } $out.= ' })'.$morejs; - $out.= '}); - '; + $out.= '});'."\n"; + $out.= ''."\n"; } } + // Output editor ACE + // Warning: ace.js and ext-statusbar.js must be loaded by the parent page. + if (preg_match('/^ace/', $this->tool)) + { + $found=1; + $format=$option; + + $out.= "\n".''."\n"; + + if ($titlecontent) + { + $out.= '
'.$titlecontent; + $out.= '   -   '.dol_escape_htmltag($langs->trans("ShowMoreLines")).'     '; + $out.= '
'; + $out.= ''."\n"; + } + + $out.= '
content);
+        	$out.= '
'; + $out.= ''; + + $out.= ''."\n"; + } + if (empty($found)) { $out.= 'Error, unknown value for tool '.$this->tool.' in DolEditor Create function.'; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 4fad0149a5b..d603d1b6cc1 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -25,7 +25,7 @@ /** * Class to build graphs. - * Usage is: + * Usage is: * $dolgraph=new DolGraph(); * $dolgraph->SetTitle($langs->transnoentities('Tracking_Projects_Pourcent').'
'.$langs->transnoentities('Tracking_IndicatorDefGraph').'%'); * $dolgraph->SetMaxValue(50); @@ -570,6 +570,7 @@ class DolGraph function GetFloorMinValue() { $min = $this->GetMinValueInData(); + if ($min == '') $min=0; if ($min != 0) $min--; $size=dol_strlen(abs(floor($min))); $factor=1; @@ -868,7 +869,7 @@ class DolGraph return; } $this->stringtoshow.='
'."\n"; - + $this->stringtoshow.=''; - } print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice); } } @@ -3410,12 +3402,12 @@ class Form /** * Return list of categories having choosed type * - * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. - * @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element) - * @param string $htmlname HTML field name - * @param int $maxlength Maximum length for labels - * @param int $excludeafterid Exclude all categories after this leaf in category tree. - * @param int $outputmode 0=HTML select string, 1=Array + * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. + * @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element) + * @param string $htmlname HTML field name + * @param int $maxlength Maximum length for labels + * @param int $excludeafterid Exclude all categories after this leaf in category tree. + * @param int $outputmode 0=HTML select string, 1=Array * @return string * @see select_categories */ @@ -3458,7 +3450,7 @@ class Form else { $cat = new Categorie($this->db); - $cate_arbo = $cat->get_full_arbo($type,$excludeafterid); + $cate_arbo = $cat->get_full_arbo($type, $excludeafterid); } $output = ''; - foreach ($langs->cache_currencies as $code_iso => $currency) - { - if ($selected && $selected == $code_iso) - { - $out.= ''; - } - $out.= ''; - if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - return $out; - } + $out.= ''; + if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + + // Make select dynamic + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname); + + return $out; + } /** * Return array of currencies in user language @@ -4417,7 +4414,7 @@ class Form dol_syslog(__METHOD__, LOG_DEBUG); - $sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.recuperableonly"; + $sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; $sql.= " WHERE t.fk_pays = c.rowid"; $sql.= " AND t.active > 0"; @@ -4436,8 +4433,20 @@ class Form $this->cache_vatrates[$i]['rowid'] = $obj->rowid; $this->cache_vatrates[$i]['code'] = $obj->code; $this->cache_vatrates[$i]['txtva'] = $obj->taux; - $this->cache_vatrates[$i]['libtva'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or * $this->cache_vatrates[$i]['nprtva'] = $obj->recuperableonly; + $this->cache_vatrates[$i]['localtax1'] = $obj->localtax1; + $this->cache_vatrates[$i]['localtax1_type'] = $obj->localtax1_type; + $this->cache_vatrates[$i]['localtax2'] = $obj->localtax2; + $this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type; + + $this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or * + $this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1?$obj->localtax1:'0').'/'.($obj->localtax2?$obj->localtax2:'0').($obj->code?' ('.$obj->code.')':''); // Must never be used as key, only label + $positiverates=''; + if ($obj->taux) $positiverates.=($positiverates?'/':'').$obj->taux; + if ($obj->localtax1) $positiverates.=($positiverates?'/':'').$obj->localtax1; + if ($obj->localtax2) $positiverates.=($positiverates?'/':'').$obj->localtax2; + if (empty($positiverates)) $positiverates='0'; + $this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code?' ('.$obj->code.')':''); // Must never be used as key, only label } return $num; @@ -4611,7 +4620,16 @@ class Form $selectedfound=true; } } - $return.= '>'.vatrate($rate['libtva']); + $return.= '>'; + //if (! empty($conf->global->MAIN_VAT_SHOW_POSITIVE_RATES)) + if ($mysoc->country_code == 'IN' || ! empty($conf->global->MAIN_VAT_LABEL_IS_POSITIVE_RATES)) + { + $return.= $rate['labelpositiverates']; + } + else + { + $return.= vatrate($rate['label']); + } //$return.=($rate['code']?' '.$rate['code']:''); $return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used) @@ -4706,9 +4724,10 @@ class Form $smin = !isset($conf->global->MAIN_DEFAULT_DATE_MIN) ? '' : $conf->global->MAIN_DEFAULT_DATE_MIN; } + // You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery' $usecalendar='combo'; - if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) $usecalendar=empty($conf->global->MAIN_POPUP_CALENDAR)?'eldy':$conf->global->MAIN_POPUP_CALENDAR; - if ($conf->browser->phone) $usecalendar='combo'; + if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) $usecalendar=empty($conf->global->MAIN_POPUP_CALENDAR)?'jquery':$conf->global->MAIN_POPUP_CALENDAR; + //if (! empty($conf->browser->phone)) $usecalendar='combo'; if ($d) { @@ -4737,7 +4756,8 @@ class Form { $retstring.=''; + $retstring.=' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; + $retstring.='>'.img_object($langs->trans("SelectDate"),'calendarday','class="datecallink"').''; } else $retstring.=''; @@ -4745,9 +4765,58 @@ class Form $retstring.=''."\n"; $retstring.=''."\n"; } + elseif ($usecalendar == 'jquery') + { + if (! $disabled) + { + $retstring.=""; + } + + // Zone de saisie manuelle de la date + $retstring.='trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $retstring.='>'; + + // Icone calendrier + if (! $disabled) + { + /* Not required. Managed by option buttonImage of jquery + $retstring.=img_object($langs->trans("SelectDate"),'calendarday','id="'.$prefix.'id" class="datecallink"'); + $retstring.="";*/ + } + else + { + $retstring.=''; + } + + $retstring.=''."\n"; + $retstring.=''."\n"; + $retstring.=''."\n"; + } else { - print "Bad value of MAIN_POPUP_CALENDAR"; + $retstring.="Bad value of MAIN_POPUP_CALENDAR"; } } // Show date with combo selects @@ -5017,7 +5086,7 @@ class Form * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect * @param array $array Array (key => value) * @param string|string[] $id Preselected key or preselected keys for multiselect - * @param int $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (value is '' or ' ' if 1), <0 to add an empty value with key that is this value. + * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value. * @param int $key_in_label 1 to show key into label with format "[key] value" * @param int $value_as_key 1 to use value as key * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container @@ -5604,6 +5673,14 @@ class Form { $listofidcompanytoscan=$object->thirdparty->id; if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent; + if (($object->fk_project > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO)) + { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $tmpproject=new Project($this->db); + $tmpproject->fetch($object->fk_project); + if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) $listofidcompanytoscan.=','.$tmpproject->socid; + unset($tmpproject); + } $possiblelinks=array( 'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal').')'), @@ -5835,7 +5912,7 @@ class Form * @param string $paramid Name of parameter to use to name the id into the URL next/previous link. * @param string $morehtml More html content to output just before the nav bar. * @param int $shownav Show Condition (navigation is shown if value is 1). - * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field). + * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field). Use 'none' to disable next/prev. * @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref. * @param string $morehtmlref More html to show after ref. * @param string $moreparam More param to add in nav link url. Must start with '&...'. @@ -5845,11 +5922,11 @@ class Form * @param string $morehtmlright More html code to show after ref. * @return string Portion HTML with ref + navigation buttons */ - function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') - { - global $langs,$conf,$hookmanager; + function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') + { + global $langs,$conf,$hookmanager; - $ret=''; + $ret=''; if (empty($fieldid)) $fieldid='rowid'; if (empty($fieldref)) $fieldref='ref'; @@ -5861,18 +5938,22 @@ class Form $object->next_prev_filter.=$hookmanager->resPrint; } - //print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam"; - $object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix); - - $navurl = $_SERVER["PHP_SELF"]; - // Special case for project/task page - if ($paramid == 'project_ref') + $previous_ref = $next_ref = ''; + if ($shownav) { - $navurl = preg_replace('/\/tasks\/(task|contact|time|note|document).php/','/tasks.php',$navurl); - $paramid='ref'; + //print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam"; + $object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix); + + $navurl = $_SERVER["PHP_SELF"]; + // Special case for project/task page + if ($paramid == 'project_ref') + { + $navurl = preg_replace('/\/tasks\/(task|contact|time|note|document)\.php/','/tasks.php',$navurl); + $paramid='ref'; + } + $previous_ref = $object->ref_previous?'':''; + $next_ref = $object->ref_next?'':''; } - $previous_ref = $object->ref_previous?'':''; - $next_ref = $object->ref_next?'':''; //print "xx".$previous_ref."x".$next_ref; $ret.='
'; @@ -5880,10 +5961,10 @@ class Form // Right part of banner if ($morehtmlright) $ret.='
'.$morehtmlright.'
'; - if ($previous_ref || $next_ref || $morehtml) - { - $ret.='
'.$langs->trans("SmsFrom"); + print '
'.$langs->trans("SmsFrom"); print ''; print ""; if ($this->fromtype == 'user') @@ -223,7 +223,7 @@ function limitChars(textarea, limit, infodiv) if (is_array($resultsender) && count($resultsender) > 0) { - print ''; foreach($resultsender as $obj) { print ''; @@ -244,7 +244,7 @@ function limitChars(textarea, limit, infodiv) // To (target) if ($this->withto || is_array($this->withto)) { - print '
'; + print '
'; //$moretext=$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"); $moretext=''; print $form->textwithpicto($langs->trans("SmsTo"),$moretext); @@ -259,7 +259,7 @@ function limitChars(textarea, limit, infodiv) if (! empty($this->withtosocid) && $this->withtosocid > 0) { $liste=array(); - foreach ($soc->thirdparty_and_contact_phone_array() as $key=>$value) + foreach ($soc->thirdparty_and_contact_phone_array() as $key => $value) { $liste[$key]=$value; } @@ -285,7 +285,7 @@ function limitChars(textarea, limit, infodiv) $defaultmessage=str_replace('\n',"\n",$defaultmessage); print "
".$langs->trans("SmsText")."'.$langs->trans("SmsText").""; if ($this->withbodyreadonly) { @@ -306,7 +306,7 @@ function limitChars(textarea, limit, infodiv)
'.$langs->trans("Priority").' : - @@ -314,17 +314,23 @@ function limitChars(textarea, limit, infodiv)
'.$langs->trans("Type").' : - +
'.$langs->trans("DisableStopIfSupported").' : +
\n"; - - if ($showform) + + if ($showform) { print '
'; print ''; @@ -334,10 +340,10 @@ function limitChars(textarea, limit, infodiv) print ''; } print '
'; - + print "\n"; } - + print "\n"; } diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php new file mode 100644 index 00000000000..a42bdd0158a --- /dev/null +++ b/htdocs/core/class/html.formwebsite.class.php @@ -0,0 +1,1252 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/class/html.formwebsite.class.php + * \ingroup core + * \brief File of class to manage component html for module website + */ + + +/** + * Class to manage component html for module website + */ +class FormWebsite +{ + private $db; + public $error; + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + + return 1; + } + + + /** + * Return HTML select list of export models + * + * @param string $selected Id modele pre-selectionne + * @param string $htmlname Name of HTML select + * @param int $useempty Show empty value or not + * @return string Html component + */ + function selectWebsite($selected='',$htmlname='exportmodelid',$useempty=0) + { + $out=''; + + $sql = "SELECT rowid, ref"; + $sql.= " FROM ".MAIN_DB_PREFIX."website"; + $sql.= " WHERE 1 = 1"; + $sql.= " ORDER BY rowid"; + $result = $this->db->query($sql); + if ($result) + { + $out.='"; + } + else { + dol_print_error($this->db); + } + + return $out; + } + + + /** + * Return list of export models + * + * @param string $selected Id modele pre-selectionne + * @param string $htmlname Nom de la zone select + * @param string $type Type des modeles recherches + * @param int $useempty Affiche valeur vide dans liste + * @return void + */ + function select_import_model($selected='',$htmlname='importmodelid',$type='',$useempty=0) + { + $sql = "SELECT rowid, label"; + $sql.= " FROM ".MAIN_DB_PREFIX."import_model"; + $sql.= " WHERE type = '".$type."'"; + $sql.= " ORDER BY rowid"; + $result = $this->db->query($sql); + if ($result) + { + print '"; + } + else { + dol_print_error($this->db); + } + } + + + /** + * Return list of ecotaxes with label + * + * @param string $selected Preselected ecotaxes + * @param string $htmlname Name of combo list + * @return integer + */ + function select_ecotaxes($selected='',$htmlname='ecotaxe_id') + { + global $langs; + + $sql = "SELECT e.rowid, e.code, e.libelle, e.price, e.organization,"; + $sql.= " c.label as country"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_ecotaxe as e,".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE e.active = 1 AND e.fk_pays = c.rowid"; + $sql.= " ORDER BY country, e.organization ASC, e.code ASC"; + + dol_syslog(get_class($this).'::select_ecotaxes', LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + print ''; + return 0; + } + else + { + dol_print_error($this->db); + return 1; + } + } + + + /** + * Return list of revenue stamp for country + * + * @param string $selected Value of preselected revenue stamp + * @param string $htmlname Name of combo list + * @param string $country_code Country Code + * @return string HTML select list + */ + function select_revenue_stamp($selected='',$htmlname='revenuestamp',$country_code='') + { + global $langs; + + $out=''; + + $sql = "SELECT r.taux"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE r.active = 1 AND r.fk_pays = c.rowid"; + $sql.= " AND c.code = '".$country_code."'"; + + dol_syslog(get_class($this).'::select_revenue_stamp', LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $out.=''; + return $out; + } + else + { + dol_print_error($this->db); + return ''; + } + } + + + /** + * Return a HTML select list to select a percent + * + * @param integer $selected pourcentage pre-selectionne + * @param string $htmlname nom de la liste deroulante + * @param int $disabled Disabled or not + * @param int $increment increment value + * @param int $start start value + * @param int $end end value + * @param int $showempty Add also an empty line + * @return string HTML select string + */ + function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0) + { + $return = ''; + + return $return; + } + + /** + * Return select list for categories (to use in form search selectors) + * + * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. + * @param integer $selected Preselected value + * @param string $htmlname Name of combo list + * @param int $nocateg Show also an entry "Not categorized" + * @param int $showempty Add also an empty line + * @param string $morecss More CSS + * @return string Html combo list code + * @see select_all_categories + */ + function select_categories($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='') + { + global $conf, $langs; + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + + // For backward compatibility + if (is_numeric($type)) + { + dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); + } + + // Load list of "categories" + $static_categs = new Categorie($this->db); + $tab_categs = $static_categs->get_full_arbo($type); + + $moreforfilter = ''; + // Enhance with select2 + if ($conf->use_javascript_ajax) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $comboenhancement = ajax_combobox('select_categ_'.$htmlname); + $moreforfilter.=$comboenhancement; + } + + // Print a select with each of them + $moreforfilter.=''; + + return $moreforfilter; + } + + + /** + * Return select list for categories (to use in form search selectors) + * + * @param string $selected Preselected value + * @param string $htmlname Name of combo list (example: 'search_sale') + * @param User $user Object user + * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status + * @param int $showempty 1=show also an empty value + * @param string $morecss More CSS + * @return string Html combo list code + */ + function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1,$morecss='') + { + global $conf,$langs; + $langs->load('users'); + + $out = ''; + // Enhance with select2 + if ($conf->use_javascript_ajax) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + + $comboenhancement = ajax_combobox($htmlname); + if ($comboenhancement) + { + $out.=$comboenhancement; + } + } + // Select each sales and print them in a select input + $out.=''; + + return $out; + } + + /** + * Return list of project and tasks + * + * @param int $selectedtask Pre-selected task + * @param int $projectid Project id + * @param string $htmlname Name of html select + * @param int $modeproject 1 to restrict on projects owned by user + * @param int $modetask 1 to restrict on tasks associated to user + * @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists + * @param int $useempty 0=Allow empty values + * @param int $disablechildoftaskid 1=Disable task that are child of the provided task id + * @return void + */ + function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0, $disablechildoftaskid=0) + { + global $user, $langs; + + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + + //print $modeproject.'-'.$modetask; + $task=new Task($this->db); + $tasksarray=$task->getTasksArray($modetask?$user:0, $modeproject?$user:0, $projectid, 0, $mode); + if ($tasksarray) + { + print ''; + } + else + { + print '
'.$langs->trans("NoProject").'
'; + } + } + + /** + * Write lines of a project (all lines of a project if parent = 0) + * + * @param int $inc Cursor counter + * @param int $parent Id of parent task we want to see + * @param array $lines Array of task lines + * @param int $level Level + * @param int $selectedtask Id selected task + * @param int $selectedproject Id selected project + * @param int $disablechildoftaskid 1=Disable task that are child of the provided task id + * @return void + */ + private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0) + { + global $langs, $user, $conf; + + $lastprojectid=0; + + $numlines=count($lines); + for ($i = 0 ; $i < $numlines ; $i++) + { + if ($lines[$i]->fk_parent == $parent) + { + //var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines + + // Break on a new project + if ($parent == 0) // We are on a task at first level + { + if ($lines[$i]->fk_project != $lastprojectid) // Break found on project + { + if ($i > 0) print ''; + print '\n"; + + $lastprojectid=$lines[$i]->fk_project; + $inc++; + } + } + + $newdisablechildoftaskid=$disablechildoftaskid; + + // Print task + if (isset($lines[$i]->id)) // We use isset because $lines[$i]->id may be null if project has no task and are on root project (tasks may be caught by a left join). We enter here only if '0' or >0 + { + // Check if we must disable entry + $disabled=0; + if ($disablechildoftaskid && (($lines[$i]->id == $disablechildoftaskid || $lines[$i]->fk_parent == $disablechildoftaskid))) + { + $disabled++; + if ($lines[$i]->fk_parent == $disablechildoftaskid) $newdisablechildoftaskid=$lines[$i]->id; // If task is child of a disabled parent, we will propagate id to disable next child too + } + + print '\n"; + $inc++; + } + + $level++; + if ($lines[$i]->id) $this->_pLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject, $newdisablechildoftaskid); + $level--; + } + } + } + + + /** + * Output a HTML thumb of color or a text if not defined. + * + * @param string $color String with hex (FFFFFF) or comma RGB ('255,255,255') + * @param string $textifnotdefined Text to show if color not defined + * @return string HTML code for color thumb + * @see selectColor + */ + static function showColor($color, $textifnotdefined='') + { + $textcolor='FFF'; + if ($color) + { + $tmp=explode(',', $color); + if (count($tmp) > 1) // This is a comma RGB ('255','255','255') + { + $r = $tmp[0]; + $g = $tmp[1]; + $b = $tmp[2]; + } + else + { + $hexr=$color[0].$color[1]; + $hexg=$color[2].$color[3]; + $hexb=$color[4].$color[5]; + $r = hexdec($hexr); + $g = hexdec($hexg); + $b = hexdec($hexb); + } + $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm + if ($bright > 0.6) $textcolor='000'; + } + + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + $color = colorArrayToHex(colorStringToArray($color,array()),''); + + if ($color) print ''; + else print $textifnotdefined; + } + + /** + * Output a HTML code to select a color + * + * @param string $set_color Pre-selected color + * @param string $prefix Name of HTML field + * @param string $form_name Deprecated. Not used. + * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code + * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @return void + * @deprecated Use instead selectColor + * @see selectColor() + */ + function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='') + { + print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors); + } + + /** + * Output a HTML code to select a color. Field will return an hexa color like '334455'. + * + * @param string $set_color Pre-selected color + * @param string $prefix Name of HTML field + * @param string $form_name Deprecated. Not used. + * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code + * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @param string $morecss Add css style into input field + * @return string + * @see showColor + */ + static function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='') + { + // Deprecation warning + if ($form_name) { + dol_syslog(__METHOD__ . ": form_name parameter is deprecated", LOG_WARNING); + } + + global $langs,$conf; + + $out=''; + + if (! is_array($arrayofcolors) || count($arrayofcolors) < 1) + { + $langs->load("other"); + if (empty($conf->dol_use_jmobile)) + { + $out.= ''; + $out.= ''; + $out.= ''; + } + $out.= ''; + } + else // In most cases, this is not used. We used instead function with no specific list of colors + { + if (empty($conf->dol_use_jmobile)) + { + $out.= ''; + $out.= ''; + $out.= ''; + } + $out.= ''; + } + + return $out; + } + + /** + * Creation d'un icone de couleur + * + * @param string $color Couleur de l'image + * @param string $module Nom du module + * @param string $name Nom de l'image + * @param int $x Largeur de l'image en pixels + * @param int $y Hauteur de l'image en pixels + * @return void + */ + function CreateColorIcon($color,$module,$name,$x='12',$y='12') + { + global $conf; + + $file = $conf->$module->dir_temp.'/'.$name.'.png'; + + // On cree le repertoire contenant les icones + if (! file_exists($conf->$module->dir_temp)) + { + dol_mkdir($conf->$module->dir_temp); + } + + // On cree l'image en vraies couleurs + $image = imagecreatetruecolor($x,$y); + + $color = substr($color,1,6); + + $rouge = hexdec(substr($color,0,2)); //conversion du canal rouge + $vert = hexdec(substr($color,2,2)); //conversion du canal vert + $bleu = hexdec(substr($color,4,2)); //conversion du canal bleu + + $couleur = imagecolorallocate($image,$rouge,$vert,$bleu); + //print $rouge.$vert.$bleu; + imagefill($image,0,0,$couleur); //on remplit l'image + // On cree la couleur et on l'attribue a une variable pour ne pas la perdre + ImagePng($image,$file); //renvoie une image sous format png + ImageDestroy($image); + } + + /** + * Return HTML combo list of week + * + * @param string $selected Preselected value + * @param string $htmlname Nom de la zone select + * @param int $useempty Affiche valeur vide dans liste + * @return string + */ + function select_dayofweek($selected='',$htmlname='weekid',$useempty=0) + { + global $langs; + + $week = array( 0=>$langs->trans("Day0"), + 1=>$langs->trans("Day1"), + 2=>$langs->trans("Day2"), + 3=>$langs->trans("Day3"), + 4=>$langs->trans("Day4"), + 5=>$langs->trans("Day5"), + 6=>$langs->trans("Day6")); + + $select_week = ''; + return $select_week; + } + + /** + * Return HTML combo list of month + * + * @param string $selected Preselected value + * @param string $htmlname Name of HTML select object + * @param int $useempty Show empty in list + * @param int $longlabel Show long label + * @return string + */ + function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) + { + global $langs; + + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + + if ($longlabel) $montharray = monthArray($langs, 0); // Get array + else $montharray = monthArray($langs, 1); + + $select_month = ''; + return $select_month; + } + + /** + * Return HTML combo list of years + * + * @param string $selected Preselected value (''=current year, -1=none, year otherwise) + * @param string $htmlname Name of HTML select object + * @param int $useempty Affiche valeur vide dans liste + * @param int $min_year Offset of minimum year into list (by default current year -10) + * @param int $max_year Offset of maximum year into list (by default current year + 5) + * @param int $offset Offset + * @param int $invert Invert + * @param string $option Option + * @return string + */ + function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='') + { + print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option); + } + + /** + * Return HTML combo list of years + * + * @param string $selected Preselected value (''=current year, -1=none, year otherwise) + * @param string $htmlname Name of HTML select object + * @param int $useempty Affiche valeur vide dans liste + * @param int $min_year Offset of minimum year into list (by default current year -10) + * @param int $max_year Offset of maximum year into list (by default current year + 5) + * @param int $offset Offset + * @param int $invert Invert + * @param string $option Option + * @return string + */ + function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='') + { + $out=''; + + $currentyear = date("Y")+$offset; + $max_year = $currentyear+$max_year; + $min_year = $currentyear-$min_year; + if(empty($selected) && empty($useempty)) $selected = $currentyear; + + $out.= '\n"; + + return $out; + } + + /** + * Show form to select address + * + * @param int $page Page + * @param string $selected Id condition pre-selectionne + * @param int $socid Id of third party + * @param string $htmlname Nom du formulaire select + * @param string $origin Origine de l'appel pour pouvoir creer un retour + * @param int $originid Id de l'origine + * @return void + */ + function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='') + { + global $langs,$conf; + global $form; + + if ($htmlname != "none") + { + print '
'; + print ''; + print ''; + $form->select_address($selected, $socid, $htmlname, 1); + print ''; + $langs->load("companies"); + print '   '.$langs->trans("AddAddress").''; + print '
'; + } + else + { + if ($selected) + { + require_once DOL_DOCUMENT_ROOT .'/societe/class/address.class.php'; + $address=new Address($this->db); + $result=$address->fetch_address($selected); + print ''.$address->label.''; + } + else + { + print " "; + } + } + } + + + + /** + * Get array with HTML tabs with boxes of a particular area including personalized choices of user. + * Class 'Form' must be known. + * + * @param User $user Object User + * @param String $areacode Code of area for pages ('0'=value for Home page) + * @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>) + */ + static function getBoxesArea($user,$areacode) + { + global $conf,$langs,$db; + + include_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; + + $confuserzone='MAIN_BOXES_'.$areacode; + + // $boxactivated will be array of boxes enabled into global setup + // $boxidactivatedforuser will be array of boxes choosed by user + + $selectboxlist=''; + $boxactivated=InfoBox::listBoxes($db, 'activated', $areacode, (empty($user->conf->$confuserzone)?null:$user), array(), 0); // Search boxes of common+user (or common only if user has no specific setup) + + $boxidactivatedforuser=array(); + foreach($boxactivated as $box) + { + if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id]=$box->id; // We keep only boxes to show for user + } + + // Define selectboxlist + $arrayboxtoactivatelabel=array(); + if (! empty($user->conf->$confuserzone)) + { + $boxorder=''; + $langs->load("boxes"); // Load label of boxes + foreach($boxactivated as $box) + { + if (! empty($boxidactivatedforuser[$box->id])) continue; // Already visible for user + $label=$langs->transnoentitiesnoconv($box->boxlabel); + if (preg_match('/graph/',$box->class)) $label.=' ('.$langs->trans("Graph").')'; + //$label = ''.$label; KO with select2. No html rendering. + $arrayboxtoactivatelabel[$box->id]=$label; // We keep only boxes not shown for user, to show into combo list + } + foreach($boxidactivatedforuser as $boxid) + { + if (empty($boxorder)) $boxorder.='A:'; + $boxorder.=$boxid.','; + } + + //var_dump($boxidactivatedforuser); + + // Class Form must have been already loaded + $selectboxlist.='
'; + $selectboxlist.=''; + $selectboxlist.=''; + $selectboxlist.=''; + $selectboxlist.=''; + $selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone', 0, 'hidden selected', 0, 1); + if (empty($conf->use_javascript_ajax)) $selectboxlist.=' '; + $selectboxlist.='
'; + $selectboxlist.=ajax_combobox("boxcombo"); + } + + // Javascript code for dynamic actions + if (! empty($conf->use_javascript_ajax)) + { + $selectboxlist.=''."\n"; + } + + // Define boxlista and boxlistb + $nbboxactivated=count($boxidactivatedforuser); + + if ($nbboxactivated) + { + $langs->load("boxes"); + $langs->load("projects"); + + $emptybox=new ModeleBoxes($db); + + $boxlista ="\n\n"; + $boxlista.='
'."\n"; + + // Define $box_max_lines + $box_max_lines=5; + if (! empty($conf->global->MAIN_BOXES_MAXLINES)) $box_max_lines=$conf->global->MAIN_BOXES_MAXLINES; + + $ii=0; + foreach ($boxactivated as $key => $box) + { + if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue; + if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='A'.sprintf("%02d",($ii+1)); // When box_order was not yet set to Axx or Bxx and is still 0 + if (preg_match('/^A/i',$box->box_order)) // column A + { + $ii++; + //print 'box_id '.$boxactivated[$ii]->box_id.' '; + //print 'box_order '.$boxactivated[$ii]->box_order.'
'; + // Show box + $box->loadBox($box_max_lines); + $boxlista.= $box->outputBox(); + } + } + + if (empty($conf->browser->phone)) + { + $emptybox->box_id='A'; + $emptybox->info_box_head=array(); + $emptybox->info_box_contents=array(); + $boxlista.= $emptybox->outputBox(array(),array()); + } + $boxlista.= "
\n"; + $boxlista.= "\n"; + + $boxlistb = "\n\n"; + $boxlistb.= '\n"; + $boxlistb.= "\n"; + + } + + return array('selectboxlist'=>count($boxactivated)?$selectboxlist:'', 'boxactivated'=>$boxactivated, 'boxlista'=>$boxlista, 'boxlistb'=>$boxlistb); + } + + + /** + * Return a HTML select list of bank accounts + * + * @param string $htmlname Name of select zone + * @param string $dictionarytable Dictionary table + * @param string $keyfield Field for key + * @param string $labelfield Label field + * @param string $selected Selected value + * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param string $moreattrib More attributes on HTML select tag + * @return void + */ + function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='') + { + global $langs, $conf; + + $langs->load("admin"); + + $sql = "SELECT rowid, ".$keyfield.", ".$labelfield; + $sql.= " FROM ".MAIN_DB_PREFIX.$dictionarytable; + $sql.= " ORDER BY ".$labelfield; + + dol_syslog(get_class($this)."::select_dictionary", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $num = $this->db->num_rows($result); + $i = 0; + if ($num) + { + print '"; + } + else + { + print $langs->trans("DictionaryEmpty"); + } + } + else { + dol_print_error($this->db); + } + } + +} + diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 625b30e3ac2..a34754b8d4c 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -120,7 +120,7 @@ class Interfaces if (! $qualified) { - dol_syslog(get_class($this)."::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled", LOG_DEBUG); + //dol_syslog(get_class($this)."::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled", LOG_DEBUG); continue; } @@ -231,7 +231,7 @@ class Interfaces */ function getTriggersList($forcedirtriggers=null) { - global $conf, $langs; + global $conf, $langs, $db; $files = array(); $fullpath = array(); @@ -262,6 +262,8 @@ class Interfaces { if (is_readable($newdir.'/'.$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/',$file,$reg)) { + if (preg_match('/\.back$/',$file)) continue; + $part1=$reg[1]; $part2=$reg[2]; $part3=$reg[3]; @@ -309,7 +311,7 @@ class Interfaces continue; } - $objMod = new $modName($this->db); + $objMod = new $modName($db); // Define disabledbyname and disabledbymodule $disabledbyname=0; @@ -323,8 +325,9 @@ class Interfaces { $module=preg_replace('/^mod/i','',$reg[2]); $constparam='MAIN_MODULE_'.strtoupper($module); - if (strtolower($reg[2]) == 'all') $disabledbymodule=0; + if (strtolower($module) == 'all') $disabledbymodule=0; else if (empty($conf->global->$constparam)) $disabledbymodule=2; + $triggers[$j]['module']=strtolower($module); } // We set info of modules @@ -335,7 +338,7 @@ class Interfaces $triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key]; $triggers[$j]['version'] = $objMod->getVersion(); $triggers[$j]['status'] = img_picto($langs->trans("Active"),'tick'); - if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = " "; + if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = ''; $text =''.$langs->trans("Description").':
'; $text.=$objMod->getDesc().'
'; diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index f604e85e11d..0441c04a86e 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -89,7 +89,7 @@ class Link extends CommonObject $sql .= " VALUES ('".$conf->entity."', '".$this->db->idate($this->datea)."'"; $sql .= ", '" . $this->db->escape($this->url) . "'"; $sql .= ", '" . $this->db->escape($this->label) . "'"; - $sql .= ", '" . $this->objecttype . "'"; + $sql .= ", '" . $this->db->escape($this->objecttype) . "'"; $sql .= ", " . $this->objectid . ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -100,7 +100,7 @@ class Link extends CommonObject if ($this->id > 0) { // Call trigger $result=$this->call_trigger('LINK_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } else { $error++; @@ -283,20 +283,20 @@ class Link extends CommonObject public static function count($db, $objecttype, $objectid) { global $conf; - + $sql = "SELECT COUNT(rowid) as nb FROM " . MAIN_DB_PREFIX . "links"; $sql .= " WHERE objecttype = '" . $objecttype . "' AND objectid = " . $objectid; if ($conf->entity != 0) $sql .= " AND entity = " . $conf->entity; - + $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); if ($obj) return $obj->nb; - } + } return -1; } - + /** * Loads a link from database * @@ -354,8 +354,8 @@ class Link extends CommonObject // Call trigger $result=$this->call_trigger('LINK_DELETE',$user); - if ($result < 0) return -1; - // End call triggers + if ($result < 0) return -1; + // End call triggers $this->db->begin(); diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index 58e93ec5544..d4570218ff2 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -51,7 +51,7 @@ class Menu /** * Add a menu entry into this->liste (at end) * - * @param string $url Url to follow on click + * @param string $url Url to follow on click (does not include DOL_URL_ROOT) * @param string $titre Label of menu to add * @param integer $level Level of menu to add * @param int $enabled Menu active or not (0=Not active, 1=Active, 2=Active but grey) @@ -59,11 +59,14 @@ class Menu * @param string $mainmenu Main menu ('home', 'companies', 'products', ...) * @param string $leftmenu Left menu ('setup', 'system', 'admintools', ...) * @param int $position Position (not used yet) + * @param string $id Id + * @param string $idsel Id sel + * @param string $classname Class name * @return void */ - function add($url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='',$position=0) + function add($url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='',$position=0, $id='', $idsel='', $classname='') { - $this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu, 'position'=>$position); + $this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu, 'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname); } /** @@ -78,12 +81,15 @@ class Menu * @param string $mainmenu Main menu ('home', 'companies', 'products', ...) * @param string $leftmenu Left menu ('setup', 'system', 'admintools', ...) * @param int $position Position (not used yet) + * @param string $id Id + * @param string $idsel Id sel + * @param string $classname Class name * @return void */ - function insert($idafter, $url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='',$position=0) + function insert($idafter, $url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='',$position=0, $id='', $idsel='', $classname='') { $array_start = array_slice($this->liste,0,($idafter+1)); - $array_new = array(0=>array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu,'position'=>$position)); + $array_new = array(0=>array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu,'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname)); $array_end = array_slice($this->liste,($idafter+1)); $this->liste=array_merge($array_start,$array_new,$array_end); } @@ -100,7 +106,7 @@ class Menu /** * Return number of visible entries (gray or not) - * + * * @return int Number of visible (gray or not) menu entries */ function getNbOfVisibleMenuEntries() diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index a6770b57c37..f011119e08e 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -144,15 +144,15 @@ class Menubase $sql.= "enabled,"; $sql.= "usertype"; $sql.= ") VALUES ("; - $sql.= " '".$this->menu_handler."',"; - $sql.= " '".$conf->entity."',"; - $sql.= " '".$this->module."',"; - $sql.= " '".$this->type."',"; - $sql.= " ".($this->mainmenu?"'".$this->mainmenu."'":"''").","; // Can't be null - $sql.= " ".($this->leftmenu?"'".$this->leftmenu."'":"null").","; - $sql.= " '".$this->fk_menu."',"; - $sql.= " ".($this->fk_mainmenu?"'".$this->fk_mainmenu."'":"null").","; - $sql.= " ".($this->fk_leftmenu?"'".$this->fk_leftmenu."'":"null").","; + $sql.= " '".$this->db->escape($this->menu_handler)."',"; + $sql.= " '".$this->db->escape($conf->entity)."',"; + $sql.= " '".$this->db->escape($this->module)."',"; + $sql.= " '".$this->db->escape($this->type)."',"; + $sql.= " ".($this->mainmenu?"'".$this->db->escape($this->mainmenu)."'":"''").","; // Can't be null + $sql.= " ".($this->leftmenu?"'".$this->db->escape($this->leftmenu)."'":"null").","; + $sql.= " '".$this->db->escape($this->fk_menu)."',"; + $sql.= " ".($this->fk_mainmenu?"'".$this->db->escape($this->fk_mainmenu)."'":"null").","; + $sql.= " ".($this->fk_leftmenu?"'".$this->db->escape($this->fk_leftmenu)."'":"null").","; $sql.= " '".(int) $this->position."',"; $sql.= " '".$this->db->escape($this->url)."',"; $sql.= " '".$this->db->escape($this->target)."',"; @@ -160,7 +160,7 @@ class Menubase $sql.= " '".$this->db->escape($this->langs)."',"; $sql.= " '".$this->db->escape($this->perms)."',"; $sql.= " '".$this->db->escape($this->enabled)."',"; - $sql.= " '".$this->user."'"; + $sql.= " '".$this->db->escape($this->user)."'"; $sql.= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -220,8 +220,8 @@ class Menubase $sql.= " mainmenu='".$this->db->escape($this->mainmenu)."',"; $sql.= " leftmenu='".$this->db->escape($this->leftmenu)."',"; $sql.= " fk_menu='".$this->db->escape($this->fk_menu)."',"; - $sql.= " fk_mainmenu=".($this->fk_mainmenu?"'".$this->fk_mainmenu."'":"null").","; - $sql.= " fk_leftmenu=".($this->fk_leftmenu?"'".$this->fk_leftmenu."'":"null").","; + $sql.= " fk_mainmenu=".($this->fk_mainmenu?"'".$this->db->escape($this->fk_mainmenu)."'":"null").","; + $sql.= " fk_leftmenu=".($this->fk_leftmenu?"'".$this->db->escape($this->fk_leftmenu)."'":"null").","; $sql.= " position=".($this->position > 0 ? $this->position : 0).","; $sql.= " url='".$this->db->escape($this->url)."',"; $sql.= " target='".$this->db->escape($this->target)."',"; @@ -402,7 +402,8 @@ class Menubase } /** - * Load entries found from database in this->newmenu array. + * Load entries found from database (and stored into $tabMenu) in $this->newmenu array. + * Warning: Entries in $tabMenu must have child after parent * * @param Menu $newmenu Menu array to complete (in most cases, it's empty, may be already initialized with some menu manager like eldy) * @param string $mymainmenu Value for mainmenu to filter menu to load (often $_SESSION["mainmenu"]) @@ -435,10 +436,10 @@ class Menubase // We initialize newmenu with first already found menu entries $this->newmenu = $newmenu; - // Now edit this->newmenu->list to add entries found into tabMenu that are childs of mainmenu claimed, using the fk_menu link (old method) + // Now complete $this->newmenu->list to add entries found into $tabMenu that are childs of mainmenu=$menutopid, using the fk_menu link that is int (old method) $this->recur($tabMenu, $menutopid, 1); - // Now update this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu) + // Now complete $this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu) foreach($tabMenu as $key => $val) { //var_dump($tabMenu); @@ -479,6 +480,10 @@ class Menubase } //print 'We must insert menu entry between entry '.$lastid.' and '.$nextid.'
'; if ($found) $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position']); + else { + dol_syslog("Error. Modules ".$val['module']." has defined a menu entry with a parent='fk_mainmenu=".$val['fk_leftmenu'].",fk_leftmenu=".$val['fk_leftmenu']."' and position=".$val['position'].'. The parent was not found. May be you forget it into your definition of menu, or may be the parent has a "position" that is after the child (fix field "position" of parent or child in this case).', LOG_WARNING); + //print "Parent menu not found !!
"; + } } } } @@ -494,7 +499,7 @@ class Menubase * @param string $myleftmenu Value for left that defined leftmenu * @param int $type_user Looks for menu entry for 0=Internal users, 1=External users * @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...) - * @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) + * @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) * @return int >0 if OK, <0 if KO */ function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) @@ -602,7 +607,7 @@ class Menubase //$tabMenu[$b]['langs'] = $menu['langs']; $tabMenu[$b]['fk_mainmenu'] = $menu['fk_mainmenu']; $tabMenu[$b]['fk_leftmenu'] = $menu['fk_leftmenu']; - $tabMenu[$b]['position'] = $menu['position']; + $tabMenu[$b]['position'] = (int) $menu['position']; $b++; } @@ -610,6 +615,11 @@ class Menubase $a++; } $this->db->free($resql); + + // Currently $tabMenu is sorted on position. + // If a child have a position lower that its parent, we can make a loop to fix this here, but we prefer to show a warning + // into the leftMenuCharger later to avoid useless operations. + return 1; } else @@ -622,7 +632,7 @@ class Menubase /** * Complete this->newmenu with menu entry found in $tab * - * @param array $tab Tab array + * @param array $tab Tab array with all menu entries * @param int $pere Id of parent * @param int $level Level * @return void diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 9fb119fa9e6..7ddb71315b7 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -221,7 +221,7 @@ class SMTPs var $_debug = false; - // DOL_CHANGE LDR + // @CHANGE LDR var $log = ''; var $_errorsTo = ''; var $_deliveryReceipt = 0; @@ -271,7 +271,7 @@ class SMTPs { $this->_moreinheader = $_val; } - + /** * get trackid * @@ -291,7 +291,7 @@ class SMTPs { return $this->_moreinheader; } - + /** * Set errors to * @@ -358,10 +358,13 @@ class SMTPs // This is done here because '@fsockopen' will not give me this // information if it failes to connect because it can't find the HOST $host=$this->getHost(); + $usetls = preg_match('@tls://@i',$host); + $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix + $host=preg_replace('@tls://@i','',$host); // Remove prefix - // DOL_CHANGE LDR + // @CHANGE LDR include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; if ( (! is_ip($host)) && ((gethostbyname($host)) == $host)) @@ -373,7 +376,7 @@ class SMTPs { //See if we can connect to the SMTP server if ($this->socket = @fsockopen( - $this->getHost(), // Host to 'hit', IP or domain + preg_replace('@tls://@i','',$this->getHost()), // Host to 'hit', IP or domain $this->getPort(), // which Port number to use $this->errno, // actual system level error $this->errstr, // and any text that goes with the error @@ -393,7 +396,7 @@ class SMTPs // This connection attempt failed. else { - // DOL_CHANGE LDR + // @CHANGE LDR if (empty($this->errstr)) $this->errstr='Failed to connect with fsockopen host='.$this->getHost().' port='.$this->getPort(); $this->_setErr($this->errno, $this->errstr); $_retVal = false; @@ -411,21 +414,22 @@ class SMTPs function _server_authenticate() { global $conf; - + // Send the RFC2554 specified EHLO. // This improvment as provided by 'SirSir' to // accomodate both SMTP AND ESMTP capable servers $host=$this->getHost(); + $usetls = preg_match('@tls://@i',$host); + $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix - if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)) - { - $host=preg_replace('@tls://@i','',$host); // Remove prefix - $host='tls://'.$host; - } + $host=preg_replace('@tls://@i','',$host); // Remove prefix + + if ($usetls) $host='tls://'.$host; + if ( $_retVal = $this->socket_send_str('EHLO ' . $host, '250') ) { - if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)) + if ($usetls) { /* The following dialog illustrates how a client and server can start a TLS STARTTLS session @@ -443,7 +447,7 @@ class SMTPs // Second pass EHLO C: EHLO client-domain.com S: 250-server-domain.com - S: 250 AUTH LOGIN + S: 250 AUTH LOGIN C: socket_send_str('STARTTLS', 220)) @@ -451,18 +455,32 @@ class SMTPs $this->_setErr(131, 'STARTTLS connection is not supported.'); return $_retVal; } - if (!stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) + + // Before 5.6.7: + // STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_SSLv2_CLIENT|STREAM_CRYPTO_METHOD_SSLv3_CLIENT + // STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + // PHP >= 5.6.7: + // STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + // STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT + + $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; + if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + } + + if (!stream_socket_enable_crypto($this->socket, true, $crypto_method)) { $this->_setErr(132, 'STARTTLS connection failed.'); return $_retVal; } - // Most server servers expect a 2nd pass of EHLO after TLS is established to get another time + // Most server servers expect a 2nd pass of EHLO after TLS is established to get another time // the answer with list of supported AUTH methods. They may differs between non STARTTLS and with STARTTLS. if (!$_retVal = $this->socket_send_str('EHLO '.$host, '250')) { $this->_setErr(126, '"' . $host . '" does not support authenticated connections.'); return $_retVal; - } + } } // Send Authentication to Server // Check for errors along the way @@ -514,8 +532,12 @@ class SMTPs { // Send the RFC821 specified HELO. $host=$this->getHost(); + $usetls = preg_match('@tls://@i',$host); + $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix + $host=preg_replace('@tls://@i','',$host); // Remove prefix + $_retVal = $this->socket_send_str('HELO ' . $host, '250'); } @@ -903,7 +925,7 @@ class SMTPs if ( $_strReplyTo ) $this->_msgReplyTo = $this->_strip_email($_strReplyTo); } - + /** * Retrieves the Address from which mail will be the reply-to * @@ -913,15 +935,15 @@ class SMTPs function getReplyTo($_part = true) { $_retValue = ''; - + if ( $_part === true ) $_retValue = $this->_msgReplyTo; else $_retValue = $this->_msgReplyTo[$_part]; - + return $_retValue; } - + /** * Inserts given addresses into structured format. * This method takes a list of given addresses, via an array @@ -1093,7 +1115,7 @@ class SMTPs { foreach ( $this->_msgRecipients[$_host][$_which] as $_addr => $_realName ) { - if ( $_realName ) // DOL_CHANGE LDR + if ( $_realName ) // @CHANGE LDR { $_realName = '"' . $_realName . '"'; $_RCPT_list[] = $_realName . ' <' . $_addr . '@' . $_host . '>'; @@ -1217,6 +1239,8 @@ class SMTPs */ function getHeader() { + global $conf; + $_header = 'From: ' . $this->getFrom('org') . "\r\n" . 'To: ' . $this->getTO() . "\r\n"; @@ -1233,13 +1257,16 @@ class SMTPs if ( $this->getBCC() ) $_header .= 'Bcc: ' . $this->getBCC() . "\r\n"; */ - + $host=$this->getHost(); + $usetls = preg_match('@tls://@i',$host); + $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix + $host=preg_replace('@tls://@i','',$host); // Remove prefix $host=dol_getprefix('email'); - + //NOTE: Message-ID should probably contain the username of the user who sent the msg $_header .= 'Subject: ' . $this->getSubject() . "\r\n"; $_header .= 'Date: ' . date("r") . "\r\n"; @@ -1258,7 +1285,7 @@ class SMTPs } if ( $this->getMoreInHeader() ) $_header .= $this->getMoreInHeader(); // Value must include the "\r\n"; - + //$_header .= // 'Read-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n" // 'Return-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n"; @@ -1270,7 +1297,7 @@ class SMTPs $_header .= $this->getPriority(); - // DOL_CHANGE LDR + // @CHANGE LDR if ( $this->getDeliveryReceipt() ) $_header .= 'Disposition-Notification-To: '.$this->getFrom('addr') . "\r\n"; if ( $this->getErrorsTo() ) @@ -1279,9 +1306,10 @@ class SMTPs $_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n"; $_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\r\n"; + $_header .= 'X-Dolibarr-Option: '.($conf->global->MAIN_MAIL_USE_MULTI_PART?'MAIN_MAIL_USE_MULTI_PART':'No MAIN_MAIL_USE_MULTI_PART') . "\r\n"; $_header .= 'Mime-Version: 1.0' . "\r\n"; - + return $_header; } @@ -1310,17 +1338,17 @@ class SMTPs $strContentAltText = html_entity_decode(strip_tags($strContent)); $strContentAltText = rtrim(wordwrap($strContentAltText, 75, "\r\n")); } - + // Make RFC2045 Compliant //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content $strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content. - + $this->_msgContent[$strType] = array(); $this->_msgContent[$strType]['mimeType'] = $strMimeType; $this->_msgContent[$strType]['data'] = $strContent; $this->_msgContent[$strType]['dataText'] = $strContentAltText; - + if ( $this->getMD5flag() ) $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); //} @@ -1334,7 +1362,7 @@ class SMTPs function getBodyContent() { global $conf; - + // Generate a new Boundary string $this->_setBoundary(); @@ -1382,7 +1410,7 @@ class SMTPs $content .= "\r\n"; $content .= "--" . $this->_getBoundary('mixed') . "\r\n"; - + if (key_exists('image', $this->_msgContent)) // If inline image found { $content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n"; @@ -1390,7 +1418,7 @@ class SMTPs $content .= "--" . $this->_getBoundary('alternative') . "\r\n"; } - + // $this->_msgContent must be sorted with key 'text' or 'html' first then 'image' then 'attachment' @@ -1414,7 +1442,7 @@ class SMTPs $content .= "\r\n" . $_data['data'] . "\r\n\r\n"; } } - // DOL_CHANGE LDR + // @CHANGE LDR else if ( $type == 'image' ) { // loop through all images @@ -1450,18 +1478,18 @@ class SMTPs $content.= "\r\n"; $content.= "--" . $this->_getBoundary('related') . "\r\n"; } - + if (! key_exists('image', $this->_msgContent) && $_content['dataText'] && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part { $content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n"; $content .= "\r\n"; $content .= "--" . $this->_getBoundary('alternative') . "\r\n"; - + $content.= "Content-Type: text/plain; charset=" . $this->getCharSet() . "\r\n"; $content.= "\r\n". $_content['dataText'] . "\r\n"; $content.= "--" . $this->_getBoundary('alternative') . "\r\n"; - } - + } + $content .= 'Content-Type: ' . $_content['mimeType'] . '; ' // . 'charset="' . $this->getCharSet() . '"'; . 'charset=' . $this->getCharSet() . ''; @@ -1483,7 +1511,7 @@ class SMTPs { $content.= "--" . $this->_getBoundary('alternative') . "--". "\r\n"; } - + $content .= "\r\n"; } } @@ -1521,7 +1549,7 @@ class SMTPs } - // DOL_CHANGE LDR + // @CHANGE LDR /** * Image attachments are added to the content array as sub-arrays, @@ -1546,7 +1574,7 @@ class SMTPs $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, 3); } } - // END DOL_CHANGE LDR + // END @CHANGE LDR /** @@ -1740,7 +1768,7 @@ class SMTPs */ function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" ) { - if ($this->_debug) $this->log.=$_strSend; // DOL_CHANGE LDR for log + if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log fputs($this->socket, $_strSend . $CRLF); if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF; diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 3a35bfb2cc2..dee63987d45 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -28,10 +28,10 @@ class Utils { var $db; - + var $output; // Used by Cron method to return message var $result; // Used by Cron method to return data - + /** * Constructor * @@ -47,21 +47,21 @@ class Utils * Purge files into directory of data files. * CAN BE A CRON TASK * - * @param string $choice Choice of purge mode ('tempfiles', 'tempfilesold' to purge temp older than 24h, 'allfiles', 'logfiles') - * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) + * @param string $choice Choice of purge mode ('tempfiles', 'tempfilesold' to purge temp older than 24h, 'allfiles', 'logfile') + * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ function purgeFiles($choice='tempfilesold') { global $conf, $langs, $dolibarr_main_data_root; - + $langs->load("admin"); - + dol_syslog("Utils::purgeFiles choice=".$choice, LOG_DEBUG); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - + $filesarray=array(); if (empty($choice)) $choice='tempfilesold'; - + if ($choice=='tempfiles' || $choice=='tempfilesold') { // Delete temporary files @@ -78,49 +78,71 @@ class Utils } } } - + if ($choice=='allfiles') { - // Delete all files + // Delete all files (except install.lock) if ($dolibarr_main_data_root) { $filesarray=dol_dir_list($dolibarr_main_data_root,"all",0,'','install\.lock$'); } } - + if ($choice=='logfile') { - // Define filelog to discard it from purge + // Define files log + if ($dolibarr_main_data_root) + { + $filesarray=dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*$', 'install\.lock$'); + } + $filelog=''; if (! empty($conf->syslog->enabled)) { $filelog=$conf->global->SYSLOG_FILE; $filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog); - } - $filesarray[]=array('fullname'=>$filelog,'type'=>'file'); + $alreadyincluded=false; + foreach ($filesarray as $tmpcursor) + { + if ($tmpcursor['fullname'] == $filelog) { $alreadyincluded=true; } + } + if (! $alreadyincluded) $filesarray[]=array('fullname'=>$filelog,'type'=>'file'); + } } - + $count=0; + $countdeleted=0; + $counterror=0; if (count($filesarray)) { foreach($filesarray as $key => $value) { - //print "x ".$filesarray[$key]['fullname']."
\n"; + //print "x ".$filesarray[$key]['fullname']."-".$filesarray[$key]['type']."
\n"; if ($filesarray[$key]['type'] == 'dir') { - $count+=dol_delete_dir_recursive($filesarray[$key]['fullname']); + $startcount=0; + $tmpcountdeleted=0; + $result=dol_delete_dir_recursive($filesarray[$key]['fullname'], $startcount, 1, 0, $tmpcountdeleted); + $count+=$result; + $countdeleted+=$tmpcountdeleted; } elseif ($filesarray[$key]['type'] == 'file') { // If (file that is not logfile) or (if logfile with option logfile) if ($filesarray[$key]['fullname'] != $filelog || $choice=='logfile') { - $count+=(dol_delete_file($filesarray[$key]['fullname'])?1:0); + $result=dol_delete_file($filesarray[$key]['fullname'], 1, 1); + if ($result) + { + $count++; + $countdeleted++; + } + else $counterror++; } } } - + // Update cachenbofdoc if (! empty($conf->ecm->enabled) && $choice=='allfiles') { @@ -129,14 +151,18 @@ class Utils $result = $ecmdirstatic->refreshcachenboffile(1); } } - - if ($count > 0) $this->output=$langs->trans("PurgeNDirectoriesDeleted", $count); - else $this->output=$langs->trans("PurgeNothingToDelete"); + + if ($count > 0) + { + $this->output=$langs->trans("PurgeNDirectoriesDeleted", $countdeleted); + if ($count > $countdeleted) $this->output.='
'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted)); + } + else $this->output=$langs->trans("PurgeNothingToDelete").($choice == 'tempfilesold' ? ' (older than 24h)':''); //return $count; return 0; // This function can be called by cron so must return 0 if OK } - + /** * Make a backup of database @@ -147,16 +173,16 @@ class Utils * @param int $usedefault 1=Use default backup profile (Set this to 1 when used as cron) * @param string $file 'auto' or filename to build * @param int $keeplastnfiles Keep only last n files (not used yet) - * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) + * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ function dumpDatabase($compression='none', $type='auto', $usedefault=1, $file='auto', $keeplastnfiles=0) { global $db, $conf, $langs, $dolibarr_main_data_root; global $dolibarr_main_db_name, $dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_port, $dolibarr_main_db_pass; - + $langs->load("admin"); - + dol_syslog("Utils::dumpDatabase type=".$type." compression=".$compression." file=".$file, LOG_DEBUG); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -190,14 +216,14 @@ class Utils $outputdir = $conf->admin->dir_output.'/backup'; $result=dol_mkdir($outputdir); - + // MYSQL if ($type == 'mysql' || $type == 'mysqli') { $cmddump=$conf->global->SYSTEMTOOLS_MYSQLDUMP; - - + + $outputfile = $outputdir.'/'.$file; // for compression format, we add extension $compression=$compression ? $compression : 'none'; @@ -205,11 +231,11 @@ class Utils if ($compression == 'bz') $outputfile.='.bz2'; $outputerror = $outputfile.'.err'; dol_mkdir($conf->admin->dir_output.'/backup'); - + // Parameteres execution $command=$cmddump; if (preg_match("/\s/",$command)) $command=escapeshellarg($command); // Use quotes on command - + //$param=escapeshellarg($dolibarr_main_db_name)." -h ".escapeshellarg($dolibarr_main_db_host)." -u ".escapeshellarg($dolibarr_main_db_user)." -p".escapeshellarg($dolibarr_main_db_pass); $param=$dolibarr_main_db_name." -h ".$dolibarr_main_db_host; $param.=" -u ".$dolibarr_main_db_user; @@ -250,16 +276,16 @@ class Utils $paramcrypted.=' -p"'.preg_replace('/./i','*',$dolibarr_main_db_pass).'"'; $paramclear.=' -p"'.str_replace(array('"','`'),array('\"','\`'),$dolibarr_main_db_pass).'"'; } - + $errormsg=''; - + // Debut appel methode execution $fullcommandcrypted=$command." ".$paramcrypted." 2>&1"; $fullcommandclear=$command." ".$paramclear." 2>&1"; if ($compression == 'none') $handle = fopen($outputfile, 'w'); if ($compression == 'gz') $handle = gzopen($outputfile, 'w'); if ($compression == 'bz') $handle = bzopen($outputfile, 'w'); - + if ($handle) { $ok=0; @@ -277,11 +303,11 @@ class Utils elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; } pclose($handlein); - + if ($compression == 'none') fclose($handle); if ($compression == 'gz') gzclose($handle); if ($compression == 'bz') bzclose($handle); - + if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } @@ -291,7 +317,7 @@ class Utils dol_syslog("Failed to open file ".$outputfile,LOG_ERR); $errormsg=$langs->trans("ErrorFailedToWriteInDir"); } - + // Get errorstring if ($compression == 'none') $handle = fopen($outputfile, 'r'); if ($compression == 'gz') $handle = gzopen($outputfile, 'r'); @@ -320,13 +346,13 @@ class Utils } } // Fin execution commande - + $this->output = $errormsg; $this->error = $errormsg; $this->result = array("commandbackuplastdone" => $command." ".$paramcrypted, "commandbackuptorun" => ""); //if (empty($this->output)) $this->output=$this->result['commandbackuplastdone']; } - + // MYSQL NO BIN if ($type == 'mysqlnobin') { @@ -338,7 +364,7 @@ class Utils if ($compression == 'bz') $outputfile.='.bz2'; $outputerror = $outputfile.'.err'; dol_mkdir($conf->admin->dir_output.'/backup'); - + if ($compression == 'gz' or $compression == 'bz') { backup_tables($outputfiletemp); @@ -349,16 +375,16 @@ class Utils { backup_tables($outputfile); } - + $this->output = ""; $this->result = array("commandbackuplastdone" => "", "commandbackuptorun" => ""); } - + // POSTGRESQL if ($type == 'postgresql') { $cmddump=$conf->global->SYSTEMTOOLS_POSTGRESQLDUMP; - + $outputfile = $outputdir.'/'.$file; // for compression format, we add extension $compression=$compression ? $compression : 'none'; @@ -366,11 +392,11 @@ class Utils if ($compression == 'bz') $outputfile.='.bz2'; $outputerror = $outputfile.'.err'; dol_mkdir($conf->admin->dir_output.'/backup'); - + // Parameteres execution $command=$cmddump; if (preg_match("/\s/",$command)) $command=escapeshellarg($command); // Use quotes on command - + //$param=escapeshellarg($dolibarr_main_db_name)." -h ".escapeshellarg($dolibarr_main_db_host)." -u ".escapeshellarg($dolibarr_main_db_user)." -p".escapeshellarg($dolibarr_main_db_pass); //$param="-F c"; $param="-F p"; @@ -419,8 +445,8 @@ class Utils dol_delete_file($val['fullname']); } } - - + + return 0; } } diff --git a/htdocs/core/commonfieldsinexport.inc.php b/htdocs/core/commonfieldsinexport.inc.php new file mode 100644 index 00000000000..9a84ae6c199 --- /dev/null +++ b/htdocs/core/commonfieldsinexport.inc.php @@ -0,0 +1,60 @@ +db); + + // Add common fields + foreach($tmpobject->fields as $keyfield => $valuefield) + { + $fieldname = 't' . '.' . $keyfield; + $fieldlabel = ucfirst($valuefield['label']); + $typeFilter = "Text"; + $typefield=preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double + switch ($typefield) { + case 'int': + case 'integer': + case 'double': + case 'price': + $typeFilter = "Numeric"; + break; + case 'date': + case 'datetime': + case 'timestamp': + $typeFilter = "Date"; + break; + case 'boolean': + $typeFilter = "Boolean"; + break; + /* + * case 'sellist': + * $tmp=''; + * $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + * if ($tmpparam['options'] && is_array($tmpparam['options'])) { + * $tmpkeys=array_keys($tmpparam['options']); + * $tmp=array_shift($tmpkeys); + * } + * if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; + * break; + */ + } + if ($valuefield['enabled']) { + $this->export_fields_array[$r][$fieldname] = $fieldlabel; + $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; + $this->export_entities_array[$r][$fieldname] = $keyforelement; + } + } +} +else +{ + dol_print_error($this->db, 'Failed to find class '.$keyforclass.', even after the include of '.$keyforclassfile); +} +// End add common fields diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 24ed1425f6b..4206e75a165 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -185,6 +185,9 @@ class DoliDBMysqli extends DoliDB { dol_syslog(get_class($this) . "::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name", LOG_DEBUG); + // Can also be + // mysqli::init(); mysql::options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0'); mysqli::options(MYSQLI_OPT_CONNECT_TIMEOUT, 5); + // return mysqli::real_connect($host, $user, $pass, $db, $port); return new mysqli($host, $login, $passwd, $name, $port); } @@ -735,13 +738,13 @@ class DoliDBMysqli extends DoliDB { // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); - $sql= "ALTER TABLE ".$table." ADD `".$field_name."` "; + $sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql.= $field_desc['type']; if(preg_match("/^[^\s]/i",$field_desc['value'])) - if (! in_array($field_desc['type'],array('date','datetime'))) - { - $sql.= "(".$field_desc['value'].")"; - } + if (! in_array($field_desc['type'],array('date','datetime'))) + { + $sql.= "(".$field_desc['value'].")"; + } if(preg_match("/^[^\s]/i",$field_desc['attribute'])) $sql.= " ".$field_desc['attribute']; if(preg_match("/^[^\s]/i",$field_desc['null'])) @@ -776,10 +779,31 @@ class DoliDBMysqli extends DoliDB { $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; - if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { + if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { $sql.="(".$field_desc['value'].")"; } - if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL"; + if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') + { + // We will try to change format of column to NOT NULL. To be sure the ALTER works, we try to update fields that are NULL + if ($field_desc['type'] == 'varchar' || $field_desc['type'] == 'text') + { + $sqlbis="UPDATE ".$table." SET ".$field_name." = '".$this->escape($field_desc['default'] ? $field_desc['default'] : '')."' WHERE ".$field_name." IS NULL"; + $this->query($sqlbis); + } + elseif ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') + { + $sqlbis="UPDATE ".$table." SET ".$field_name." = ".((int) $this->escape($field_desc['default'] ? $field_desc['default'] : 0))." WHERE ".$field_name." IS NULL"; + $this->query($sqlbis); + } + + $sql.=" NOT NULL"; + } + + if ($field_desc['default'] != '') + { + if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']); + elseif ($field_desc['type'] == 'text') $sql.=" DEFAULT '".$this->escape($field_desc['default'])."'"; // Default not supported on text fields + } dol_syslog(get_class($this)."::DDLUpdateField ".$sql,LOG_DEBUG); if (! $this->query($sql)) @@ -857,6 +881,7 @@ class DoliDBMysqli extends DoliDB * Return charset used to store data in current database (same result than using SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "databasename";) * * @return string Charset + * @see getDefaultCollationDatabase */ function getDefaultCharacterSetDatabase() { @@ -867,7 +892,9 @@ class DoliDBMysqli extends DoliDB return $this->forcecharset; } $liste=$this->fetch_array($resql); - return $liste['Value']; + $tmpval = $liste['Value']; + + return $tmpval; } /** @@ -900,6 +927,7 @@ class DoliDBMysqli extends DoliDB * Return collation used in current database * * @return string Collation value + * @see getDefaultCharacterSetDatabase */ function getDefaultCollationDatabase() { @@ -910,7 +938,9 @@ class DoliDBMysqli extends DoliDB return $this->forcecollate; } $liste=$this->fetch_array($resql); - return $liste['Value']; + $tmpval = $liste['Value']; + + return $tmpval; } /** diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 4aa56b367f3..bc967ffb0b7 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1048,8 +1048,11 @@ class DoliDBPgsql extends DoliDB // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); $sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql .= $field_desc['type']; - if ($field_desc['type'] != 'int' && preg_match("/^[^\s]/i",$field_desc['value'])) - $sql .= "(".$field_desc['value'].")"; + if(preg_match("/^[^\s]/i",$field_desc['value'])) + if (! in_array($field_desc['type'],array('int','date','datetime'))) + { + $sql.= "(".$field_desc['value'].")"; + } if (preg_match("/^[^\s]/i",$field_desc['attribute'])) $sql .= " ".$field_desc['attribute']; if (preg_match("/^[^\s]/i",$field_desc['null'])) @@ -1081,12 +1084,30 @@ class DoliDBPgsql extends DoliDB { $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; - if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { + if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { $sql.="(".$field_desc['value'].")"; } - // TODO May not work with pgsql. May need to run a second request. If it works, just remove the comment - if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL"; + if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') + { + // We will try to change format of column to NOT NULL. To be sure the ALTER works, we try to update fields that are NULL + if ($field_desc['type'] == 'varchar' || $field_desc['type'] == 'text') + { + $sqlbis="UPDATE ".$table." SET ".$field_name." = '".$this->escape($field_desc['default'] ? $field_desc['default'] : '')."' WHERE ".$field_name." IS NULL"; + $this->query($sqlbis); + } + elseif ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') + { + $sqlbis="UPDATE ".$table." SET ".$field_name." = ".((int) $this->escape($field_desc['default'] ? $field_desc['default'] : 0))." WHERE ".$field_name." IS NULL"; + $this->query($sqlbis); + } + } + + if ($field_desc['default'] != '') + { + if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']); + elseif ($field_desc['type'] == 'text') $sql.=" DEFAULT '".$this->escape($field_desc['default'])."'"; // Default not supported on text fields + } dol_syslog($sql,LOG_DEBUG); if (! $this->query($sql)) diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 7f9cf523105..13b2d1ae520 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -18,15 +18,17 @@ if ($resql) // This can fail when class is used on old database (during migra $fieldname=$keyforaliasextra.'.'.$obj->name; $fieldlabel=ucfirst($obj->label); $typeFilter="Text"; - switch($obj->type) - { + $typefield=preg_replace('/\(.*$/', '', $obj->type); // double(24,8) -> double + switch ($typefield) { case 'int': + case 'integer': case 'double': case 'price': $typeFilter="Numeric"; break; case 'date': case 'datetime': + case 'timestamp': $typeFilter="Date"; break; case 'boolean': diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index 5c8e76a9522..5523708a3a0 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -183,7 +183,7 @@ function CreateFolder( $resourceType, $currentFolder ) echo '' ; } -// DOL_CHANGE +// @CHANGE //function FileUpload( $resourceType, $currentFolder, $sCommand ) /** * FileUpload @@ -308,7 +308,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') $sFileUrl = CombinePaths($sFileUrl, $sFileName); - // DOL_CHANGE + // @CHANGE //SendUploadResults( $sErrorNumber, $sFileUrl, $sFileName ); if($CKEcallback == '') { diff --git a/htdocs/core/filemanagerdol/connectors/php/io.php b/htdocs/core/filemanagerdol/connectors/php/io.php index 77c8c3ec253..66d024edce8 100644 --- a/htdocs/core/filemanagerdol/connectors/php/io.php +++ b/htdocs/core/filemanagerdol/connectors/php/io.php @@ -388,7 +388,7 @@ EOF; } -// DOL_CHANGE +// @CHANGE // This is the function that sends the results of the uploading process to CKE. /** diff --git a/htdocs/core/filemanagerdol/connectors/php/upload.php b/htdocs/core/filemanagerdol/connectors/php/upload.php index dc7235dc8a8..90230504705 100644 --- a/htdocs/core/filemanagerdol/connectors/php/upload.php +++ b/htdocs/core/filemanagerdol/connectors/php/upload.php @@ -60,7 +60,7 @@ if (! IsAllowedType($sType)) SendUploadResults(1, '', '', 'Invalid type specified'); -// DOL_CHANGE +// @CHANGE //FileUpload( $sType, $sCurrentFolder, $sCommand ) // Get the CKEditor Callback diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index d2712de201f..4ffee2caad9 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -194,7 +194,7 @@ if (! class_exists('MenuManager')) } $menumanager = new MenuManager($db, empty($user->societe_id)?0:1); $menumanager->loadMenu('all','all'); -//var_dump($menumanager->tabMenu);exit; +//var_dump($menumanager);exit; $menumanager->showmenu('jmobile'); print ''; diff --git a/htdocs/core/js/blockUI.js b/htdocs/core/js/blockUI.js index c72ad69580d..6abcc706e25 100644 --- a/htdocs/core/js/blockUI.js +++ b/htdocs/core/js/blockUI.js @@ -23,7 +23,7 @@ // Examples $(document).ready(function() { // override these in your code to change the default behavior and style - $.blockUI.events = { + /*$.blockUI.events = { // styles applied when using $.growlUI dolEventValidCSS: { @@ -59,7 +59,7 @@ $(document).ready(function() { 'border-radius': '10px' } - }; + };*/ $.dolEventValid = function(title, message, timeout, onClose) { var $m = $('
'); @@ -67,7 +67,7 @@ $(document).ready(function() { if (message) $m.append('

'+message+'

'); if (timeout == undefined) timeout = 3000; $.blockUI({ - message: $m, fadeIn: 200, fadeOut: 700, centerY: false, + message: $m, fadeIn: 0, fadeOut: 0, centerY: false, timeout: timeout, showOverlay: false, onUnblock: onClose, css: $.blockUI.events.dolEventValidCSS @@ -80,7 +80,7 @@ $(document).ready(function() { if (message) $m.append('

'+message+'

'); if (timeout == undefined) timeout = 0; $.blockUI({ - message: $m, fadeIn: 200, centerY: false, + message: $m, fadeIn: 0, centerY: false, timeout: timeout, showOverlay: false, onUnblock: onClose, css: $.blockUI.events.dolEventErrorCSS @@ -98,7 +98,6 @@ $(document).ready(function() { '-webkit-border-radius': '10px', '-moz-border-radius': '10px', 'border-radius': '10px', - opacity: .5, color: '#fff' } }); diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 478d66f2c2a..55055792510 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -46,7 +46,7 @@ else header('Cache-Control: no-cache'); ?> /* - * ================================================================= + * ================================================================= * Purpose: * Pour la saisie des dates par calendrier Input: base "/theme/eldy" dateFieldID * "dateo" Nom du champ format "dd/MM/yyyy" Format issu de Dolibarr de @@ -63,7 +63,7 @@ function showDP(base,dateFieldID,format,codelang) showDP.datefieldID=dateFieldID; // Must be after the close var dateField=getObjectFromID(dateFieldID); - + // get positioning var thetop=getTop(dateField)+dateField.offsetHeight; @@ -86,7 +86,7 @@ function showDP(base,dateFieldID,format,codelang) showDP.box.style.position="absolute"; showDP.box.style.top=thetop + "px"; showDP.box.style.left=theleft + "px"; - + if (dateField.value) // Si il y avait valeur initiale dans champ { selDate=getDateFromFormat(dateField.value,format); @@ -129,7 +129,7 @@ function resetDP(base,dateFieldID,format,codelang) var dateField=getObjectFromID(dateFieldID); dateField.value = formatDate(new Date(), format); dpChangeDay(dateFieldID,format); - + var alreadybox=getObjectFromID("DPCancel"); if (alreadybox) showDP(base,dateFieldID,format,codelang); } @@ -147,25 +147,26 @@ function loadMonth(base,month,year,ymd,codelang) } var req=null; - + req=loadXMLDoc(theURL,null,false); if (req.responseText == '') alert('Failed to get URL '.theURL); // alert(theURL+' - '+req.responseText); // L'url doit avoir la meme racine // que la pages et elements sinon pb de securite. - showDP.box.innerHTML=req.responseText; + showDP.box.innerHTML=req.responseText; } function closeDPBox() { document.body.removeChild(showDP.box); displaySelectBoxes(); - showDP.box=null; - showDP.datefieldID=null; + showDP.box=null; + showDP.datefieldID=null; } function dpChangeDay(dateFieldID,format) { showDP.datefieldID=dateFieldID; + console.log("Call dpChangeDay, we save date into detailed fields."); var thefield=getObjectFromID(showDP.datefieldID); var thefieldday=getObjectFromID(showDP.datefieldID+"day"); @@ -200,7 +201,7 @@ function dpClickDay(year,month,day,format) var thefieldmonth=getObjectFromID(showDP.datefieldID+"month"); var thefieldyear=getObjectFromID(showDP.datefieldID+"year"); - var dt = new Date(year, month-1, day); + var dt = new Date(year, month-1, day); thefield.value=formatDate(dt,format); if(thefield.onchange) thefield.onchange.call(thefield); @@ -238,7 +239,7 @@ function getTop(theitem){ offsetTop += offsetTrail.offsetTop; offsetTrail = offsetTrail.offsetParent; } - if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") + if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") offsetTop += document.body.TopMargin; return offsetTop; } @@ -251,7 +252,7 @@ function getLeft(theitem){ offsetLeft += offsetTrail.offsetLeft; offsetTrail = offsetTrail.offsetParent; } - if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") + if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") offsetLeft += document.body.leftMargin; return offsetLeft; } @@ -260,16 +261,16 @@ function getLeft(theitem){ // Create XMLHttpRequest object and load url // Used by calendar or other ajax processes // Return req built or false if error -function loadXMLDoc(url,readyStateFunction,async) +function loadXMLDoc(url,readyStateFunction,async) { // req must be defined by caller with // var req = false; - + // branch for native XMLHttpRequest object (Mozilla, Safari...) if (window.XMLHttpRequest) { req = new XMLHttpRequest(); - + // if (req.overrideMimeType) { // req.overrideMimeType('text/xml'); // } @@ -286,7 +287,7 @@ function loadXMLDoc(url,readyStateFunction,async) try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} - } + } } // If XMLHttpRequestObject req is ok, call URL @@ -321,9 +322,9 @@ function loadXMLDoc(url,readyStateFunction,async) */ function hideSelectBoxes() { var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10); - if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1) - { - for(var i = 0; i < document.all.length; i++) + if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1) + { + for(var i = 0; i < document.all.length; i++) { if(document.all[i].tagName) if(document.all[i].tagName == "SELECT") @@ -337,9 +338,9 @@ function hideSelectBoxes() { */ function displaySelectBoxes() { var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10); - if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1) - { - for(var i = 0; i < document.all.length; i++) + if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1) + { + for(var i = 0; i < document.all.length; i++) { if(document.all[i].tagName) if(document.all[i].tagName == "SELECT") @@ -351,7 +352,7 @@ function displaySelectBoxes() { /* - * ================================================================= + * ================================================================= * Function: * formatDate (javascript object Date(), format) Purpose: Returns a date in the * output format specified. The format string can use the following tags: Field | @@ -366,10 +367,10 @@ function displaySelectBoxes() { function formatDate(date,format) { // alert('formatDate date='+date+' format='+format); - + // Force parametres en chaine format=format+""; - + var result=""; var year=date.getYear()+""; if (year.length < 4) { year=""+(year-0+1900); } @@ -402,7 +403,7 @@ function formatDate(date,format) else if (substr == 'mm') { result=result+(minute<0||minute>9?"":"0")+minute; } else if (substr == 'ss') { result=result+(seconde<0||seconde>9?"":"0")+seconde; } else { result=result+substr; } - + i+=substr.length; } @@ -412,22 +413,22 @@ function formatDate(date,format) /* - * ================================================================= + * ================================================================= * Function: * getDateFromFormat(date_string, format_string) Purpose: This function takes a * date string and a format string. It parses the date string with format and it * returns the date as a javascript Date() object. If date does not match - * format, it returns 0. The format string can use the following tags: + * format, it returns 0. The format string can use the following tags: * Field | Tags * -------------+----------------------------------- - * Year | yyyy (4 digits), yy (2 digits) - * Month | MM (2 digits) - * Day of Month | dd (2 digits) - * Hour (1-12) | hh (2 digits) - * Hour (0-23) | HH (2 digits) - * Minute | mm (2 digits) + * Year | yyyy (4 digits), yy (2 digits) + * Month | MM (2 digits) + * Day of Month | dd (2 digits) + * Hour (1-12) | hh (2 digits) + * Hour (0-23) | HH (2 digits) + * Minute | mm (2 digits) * Second | ss (2 digits) - * Author: Laurent Destailleur + * Author: Laurent Destailleur * Licence: GPL * ================================================================== */ @@ -440,7 +441,7 @@ function getDateFromFormat(val,format) format=format+""; if (val == '') return 0; - + var now=new Date(); var year=now.getYear(); if (year.length < 4) { year=""+(year-0+1900); } var month=now.getMonth()+1; @@ -466,37 +467,37 @@ function getDateFromFormat(val,format) } // alert('substr='+substr); - if (substr == "yyyy") year=getIntegerInString(val,d,4,4); - if (substr == "yy") year=""+(getIntegerInString(val,d,2,2)-0+1900); - if (substr == "MM" ||substr == "M") - { - month=getIntegerInString(val,d,1,2); - d -= 2- month.length; - } - if (substr == "dd") - { - day=getIntegerInString(val,d,1,2); - d -= 2- day.length; - } - if (substr == "HH" ||substr == "hh" ) - { - hour=getIntegerInString(val,d,1,2); - d -= 2- hour.length; - } - if (substr == "mm"){ - minute=getIntegerInString(val,d,1,2); - d -= 2- minute.length; - } - if (substr == "ss") - { - seconde=getIntegerInString(val,d,1,2); - d -= 2- seconde.length; - } - + if (substr == "yyyy") year=getIntegerInString(val,d,4,4); + if (substr == "yy") year=""+(getIntegerInString(val,d,2,2)-0+1900); + if (substr == "MM" ||substr == "M") + { + month=getIntegerInString(val,d,1,2); + d -= 2- month.length; + } + if (substr == "dd") + { + day=getIntegerInString(val,d,1,2); + d -= 2- day.length; + } + if (substr == "HH" ||substr == "hh" ) + { + hour=getIntegerInString(val,d,1,2); + d -= 2- hour.length; + } + if (substr == "mm"){ + minute=getIntegerInString(val,d,1,2); + d -= 2- minute.length; + } + if (substr == "ss") + { + seconde=getIntegerInString(val,d,1,2); + d -= 2- seconde.length; + } + i+=substr.length; d+=substr.length; } - + // Check if format param are ok if (year==null||year<1) { return 0; } if (month==null||(month<1)||(month>12)) { return 0; } @@ -504,15 +505,15 @@ function getDateFromFormat(val,format) if (hour==null||(hour<0)||(hour>24)) { return 0; } if (minute==null||(minute<0)||(minute>60)) { return 0; } if (seconde==null||(seconde<0)||(seconde>60)) { return 0; } - + // alert(year+' '+month+' '+day+' '+hour+' '+minute+' '+seconde); return new Date(year,month-1,day,hour,minute,seconde); } /* - * ================================================================= + * ================================================================= * Function: - * stringIsInteger(string) + * stringIsInteger(string) * Purpose: Return true if string is an integer * ================================================================== */ @@ -530,9 +531,9 @@ function stringIsInteger(str) } /* - * ================================================================= + * ================================================================= * Function: - * getIntegerInString(string,pos,minlength,maxlength) + * getIntegerInString(string,pos,minlength,maxlength) * Purpose: Return part of string from position i that is integer * ================================================================== */ @@ -549,10 +550,10 @@ function getIntegerInString(str,i,minlength,maxlength) /* - * ================================================================= + * ================================================================= * Purpose: - * Clean string to have it url encoded - * Input: s + * Clean string to have it url encoded + * Input: s * Author: Laurent Destailleur * Licence: GPL * ================================================================== @@ -566,11 +567,11 @@ function urlencode(s) { /* - * ================================================================= + * ================================================================= * Purpose: * Applique un delai avant execution. Used for autocompletion of companies. - * Input: funct, delay - * Author: Regis Houssin + * Input: funct, delay + * Author: Regis Houssin * Licence: GPL * ================================================================== */ @@ -581,11 +582,11 @@ function urlencode(s) { /* - * ================================================================= + * ================================================================= * Purpose: * Clean values of a "Sortable.serialize". Used by drag and drop. - * Input: expr - * Author: Regis Houssin + * Input: expr + * Author: Regis Houssin * Licence: GPL * ================================================================== */ @@ -599,12 +600,12 @@ function cleanSerialize(expr) { /* - * ================================================================= + * ================================================================= * Purpose: Display a temporary message in input text fields (For showing help message on * input field). * Input: fieldId * Input: message - * Author: Regis Houssin + * Author: Regis Houssin * Licence: GPL * ================================================================== */ @@ -617,11 +618,11 @@ function displayMessage(fieldId,message) { } /* - * ================================================================= + * ================================================================= * Purpose: Hide a temporary message in input text fields (For showing help message on - * input field). - * Input: fiedId - * Input: message + * input field). + * Input: fiedId + * Input: message * Author: Regis Houssin * Licence: GPL * ================================================================== @@ -673,7 +674,7 @@ function setConstant(url, code, input, entity, strict) { $(newvalue).removeClass("butAction"); $(newvalue).addClass("butActionRefused"); } - }); + }); // Show another element } else if (type == "showhide" || type == "show") { $.each(data, function(key, value) { @@ -734,7 +735,7 @@ function delConstant(url, code, input, entity, strict) { $(newvalue).removeClass("butActionRefused"); $(newvalue).addClass("butAction"); } - }); + }); // Hide another element } else if (type == "showhide" || type == "hide") { $.each(data, function(key, value) { @@ -816,13 +817,13 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, } } -/* - * ================================================================= +/* + * ================================================================= * This is to allow to transform all select box into ajax autocomplete box - * with just one line: + * with just one line: * $(function() { $( "#idofmylist" ).combobox(); }); - * Do not use it on large combo boxes - * ================================================================= + * Do not use it on large combo boxes + * ================================================================= */ (function( $ ) { $.widget( "ui.combobox", { @@ -933,11 +934,11 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, /** * Function to output a dialog bog for copy/paste - * + * * @param string text Text to put into copy/paste area * @param string text2 Text to put under the copy/paste area */ -function copyToClipboard(text,text2) +function copyToClipboard(text,text2) { text = text.replace(/
/g,"\n"); var newElem = '

'+text2; @@ -951,7 +952,7 @@ function copyToClipboard(text,text2) /** * Show a popup HTML page. Use the "window.open" function. - * + * * @param string url Url * @param string title Title of popup * @return boolean False @@ -982,15 +983,17 @@ function newpopup(url,title) { function document_preview(file, type, title) { var ValidImageTypes = ["image/gif", "image/jpeg", "image/png"]; + var showOriginalSizeButton = false; + console.log("document_preview A click was done. file="+file+", type="+type+", title="+title); - + if ($.inArray(type, ValidImageTypes) < 0) { var width='85%'; var object_width='100%'; var height = $( window ).height()*0.90; var object_height='98%'; - show_preview(); + show_preview('notimage'); } else { var object_width=0; @@ -1004,23 +1007,38 @@ function document_preview(file, type, title) width = $( window ).width()*0.90; if(object_width < width){ + console.log("Object width is small, we set width of popup according to image width."); width = object_width + 30 } height = $( window ).height()*0.85; if(object_height < height){ + console.log("Object height is small, we set height of popup according to image height."); height = object_height + 80 } + else + { + showOriginalSizeButton = true; + } - show_preview(); + show_preview('image'); }; img.src = file; } - function show_preview(){ - /* console.log("file="+file+" type="+type+" width="+width+" height="+height); */ + function show_preview(mode) { + /* console.log("mode="+mode+" file="+file+" type="+type+" width="+width+" height="+height); */ var newElem = ''; + optionsbuttons = {} + if (mode == 'image' && showOriginalSizeButton) + { + optionsbuttons = { + "trans("OriginalSize")); ?>": function() { console.log("Click on original size"); jQuery(".ui-dialog-content.ui-widget-content > object").css({ "max-height": "none" }); }, + "trans("Close")); ?>": function() { $( this ).dialog( "close" ); } + }; + } + $("#dialogforpopup").html(newElem); $("#dialogforpopup").dialog({ closeOnEscape: true, @@ -1028,19 +1046,25 @@ function document_preview(file, type, title) width: width, height: height, modal: true, - title: title + title: title, + buttons: optionsbuttons }); + + if (showOriginalSizeButton) + { + jQuery(".ui-dialog-content.ui-widget-content > object").css({ "max-height": "100%", "width": "auto", "margin-left": "auto", "margin-right": "auto", "display": "block" }); + } } } /* - * Provide a function to get an URL GET parameter in javascript - * + * Provide a function to get an URL GET parameter in javascript + * * @param string name Name of parameter * @param mixed valueifnotfound Value if not found * @return string Value */ -function getParameterByName(name, valueifnotfound) +function getParameterByName(name, valueifnotfound) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), @@ -1098,7 +1122,7 @@ function getParameterByName(name, valueifnotfound) } })(); -// Another solution, easier, to build a javascript rounding function +// Another solution, easier, to build a javascript rounding function function dolroundjs(number, decimals) { return +(Math.round(number + "e+" + decimals) + "e-" + decimals); } @@ -1146,10 +1170,10 @@ function price2numjs(amount) { amount = amount.replace(dec, '.'); //console.log("amount before="+amount+" rouding="+rounding) var res = Math.round10(amount, - rounding); - // Other solution is + // Other solution is // var res = dolroundjs(amount, rounding) console.log("res="+res) return res; } - + diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index b640f4cc81b..ba725d3e226 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -90,7 +90,7 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H if (arr.length > 0) { var audio = null; global->AGENDA_NOTIFICATION_SOUND)) { + if (! empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');'; } ?> diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 7952c0eda7d..0fccf6ccd9a 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -201,9 +201,10 @@ function journalHead($nom,$variante,$period,$periodlink,$description,$builddate, $head[$h][1] = $langs->trans("Journalization"); $head[$h][2] = 'journal'; + print '
'; + dol_fiche_head($head, 'journal'); - print ''; foreach($moreparam as $key => $value) { print ''; @@ -251,12 +252,12 @@ function journalHead($nom,$variante,$period,$periodlink,$description,$builddate, print ''; - print '
'; + dol_fiche_end(); + + print '
'; print '
'; - dol_fiche_end(); - print "\n\n\n"; } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index e90f006ac7e..5d46de321da 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -143,10 +143,10 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker { while (! feof($fp)) { - $buf = fgets($fp, 4096); + $buf = fgets($fp, 32768); // Test if request must be ran only for particular database or version (if yes, we must remove the -- comment) - if (preg_match('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i',$buf,$reg)) + if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg)) { $qualified=1; @@ -159,28 +159,41 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker // restrict on version if ($qualified) { - - $versionrequest=explode('.',$reg[2]); - //print var_dump($versionrequest); - //print var_dump($versionarray); - if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0) - { - $qualified=0; - } + if (! empty($reg[2])) + { + if (is_numeric($reg[2])) // This is a version + { + $versionrequest=explode('.',$reg[2]); + //print var_dump($versionrequest); + //print var_dump($versionarray); + if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0) + { + $qualified=0; + } + } + else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE + { + $dbcollation = strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)); + //var_dump($reg[2]); + //var_dump($dbcollation); + if (empty($conf->db->dolibarr_main_db_collation) || ($reg[2] != $dbcollation)) $qualified=0; + //var_dump($qualified); + } + } } if ($qualified) { // Version qualified, delete SQL comments - $buf=preg_replace('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i','',$buf); + $buf=preg_replace('/^--\sV(MYSQL|PGSQL)([^\s]*)/i','',$buf); //print "Ligne $i qualifi?e par version: ".$buf.'
'; } } // Add line buf to buffer if not a comment - if (! preg_match('/^--/',$buf)) + if (! preg_match('/^\s*--/',$buf)) { - $buf=preg_replace('/--.*$/','',$buf); //remove comment from a line that not start with -- before add it to the buffer + $buf=preg_replace('/([,;ERLT\)])\s*--.*$/i','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer $buffer .= trim($buf); } @@ -523,6 +536,43 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not } + + +/** + * Prepare array with list of tabs + * + * @return array Array of tabs to show + */ +function modules_prepare_head() +{ + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=common"; + $head[$h][1] = $langs->trans("AvailableModules"); + $head[$h][2] = 'common'; + $h++; + + $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=marketplace"; + $head[$h][1] = $langs->trans("ModulesMarketPlaces"); + $head[$h][2] = 'marketplace'; + $h++; + + $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=deploy"; + $head[$h][1] = $langs->trans("AddExtensionThemeModuleOrOther"); + $head[$h][2] = 'deploy'; + $h++; + + $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=develop"; + $head[$h][1] = $langs->trans("ModulesDevelopYourModule"); + $head[$h][2] = 'develop'; + $h++; + + return $head; +} + + /** * Prepare array with list of tabs * @@ -545,10 +595,17 @@ function security_prepare_head() $h++; $head[$h][0] = DOL_URL_ROOT."/admin/security_file.php"; - $head[$h][1] = $langs->trans("Files"); + $head[$h][1] = $langs->trans("Files").' ('.$langs->trans("Upload").')'; $head[$h][2] = 'file'; $h++; + /* + $head[$h][0] = DOL_URL_ROOT."/admin/security_file_download.php"; + $head[$h][1] = $langs->trans("Files").' ('.$langs->trans("Download").')'; + $head[$h][2] = 'filedownload'; + $h++; + */ + $head[$h][0] = DOL_URL_ROOT."/admin/proxy.php"; $head[$h][1] = $langs->trans("ExternalAccess"); $head[$h][2] = 'proxy'; @@ -931,7 +988,8 @@ function unActivateModule($value, $requiredby=1) { //print $dir.$modFile; // TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded - $genericMod = new DolibarrModules($db); + include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; + $genericMod = new DolibarrModules($db); $genericMod->name=preg_replace('/^mod/i','',$modName); $genericMod->rights_class=strtolower(preg_replace('/^mod/i','',$modName)); $genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',$modName)); @@ -1193,7 +1251,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') print ''; print ''; - print ''; + print ''; print ''; print ''; } - + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions=new FormActions($db); @@ -221,8 +221,8 @@ function show_array_actions_to_do($max=5) $sql = "SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent,"; $sql.= " c.code, c.libelle as type_label,"; $sql.= " s.nom as sname, s.rowid, s.client"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c LEFT JOIN "; - $sql.= " ".MAIN_DB_PREFIX."actioncomm as a ON c.id = a.fk_action"; + $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; + $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE a.entity = ".$conf->entity; @@ -251,7 +251,7 @@ function show_array_actions_to_do($max=5) while ($i < $num) { $obj = $db->fetch_object($resql); - + print ''; @@ -318,8 +318,8 @@ function show_array_last_actions_done($max=5) $sql = "SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label,"; $sql.= " c.code, c.libelle,"; $sql.= " s.rowid, s.nom as sname, s.client"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c LEFT JOIN "; - $sql.= " ".MAIN_DB_PREFIX."actioncomm as a ON c.id = a.fk_action "; + $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; + $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action "; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE a.entity = ".$conf->entity; @@ -347,7 +347,7 @@ function show_array_last_actions_done($max=5) while ($i < $num) { $obj = $db->fetch_object($resql); - + print ''; @@ -412,6 +412,14 @@ function agenda_prepare_head() $head[$h][2] = 'autoactions'; $h++; + if ($conf->global->MAIN_FEATURES_LEVEL > 0) + { + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php"; + $head[$h][1] = $langs->trans("Reminders"); + $head[$h][2] = 'reminders'; + $h++; + } + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php"; $head[$h][1] = $langs->trans("ExportCal"); $head[$h][2] = 'xcal'; @@ -458,7 +466,7 @@ function actions_prepare_head($object) { include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; $resource=new DolResource($db); - + $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id; $listofresourcelinked = $resource->getElementResources($object->element, $object->id); $nbResources=count($listofresourcelinked); @@ -506,6 +514,11 @@ function calendars_prepare_head($param) $h = 0; $head = array(); + $head[$h][0] = DOL_URL_ROOT.'/comm/action/listactions.php'.($param?'?'.$param:''); + $head[$h][1] = $langs->trans("ViewList"); + $head[$h][2] = 'cardlist'; + $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_day'.($param?'&'.$param:''); $head[$h][1] = $langs->trans("ViewDay"); $head[$h][2] = 'cardday'; @@ -529,16 +542,12 @@ function calendars_prepare_head($param) $head[$h][2] = 'cardpertype'; $h++; } - + $head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($param?'?'.$param:''); $head[$h][1] = $langs->trans("ViewPerUser"); $head[$h][2] = 'cardperuser'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/comm/action/listactions.php'.($param?'?'.$param:''); - $head[$h][1] = $langs->trans("ViewList"); - $head[$h][2] = 'cardlist'; - $h++; $object=new stdClass(); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 705bcf6deab..dc86a2ef9f3 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -40,12 +40,19 @@ * Ex: array('disabled'=> ) * Ex: array('show'=> ) * Ex: array('update_textarea'=> ) + * Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax) * @return string Script */ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array()) { if (empty($minLength)) $minLength=1; + $dataforrenderITem='ui-autocomplete'; + $dataforitem='ui-autocomplete-item'; + // Allow two constant to use other values for backward compatibility + if (defined('JS_QUERY_AUTOCOMPLETE_RENDERITEM')) $dataforrenderITem=constant('JS_QUERY_AUTOCOMPLETE_RENDERITEM'); + if (defined('JS_QUERY_AUTOCOMPLETE_ITEM')) $dataforitem=constant('JS_QUERY_AUTOCOMPLETE_ITEM'); + // Input search_htmlname is original field // Input htmlname is a second input field used when using ajax autocomplete. $script = ''; @@ -140,6 +147,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt $("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value // Disable an element if (options.option_disabled) { + console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled) if (ui.item.disabled) { $("#" + options.option_disabled).prop("disabled", true); if (options.error) { @@ -148,28 +156,32 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt if (options.warning) { $.jnotify(options.warning, "warning", false); // Output with jnotify the warning message } - } else { + } else { $("#" + options.option_disabled).removeAttr("disabled"); } } if (options.disabled) { + console.log("Make action disabled on each "+options.option_disabled) $.each(options.disabled, function(key, value) { $("#" + value).prop("disabled", true); }); } if (options.show) { + console.log("Make action show on each "+options.show) $.each(options.show, function(key, value) { $("#" + value).show().trigger("show"); }); } // Update an input if (ui.item.update) { + console.log("Make action update on each ui.item.update") // loop on each "update" fields $.each(ui.item.update, function(key, value) { $("#" + key).val(value).trigger("change"); }); } if (ui.item.textarea) { + console.log("Make action textarea on each ui.item.textarea") $.each(ui.item.textarea, function(key, value) { if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") { CKEDITOR.instances[key].setData(value); @@ -185,10 +197,9 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt $("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code. } ,delay: 500 - }).data("ui-autocomplete")._renderItem = function( ul, item ) { - + }).data("'.$dataforrenderITem.'")._renderItem = function( ul, item ) { return $("
  • ") - .data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0 + .data( "'.$dataforitem.'", item ) // jQuery UI > 1.10.0 .append( \'\' + item.label + "" ) .appendTo(ul); }; diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 6fa6b55151e..b0849bb913e 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -37,7 +37,7 @@ $text_color=Array(0,0,0); /* ******************************************************************** */ if (defined('DOL_DEFAULT_TTF_BOLD')) $font_loc=constant('DOL_DEFAULT_TTF_BOLD'); // Automatic-Detection of Font if running Windows -// DOL_CHANGE LDR +// @CHANGE LDR if (isset($_SERVER['WINDIR']) && @file_exists($_SERVER['WINDIR'])) $font_loc=$_SERVER['WINDIR'].'\Fonts\arialbd.ttf'; if (empty($font_loc)) die('DOL_DEFAULT_TTF_BOLD must de defined with full path to a TTF font.'); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 0a41969afd3..fe36e0e02f4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -162,7 +162,7 @@ function societe_prepare_head(Societe $object) $head[$h][2] = 'rib'; $h++; } - + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab @@ -217,7 +217,7 @@ function societe_prepare_head(Societe $object) $upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id ; $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); - + $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; @@ -234,7 +234,7 @@ function societe_prepare_head(Societe $object) } $head[$h][2] = 'agenda'; $h++; - + // Log /*$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$object->id; $head[$h][1] = $langs->trans("Info"); @@ -334,7 +334,7 @@ function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv= global $db,$langs; $result=''; - + // Check parameters if (empty($searchkey) && empty($searchlabel)) { @@ -421,23 +421,28 @@ function getState($id,$withcode='',$dbtouse=0) } /** - * Retourne le nom traduit ou code+nom d'une devise + * Return label of currency or code+label * - * @param string $code_iso Code iso de la devise - * @param int $withcode '1'=affiche code + nom - * @return string Nom traduit de la devise + * @param string $code_iso Code iso of currency + * @param int $withcode '1'=show code + label + * @param Translate $outputlangs Output language + * @return string Label translated of currency */ -function currency_name($code_iso,$withcode='') +function currency_name($code_iso, $withcode='', $outputlangs=null) { global $langs,$db; - // Si il existe une traduction, on peut renvoyer de suite le libelle - if ($langs->trans("Currency".$code_iso)!="Currency".$code_iso) + if (empty($outputlangs)) $outputlangs=$langs; + + $outputlangs->load("dict"); + + // If there is a translation, we can send immediatly the label + if ($outputlangs->trans("Currency".$code_iso)!="Currency".$code_iso) { - return $langs->trans("Currency".$code_iso); + return ($withcode?$code_iso.' - ':'').$outputlangs->trans("Currency".$code_iso); } - // Si pas de traduction, on consulte le libelle par defaut en table + // If no translation, we read table to get label by default $sql = "SELECT label FROM ".MAIN_DB_PREFIX."c_currencies"; $sql.= " WHERE code_iso='".$code_iso."'"; @@ -457,8 +462,8 @@ function currency_name($code_iso,$withcode='') { return $code_iso; } - } + return 'ErrorWhenReadingCurrencyLabel'; } /** @@ -499,7 +504,7 @@ function getFormeJuridiqueLabel($code) /** * Return if a country is inside the EEC (European Economic Community) * TODO Add a field into country dictionary. - * + * * @param Object $object Object * @return boolean true = country inside EEC, false = country outside EEC */ @@ -649,7 +654,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin // Opp percent print '
  • '; + print ''; // Status print ''; @@ -671,7 +676,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin } print "
    '.$langs->trans("Description").''.$langs->trans("Description").''; $text = $langs->trans("Value"); print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext'); diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 4e9b458c3d0..d50e9f572ad 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -85,7 +85,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { include_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php'; $formresource=new FormResource($db); - + // Resource print '
    '; @@ -94,7 +94,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print $formresource->select_resource_list($resourceid, "resourceid", '', 1, 0, 0, null, '', 2); print '
    '; if ($obj->opp_percent) print price($obj->opp_percent, 1, '', 1, 0).'%'; - print ''.$projecttmp->getLibStatut(5).'
    "; print ''; - + print "
    \n"; } @@ -735,7 +740,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; print ''; print ''; - + print "\n".''."\n"; $param="socid=".$object->id; @@ -744,10 +749,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $colspan=9; print ''; - print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Poste"),$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email"),$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Name",$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Poste",$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder); + print_liste_field_titre( $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email"),$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"p.statut","",$param,'',$sortfield,$sortorder); // Add to agenda if (! empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create)) { @@ -777,44 +782,44 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') if ($num || (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x'))) { print ''; - + // Photo - Name print ''; - + // Position print ''; - + // Address - Phone - Email print ''; - + // Status print ''; - + // Add to agenda if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { $colspan++; print ''; } - + // Edit print ''; - + print ""; - + $i=0; while ($i < $num) { $obj = $db->fetch_object($result); - + $contactstatic->id = $obj->rowid; $contactstatic->ref = $obj->ref; $contactstatic->statut = $obj->statut; @@ -838,7 +843,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $contactstatic->country_code = $country_code; $contactstatic->setGenderFromCivility(); - + print ""; // Photo - Name @@ -846,7 +851,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder valignmiddle marginrightonly','small',1,0,1); print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage)); print ''; - + // Job position print ''; - print ''; + + print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index c3583e72ac8..0395f9f17ff 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -175,6 +175,17 @@ function task_prepare_head($object) // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf,$langs,$object,$head,$h,'task'); + + // Manage discussion + if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK)) + { + $nbComments= $object->getNbComments(); + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); + $head[$h][1] = $langs->trans("TaskCommentLinks"); + if ($nbComments > 0) $head[$h][1].= ' '.$nbComments.''; + $head[$h][2] = 'task_comment'; + $h++; + } if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { @@ -187,7 +198,7 @@ function task_prepare_head($object) $head[$h][2] = 'task_notes'; $h++; } - + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -629,9 +640,16 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print ''."\n"; // User + /* print ''; + */ + + // Project + print ""; // Ref print ''; + if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) + { + // Thirdparty + print ''; + } + // Label task print "\n"; - // Project - print ""; - - if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) - { - // Thirdparty - print ''; - } - // Planned Workload print ''; print "\n"; @@ -832,12 +851,35 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $workloadforid[$projectstatic->id]=1; } + $projectstatic->id=$lines[$i]->fk_project; + $projectstatic->ref=$lines[$i]->projectref; + $projectstatic->title=$lines[$i]->projectlabel; + $projectstatic->public=$lines[$i]->public; + $projectstatic->thirdparty_name=$lines[$i]->thirdparty_name; + print ''."\n"; // User + /* print ''; + */ + + // Project + print '"; + + if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) + { + // Thirdparty + print ''; + } // Ref print '\n"; - // Project - print '"; - - if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) - { - // Thirdparty - print ''; - } - // Planned Workload print ''; print "\n"; @@ -1136,19 +1164,19 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= print ''; print_liste_field_titre($title.' '.$num.'',$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder); + print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder); if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print_liste_field_titre($langs->trans("OpportunityAmount"),"","","","",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("OpportunityStatus"),"","","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("OpportunityAmount","","","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("OpportunityStatus","","","","",'align="right"',$sortfield,$sortorder); } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder); - if (! in_array('plannedworkload', $hiddenfields)) print_liste_field_titre($langs->trans("PlannedWorkload"),"","","","",'align="right"',$sortfield,$sortorder); - if (! in_array('declaredprogress', $hiddenfields)) print_liste_field_titre($langs->trans("ProgressDeclared"),"","","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Tasks","","","","",'align="right"',$sortfield,$sortorder); + if (! in_array('plannedworkload', $hiddenfields)) print_liste_field_titre("PlannedWorkload","","","","",'align="right"',$sortfield,$sortorder); + if (! in_array('declaredprogress', $hiddenfields)) print_liste_field_titre("ProgressDeclared","","","","",'align="right"',$sortfield,$sortorder); } - print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Status","","","","",'align="right"',$sortfield,$sortorder); print "\n"; while ($i < $num) diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 2c13485d0e9..475fbaa48d5 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -24,10 +24,10 @@ /** - * Show header of a VAT report + * Show header of a report * - * @param string $nom Name of report - * @param string $variante Link for alternate report + * @param string $reportname Name of report + * @param string $notused Not used * @param string $period Period of report * @param string $periodlink Link to switch period * @param string $description Description @@ -35,17 +35,17 @@ * @param string $exportlink Link for export or '' * @param array $moreparam Array with list of params to add into form * @param string $calcmode Calculation mode - * @param string $varlink Add a variable into the address of the page + * @param string $varlink Add a variable into the address of the page * @return void */ -function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='', $varlink='') +function report_header($reportname,$notused,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='', $varlink='') { global $langs; if (empty($hselected)) $hselected='report'; - - print "\n\n\n"; - + + print "\n\n\n"; + if(! empty($varlink)) $varlink = '?'.$varlink; $h=0; @@ -53,23 +53,25 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat $head[$h][1] = $langs->trans("Report"); $head[$h][2] = 'report'; + print ''; + dol_fiche_head($head, 'report'); - print ''; foreach($moreparam as $key => $value) { print ''; } print '
    '; print ''; print ''; print ' '; print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0,1),'1'=>$contactstatic->LibStatut(1,1)),$search_status); print ' '; print ''; print '
    '; if ($obj->poste) print $obj->poste; @@ -1036,9 +1041,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= global $form; global $param; - + // Check parameters - if (! is_object($filterobj)) dol_print_error('','BadParameter'); + if (! is_object($filterobj) && ! is_object($objcon)) dol_print_error('','BadParameter'); $out=''; $histo=array(); @@ -1056,24 +1061,24 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $sql.= " a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,"; $sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; - if (get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname"; - if (get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname"; - if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref"; + if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname"; + if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname"; + if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; - if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; - if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; - if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; + if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; + if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; + if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; $sql.= " WHERE u.rowid = a.fk_user_action"; $sql.= " AND a.entity IN (".getEntity('agenda').")"; - if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; - if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; - if (get_class($filterobj) == 'Adherent') + if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; + if (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; + if (is_object($filterobj) && get_class($filterobj) == 'Adherent') { $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; } - if (get_class($filterobj) == 'CommandeFournisseur') + if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; @@ -1086,7 +1091,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= { if ($actioncode == 'AC_NON_AUTO') $sql.= " AND c.type != 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'"; - else + else { if ($actioncode == 'AC_OTH') $sql.= " AND c.type != 'systemauto'"; if ($actioncode == 'AC_OTH_AUTO') $sql.= " AND c.type = 'systemauto'"; @@ -1114,7 +1119,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= while ($i < $num) { $obj = $db->fetch_object($resql); - + //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; //if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; $tododone=''; @@ -1128,7 +1133,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= 'dateend'=>$db->jdate($obj->dp2), 'note'=>$obj->label, 'percent'=>$obj->percent, - + 'userid'=>$obj->user_id, 'login'=>$obj->user_login, 'userfirstname'=>$obj->user_firstname, @@ -1146,7 +1151,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= 'libelle'=>$obj->alabel, // deprecated 'apicto'=>$obj->apicto ); - + $numaction++; $i++; } @@ -1191,7 +1196,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= 'note'=>$obj->note, 'percent'=>$obj->percentage, 'acode'=>$obj->acode, - + 'userid'=>$obj->user_id, 'login'=>$obj->user_login, 'userfirstname'=>$obj->user_firstname, @@ -1213,7 +1218,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email))) { $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; - + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; @@ -1222,7 +1227,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); - + $actionstatic=new ActionComm($db); $userstatic=new User($db); $contactstatic = new Contact($db); @@ -1234,7 +1239,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $facturestatic=new Facture($db); $out.='
    '; - if ($objcon && get_class($objcon) == 'Contact' && get_class($filterobj) == 'Societe') + if ($objcon && get_class($objcon) == 'Contact' && $filterobj && get_class($filterobj) == 'Societe') { $out.=''; } @@ -1242,10 +1247,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= { $out.=''; } - if (get_class($filterobj) == 'Societe') $out.=''; - + if ($filterobj && get_class($filterobj) == 'Societe') $out.=''; + $out.="\n"; - + $out.='
    '; $out.=''; @@ -1270,7 +1275,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=$searchpicto; $out.=''; $out.=''; - + $out.=''; if ($donetodo) { @@ -1293,26 +1298,26 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder); $out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch '); $out.=''; - + foreach ($histo as $key=>$value) { - + $actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo $out.=""; - + // Done or todo if ($donetodo) { $out.=''; } - + // Ref $out.=''; - + // Author of event $out.=''; - + // Title $out.='\n"; - + // Type $out.=''; @@ -1445,7 +1450,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= // Actions $out.=''; - + $out.="\n"; $i++; } @@ -1454,7 +1459,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= } $out.=''; - + if ($noprint) return $out; else print $out; } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 202a598d8ae..c45c5a88e29 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2015 Juanjo Menent + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -114,26 +115,28 @@ function getServerTimeZoneInt($refgmtdate='now') */ function dol_time_plus_duree($time, $duration_value, $duration_unit) { + global $conf; + if ($duration_value == 0) return $time; if ($duration_unit == 'h') return $time + (3600*$duration_value); if ($duration_unit == 'w') return $time + (3600*24*7*$duration_value); - + $deltastring='P'; - + if ($duration_value > 0){ $deltastring.=abs($duration_value); $sub= false; } if ($duration_value < 0){ $deltastring.=abs($duration_value); $sub= true; } if ($duration_unit == 'd') { $deltastring.="D"; } if ($duration_unit == 'm') { $deltastring.="M"; } if ($duration_unit == 'y') { $deltastring.="Y"; } - + $date = new DateTime(); - $date->setTimezone(new DateTimeZone('UTC')); + if (! empty($conf->global->MAIN_DATE_IN_MEMORY_ARE_GMT)) $date->setTimezone(new DateTimeZone('UTC')); $date->setTimestamp($time); $interval = new DateInterval($deltastring); - + if($sub) $date->sub($interval); else $date->add( $interval ); - + return $date->getTimestamp(); } @@ -419,7 +422,7 @@ function dol_get_next_week($day, $week, $month, $year) { $tmparray = dol_get_first_day_week($day, $month, $year); - $time=dol_mktime(12,0,0,$month,$tmparray['first_day'],$year,1,0); + $time=dol_mktime(12,0,0,$tmparray['first_month'],$tmparray['first_day'],$tmparray['first_year'],1,0); $time+=24*60*60*7; $tmparray=dol_getdate($time,true); diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index a5f19174a84..1efdc73f247 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -132,6 +132,22 @@ function expensereport_admin_prepare_head() $head[$h][2] = 'expensereport'; $h++; + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) + { + $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_ik.php"; + $head[$h][1] = $langs->trans("ExpenseReportsIk"); + $head[$h][2] = 'expenseik'; + $h++; + } + + if (!empty($conf->global->MAIN_USE_EXPENSE_RULE)) + { + $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php"; + $head[$h][1] = $langs->trans("ExpenseReportsRules"); + $head[$h][2] = 'expenserules'; + $h++; + } + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index dd21a1345e7..1cc0c209591 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -47,14 +47,15 @@ function dol_basename($pathfile) * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, * but must not contains the start and end '/'. Filter is checked into basename only. * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked into fullpath. - * @param string $sortcriteria Sort criteria ("","fullname","name","date","size") + * @param string $sortcriteria Sort criteria ("","fullname","relativename","name","date","size") * @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only * @param int $nohook Disable all hooks + * @param string $relativename For recursive purpose only. Must be "" at first call. * @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...) * @see dol_dir_list_indatabase */ -function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0) +function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="") { global $db, $hookmanager; global $object; @@ -144,6 +145,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil "name" => $file, "path" => $path, "level1name" => $level1name, + "relativename" => ($relativename?$relativename.'/':'').$file, "fullname" => $path.'/'.$file, "date" => $filedate, "size" => $filesize, @@ -155,7 +157,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil // if we're in a directory and we want recursive behavior, call this function again if ($recursive) { - $file_list = array_merge($file_list,dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook)); + $file_list = array_merge($file_list, dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook, ($relativename?$relativename.'/':'').$file)); } } else if (! $isdir && (($types == "files") || ($types == "all"))) @@ -172,6 +174,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil "name" => $file, "path" => $path, "level1name" => $level1name, + "relativename" => ($relativename?$relativename.'/':'').$file, "fullname" => $path.'/'.$file, "date" => $filedate, "size" => $filesize, @@ -281,6 +284,90 @@ function dol_dir_list_in_database($path, $filter="", $excludefilter=null, $sortc } +/** + * Complete $filearray with data from database. + * This will call doldir_list_indatabase to complate filearray. + * + * @param array $filearray Array of files get using dol_dir_list + * @param string $relativedir Relative dir from DOL_DATA_ROOT + * @return void + */ +function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir) +{ + global $db, $user; + + $filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC); + + //var_dump($filearray); + //var_dump($filearrayindatabase); + + // Complete filearray with properties found into $filearrayindatabase + foreach($filearray as $key => $val) + { + $found=0; + // Search if it exists into $filearrayindatabase + foreach($filearrayindatabase as $key2 => $val2) + { + if ($filearrayindatabase[$key2]['name'] == $filearray[$key]['name']) + { + $filearray[$key]['position_name']=($filearrayindatabase[$key2]['position']?$filearrayindatabase[$key2]['position']:'0').'_'.$filearrayindatabase[$key2]['name']; + $filearray[$key]['position']=$filearrayindatabase[$key2]['position']; + $filearray[$key]['cover']=$filearrayindatabase[$key2]['cover']; + $filearray[$key]['acl']=$filearrayindatabase[$key2]['acl']; + $filearray[$key]['rowid']=$filearrayindatabase[$key2]['rowid']; + $filearray[$key]['label']=$filearrayindatabase[$key2]['label']; + $found=1; + break; + } + } + + if (! $found) // This happen in transition toward version 6, or if files were added manually into os dir. + { + $filearray[$key]['position']='999999'; // File not indexed are at end. So if we add a file, it will not replace an existing position + $filearray[$key]['cover']=0; + $filearray[$key]['acl']=''; + + $rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $filearray[$key]['fullname']); + if (! preg_match('/([\\/]temp[\\/]|[\\/]thumbs|\.meta$)/', $rel_filetorenameafter)) // If not a tmp file + { + dol_syslog("list_of_documents We found a file called '".$filearray[$key]['name']."' not indexed into database. We add it"); + include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; + $ecmfile=new EcmFiles($db); + + // Add entry into database + $filename = basename($rel_filename); + $rel_dir = dirname($rel_filename); + $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); + $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); + + $ecmfile->filepath = $rel_dir; + $ecmfile->filename = $filename; + $ecmfile->label = md5_file(dol_osencode($filearray[$key]['fullname'])); // $destfile is a full path to file + $ecmfile->fullpath_orig = $filearray[$key]['fullname']; + $ecmfile->gen_or_uploaded = 'unknown'; + $ecmfile->description = ''; // indexed content + $ecmfile->keyword = ''; // keyword content + $result = $ecmfile->create($user); + if ($result < 0) + { + setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); + } + else + { + $filearray[$key]['rowid']=$result; + } + } + else + { + $filearray[$key]['rowid']=0; // Should not happened + } + } + } + + /*var_dump($filearray);*/ +} + + /** * Fast compare of 2 files identified by their properties ->name, ->date and ->size * @@ -390,6 +477,7 @@ function dol_dir_is_emtpy($folder) * * @param string $file Filename * @return int <0 if KO, Number of lines in files if OK + * @see dol_nboflines */ function dol_count_nb_of_line($file) { @@ -445,12 +533,12 @@ function dol_filemtime($pathoffile) * Make replacement of strings into a file. * * @param string $srcfile Source file (can't be a directory) - * @param array $arrayreplacement Array with strings to replace + * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' * @param int $indexdatabase Index new file into database. * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK - * @see dolCopyr + * @see dolCopyr dolReplaceRegExInFile */ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, $indexdatabase=0) { @@ -511,6 +599,23 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, return 1; } +/** + * Make replacement of strings into a file. + * + * @param string $srcfile Source file (can't be a directory) + * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) + * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. + * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' + * @param int $indexdatabase Index new file into database. + * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK + * @see dolCopyr dolReplaceInFile + */ +function dolReplaceRegExInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, $indexdatabase=0) +{ + // TODO + +} + /** * Copy a file to another file. * @@ -567,7 +672,7 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1) } /** - * Copy a dir to another dir. + * Copy a dir to another dir. This include recursive subdirectories. * * @param string $srcfile Source file (a directory) * @param string $destfile Destination file (a directory) @@ -609,7 +714,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep $dir_handle=opendir($ossrcfile); while ($file=readdir($dir_handle)) { - if ($file!="." && $file!="..") + if ($file != "." && $file != ".." && ! is_link($ossrcfile."/".$file)) { if (is_dir($ossrcfile."/".$file)) { @@ -658,7 +763,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep * Move a file into another name. * Note: * - This function differs from dol_move_uploaded_file, because it can be called in any context. - * - Database of files is updated. + * - Database indexes for files are updated. * - Test on antivirus is done only if param testvirus is provided and an antivirus was set. * * @param string $srcfile Source file (can't be a directory. use native php @rename() to move a directory) @@ -721,7 +826,7 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1, $testvi // Rename entry into ecm database $rel_filetorenamebefore = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $srcfile); $rel_filetorenameafter = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $destfile); - if (! preg_match('/(\/temp\/|\/thumbs|\.meta$)/', $rel_filetorenameafter)) // If not a tmp file + if (! preg_match('/([\\/]temp[\\/]|[\\/]thumbs|\.meta$)/', $rel_filetorenameafter)) // If not a tmp file { $rel_filetorenamebefore = preg_replace('/^[\\/]/', '', $rel_filetorenamebefore); $rel_filetorenameafter = preg_replace('/^[\\/]/', '', $rel_filetorenameafter); @@ -978,7 +1083,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable } /** - * Remove a file or several files with a mask + * Remove a file or several files with a mask. + * This delete file physically but also database indexes. * * @param string $file File to delete or mask of files to delete * @param int $disableglob Disable usage of glob like * so function is an exact delete function that will return error if no file found @@ -1113,12 +1219,13 @@ function dol_delete_dir($dir,$nophperrors=0) * Remove a directory $dir and its subdirectories (or only files and subdirectories) * * @param string $dir Dir to delete - * @param int $count Counter to count nb of deleted elements + * @param int $count Counter to count nb of elements found to delete * @param int $nophperrors Disable all PHP output errors * @param int $onlysub Delete only files and subdir, not main directory - * @return int Number of files and directory removed + * @param int $countdeleted Counter to count nb of elements found really deleted + * @return int Number of files and directory we try to remove. NB really removed is returned into $countdeleted. */ -function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0,$onlysub=0) +function dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0) { dol_syslog("functions.lib:dol_delete_dir_recursive ".$dir,LOG_DEBUG); if (dol_is_dir($dir)) @@ -1132,15 +1239,15 @@ function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0,$onlysub=0) if ($item != "." && $item != "..") { - if (is_dir(dol_osencode("$dir/$item"))) + if (is_dir(dol_osencode("$dir/$item")) && ! is_link(dol_osencode("$dir/$item"))) { - $count=dol_delete_dir_recursive("$dir/$item",$count,$nophperrors); + $count=dol_delete_dir_recursive("$dir/$item", $count, $nophperrors, 0, $countdeleted); } else { - dol_delete_file("$dir/$item",1,$nophperrors); + $result=dol_delete_file("$dir/$item", 1, $nophperrors); $count++; - //echo " removing $dir/$item
    \n"; + if ($result) $countdeleted++; } } } @@ -1148,14 +1255,13 @@ function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0,$onlysub=0) if (empty($onlysub)) { - dol_delete_dir($dir,$nophperrors); - $count++; - //echo "removing $dir
    \n"; + $result=dol_delete_dir($dir, $nophperrors); + $count++; + if ($result) $countdeleted++; } } } - //echo "return=".$count; return $count; } @@ -1218,16 +1324,17 @@ function dol_delete_preview($object) /** * Create a meta file with document file into same directory. - * This should allow "grep" search. - * This feature is enabled only if option MAIN_DOC_CREATE_METAFILE is set. + * This make "grep" search possible. + * This feature to generate the meta file is enabled only if option MAIN_DOC_CREATE_METAFILE is set. * * @param CommonObject $object Object - * @return int 0 if we did nothing, >0 success, <0 error + * @return int 0 if do nothing, >0 if we update meta file too, <0 if KO */ function dol_meta_create($object) { global $conf; + // Create meta file if (empty($conf->global->MAIN_DOC_CREATE_METAFILE)) return 0; // By default, no metafile. // Define parent dir of elements @@ -1245,9 +1352,9 @@ function dol_meta_create($object) { $object->fetch_thirdparty(); - $facref = dol_sanitizeFileName($object->ref); - $dir = $dir . "/" . $facref; - $file = $dir . "/" . $facref . ".meta"; + $objectref = dol_sanitizeFileName($object->ref); + $dir = $dir . "/" . $objectref; + $file = $dir . "/" . $objectref . ".meta"; if (! is_dir($dir)) { @@ -1262,15 +1369,15 @@ function dol_meta_create($object) DATE=\"" . dol_print_date($object->date,'') . "\" NB_ITEMS=\"" . $nblignes . "\" CLIENT=\"" . $client . "\" - TOTAL_HT=\"" . $object->total_ht . "\" - TOTAL_TTC=\"" . $object->total_ttc . "\"\n"; + AMOUNT_WO_TAX=\"" . $object->total_ht . "\" + AMOUNT_INC_TAX=\"" . $object->total_ttc . "\"\n"; for ($i = 0 ; $i < $nblignes ; $i++) { //Pour les articles $meta .= "ITEM_" . $i . "_QUANTITY=\"" . $object->lines[$i]->qty . "\" - ITEM_" . $i . "_TOTAL_HT=\"" . $object->lines[$i]->total_ht . "\" - ITEM_" . $i . "_TVA=\"" .$object->lines[$i]->tva_tx . "\" + ITEM_" . $i . "_AMOUNT_WO_TAX=\"" . $object->lines[$i]->total_ht . "\" + ITEM_" . $i . "_VAT=\"" .$object->lines[$i]->tva_tx . "\" ITEM_" . $i . "_DESCRIPTION=\"" . str_replace("\r\n","",nl2br($object->lines[$i]->desc)) . "\" "; } @@ -1284,6 +1391,10 @@ function dol_meta_create($object) return 1; } + else + { + dol_syslog('FailedToDetectDirInDolMetaCreateFor'.$object->element, LOG_WARNING); + } return 0; } @@ -1322,20 +1433,21 @@ function dol_init_file_process($pathtoscan='', $trackid='') /** - * Get and save an upload file (for example after submitting a new file a mail form). + * Get and save an upload file (for example after submitting a new file a mail form). Database index of file is also updated if donotupdatesession is set. * All information used are in db, conf, langs, user and _FILES. * Note: This function can be used only into a HTML page context. * * @param string $upload_dir Directory where to store uploaded file (note: used to forge $destpath = $upload_dir + filename) * @param int $allowoverwrite 1=Allow overwrite existing file - * @param int $donotupdatesession 1=Do no edit _SESSION variable + * @param int $donotupdatesession 1=Do no edit _SESSION variable but update database index. 0=Update _SESSION and not database index. * @param string $varfiles _FILES var name * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' * @param string $link Link to add (to add a link instead of a file) * @param string $trackid Track id (used to prefix name of session vars to avoid conflict) + * @param int $generatethumbs 1=Generate also thumbs for uploaded image files * @return int <=0 if KO, >0 if OK */ -function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='', $link=null, $trackid='') +function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='', $link=null, $trackid='', $generatethumbs=1) { global $db,$user,$conf,$langs; @@ -1386,16 +1498,19 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; // Generate thumbs. - if (image_format_supported($destfull) == 1) + if ($generatethumbs) { - // Create thumbs - // We can't use $object->addThumbs here because there is no $object known + if (image_format_supported($destfull) == 1) + { + // Create thumbs + // We can't use $object->addThumbs here because there is no $object known - // Used on logon for example - $imgThumbSmall = vignette($destfull, $maxwidthsmall, $maxheightsmall, '_small', 50, "thumbs"); - // Create mini thumbs for image (Ratio is near 16/9) - // Used on menu or for setup page for example - $imgThumbMini = vignette($destfull, $maxwidthmini, $maxheightmini, '_mini', 50, "thumbs"); + // Used on logon for example + $imgThumbSmall = vignette($destfull, $maxwidthsmall, $maxheightsmall, '_small', 50, "thumbs"); + // Create mini thumbs for image (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($destfull, $maxwidthmini, $maxheightmini, '_mini', 50, "thumbs"); + } } // Update session @@ -1412,7 +1527,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio { $rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir); - if (! preg_match('/[\\/]temp[\\/]/', $rel_dir)) // If not a tmp dir + if (! preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir { $filename = basename($destfile); $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); @@ -1539,34 +1654,41 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile= * @param string $fileinput Input file name * @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided). * @param string $fileoutput Output filename - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0=Nothing done, >0 if OK */ function dol_convert_file($fileinput,$ext='png',$fileoutput='') { global $langs; - $image=new Imagick(); - $ret = $image->readImage($fileinput); - if ($ret) + if (class_exists('Imagick')) { - $ret = $image->setImageFormat($ext); + $image=new Imagick(); + $ret = $image->readImage($fileinput); if ($ret) { - if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; + $ret = $image->setImageFormat($ext); + if ($ret) + { + if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; - $count = $image->getNumberImages(); - $ret = $image->writeImages($fileoutput, true); - if ($ret) return $count; - else return -3; + $count = $image->getNumberImages(); + $ret = $image->writeImages($fileoutput, true); + if ($ret) return $count; + else return -3; + } + else + { + return -2; + } } else { - return -2; + return -1; } } else { - return -1; + return 0; } } @@ -1689,7 +1811,7 @@ function dol_uncompress($inputfile,$outputdir) * Compress a directory and subdirectories into a package file. * * @param string $inputdir Source dir name - * @param string $outputfile Target file name + * @param string $outputfile Target file name (output directory must exists and be writable) * @param string $mode 'zip' * @return int <0 if KO, >0 if OK */ @@ -1698,6 +1820,15 @@ function dol_compress_dir($inputdir, $outputfile, $mode="zip") $foundhandler=0; dol_syslog("Try to zip dir ".$inputdir." into ".$outputdir." mode=".$mode); + + if (! dol_is_dir(dirname($outputfile)) || ! is_writable(dirname($outputfile))) + { + global $langs, $errormsg; + $langs->load("errors"); + $errormsg=$langs->trans("ErrorFailedToWriteInDir",$outputfile); + return -3; + } + try { if ($mode == 'gz') { $foundhandler=0; } @@ -1721,7 +1852,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode="zip") // Initialize archive object $zip = new ZipArchive(); - $zip->open($outputfile, ZipArchive::CREATE | ZipArchive::OVERWRITE); + $result = $zip->open($outputfile, ZipArchive::CREATE | ZipArchive::OVERWRITE); // Create recursive directory iterator /** @var SplFileInfo[] $files */ @@ -1756,6 +1887,10 @@ function dol_compress_dir($inputdir, $outputfile, $mode="zip") dol_syslog("Try to zip with format ".$mode." with no handler for this format",LOG_ERR); return -2; } + else + { + return 0; + } } catch (Exception $e) { @@ -1801,7 +1936,7 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta function dol_check_secure_access_document($modulepart, $original_file, $entity, $fuser='', $refname='', $mode='read') { global $user, $conf, $db; - global $dolibarr_main_data_root; + global $dolibarr_main_data_root, $dolibarr_main_document_root_alt; if (! is_object($fuser)) $fuser=$user; @@ -1829,7 +1964,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($modulepart == 'medias' && !empty($dolibarr_main_data_root)) { $accessallowed=1; - $original_file=$dolibarr_main_data_root.'/medias/'.$original_file; + $original_file=$conf->medias->multidir_output[$entity].'/'.$original_file; } // Wrapping for *.log files, like when used with url http://.../document.php?modulepart=logs&file=dolibarr.log elseif ($modulepart == 'logs' && !empty($dolibarr_main_data_root)) @@ -1837,6 +1972,16 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed=($user->admin && basename($original_file) == $original_file && preg_match('/^dolibarr.*\.log$/', basename($original_file))); $original_file=$dolibarr_main_data_root.'/'.$original_file; } + // Wrapping for *.zip files, like when used with url http://.../document.php?modulepart=packages&file=module_myfile.zip + elseif ($modulepart == 'packages' && !empty($dolibarr_main_data_root)) + { + // Dir for custom dirs + $tmp=explode(',', $dolibarr_main_document_root_alt); + $dirins = $tmp[0]; + + $accessallowed=($user->admin && preg_match('/^module_.*\.zip$/', basename($original_file))); + $original_file=$dirins.'/'.$original_file; + } // Wrapping for some images elseif (($modulepart == 'mycompany' || $modulepart == 'companylogo') && !empty($conf->mycompany->dir_output)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4629324dc84..f24cf0338c5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1,16 +1,16 @@ +/* Copyright (C) 2000-2007 Rodolphe Quiedeville * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2004 Christophe Combelles - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2004 Christophe Combelles + * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2014 Cédric GROSS + * Copyright (C) 2014 Cédric GROSS * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry * @@ -190,8 +190,9 @@ function getBrowserInfo($user_agent) } // OS - if (preg_match('/linux/i', $user_agent)) { $os='linux'; } + if (preg_match('/linux/i', $user_agent)) { $os='linux'; } elseif (preg_match('/macintosh/i', $user_agent)) { $os='macintosh'; } + elseif (preg_match('/windows/i', $user_agent)) { $os='windows'; } // Name if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='firefox'; $version=$reg[2]; } @@ -201,7 +202,8 @@ function getBrowserInfo($user_agent) elseif (preg_match('/epiphany/i', $user_agent)) { $name='epiphany'; } elseif (preg_match('/safari(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not. elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; } - elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end + elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];.*rv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end + elseif (preg_match('/(Windows NT\s([0-9]+\.[0-9])).*(Trident\/[0-9]+.[0-9];.*rv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; } if ($tablet) { @@ -245,7 +247,7 @@ function dol_shutdown() * @param string $check Type of check * ''=no check (deprecated) * 'none'=no check (only for param that should have very rich content) - * 'int'=check it's numeric + * 'int'=check it's numeric (integer or float) * 'alpha'=check it's text and sign * 'aZ'=check it's a-z only * 'aZ09'=check it's simple alpha string (recommended for keys) @@ -257,14 +259,18 @@ function dol_shutdown() * @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails) * @param mixed $options Options to pass to filter_var when $check is set to 'custom'. * @return string|string[] Value found (string or array), or '' if check fails - * - * @TODO Set default value for check to alpha. Check all WYSIWYG edition (email and description...) is still ok with rich text. */ -function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) +function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=NULL) { global $mysoc,$user,$conf; if (empty($paramname)) return 'BadFirstParameterForGETPOST'; + if (empty($check)) + { + dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING); + // Enable this line to know who call the GETPOST with '' $check parameter. + //var_dump(debug_backtrace()[0]); + } if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; @@ -275,12 +281,14 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) if (empty($method) || $method == 3 || $method == 4) { + $relativepathstring = $_SERVER["PHP_SELF"]; // Clean $relativepathstring if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); $relativepathstring = preg_replace('/^\//', '', $relativepathstring); $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); - //var_dump($relativepathstring); + //var_dump($relativepathstring); + //var_dump($user->default_values); // Code for search criteria persistence. // Retrieve values if restore_lastsearch_values is set and there is saved values @@ -302,12 +310,25 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) // Else, retreive default values if we are not doing a sort elseif (! isset($_GET['sortfield']) && ! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_ENABLE_DEFAULT_VALUES is not set { - if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) + if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) { if (! empty($user->default_values)) // $user->default_values defined from menu default values { - //var_dump($user->default_values[$relativepathstring]['createform']); - if (isset($user->default_values[$relativepathstring]['createform'][$paramname])) $out = $user->default_values[$relativepathstring]['createform'][$paramname]; + $qualified=1; + if (isset($user->default_values[$relativepathstring]['createform_queries'])) // Even if paramname is sortfield, data are stored into ['sortorder...'] + { + $tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['createform_queries']); + $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); + foreach($tmpqueryarraytohave as $tmpquerytohave) + { + if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0; + } + } + if ($qualified) + { + //var_dump($user->default_values[$relativepathstring]['createform']); + if (isset($user->default_values[$relativepathstring]['createform'][$paramname])) $out = $user->default_values[$relativepathstring]['createform'][$paramname]; + } } } // Management of default search_filters and sort order @@ -317,34 +338,85 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) if (! empty($user->default_values)) // $user->default_values defined from menu default values { //var_dump($user->default_values[$relativepathstring]); - if ($paramname == 'sortfield') + if ($paramname == 'sortfield') // Sorted on which fields ? { - if (isset($user->default_values[$relativepathstring]['sortorder'])) // We will use the key of $user->default_values[path][sortorder] - { - $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , - foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val) - { - if ($out) $out.=', '; - $out.=dol_string_nospecial($key, '', $forbidden_chars_to_replace); - } - } + $qualified=1; + if (isset($user->default_values[$relativepathstring]['sortorder_queries'])) // Even if paramname is sortfield, data are stored into ['sortorder...'] + { + $tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['sortorder_queries']); + $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); + foreach($tmpqueryarraytohave as $tmpquerytohave) + { + if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0; + } + } + if ($qualified) + { + if (isset($user->default_values[$relativepathstring]['sortorder'])) // We will use the key of $user->default_values[path][sortorder] + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val) + { + if ($out) $out.=', '; + $out.=dol_string_nospecial($key, '', $forbidden_chars_to_replace); + } + } + } } - elseif ($paramname == 'sortorder') + elseif ($paramname == 'sortorder') // ASC or DESC ? { - if (isset($user->default_values[$relativepathstring]['sortorder'])) // We will use the val of $user->default_values[path][sortorder] - { - $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , - foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val) - { - if ($out) $out.=', '; - $out.=dol_string_nospecial($val, '', $forbidden_chars_to_replace); - } - } + $qualified=1; + if (isset($user->default_values[$relativepathstring]['sortorder_queries'])) + { + $tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['sortorder_queries']); + $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); + foreach($tmpqueryarraytohave as $tmpquerytohave) + { + if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0; + } + } + if ($qualified) + { + if (isset($user->default_values[$relativepathstring]['sortorder'])) // We will use the val of $user->default_values[path][sortorder] + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val) + { + if ($out) $out.=', '; + $out.=dol_string_nospecial($val, '', $forbidden_chars_to_replace); + } + } + } } elseif (isset($user->default_values[$relativepathstring]['filters'][$paramname])) { - $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , - $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace); + $qualified=1; + if (isset($user->default_values[$relativepathstring]['filters_queries'])) + { + $tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['filters_queries']); + $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); + foreach($tmpqueryarraytohave as $tmpquerytohave) + { + if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0; + } + } + if ($qualified) + { + if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) + { + // We made a search from quick search menu, do we still use default filter ? + if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace); + } + } + else + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace); + } + } } } } @@ -352,15 +424,6 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) } - if (empty($check) && ! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) - { - dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param not defined, when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING); - // Enable this line to know who call the GETPOST with empty $check parameter. - //var_dump(debug_backtrace()[0]); - } - - if (! empty($check)) - { // Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters) // Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ... // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. @@ -407,7 +470,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) { case 'none': break; - case 'int': + case 'int': // Check param is a numeric value (integer but also float or hexadecimal) if (! is_numeric($out)) { $out=''; } break; case 'intcomma': @@ -429,7 +492,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) break; case 'aZ09': $out=trim($out); - if (preg_match('/[^a-z0-9_\-]+/i',$out)) $out=''; + if (preg_match('/[^a-z0-9_\-\.]+/i',$out)) $out=''; break; case 'array': if (! is_array($out) || empty($out)) $out=array(); @@ -450,7 +513,6 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) $out=filter_var($out, $filter, $options); break; } - } // Code for search criteria persistence. // Save data into session if key start with 'search_' or is 'smonth', 'syear', 'month', 'year' @@ -624,18 +686,26 @@ function dol_buildpath($path, $type=0) /** * Create a clone of instance of object (new instance with same value for properties) - * Property that are reference are also new object (true clone) + * With native = 0: Property that are reference are also new object (true clone). This means $this->db is not valid. + * With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db is still valid. * * @param object $object Object to clone + * @param int $native Native method or true method * @return object Object clone * @see https://php.net/manual/language.oop5.cloning.php */ -function dol_clone($object) +function dol_clone($object, $native=0) { //dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); - //$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable - $myclone=unserialize(serialize($object)); + if (empty($native)) + { + $myclone=unserialize(serialize($object)); + } + else + { + $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable) + } return $myclone; } @@ -746,7 +816,8 @@ function dol_string_unaccent($str) } /** - * Clean a string from all punctuation characters to use it as a ref or login + * Clean a string from all punctuation characters to use it as a ref or login. + * This is a more complete function than dol_sanitizeFileName. * * @param string $str String to clean * @param string $newstr String to replace forbidden chars with @@ -757,7 +828,7 @@ function dol_string_unaccent($str) */ function dol_string_nospecial($str,$newstr='_',$badcharstoreplace='') { - $forbidden_chars_to_replace=array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "="); + $forbidden_chars_to_replace=array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°'); // more complete than dol_sanitizeFileName $forbidden_chars_to_remove=array(); if (is_array($badcharstoreplace)) $forbidden_chars_to_replace=$badcharstoreplace; //$forbidden_chars_to_remove=array("(",")"); @@ -1126,7 +1197,7 @@ function dol_get_fiche_end($notab=0) * @param string $paramid Name of parameter to use to name the id into the URL next/previous link * @param string $morehtml More html content to output just before the nav bar * @param int $shownav Show Condition (navigation is shown if value is 1) - * @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field) + * @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field). Use 'none' for no prev/next search. * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous * @param string $morehtmlref More html to show after ref * @param string $moreparam More param to add in nav link url. @@ -1181,10 +1252,10 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $nophoto=''; $morehtmlleft.='
    '; } - elseif ($conf->browser->layout != 'phone') { // Show no photo link + //elseif ($conf->browser->layout != 'phone') { // Show no photo link $nophoto='/public/theme/common/nophoto.png'; $morehtmlleft.='
    No photo
    '; - } + //} } } else @@ -1225,8 +1296,11 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) ) { - $ret = dol_convert_file($file, 'png', $fileimage); - if ($ret < 0) $error++; + if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. + { + $ret = dol_convert_file($file, 'png', $fileimage); + if ($ret < 0) $error++; + } } $heightforphotref=70; @@ -1261,7 +1335,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } } - if (! $phototoshow && $conf->browser->layout != 'phone') // Show No photo link (picto of pbject) + if (! $phototoshow) // Show No photo link (picto of pbject) { $morehtmlleft.='
    '; if ($object->element == 'action') @@ -1277,7 +1351,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub $nophoto=img_picto('', 'object_'.$picto, '', false, 1); } - $morehtmlleft.='
    No photo
    '; + $morehtmlleft.=''; + $morehtmlleft.='
    No photo
    '; + $morehtmlleft.='
    '; } } @@ -1319,6 +1395,11 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->statut==0) $morehtmlstatus.=$object->getLibStatut(2); else $morehtmlstatus.=$object->getLibStatut(4); } + elseif ($object->element == 'facturerec') + { + if ($object->frequency==0) $morehtmlstatus.=$object->getLibStatut(2); + else $morehtmlstatus.=$object->getLibStatut(4); + } else { // Generic case $tmptxt=$object->getLibStatut(6); if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5); @@ -1332,7 +1413,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if (! empty($object->label)) $morehtmlref.='
    '.$object->label.'
    '; } - if ($object->element != 'product' && $object->element != 'bookmark') + if ($object->element != 'product' && $object->element != 'bookmark' && $object->element != 'ecm_directories') { $morehtmlref.='
    '; $morehtmlref.=$object->getBannerAddress('refaddress',$object); @@ -2462,12 +2543,12 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie', * MAIN_DISABLE_TRUNC=1 can disable all truncings * * @param string $string String to truncate - * @param int $size Max string size visible. 0 for no limit. Final string size can be 1 more (if size was max+1) or 3 more (if we added ...) + * @param int $size Max string size visible (excluding ...). 0 for no limit. WARNING: Final string size can have 3 more chars (if we added ..., or if size was max+1 or max+2 or max+3 so it does not worse to replace with ...) * @param string $trunc Where to trunc: right, left, middle (size must be a 2 power), wrap * @param string $stringencoding Tell what is source string encoding * @param int $nodot Truncation do not add ... after truncation. So it's an exact truncation. * @param int $display Trunc is use to display and can be changed for small screen. TODO Remove this param (must be dealt with CSS) - * @return string Truncated string + * @return string Truncated string. WARNING: length is never higher than $size if $nodot is set, but can be 3 chars higher otherwise. */ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodot=0, $display=0) { @@ -2483,9 +2564,10 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo if ($trunc == 'right') { $newstring=dol_textishtml($string)?dol_string_nohtmltag($string,1):$string; - if (dol_strlen($newstring,$stringencoding) > ($size+($nodot?0:1))) + if (dol_strlen($newstring,$stringencoding) > ($size+($nodot?0:3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ... return dol_substr($newstring,0,$size,$stringencoding).($nodot?'':'...'); else + //return 'u'.$size.'-'.$newstring.'-'.dol_strlen($newstring,$stringencoding).'-'.$string; return $string; } elseif ($trunc == 'middle') @@ -2503,7 +2585,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo elseif ($trunc == 'left') { $newstring=dol_textishtml($string)?dol_string_nohtmltag($string,1):$string; - if (dol_strlen($newstring,$stringencoding) > ($size+1)) + if (dol_strlen($newstring,$stringencoding) > ($size+($nodot?0:3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ... return '...'.dol_substr($newstring,dol_strlen($newstring,$stringencoding) - $size,$size,$stringencoding); else return $string; @@ -2543,7 +2625,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if ($pictoisfullpath) { // Clean parameters - if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png'; + if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png'; $fullpathpicto = $picto; } else @@ -2565,7 +2647,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } // Clean parameters - if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png'; + if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png'; // If alt path are defined, define url where img file is, according to physical path foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...) { @@ -3234,7 +3316,12 @@ function dol_print_error($db='',$error='',$errors=null) } if (empty($dolibarr_main_prod)) print $out; - else define("MAIN_CORE_ERROR", 1); + else + { + print $langs->trans("DolibarrHasDetectedError").'. '; + print $langs->trans("YouCanSetOptionDolibarrMainProdToZero"); + define("MAIN_CORE_ERROR", 1); + } //else print 'Sorry, an error occured but the parameter $dolibarr_main_prod is defined in conf file so no message is reported to your browser. Please read the log file for error message.'; dol_syslog("Error ".$syslog, LOG_ERR); } @@ -3270,31 +3357,34 @@ function dol_print_error_email($prefixcode, $errormessage='') * @param string $sortfield Current field used to sort * @param string $sortorder Current sort order * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag. + * @param string $tooltip Tooltip * @return void */ -function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="") +function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="", $tooltip="") { - print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix); + print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix, 0, $tooltip); } /** * Get title line of an array * - * @param string $name Translation key of field - * @param int $thead 0=To use with standard table format, 1=To use inside
    , 2=To use with
    - * @param string $file Url used when we click on sort picto - * @param string $field Field to use for new sorting. Empty if this field is not sortable. - * @param string $begin ("" by defaut) - * @param string $moreparam Add more parameters on sort url links ("" by default) - * @param string $moreattrib Add more attributes on th ("" by defaut). To add more css class, use param $prefix. - * @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id') - * @param string $sortorder Current sort order (Ex: 'asc,desc') - * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag. + * @param string $name Translation key of field + * @param int $thead 0=To use with standard table format, 1=To use inside
    , 2=To use with
    + * @param string $file Url used when we click on sort picto + * @param string $field Field to use for new sorting. Empty if this field is not sortable. + * @param string $begin ("" by defaut) + * @param string $moreparam Add more parameters on sort url links ("" by default) + * @param string $moreattrib Add more attributes on th ("" by defaut, example: 'align="center"'). To add more css class, use param $prefix. + * @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id') + * @param string $sortorder Current sort order (Ex: 'asc,desc') + * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '. + * @param string $disablesortlink 1=Disable sort link + * @param string $tooltip Tooltip * @return string */ -function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="") +function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='') { - global $conf, $langs; + global $conf, $langs, $form; //print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder
    \n"; $sortorder=strtoupper($sortorder); @@ -3310,13 +3400,12 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m $field1=trim($tmpfield[0]); // If $field is 'd.datep,d.id', it becomes 'd.datep' //var_dump('field='.$field.' field1='.$field1.' sortfield='.$sortfield.' sortfield1='.$sortfield1); - // If field is used as sort criteria we use a specific css class liste_titre_sel // Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom") if ($field1 && ($sortfield1 == $field1 || $sortfield1 == preg_replace("/^[^\.]+\./","",$field1))) $out.= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '. $moreattrib.'>'; else $out.= '<'.$tag.' class="'.$prefix.'liste_titre" '. $moreattrib.'>'; - if (empty($thead) && $field) // If this is a sort field + if (empty($thead) && $field && empty($disablesortlink)) // If this is a sort field { $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam); $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options); @@ -3335,9 +3424,10 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m } } - $out.=$langs->trans($name); + if ($tooltip) $out.=$form->textwithpicto($langs->trans($name), $langs->trans($tooltip)); + else $out.=$langs->trans($name); - if (empty($thead) && $field) // If this is a sort field + if (empty($thead) && $field && empty($disablesortlink)) // If this is a sort field { $out.=''; } @@ -3510,8 +3600,8 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so // Right print '
    '; print '
    '; $out.=''; $out.=$actionstatic->getNomUrl(1, -1); $out.=''; //$userstatic->id=$histo[$key]['userid']; @@ -1321,7 +1326,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $userstatic->fetch($histo[$key]['userid']); $out.=$userstatic->getNomUrl(-1); $out.=''; if (isset($histo[$key]['type']) && $histo[$key]['type']=='action') @@ -1360,7 +1365,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && ! $histo[$key]['dateend'] && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1; if ($late) $out.=img_warning($langs->trans("Late")).' '; $out.="'; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) @@ -1375,7 +1380,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= } else { $typelabel = $actionstatic->type; - if ($histo[$key]['acode'] != 'AC_OTH_AUTO') $typelabel = $langs->trans("ActionAC_MANUAL"); + if ($histo[$key]['acode'] != 'AC_OTH_AUTO') $typelabel = $langs->trans("ActionAC_MANUAL"); $out.=$typelabel; } $out.='
    '; - if ($sortfield) $options .= "&sortfield=".$sortfield; - if ($sortorder) $options .= "&sortorder=".$sortorder; + if ($sortfield) $options .= "&sortfield=".$sortfield; + if ($sortorder) $options .= "&sortorder=".$sortorder; // Show navigation bar $pagelist = ''; if ($savlimit != 0 && ($page > 0 || $num > $limit)) @@ -3558,7 +3648,9 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="active"':'').'>'.($page+1).""; } } + print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtml, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist + print '
    '."\n"; @@ -3684,7 +3776,13 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0) $info_bits |= 1; } - $ret=price($rate,0,'',0,0).($addpercent?'%':''); + // If rate is '9/9/9' we don't change it. If rate is '9.000' we apply price() + if (! preg_match('/\//', $rate)) $ret=price($rate,0,'',0,0).($addpercent?'%':''); + else + { + // TODO Split on / and output with a price2num to have clean numbers with ton of 000. + $ret=$rate.($addpercent?'%':''); + } if ($info_bits & 1) $ret.=' *'; $ret.=$morelabel; return $ret; @@ -3766,7 +3864,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou { if ($currency_code == 'auto') $currency_code=$conf->currency; - $listofcurrenciesbefore=array('USD','GBP','AUD','MXN'); + $listofcurrenciesbefore=array('USD','GBP','AUD','MXN','PEN'); if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); else { @@ -4159,7 +4257,7 @@ function getTaxesFromId($vatrate, $buyer=null, $seller=null, $firstparamisid=1) * @param Societe $buyer Company object * @param Societe $seller Company object * @param int $firstparamisid 1 if first param is id into table (use this if you can) - * @return array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type1, rate localtax2, accountancycodecust, accountancycodesupp) + * @return array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type2, rate localtax2, accountancycodecust, accountancycodesupp) * @see getTaxesFromId */ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0) @@ -4763,22 +4861,57 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8') * Return first line of text. Cut will depends if content is HTML or not. * * @param string $text Input text + * @param int $nboflines Nb of lines to get (default is 1 = first line only) * @return string Output text * @see dol_nboflines_bis, dol_string_nohtmltag, dol_escape_htmltag */ -function dolGetFirstLineOfText($text) +function dolGetFirstLineOfText($text, $nboflines=1) { - if (dol_textishtml($text)) + if ($nboflines == 1) { - $firstline=preg_replace('/]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters - $firstline=preg_replace('/]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters + if (dol_textishtml($text)) + { + $firstline=preg_replace('/]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters + $firstline=preg_replace('/]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters + } + else + { + $firstline=preg_replace('/[\n\r].*/','',$text); + } + return $firstline.((strlen($firstline) != strlen($text))?'...':''); } else { - $firstline=preg_replace('/[\n\r].*/','',$text); + $ishtml=0; + if (dol_textishtml($text)) + { + $text=preg_replace('/\n/','',$text); + $ishtml=1; + $repTable = array("\t" => " ", "\n" => " ", "\r" => " ", "\0" => " ", "\x0B" => " "); + } + else + { + $repTable = array("\t" => " ", "\n" => "
    ", "\r" => " ", "\0" => " ", "\x0B" => " "); + } + + $text = strtr($text, $repTable); + if ($charset == 'UTF-8') { $pattern = '/(]*>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support + else $pattern = '/(]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. + $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + + $firstline=''; + $i=0; + $nba = count($a); // 2x nb of lines in $a because $a contains also a line for each new line separator + while (($i < $nba) && ($i < ($nboflines * 2))) + { + if ($i % 2 == 0) $firstline .= $a[$i]; + elseif (($i < (($nboflines * 2) - 1)) && ($i < ($nba - 1))) $firstline .= ($ishtml?"
    \n":"\n"); + $i++; + } + unset($a); + return $firstline.(($i < $nba)?'...':''); } - return $firstline.((strlen($firstline) != strlen($text))?'...':''); } @@ -4940,7 +5073,7 @@ function dol_nboflines($s,$maxchar=0) /** - * Return nb of lines of a formated text with \n and
    (we can't have both \n and br) + * Return nb of lines of a formated text with \n and
    (WARNING: string must not have mixed \n and br separators) * * @param string $text Text * @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut) @@ -4976,6 +5109,8 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8') } } } + + unset($a); return $nblines; } @@ -5674,8 +5809,8 @@ function dol_osencode($str) * @param DoliDB $db Database handler * @param string $key Code or Id to get Id or Code * @param string $tablename Table name without prefix - * @param string $fieldkey Field for code - * @param string $fieldid Field for id + * @param string $fieldkey Field for search ('code' or 'id') + * @param string $fieldid Field to get ('id' or 'code') * @return int <0 if KO, Id of code if OK * @see $langs->getLabelFromKey */ @@ -5837,6 +5972,7 @@ function picto_from_langcode($codelang) * 'supplier_invoice' to add a tab in supplier invoice view * 'invoice' to add a tab in customer invoice view * 'order' to add a tab in customer order view + * 'contract' to add a tabl in contract view * 'product' to add a tab in product view * 'propal' to add a tab in propal view * 'user' to add a tab in user view @@ -6124,8 +6260,8 @@ function dol_getmypid() * like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2 * or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2 * If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000" - * If param $mode is 2, can contains a list of id separated by comma like "1,3,4" - * @param integer $mode 0=value is list of keywords, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4') + * If param $mode is 2, can contains a list of int id separated by comma like "1,3,4" + * @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4') * @param integer $nofirstand 1=Do not output the first 'AND' * @return string $res The statement to append to the SQL query */ @@ -6133,6 +6269,8 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) { global $db,$langs; + $value=trim($value); + if ($mode == 0) { $value=preg_replace('/\*/','%',$value); // Replace * with % @@ -6193,29 +6331,39 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) $i3 = 0; foreach($tmpcrits as $tmpcrit) { - $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '') . $field . " LIKE '"; + $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); + + if (preg_match('/\.(id|rowid)$/', $field)) // Special cas for rowid that is sometimes a ref so used as a search field + { + $newres .= $field . " = " . (is_numeric(trim($tmpcrit))?trim($tmpcrit):'0'); + } + else + { + $newres .= $field . " LIKE '"; + + $tmpcrit=trim($tmpcrit); + $tmpcrit2=$tmpcrit; + $tmpbefore='%'; $tmpafter='%'; + if (preg_match('/^[\^\$]/', $tmpcrit)) + { + $tmpbefore=''; + $tmpcrit2 = preg_replace('/^[\^\$]/', '', $tmpcrit2); + } + if (preg_match('/[\^\$]$/', $tmpcrit)) + { + $tmpafter=''; + $tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2); + } + $newres .= $tmpbefore; + $newres .= $db->escape($tmpcrit2); + $newres .= $tmpafter; + $newres .= "'"; + if ($tmpcrit2 == '') + { + $newres .= ' OR ' . $field . " IS NULL"; + } + } - $tmpcrit=trim($tmpcrit); - $tmpcrit2=$tmpcrit; - $tmpbefore='%'; $tmpafter='%'; - if (preg_match('/^[\^\$]/', $tmpcrit)) - { - $tmpbefore=''; - $tmpcrit2 = preg_replace('/^[\^\$]/', '', $tmpcrit2); - } - if (preg_match('/[\^\$]$/', $tmpcrit)) - { - $tmpafter=''; - $tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2); - } - $newres .= $tmpbefore; - $newres .= $db->escape($tmpcrit2); - $newres .= $tmpafter; - $newres .= "'"; - if (empty($tmpcrit2)) - { - $newres .= ' OR ' . $field . " IS NULL"; - } $i3++; } $i2++; // a criteria was added to string @@ -6403,3 +6551,43 @@ function dol_mimetype($file,$default='application/octet-stream',$mode=0) return $mime; } +/** + * Return value from dictionary + * + * @param string $tablename name of dictionary + * @param string $field the value to return + * @param int $id id of line + * @param bool $checkentity add filter on entity + * @param string $rowidfield name of the column rowid + */ +function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield='rowid') +{ + global $dictvalues,$db,$langs; + + if (!isset($dictvalues[$tablename])) + { + $dictvalues[$tablename] = array(); + $sql = 'SELECT * FROM '.$tablename.' WHERE 1'; + if ($checkentity) $sql.= ' entity IN (0,'.getEntity('').')'; + + $resql = $db->query($sql); + if ($resql) + { + while ($obj = $db->fetch_object($resql)) + { + $dictvalues[$tablename][$obj->{$rowidfield}] = $obj; + } + } + else + { + dol_print_error($db); + } + } + + if (!empty($dictvalues[$tablename][$id])) return $dictvalues[$tablename][$id]->{$field}; // Found + else // Not found + { + if ($id > 0) return $id; + return ''; + } +} \ No newline at end of file diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php old mode 100755 new mode 100644 index b68d7706e43..3d4b7352dc3 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -707,9 +707,10 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti * @param string $date Date to use for the {y},{m},{d} tags. * @param string $mode 'next' for next value or 'last' for last value * @param bool $bentityon Activate the entity filter. Default is true (for modules not compatible with multicompany) + * @param User $objuser Object user we need data from. * @return string New value (numeric) or error message */ -function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true) +function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true, $objuser=null) { global $conf,$user; @@ -780,6 +781,22 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $masktype_value=''; } + // Extract value for user + if (preg_match('/\{(u+)\}/i',$mask,$regType)) + { + $lastname = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; + if (is_object($objuser)) $lastname = $objuser->lastname; + + $maskuser=$regType[1]; + $maskuser_value=substr($lastname,0,dol_strlen($regType[1]));// get n first characters of user firstname (where n is length in mask) + $maskuser_value=str_pad($maskuser_value,dol_strlen($regType[1]),"#",STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask + } + else + { + $maskuser=''; + $maskuser_value=''; + } + // Personalized field {XXX-1} à {XXX-9} /*$maskperso=array(); $maskpersonew=array(); @@ -805,6 +822,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskwithonlyymcode=preg_replace('/\{dd\}/i','dd',$maskwithonlyymcode); $maskwithonlyymcode=preg_replace('/\{(c+)(0*)\}/i',$maskrefclient,$maskwithonlyymcode); $maskwithonlyymcode=preg_replace('/\{(t+)\}/i',$masktype_value,$maskwithonlyymcode); + $maskwithonlyymcode=preg_replace('/\{(u+)\}/i',$maskuser_value,$maskwithonlyymcode); /*foreach($maskperso as $key => $val) { $maskwithonlyymcode=preg_replace('/'.$val.'/i', $maskpersonew[$key], $maskwithonlyymcode); @@ -951,6 +969,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),str_pad("",dol_strlen($maskcounter),"_"),$maskLike); if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); + if ($maskuser) $maskLike = str_replace(dol_string_nospecial('{'.$maskuser.'}'),$maskuser_value,$maskLike); // Get counter in database $counter=0; @@ -994,6 +1013,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike); if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); + if ($maskuser) $maskLike = str_replace(dol_string_nospecial('{'.$maskuser.'}'),$maskuser_value,$maskLike); $ref=''; $sql = "SELECT ".$field." as ref"; @@ -1114,6 +1134,14 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $masktype_maskafter=$masktype_value; $numFinal = str_replace($masktype_maskbefore,$masktype_maskafter,$numFinal); } + + // Now we replace the user + if ($maskuser) + { + $maskuser_maskbefore='{'.$maskuser.'}'; + $maskuser_maskafter=$maskuser_value; + $numFinal = str_replace($maskuser_maskbefore,$maskuser_maskafter,$numFinal); + } } dol_syslog("functions2::get_next_value return ".$numFinal,LOG_DEBUG); @@ -1780,6 +1808,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='') $module='ficheinter'; $subelement='fichinter'; } + if ($objecttype == 'task') { + $classpath = 'projet/class'; + $module='projet'; + $subelement='task'; + } //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; @@ -2117,12 +2150,46 @@ function colorStringToArray($stringcolor,$colorifnotfound=array(88,88,88)) return array(hexdec($reg[1]),hexdec($reg[2]),hexdec($reg[3])); } +/** + * Return true if the color is light + * + * @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255') + * @return int -1 : Error with argument passed |0 : color is dark | 1 : color is light + */ +function colorIsLight($stringcolor) +{ + $res = -1; + if (!empty($stringcolor)) + { + $res = 0; + $tmp=explode(',', $stringcolor); + if (count($tmp) > 1) // This is a comma RGB ('255','255','255') + { + $r = $tmp[0]; + $g = $tmp[1]; + $b = $tmp[2]; + } + else + { + $hexr=$stringcolor[0].$stringcolor[1]; + $hexg=$stringcolor[2].$stringcolor[3]; + $hexb=$stringcolor[4].$stringcolor[5]; + $r = hexdec($hexr); + $g = hexdec($hexg); + $b = hexdec($hexb); + } + $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm + if ($bright > 0.6) $res = 1; + } + return $res; +} + /** * Applies the Cartesian product algorithm to an array * Source: http://stackoverflow.com/a/15973172 * - * @param array $input Array of products - * @return array Array of combinations + * @param array $input Array of products + * @return array Array of combinations */ function cartesianArray(array $input) { // filter out empty values @@ -2145,3 +2212,92 @@ function cartesianArray(array $input) { return $result; } + + +/** + * Get name of directory where the api_...class.php file is stored + * + * @param string $module Module name + * @return string Directory name + */ +function getModuleDirForApiClass($module) +{ + $moduledirforclass=$module; + + if (in_array($module, array('login', 'access', 'status', 'documents'))) { + $moduledirforclass = 'api'; + } + if (preg_match('/^dictionary/', $module)) { + $moduledirforclass = 'api'; + } + + if ($module == 'contact' || $module == 'contacts' || $module == 'customer' || $module == 'thirdparty' || $module == 'thirdparties') { + $moduledirforclass = 'societe'; + } + if ($module == 'propale' || $module == 'proposals') { + $moduledirforclass = 'comm/propal'; + } + elseif ($module == 'agenda' || $module == 'agendaevents') { + $moduledirforclass = 'comm/action'; + } + elseif ($module == 'adherent' || $module == 'members' || $module == 'memberstypes' || $module == 'subscriptions') { + $moduledirforclass = 'adherents'; + } + elseif ($module == 'banque' || $module == 'bankaccounts') { + $moduledirforclass = 'compta/bank'; + } + elseif ($module == 'category' || $module == 'categorie') { + $moduledirforclass = 'categories'; + } + elseif ($module == 'order' || $module == 'orders') { + $moduledirforclass = 'commande'; + } + elseif ($module == 'facture' || $module == 'invoice' || $module == 'invoices') { + $moduledirforclass = 'compta/facture'; + } + elseif ($module == 'products') { + $moduledirforclass = 'product'; + } + elseif ($module == 'project' || $module == 'projects' || $module == 'tasks') { + $moduledirforclass = 'projet'; + } + elseif ($module == 'task') { + $moduledirforclass = 'projet'; + } + elseif ($module == 'stock' || $module == 'stockmovements' || $module == 'warehouses') { + $moduledirforclass = 'product/stock'; + } + elseif ($module == 'fournisseur' || $module == 'supplierinvoices' || $module == 'supplierorders') { + $moduledirforclass = 'fourn'; + } + elseif ($module == 'expensereports') { + $moduledirforclass = 'expensereport'; + } + elseif ($module == 'users') { + $moduledirforclass = 'user'; + } + + return $moduledirforclass; +} + +/* + * Return 2 hexa code randomly + * + * @param $min int Between 0 and 255 + * @param $max int Between 0 and 255 + * @return String + */ +function random_color_part($min=0,$max=255) { + return str_pad( dechex( mt_rand( $min, $max) ), 2, '0', STR_PAD_LEFT); +} + +/* + * Return hexadecimal color randomly + * + * @param $min int Between 0 and 255 + * @param $max int Between 0 and 255 + * @return String + */ +function random_color($min=0, $max=255) { + return random_color_part($min, $max) . random_color_part($min, $max) . random_color_part($min, $max); +} diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index d9d7d0d9730..e6f69da1d93 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -347,7 +347,7 @@ function dolRotateImage($file_path) * @param int $quality Quality of compression (0=worst, 100=best) * @param string $outdir Directory where to store thumb * @param int $targetformat New format of target (IMAGETYPE_GIF, IMAGETYPE_JPG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_WBMP ... or 0 to keep old format) - * @return string Full path of thumb or '' if it fails + * @return string Full path of thumb or '' if it fails or 'Error...' if it fails */ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $quality=50, $outdir='thumbs', $targetformat=0) { diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 220cc5aeccc..4e7fa860529 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Charlie Benke + * Copyright (C) 2017 ATM-CONSULTING * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -151,6 +152,16 @@ function invoice_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][2] = 'attributeslines'; $h++; + + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php'; + $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); + $head[$h][2] = 'attributesrec'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php'; + $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); + $head[$h][2] = 'attributeslinesrec'; + $h++; complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin','remove'); diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 7388ba47806..3d14d035a61 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -19,14 +19,14 @@ /** * \file htdocs/core/lib/json.lib.php - * \brief Functions to emulate json function for PHP < 5.3 compatibility + * \brief Functions to emulate json function when there were not activated * \ingroup core */ if (! function_exists('json_encode')) { /** - * Implement json_encode for PHP that does not support it + * Implement json_encode for PHP that does not have module enabled. * * @param mixed $elements PHP Object to json encode * @return string Json encoded string @@ -42,12 +42,11 @@ if (! function_exists('json_encode')) * * @param mixed $elements PHP Object to json encode * @return string Json encoded string - * @deprecated PHP >= 5.3 supports native json_encode * @see json_encode() */ function dol_json_encode($elements) { - dol_syslog('dol_json_encode() is deprecated. Please update your code to use native json_encode().', LOG_WARNING); + dol_syslog("For better permorfance, enable the native json in your PHP", LOG_WARNING); $num=0; if (is_object($elements)) // Count number of properties for an object diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 550ec6ad534..472c040e450 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -100,7 +100,7 @@ function member_prepare_head(Adherent $object) $head[$h][2] = 'agenda'; $h++; } - + complete_head_from_modules($conf,$langs,$object,$head,$h,'member','remove'); return $head; @@ -152,6 +152,11 @@ function member_admin_prepare_head() $head[$h][2] = 'general'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_emails.php'; + $head[$h][1] = $langs->trans("EMails"); + $head[$h][2] = 'emails'; + $h++; + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab @@ -168,9 +173,9 @@ function member_admin_prepare_head() $head[$h][2] = 'attributes_type'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/public.php'; + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/website.php'; $head[$h][1] = $langs->trans("BlankSubscriptionForm"); - $head[$h][2] = 'public'; + $head[$h][2] = 'website'; $h++; complete_head_from_modules($conf,$langs,'',$head,$h,'member_admin','remove'); diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php new file mode 100644 index 00000000000..b30b7e0806a --- /dev/null +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -0,0 +1,264 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/lib/memory.lib.php + * \brief Set of function for memory/cache management + */ + + + + +/** + * Regenerate files .class.php + * + * @param string $destdir Directory + * @param string $module Module name + * @param string $objectname Name of object + * @param string $newmask New mask + * @param string $readdir Directory source (use $destdir when not defined) + * @param string $addfieldentry Array of the field entry to add array('key'=>,'type'=>,''label'=>,'visible'=>,'enabled'=>,'position'=>,'notnull'=>','index'=>,'searchall'=>,'comment'=>,'help'=>,'isameasure') + * @param string $delfieldentry Id of field to remove + * @return int <=0 if KO, >0 if OK + */ +function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='', $addfieldentry=array() ,$delfieldentry='') +{ + global $db, $langs; + + if (empty($objectname)) return -1; + if (empty($readdir)) $readdir=$destdir; + + // Check parameters + if (count($addfieldentry) > 0) + { + if (! preg_match('/^(integer|date|timestamp|varchar|double)/', $addfieldentry['type'])) + { + setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null, 'errors'); + return -1; + } + } + + $pathoffiletoeditsrc=$readdir.'/class/'.strtolower($objectname).'.class.php'; + $pathoffiletoedittarget=$destdir.'/class/'.strtolower($objectname).'.class.php'.($readdir != $destdir ? '.new' : ''); + if (! dol_is_file($pathoffiletoeditsrc)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFileNotFound", $pathoffiletoeditsrc), null, 'errors'); + return -1; + } + + //$pathoffiletoedittmp=$destdir.'/class/'.strtolower($objectname).'.class.php.tmp'; + //dol_delete_file($pathoffiletoedittmp, 0, 1, 1); + + try + { + include_once $pathoffiletoeditsrc; + if (class_exists($objectname)) $object=new $objectname($db); + else return -1; + + // Backup old file + dol_copy($pathoffiletoedittarget, $pathoffiletoedittarget.'.back', $newmask, 1); + + // Edit class files + $contentclass = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r'); + + // Update ->fields (add or remove entries) + if (count($object->fields)) + { + if (is_array($addfieldentry) && count($addfieldentry)) + { + $name=$addfieldentry['name']; + unset($addfieldentry['name']); + $object->fields[$name]=$addfieldentry; + } + if (! empty($delfieldentry)) + { + $name=$delfieldentry; + unset($object->fields[$name]); + } + } + + dol_sort_array($object->fields, 'position'); + + $i=0; + $texttoinsert = '// BEGIN MODULEBUILDER PROPERTIES'."\n"; + $texttoinsert.= "\t".'/**'."\n"; + $texttoinsert.= "\t".' * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.'."\n"; + $texttoinsert.= "\t".' */'."\n"; + $texttoinsert.= "\t".'public $fields=array('."\n"; + + if (count($object->fields)) + { + foreach($object->fields as $key => $val) + { + $i++; + $texttoinsert.= "\t\t'".$key."' => array('type'=>'".$val['type']."', 'label'=>'".$val['label']."',"; + $texttoinsert.= " 'visible'=>".($val['visible']!=''?$val['visible']:-1).","; + $texttoinsert.= " 'enabled'=>".($val['enabled']!=''?$val['enabled']:1).","; + $texttoinsert.= " 'position'=>".($val['position']!=''?$val['position']:50).","; + $texttoinsert.= " 'notnull'=>".($val['notnull']!=''?$val['notnull']:-1).","; + if ($val['index']) $texttoinsert.= " 'index'=>".$val['index'].","; + if ($val['searchall']) $texttoinsert.= " 'searchall'=>".$val['searchall'].","; + if ($val['comment']) $texttoinsert.= " 'comment'=>'".$val['comment']."',"; + if ($val['isameasure']) $texttoinsert.= " 'isameasure'=>'".$val['isameasure']."',"; + if ($val['help']) $texttoinsert.= " 'help'=>'".$val['help']."',"; + $texttoinsert.= "),\n"; + } + } + + $texttoinsert.= "\t".');'."\n"; + + if (count($object->fields)) + { + $typetotypephp=array('integer'=>'integer', 'varchar'=>'string'); + + foreach($object->fields as $key => $val) + { + $i++; + //$typephp=$typetotypephp[$val['type']]; + $texttoinsert.= "\t".'public $'.$key.";"; + //if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY'; + //if ($key == 'entity') $texttoinsert.= ' DEFAULT 1'; + //$texttoinsert.= ($val['notnull']?' NOT NULL':''); + //if ($i < count($object->fields)) $texttoinsert.=";"; + $texttoinsert.= "\n"; + } + } + + $texttoinsert.= "\t".'// END MODULEBUILDER PROPERTIES'; + + //print($texttoinsert);exit; + + $contentclass = preg_replace('/\/\/ BEGIN MODULEBUILDER PROPERTIES.*END MODULEBUILDER PROPERTIES/ims', $texttoinsert, $contentclass); + + dol_mkdir(dirname($pathoffiletoedittarget)); + + //file_put_contents($pathoffiletoedittmp, $contentclass); + file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass); + @chmod($pathoffiletoedittarget, octdec($newmask)); + + return 1; + } + catch(Exception $e) + { + print $e->getMessage(); + return -1; + } +} + +/** + * Save data into a memory area shared by all users, all sessions on server + * + * @param string $destdir Directory + * @param string $module Module name + * @param string $objectname Name of object + * @param string $newmask New mask + * @param string $readdir Directory source (use $destdir when not defined) + * @return int <=0 if KO, >0 if OK + */ +function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='') +{ + global $db, $langs; + + if (empty($objectname)) return -1; + if (empty($readdir)) $readdir=$destdir; + + $pathoffiletoclasssrc=$readdir.'/class/'.strtolower($objectname).'.class.php'; + + // Edit .sql file + $pathoffiletoeditsrc=$readdir.'/sql/llx_'.strtolower($objectname).'.sql'; + $pathoffiletoedittarget=$destdir.'/sql/llx_'.strtolower($objectname).'.sql'.($readdir != $destdir ? '.new' : ''); + if (! dol_is_file($pathoffiletoeditsrc)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFileNotFound", $pathoffiletoeditsrc), null, 'errors'); + return -1; + } + + try + { + include_once $pathoffiletoclasssrc; + if (class_exists($objectname)) $object=new $objectname($db); + else return -1; + } + catch(Exception $e) + { + print $e->getMessage(); + } + + // Backup old file + dol_copy($pathoffiletoedittarget, $pathoffiletoedittarget.'.back', $newmask, 1); + + $contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r'); + + $i=0; + $texttoinsert = '-- BEGIN MODULEBUILDER FIELDS'."\n"; + if (count($object->fields)) + { + foreach($object->fields as $key => $val) + { + $i++; + $texttoinsert.= "\t".$key." ".$val['type']; + if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY'; + if ($key == 'entity') $texttoinsert.= ' DEFAULT 1'; + $texttoinsert.= (($val['notnull'] > 0)?' NOT NULL':''); + if ($i < count($object->fields)) $texttoinsert.=", "; + $texttoinsert.= "\n"; + } + } + $texttoinsert.= "\t".'-- END MODULEBUILDER FIELDS'; + + $contentsql = preg_replace('/-- BEGIN MODULEBUILDER FIELDS.*END MODULEBUILDER FIELDS/ims', $texttoinsert, $contentsql); + + file_put_contents($pathoffiletoedittarget, $contentsql); + @chmod($pathoffiletoedittarget, octdec($newmask)); + + + // Edit .key.sql file + $pathoffiletoeditsrc=$destdir.'/sql/llx_'.strtolower($objectname).'.key.sql'; + $pathoffiletoedittarget=$destdir.'/sql/llx_'.strtolower($objectname).'.key.sql'.($readdir != $destdir ? '.new' : ''); + + $contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r'); + + $i=0; + $texttoinsert = '-- BEGIN MODULEBUILDER INDEXES'."\n"; + if (count($object->fields)) + { + foreach($object->fields as $key => $val) + { + $i++; + if ($val['index']) + { + $texttoinsert.= "ALTER TABLE llx_".strtolower($objectname)." ADD INDEX idx_".strtolower($objectname)."_".$key." (".$key.");"; + $texttoinsert.= "\n"; + } + } + } + $texttoinsert.= '-- END MODULEBUILDER INDEXES'; + + $contentsql = preg_replace('/-- BEGIN MODULEBUILDER INDEXES.*END MODULEBUILDER INDEXES/ims', $texttoinsert, $contentsql); + + dol_mkdir(dirname($pathoffiletoedittarget)); + + file_put_contents($pathoffiletoedittarget, $contentsql); + @chmod($pathoffiletoedittarget, octdec($newmask)); + + return 1; +} + + diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 3a4d6b684f5..7caac7a9452 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -1,5 +1,4 @@ * @@ -21,14 +20,14 @@ /** * Returns an array with the tabs for the "Payment" section * It loads tabs from modules looking for the entity payment - * + * * @param Paiement $object Current payment object * @return array Tabs for the payment section */ function payment_prepare_head(Paiement $object) { - + global $langs, $conf; - + $h = 0; $head = array(); @@ -56,14 +55,14 @@ function payment_prepare_head(Paiement $object) { /** * Returns an array with the tabs for the "Supplier payment" section * It loads tabs from modules looking for the entity payment_supplier - * + * * @param Paiement $object Current payment object * @return array Tabs for the payment section */ function payment_supplier_prepare_head(Paiement $object) { - + global $langs, $conf; - + $h = 0; $head = array(); @@ -77,7 +76,7 @@ function payment_supplier_prepare_head(Paiement $object) { // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier'); - + $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/info.php?id='.$object->id; $head[$h][1] = $langs->trans('Info'); $head[$h][2] = 'info'; @@ -89,15 +88,147 @@ function payment_supplier_prepare_head(Paiement $object) { } +/** + * Return string with full Url + * + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $ref Ref of object + * @return string Url string + */ +function showOnlinePaymentUrl($type,$ref) +{ + global $conf, $langs; + + $langs->load("PAYMENT"); + $langs->load("paybox"); + $servicename='Online'; + + $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'
    '; + $url = getOnlinePaymentUrl(0,$type,$ref); + $out.= ''; + $out.= ajax_autoselect("onlinepaymenturl", 0); + return $out; +} + + +/** + * Return string with full Url + * + * @param int $mode 0=True url, 1=Url formated with colors + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $ref Ref of object + * @param int $amount Amount + * @param string $freetag Free tag + * @return string Url string + */ +function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_free_tag') +{ + global $conf; + + $ref=str_replace(' ','',$ref); + $out=''; + + if ($type == 'free') + { + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode?'':'').$amount.($mode?'':'').'&tag='.($mode?'':'').$freetag.($mode?'':''); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); + } + } + if ($type == 'order') + { + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'':''); + if ($mode == 1) $out.='order_ref'; + if ($mode == 0) $out.=urlencode($ref); + $out.=($mode?'':''); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + else + { + $out.='&securekey='.($mode?'':''); + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); + $out.=($mode?'':''); + } + } + } + if ($type == 'invoice') + { + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'':''); + if ($mode == 1) $out.='invoice_ref'; + if ($mode == 0) $out.=urlencode($ref); + $out.=($mode?'':''); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + else + { + $out.='&securekey='.($mode?'':''); + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); + $out.=($mode?'':''); + } + } + } + if ($type == 'contractline') + { + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'':''); + if ($mode == 1) $out.='contractline_ref'; + if ($mode == 0) $out.=urlencode($ref); + $out.=($mode?'':''); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + else + { + $out.='&securekey='.($mode?'':''); + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); + $out.=($mode?'':''); + } + } + } + if ($type == 'membersubscription') + { + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'':''); + if ($mode == 1) $out.='member_ref'; + if ($mode == 0) $out.=urlencode($ref); + $out.=($mode?'':''); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + else + { + $out.='&securekey='.($mode?'':''); + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); + $out.=($mode?'':''); + } + } + } + + // For multicompany + if (! empty($out)) $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities + + return $out; +} + + /** * Show footer of company in HTML pages * * @param Societe $fromcompany Third party * @param Translate $langs Output language + * @param int $addformmessage Add the payment form message + * @param string $suffix Suffix to use on constants + * @param Object $object Object related to payment * @return void */ -function htmlPrintOnlinePaymentFooter($fromcompany,$langs) +function htmlPrintOnlinePaymentFooter($fromcompany,$langs,$addformmessage=0,$suffix='',$object=null) { global $conf; @@ -149,10 +280,32 @@ function htmlPrintOnlinePaymentFooter($fromcompany,$langs) $line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra; } - print '


    '."\n"; - print '
    '."\n"; + print '
    '; + + print '
    '."\n"; + if ($addformmessage) + { + print ''; + print '
    '; + + $parammessageform='ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; + if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); + else if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); + + // Add other message if VAT exists + if (! empty($object->total_vat) || ! empty($object->total_tva)) + { + $parammessageform='ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; + if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); + else if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); + } + } + + print '

    '."\n"; print $fromcompany->name.'
    '; - print $line1.'
    '; + print $line1; + if (strlen($line1+$line2) > 50) print '
    '; + else print ' - '; print $line2; print '
    '."\n"; } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3c771220c70..8a445625022 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1,9 +1,9 @@ +/* Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2017 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2015 Raphaël Doursenaud @@ -345,16 +345,18 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) * @param Societe|Contact $thirdparty Contact or thirdparty * @param Translate $outputlangs Output language * @param int $includealias 1=Include alias name after name - * @return string + * @return string String with name of thirdparty (+ alias if requested) */ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0) { + global $conf; + // Recipient name $socname = ''; if ($thirdparty instanceof Societe) { $socname .= $thirdparty->name; - if ($includealias && !empty($thirdparty->name_alias)) { + if (($includealias || ! empty($conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME)) && !empty($thirdparty->name_alias)) { $socname .= "\n".$thirdparty->name_alias; } } elseif ($thirdparty instanceof Contact) { @@ -746,7 +748,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default $pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($content), 0, 'C', 0); $pdf->SetXY($curx, $cury + 1); $curx += $tmplength; - $pdf->SetFont('', 'B', $default_font_size - 4); + $pdf->SetFont('', 'B', $default_font_size - $diffsizecontent); $pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities($val), 0, 'C', 0); if (empty($onlynumber)) { $pdf->line($curx, $cury + 1, $curx, $cury + 7); @@ -792,6 +794,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default $pdf->MultiCell(100, 3, $val, 0, 'L', 0); $tmpy=$pdf->getStringHeight(100, $val); $cury+=$tmpy; + $cur+=1; } else if (! $usedetailedbban) $cury+=1; @@ -865,7 +868,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass // Make a change into HTML code to allow to include images from medias directory. // // become - // + // $newfreetext=preg_replace('/()/', '\1'.DOL_DATA_ROOT.'/medias/\2\3', $newfreetext); $line.=$outputlangs->convToOutputCharset($newfreetext); @@ -1068,10 +1071,10 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass // Show page nb only on iso languages (so default Helvetica font) if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') { - $pdf->SetXY(-20,-$posy); + $pdf->SetXY($dims['wk']-$dims['rm']-15, -$posy); //print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit; - if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(13, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0); - else $pdf->MultiCell(13, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0); + if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(15, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0); + else $pdf->MultiCell(15, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0); } return $marginwithfooter; @@ -1467,7 +1470,7 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0) */ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { - global $hookmanager; + global $conf, $hookmanager, $mysoc; $result=''; $reshook=0; @@ -1484,7 +1487,32 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) } if (empty($reshook)) { - if (empty($hidedetails) || $hidedetails > 1) $result.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); + if (empty($hidedetails) || $hidedetails > 1) + { + $tmpresult=''; + + $tmpresult.=vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1); + if (empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) + { + if ($object->lines[$i]->total_localtax1 != 0) + { + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; + else $tmpresult=''; + $tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx),1); + } + } + if (empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) + { + if ($object->lines[$i]->total_localtax2 != 0) + { + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; + else $tmpresult=''; + $tmpresult.=vatrate(abs($object->lines[$i]->localtax2_tx),1); + } + } + + $result.=$tmpresult; + } } return $result; } diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 2fe652f6ac9..0cb1f755450 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -50,8 +50,8 @@ * @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function). * @param integer $progress Situation invoices progress (value from 0 to 100, 100 by default) * @param double $multicurrency_tx Currency rate (1 by default) - * @param double $pu_ht_devise Amount in currency - * @return array [ + * @param double $pu_devise Amount in currency + * @return array [ * 0=total_ht, * 1=total_vat, (main vat only) * 2=total_ttc, (total_ht + main vat + local taxes) @@ -65,15 +65,16 @@ * 10=total_tax2 for total_ht, * 11=pu_tax1 for pu_ht, !! should not be used * 12=pu_tax2 for pu_ht, !! should not be used - * 13=!! should not be used + * 13=?? !! should not be used * 14=total_tax1 for total_ht_without_discount, - * 15=total_tax2 for total_ht_without_discount] + * 15=total_tax2 for total_ht_without_discount, + * * 16=multicurrency_total_ht * 17=multicurrency_total_tva * 18=multicurrency_total_ttc * 19=multicurrency_pu_ht */ -function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array='', $progress=100, $multicurrency_tx=1, $pu_ht_devise=0) +function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array='', $progress=100, $multicurrency_tx=1, $pu_devise=0) { global $conf,$mysoc,$db; @@ -101,10 +102,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt //dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress); $countryid=$seller->country_id; - + if (is_numeric($uselocaltax1_rate)) $uselocaltax1_rate=(float) $uselocaltax1_rate; if (is_numeric($uselocaltax2_rate)) $uselocaltax2_rate=(float) $uselocaltax2_rate; - + if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj; if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj; @@ -143,14 +144,15 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt } else dol_print_error($db); } - + // pu calculation from pu_devise if pu empty - if(empty($pu) && !empty($pu_ht_devise)) { - $pu = $pu_ht_devise / $multicurrency_tx; - } else { - $pu_ht_devise = $pu * $multicurrency_tx; + if(empty($pu) && !empty($pu_devise)) { + $pu = $pu_devise / $multicurrency_tx; } - + if(empty($pu_devise) && !empty($multicurrency_tx)) { + $pu_devise = $pu * $multicurrency_tx; + } + // initialize total (may be HT or TTC depending on price_base_type) $tot_sans_remise = $pu * $qty * $progress / 100; $tot_avec_remise_ligne = $tot_sans_remise * (1 - ($remise_percent_ligne / 100)); @@ -338,13 +340,47 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; } } - + // Multicurrency - $result[16] = price2num($result[0] * $multicurrency_tx, 'MT'); - $result[17] = price2num($result[1] * $multicurrency_tx, 'MT'); - $result[18] = price2num($result[2] * $multicurrency_tx, 'MT'); - $result[19] = price2num($pu_ht_devise, 'MU'); - + if ($multicurrency_tx != 1) + { + // Recal function using the multicurrency price as reference price. We must set param $multicurrency_tx to 1 to avoid infinite loop. + $newresult = calcul_price_total($qty, $pu_devise, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller, $localtaxes_array, $progress, 1, 0); + + $result[16] = $newresult[0]; + $result[17] = $newresult[1]; + $result[18] = $newresult[2]; + $result[19] = $newresult[3]; + $result[20] = $newresult[4]; + $result[21] = $newresult[5]; + $result[22] = $newresult[6]; + $result[23] = $newresult[7]; + $result[24] = $newresult[8]; + $result[25] = $newresult[9]; + $result[26] = $newresult[10]; + /* + $result[16] = price2num($result[0] * $multicurrency_tx, 'MT'); + $result[17] = price2num($result[1] * $multicurrency_tx, 'MT'); + $result[18] = price2num($result[2] * $multicurrency_tx, 'MT'); + $result[19] = price2num($pu_devise, 'MU'); + */ + } + else + { + $result[16] = $result[0]; + $result[17] = $result[1]; + $result[18] = $result[2]; + $result[19] = $result[3]; + $result[20] = $result[4]; + $result[21] = $result[5]; + $result[22] = $result[6]; + $result[23] = $result[7]; + $result[24] = $result[8]; + $result[25] = $result[9]; + $result[26] = $result[10]; + } + + //var_dump($result); // initialize result array //for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i]; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 7048b8570c6..b01637d7b08 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -52,7 +52,7 @@ function product_prepare_head($object) $head[$h][2] = 'price'; $h++; } - + if (! empty($object->status_buy) || (! empty($conf->margin->enabled) && ! empty($object->status))) // If margin is on and product on sell, we may need the cost price even if product os not on purchase { if ((! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) @@ -102,7 +102,7 @@ function product_prepare_head($object) $prodcomb = new ProductCombination($db); - if ($prodcomb->fetchByFkProductChild($object->id) == -1) + if ($prodcomb->fetchByFkProductChild($object->id) == -1) { $head[$h][0] = DOL_URL_ROOT."/variants/combinations.php?id=".$object->id; $head[$h][1] = $langs->trans('ProductCombinations'); @@ -184,7 +184,7 @@ function productlot_prepare_head($object) global $db, $langs, $conf, $user; $langs->load("products"); $langs->load("productbatch"); - + $h = 0; $head = array(); @@ -208,7 +208,7 @@ function productlot_prepare_head($object) $head[$h][2] = 'info'; $h++; */ - + return $head; } @@ -301,9 +301,9 @@ function show_stats_for_company($product,$socid) global $conf,$langs,$user,$db; $nblines = 0; - - print '
    '.$langs->trans("Referers").'
    '.$langs->trans("Referers").''.$langs->trans("NbOfThirdParties").''.$langs->trans("NbOfObjectReferers").''.$langs->trans("TotalQuantity").'
    '; print $fuser->getNomUrl(1, 'withproject', 'time'); print '"; + print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + print "'; @@ -639,6 +657,16 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print $taskstatic->getNomUrl(1,'withproject'); print ''; + $thirdpartystatic->id=$lines[$i]->socid; + $thirdpartystatic->name=$lines[$i]->thirdparty_name; + print $thirdpartystatic->getNomUrl(1, 'project', 10); + print '"; for ($k = 0 ; $k < $level ; $k++) print "   "; @@ -652,21 +680,6 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); print ""; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); - print "'; - $thirdpartystatic->id=$lines[$i]->socid; - $thirdpartystatic->name=$lines[$i]->thirdparty_name; - print $thirdpartystatic->getNomUrl(1, 'project', 10); - print ''; if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); @@ -743,7 +756,13 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr // Warning print ''; if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject")); - else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $langs->transnoentitiesnoconv("AssignTaskToUser", '...'))); + else if ($disabledtask) + { + $titleassigntask = $langs->trans("AssignTaskToMe"); + if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...'); + + print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask)); + } print '
    '; print $fuser->getNomUrl(1, 'withproject', 'time'); print ''; + print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + print "'; + $thirdpartystatic->id=$lines[$i]->thirdparty_id; + $thirdpartystatic->name=$lines[$i]->thirdparty_name; + print $thirdpartystatic->getNomUrl(1, 'project'); + print ''; @@ -860,26 +902,6 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); print "'; - $projectstatic->id=$lines[$i]->fk_project; - $projectstatic->ref=$lines[$i]->projectref; - $projectstatic->title=$lines[$i]->projectlabel; - $projectstatic->public=$lines[$i]->public; - $projectstatic->thirdparty_name=$lines[$i]->thirdparty_name; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); - print "'; - $thirdpartystatic->id=$lines[$i]->thirdparty_id; - $thirdpartystatic->name=$lines[$i]->thirdparty_name; - print $thirdpartystatic->getNomUrl(1, 'project'); - print ''; if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); @@ -957,7 +979,13 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ // Warning print ''; if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject")); - else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $langs->transnoentitiesnoconv("AssignTaskToUser", '...'))); + else if ($disabledtask) + { + $titleassigntask = $langs->trans("AssignTaskToMe"); + if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...'); + + print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask)); + } print '
    '; + $variante = ($periodlink || $exportlink); + // Ligne de titre print ''; print ''; - if (! $variantexxx) print ''; + if ($variante) print ''; print ''; // Calculation mode @@ -77,10 +79,9 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat { print ''; print ''; - if (! $variante) print ''; print ''; print ''; } @@ -88,35 +89,37 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat // Ligne de la periode d'analyse du rapport print ''; print ''; - if (! $periodlink) print ''; print ''; print ''; // Ligne de description print ''; print ''; - print ''; + print ''; + if ($variante) print ''; print ''; // Ligne d'export print ''; print ''; - if (! $exportlink) print ''; + print ''; + if ($variante) print ''; + print ''; print '
    '.$langs->trans("ReportName").''; - else print ''; - print $nom; - if ($variantexxx) print ''.$variantexxx; + print ''; + print $reportname; print '
    '.$langs->trans("CalculationMode").''; - else print ''; + print ''; print $calcmode; - if ($variante) print ''.$variante; + if ($variante) print '
    '.$langs->trans("ReportPeriod").''; - else print ''; + print ''; if ($period) print $period; - if ($periodlink) print ''.$periodlink; + if ($variante) print ''.$periodlink.'
    '.$langs->trans("ReportDescription").''.$description.''.$description.'
    '.$langs->trans("GeneratedOn").''; - else print ''; - print dol_print_date($builddate); - if ($exportlink) print ''.$langs->trans("Export").''.$exportlink; - print '
    '; + print dol_print_date($builddate, 'dayhour'); + print ''.($exportlink ? $langs->trans("Export").': '.$exportlink : '').'
    '; - print '
    '; - print ''; - dol_fiche_end(); - - print "\n\n\n"; + + print '
    '; + + print ''; + print '
    '; + + print "\n\n\n"; } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index d3250263a6f..581c324674a 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -376,7 +376,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh $check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for societe object - $checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...). + $checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet','project'); // Test for project object $checktask = array('projet_task'); $nocheck = array('barcode','stock','fournisseur'); // No test diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 248c3bde43e..3876dc0e2cd 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2008-2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -166,7 +166,7 @@ function dol_loginfunction($langs,$conf,$mysoc) } $conf_css = $themepath."?lang=".$langs->defaultlang; - // Select templates + // Select templates dir if (! empty($conf->modules_parts['tpl'])) // Using this feature slow down application { $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl/')); @@ -189,7 +189,7 @@ function dol_loginfunction($langs,$conf,$mysoc) if (GETPOST('urlfrom','alpha')) $_SESSION["urlfrom"]=GETPOST('urlfrom','alpha'); else unset($_SESSION["urlfrom"]); - if (! GETPOST("username")) $focus_element='username'; + if (! GETPOST("username",'alpha')) $focus_element='username'; else $focus_element='password'; $demologin=''; @@ -201,10 +201,19 @@ function dol_loginfunction($langs,$conf,$mysoc) $demopassword=$tab[1]; } - // Execute hook getLoginPageOptions - // Should be an array with differents options in $hookmanager->resArray + // Execute hook getLoginPageOptions (for table) $parameters=array('entity' => GETPOST('entity','int')); - $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook. + $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. + if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) { + $morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility + } else { + $morelogincontent = $hookmanager->resPrint; + } + + // Execute hook getLoginPageExtraOptions (eg for js) + $parameters=array('entity' => GETPOST('entity','int')); + $reshook = $hookmanager->executeHooks('getLoginPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks. + $moreloginextracontent = $hookmanager->resPrint; // Login $login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin)); diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 4764d1bfb65..6fbfbec3bf6 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier * Copyright (C) 2011 Regis Houssin - * Copyright (C) 2012-2016 Juanjo Menent + * Copyright (C) 2012-2017 Juanjo Menent * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García @@ -181,11 +181,12 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction } /** - * Gets VAT to collect for the given year (and given quarter or month) - * The function gets the VAT in split results, as the VAT declaration asks - * to report the amounts for different VAT rates as different lines. + * Gets Tax to collect for the given year (and given quarter or month) + * The function gets the Tax in split results, as the Tax declaration asks + * to report the amounts for different Tax rates as different lines. * This function also accounts recurrent invoices. * + * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' * @param DoliDB $db Database handler object * @param int $y Year * @param int $q Quarter @@ -196,7 +197,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction * @param int $m Month * @return array List of quarters with vat */ -function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) +function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) { global $conf; @@ -210,8 +211,6 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $fk_facture2='fk_facture'; $fk_payment='fk_paiement'; $total_tva='total_tva'; - $total_localtax1='total_localtax1'; - $total_localtax2='total_localtax2'; $paymenttable='paiement'; $paymentfacturetable='paiement_facture'; $invoicefieldref='facnumber'; @@ -224,13 +223,20 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $fk_facture2='fk_facturefourn'; $fk_payment='fk_paiementfourn'; $total_tva='tva'; - $total_localtax1='total_localtax1'; - $total_localtax2='total_localtax2'; $paymenttable='paiementfourn'; $paymentfacturetable='paiementfourn_facturefourn'; $invoicefieldref='ref'; } + if ( strpos( $type, 'localtax' ) === 0 ) { + $f_rate = $type . '_tx'; + } else { + $f_rate = 'tva_tx'; + } + + $total_localtax1='total_localtax1'; + $total_localtax2='total_localtax2'; + // CAS DES BIENS // Define sql request @@ -238,7 +244,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { // Count on delivery date (use invoice date as delivery is unknown) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,"; @@ -273,7 +279,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, else // Option vat on delivery for goods (payments) and payments for services { // Count on delivery date (use invoice date as delivery is unknown) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef as date_f, s.nom as company_name, s.rowid as company_id,"; @@ -378,7 +384,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { // Count on invoice date - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,"; @@ -413,7 +419,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, else // Option vat on delivery for goods (payments) and payments for services { // Count on payments date - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,"; @@ -522,7 +528,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql=''; // Count on payments date - $sql = "SELECT e.rowid, d.product_type as dtype, e.rowid as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.total_tva as total_vat, e.note_private as descr,"; + $sql = "SELECT e.rowid, d.product_type as dtype, e.rowid as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.total_tva as total_vat, e.note_private as descr,"; $sql .=" d.total_localtax1 as total_localtax1, d.total_localtax2 as total_localtax2, "; $sql.= " e.date_debut as date_start, e.date_fin as date_end,"; $sql.= " e.ref as facnum, e.total_ttc as ftotal_ttc, e.date_create, s.nom as company_name, s.rowid as company_id, d.fk_c_type_fees as type,"; @@ -577,11 +583,11 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, { $oldrowid=$assoc['rowid']; $list[$assoc['rate']]['totalht'] += $assoc['total_ht']; + $list[$assoc['rate']]['vat'] += $assoc['total_vat']; $list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1']; $list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2']; } - $list[$assoc['rate']]['vat'] = $assoc['total_vat']; $list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc']; $list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment'; $list[$assoc['rate']]['datef'][] = $assoc['datef']; @@ -622,3 +628,24 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, return $list; } +/** + * Gets VAT to collect for the given year (and given quarter or month) + * The function gets the VAT in split results, as the VAT declaration asks + * to report the amounts for different VAT rates as different lines. + * This function also accounts recurrent invoices. + * + * @param DoliDB $db Database handler object + * @param int $y Year + * @param int $q Quarter + * @param string $date_start Start date + * @param string $date_end End date + * @param int $modetax 0 or 1 (option vat on debit) + * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) + * @param int $m Month + * @return array List of quarters with vat + */ +function vat_by_date ($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) +{ + return tax_by_date('vat', $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m); +} + diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index db0fcd07fae..6c66079090a 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -110,15 +110,15 @@ function tree_showpad(&$fulltree,$key,$silent=0) * @param int $rang Level of element * @param string $iddivjstree Id to use for parent ul element * @param int $donoresetalreadyloaded Do not reset global array $donoresetalreadyloaded used to avoid to go down on an aleady processed record - * @param int $showfk Show fk links to parent into label + * @param int $showfk 1=show fk_links to parent into label (used by menu editor only) * @return void */ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetalreadyloaded=0, $showfk=0) { global $tree_recur_alreadyadded; - + if ($rang == 0 && empty($donoresetalreadyloaded)) $tree_recur_alreadyadded=array(); - + if ($rang == 0) { // Test also done with jstree and dynatree (not able to have inside label) @@ -138,8 +138,8 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetal print '
      '; } - - if ($rang > 50) + + if ($rang > 50) { return; // Protect against infinite loop. Max 50 depth } @@ -154,29 +154,41 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetal if ($tab[$x]['fk_menu'] != -1 && $tab[$x]['fk_menu'] == $pere['rowid']) { //print 'rang='.$rang.'-x='.$x." rowid=".$tab[$x]['rowid']." tab[x]['fk_leftmenu'] = ".$tab[$x]['fk_leftmenu']." leftmenu pere = ".$pere['leftmenu']."
      \n"; - if (empty($ulprinted) && ! empty($pere['rowid'])) - { + if (empty($ulprinted) && ! empty($pere['rowid'])) + { if (! empty($tree_recur_alreadyadded[$tab[$x]['rowid']])) { dol_syslog('Error, record with id '.$tab[$x]['rowid'].' seems to be a child of record with id '.$pere['rowid'].' but it was already output. Complete field "leftmenu" and "mainmenu" on ALL records to avoid ambiguity.', LOG_WARNING); continue; } - + print ''; $ulprinted++; } print "\n".'
    • '; - print $tab[$x]['entry']; - if ($showfk) print '  (fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; + if ($showfk) + { + print '
      '; + print '   '; + print $tab[$x]['title']; + print '  (fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; + print ''; + print $tab[$x]['buttons']; + print '
      '; + } + else + { + print $tab[$x]['entry']; + } //print ' -> A '.$tab[$x]['rowid'].' mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].'
      '."\n"; $tree_recur_alreadyadded[$tab[$x]['rowid']]=($rang + 1); // And now we search all its sons of lower level - tree_recur($tab,$tab[$x],$rang+1); + tree_recur($tab, $tab[$x], $rang+1, 'iddivjstree', 0, $showfk); print '
    • '; } elseif (! empty($tab[$x]['rowid']) && $tab[$x]['fk_menu'] == -1 && $tab[$x]['fk_mainmenu'] == $pere['mainmenu'] && $tab[$x]['fk_leftmenu'] == $pere['leftmenu']) { //print 'rang='.$rang.'-x='.$x." rowid=".$tab[$x]['rowid']." tab[x]['fk_leftmenu'] = ".$tab[$x]['fk_leftmenu']." leftmenu pere = ".$pere['leftmenu']."
      \n"; - if (empty($ulprinted) && ! empty($pere['rowid'])) + if (empty($ulprinted) && ! empty($pere['rowid'])) { if (! empty($tree_recur_alreadyadded[$tab[$x]['rowid']])) { @@ -184,17 +196,30 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetal //print 'Error, record with id '.$tab[$x]['rowid'].' seems to be a child of record with id '.$pere['rowid'].' but it was already output. Complete field "leftmenu" and "mainmenu" on ALL records to avoid ambiguity.'; continue; } - + print ''; $ulprinted++; } print "\n".'
    • '; - print $tab[$x]['entry']; - if ($showfk) print '  (fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; + if ($showfk) + { + print '
      '; + print '   '; + print $tab[$x]['title']; + print ''; + print '  (mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' - fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; + print ''; + print $tab[$x]['buttons']; + print '
      '; + } + else + { + print $tab[$x]['entry']; + } //print ' -> B '.$tab[$x]['rowid'].' mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].'
      '."\n"; $tree_recur_alreadyadded[$tab[$x]['rowid']]=($rang + 1); // And now we search all its sons of lower level //print 'Call tree_recur for x='.$x.' rowid='.$tab[$x]['rowid']." fk_mainmenu pere = ".$tab[$x]['fk_mainmenu']." fk_leftmenu pere = ".$tab[$x]['fk_leftmenu']."
      \n"; - tree_recur($tab,$tab[$x],$rang+1); + tree_recur($tab, $tab[$x], $rang+1, 'iddivjstree', 0, $showfk); print '
    • '; } } diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index ebbd261984e..122c3a6aa7d 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -27,25 +27,253 @@ * * @param string $content Content string * @return void + * @see dolWebsiteSaveContent */ function dolWebsiteOutput($content) { global $db, $langs, $conf, $user; + global $dolibarr_main_url_root, $dolibarr_main_data_root; - dol_syslog("dolWebsiteOutput start"); - - if (! defined('USEDOLIBARRSERVER')) + dol_syslog("dolWebsiteOutput start (mode=".(defined('USEDOLIBARRSERVER')?'USEDOLIBARRSERVER':'').')'); + + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + // Note: This seems never called when page is output inside the website editor (search 'REPLACEMENT OF LINKS When page called by website editor') + + if (! defined('USEDOLIBARRSERVER')) // REPLACEMENT OF LINKS When page called from virtual host { - // Replace link of Dolibarr medias with direct link for virtual server - - - - - + $symlinktomediaexists=1; + + // Make a change into HTML code to allow to include images from medias directory correct with direct link for virtual server + // + // become + // + $nbrep=0; + if (! $symlinktomediaexists) + { + $content=preg_replace('/()/', '\1'.$urlwithroot.'/viewimage.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep); + $content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1'.$urlwithroot.'/viewimage.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep); + } + else + { + $content=preg_replace('/()/', '\1medias/\4\5', $content, -1, $nbrep); + $content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1medias/\4\5', $content, -1, $nbrep); + } } - + else // REPLACEMENT OF LINKS When page called from dolibarr server + { + global $website; + + // Replace relative link / with dolibarr URL: ...href="/"... + $content=preg_replace('/(href=")\/\"/', '\1'.DOL_URL_ROOT.'/public/websites/index.php?website='.$website->ref.'&pageid='.$website->fk_default_home.'"', $content, -1, $nbrep); + // Replace relative link /xxx.php with dolibarr URL: ...href="....php" + $content=preg_replace('/(href=")\/?([^\"]*)(\.php\")/', '\1'.DOL_URL_ROOT.'/public/websites/index.php?website='.$website->ref.'&pageref=\2"', $content, -1, $nbrep); + + // Fix relative link /document.php with correct URL after the DOL_URL_ROOT: ...href="/document.php?modulepart=" + $content=preg_replace('/(href=")(\/?document\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3"', $content, -1, $nbrep); + // Fix relative link /viewimage.php with correct URL after the DOL_URL_ROOT: ...href="/viewimage.php?modulepart=" + $content=preg_replace('/(href=")(\/?viewimage\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3"', $content, -1, $nbrep); + + // Fix relative link into medias with correct URL after the DOL_URL_ROOT: ../url("medias/ + $content=preg_replace('/url\((["\']?)medias\//', 'url(\1'.DOL_URL_ROOT.'/viewimage.php?modulepart=medias&file=', $content, -1, $nbrep); + } + dol_syslog("dolWebsiteOutput end"); - + print $content; } + +/** + * Convert a page content to have correct links into a new html content. + * Used to ouput the page on the Preview. + * + * @param Website $website Web site object + * @param string $content Content to replace + * @return boolean True if OK + */ +function dolWebsiteReplacementOfLinks($website, $content) +{ + // Replace php code. Note $content may come from database and does not contains body tags. + $content = preg_replace('/<\?php[^\?]+\?>\n*/ims', '...php...', $content); + + // Replace relative link / with dolibarr URL + $content = preg_replace('/(href=")\/\"/', '\1'.DOL_URL_ROOT.'/websites/index.php?website='.$website->ref.'&pageid='.$website->fk_default_home.'"', $content, -1, $nbrep); + // Replace relative link /xxx.php with dolibarr URL + $content = preg_replace('/(href=")\/?([^\"]*)(\.php\")/', '\1'.DOL_URL_ROOT.'/websites/index.php?website='.$website->ref.'&pageref=\2"', $content, -1, $nbrep); + + $content = preg_replace('/url\((["\']?)medias\//', 'url(\1'.DOL_URL_ROOT.'/viewimage.php?modulepart=medias&file=', $content, -1, $nbrep); + + // $MAXLEVEL) + { + print 'ERROR: RECURSIVE CONTENT LEVEL. Depth of recursive call is more than the limit of '.$MAXLEVEL.".\n"; + return; + } + // file_get_contents is not possible. We must execute code with include + //$content = file_get_contents($fullpathfile); + //print preg_replace(array('/^.*]*>/ims','/<\/body>.*$/ims'), array('', ''), $content);*/ + + ob_start(); + $res = include $fullpathfile; // Include because we want to execute code content + $tmpoutput = ob_get_contents(); + ob_end_clean(); + + print "\n".''."\n"; + print preg_replace(array('/^.*]*>/ims','/<\/body>.*$/ims'), array('', ''), $tmpoutput); + + if (! $res) + { + print 'ERROR: FAILED TO INCLUDE PAGE '.$contentfile.".\n"; + } + + $includehtmlcontentopened--; +} + +/** + * Generate a zip with all data of web site. + * + * @param Website $website Object website + * @return void + */ +function exportWebSite($website) +{ + global $db, $conf; + + dol_mkdir($conf->websites->dir_temp); + $srcdir = $conf->websites->dir_output.'/'.$website->ref; + $destdir = $conf->websites->dir_temp.'/'.$website->ref; + + $arrayreplacement=array(); + + dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacement); + + $srcdir = DOL_DATA_ROOT.'/medias/images/'.$website->ref; + $destdir = $conf->websites->dir_temp.'/'.$website->ref.'/medias/images/'.$website->ref; + + dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacement); + + // Build sql file + dol_mkdir($conf->websites->dir_temp.'/'.$website->ref.'/export'); + + $filesql = $conf->websites->dir_temp.'/'.$website->ref.'/export/pages.sql'; + $fp = fopen($filesql,"w"); + + $objectpages = new WebsitePage($db); + $listofpages = $objectpages->fetchAll($website->id); + + // Assign ->newid and ->newfk_page + $i=1; + foreach($listofpages as $pageid => $objectpageold) + { + $objectpageold->newid=$i; + $i++; + } + $i=1; + foreach($listofpages as $pageid => $objectpageold) + { + // Search newid + $newfk_page=0; + foreach($listofpages as $pageid2 => $objectpageold2) + { + if ($pageid2 == $objectpageold->fk_page) + { + $newfk_page = $objectpageold2->newid; + break; + } + } + $objectpageold->newfk_page=$newfk_page; + $i++; + } + foreach($listofpages as $pageid => $objectpageold) + { + $line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, title, description, keyword, status, date_creation, tms, lang, import_key, grabbed_from, content)'; + $line.= " VALUES("; + $line.= $objectpageold->newid."+__MAXROWID__, "; + $line.= ($objectpageold->newfk_page ? $db->escape($objectpageold->newfk_page)."+__MAXROWID__" : "null").", "; + $line.= "__WEBSITE_ID__, "; + $line.= "'".$db->escape($objectpageold->pageurl)."', "; + $line.= "'".$db->escape($objectpageold->title)."', "; + $line.= "'".$db->escape($objectpageold->description)."', "; + $line.= "'".$db->escape($objectpageold->keyword)."', "; + $line.= "'".$db->escape($objectpageold->status)."', "; + $line.= "'".$db->idate($objectpageold->date_creation)."', "; + $line.= "'".$db->idate($objectpageold->date_modification)."', "; + $line.= "'".$db->escape($objectpageold->lang)."', "; + $line.= ($objectpageold->import_key ? "'".$db->escape($objectpageold->import_key)."'" : "null").", "; + $line.= "'".$db->escape($objectpageold->grabbed_from)."', "; + $line.= "'".$db->escape($objectpageold->content)."'"; + $line.= ");"; + $line.= "\n"; + fputs($fp, $line); + } + + fclose($fp); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filesql, octdec($conf->global->MAIN_UMASK)); + + // Build zip file + $filedir = $conf->websites->dir_temp.'/'.$website->ref; + $fileglob = $conf->websites->dir_temp.'/'.$website->ref.'/export/'.$website->ref.'_export_*.zip'; + $filename = $conf->websites->dir_temp.'/'.$website->ref.'/export/'.$website->ref.'_export_'.dol_print_date(dol_now(),'dayhourlog').'.zip'; + + dol_delete_file($fileglob, 0); + dol_compress_file($filedir, $filename, 'zip'); + + return $filename; +} + diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 76d58132caf..47ec0741127 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -12,10 +12,11 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|don|tax|salaries|loan', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read', '', 2, 50, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'Accountancy', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 2, 51, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('mailing|export|import|opensurvey|resource', '$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled || $conf->resource->enabled', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read || $user->rights->resource->read', '', 2, 90, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 110, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__); @@ -163,53 +164,56 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1501__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/card.php?action=create&leftmenu=ficheinter', 'NewIntervention', 1, 'interventions', '$user->rights->ficheinter->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1502__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/list.php?leftmenu=ficheinter', 'List', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1503__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/stats/index.php?leftmenu=ficheinter', 'Statistics', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 2, __ENTITY__); --- Accountancy - Supplier invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'accountancy', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?leftmenu=suppliers_bills', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'accountancy', '', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?leftmenu=suppliers_bills', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); --- Accountancy - Customer invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); +-- Billing - Supplier invoice +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?leftmenu=suppliers_bills', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', '', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?leftmenu=suppliers_bills', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); +-- Billing - Customer invoice +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'accountancy', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'accountancy', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'accountancy', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'accountancy', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'accountancy', '', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?leftmenu=customers_bills', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); --- Accountancy - Orders to bill -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'accountancy', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?leftmenu=orders&viewstatut=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', '', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?leftmenu=customers_bills', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); +-- Billing - Orders to bill +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?leftmenu=orders&viewstatut=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); -- Donations -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'accountancy', 'donations', 6__+MAX_llx_menu__, '/don/index.php?leftmenu=donations&mainmenu=accountancy', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/card.php?leftmenu=donations&mainmenu=accountancy&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&mainmenu=accountancy', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); --- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=accountancy', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?leftmenu=donations&mainmenu=billing', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?leftmenu=donations&mainmenu=billing&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&mainmenu=billing', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); +-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=billing', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'accountancy', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read)', '', 0, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'accountancy', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'accountancy', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'accountancy', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'accountancy', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'accountancy', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'accountancy', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->payment->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->payment->write', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->payment->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/index.php?leftmenu=tax_vat&mainmenu=billing', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 2200__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=billing', 'MenuVariousPayment', 1, 'banks', '$user->rights->banque->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/bank/various_payment/card.php?leftmenu=tax_various&action=create', 'MenuNewVariousPayment', 2, 'various_payment', '$user->rights->banque->modifier', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various', 'List', 2, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); -- Accounting Expert -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/index.php?leftmenu=accountancy', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?leftmenu=accountancy', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); -- Setup insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 1, __ENTITY__); @@ -218,47 +222,52 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 30, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 80, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 90, __ENTITY__); + + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 52, __ENTITY__); + + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 80, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 90, __ENTITY__); -- Accounting period insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); -- Binding - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 4, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'ventil_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?leftmenu=dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'ventil_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?leftmenu=dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 4, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); -- Journals - -- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'journal', 2400__+MAX_llx_menu__, '/accountancy/journal/index.php?leftmenu=journal', 'Journaux', 1, 'accountancy', '$user->rights->accounting->comptarapport->lire', '', 0, 7, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6', 'ExpenseReportJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 2, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2709__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2', 'PurchasesJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 3, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1', 'SellsJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 4, __ENTITY__); -- General Ledger - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__); -- Balance - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__); -- Reports - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'report', 2400__+MAX_llx_menu__, '/accountancy/report/result.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/accountancy/report/result.php?leftmenu=ca', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ByExpenseIncome', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__); --- Rapports compta simple -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2702__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'MenuReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__); +-- Accounting simple +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'MenuReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2712__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2713__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2714__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2715__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2716__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -- Check deposit insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank', 'MenuChequeDeposits', 0, 'bills', '$user->rights->banque->lire', '', 2, 9, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->rights->banque->lire', '', 2, 0, __ENTITY__); @@ -286,20 +295,21 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -- Project - Categories -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3200__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); -- Tools -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3902__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/list.php?leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'email_templates', 8__+MAX_llx_menu__, '/admin/mails_templates.php?leftmenu=email_templates', 'EMailTemplates', 0, '', '', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3910__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3911__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3912__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/list.php?leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->export->enabled', __HANDLER__, 'left', 4100__+MAX_llx_menu__, 'tools', 'export', 8__+MAX_llx_menu__, '/exports/index.php?leftmenu=export', 'FormatedExport', 0, 'exports', '$user->rights->export->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->export->enabled', __HANDLER__, 'left', 4101__+MAX_llx_menu__, 'tools', '', 4100__+MAX_llx_menu__, '/exports/export.php?leftmenu=export', 'NewExport', 1, 'exports', '$user->rights->export->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->import->enabled', __HANDLER__, 'left', 4130__+MAX_llx_menu__, 'tools', 'import', 8__+MAX_llx_menu__, '/imports/index.php?leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->run', '', 2, 2, __ENTITY__); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index b51d303765b..5fc0ab2c516 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -62,10 +62,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m $classname = 'class="tmenu menuhider"'; $idsel='menu'; - if (empty($noout)) print_start_menu_entry_auguria($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry_auguria('', 1, '#', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry_auguria($showmode); - $menu->add('#', '', 0, $showmode, $atarget, "xxx", ''); + $menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); } $num = count($newTabMenu); @@ -84,10 +81,10 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m $url = $shorturl = $tmp[0]; $param = (isset($tmp[1])?$tmp[1]:''); - // Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined. + // Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined. if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($newTabMenu[$i]['url'])) { - $param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['url'].'&leftmenu='; + $param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; } if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($newTabMenu[$i]['url'])) { @@ -95,7 +92,10 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m } //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad $url = dol_buildpath($url,1).($param?'?'.$param:''); - $shorturl = $shorturl.($param?'?'.$param:''); + //$shorturl = $shorturl.($param?'?'.$param:''); + $shorturl = $url; + + if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/','',$shorturl); } $url=preg_replace('/__LOGIN__/',$user->login,$url); @@ -118,10 +118,18 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m } else if ($showmode == 2) $classname='class="tmenu"'; - if (empty($noout)) print_start_menu_entry_auguria($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry_auguria($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget)); - if (empty($noout)) print_end_menu_entry_auguria($showmode); - $menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), ''); + $menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), ($newTabMenu[$i]['leftmenu']?$newTabMenu[$i]['leftmenu']:''), $newTabMenu[$i]['position'], $id, $idsel, $classname); + } + + // Sort on position + $menu->liste = dol_sort_array($menu->liste, 'position'); + + // Output menu entries + foreach($menu->liste as $menkey => $menuval) + { + if (empty($noout)) print_start_menu_entry_auguria($menuval['idsel'],$menuval['classname'],$menuval['enabled']); + if (empty($noout)) print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url']!='#'?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget)); + if (empty($noout)) print_end_menu_entry_auguria($menuval['enabled']); } $showmode=1; @@ -293,6 +301,16 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM print "\n"; } + if (is_array($moredata) && ! empty($moredata['bookmarks'])) + { + print "\n"; + print "\n"; + print '
      '."\n"; + print $moredata['bookmarks']; + print '
      '."\n"; + print "\n"; + } + // We update newmenu with entries found into database $menuArbo = new Menubase($db,'auguria'); $newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu); @@ -333,13 +351,14 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('',$langs->trans("Journalization"),0,$user->rights->accounting->comptarapport->lire,'','accountancy','accountancy'); + $newmenu->add('',$langs->trans("Journalization"),0,$user->rights->accounting->comptarapport->lire,'','accountancy','accountancy'); // Multi journal $sql = "SELECT rowid, code, label, nature"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " WHERE entity = ".$conf->entity; - $sql.= " ORDER BY label"; + $sql.= " AND active = 1"; + $sql.= " ORDER BY label DESC"; $resql = $db->query($sql); if ($resql) @@ -354,16 +373,17 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $objp = $db->fetch_object($resql); $nature=''; + // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2) $nature="sells"; - if ($objp->nature == 3) $nature="purchases"; - if ($objp->nature == 4) $nature="bank"; - if ($objp->nature == 5) $nature="expensereports"; + if ($objp->nature == 2 && ! empty($conf->facture->enabled)) $nature="sells"; + if ($objp->nature == 3 && ! empty($conf->fournisseur->enabled)) $nature="purchases"; + if ($objp->nature == 4 && ! empty($conf->banque->enabled)) $nature="bank"; + if ($objp->nature == 5 && ! empty($conf->expensereport->enabled)) $nature="expensereports"; if ($objp->nature == 1) $nature="various"; if ($objp->nature == 9) $nature="hasnew"; // To enable when page exists - if (empty($conf->global->MAIN_FEATURES_LEVEL)) + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($nature == 'various' || $nature == 'hasnew') $nature=''; } @@ -556,16 +576,6 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM if ($altok) print '
      '; // End menu block } - if (is_array($moredata) && ! empty($moredata['bookmarks'])) - { - print "\n"; - print "\n"; - print '
      '."\n"; - print $moredata['bookmarks']; - print '
      '."\n"; - print "\n"; - } - return count($menu_array); } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index cd53f913780..26047336644 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -60,10 +60,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $classname = 'class="tmenu menuhider"'; $idsel='menu'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry('', 1, '#', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('#', '', 0, $showmode, $atarget, "xxx", ''); + $menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); } // Home @@ -73,10 +70,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='home'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("Home"), 1, DOL_URL_ROOT.'/index.php?mainmenu=home&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/index.php?mainmenu=home&leftmenu=home', $langs->trans("Home"), 0, $showmode, $atarget, "home", ''); + $menu->add('/index.php?mainmenu=home&leftmenu=home', $langs->trans("Home"), 0, $showmode, $atarget, "home", '', 10, $id, $idsel, $classname); // Third parties $tmpentry=array('enabled'=>(( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)), 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)), 'module'=>'societe|fournisseur'); @@ -91,10 +85,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='companies'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("ThirdParties"), $showmode, DOL_URL_ROOT.'/societe/index.php?mainmenu=companies&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/societe/index.php?mainmenu=companies&leftmenu=', $langs->trans("ThirdParties"), 0, $showmode, $atarget, "companies", ''); + $menu->add('/societe/index.php?mainmenu=companies&leftmenu=', $langs->trans("ThirdParties"), 0, $showmode, $atarget, "companies", '', 20, $id, $idsel, $classname); } // Products-Services @@ -120,10 +111,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $chaine.=$langs->trans("TMenuServices"); } - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/product/index.php?mainmenu=products&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/product/index.php?mainmenu=products&leftmenu=', $chaine, 0, $showmode, $atarget, "products", ''); + $menu->add('/product/index.php?mainmenu=products&leftmenu=', $chaine, 0, $showmode, $atarget, "products", '', 30, $id, $idsel, $classname); } // Commercial @@ -147,26 +135,43 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='commercial'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("Commercial"), $showmode, DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/comm/index.php?mainmenu=commercial&leftmenu=', $langs->trans("Commercial"), 0, $showmode, $atarget, "commercial", ""); + $menu->add('/comm/index.php?mainmenu=commercial&leftmenu=', $langs->trans("Commercial"), 0, $showmode, $atarget, "commercial", "", 40, $id, $idsel, $classname); } - // Financial + // Billing - Financial $menuqualified=0; - if (! empty($conf->comptabilite->enabled)) $menuqualified++; - if (! empty($conf->accounting->enabled)) $menuqualified++; if (! empty($conf->facture->enabled)) $menuqualified++; if (! empty($conf->don->enabled)) $menuqualified++; if (! empty($conf->tax->enabled)) $menuqualified++; if (! empty($conf->salaries->enabled)) $menuqualified++; if (! empty($conf->supplier_invoice->enabled)) $menuqualified++; if (! empty($conf->loan->enabled)) $menuqualified++; + if (! empty($conf->banque->enabled)) $menuqualified++; $tmpentry=array( 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), - 'module'=>'comptabilite|accounting|facture|supplier_invoice|don|tax|salaries|loan'); + 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read) || ! empty($user->rights->banque->lire)), + 'module'=>'facture|supplier_invoice|don|tax|salaries|loan|banque'); + $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); + if ($showmode) + { + $langs->load("compta"); + + $classname=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "billing") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } + else $classname = 'class="tmenu"'; + $idsel='billing'; + + $menu->add('/compta/index.php?mainmenu=billing&leftmenu=', $langs->trans("MenuFinancial"), 0, $showmode, $atarget, "billing", '', 50, $id, $idsel, $classname); + } + + // Accounting + $menuqualified=0; + if (! empty($conf->comptabilite->enabled)) $menuqualified++; + if (! empty($conf->accounting->enabled)) $menuqualified++; + $tmpentry=array( + 'enabled'=>$menuqualified, + 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire)), + 'module'=>'comptabilite|accounting'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -177,12 +182,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='accountancy'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("MenuFinancial"), $showmode, DOL_URL_ROOT.'/compta/index.php?mainmenu=accountancy&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/compta/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("MenuFinancial"), 0, $showmode, $atarget, "accountancy", ''); + $menu->add('/accountancy/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("Accountancy"), 0, $showmode, $atarget, "accountancy", '', 50, $id, $idsel, $classname); } + // Bank $tmpentry=array('enabled'=>(! empty($conf->banque->enabled) || ! empty($conf->prelevement->enabled)), 'perms'=>(! empty($user->rights->banque->lire) || ! empty($user->rights->prelevement->lire)), @@ -198,10 +201,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='bank'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("MenuBankCash"), $showmode, DOL_URL_ROOT.'/compta/bank/index.php?mainmenu=bank&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/compta/bank/index.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", ''); + $menu->add('/compta/bank/index.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", '', 60, $id, $idsel, $classname); } // Projects @@ -218,10 +218,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='project'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("Projects"), $showmode, DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/projet/index.php?mainmenu=project&leftmenu=', $langs->trans("Projects"), 0, $showmode, $atarget, "project", ''); + $menu->add('/projet/index.php?mainmenu=project&leftmenu=', $langs->trans("Projects"), 0, $showmode, $atarget, "project", '', 70, $id, $idsel, $classname); } // HRM @@ -238,18 +235,16 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='hrm'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("HRM"), $showmode, DOL_URL_ROOT.'/hrm/index.php?mainmenu=hrm&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/hrm/index.php?mainmenu=hrm&leftmenu=', $langs->trans("HRM"), 0, $showmode, $atarget, "hrm", ''); + $menu->add('/hrm/index.php?mainmenu=hrm&leftmenu=', $langs->trans("HRM"), 0, $showmode, $atarget, "hrm", '', 80, $id, $idsel, $classname); } // Tools - $tmpentry=array('enabled'=>(! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS) || ! empty($conf->barcode->enabled) || ! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled) || ! empty($conf->opensurvey->enabled) || ! empty($conf->resource->enabled)), - 'perms'=>(! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS) || ! empty($conf->barcode->enabled) || ! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run) || ! empty($user->rights->opensurvey->read) || ! empty($user->rights->resource->read)), - 'module'=>'mailing|export|import|opensurvey|resource'); + $tmpentry=array( + 'enabled'=>1, + 'perms'=>1, + 'module'=>''); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -260,10 +255,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='tools'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("TMenuTools"), $showmode, DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/core/tools.php?mainmenu=tools&leftmenu=', $langs->trans("Tools"), 0, $showmode, $atarget, "tools", ''); + $menu->add('/core/tools.php?mainmenu=tools&leftmenu=', $langs->trans("Tools"), 0, $showmode, $atarget, "tools", '', 90, $id, $idsel, $classname); } // Members @@ -278,10 +270,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='members'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("MenuMembers"), $showmode, DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/adherents/index.php?mainmenu=members&leftmenu=', $langs->trans("MenuMembers"), 0, $showmode, $atarget, "members", ''); + $menu->add('/adherents/index.php?mainmenu=members&leftmenu=', $langs->trans("MenuMembers"), 0, $showmode, $atarget, "members", '', 100, $id, $idsel, $classname); } @@ -297,6 +286,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $showmode=dol_eldy_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal); if ($showmode == 1) { + // url = url from host, shorturl = relative path into dolibarr sources $url = $shorturl = $newTabMenu[$i]['url']; if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) { @@ -307,7 +297,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! preg_match('/mainmenu/i',$param) || ! preg_match('/leftmenu/i',$param)) $param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad $url = dol_buildpath($url,1).($param?'?'.$param:''); - $shorturl = $shorturl.($param?'?'.$param:''); + //$shorturl = $shorturl.($param?'?'.$param:''); + $shorturl = $url; + if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/','',$shorturl); } $url=preg_replace('/__LOGIN__/',$user->login,$url); $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl); @@ -321,10 +313,18 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode } else if ($showmode == 2) $classname='class="tmenu"'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget)); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), ''); + $menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), ($newTabMenu[$i]['leftmenu']?$newTabMenu[$i]['leftmenu']:''), $newTabMenu[$i]['position'], $id, $idsel, $classname); + } + + // Sort on position + $menu->liste = dol_sort_array($menu->liste, 'position'); + + // Output menu entries + foreach($menu->liste as $menkey => $menuval) + { + if (empty($noout)) print_start_menu_entry($menuval['idsel'],$menuval['classname'],$menuval['enabled']); + if (empty($noout)) print_text_menu_entry($menuval['titre'], $menuval['enabled'], ($menuval['url']!='#'?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget)); + if (empty($noout)) print_end_menu_entry($menuval['enabled']); } $showmode=1; @@ -792,7 +792,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu /* * Menu COMPTA-FINANCIAL */ - if ($mainmenu == 'accountancy') + if ($mainmenu == 'billing') { $langs->load("companies"); @@ -829,8 +829,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("bills"); $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); - $newmenu->add("/fourn/facture/card.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer); - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"),1,$user->rights->fournisseur->facture->lire, 'suppliers_bills_list'); + $newmenu->add("/fourn/facture/card.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create'); + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"),1,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft'); @@ -869,19 +869,19 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->don->enabled)) { $langs->load("donations"); - $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=accountancy",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); + $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); if ($usemenuhider || empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/card.php?leftmenu=donations&action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer); if ($usemenuhider || empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/list.php?leftmenu=donations",$langs->trans("List"), 1, $user->rights->don->lire); // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); } // Taxes and social contributions - if (! empty($conf->tax->enabled) || ! empty($conf->salaries->enabled) || ! empty($conf->loan->enabled)) + if (! empty($conf->tax->enabled) || ! empty($conf->salaries->enabled) || ! empty($conf->loan->enabled) || ! empty($conf->banque->enabled)) { global $mysoc; - $permtoshowmenu=((! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read)); - $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy",$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); + $permtoshowmenu=((! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)); + $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing",$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); // Social contributions if (! empty($conf->tax->enabled)) @@ -889,11 +889,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); // VAT if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { - $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); + $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=billing",$langs->transcountry("VAT", $mysoc->country_code),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); @@ -904,7 +904,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu //Local Taxes 1 if($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj=="1")) { - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&mainmenu=accountancy&localTaxType=1",$langs->transcountry("LT1",$mysoc->country_code),1,$user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1",$langs->transcountry("LT1",$mysoc->country_code),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/reglement.php?leftmenu=tax_1_vat&localTaxType=1",$langs->trans("Payments"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); @@ -913,7 +913,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu //Local Taxes 2 if($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj=="1")) { - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&mainmenu=accountancy&localTaxType=2",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/reglement.php?leftmenu=tax_2_vat&localTaxType=2",$langs->trans("Payments"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); @@ -926,21 +926,38 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary'); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); + $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->payment->read, '', $mainmenu, 'tax_salary'); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->payment->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->payment->read); } // Loan if (! empty($conf->loan->enabled)) { $langs->load("loan"); - $newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); + $newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write); //if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); if (($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) && ! empty($conf->global->LOAN_SHOW_CALCULATOR)) $newmenu->add("/loan/calc.php?leftmenu=tax_loan",$langs->trans("Calculator"),2,$user->rights->loan->calc); } + + // Various payment + if (! empty($conf->banque->enabled)) + { + $langs->load("banks"); + $newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various'); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create",$langs->trans("MenuNewVariousPayment"), 2, $user->rights->banque->modifier); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) $newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various",$langs->trans("List"),2,$user->rights->banque->lire); + } } + } + + /* + * Menu COMPTA-FINANCIAL + */ + if ($mainmenu == 'accountancy') + { + $langs->load("companies"); // Accounting Expert if (! empty($conf->accounting->enabled)) @@ -951,12 +968,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/accountancy/index.php?leftmenu=accountancy",$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Chart of account - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 10); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 20); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 30); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 31); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 40); + if (! empty($conf->banque->enabled)) + { + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 42); + } if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); @@ -987,20 +1008,22 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // Binding - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); - + if (! empty($conf->facture->enabled)) + { + $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + } if (! empty($conf->supplier_invoice->enabled)) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); + $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); } if (! empty($conf->expensereport->enabled)) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); + $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); } @@ -1008,13 +1031,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Journals if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('',$langs->trans("Journalization"),1,$user->rights->accounting->comptarapport->lire); + $newmenu->add('',$langs->trans("Journalization"),1,$user->rights->accounting->comptarapport->lire); // Multi journal $sql = "SELECT rowid, code, label, nature"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " WHERE entity = ".$conf->entity; - $sql.= " ORDER BY label"; + $sql.= " AND active = 1"; + $sql.= " ORDER BY label DESC"; $resql = $db->query($sql); if ($resql) @@ -1029,23 +1053,24 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $objp = $db->fetch_object($resql); $nature=''; + // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2) $nature="sells"; - if ($objp->nature == 3) $nature="purchases"; - if ($objp->nature == 4) $nature="bank"; - if ($objp->nature == 5) $nature="expensereports"; + if ($objp->nature == 2 && ! empty($conf->facture->enabled)) $nature="sells"; + if ($objp->nature == 3 && ! empty($conf->fournisseur->enabled)) $nature="purchases"; + if ($objp->nature == 4 && ! empty($conf->banque->enabled)) $nature="bank"; + if ($objp->nature == 5 && ! empty($conf->expensereport->enabled)) $nature="expensereports"; if ($objp->nature == 1) $nature="various"; if ($objp->nature == 9) $nature="hasnew"; // To enable when page exists - if (empty($conf->global->MAIN_FEATURES_LEVEL)) + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($nature == 'various' || $nature == 'hasnew') $nature=''; } if ($nature) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid,dol_trunc($objp->label,25),2,$user->rights->accounting->comptarapport->lire); + $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, dol_trunc($objp->label,25), 2, $user->rights->accounting->comptarapport->lire); } $i++; } @@ -1091,19 +1116,19 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // General Ledger - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_generalledger",$langs->trans("Bookkeeping"),1,$user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_generalledger",$langs->trans("Bookkeeping"),1,$user->rights->accounting->mouvements->lire); // Balance - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance",$langs->trans("AccountBalance"),1,$user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance",$langs->trans("AccountBalance"),1,$user->rights->accounting->mouvements->lire); // Reports $langs->load("compta"); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); + $newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ByExpenseIncome"),3,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("MenuReportInOut"),2,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByPredefinedAccountGroups"),3,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByPersonalizedAccountGroups"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report",$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report",$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire); @@ -1118,7 +1143,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Bilan, resultats $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy",$langs->trans("Reportings"),0,$user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=report",$langs->trans("ReportInOut"),1,$user->rights->compta->resultat->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=report",$langs->trans("MenuReportInOut"),1,$user->rights->compta->resultat->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire); /* On verra ca avec module compabilite expert if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); @@ -1139,8 +1164,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Journaux //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report",$langs->trans("SellsJournal"),1,$user->rights->compta->resultat->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report",$langs->trans("PurchasesJournal"),1,$user->rights->compta->resultat->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report",$langs->trans("SellsJournal"),1,$user->rights->compta->resultat->lire, '', '', '', 50); + if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report",$langs->trans("PurchasesJournal"),1,$user->rights->compta->resultat->lire, '', '', '', 51); } } @@ -1402,10 +1427,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu */ if ($mainmenu == 'tools') { + $langs->load("mails"); + $newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates'); + if (! empty($conf->mailing->enabled)) { - $langs->load("mails"); - $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing'); $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); @@ -1446,8 +1472,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate",$langs->trans("MenuMembersNotUpToDate"),2,$user->rights->adherent->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=0",$langs->trans("MenuMembersResiliated"),2,$user->rights->adherent->lire); $newmenu->add("/adherents/stats/index.php?leftmenu=members",$langs->trans("MenuMembersStats"),1,$user->rights->adherent->lire); - if (! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export); + if (! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu=='none' || $leftmenu=="members" || $leftmenu=="export")) $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export); + $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export); $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members",$langs->trans("Subscriptions"),0,$user->rights->adherent->cotisation->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members",$langs->trans("NewSubscription"),1,$user->rights->adherent->cotisation->creer); @@ -1605,7 +1631,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $url = $shorturl = $tmp[0]; $param = (isset($tmp[1])?$tmp[1]:''); // params in url of the menu link - // Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined. + // Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined. if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($menu_array[$i]['mainmenu'])) { $param.=($param?'&':'').'mainmenu='.$menu_array[$i]['mainmenu'].'&leftmenu='; diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index e4424712625..dafc0486145 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -76,39 +76,47 @@ class MenuManager $res='ErrorBadParameterForMode'; $noout=0; - if ($mode == 'jmobile') $noout=1; + //if ($mode == 'jmobile') $noout=1; if ($mode == 'topnb') { return 1; } - if ($mode == 'top' || $mode == 'jmobile') + if ($mode == 'top') { if (empty($noout)) print_start_menu_array_empty(); - // Home - $showmode=1; - $idsel='home'; - $classname='class="tmenusel"'; + $usemenuhider = (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)); // Show/Hide vertical menu - if ($mode != 'jmobile' && $mode != 'topnb' && (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $showmode=1; $classname = 'class="tmenu menuhider"'; $idsel='menu'; - if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry('', 1, '#', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('#', '', 0, $showmode, $atarget, "xxx", ''); + $this->menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); } - if (empty($noout)) print_start_menu_entry_empty($idsel, $classname, $showmode); - if (empty($noout)) print_text_menu_entry_empty($langs->trans("Home"), 1, dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu=', $id, $idsel, $classname, $this->atarget); - if (empty($noout)) print_end_menu_entry_empty($showmode); - $this->menu->add(dol_buildpath('/index.php',1), $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', ''); + // Home + $showmode=1; + $classname='class="tmenusel"'; + $idsel='home'; + + $this->menu->add('/index.php', $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', '', 10, $id, $idsel, $classname); + + + // Sort on position + $this->menu->liste = dol_sort_array($this->menu->liste, 'position'); + + // Output menu entries + foreach($this->menu->liste as $menkey => $menuval) + { + if (empty($noout)) print_start_menu_entry_empty($menuval['idsel'],$menuval['classname'],$menuval['enabled']); + if (empty($noout)) print_text_menu_entry_empty($menuval['titre'], $menuval['enabled'], ($menuval['url']!='#'?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget)); + if (empty($noout)) print_end_menu_entry_empty($menuval['enabled']); + } $showmode=1; if (empty($noout)) print_start_menu_entry_empty('','class="tmenuend"',$showmode); @@ -123,7 +131,195 @@ class MenuManager } } - if ($mode == 'left' || $mode == 'jmobile') + if ($mode == 'jmobile') // Used to get menu in xml ul/li + { + // Home + $showmode=1; + $classname='class="tmenusel"'; + $idsel='home'; + + $this->menu->add('/index.php', $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', '', 10, $id, $idsel, $classname); + + + // $this->menu->liste is top menu + //var_dump($this->menu->liste);exit; + $lastlevel = array(); + print ''."\n"; + foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' + { + print '
      '."\n"; + } + } + + if ($mode == 'left') { // Put here left menu entries // ***** START ***** @@ -134,8 +330,10 @@ class MenuManager $this->menu->add("/admin/modules.php", $langs->trans("Modules"),1); $this->menu->add("/admin/menus.php", $langs->trans("Menus"),1); $this->menu->add("/admin/ihm.php", $langs->trans("GUISetup"),1); - $this->menu->add("/admin/fiscalyear.php", $langs->trans("Fiscalyear"),1); - $this->menu->add("/admin/boxes.php", $langs->trans("Boxes"),1); + $this->menu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"),1); + $this->menu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"),1); + + $this->menu->add("/admin/boxes.php", $langs->trans("Boxes"),1); $this->menu->add("/admin/delais.php",$langs->trans("Alerts"),1); $this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"),1); $this->menu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"),1); @@ -143,7 +341,6 @@ class MenuManager $this->menu->add("/admin/mails.php?mainmenu=home", $langs->trans("Emails"),1); $this->menu->add("/admin/sms.php?mainmenu=home", $langs->trans("SMS"),1); $this->menu->add("/admin/dict.php?mainmenu=home", $langs->trans("DictionarySetup"),1); - if (! empty($conf->accounting->enabled)) $this->menu->add("/accountancy/admin/account.php", $langs->trans("Chartofaccounts"),1); $this->menu->add("/admin/const.php?mainmenu=home", $langs->trans("OtherSetup"),1); // ***** END ***** @@ -170,15 +367,15 @@ class MenuManager $lastopened = 1; // For menu manager "empty", we force to not have blockvmenulast defined if (($alt%2==0)) { - print '
      '."\n"; + print '
      '."\n"; } else { - print '
      '."\n"; + print '
      '."\n"; } } - // Place tabulation + // Add tabulation $tabstring=''; $tabul=($this->menu->liste[$i]['level'] - 1); if ($tabul > 0) @@ -243,10 +440,10 @@ class MenuManager unset($this->menu->liste); } } - +/* if ($mode == 'jmobile') { - foreach($this->topmenu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' + foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' { print '
        '; print '
      • '; @@ -296,7 +493,7 @@ class MenuManager break; // Only first menu entry (so home) } } - +*/ unset($this->menu); return $res; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 37e72024e2a..bdf8effe23c 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -363,10 +363,6 @@ class DolibarrModules // Can not be abstract, because we need to insta - - - - /** * Constructor. Define names, constants, directories, boxes, permissions * @@ -381,6 +377,7 @@ class DolibarrModules // Can not be abstract, because we need to insta // a try catch on Fatal error to manage this correctly. // We need constructor into function unActivateModule into admin.lib.php + /** * Enables a module. * Inserts all informations into database @@ -617,7 +614,7 @@ class DolibarrModules // Can not be abstract, because we need to insta * Gives the long description of a module. First check README-la_LA.md then README.md * If not markdown files found, it return translated value of the key ->descriptionlong. * - * @return string Long description of a module + * @return string Long description of a module from README.md of from property. */ function getDescLong() { @@ -627,32 +624,21 @@ class DolibarrModules // Can not be abstract, because we need to insta include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - $filefound= false; + $pathoffile = $this->getDescLongReadmeFound(); - // Define path to file README.md. - // First check README-la_LA.md then README.md - $pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$langs->defaultlang.'.md', 0); - if (dol_is_file($pathoffile)) - { - $filefound = true; - } - if (! $filefound) - { - $pathoffile = dol_buildpath(strtolower($this->name).'/README.md', 0); - if (dol_is_file($pathoffile)) - { - $filefound = true; - } - } - - if ($filefound) // Mostly for external modules + if ($pathoffile) // Mostly for external modules { $content = file_get_contents($pathoffile); if ((float) DOL_VERSION >= 6.0) { @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; - $content = dolMd2Html($content, 'parsedown', array('doc/'=>dol_buildpath('cabinetmed/doc/', 1))); + $content = dolMd2Html($content, 'parsedown', + array( + 'doc/'=>dol_buildpath(strtolower($this->name).'/doc/', 1), + 'img/'=>dol_buildpath(strtolower($this->name).'/img/', 1), + 'images/'=>dol_buildpath(strtolower($this->name).'/imgages/', 1), + )); } else { @@ -678,6 +664,84 @@ class DolibarrModules // Can not be abstract, because we need to insta return $content; } + /** + * Return path of file if a README file was found. + * + * @return string Path of file if a README file was found. + */ + function getDescLongReadmeFound() + { + $filefound= false; + + // Define path to file README.md. + // First check README-la_LA.md then README.md + $pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$langs->defaultlang.'.md', 0); + if (dol_is_file($pathoffile)) + { + $filefound = true; + } + if (! $filefound) + { + $pathoffile = dol_buildpath(strtolower($this->name).'/README.md', 0); + if (dol_is_file($pathoffile)) + { + $filefound = true; + } + } + + return ($filefound?$pathoffile:''); + } + + + /** + * Gives the changelog. First check ChangeLog-la_LA.md then ChangeLog.md + * + * @return string Content of ChangeLog + */ + function getChangeLog() + { + global $langs; + $langs->load("admin"); + + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + + $filefound= false; + + // Define path to file README.md. + // First check README-la_LA.md then README.md + $pathoffile = dol_buildpath(strtolower($this->name).'/ChangeLog-'.$langs->defaultlang.'.md', 0); + if (dol_is_file($pathoffile)) + { + $filefound = true; + } + if (! $filefound) + { + $pathoffile = dol_buildpath(strtolower($this->name).'/ChangeLog.md', 0); + if (dol_is_file($pathoffile)) + { + $filefound = true; + } + } + + if ($filefound) // Mostly for external modules + { + $content = file_get_contents($pathoffile); + + if ((float) DOL_VERSION >= 6.0) + { + @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; + $content = dolMd2Html($content, 'parsedown', array('doc/'=>dol_buildpath(strtolower($this->name).'/doc/', 1))); + } + else + { + $content = nl2br($content); + } + } + + return $content; + } + /** * Gives the publisher name * @@ -1362,7 +1426,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE ".$this->db->decrypt('name')." like '".$this->const_name."_TABS_%'"; + $sql.= " WHERE ".$this->db->decrypt('name')." like '".$this->db->escape($this->const_name)."_TABS_%'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_tabs", LOG_DEBUG); @@ -1380,55 +1444,66 @@ class DolibarrModules // Can not be abstract, because we need to insta * * @return int Error count (0 if ok) */ - function insert_tabs() - { - global $conf; + function insert_tabs() + { + global $conf; - $err=0; + $err=0; - if (! empty($this->tabs)) - { - $i=0; - foreach ($this->tabs as $key => $value) - { - if (is_array($value) && count($value) == 0) continue; // Discard empty arrays + if (! empty($this->tabs)) + { + $i=0; + foreach ($this->tabs as $key => $value) + { + if (is_array($value) && count($value) == 0) continue; // Discard empty arrays - $entity=$conf->entity; - $newvalue = $value; + $entity=$conf->entity; + $newvalue = $value; - if (is_array($value)) - { - $newvalue = $value['data']; - if (isset($value['entity'])) $entity = $value['entity']; - } + if (is_array($value)) + { + $newvalue = $value['data']; + if (isset($value['entity'])) $entity = $value['entity']; + } - if ($newvalue) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."const ("; - $sql.= "name"; - $sql.= ", type"; - $sql.= ", value"; - $sql.= ", note"; - $sql.= ", visible"; - $sql.= ", entity"; - $sql.= ")"; - $sql.= " VALUES ("; - $sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1); - $sql.= ", 'chaine'"; - $sql.= ", ".$this->db->encrypt($value,1); - $sql.= ", null"; - $sql.= ", '0'"; - $sql.= ", ".$conf->entity; - $sql.= ")"; + if ($newvalue) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."const ("; + $sql.= "name"; + $sql.= ", type"; + $sql.= ", value"; + $sql.= ", note"; + $sql.= ", visible"; + $sql.= ", entity"; + $sql.= ")"; + $sql.= " VALUES ("; + $sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1); + $sql.= ", 'chaine'"; + $sql.= ", ".$this->db->encrypt($newvalue,1); + $sql.= ", null"; + $sql.= ", '0'"; + $sql.= ", ".$entity; + $sql.= ")"; - dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG); - $this->db->query($sql); - } - $i++; - } - } - return $err; - } + dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) + { + dol_syslog($this->db->lasterror(), LOG_ERR); + if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $this->error = $this->db->lasterror(); + $this->errors[] = $this->db->lasterror(); + $err++; + break; + } + } + } + $i++; + } + } + return $err; + } /** * Adds constants @@ -1454,11 +1529,11 @@ class DolibarrModules // Can not be abstract, because we need to insta // Clean if (empty($visible)) $visible='0'; - if (empty($val)) $val=''; + if (empty($val) && $val != '0') $val=''; $sql = "SELECT count(*)"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE ".$this->db->decrypt('name')." = '".$name."'"; + $sql.= " WHERE ".$this->db->decrypt('name')." = '".$this->db->escape($name)."'"; $sql.= " AND entity = ".$entity; $result=$this->db->query($sql); @@ -1472,7 +1547,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $sql.= " VALUES ("; $sql.= $this->db->encrypt($name,1); $sql.= ",'".$type."'"; - $sql.= ",".($val?$this->db->encrypt($val,1):"''"); + $sql.= ",".(($val != '')?$this->db->encrypt($val,1):"''"); $sql.= ",".($note?"'".$this->db->escape($note)."'":"null"); $sql.= ",'".$visible."'"; $sql.= ",".$entity; @@ -1944,7 +2019,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->const_name."_DIR_%'"; + $sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->db->escape($this->const_name)."_DIR_%'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_dirs", LOG_DEBUG); @@ -2053,7 +2128,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if (is_array($value) && isset($value['entity'])) $entity = $value['entity']; $sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->const_name."_".strtoupper($key)."'"; + $sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->db->escape($this->const_name)."_".strtoupper($key)."'"; $sql.= " AND entity = ".$entity; dol_syslog(get_class($this)."::delete_const_".$key."", LOG_DEBUG); @@ -2094,5 +2169,4 @@ class DolibarrModules // Can not be abstract, because we need to insta { return $this->_remove(array(), $options); } - } diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 65a80d97e5b..c6b652e265e 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -178,6 +178,8 @@ class CommActionRapport if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; } } @@ -229,7 +231,7 @@ class CommActionRapport $obj = $this->db->fetch_object($resql); $eventstatic->id=$obj->id; - $eventstatic->percentage=$obj->percentage; + $eventstatic->percentage=$obj->percent; $eventstatic->fulldayevent=$obj->fulldayevent; $eventstatic->punctual=$obj->punctual; @@ -266,7 +268,14 @@ class CommActionRapport // Date $pdf->SetXY($this->marge_gauche, $y); - $pdf->MultiCell(22, $height, dol_print_date($this->db->jdate($obj->dp),"day")."\n".dol_print_date($this->db->jdate($obj->dp),"hour"), 0, 'L', 0); + $textdate = dol_print_date($this->db->jdate($obj->dp),"day")."\n".dol_print_date($this->db->jdate($obj->dp),"hour"); + if ($obj->dp2) { + if (dol_print_date($this->db->jdate($obj->dp),"day") != dol_print_date($this->db->jdate($obj->dp2),"day")) + $textdate.= " -> ".dol_print_date($this->db->jdate($obj->dp2), "day")." - ".dol_print_date($this->db->jdate($obj->dp2), "hour"); + else + $textdate.= " -> ".dol_print_date($this->db->jdate($obj->dp2), "hour"); + } + $pdf->MultiCell(22, $height, $textdate, 0, 'L', 0); $y0 = $pdf->GetY(); // Third party diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 699b186a9d2..9941742d8d7 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -249,6 +249,8 @@ class pdf_ban extends ModeleBankAccountDoc if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 3dc615d9deb..e44ab8cafd8 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -396,6 +396,8 @@ class pdf_sepamandate extends ModeleBankAccountDoc if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index 47912c47c20..5b9422b15e7 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005 Regis Houssin + * Copyright (C) 2005 Regis Houssin * Copyright (C) 2015 Francis Appels * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index dc8681a85fd..1e539a2019f 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -193,6 +193,8 @@ class BordereauChequeBlochet extends ModeleChequeReceipts if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + $outputlangs->charset_output=$sav_charset_output; return 1; // Pas d'erreur } diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index 2656ffa23d5..1c028559ddc 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -73,7 +73,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts $posindice=9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -107,7 +107,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts $posindice=9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref like '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 9e26b31b0ce..9ff01c9f5b5 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -275,9 +275,9 @@ class doc_generic_order_odt extends ModelePDFCommandes dol_mkdir($conf->commande->dir_temp); - // If BILLING contact defined on invoice, we use it + // If CUSTOMER contact defined on order, we use it $usecontact=false; - $arrayidcontact=$object->getIdContact('external','BILLING'); + $arrayidcontact=$object->getIdContact('external','CUSTOMER'); if (count($arrayidcontact) > 0) { $usecontact=true; @@ -289,7 +289,11 @@ class doc_generic_order_odt extends ModelePDFCommandes { // On peut utiliser le nom de la societe du contact if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else $socobject = $object->thirdparty; + else { + $socobject = $object->thirdparty; + // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + $contactobject = $object->contact; + } } else { @@ -356,8 +360,12 @@ class doc_generic_order_odt extends ModelePDFCommandes $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs); + // retrieve contact information for use in order as contact_xxx tags + $array_thirdparty_contact = array(); + if ($usecontact) + $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); - $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); + $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); // Call the ODTSubstitution hook @@ -459,6 +467,8 @@ class doc_generic_order_odt extends ModelePDFCommandes $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index cdcca71cb75..e5a22c62867 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -45,28 +45,28 @@ class pdf_einstein extends ModelePDFCommandes * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ public $type; - + /** * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.3 = array(5, 3) */ - public $phpmin = array(5, 2); - + public $phpmin = array(5, 2); + /** * Dolibarr version of the loaded document * @public string @@ -146,7 +146,7 @@ class pdf_einstein extends ModelePDFCommandes } $this->posxdiscount=162; $this->postotalht=174; - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup; $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { @@ -240,11 +240,11 @@ class pdf_einstein extends ModelePDFCommandes $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -263,10 +263,10 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetDrawColor(128,128,128); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); - $pdf->SetSubject($outputlangs->transnoentities("Order")); + $pdf->SetSubject($outputlangs->transnoentities("PdfOrderTitle")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfOrderTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -317,16 +317,16 @@ class pdf_einstein extends ModelePDFCommandes $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - + // Rect prend une longueur en 3eme param $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - + $tab_top = $nexY+6; $height_incoterms += 4; } } - + // Affiche notes $notetoshow=empty($object->note_public)?'':$object->note_public; if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) @@ -478,7 +478,7 @@ class pdf_einstein extends ModelePDFCommandes // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -562,15 +562,10 @@ class pdf_einstein extends ModelePDFCommandes // Show square if ($pagenb == 1) - { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - } else - { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - } + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Affiche zone infos $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); @@ -585,24 +580,26 @@ class pdf_einstein extends ModelePDFCommandes $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); } */ - + // Pied de page - $this->_pagefoot($pdf,$object,$outputlangs); - if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); + $this->_pagefoot($pdf, $object, $outputlangs); + if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); $pdf->Close(); - $pdf->Output($file,'F'); + $pdf->Output($file, 'F'); // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + $parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); global $action; - $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else @@ -862,6 +859,8 @@ class pdf_einstein extends ModelePDFCommandes // Show VAT by rates and total $pdf->SetFillColor(248,248,248); + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $this->atleastoneratenotnull=0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { @@ -953,7 +952,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1035,7 +1034,6 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); } @@ -1048,7 +1046,7 @@ class pdf_einstein extends ModelePDFCommandes //$creditnoteamount=$object->getSumCreditNotesUsed(); //$depositsamount=$object->getSumDepositsUsed(); //print "x".$creditnoteamount."-".$depositsamount;exit; - $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); + $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); if (! empty($object->paye)) $resteapayer=0; if ($deja_regle > 0) @@ -1201,7 +1199,7 @@ class pdf_einstein extends ModelePDFCommandes * @param string $titlekey Translation key to show as title of document * @return void */ - function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="Order") + function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="PdfOrderTitle") { global $conf,$langs,$hookmanager; @@ -1294,7 +1292,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 92c8f55581c..fdea573f584 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -73,7 +73,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."commande"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -107,7 +107,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."commande"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index 1996717e506..2c8ae2ef3e9 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -88,9 +88,12 @@ class mod_commande_saphir extends ModeleNumRefCommandes global $conf,$langs,$mysoc; $old_code_client=$mysoc->code_client; + $old_code_type=$mysoc->typent_code; $mysoc->code_client='CCCCCCCCCC'; + $mysoc->typent_code='TTTTTTTTTT'; $numExample = $this->getNextValue($mysoc,''); $mysoc->code_client=$old_code_client; + $mysoc->typent_code=$old_code_type; if (! $numExample) { @@ -121,7 +124,9 @@ class mod_commande_saphir extends ModeleNumRefCommandes return 0; } - $numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc,$object->date); + $date = ($object->date_commande ? $object->date_commande : $object->date); + + $numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc,$date); return $numFinal; } diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 64d0da9b5fd..eeb267512d4 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -211,7 +211,7 @@ class doc_generic_contract_odt extends ModelePDFContract if (! is_object($object)) { $id = $object; - $object = new Contract($this->db); + $object = new Contrat($this->db); $result=$object->fetch($id); if ($result < 0) { @@ -454,6 +454,8 @@ class doc_generic_contract_odt extends ModelePDFContract $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c06882fa121..646d00afe7b 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -396,6 +396,8 @@ class pdf_strato extends ModelePDFContract if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; } else diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index b909b762541..a76d61a04ae 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -72,7 +72,7 @@ class mod_contract_serpis extends ModelNumRefContracts $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -105,7 +105,7 @@ class mod_contract_serpis extends ModelNumRefContracts $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 5e557f95f33..24027375528 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -259,6 +259,8 @@ class html_cerfafr extends ModeleDon if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; } else diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 2693a4f013a..77a5677c003 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -510,6 +510,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 72b9a7e6def..68795126487 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -359,6 +359,8 @@ class pdf_merou extends ModelePdfExpedition if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; } else diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 3f7a73a650c..1761235d039 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -84,7 +84,7 @@ class pdf_rouget extends ModelePdfExpedition } $this->posxpicture=$this->posxweightvol - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images - + if ($this->page_largeur < 210) // To work with US executive format { $this->posxweightvol-=20; @@ -92,7 +92,7 @@ class pdf_rouget extends ModelePdfExpedition $this->posxqtyordered-=20; $this->posxqtytoship-=20; } - + if (! empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) { $this->posxweightvol += ($this->posxqtytoship - $this->posxqtyordered); @@ -139,17 +139,17 @@ class pdf_rouget extends ModelePdfExpedition if (! empty($conf->global->MAIN_GENERATE_SHIPMENT_WITH_PICTURE)) { $objphoto = new Product($this->db); - + for ($i = 0 ; $i < $nblignes ; $i++) { if (empty($object->lines[$i]->fk_product)) continue; - + $objphoto = new Product($this->db); $objphoto->fetch($object->lines[$i]->fk_product); - + $pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; - + $realpath=''; foreach ($objphoto->liste_photos($dir,1) as $key => $obj) @@ -169,17 +169,17 @@ class pdf_rouget extends ModelePdfExpedition { $filename=$obj['photo']; } - + $realpath = $dir.$filename; break; } - + if ($realpath) $realpatharray[$i]=$realpath; } } - - if (count($realpatharray) == 0) $this->posxpicture=$this->posxweightvol; - + + if (count($realpatharray) == 0) $this->posxpicture=$this->posxweightvol; + if ($conf->expedition->dir_output) { // Definition de $dir et $file @@ -219,7 +219,7 @@ class pdf_rouget extends ModelePdfExpedition // Set nblignes with the new facture lines content after hook $nblignes = count($object->lines); - + $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part @@ -282,11 +282,11 @@ class pdf_rouget extends ModelePdfExpedition $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - + // Rect prend une longueur en 3eme param $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - + $tab_top = $nexY+6; $height_incoterms += 4; } @@ -343,7 +343,7 @@ class pdf_rouget extends ModelePdfExpedition // Rect prend une longueur en 3eme param $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - + $tab_height = $tab_height - $height_note; $tab_top = $nexY+6; } @@ -400,7 +400,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->startTransaction(); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); - + $pageposafter=$pdf->getPage(); if ($pageposafter > $pageposbefore) // There is a pagebreak { @@ -434,10 +434,10 @@ class pdf_rouget extends ModelePdfExpedition $pdf->commitTransaction(); } $posYAfterDescription=$pdf->GetY(); - + $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); - + $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. @@ -456,29 +456,29 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetXY($this->posxweightvol, $curY); $weighttxt=''; - if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight) + if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight) { $weighttxt=round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->weight_units,"weight"); } $voltxt=''; - if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume) + if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume) { $voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0,"volume"); } - + $pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'
        ':'').$voltxt, 0, 0, false, true, 'C'); //$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'
        ':'').$voltxt,'','C'); - + if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) { $pdf->SetXY($this->posxqtyordered, $curY); $pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked,'','C'); } - + $pdf->SetXY($this->posxqtytoship, $curY); $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C'); - if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) + if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) { $pdf->SetXY($this->posxpuht, $curY); $pdf->MultiCell(($this->posxtotalht - $this->posxpuht-1), 3, price($object->lines[$i]->subprice, 0, $outputlangs),'','R'); @@ -489,7 +489,7 @@ class pdf_rouget extends ModelePdfExpedition $nexY+=3; if ($weighttxt && $voltxt) $nexY+=2; - + // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { @@ -548,7 +548,7 @@ class pdf_rouget extends ModelePdfExpedition } // Affiche zone totaux - $posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); + $posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs); // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); @@ -567,6 +567,8 @@ class pdf_rouget extends ModelePdfExpedition if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // No error } else @@ -612,7 +614,7 @@ class pdf_rouget extends ModelePdfExpedition }*/ if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) $largcol2 = ($this->posxqtyordered - $this->posxweightvol); else $largcol2 = ($this->posxqtytoship - $this->posxweightvol); - + $useborder=0; $index = 0; @@ -626,12 +628,12 @@ class pdf_rouget extends ModelePdfExpedition $totalOrdered=$tmparray['ordered']; $totalToShip=$tmparray['toship']; // Set trueVolume and volume_units not currently stored into database - if ($object->trueWidth && $object->trueHeight && $object->trueDepth) + if ($object->trueWidth && $object->trueHeight && $object->trueDepth) { $object->trueVolume=price(($object->trueWidth * $object->trueHeight * $object->trueDepth), 0, $outputlangs, 0, 0); $object->volume_units=$object->size_units * 3; } - + if ($totalWeight!='') $totalWeighttoshow=showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); if ($totalVolume!='') $totalVolumetoshow=showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs); if ($object->trueWeight) $totalWeighttoshow=showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); @@ -640,48 +642,48 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFillColor(255,255,255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1); - + if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) { $pdf->SetXY($this->posxqtyordered, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1); } - + $pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1); - + if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) { $pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1); - + $pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1); } - + // Total Weight if ($totalWeighttoshow) { $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1); - + $index++; } if ($totalVolumetoshow) { $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1); - + $index++; } if (! $totalWeighttoshow && ! $totalVolumetoshow) $index++; - + $pdf->SetTextColor(0,0,0); return ($tab2_top + ($tab2_hl * $index)); } - + /** * Show table for lines * @@ -728,7 +730,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetXY($this->posxweightvol-1, $tab_top+1); $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"),'','C'); } - + if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) { $pdf->line($this->posxqtyordered-1, $tab_top, $this->posxqtyordered-1, $tab_top + $tab_height); @@ -738,14 +740,14 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 2, $outputlangs->transnoentities("QtyOrdered"),'','C'); } } - + $pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqtytoship, $tab_top+1); $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C'); } - + if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) { $pdf->line($this->posxpuht-1, $tab_top, $this->posxpuht-1, $tab_top + $tab_height); @@ -754,7 +756,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetXY($this->posxpuht-1, $tab_top+1); $pdf->MultiCell(($this->posxtotalht - $this->posxpuht), 2, $outputlangs->transnoentities("PriceUHT"),'','C'); } - + $pdf->line($this->posxtotalht-1, $tab_top, $this->posxtotalht-1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -763,7 +765,7 @@ class pdf_rouget extends ModelePdfExpedition } } - + } /** @@ -780,7 +782,7 @@ class pdf_rouget extends ModelePdfExpedition global $conf,$langs,$mysoc; $langs->load("orders"); - + $default_font_size = pdf_getPDFFontSize($outputlangs); pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); @@ -796,7 +798,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFont('','B', $default_font_size + 3); $w = 110; - + $posy=$this->marge_haute; $posx=$this->page_largeur-$this->marge_droite-$w; @@ -863,7 +865,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFont('','', $default_font_size + 1); $posy+=5; - + $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R'); @@ -876,7 +878,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetTextColor(0,0,60); $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery,"day",false,$outputlangs,true), '', 'R'); } - + if (! empty($object->thirdparty->code_client)) { $posy+=4; @@ -904,7 +906,7 @@ class pdf_rouget extends ModelePdfExpedition if ($result >= 0) { //$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects - + $pdf->SetFont('','', $default_font_size - 2); $text=$linkedobject->ref; if ($linkedobject->ref_client) $text.=' ('.$linkedobject->ref_client.')'; @@ -939,7 +941,7 @@ class pdf_rouget extends ModelePdfExpedition $hautcadre=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40; $widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82; - + // Show sender frame $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); @@ -950,7 +952,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); $pdf->SetTextColor(0,0,60); $pdf->SetFillColor(255,255,255); - + // Show sender name $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B',$default_font_size); diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index c92ea93e6a2..c002da1eee2 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -79,9 +79,12 @@ class mod_expedition_ribera extends ModelNumRefExpedition global $conf,$langs,$mysoc; $old_code_client=$mysoc->code_client; + $old_code_type=$mysoc->typent_code; $mysoc->code_client='CCCCCCCCCC'; + $mysoc->typent_code='TTTTTTTTTT'; $numExample = $this->getNextValue($mysoc,''); $mysoc->code_client=$old_code_client; + $mysoc->typent_code=$old_code_type; if (! $numExample) { @@ -111,7 +114,9 @@ class mod_expedition_ribera extends ModelNumRefExpedition return 0; } - $numFinal=get_next_value($db,$mask,'expedition','ref','',$objsoc->code_client,$shipment->date_expedition); + $date = $shipment->date_expedition; + + $numFinal=get_next_value($db,$mask,'expedition','ref','',$objsoc,$date); return $numFinal; } diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index 581657c6547..6d2b115d6b3 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -71,7 +71,7 @@ class mod_expedition_safor extends ModelNumRefExpedition $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -104,7 +104,7 @@ class mod_expedition_safor extends ModelNumRefExpedition $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index e4ad7b7db36..6182b5afca3 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -474,6 +474,8 @@ class pdf_standard extends ModeleExpenseReport if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else diff --git a/htdocs/accountancy/report/index.html b/htdocs/core/modules/expensereport/index.html similarity index 100% rename from htdocs/accountancy/report/index.html rename to htdocs/core/modules/expensereport/index.html diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php new file mode 100644 index 00000000000..e6da5fab7eb --- /dev/null +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -0,0 +1,139 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/expensereport/mod_expensereport_jade.php + * \ingroup expensereport + * \brief File of class to manage customer order numbering rules Jade + */ +require_once DOL_DOCUMENT_ROOT .'/core/modules/expensereport/modules_expensereport.php'; + +/** + * Class to manage customer order numbering rules Jade + */ +class mod_expensereport_jade extends ModeleNumRefExpenseReport +{ + var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' + var $prefix='ER'; + var $error=''; + var $nom='Jade'; + + + /** + * Return description of numbering module + * + * @return string Text with description + */ + function info() + { + global $langs; + return $langs->trans("SimpleNumRefModelDesc",$this->prefix); + } + + + /** + * Renvoi un exemple de numerotation + * + * @return string Example + */ + function getExample() + { + return $this->prefix."0501-0001"; + } + + + /** + * Test si les numeros deje en vigueur dans la base ne provoquent pas de + * de conflits qui empechera cette numerotation de fonctionner. + * + * @return boolean false si conflit, true si ok + */ + function canBeActivated() + { + global $conf,$langs,$db; + + $coyymm=''; $max=''; + + $posindice=8; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $coyymm = substr($row[0],0,6); $max=$row[0]; } + } + if ($coyymm && ! preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$coyymm)) + { + $langs->load("errors"); + $this->error=$langs->trans('ErrorNumRefModel', $max); + return false; + } + + return true; + } + + /** + * Return next free value + * + * @param Object $object Object we need next value for + * @return string Value if KO, <0 if KO + */ + function getNextValue($object) + { + global $db,$conf; + + // D'abord on recupere la valeur max + $posindice=8; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $max = intval($obj->max); + else $max=0; + } + else + { + dol_syslog("mod_expensereport_jade::getNextValue", LOG_DEBUG); + return 0; + } + + $date=$object->date_valid; // $object->date does not exists + if (empty($date)) + { + $this->error = 'Date valid not defined'; + return 0; + } + + $yymm = strftime("%y%m",$date); + + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); + + dol_syslog("mod_expensereport_jade::getNextValue return ".$this->prefix.$yymm."-".$num); + return $this->prefix.$yymm."-".$num; + } +} diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php new file mode 100644 index 00000000000..4222bf163d5 --- /dev/null +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -0,0 +1,140 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/expensereport/mod_expensereport_sand.php + * \ingroup expensereport + * \brief Fichier contenant la classe du modele de numerotation de reference de note de frais Sand + */ + +require_once DOL_DOCUMENT_ROOT .'/core/modules/expensereport/modules_expensereport.php'; + + +/** + * Class to manage expense report numbering rules Sand + */ +class mod_expensereport_sand extends ModeleNumRefExpenseReport +{ + var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' + var $error = ''; + var $nom = 'Sand'; + + + /** + * Renvoi la description du modele de numerotation + * + * @return string Texte descripif + */ + function info() + { + global $conf,$langs; + + $langs->load("bills"); + + $form = new Form($this->db); + + $texte = $langs->trans('GenericNumRefModelDesc')."
        \n"; + $texte.= '
        '; + $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= ''; + + $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("ExpenseReport"),$langs->transnoentities("ExpenseReport")); + //$tooltip.=$langs->trans("GenericMaskCodes2"); + $tooltip.=$langs->trans("GenericMaskCodes3"); + $tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("ExpenseReport"),$langs->transnoentities("ExpenseReport")); + $tooltip.=$langs->trans("GenericMaskCodes5"); + + // Parametrage du prefix + $texte.= ''; + $texte.= ''; + + $texte.= ''; + + $texte.= ''; + + $texte.= '
        '.$langs->trans("Mask").':'.$form->textwithpicto('',$tooltip,1,1).' 
        '; + $texte.= '
        '; + + return $texte; + } + + /** + * Renvoi un exemple de numerotation + * + * @return string Example + */ + function getExample() + { + global $conf,$langs,$user; + + $exp=new ExpenseReport($this->db); + $exp->initAsSpecimen(); + $exp->fk_user_author = $user->id; + + $numExample = $this->getNextValue($exp); + + if (! $numExample) + { + $numExample = $langs->trans('NotConfigured'); + } + return $numExample; + } + + /** + * Return next free value + * + * @param Object $object Object we need next value for + * @return string Value if KO, <0 if KO + */ + function getNextValue($object) + { + global $db,$conf; + + require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; + + // We get cursor rule + $mask=$conf->global->EXPENSEREPORT_SAND_MASK; + + if (! $mask) + { + $this->error='NotConfigured'; + return 0; + } + + $date=$object->date_valid; // $object->date does not exists + if (empty($date)) + { + $this->error = 'Date valid not defined'; + return 0; + } + + $fuser = null; + if ($object->fk_user_author > 0) + { + $fuser=new User($db); + $fuser->fetch($object->fk_user_author); + } + + $numFinal=get_next_value($db,$mask,'expensereport','ref','',null, $date, 'next', true, $fuser); + + return $numFinal; + } +} + diff --git a/htdocs/core/modules/expensereport/modules_expensereport.php b/htdocs/core/modules/expensereport/modules_expensereport.php index 153dfb37007..e0adf1fb47e 100644 --- a/htdocs/core/modules/expensereport/modules_expensereport.php +++ b/htdocs/core/modules/expensereport/modules_expensereport.php @@ -65,3 +65,87 @@ function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $ { return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } + +/** + * \class ModeleNumRefExpenseReport + * \brief Parent class for numbering masks of expense reports + */ + +abstract class ModeleNumRefExpenseReport +{ + var $error=''; + + /** + * Return if a module can be used or not + * + * @return boolean true if module can be used + */ + function isEnabled() + { + return true; + } + + /** + * Renvoie la description par defaut du modele de numerotation + * + * @return string Texte descripif + */ + function info() + { + global $langs; + $langs->load("orders"); + return $langs->trans("NoDescription"); + } + + /** + * Renvoie un exemple de numerotation + * + * @return string Example + */ + function getExample() + { + global $langs; + $langs->load("trips"); + return $langs->trans("NoExample"); + } + + /** + * Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner. + * + * @return boolean false si conflit, true si ok + */ + function canBeActivated() + { + return true; + } + + /** + * Renvoie prochaine valeur attribuee + * + * @param Societe $objsoc Object thirdparty + * @param Object $object Object we need next value for + * @return string Valeur + */ + function getNextValue($objsoc,$object) + { + global $langs; + return $langs->trans("NotAvailable"); + } + + /** + * Renvoie version du module numerotation + * + * @return string Valeur + */ + function getVersion() + { + global $langs; + $langs->load("admin"); + + if ($this->version == 'development') return $langs->trans("VersionDevelopment"); + if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); + if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; + return $langs->trans("NotAvailable"); + } +} \ No newline at end of file diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index a8baaab2282..79b848c5773 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -474,6 +474,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 693dd2e412f..ef4dd5ff6fc 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1,13 +1,13 @@ * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Raphael Bertrand + * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2012-2014 Raphaël Doursenaud - * Copyright (C) 2015 Marcos García - * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -132,7 +132,7 @@ class pdf_crabe extends ModelePDFFactures $this->posxdiscount=162; $this->posxprogress=126; // Only displayed for situation invoices $this->postotalht=174; - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup; $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { @@ -214,9 +214,9 @@ class pdf_crabe extends ModelePDFFactures { $object->fetch_thirdparty(); - $deja_regle = $object->getSommePaiement(); - $amount_credit_notes_included = $object->getSumCreditNotesUsed(); - $amount_deposits_included = $object->getSumDepositsUsed(); + $deja_regle = $object->getSommePaiement(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); + $amount_credit_notes_included = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); + $amount_deposits_included = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Definition of $dir and $file if ($object->specimen) @@ -255,16 +255,16 @@ class pdf_crabe extends ModelePDFFactures // Set nblignes with the new facture lines content after hook $nblignes = count($object->lines); $nbpayments = count($object->getListOfPayments()); - + // Create pdf instance $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + $heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -284,10 +284,10 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetDrawColor(128,128,128); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); - $pdf->SetSubject($outputlangs->transnoentities("Invoice")); + $pdf->SetSubject($outputlangs->transnoentities("PdfInvoiceTitle")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -509,7 +509,7 @@ class pdf_crabe extends ModelePDFFactures $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); // Enough for 6 chars - + if ($this->situationinvoice) { $pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R'); @@ -568,7 +568,7 @@ class pdf_crabe extends ModelePDFFactures if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva $prev_progress = $object->lines[$i]->get_prev_progress($object->id); - if ($prev_progress > 0) // Compute progress from previous situation + if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) // Compute progress from previous situation { if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; else $tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; @@ -701,6 +701,8 @@ class pdf_crabe extends ModelePDFFactures if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // No error } else @@ -769,9 +771,9 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('','', $default_font_size - 4); - + // Loop on each deposits and credit notes included - $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; + $sql = "SELECT re.rowid, re.amount_ht, re.multicurrency_amount_ht, re.amount_tva, re.multicurrency_amount_tva, re.amount_ttc, re.multicurrency_amount_ttc,"; $sql.= " re.description, re.fk_facture_source,"; $sql.= " f.type, f.datef"; $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f"; @@ -796,7 +798,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($tab3_posx, $tab3_top+$y); $pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0); $pdf->SetXY($tab3_posx+21, $tab3_top+$y); - $pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); $pdf->SetXY($tab3_posx+40, $tab3_top+$y); $pdf->MultiCell(20, 3, $text, 0, 'L', 0); $pdf->SetXY($tab3_posx+58, $tab3_top+$y); @@ -815,14 +817,14 @@ class pdf_crabe extends ModelePDFFactures // Loop on each payment // TODO Call getListOfPaymentsgetListOfPayments instead of hard coded sql - $sql = "SELECT p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount,"; + $sql = "SELECT p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,"; $sql.= " cp.code"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; //$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = 1"; $sql.= " ORDER BY p.datep"; - + $resql=$this->db->query($sql); if ($resql) { @@ -835,7 +837,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($tab3_posx, $tab3_top+$y); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); $pdf->SetXY($tab3_posx+21, $tab3_top+$y); - $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * (($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0); $pdf->SetXY($tab3_posx+40, $tab3_top+$y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code); @@ -1052,7 +1054,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFillColor(255,255,255); $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - + $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); @@ -1060,6 +1062,8 @@ class pdf_crabe extends ModelePDFFactures // Show VAT by rates and total $pdf->SetFillColor(248,248,248); + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $this->atleastoneratenotnull=0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { @@ -1071,7 +1075,7 @@ class pdf_crabe extends ModelePDFFactures else { // FIXME amount of vat not supported with multicurrency - + //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1141,7 +1145,26 @@ class pdf_crabe extends ModelePDFFactures } //} + // VAT + // Situations totals migth be wrong on huge amounts + if ($object->situation_cycle_ref && $object->situation_counter > 1) { + + $sum_pdf_tva = 0; + foreach($this->tva as $tvakey => $tvaval){ + $sum_pdf_tva+=$tvaval; // sum VAT amounts to compare to object + } + + if($sum_pdf_tva!=$object->total_tva) { // apply coef to recover the VAT object amount (the good one) + $coef_fix_tva = $object->total_tva / $sum_pdf_tva; + + foreach($this->tva as $tvakey => $tvaval) { + $this->tva[$tvakey]=$tvaval * $coef_fix_tva; + } + } + + } + foreach($this->tva as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 @@ -1157,7 +1180,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1251,7 +1274,6 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); } @@ -1259,10 +1281,10 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0,0,0); - $creditnoteamount=$object->getSumCreditNotesUsed(); - $depositsamount=$object->getSumDepositsUsed(); + $creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); + $depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); //print "x".$creditnoteamount."-".$depositsamount;exit; - $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); + $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); if ($object->paye) $resteapayer=0; if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) @@ -1397,7 +1419,7 @@ class pdf_crabe extends ModelePDFFactures if (empty($hidetop)) { $pdf->SetXY($this->posxqty-1, $tab_top+1); - + if($this->situationinvoice) { $pdf->MultiCell($this->posxprogress-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); @@ -1411,14 +1433,14 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); } } - + if ($this->situationinvoice) { $pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height); - + if (empty($hidetop)) { - + $pdf->SetXY($this->posxprogress, $tab_top+1); - + if($conf->global->PRODUCT_USE_UNITS) { $pdf->MultiCell($this->posxunit-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C'); @@ -1431,9 +1453,9 @@ class pdf_crabe extends ModelePDFFactures { $pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C'); } - + } - + } if($conf->global->PRODUCT_USE_UNITS) { @@ -1540,7 +1562,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('','B', $default_font_size + 3); $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $title=$outputlangs->transnoentities("Invoice"); + $title=$outputlangs->transnoentities("PdfInvoiceTitle"); if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); @@ -1554,10 +1576,10 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $textref=$outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref); - if ($object->statut == Facture::STATUS_DRAFT) + if ($object->statut == Facture::STATUS_DRAFT) { $pdf->SetTextColor(128,0,0); - $textref.=' - '.$outputlangs->trans("NotValidated"); + $textref.=' - '.$outputlangs->transnoentities("NotValidated"); } $pdf->MultiCell($w, 4, $textref, '', 'R'); @@ -1616,7 +1638,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0,0,60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("DatePointOfTax")." : " . dol_print_date($object->date_pointoftax,"day",false,$outputlangs), '', 'R'); } - + if ($object->type != 2) { $posy+=3; @@ -1644,10 +1666,10 @@ class pdf_crabe extends ModelePDFFactures $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell($w, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=1; // Show list of linked objects diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 15d3ce53fa8..f31d5a7f451 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -37,7 +37,7 @@ class mod_facture_mars extends ModeleNumRefFactures var $prefixcreditnote='AV'; var $error=''; - + /** * Constructor */ @@ -48,7 +48,7 @@ class mod_facture_mars extends ModeleNumRefFactures $this->prefixinvoice = $conf->global->INVOICE_NUMBERING_MARS_FORCE_PREFIX; } } - + /** * Renvoi la description du modele de numerotation * @@ -89,7 +89,7 @@ class mod_facture_mars extends ModeleNumRefFactures $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - $sql.= " WHERE facnumber LIKE '".$this->prefixinvoice."____-%'"; + $sql.= " WHERE facnumber LIKE '".$this->db->escape($this->prefixinvoice)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -111,7 +111,7 @@ class mod_facture_mars extends ModeleNumRefFactures $posindice=8; $sql = "SELECT MAX(SUBSTRING(facnumber FROM ".$posindice.")) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - $sql.= " WHERE facnumber LIKE '".$this->prefixcreditnote."____-%'"; + $sql.= " WHERE facnumber LIKE '".$this->db->escape($this->prefixcreditnote)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index b2a2f22cd12..cf2ea28f162 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -35,7 +35,7 @@ class mod_facture_terre extends ModeleNumRefFactures var $prefixdeposit='AC'; var $error=''; - + /** * Constructor */ @@ -46,7 +46,7 @@ class mod_facture_terre extends ModeleNumRefFactures $this->prefixinvoice = $conf->global->INVOICE_NUMBERING_TERRE_FORCE_PREFIX; } } - + /** * Renvoi la description du modele de numerotation * @@ -87,7 +87,7 @@ class mod_facture_terre extends ModeleNumRefFactures $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - $sql.= " WHERE facnumber LIKE '".$this->prefixinvoice."____-%'"; + $sql.= " WHERE facnumber LIKE '".$this->db->escape($this->prefixinvoice)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -109,7 +109,7 @@ class mod_facture_terre extends ModeleNumRefFactures $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - $sql.= " WHERE facnumber LIKE '".$this->prefixcreditnote."____-%'"; + $sql.= " WHERE facnumber LIKE '".$this->db->escape($this->prefixcreditnote)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -130,7 +130,7 @@ class mod_facture_terre extends ModeleNumRefFactures $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - $sql.= " WHERE facnumber LIKE '".$this->prefixdeposit."____-%'"; + $sql.= " WHERE facnumber LIKE '".$this->db->escape($this->prefixdeposit)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 4d889f84902..93e5aa11182 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -277,7 +277,15 @@ class pdf_soleil extends ModelePDFFicheinter $curX = $this->posxdesc-1; // Description of product line - $txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true); + if (empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) + { + $txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true); + } + else + { + $txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'day',false,$outputlangs,true); + } + if ($objectligne->duration > 0) { $txt.=" - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration); @@ -294,7 +302,7 @@ class pdf_soleil extends ModelePDFFicheinter $pageposafter=$pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - $pdf->writeHTMLCell(0, 0, $curX, $curY, $txt.'
        '.$desc, LR, 1, 0); + $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0); $pageposafter=$pdf->getPage(); $posyafter=$pdf->GetY(); //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; @@ -392,6 +400,8 @@ class pdf_soleil extends ModelePDFFicheinter if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; } else diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index 65e5aa979b9..c9f42f12949 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -74,7 +74,7 @@ class mod_pacific extends ModeleNumRefFicheinter $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " WHERE entity = ".$conf->entity; $resql=$db->query($sql); @@ -110,7 +110,7 @@ class mod_pacific extends ModeleNumRefFicheinter $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 917760dc900..eff3b8f8b21 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -292,10 +292,11 @@ class ImportXlsx extends ModeleImports * @param Object $objimport Object import (contains objimport->array_import_tables, objimport->array_import_fields, objimport->array_import_convertvalue, ...) * @param int $maxfields Max number of fields to use * @param string $importid Import key + * @param array $updatekeys Array of keys to use to try to do update * @return int <0 if KO, >0 if OK */ // What is this doing here ? it is common to all imports, is should be in the parent class - function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid) + function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys) { global $langs,$conf,$user; global $thirdparty_static; // Specific to thirdparty import @@ -326,13 +327,15 @@ class ImportXlsx extends ModeleImports else { $last_insert_id_array = array(); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id (eg: extrafields fk_object will be set with the last inserted object's id) + $updatedone = false; + $insertdone = false; // For each table to insert, me make a separate insert foreach($objimport->array_import_tables[0] as $alias => $tablename) { // Build sql request $sql=''; - $listfields=''; - $listvalues=''; + $listfields=array(); + $listvalues=array(); $i=0; $errorforthistable=0; @@ -372,7 +375,7 @@ class ImportXlsx extends ModeleImports // Make some tests on $newval // Is it a required field ? - if (preg_match('/\*/',$objimport->array_import_fields[0][$val]) && ((string) $newval == '')) + if (preg_match('/\*/',$objimport->array_import_fields[0][$val]) && ((string) $newval=='')) { $this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key); $this->errors[$error]['type']='NOTNULL'; @@ -399,7 +402,7 @@ class ImportXlsx extends ModeleImports if ($isidorref == 'ref') // If value into input import file is a ref, we apply the function defined into descriptor { - $file=$objimport->array_import_convertvalue[0][$val]['classfile']; + $file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']); $class=$objimport->array_import_convertvalue[0][$val]['class']; $method=$objimport->array_import_convertvalue[0][$val]['method']; if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] != '') @@ -408,7 +411,12 @@ class ImportXlsx extends ModeleImports } else { - dol_include_once($file); + $resultload = dol_include_once($file); + if (empty($resultload)) + { + dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method); + break; + } $classinstance=new $class($this->db); // Try the fetch from code or ref call_user_func_array(array($classinstance, $method),array('', $newval)); @@ -481,6 +489,26 @@ class ImportXlsx extends ModeleImports } if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" } + elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getrefifauto') + { + $defaultref=''; + // TODO provide the $modTask (module of generation of ref) as parameter of import_insert function + $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON; + if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) + { + require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; + $modTask = new $obj; + $defaultref = $modTask->getNextValue(null,null); + } + if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; + $newval=$defaultref; + } + + + elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric') + { + $newval = price2num($newval); + } //print 'Val to use as insert is '.$newval.'
        '; } @@ -541,42 +569,37 @@ class ImportXlsx extends ModeleImports } // Define $listfields and $listvalues to build SQL request - if ($listfields) { $listfields.=', '; $listvalues.=', '; } - $listfields.=$fieldname; + $listfields[] = $fieldname; // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert - if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues.=($newval=='0'?$newval:"null"); - elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues.="''"; - else $listvalues.="'".$this->db->escape($newval)."'"; + if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues[] = ($newval=='0'?$newval:"null"); + elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues[] = "''"; + else $listvalues[] = "'".$this->db->escape($newval)."'"; } $i++; } // We add hidden fields (but only if there is at least one field to add into table) - if ($listfields && is_array($objimport->array_import_fieldshidden[0])) + if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0])) { // Loop on each hidden fields to add them into listfields/listvalues foreach($objimport->array_import_fieldshidden[0] as $key => $val) { if (! preg_match('/^'.preg_quote($alias).'\./', $key)) continue; // Not a field of current table - if ($listfields) { $listfields.=', '; $listvalues.=', '; } if ($val == 'user->id') { - $listfields.=preg_replace('/^'.preg_quote($alias).'\./','',$key); - $listvalues.=$user->id; + $listfields[] = preg_replace('/^'.preg_quote($alias).'\./','',$key); + $listvalues[] = $user->id; } elseif (preg_match('/^lastrowid-/',$val)) { $tmp=explode('-',$val); $lastinsertid=(isset($last_insert_id_array[$tmp[1]]))?$last_insert_id_array[$tmp[1]]:0; - $listfields.=preg_replace('/^'.preg_quote($alias).'\./','',$key); - $listvalues.=$lastinsertid; + $keyfield = preg_replace('/^'.preg_quote($alias).'\./','',$key); + $listfields[] = $keyfield; + $listvalues[] = $lastinsertid; //print $key."-".$val."-".$listfields."-".$listvalues."
        ";exit; - } else - { - $listfields.=preg_replace('/^'.preg_quote($alias).'\./','',$key); - $listvalues.=$val; - } + } } } //print 'listfields='.$listfields.'
        listvalues='.$listvalues.'
        '; @@ -584,49 +607,114 @@ class ImportXlsx extends ModeleImports // If no error for this $alias/$tablename, we have a complete $listfields and $listvalues that are defined if (! $errorforthistable) { - //print "$alias/$tablename/$listfields/$listvalues
        "; - if ($listfields) + //print "$alias/$tablename/$listfields/$listvalues
        "; + if (!empty($listfields)) { - //var_dump($objimport->array_import_convertvalue); exit; - - // Build SQL request - if (empty($tablewithentity_cache[$tablename])) - { - $sql ='INSERT INTO '.$tablename.'('.$listfields.', import_key'; - if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$objimport->array_import_tables_creator[0][$alias]; - $sql.=') VALUES('.$listvalues.", '".$importid."'"; - } - else - { - $sql ='INSERT INTO '.$tablename.'('.$listfields.', import_key, entity'; - if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$objimport->array_import_tables_creator[0][$alias]; - $sql.=') VALUES('.$listvalues.", '".$importid."', ".$conf->entity ; - } - if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$user->id; - $sql.=')'; - - //print($sql).'
        '; - dol_syslog("import_csv.modules", LOG_DEBUG); - - //print '> '.join(',',$arrayrecord); - //print 'sql='.$sql; - //print '
        '."\n"; - - // Run insert request - if ($sql) - { - $resql=$this->db->query($sql); - $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). - if ($resql) - { - //print '.'; + $updatedone = false; + $insertdone = false; + if (!empty($updatekeys)) { + // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) + if (empty($lastinsertid)) { + $sqlSelect = 'SELECT rowid FROM '.$tablename; + + $data = array_combine($listfields, $listvalues); + $where = array(); + $filters = array(); + foreach ($updatekeys as $key) { + $col = $objimport->array_import_updatekeys[0][$key]; + $key=preg_replace('/^.*\./i','',$key); + $where[] = $key.' = '.$data[$key]; + $filters[] = $col.' = '.$data[$key]; + } + $sqlSelect.= ' WHERE '.implode(' AND ', $where); + + $resql=$this->db->query($sqlSelect); + if($resql) { + $res = $this->db->fetch_object($resql); + if($resql->num_rows == 1) { + $lastinsertid = $res->rowid; + $last_insert_id_array[$tablename] = $lastinsertid; + } else if($resql->num_rows > 1) { + $this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', ')); + $this->errors[$error]['type']='SQL'; + $error++; + } else { + // No record found with filters, insert will be tried below + } + } + else + { + //print 'E'; + $this->errors[$error]['lib']=$this->db->lasterror(); + $this->errors[$error]['type']='SQL'; + $error++; + } } - else + + if (!empty($lastinsertid)) { + // Build SQL UPDATE request + $sqlstart = 'UPDATE '.$tablename; + + $data = array_combine($listfields, $listvalues); + $set = array(); + foreach ($data as $key => $val) { + $set[] = $key.' = '.$val; + } + $sqlstart.= ' SET '.implode(', ', $set); + + if(empty($keyfield)) $keyfield = 'rowid'; + $sqlend = ' WHERE '.$keyfield.' = '.$lastinsertid; + + $sql = $sqlstart.$sqlend; + + // Run update request + $resql=$this->db->query($sql); + if($resql) { + // No error, update has been done. $this->db->db->affected_rows can be 0 if data hasn't changed + $updatedone = true; + } + else + { + //print 'E'; + $this->errors[$error]['lib']=$this->db->lasterror(); + $this->errors[$error]['type']='SQL'; + $error++; + } + } + } + + // Update not done, we do insert + if (!$error && !$updatedone) { + // Build SQL INSERT request + $sqlstart = 'INSERT INTO '.$tablename.'('.implode(', ', $listfields).', import_key'; + $sqlend = ') VALUES('.implode(', ', $listvalues).", '".$importid."'"; + if (! empty($tablewithentity_cache[$tablename])) { + $sqlstart.= ', entity'; + $sqlend.= ', '.$conf->entity; + } + if (! empty($objimport->array_import_tables_creator[0][$alias])) { + $sqlstart.= ', '.$objimport->array_import_tables_creator[0][$alias]; + $sqlend.=', '.$user->id; + } + $sql = $sqlstart.$sqlend.')'; + dol_syslog("import_xlsx.modules", LOG_DEBUG); + + // Run insert request + if ($sql) { - //print 'E'; - $this->errors[$error]['lib']=$this->db->lasterror(); - $this->errors[$error]['type']='SQL'; - $error++; + $resql=$this->db->query($sql); + if ($resql) + { + $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). + $insertdone = true; + } + else + { + //print 'E'; + $this->errors[$error]['lib']=$this->db->lasterror(); + $this->errors[$error]['type']='SQL'; + $error++; + } } } } @@ -638,6 +726,9 @@ class ImportXlsx extends ModeleImports if ($error) break; } + + if($updatedone) $this->nbupdate++; + if($insertdone) $this->nbinsert++; } return 1; diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 1f8e06eb04d..eeba25962cb 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -566,6 +566,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // pas d'erreur } else diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index 3480bb6d609..cbb630543c7 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -80,7 +80,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."livraison"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -114,7 +114,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."livraison"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 0e4966a5ada..8aae15b9cc8 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -28,8 +28,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; /** - * \class mailing_contacts1 - * \brief Class to offer a selector of emailing targets with Rule 'Poire'. + * Class to offer a selector of emailing targets from contacts */ class mailing_contacts1 extends MailingTargets { @@ -39,7 +38,7 @@ class mailing_contacts1 extends MailingTargets var $require_module=array("societe"); // Module mailing actif si modules require_module actifs var $require_admin=0; // Module mailing actif pour user admin ou non var $picto='contact'; - + var $db; @@ -101,8 +100,7 @@ class mailing_contacts1 extends MailingTargets $sql.= " AND c.no_email = 0"; $sql.= " AND c.statut = 1"; - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients + // The request must return a field called "nb" to be understandable by parent::getNbOfRecipients return parent::getNbOfRecipients($sql); } @@ -118,10 +116,86 @@ class mailing_contacts1 extends MailingTargets $langs->load("companies"); $langs->load("commercial"); $langs->load("suppliers"); + $langs->load("categories"); $s=''; - $s.=''; + $s.=''; + if ($resql) + { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $s.=''; + $i++; + } + } + else dol_print_error($this->db); + $s.=''; + + $s.=' '; + + // Filter on contact category + $s .= $langs->trans("ContactCategoriesShort").': '; + $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; + $sql.= " FROM "; + $sql.= " ".MAIN_DB_PREFIX."socpeople as sp,"; + $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; + $sql.= " ".MAIN_DB_PREFIX."categorie_contact as cs"; + $sql.= " WHERE sp.statut = 1"; // Note that null != '' is false + //$sql.= " AND sp.no_email = 0"; + //$sql.= " AND sp.email != ''"; + //$sql.= " AND sp.entity IN (".getEntity('societe').")"; + $sql.= " AND cs.fk_categorie = c.rowid"; + $sql.= " AND cs.fk_socpeople = sp.rowid"; + $sql.= " GROUP BY c.label"; + $sql.= " ORDER BY c.label"; + $resql = $this->db->query($sql); + + $s.=''; + + $s.='
        '; + // Add prospect of a particular level + $s.=$langs->trans("NatureOfThirdParty").': '; + $s.=''; + + $s.= ' '; + + // Filter on thirdparty category + $s .= $langs->trans("CustomersProspectsCategoriesShort").': '; + $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; + $sql.= " FROM "; + $sql.= " ".MAIN_DB_PREFIX."socpeople as sp,"; + $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; + $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; + $sql.= " WHERE sp.statut = 1"; // Note that null != '' is false + //$sql.= " AND sp.no_email = 0"; + //$sql.= " AND sp.email != ''"; + //$sql.= " AND sp.entity IN (".getEntity('societe').")"; + $sql.= " AND cs.fk_categorie = c.rowid"; + $sql.= " AND cs.fk_soc = sp.fk_soc"; + $sql.= " GROUP BY c.label"; + $sql.= " ORDER BY c.label"; + $resql = $this->db->query($sql); + + $s.=''; + + $s.= ' '; + + // Filter on thirdparty category + $s .= $langs->trans("SuppliersCategoriesShort").': '; + $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; + $sql.= " FROM "; + $sql.= " ".MAIN_DB_PREFIX."socpeople as sp,"; + $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; + $sql.= " ".MAIN_DB_PREFIX."categorie_fournisseur as cs"; + $sql.= " WHERE sp.statut = 1"; // Note that null != '' is false + //$sql.= " AND sp.no_email = 0"; + //$sql.= " AND sp.email != ''"; + //$sql.= " AND sp.entity IN (".getEntity('societe').")"; + $sql.= " AND cs.fk_categorie = c.rowid"; + $sql.= " AND cs.fk_soc = sp.fk_soc"; + $sql.= " GROUP BY c.label"; + $sql.= " ORDER BY c.label"; + $resql = $this->db->query($sql); + + $s.=''; + return $s; } @@ -168,13 +328,19 @@ class mailing_contacts1 extends MailingTargets * Ajoute destinataires dans table des cibles * * @param int $mailing_id Id of emailing - * @param array $filtersarray Requete sql de selection des destinataires + * @param array $filtersarray Optional filter data (deprecated) * @return int <0 si erreur, nb ajout si ok */ function add_to_target($mailing_id,$filtersarray=array()) { global $conf, $langs; + $filter = GETPOST('filter','alpha'); + $filter_jobposition = GETPOST('filter_jobposition','alpha'); + $filter_category = GETPOST('filter_category','alpha'); + $filter_category_customer = GETPOST('filter_category_customer','alpha'); + $filter_category_supplier = GETPOST('filter_category_supplier','alpha'); + $cibles = array(); // List prospects levels @@ -197,27 +363,43 @@ class mailing_contacts1 extends MailingTargets } else dol_print_error($this->db); - // La requete doit retourner: id, email, fk_contact, name, firstname, other - $sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,"; - $sql.= " c.lastname, c.firstname, c.civility as civility_id,"; + // Request must return: id, email, fk_contact, lastname, firstname, other + $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact, sp.lastname, sp.firstname, sp.civility as civility_id, sp.poste as jobposition,"; $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc"; - $sql.= " WHERE c.entity IN (".getEntity('societe').")"; - $sql.= " AND c.email <> ''"; - $sql.= " AND c.no_email = 0"; - $sql.= " AND c.statut = 1"; - $sql.= " AND c.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; - foreach($filtersarray as $key) + $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; + if ($filter_category <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c"; + if ($filter_category <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_contact as cs"; + if ($filter_category_customer <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c2"; + if ($filter_category_customer <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as c2s"; + if ($filter_category_supplier <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c3"; + if ($filter_category_supplier <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_fournisseur as c3s"; + $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; + $sql.= " AND sp.email <> ''"; + $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; + $sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + // Filter on category + if ($filter_category <> 'all') $sql.= " AND cs.fk_categorie = c.rowid AND cs.fk_socpeople = sp.rowid"; + if ($filter_category <> 'all') $sql.= " AND c.label = '".$this->db->escape($filter_category)."'"; + if ($filter_category_customer <> 'all') $sql.= " AND c2s.fk_categorie = c2.rowid AND c2s.fk_soc = sp.fk_soc"; + if ($filter_category_customer <> 'all') $sql.= " AND c2.label = '".$this->db->escape($filter_category_customer)."'"; + if ($filter_category_supplier <> 'all') $sql.= " AND c3s.fk_categorie = c3.rowid AND c3s.fk_soc = sp.fk_soc"; + if ($filter_category_supplier <> 'all') $sql.= " AND c3.label = '".$this->db->escape($filter_category_supplier)."'"; + // Filter on nature + $key = $filter; { - if ($key == 'prospects') $sql.= " AND s.client=2"; //print "xx".$key; + if ($key == 'prospects') $sql.= " AND s.client=2"; foreach($prospectlevel as $codelevel=>$valuelevel) if ($key == 'prospectslevel'.$codelevel) $sql.= " AND s.fk_prospectlevel='".$codelevel."'"; if ($key == 'customers') $sql.= " AND s.client=1"; if ($key == 'suppliers') $sql.= " AND s.fournisseur=1"; } - $sql.= " ORDER BY c.email"; - //print "x".$sql; + // Filter on job position + $key = $filter_jobposition; + if (! empty($key) && $key != 'all') $sql.= " AND sp.poste ='".$this->db->escape($key)."'"; + $sql.= " ORDER BY sp.email"; + //print "wwwwwwx".$sql; // Stocke destinataires dans cibles $result=$this->db->query($sql); @@ -242,8 +424,9 @@ class mailing_contacts1 extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), - 'source_url' => $this->url($obj->id), + ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')).';'. + ($langs->transnoentities("JobPosition").'='.$obj->jobposition), + 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'contact' ); diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php deleted file mode 100644 index a9c05434cd3..00000000000 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ /dev/null @@ -1,222 +0,0 @@ - - * Copyright (C) 2013 Regis Houssin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/modules/mailings/contacts2.modules.php - * \ingroup mailing - * \brief Provides a list of recipients for mailing module - */ - -include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; - - -/** - * \class mailing_contacts2 - * \brief Class to manage a list of personalised recipients for mailing feature - */ -class mailing_contacts2 extends MailingTargets -{ - var $name='ContactsByFunction'; - // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc='Add contacts by function'; - var $require_admin=0; - - var $require_module=array(); - var $picto='contact'; - var $db; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - - /** - * Renvoie url lien vers fiche de la source du destinataire du mailing - * - * @param int $id ID - * @return string Url lien - */ - function url($id) - { - return ''.img_object('',"contact").''; - } - - /** - * This is the main function that returns the array of emails - * - * @param int $mailing_id Id of mailing. No need to use it. - * @param array $filtersarray Function - * @return int <0 if error, number of emails added if ok - */ - function add_to_target($mailing_id,$filtersarray=array()) - { - global $conf,$langs; - - $target = array(); - - // La requete doit retourner: id, email, fk_contact, name, firstname, other - $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname as firstname, sp.civility as civility_id,"; - $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; - $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email <> ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - //$sql.= " AND sp.poste != ''"; - $sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; - if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'"; - $sql.= " ORDER BY sp.lastname, sp.firstname"; - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $obj= $this->db->fetch_object($resql); - $target[] = array( - 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, - 'lastname' => $obj->lastname, - 'firstname' => $obj->firstname, - 'other' => - ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), - 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, - 'source_type' => 'contact' - ); - $i++; - } - } - - return parent::add_to_target($mailing_id, $target); - } - - - /** - * On the main mailing area, there is a box with statistics. - * If you want to add a line in this report you must provide an - * array of SQL request that returns two field: - * One called "label", One called "nb". - * - * @return array Array with SQL requests - */ - function getSqlArrayForStats() - { - global $conf; - - $statssql=array(); - /*for ($i=0; $i<5; $i++) { - $statssql[$i] = "SELECT sp.poste as label"; - $statssql[$i].= ", count(distinct(sp.email)) as nb"; - $statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."societe as s"; - $statssql[$i].= " WHERE s.rowid = sp.fk_soc"; - $statssql[$i].= " AND sp.email != ''"; // Note that null != '' is false - $statssql[$i].= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; - $statssql[$i].= " AND sp.entity IN (".getEntity('societe').")"; - $statssql[$i].= " GROUP BY label"; - $statssql[$i].= " ORDER BY nb DESC"; - $statssql[$i].= " LIMIT $i,1"; - }*/ - - return $statssql; - } - - - /** - * Return here number of distinct emails returned by your selector. - * - * @param string $sql Requete sql de comptage - * @return int - */ - function getNbOfRecipients($sql='') - { - global $conf; - - // We must report here number of contacts when absolutely no filter selected (so all contacts). - // Number with a filter are show in the combo list for each filter. - // If we want a filter "a position is defined", we must add it into formFilter - $sql = "SELECT count(distinct(sp.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; - $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - //$sql.= " AND sp.poste != ''"; - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients - return parent::getNbOfRecipients($sql); - } - - /** - * This is to add a form filter to provide variant of selector - * If used, the HTML select must be called "filter" - * - * @return string A html select zone - */ - function formFilter() - { - global $conf, $langs; - - $langs->load("companies"); - - $sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; - $sql.= " GROUP BY sp.poste"; - $sql.= " ORDER BY sp.poste"; - - $resql = $this->db->query($sql); - - $s=''; - $s.=''; - return $s; - } - -} - diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php deleted file mode 100644 index c16f6869668..00000000000 --- a/htdocs/core/modules/mailings/contacts3.modules.php +++ /dev/null @@ -1,250 +0,0 @@ - - * Copyright (C) 2013 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/modules/mailings/contacts3.modules.php - * \ingroup mailing - * \brief Provides a list of recipients for mailing module - */ - -include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; - - -/** - * Class to manage a list of personalised recipients for mailing feature - */ -class mailing_contacts3 extends MailingTargets -{ - var $name='ContactsByCompanyCategory'; - // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc='Add contacts by company category'; - var $require_admin=0; - - var $require_module=array(); - var $picto='contact'; - var $db; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - /** - * Renvoie url lien vers fiche de la source du destinataire du mailing - * - * @param int $id ID - * @return string Url lien - */ - function url($id) - { - return ''.img_object('',"contact").''; - } - - /** - * This is the main function that returns the array of emails - * - * @param int $mailing_id Id of mailing. No need to use it. - * @param array $filtersarray Category - * @return int <0 if error, number of emails added if ok - */ - function add_to_target($mailing_id,$filtersarray=array()) - { - global $conf,$langs; - - $target = array(); - - // La requete doit retourner: id, email, fk_contact, name, firstname, other - $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname, sp.civility as civility_id,"; - $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; - if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c"; - if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE sp.email <> ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; - if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid"; - if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_soc = sp.fk_soc"; - if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'"; - $sql.= " ORDER BY sp.lastname, sp.firstname"; - - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - - while ($i < $num) - { - $obj= $this->db->fetch_object($resql); - $target[] = array( - 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, - 'lastname' => $obj->lastname, - 'firstname' => $obj->firstname, - 'other' => - ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), - 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, - 'source_type' => 'contact' - ); - $i++; - } - } - - return parent::add_to_target($mailing_id, $target); - } - - - /** - * On the main mailing area, there is a box with statistics. - * If you want to add a line in this report you must provide an - * array of SQL request that returns two field: - * One called "label", One called "nb". - * - * @return array Array with SQL requests - */ - function getSqlArrayForStats() - { - global $conf, $langs; - - $statssql=array(); - /*for ($i=0; $i<5; $i++) { - $statssql[$i] = "SELECT c.label, count(sp.rowid) AS nb"; - $statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."societe as s,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."categorie as c,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $statssql[$i].= " WHERE s.rowid = sp.fk_soc"; - $statssql[$i].= " AND sp.email != ''"; // Note that null != '' is false - $statssql[$i].= " AND sp.entity IN (".getEntity('societe').")"; - $statssql[$i].= " AND cs.fk_categorie = c.rowid"; - $statssql[$i].= " AND cs.fk_soc = sp.fk_soc"; - $statssql[$i].= " GROUP BY c.label"; - $statssql[$i].= " ORDER BY nb DESC"; - $statssql[$i].= " LIMIT $i,1"; - }*/ - - return $statssql; - } - - - /** - * Return here number of distinct emails returned by your selector. - * - * @param string $sql Requete sql de comptage - * @return int Number of recipients - */ - function getNbOfRecipients($sql='') - { - global $conf; - - // We must report here number of contacts when absolutely no filter selected (so all contacts). - // Number with a filter are show in the combo list for each filter. - // If we want a filter "is inside at least one category", we must add it into formFilter - $sql = "SELECT count(distinct(c.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc"; - $sql.= " WHERE c.entity IN (".getEntity('societe').")"; - $sql.= " AND c.email != ''"; // Note that null != '' is false - $sql.= " AND c.no_email = 0"; - $sql.= " AND c.statut = 1"; - /* - $sql = "SELECT count(distinct(sp.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."societe as s,"; - $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; - $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE s.rowid = sp.fk_soc"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND cs.fk_categorie = c.rowid"; - $sql.= " AND cs.fk_soc = sp.fk_soc"; - */ - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients - return parent::getNbOfRecipients($sql); - } - - /** - * This is to add a form filter to provide variant of selector - * If used, the HTML select must be called "filter". - * - * @return string A html select zone - */ - function formFilter() - { - global $conf, $langs; - - $langs->load("companies"); - - $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; - $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " AND cs.fk_categorie = c.rowid"; - $sql.= " AND cs.fk_soc = sp.fk_soc"; - $sql.= " GROUP BY c.label"; - $sql.= " ORDER BY c.label"; - - $resql = $this->db->query($sql); - - $s=''; - $s.=''; - - return $s; - } - -} - diff --git a/htdocs/core/modules/mailings/contacts4.modules.php b/htdocs/core/modules/mailings/contacts4.modules.php deleted file mode 100644 index f4c67874bfb..00000000000 --- a/htdocs/core/modules/mailings/contacts4.modules.php +++ /dev/null @@ -1,252 +0,0 @@ - - * Copyright (C) 2013 Florian HENRY - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/modules/mailings/contacts4.modules.php - * \ingroup mailing - * \brief Provides a list of recipients for mailing module - */ - -include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; - - -/** - * Class to manage a list of personalised recipients for mailing feature - */ -class mailing_contacts4 extends MailingTargets -{ - var $name='ContactsByCategory'; - // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc='Add contacts by category'; - var $require_admin=0; - - var $require_module=array(); - var $picto='contact'; - var $db; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - /** - * Renvoie url lien vers fiche de la source du destinataire du mailing - * - * @param int $id ID - * @return string Url lien - */ - function url($id) - { - return ''.img_object('',"contact").''; - } - - /** - * This is the main function that returns the array of emails - * - * @param int $mailing_id Id of mailing. No need to use it. - * @param array $filtersarray Category - * @return int <0 if error, number of emails added if ok - */ - function add_to_target($mailing_id,$filtersarray=array()) - { - global $conf,$langs; - - $target = array(); - - // La requete doit retourner: id, email, fk_contact, name, firstname, other - $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname, sp.civility as civility_id,"; - $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - if ($filtersarray[0] <> 'all')$sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie_contact as cs ON cs.fk_socpeople=sp.rowid"; - if ($filtersarray[0] <> 'all') $sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; - $sql.= " WHERE sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'"; - $sql.= " ORDER BY sp.lastname, sp.firstname"; - - dol_syslog(get_class($this).':: add_to_target',LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - - while ($i < $num) - { - $obj= $this->db->fetch_object($resql); - $target[] = array( - 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, - 'lastname' => $obj->lastname, - 'firstname' => $obj->firstname, - 'other' => - ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), - 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, - 'source_type' => 'contact' - ); - $i++; - } - }else { - $this->error=$this->db->lasterrno(); - return -1; - } - - return parent::add_to_target($mailing_id, $target); - } - - - /** - * On the main mailing area, there is a box with statistics. - * If you want to add a line in this report you must provide an - * array of SQL request that returns two field: - * One called "label", One called "nb". - * - * @return array Array with SQL requests - */ - function getSqlArrayForStats() - { - global $conf, $langs; - - $statssql=array(); - /*for ($i=0; $i<5; $i++) { - $statssql[$i] = "SELECT c.label, count(sp.rowid) AS nb"; - $statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."societe as s,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."categorie as c,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $statssql[$i].= " WHERE s.rowid = sp.fk_soc"; - $statssql[$i].= " AND sp.email != ''"; // Note that null != '' is false - $statssql[$i].= " AND sp.entity IN (".getEntity('societe').")"; - $statssql[$i].= " AND cs.fk_categorie = c.rowid"; - $statssql[$i].= " AND cs.fk_soc = sp.fk_soc"; - $statssql[$i].= " GROUP BY c.label"; - $statssql[$i].= " ORDER BY nb DESC"; - $statssql[$i].= " LIMIT $i,1"; - }*/ - - return $statssql; - } - - - /** - * Return here number of distinct emails returned by your selector. - * - * @param string $sql Requete sql de comptage - * @return int Number of recipients - */ - function getNbOfRecipients($sql='') - { - global $conf; - - // We must report here number of contacts when absolutely no filter selected (so all contacts). - // Number with a filter are show in the combo list for each filter. - // If we want a filter "is inside at least one category", we must add it into formFilter - $sql = "SELECT count(distinct(c.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql.= " WHERE c.entity IN (".getEntity('societe').")"; - $sql.= " AND c.email != ''"; // Note that null != '' is false - $sql.= " AND c.no_email = 0"; - $sql.= " AND c.statut = 1"; - /* - $sql = "SELECT count(distinct(sp.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."societe as s,"; - $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; - $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE s.rowid = sp.fk_soc"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND cs.fk_categorie = c.rowid"; - $sql.= " AND cs.fk_soc = sp.fk_soc"; - */ - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients - return parent::getNbOfRecipients($sql); - } - - /** - * This is to add a form filter to provide variant of selector - * If used, the HTML select must be called "filter". - * - * @return string A html select zone - */ - function formFilter() - { - global $conf, $langs; - - $langs->load("companies"); - - $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie_contact as cs ON cs.fk_socpeople=sp.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; - $sql.= " WHERE sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " GROUP BY c.label"; - $sql.= " ORDER BY c.label"; - - $resql = $this->db->query($sql); - - dol_syslog(get_class($this).':: formFilter',LOG_DEBUG); - if ($resql) { - $s=''; - $s.=''; - return $s; - } - else { - $this->error=$this->db->lasterrno(); - return -1; - } - - } - -} - diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 05d9e525652..e0226017ede 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -34,7 +34,7 @@ class mailing_fraise extends MailingTargets { var $name='FundationMembers'; // Identifiant du module mailing // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc='Foundation members with emails (by status)'; + var $desc='Foundation members with emails'; // Set to 1 if selector is available for admin users only var $require_admin=0; @@ -108,10 +108,14 @@ class mailing_fraise extends MailingTargets { global $conf, $langs; $langs->load("members"); + $langs->load("categories"); + $langs->load("companies"); $form=new Form($this->db); $s=''; + + // Status $s.=$langs->trans("Status").': '; $s.=' '; $s.=$langs->trans("Type").': '; - $s.=''; $sql = "SELECT rowid, libelle, statut"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type"; $sql.= " WHERE entity = ".$conf->entity; @@ -150,6 +154,47 @@ class mailing_fraise extends MailingTargets } $s.=''; + + $s.=' '; + + $s.=$langs->trans("Category").': '; + $s.=''; + + $s.='
        '; $s.=$langs->trans("DateEndSubscription").':  '; $s.=$langs->trans("After").' > '.$form->select_date(-1,'subscriptionafter',0,0,1,'fraise',1,0,1,0); @@ -200,18 +245,29 @@ class mailing_fraise extends MailingTargets $sql = "SELECT a.rowid as id, a.email as email, null as fk_contact, "; $sql.= " a.lastname, a.firstname,"; $sql.= " a.datefin, a.civility as civility_id, a.login, a.societe"; // Other fields - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; + if ($_POST['filter_category']) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = a.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cm.fk_categorie"; + } + $sql.= " , ".MAIN_DB_PREFIX."adherent_type as ta"; $sql.= " WHERE a.email <> ''"; // Note that null != '' is false $sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + // Filter on status if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1"; if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND a.datefin >= '".$this->db->idate($now)."'"; if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')"; if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0"; + // Filter on date if ($dateendsubscriptionafter > 0) $sql.=" AND datefin > '".$this->db->idate($dateendsubscriptionafter)."'"; if ($dateendsubscriptionbefore > 0) $sql.=" AND datefin < '".$this->db->idate($dateendsubscriptionbefore)."'"; $sql.= " AND a.fk_adherent_type = ta.rowid"; - if ($_POST['filtertype']) $sql.= " AND ta.rowid='".$_POST['filtertype']."'"; - $sql.= " ORDER BY a.email"; + // Filter on type + if ($_POST['filter_type']) $sql.= " AND ta.rowid='".$_POST['filter_type']."'"; + // Filter on category + if ($_POST['filter_category']) $sql.= " AND c.rowid='".$_POST['filter_category']."'"; + $sql.= " ORDER BY a.email"; //print $sql; // Add targets into table diff --git a/htdocs/core/modules/mailings/framboise.modules.php b/htdocs/core/modules/mailings/framboise.modules.php deleted file mode 100644 index 82f7e51e0ef..00000000000 --- a/htdocs/core/modules/mailings/framboise.modules.php +++ /dev/null @@ -1,234 +0,0 @@ - - * Copyright (C) 2005-2009 Regis Houssin - * - * This file is an example to follow to add your own email selector inside - * the Dolibarr email tool. - * Follow instructions given in README file to know what to change to build - * your own emailing list selector. - * Code that need to be changed in this file are marked by "CHANGE THIS" tag. - */ - -/** - * \file htdocs/core/modules/mailings/framboise.modules.php - * \ingroup mailing - * \brief Example file to provide a list of recipients for mailing module - */ - -include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; - - -/** - * Class to manage a list of personalised recipients for mailing feature - */ -class mailing_framboise extends MailingTargets -{ - var $name='MembersCategories'; - // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc="Foundation members with emails (by categories)"; - // Set to 1 if selector is available for admin users only - var $require_admin=0; - - var $require_module=array("adherent","categorie"); - var $picto='user'; - var $db; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - - /** - * This is the main function that returns the array of emails. - * - * @param int $mailing_id Id of mailing. No need to use it. - * @param array $filtersarray If you used the formFilter function. Empty otherwise. - * @return int <0 if error, number of emails added if ok - */ - function add_to_target($mailing_id,$filtersarray=array()) - { - global $conf, $langs; - $langs->load("members"); - $langs->load("companies"); - - $cibles = array(); - - // Select the members from category - $sql = "SELECT a.rowid as id, a.email as email, a.lastname, null as fk_contact, a.firstname,"; - $sql.= " a.datefin, a.civility as civility_id, a.login, a.societe,"; // Other fields - if ($_POST['filter']) $sql.= " c.label"; - else $sql.=" null as label"; - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; - if ($_POST['filter']) - { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = a.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cm.fk_categorie"; - } - $sql.= " WHERE a.email != ''"; - $sql.= " AND a.entity = ".$conf->entity; - if ($_POST['filter']) $sql.= " AND c.rowid='".$_POST['filter']."'"; - $sql.= " ORDER BY a.email"; - - // Stocke destinataires dans cibles - $result=$this->db->query($sql); - if ($result) - { - $num = $this->db->num_rows($result); - $i = 0; - $j = 0; - - dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found"); - - $old = ''; - while ($i < $num) - { - $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) - { - $cibles[$j] = array( - 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, - 'lastname' => $obj->lastname, - 'firstname' => $obj->firstname, - 'other' => - ($langs->transnoentities("Login").'='.$obj->login).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')).';'. - ($langs->transnoentities("DateEnd").'='.dol_print_date($this->db->jdate($obj->datefin),'day')).';'. - ($langs->transnoentities("Company").'='.$obj->societe).';'. - ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''), - 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, - 'source_type' => 'member' - ); - $old = $obj->email; - $j++; - } - - $i++; - } - } - else - { - dol_syslog($this->db->error()); - $this->error=$this->db->error(); - return -1; - } - - return parent::add_to_target($mailing_id, $cibles); - } - - - /** - * On the main mailing area, there is a box with statistics. - * If you want to add a line in this report you must provide an - * array of SQL request that returns two field: - * One called "label", One called "nb". - * - * @return array Array with SQL requests - */ - function getSqlArrayForStats() - { - // CHANGE THIS: Optionnal - - //var $statssql=array(); - //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL"; - return array(); - } - - - /** - * Return here number of distinct emails returned by your selector. - * For example if this selector is used to extract 500 different - * emails from a text file, this function must return 500. - * - * @param string $sql Requete sql de comptage - * @return int Nb of recipients - */ - function getNbOfRecipients($sql='') - { - global $conf; - - $sql = "SELECT count(distinct(a.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; - $sql.= " WHERE a.email != ''"; - $sql.= " AND a.entity = ".$conf->entity; - - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients - return parent::getNbOfRecipients($sql); - } - - /** - * This is to add a form filter to provide variant of selector - * If used, the HTML select must be called "filter" - * - * @return string A html select zone - */ - function formFilter() - { - global $conf, $langs; - - $langs->load("companies"); - $langs->load("categories"); - - $s=''; - $s.=''; - return $s; - - } - - - /** - * Can include an URL link on each record provided by selector shown on target page. - * - * @param int $id Id of member - * @return string Url link - */ - function url($id) - { - return ''.img_object('',"user").''; - } - -} - diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index c97da24d174..6fd8ecfee70 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -418,6 +418,8 @@ class pdf_standard extends CommonStickerGenerator @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + // Output to http stream if (empty($nooutput)) { diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index af0874b8c30..496d054d86c 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) * Copyright (C) 2014 Florian Henry - * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2016-2017 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,9 +56,6 @@ class modAccounting extends DolibarrModules $this->special = 0; $this->picto = 'accounting'; - // Defined if the directory /mymodule/inc/triggers/ contains triggers or not - // $this->triggers = 1; - // Data directories to create when module is enabled $this->dirs = array('/accounting/temp'); diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 041892c35ee..ade0e2c7e75 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -53,7 +53,8 @@ class modAdherent extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Management of members of a foundation or association"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; $this->picto='user'; @@ -75,119 +76,119 @@ class modAdherent extends DolibarrModules //----------- $this->const = array(); $r=0; - + $this->const[$r][0] = "ADHERENT_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "standard"; $this->const[$r][3] = 'Name of PDF model of member'; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_MAIL_RESIL"; $this->const[$r][1] = "texte"; $this->const[$r][2] = "Votre adhésion vient d'être résiliée.\r\nNous espérons vous revoir très bientôt"; $this->const[$r][3] = "Mail de résiliation"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_MAIL_VALID"; $this->const[$r][1] = "texte"; $this->const[$r][2] = "Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\n"; $this->const[$r][3] = "Mail de validation"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_MAIL_VALID_SUBJECT"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "Votre adhésion a été validée"; $this->const[$r][3] = "Sujet du mail de validation"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_MAIL_RESIL_SUBJECT"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "Résiliation de votre adhésion"; $this->const[$r][3] = "Sujet du mail de résiliation"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_MAIL_FROM"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = ""; $this->const[$r][3] = "From des mails"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_MAIL_COTIS"; $this->const[$r][1] = "texte"; $this->const[$r][2] = "Bonjour %FIRSTNAME%,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée"; $this->const[$r][3] = "Mail de validation de cotisation"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_MAIL_COTIS_SUBJECT"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "Reçu de votre cotisation"; $this->const[$r][3] = "Sujet du mail de validation de cotisation"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_CARD_HEADER_TEXT"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "%YEAR%"; $this->const[$r][3] = "Texte imprimé sur le haut de la carte adhérent"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_CARD_FOOTER_TEXT"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "%COMPANY%"; $this->const[$r][3] = "Texte imprimé sur le bas de la carte adhérent"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_CARD_TEXT"; $this->const[$r][1] = "texte"; $this->const[$r][2] = "%FULLNAME%\r\nID: %ID%\r\n%EMAIL%\r\n%ADDRESS%\r\n%ZIP% %TOWN%\r\n%COUNTRY%"; $this->const[$r][3] = "Text to print on member cards"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_MAILMAN_ADMINPW"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = ""; $this->const[$r][3] = "Mot de passe Admin des liste mailman"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_BANK_ACCOUNT"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = ""; $this->const[$r][3] = "ID du Compte banquaire utilise"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_BANK_CATEGORIE"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = ""; $this->const[$r][3] = "ID de la catégorie bancaire des cotisations"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_ETIQUETTE_TYPE"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "L7163"; $this->const[$r][3] = "Type of address sheets"; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "ADHERENT_ETIQUETTE_TEXT"; $this->const[$r][1] = "texte"; $this->const[$r][2] = "%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%"; $this->const[$r][3] = "Text to print on member address sheets"; $this->const[$r][4] = 0; $r++; - + // Boxes //------- $this->boxes = array(0=>array('file'=>'box_members.php','enabledbydefaulton'=>'Home')); @@ -260,8 +261,8 @@ class modAdherent extends DolibarrModules // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - - + + // Exports //-------- $r=0; @@ -325,8 +326,8 @@ class modAdherent extends DolibarrModules $this->import_regex_array[$r]=array('a.civility'=>'code@'.MAIN_DB_PREFIX.'c_civility','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_examplevalues_array[$r]=array('a.civility'=>"MR",'a.lastname'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.birth'=>'1972-10-10','a.statut'=>"0 or 1",'a.note_public'=>"This is a public comment on member",'a.note_private'=>"This is private comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d')); } - - + + /** * Function called when module is enabled. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. @@ -338,16 +339,16 @@ class modAdherent extends DolibarrModules function init($options='') { global $conf,$langs; - + // Permissions $this->remove($options); - + //ODT template /* $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt'; $dirodt=DOL_DATA_ROOT.'/doctemplates/orders'; $dest=$dirodt.'/template_order.odt'; - + if (file_exists($src) && ! file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -360,12 +361,12 @@ class modAdherent extends DolibarrModules return 0; } }*/ - + $sql = array( "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type='member' AND entity = ".$conf->entity, "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','member',".$conf->entity.")" ); - + return $this->_init($sql,$options); - } + } } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 7513b489195..a42c3001b44 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -55,7 +55,8 @@ class modAgenda extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Follow events or rendez-vous. Record manual events into Agendas or let application record automatic events for log tracking."; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; @@ -86,17 +87,17 @@ class modAgenda extends DolibarrModules { while ($obj = $this->db->fetch_object($sqlreadactions)) { - //if (preg_match('/_CREATE$/',$obj->code) && (! in_array($obj->code, array('COMPANY_CREATE','PRODUCT_CREATE','TASK_CREATE')))) continue; // We don't track such events (*_CREATE) by default, we prefer validation (except thirdparty/product/task creation because there is no validation). + //if (preg_match('/_CREATE$/',$obj->code) && (! in_array($obj->code, array('COMPANY_CREATE','PRODUCT_CREATE','TASK_CREATE')))) continue; // We don't track such events (*_CREATE) by default, we prefer validation (except thirdparty/product/task creation because there is no validation). if (preg_match('/^TASK_/',$obj->code)) continue; // We don't track such events by default. //if (preg_match('/^_MODIFY/',$obj->code)) continue; // We don't track such events by default. $this->const[] = array('MAIN_AGENDA_ACTIONAUTO_'.$obj->code, "chaine", "1"); } } - else + else { dol_print_error($this->db->lasterror()); } - + // New pages on tabs // ----------------- $this->tabs = array(); @@ -105,6 +106,13 @@ class modAgenda extends DolibarrModules //------ $this->boxes = array(0=>array('file'=>'box_actions.php','enabledbydefaulton'=>'Home')); + // Cronjobs + //------------ + $this->cronjobs = array( + 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1'), + // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24) + ); + // Permissions //------------ $this->rights = array(); @@ -197,7 +205,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php', 'langs'=>'agenda', - 'position'=>100, + 'position'=>15, 'perms'=>'$user->rights->agenda->myactions->read', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', @@ -235,7 +243,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', - 'position'=>102, + 'position'=>140, 'perms'=>'$user->rights->agenda->myactions->read', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', @@ -247,7 +255,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', 'langs'=>'agenda', - 'position'=>103, + 'position'=>141, 'perms'=>'$user->rights->agenda->myactions->read', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', @@ -259,7 +267,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', 'langs'=>'agenda', - 'position'=>104, + 'position'=>142, 'perms'=>'$user->rights->agenda->myactions->read', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', @@ -271,7 +279,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', 'langs'=>'agenda', - 'position'=>105, + 'position'=>143, 'perms'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$user->rights->agenda->allactions->read', 'target'=>'', @@ -283,7 +291,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', 'langs'=>'agenda', - 'position'=>106, + 'position'=>144, 'perms'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$user->rights->agenda->allactions->read', 'target'=>'', @@ -296,7 +304,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', - 'position'=>112, + 'position'=>110, 'perms'=>'$user->rights->agenda->myactions->read', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', @@ -308,7 +316,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', 'langs'=>'agenda', - 'position'=>113, + 'position'=>111, 'perms'=>'$user->rights->agenda->myactions->read', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', @@ -320,7 +328,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', 'langs'=>'agenda', - 'position'=>114, + 'position'=>112, 'perms'=>'$user->rights->agenda->myactions->read', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', @@ -332,7 +340,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', 'langs'=>'agenda', - 'position'=>115, + 'position'=>113, 'perms'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$user->rights->agenda->allactions->read', 'target'=>'', @@ -344,7 +352,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', 'langs'=>'agenda', - 'position'=>116, + 'position'=>114, 'perms'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$user->rights->agenda->allactions->read', 'target'=>'', @@ -357,7 +365,7 @@ class modAgenda extends DolibarrModules 'mainmenu'=>'agenda', 'url'=>'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', - 'position'=>120, + 'position'=>160, 'perms'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', @@ -407,5 +415,5 @@ class modAgenda extends DolibarrModules $this->export_sql_end[$r] .=' ORDER BY ac.datep'; } - + } diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index 0bb858fa07a..69df9843630 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -48,7 +48,8 @@ class modBarcode extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des codes barres"; - $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 2; $this->picto='barcode'; diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 3125627c007..f26c5fe525f 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -47,7 +47,8 @@ class modBlockedLog extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable a log on some business events into a non reversible log. This module may be mandatory for some countries."; - $this->version = 'development'; // 'development', 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'development'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php index 506eb99b540..01a80d0b702 100644 --- a/htdocs/core/modules/modCollab.class.php +++ b/htdocs/core/modules/modCollab.class.php @@ -42,7 +42,7 @@ class modCollab extends DolibarrModules $this->db = $db; $this->numero = 30000; - + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "portal"; @@ -50,7 +50,8 @@ class modCollab extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the public collaboration features, like shared pad, shared online sheets, etc..."; - $this->version = 'development'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'development'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 7f949501023..8afcc26c80f 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -23,7 +23,7 @@ * \ingroup cron * \brief Description and activation file for module Jobs */ -include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** @@ -39,7 +39,7 @@ class modCron extends DolibarrModules */ function __construct($db) { - global $langs,$conf; + global $langs, $conf; $this->db = $db; $this->numero = 2300; @@ -48,15 +48,16 @@ class modCron extends DolibarrModules // It is used to group modules in module setup page $this->family = "base"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Enable the Dolibarr cron service"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 2; // Name of image file used for this module. - $this->picto='technic'; + $this->picto = 'technic'; // Data directories to create when module is enabled $this->dirs = array(); @@ -67,10 +68,10 @@ class modCron extends DolibarrModules // Dependancies //------------- - $this->hidden = ! empty($conf->global->MODULE_CRON_DISABLED); // A condition to disable module - $this->depends = array(); // List of modules id that must be enabled if this module is enabled - $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->conflictwith = array(); // List of modules id this module is in conflict with + $this->hidden = !empty($conf->global->MODULE_CRON_DISABLED); // A condition to disable module + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->conflictwith = array(); // List of modules id this module is in conflict with $this->langfiles = array("cron"); // Constants @@ -94,18 +95,18 @@ class modCron extends DolibarrModules //------ $this->boxes = array(); - // Permissions - $this->rights = array(); // Permission array used by this module - $this->rights_class = 'cron'; - $r=0; - // Cronjobs $this->cronjobs = array( - 0=>array('label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>10, 'status'=>1, 'test'=>true), - 1=>array('label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>20, 'status'=>0, 'test'=>in_array($db->type, array('mysql','mysqli'))), + 0=>array('label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>50, 'status'=>1, 'test'=>true), + 1=>array('label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>in_array($db->type, array('mysql', 'mysqli'))), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24) ); - + + // Permissions + $this->rights = array(); // Permission array used by this module + $this->rights_class = 'cron'; + $r = 0; + $this->rights[$r][0] = 23001; $this->rights[$r][1] = 'Read cron jobs'; $this->rights[$r][3] = 0; @@ -131,17 +132,17 @@ class modCron extends DolibarrModules $r++; // Main menu entries - $r=0; - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry + $r = 0; + $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry 'titre'=>'CronList', 'url'=>'/cron/list.php?status=-2&leftmenu=admintools', - 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>200, - 'enabled'=>'$conf->cron->enabled && preg_match(\'/^admintools/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'enabled'=>'$conf->cron->enabled && preg_match(\'/^admintools/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both $r++; } } diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 881dd27e414..08564e241aa 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -49,7 +49,8 @@ class modDon extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des dons"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; // Name of png file (without png) used for this module. @@ -135,12 +136,12 @@ class modDon extends DolibarrModules $this->rights[3][2] = 'd'; $this->rights[3][3] = 0; $this->rights[3][4] = 'supprimer'; - - + + // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - + } diff --git a/htdocs/core/modules/modDynamicPrices.class.php b/htdocs/core/modules/modDynamicPrices.class.php index cb6544f4d29..21aa3644e3e 100644 --- a/htdocs/core/modules/modDynamicPrices.class.php +++ b/htdocs/core/modules/modDynamicPrices.class.php @@ -45,7 +45,8 @@ class modDynamicPrices extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the usage of math expressions for prices"; - $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'experimental'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) @@ -83,6 +84,6 @@ class modDynamicPrices extends DolibarrModules $this->rights = array(); $this->rights_class = 'dynamicprices'; $r=0; - + } } diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index cbaf141809f..087828b6cc4 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -54,9 +54,6 @@ class modExpenseReport extends DolibarrModules $this->special = 0; $this->picto='trip'; - // Defined if the directory /mymodule/inc/triggers/ contains triggers or not - $this->triggers = 0; - // Data directories to create when module is enabled. $this->dirs = array("/expensereport/temp"); $r=0; @@ -83,6 +80,13 @@ class modExpenseReport extends DolibarrModules $this->const[$r][4] = 0; $r++; + $this->const[$r][0] = "EXPENSEREPORT_ADDON"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "mod_expensereport_jade"; + $this->const[$r][3] = 'Name of manager to generate expense report ref number'; + $this->const[$r][4] = 0; + $r++; + $this->const[$r][0] = "MAIN_DELAY_EXPENSEREPORTS"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "15"; @@ -114,56 +118,56 @@ class modExpenseReport extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; - + $this->rights[$r][0] = 772; $this->rights[$r][1] = 'Create/modify expense reports'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'creer'; $r++; - + $this->rights[$r][0] = 773; $this->rights[$r][1] = 'Delete expense reports'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'supprimer'; $r++; - + $this->rights[$r][0] = 775; $this->rights[$r][1] = 'Approve expense reports'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'approve'; $r++; - + $this->rights[$r][0] = 776; $this->rights[$r][1] = 'Pay expense reports'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'to_paid'; $r++; - + $this->rights[$r][0] = 777; $this->rights[$r][1] = 'Read expense reports of everybody'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'readall'; $r++; - + $this->rights[$r][0] = 778; $this->rights[$r][1] = 'Create expense reports for everybody'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'writeall_advance'; $r++; - + $this->rights[$r][0] = 779; $this->rights[$r][1] = 'Export expense reports'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'export'; $r++; - + // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php index cc0090c2fc8..70efc2c165f 100644 --- a/htdocs/core/modules/modExport.class.php +++ b/htdocs/core/modules/modExport.class.php @@ -48,8 +48,8 @@ class modExport extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Outils d'exports de donnees Dolibarr (via un assistant)"; - // Possible values for version are: 'experimental' or 'dolibarr' or version - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; $this->picto = 'technic'; @@ -90,11 +90,11 @@ class modExport extends DolibarrModules $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'creer'; - - + + // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - + } } diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php index 7ae60e5e9eb..e3f4a538c4d 100644 --- a/htdocs/core/modules/modExternalRss.class.php +++ b/htdocs/core/modules/modExternalRss.class.php @@ -49,7 +49,8 @@ class modExternalRss extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Ajout de files d'informations RSS dans les ecrans Dolibarr"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 1; $this->picto='rss'; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 40e2a03d161..6e5206ac7a5 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -26,7 +26,7 @@ * \ingroup facture * \brief Fichier de la classe de description et activation du module Facture */ -include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** @@ -50,7 +50,7 @@ class modFacture extends DolibarrModules $this->family = "financial"; $this->module_position = 10; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des factures"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version @@ -58,25 +58,25 @@ class modFacture extends DolibarrModules $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; - $this->picto='bill'; + $this->picto = 'bill'; // Data directories to create when module is enabled $this->dirs = array("/facture/temp"); // Dependencies $this->depends = array('always'=>"modSociete"); - $this->requiredby = array("modComptabilite","modAccounting"); + $this->requiredby = array("modComptabilite", "modAccounting"); $this->conflictwith = array(); - $this->langfiles = array("bills","companies","compta","products"); - $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='text') - $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='text') + $this->langfiles = array("bills", "companies", "compta", "products"); + $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='text') + $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='text') // Config pages $this->config_page_url = array("facture.php"); // Constants $this->const = array(); - $r=0; + $r = 0; $this->const[$r][0] = "FACTURE_ADDON"; $this->const[$r][1] = "chaine"; @@ -110,27 +110,21 @@ class modFacture extends DolibarrModules // Boxes //$this->boxes = array(0=>array(1=>'box_factures_imp.php'),1=>array(1=>'box_factures.php')); $this->boxes = array( - 0=>array('file'=>'box_factures_imp.php','enabledbydefaulton'=>'Home'), - 1=>array('file'=>'box_factures.php','enabledbydefaulton'=>'Home'), - 2=>array('file'=>'box_graph_invoices_permonth.php','enabledbydefaulton'=>'Home') + 0=>array('file'=>'box_factures_imp.php', 'enabledbydefaulton'=>'Home'), + 1=>array('file'=>'box_factures.php', 'enabledbydefaulton'=>'Home'), + 2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home') ); // Cronjobs $this->cronjobs = array( - 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600*24), + 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) ); - // List of cron jobs entries to add - // Example: - // $this->cronjobs=array( - // 0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600) - // ); // Permissions $this->rights = array(); $this->rights_class = 'facture'; - $r=0; + $r = 0; $r++; $this->rights[$r][0] = 11; @@ -204,74 +198,74 @@ class modFacture extends DolibarrModules // Menus //------- - $this->menu = 1; // This module add menu entries. They are coded into menu manager. + $this->menu = 1; // This module add menu entries. They are coded into menu manager. // Exports //-------- - $r=1; + $r = 1; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) - $this->export_icon[$r]='invoice'; - $this->export_permission[$r]=array(array("facture","facture","export","other")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.type'=>"Type",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'none.rest'=>'Rest','f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancySellCode'); - $this->export_TypeFields_array[$r]=array('s.rowid'=>'Numeric','s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>'Numeric','f.facnumber'=>"Text",'f.type'=>"Numeric",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'none.rest'=>"NumericCompute",'f.paye'=>"Boolean",'f.fk_statut'=>'Numeric','f.note_private'=>"Text",'f.note_public'=>"Text",'f.fk_user_author'=>'Numeric','uc.login'=>'Text','f.fk_user_valid'=>'Numeric','uv.login'=>'Text','pj.ref'=>'Text','fd.rowid'=>'Numeric','fd.label'=>'Text','fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company', 'pj.ref'=>'project', 'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user'); - $this->export_special_array[$r]=array('none.rest'=>'getRemainToPay'); - $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid', 'product'=>'fd.rowid', 'none.rest'=>array('f.rowid','f.total_ttc')); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them - $keyforselect='facture'; $keyforelement='invoice'; $keyforaliasextra='extra'; + $this->export_code[$r] = $this->rights_class.'_'.$r; + $this->export_label[$r] = 'CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_icon[$r] = 'invoice'; + $this->export_permission[$r] = array(array("facture", "facture", "export", "other")); + $this->export_fields_array[$r] = array('s.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.facnumber'=>"InvoiceRef", 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", 'fd.subprice'=>"LineUnitPrice", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.total_ht'=>"LineTotalHT", 'fd.total_tva'=>"LineTotalVAT", 'fd.total_ttc'=>"LineTotalTTC", 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode', 'fd.product_type'=>"TypeOfLineServiceOrProduct", 'fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'p.accountancy_code_sell'=>'ProductAccountancySellCode'); + $this->export_TypeFields_array[$r] = array('s.rowid'=>'Numeric', 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'f.rowid'=>'Numeric', 'f.facnumber'=>"Text", 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'none.rest'=>"NumericCompute", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text', 'pj.ref'=>'Text', 'fd.rowid'=>'Numeric', 'fd.label'=>'Text', 'fd.description'=>"Text", 'fd.subprice'=>"Numeric", 'fd.tva_tx'=>"Numeric", 'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.date_start'=>"Date", 'fd.date_end'=>"Date", 'fd.special_code'=>'Numeric', 'fd.product_type'=>"Numeric", 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', 'p.accountancy_code_sell'=>'Text'); + $this->export_entities_array[$r] = array('s.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', 'pj.ref'=>'project', 'fd.rowid'=>'invoice_line', 'fd.label'=>"invoice_line", 'fd.description'=>"invoice_line", 'fd.subprice'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva_tx'=>"invoice_line", 'fd.qty'=>"invoice_line", 'fd.date_start'=>"invoice_line", 'fd.date_end'=>"invoice_line", 'fd.special_code'=>'invoice_line', 'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product', 'p.ref'=>'product', 'p.label'=>'product', 'p.accountancy_code_sell'=>'product', 'f.fk_user_author'=>'user', 'uc.login'=>'user', 'f.fk_user_valid'=>'user', 'uv.login'=>'user'); + $this->export_special_array[$r] = array('none.rest'=>'getRemainToPay'); + $this->export_dependencies_array[$r] = array('invoice_line'=>'fd.rowid', 'product'=>'fd.rowid', 'none.rest'=>array('f.rowid', 'f.total_ttc')); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them + $keyforselect = 'facture'; $keyforelement = 'invoice'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - $keyforselect='facturedet'; $keyforelement='invoice_line'; $keyforaliasextra='extra2'; + $keyforselect = 'facturedet'; $keyforelement = 'invoice_line'; $keyforaliasextra = 'extra2'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - $keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra3'; + $keyforselect = 'product'; $keyforelement = 'product'; $keyforaliasextra = 'extra3'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uv.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; - $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facturedet as fd'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet_extrafields as extra2 on fd.rowid = extra2.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object'; - $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; - $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture').')'; - if(isset($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; + $this->export_sql_start[$r] = 'SELECT DISTINCT '; + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'facture as f'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uv.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; + $this->export_sql_end[$r] .= ' , '.MAIN_DB_PREFIX.'facturedet as fd'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet_extrafields as extra2 on fd.rowid = extra2.fk_object'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object'; + $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; + $this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('facture').')'; + if (isset($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id; $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found) - $this->export_icon[$r]='invoice'; - $this->export_permission[$r]=array(array("facture","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.type'=>"Type",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'none.rest'=>'Rest','f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','p.rowid'=>'PaymentId','p.ref'=>'PaymentRef','p.amount'=>'AmountPayment','pf.amount'=>'AmountPaymentDistributedOnInvoice','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','pt.code'=>'CodePaymentMode','pt.libelle'=>'LabelPaymentMode','p.note'=>'PaymentNote','p.fk_bank'=>'IdTransaction','ba.ref'=>'AccountRef'); - $this->export_TypeFields_array[$r]=array('s.rowid'=>'Numeric','s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"Numeric",'f.facnumber'=>"Text",'f.type'=>"Numeric",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'none.rest'=>'NumericCompute','f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'f.fk_user_author'=>'Numeric','uc.login'=>'Text','f.fk_user_valid'=>'Numeric','uv.login'=>'Text','pj.ref'=>'Text','p.amount'=>'Numeric','pf.amount'=>'Numeric','p.rowid'=>'Numeric','p.ref'=>'Text','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric','p.note'=>'Text','pt.code'=>'Text','pt.libelle'=>'text','ba.ref'=>'Text'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','pj.ref'=>'project','p.rowid'=>'payment','p.ref'=>'payment','p.amount'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','pt.code'=>'payment','pt.libelle'=>'payment','p.note'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user','p.fk_bank'=>'account','ba.ref'=>'account'); - $this->export_special_array[$r]=array('none.rest'=>'getRemainToPay'); - $this->export_dependencies_array[$r]=array('payment'=>'p.rowid', 'none.rest'=>array('f.rowid','f.total_ttc')); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them - $keyforselect='facture'; $keyforelement='invoice'; $keyforaliasextra='extra'; + $this->export_code[$r] = $this->rights_class.'_'.$r; + $this->export_label[$r] = 'CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_icon[$r] = 'invoice'; + $this->export_permission[$r] = array(array("facture", "facture", "export")); + $this->export_fields_array[$r] = array('s.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.facnumber'=>"InvoiceRef", 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef', 'p.amount'=>'AmountPayment', 'pf.amount'=>'AmountPaymentDistributedOnInvoice', 'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber', 'pt.code'=>'CodePaymentMode', 'pt.libelle'=>'LabelPaymentMode', 'p.note'=>'PaymentNote', 'p.fk_bank'=>'IdTransaction', 'ba.ref'=>'AccountRef'); + $this->export_TypeFields_array[$r] = array('s.rowid'=>'Numeric', 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'f.rowid'=>"Numeric", 'f.facnumber'=>"Text", 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'none.rest'=>'NumericCompute', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text', 'pj.ref'=>'Text', 'p.amount'=>'Numeric', 'pf.amount'=>'Numeric', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric', 'p.fk_bank'=>'Numeric', 'p.note'=>'Text', 'pt.code'=>'Text', 'pt.libelle'=>'text', 'ba.ref'=>'Text'); + $this->export_entities_array[$r] = array('s.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', 'pj.ref'=>'project', 'p.rowid'=>'payment', 'p.ref'=>'payment', 'p.amount'=>'payment', 'pf.amount'=>'payment', 'p.datep'=>'payment', 'p.num_paiement'=>'payment', 'pt.code'=>'payment', 'pt.libelle'=>'payment', 'p.note'=>'payment', 'f.fk_user_author'=>'user', 'uc.login'=>'user', 'f.fk_user_valid'=>'user', 'uv.login'=>'user', 'p.fk_bank'=>'account', 'ba.ref'=>'account'); + $this->export_special_array[$r] = array('none.rest'=>'getRemainToPay'); + $this->export_dependencies_array[$r] = array('payment'=>'p.rowid', 'none.rest'=>array('f.rowid', 'f.total_ttc')); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them + $keyforselect = 'facture'; $keyforelement = 'invoice'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uv.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pt ON pt.id = p.fk_paiement'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON b.rowid = p.fk_bank'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON ba.rowid = b.fk_account'; - $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture').')'; - if (isset($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; + $this->export_sql_start[$r] = 'SELECT DISTINCT '; + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'facture as f'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uv.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pt ON pt.id = p.fk_paiement'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON b.rowid = p.fk_bank'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON ba.rowid = b.fk_account'; + $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('facture').')'; + if (isset($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id; $r++; } @@ -284,27 +278,27 @@ class modFacture extends DolibarrModules * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') * @return int 1 if OK, 0 if KO */ - function init($options='') + function init($options = '') { - global $conf,$langs; + global $conf, $langs; // Remove permissions and default values $this->remove($options); //ODT template - $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/invoices/template_invoice.odt'; - $dirodt=DOL_DATA_ROOT.'/doctemplates/invoices'; - $dest=$dirodt.'/template_invoice.odt'; + $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/invoices/template_invoice.odt'; + $dirodt = DOL_DATA_ROOT.'/doctemplates/invoices'; + $dest = $dirodt.'/template_invoice.odt'; - if (file_exists($src) && ! file_exists($dest)) + if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result=dol_copy($src,$dest,0,0); + $result = dol_copy($src, $dest, 0, 0); if ($result < 0) { $langs->load("errors"); - $this->error=$langs->trans('ErrorFailToCopyFile',$src,$dest); + $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); return 0; } } @@ -314,6 +308,6 @@ class modFacture extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[1][2])."','invoice',".$conf->entity.")" ); - return $this->_init($sql,$options); + return $this->_init($sql, $options); } } diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 8752c553a77..54e1eadd735 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -49,7 +49,8 @@ class modFckeditor extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Editeur WYSIWYG"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 2; // Name of png file (without png) used for this module. diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 233b1601842..74c0070c92e 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -96,12 +96,14 @@ class modFournisseur extends DolibarrModules $this->const[$r][4] = 0; $r++; + /* For supplier invoice, we must not have default pdf template on. In most cases, we need to join PDF from supplier, not have a document generated. $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "canelle"; $this->const[$r][3] = 'Nom du gestionnaire de generation des factures fournisseur en PDF'; $this->const[$r][4] = 0; $r++; + */ $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; @@ -272,12 +274,12 @@ class modFournisseur extends DolibarrModules $this->rights[$r][5] = 'approve2'; } - + // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - - + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 237778309c2..c8ef071cf7e 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -23,7 +23,7 @@ * \ingroup gravatar * \brief Description and activation file for module Gravatar */ -include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** @@ -50,7 +50,7 @@ class modGravatar extends DolibarrModules // It is used to group modules in module setup page $this->family = "technic"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Use online Gravatar service (www.gravatar.com) to show photo of users/members (found with their emails).
        Need an internet access."; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version @@ -62,25 +62,25 @@ class modGravatar extends DolibarrModules // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png' - $this->picto='gravatar'; + $this->picto = 'gravatar'; // Data directories to create when module is enabled. // Example: this->dirs = array("/mymodule/temp"); $this->dirs = array(); - $r=0; + $r = 0; // Config pages. Put here list of php page names stored in admmin directory used to setup module. $this->config_page_url = array(); // Dependencies - $this->depends = array(); // List of modules id that must be enabled if this module is enabled - $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(4,3); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(2,7); // Minimum version of Dolibarr required by module + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->phpmin = array(4, 3); // Minimum version of PHP required by module + $this->need_dolibarr_version = array(2, 7); // Minimum version of Dolibarr required by module $this->langfiles = array(); // Constants - $this->const = array(); // List of particular constants to add when module is enabled + $this->const = array(); // List of particular constants to add when module is enabled //Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0), // 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) ); @@ -88,8 +88,8 @@ class modGravatar extends DolibarrModules $this->tabs = array(); // Boxes - $this->boxes = array(); // List of boxes - $r=0; + $this->boxes = array(); // List of boxes + $r = 0; // Add here list of php file(s) stored in core/boxes that contains class to show a box. // Example: @@ -99,16 +99,9 @@ class modGravatar extends DolibarrModules //$r++; - // Cronjobs - $this->cronjobs = array(); // List of cron jobs entries to add - // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) - // ); - $r=0; - // Permissions - $this->rights = array(); // Permission array used by this module - $r=0; + $this->rights = array(); // Permission array used by this module + $r = 0; // Add here list of permission defined by an id, a label, a boolean and two constant strings. // Example: @@ -121,8 +114,8 @@ class modGravatar extends DolibarrModules // Main menu entries - $this->menus = array(); // List of menus to add - $r=0; + $this->menus = array(); // List of menus to add + $r = 0; // Add here entries to declare new menus // Example to declare the Top Menu entry: @@ -169,7 +162,7 @@ class modGravatar extends DolibarrModules // Exports - $r=1; + $r = 1; // Example: // $this->export_code[$r]=$this->rights_class.'_'.$r; diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 9ce003c1a5b..d57800872fd 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -69,9 +69,6 @@ class modHoliday extends DolibarrModules // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' $this->picto='holiday'; - // Defined if the directory /mymodule/inc/triggers/ contains triggers or not - $this->triggers = 0; - // Data directories to create when module is enabled. // Example: this->dirs = array("/mymodule/temp"); $this->dirs = array(); @@ -173,11 +170,11 @@ class modHoliday extends DolibarrModules $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r++; - + // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - + // Exports $r=1; diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index 2efebb58d80..18696ef4b11 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -48,8 +48,8 @@ class modImport extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Outils d'imports de donnees Dolibarr (via un assistant)"; - // Possible values for version are: 'experimental' or 'dolibarr' or version - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; $this->picto = 'technic'; @@ -85,11 +85,11 @@ class modImport extends DolibarrModules $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'run'; - - + + // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - + } } diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 05e98d36454..4f7cb8cacbb 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -48,7 +48,8 @@ class modLabel extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des etiquettes"; - $this->version = 'development'; // 'development' or 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'development'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 2; $this->picto='label'; diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php index 31f51d5d956..27174a7dda0 100644 --- a/htdocs/core/modules/modLdap.class.php +++ b/htdocs/core/modules/modLdap.class.php @@ -46,7 +46,8 @@ class modLdap extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Synchronisation Ldap"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 1; diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index 45d2685abe4..64966e2105c 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -48,7 +48,8 @@ class modMailing extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des EMailings"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; $this->picto='email'; @@ -130,7 +131,7 @@ class modMailing extends DolibarrModules // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - + } diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php index 3900c0549b9..209dcba3d2b 100644 --- a/htdocs/core/modules/modMailmanSpip.class.php +++ b/htdocs/core/modules/modMailmanSpip.class.php @@ -48,7 +48,8 @@ class modMailmanSpip extends DolibarrModules $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Mailman or Spip interface for member module"; - $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 1; @@ -76,10 +77,10 @@ class modMailmanSpip extends DolibarrModules // Permissions $this->rights = array(); $this->rights_class = 'clicktodial'; - + // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - + } } diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index a04c9ac567a..0a7f1a73a67 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -104,10 +104,10 @@ class modMargin extends DolibarrModules // left menu entry $this->menu[$r]=array( - 'fk_menu'=>'fk_mainmenu=accountancy', // Put 0 if this is a top menu + 'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu 'type'=>'left', // This is a Top menu entry 'titre'=>'Margins', - 'mainmenu'=>'accountancy', + 'mainmenu'=>'billing', 'leftmenu'=>'margins', 'url'=>'/margin/index.php', 'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php index dce442720a3..944664f2339 100644 --- a/htdocs/core/modules/modModuleBuilder.class.php +++ b/htdocs/core/modules/modModuleBuilder.class.php @@ -47,7 +47,8 @@ class modModuleBuilder extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "A tool to help developers to build their own module."; - $this->version = 'development'; // 'development', 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'experimental'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) @@ -85,7 +86,7 @@ class modModuleBuilder extends DolibarrModules // Main menu entries //------------------ $this->menu = array(); - + $this->menu[$r]=array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', 'type'=>'left', 'titre'=>'ModuleBuilder', @@ -98,6 +99,6 @@ class modModuleBuilder extends DolibarrModules 'enabled'=>'$conf->modulebuilder->enabled && preg_match(\'/^admintools/\',$leftmenu) && ($user->admin || $conf->global->MODULEBUILDER_FOREVERYONE)', 'target'=>'_modulebuilder', 'user'=>0); - + } } diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 7eb58e32a3a..9d1be806de1 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2016 Pierre-Henry Favre - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -25,7 +25,7 @@ * \ingroup multicurrency * \brief Description and activation file for module MultiCurrency */ -include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** @@ -40,7 +40,7 @@ class modMultiCurrency extends DolibarrModules */ public function __construct($db) { - global $langs,$conf; + global $langs, $conf; $this->db = $db; @@ -57,10 +57,10 @@ class modMultiCurrency extends DolibarrModules $this->module_position = 40; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Module to enter elements with a foreign currency"; - + // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) @@ -70,7 +70,7 @@ class modMultiCurrency extends DolibarrModules // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' - $this->picto='multicurrency'; + $this->picto = 'multicurrency'; // Defined all module parts (triggers, login, substitutions, menus, css, etc...) // for default path (eg: /multicurrency/core/xxxxx) (0=disable, 1=enable) @@ -101,12 +101,12 @@ class modMultiCurrency extends DolibarrModules $this->config_page_url = array("multicurrency.php"); // Dependencies - $this->hidden = false; // A condition to hide module - $this->depends = array(); // List of modules id that must be enabled if this module is enabled - $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5,0); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->conflictwith = array(); // List of modules id this module is in conflict with + $this->phpmin = array(5, 0); // Minimum version of PHP required by module + $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("multicurrency"); // Constants @@ -143,12 +143,12 @@ class modMultiCurrency extends DolibarrModules $this->tabs = array(); // Dictionaries - if (! isset($conf->multicurrency->enabled)) + if (!isset($conf->multicurrency->enabled)) { - $conf->multicurrency=new stdClass(); - $conf->multicurrency->enabled=0; + $conf->multicurrency = new stdClass(); + $conf->multicurrency->enabled = 0; } - $this->dictionaries=array(); + $this->dictionaries = array(); /* Example: if (! isset($conf->multicurrency->enabled)) $conf->multicurrency->enabled=0; // This is to avoid warnings $this->dictionaries=array( @@ -167,7 +167,7 @@ class modMultiCurrency extends DolibarrModules // Boxes // Add here list of php file(s) stored in core/boxes that contains class to show a box. - $this->boxes = array(); // List of boxes + $this->boxes = array(); // List of boxes // Example: //$this->boxes=array( // 0=>array('file'=>'myboxa.php@multicurrency','note'=>'','enabledbydefaulton'=>'Home'), @@ -175,15 +175,9 @@ class modMultiCurrency extends DolibarrModules // 2=>array('file'=>'myboxc.php@multicurrency','note'=>'') //); - // Cronjobs - $this->cronjobs = array(); // List of cron jobs entries to add - // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) - // ); - // Permissions - $this->rights = array(); // Permission array used by this module - $r=0; + $this->rights = array(); // Permission array used by this module + $r = 0; // Add here list of permission defined by an id, a label, a boolean and two constant strings. // Example: @@ -195,8 +189,8 @@ class modMultiCurrency extends DolibarrModules // $r++; // Main menu entries - $this->menu = array(); // List of menus to add - $r=0; + $this->menu = array(); // List of menus to add + $r = 0; // Add here entries to declare new menus // @@ -232,7 +226,7 @@ class modMultiCurrency extends DolibarrModules // Exports - $r=1; + $r = 1; // Example: // $this->export_code[$r]=$this->rights_class.'_'.$r; @@ -260,18 +254,18 @@ class modMultiCurrency extends DolibarrModules * @param string $options Options when enabling module ('', 'noboxes') * @return int 1 if OK, 0 if KO */ - public function init($options='') + public function init($options = '') { $sql = array(); //$this->_load_tables('/multicurrency/sql/'); $res = $this->_init($sql, $options); - + if ($res) { $this->createFirstCurrency(); } - + return $res; } @@ -293,22 +287,22 @@ class modMultiCurrency extends DolibarrModules /** * Function called when module is enabled * Create the currency from general setting - * + * * @return int 1 if OK, 0 if KO */ private function createFirstCurrency() { - global $conf,$user,$langs; - + global $conf, $user, $langs; + if (!MultiCurrency::checkCodeAlreadyExists($conf->currency)) { $langs->loadCacheCurrencies(''); - + $multicurrency = new MultiCurrency($this->db); $multicurrency->code = $conf->currency; $multicurrency->name = $langs->cache_currencies[$conf->currency]['label'].' ('.$langs->getCurrencySymbol($conf->currency).')'; $r = $multicurrency->create($user); - + if ($r > 0) $multicurrency->addRate(1); } } diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index 72c90ca7a6d..a4a56e1da0d 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -45,7 +45,9 @@ class modNotification extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "EMail notifications (push) on business Dolibarr events"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + $this->descriptionlong = 'Module600Long'; + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 1; $this->picto='email'; diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 4be01e561fe..4d64c666c60 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -52,7 +52,8 @@ class modOauth extends DolibarrModules $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Enable OAuth authentication"; - $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version + $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 1; diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index dae39fc00d4..14e0358ea32 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -83,14 +83,14 @@ class modProduct extends DolibarrModules $this->const[$r][3] = 'Module to control product codes'; $this->const[$r][4] = 0; $r++; - + /*$this->const[$r][0] = "PRODUCT_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "standard"; $this->const[$r][3] = 'Default module for document generation'; $this->const[$r][4] = 0; $r++;*/ - + // Boxes $this->boxes = array( 0=>array('file'=>'box_produits.php','enabledbydefaulton'=>'Home'), @@ -133,7 +133,7 @@ class modProduct extends DolibarrModules // Menus //------- - + $this->menu = 1; // This module add menu entries. They are coded into menu manager. /* We can't enable this here because it must be enabled in both product and service module and this create duplicate insert $r=0; @@ -159,13 +159,14 @@ class modProduct extends DolibarrModules $this->export_label[$r]="Products"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("produit","export")); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); - if ($mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR'; + if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR'; if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue')); if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode')); if (! empty($conf->fournisseur->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('s.nom'=>'Supplier','pf.ref_fourn'=>'SupplierRef','pf.unitprice'=>'SuppliersPrices')); if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.cost_price'=>'CostPrice')); if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('group_concat(cat.label)'=>'Categories')); if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote')); + if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; $this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric')); if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text')); @@ -189,7 +190,7 @@ class modProduct extends DolibarrModules if (! empty($conf->fournisseur->enabled)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc'; $this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')'; if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_sql_order[$r] =' GROUP BY p.rowid'; // FIXME The group by used a generic value to say "all fields in select except function fields" - + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { // Exports product multiprice @@ -203,7 +204,7 @@ class modProduct extends DolibarrModules 'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", 'pr.tva_tx'=>'PriceLevelVATRate', 'pr.date_price'=>'DateCreation'); - if ($mysoc->useNPR()) $this->export_fields_array[$r]['pr.recuperableonly']='NPR'; + if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['pr.recuperableonly']='NPR'; //$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'); $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product", 'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product", @@ -246,7 +247,7 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'product_association as pa, '.MAIN_DB_PREFIX.'product as p2'; $this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')'; $this->export_sql_end[$r] .=' AND p.rowid = pa.fk_product_pere AND p2.rowid = pa.fk_product_fils'; - } + } // Imports //-------- @@ -262,8 +263,9 @@ class modProduct extends DolibarrModules $this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.duration'=>"Duration",'p.customcode'=>'CustomCode','p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell*",'p.tobuy'=>"OnBuy*",'p.fk_product_type'=>"Type*",'p.finished'=>'Nature','p.datec'=>'DateCreation'); if (! empty($conf->stock->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue')); if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.cost_price'=>'CostPrice')); - if ($mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.recuperableonly'=>'NPR')); + if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.recuperableonly'=>'NPR')); if (! empty($conf->barcode->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.barcode'=>'BarCode')); + if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit'; // Add extra fields $import_extrafield_sample=array(); $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.')'; @@ -331,7 +333,7 @@ class modProduct extends DolibarrModules 'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", 'pr.tva_tx'=>'PriceLevelVATRate', 'pr.date_price'=>'DateCreation*'); - if ($mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('pr.recuperableonly'=>'NPR')); + if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('pr.recuperableonly'=>'NPR')); $this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','pr.recuperableonly'=>'^[0|1]$'); $this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1", 'pr.price_base_type'=>"HT",'pr.price_level'=>"1", diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index 2fc7d10fe5a..50c93f07220 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -52,7 +52,8 @@ class modReceiptPrinter extends DolibarrModules $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "ReceiptPrinterDesc"; - $this->version = 'development'; // 'development' or 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version + $this->version = 'development'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 1; diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index bf37a7e73d8..6af1e138b90 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -48,7 +48,7 @@ class modSalaries extends DolibarrModules global $conf; $this->db = $db; - $this->numero = 510; + $this->numero = 510; // Perms from 501..519 $this->family = "hr"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) @@ -97,7 +97,7 @@ class modSalaries extends DolibarrModules $r=0; $r++; - $this->rights[$r][0] = 511; + $this->rights[$r][0] = 501; $this->rights[$r][1] = 'Read employee contracts/salaries'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; @@ -105,21 +105,29 @@ class modSalaries extends DolibarrModules $this->rights[$r][5] = ''; $r++; - $this->rights[$r][0] = 512; + $this->rights[$r][0] = 502; $this->rights[$r][1] = 'Create/modify employee contracts/salaries'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'write'; $this->rights[$r][5] = ''; - + $r++; - $this->rights[$r][0] = 513; + $this->rights[$r][0] = 511; + $this->rights[$r][1] = 'Read payment of salaries'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'payment'; + $this->rights[$r][5] = 'read'; + + $r++; + $this->rights[$r][0] = 512; $this->rights[$r][1] = 'Create/modify payment of salaries'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'write'; - $this->rights[$r][5] = ''; - + $this->rights[$r][4] = 'payment'; + $this->rights[$r][5] = 'write'; + $r++; $this->rights[$r][0] = 514; $this->rights[$r][1] = 'Delete contracts/salaries'; @@ -140,8 +148,8 @@ class modSalaries extends DolibarrModules // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - - + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index f9c6a608085..961b031e232 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -145,6 +145,7 @@ class modService extends DolibarrModules $this->export_permission[$r]=array(array("service","export")); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock')); + if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; //$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date'); $this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date'); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric')); @@ -240,6 +241,7 @@ class modService extends DolibarrModules $this->import_tables_creator_array[$r]=array('p'=>'fk_user_author'); // Fields to store import user id $this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.duration'=>"Duration",'p.customcode'=>'CustomCode','p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell*",'p.tobuy'=>"OnBuy*",'p.fk_product_type'=>"Type*",'p.finished'=>'Nature','p.datec'=>'DateCreation'); if (! empty($conf->barcode->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.barcode'=>'BarCode')); + if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit'; // Add extra fields $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity = ".$conf->entity; $resql=$this->db->query($sql); diff --git a/htdocs/core/modules/modSkype.class.php b/htdocs/core/modules/modSkype.class.php index ca9179d5fa3..4c7d862cf66 100644 --- a/htdocs/core/modules/modSkype.class.php +++ b/htdocs/core/modules/modSkype.class.php @@ -48,7 +48,8 @@ class modSkype extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable Skype links into contacts"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index e7e20be5b83..61fe75d8f2e 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -62,7 +62,7 @@ class modStripe extends DolibarrModules // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png' - $this->picto='stripe@stripe'; + $this->picto='stripe'; // Data directories to create when module is enabled. $this->dirs = array(); diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index fc8ad99abf8..6ef7648531a 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -52,7 +52,7 @@ class modSyslog extends DolibarrModules // Can be enabled / disabled only in the main company $this->core_enabled = true; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/modVariants.class.php b/htdocs/core/modules/modVariants.class.php index 892d0903826..358a35b4435 100644 --- a/htdocs/core/modules/modVariants.class.php +++ b/htdocs/core/modules/modVariants.class.php @@ -59,7 +59,7 @@ class modVariants extends DolibarrModules // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = 'Allows creating products variant based on new attributes'; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'experimental'; + $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php index 59e934500b6..f4383bc6dc5 100644 --- a/htdocs/core/modules/modWebServices.class.php +++ b/htdocs/core/modules/modWebServices.class.php @@ -44,7 +44,8 @@ class modWebServices extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the Dolibarr web services server"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php index c5365ba4459..2dd0ee871c5 100644 --- a/htdocs/core/modules/modWebServicesClient.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -44,7 +44,8 @@ class modWebServicesClient extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the web service client to call external supplier web services"; - $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'experimental'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/modWebsites.class.php b/htdocs/core/modules/modWebsites.class.php index 877c78b85eb..d6d984193d9 100644 --- a/htdocs/core/modules/modWebsites.class.php +++ b/htdocs/core/modules/modWebsites.class.php @@ -42,15 +42,16 @@ class modWebsites extends DolibarrModules $this->db = $db; $this->numero = 10000; - + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "portal"; $this->module_position = 50; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); - $this->description = "Enable the public website with CMS features"; - $this->version = 'development'; // 'experimental' or 'dolibarr' or version + $this->description = "Enable to build and serve public websites with CMS features"; + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'experimental'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) @@ -71,7 +72,7 @@ class modWebsites extends DolibarrModules $this->depends = array('modFckeditor'); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->langfiles = array("websites"); + $this->langfiles = array("website"); // Constants //----------- @@ -122,5 +123,22 @@ class modWebsites extends DolibarrModules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both $r++; + + // Exports + $r=1; + + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='MyWebsitePages'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_icon[$r]='globe'; + $keyforclass = 'WebsitePage'; $keyforclassfile='/websites/class/websitepage.class.php'; $keyforelement='Website'; + include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; + //$keyforselect='myobject'; $keyforelement='myobject'; $keyforaliasextra='extra'; + //include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + //$this->export_dependencies_array[$r]=array('mysubobject'=>'ts.rowid', 't.myfield'=>array('t.myfield2','t.myfield3')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'website_page as t, '.MAIN_DB_PREFIX.'website as p'; + $this->export_sql_end[$r] .=' WHERE t.fk_website = p.rowid'; + $this->export_sql_end[$r] .=' AND p.entity IN ('.getEntity('website').')'; + $r++; } } diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php index 482261e9fe1..6c75557864b 100644 --- a/htdocs/core/modules/payment/mod_payment_cicada.php +++ b/htdocs/core/modules/payment/mod_payment_cicada.php @@ -73,7 +73,7 @@ class mod_payment_cicada extends ModeleNumRefPayments $posindice=9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -107,7 +107,7 @@ class mod_payment_cicada extends ModeleNumRefPayments $posindice=9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 5fce4c63a51..78898735f0c 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -61,11 +61,11 @@ class pdf_standardlabel extends CommonStickerGenerator */ function Add_PDF_label(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$photo='') { - global $mysoc,$conf,$langs; - global $forceimgscalewidth,$forceimgscaleheight; + global $mysoc, $conf, $langs; + global $forceimgscalewidth, $forceimgscaleheight; $imgscalewidth=(empty($forceimgscalewidth)?0.3:$forceimgscalewidth); // Scale of image for width (1=Full width of sticker) - $imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker) + $imgscaleheight=(empty($forceimgscaleheight)?0.5:$forceimgscaleheight); // Scale of image for height (1=Full height of sticker) // We are in a new page, then we must add a page if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) { @@ -326,8 +326,6 @@ class pdf_standardlabel extends CommonStickerGenerator if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); - - // Output to http stream clearstatcache(); @@ -346,6 +344,8 @@ class pdf_standardlabel extends CommonStickerGenerator readfile($file); + $this->result = array('fullpath'=>$file); + return 1; } } diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 4605b81de5e..faa62d45431 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -367,8 +367,6 @@ class pdf_tcpdflabel extends CommonStickerGenerator if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); - - // Output to http stream clearstatcache(); @@ -387,6 +385,8 @@ class pdf_tcpdflabel extends CommonStickerGenerator readfile($file); + $this->result = array('fullpath'=>$file); + return 1; } } diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 811a99d5b2a..c7eed903e8e 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -483,6 +483,8 @@ class doc_generic_product_odt extends ModelePDFProduct $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 29df1127242..b42fa3a1fb2 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -40,28 +40,28 @@ class pdf_standard extends ModelePDFProduct * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ public $type; - + /** * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.3 = array(5, 3) */ - public $phpmin = array(5, 2); - + public $phpmin = array(5, 2); + /** * Dolibarr version of the loaded document * @public string @@ -77,7 +77,7 @@ class pdf_standard extends ModelePDFProduct public $marge_basse; public $emetteur; // Objet societe qui emet - + /** * Constructor @@ -105,7 +105,7 @@ class pdf_standard extends ModelePDFProduct $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10; $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - + $this->option_logo = 1; // Affiche logo $this->option_codeproduitservice = 0; // Affiche code produit-service $this->option_multilang = 1; // Dispo en plusieurs langues @@ -145,7 +145,7 @@ class pdf_standard extends ModelePDFProduct $outputlangs->load("deliveries"); $nblignes = count($object->lines); - + if ($conf->produit->dir_output) { // Definition of $dir and $file @@ -160,7 +160,7 @@ class pdf_standard extends ModelePDFProduct $dir = $conf->produit->dir_output . "/" . $objectref; $file = $dir . "/" . $objectref . ".pdf"; } - + $productFournisseur = new ProductFournisseur($this->db); $supplierprices = $productFournisseur->list_product_fournisseur_price($object->id); $object->supplierprices = $supplierprices; @@ -191,11 +191,11 @@ class pdf_standard extends ModelePDFProduct $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -242,7 +242,7 @@ class pdf_standard extends ModelePDFProduct $pdf->SetFont('','B', $default_font_size); $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $tab_top, dol_htmlentitiesbr($object->label), 0, 1); $nexY = $pdf->GetY(); - + $pdf->SetFont('','', $default_font_size); $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, dol_htmlentitiesbr($object->description), 0, 1); $nexY = $pdf->GetY(); @@ -270,7 +270,7 @@ class pdf_standard extends ModelePDFProduct $nexY = $pdf->GetY(); } - + // Affiche notes // TODO There is no public note on product yet $notetoshow=empty($object->note_public)?'':$object->note_public; @@ -424,7 +424,7 @@ class pdf_standard extends ModelePDFProduct // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -518,13 +518,10 @@ class pdf_standard extends ModelePDFProduct $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } */ - + // Affiche zone infos //$posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); - // Affiche zone totaux - //$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); - // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); @@ -542,6 +539,8 @@ class pdf_standard extends ModelePDFProduct if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else @@ -557,7 +556,7 @@ class pdf_standard extends ModelePDFProduct } } - + /** * Show table for lines * @@ -574,42 +573,42 @@ class pdf_standard extends ModelePDFProduct function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='') { global $conf; - + // Force to disable hidetop and hidebottom $hidebottom=0; if ($hidetop) $hidetop=-1; - + $currency = !empty($currency) ? $currency : $conf->currency; $default_font_size = pdf_getPDFFontSize($outputlangs); - + // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); - + if (empty($hidetop)) { $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); - + //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); } - + $pdf->SetDrawColor(128,128,128); $pdf->SetFont('','', $default_font_size - 1); - + // Output Rect $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param - + if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param - + $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); } - + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) { $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); @@ -619,14 +618,14 @@ class pdf_standard extends ModelePDFProduct $pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C'); } } - + $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxup-1, $tab_top+1); $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); } - + $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -640,7 +639,7 @@ class pdf_standard extends ModelePDFProduct $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); } } - + if($conf->global->PRODUCT_USE_UNITS) { $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -649,7 +648,7 @@ class pdf_standard extends ModelePDFProduct 'C'); } } - + $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -659,7 +658,7 @@ class pdf_standard extends ModelePDFProduct $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); } } - + if ($this->atleastonediscount) { $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); @@ -670,7 +669,7 @@ class pdf_standard extends ModelePDFProduct $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); } } - + /** * Show top header of page. * @@ -684,33 +683,33 @@ class pdf_standard extends ModelePDFProduct function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="") { global $conf,$langs,$hookmanager; - + $outputlangs->load("main"); $outputlangs->load("bills"); $outputlangs->load("propal"); $outputlangs->load("companies"); $outputlangs->load("orders"); $default_font_size = pdf_getPDFFontSize($outputlangs); - + if ($object->type == 1) $titlekey='ServiceSheet'; else $titlekey='ProductSheet'; - + pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); - + // Show Draft Watermark if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); } - + $pdf->SetTextColor(0,0,60); $pdf->SetFont('','B', $default_font_size + 3); - + $posy=$this->marge_haute; $posx=$this->page_largeur-$this->marge_droite-100; - + $pdf->SetXY($this->marge_gauche,$posy); - + // Logo $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) @@ -733,23 +732,23 @@ class pdf_standard extends ModelePDFProduct $text=$this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } - + $pdf->SetFont('','B', $default_font_size + 3); $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $title=$outputlangs->transnoentities($titlekey); $pdf->MultiCell(100, 3, $title, '', 'R'); - + $pdf->SetFont('','B',$default_font_size); - + $posy+=5; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R'); - + $posy+=1; $pdf->SetFont('','', $default_font_size - 1); - + /*if ($object->ref_client) { $posy+=5; @@ -757,13 +756,13 @@ class pdf_standard extends ModelePDFProduct $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); }*/ - + /*$posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R'); */ - + // Get contact /* if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) @@ -779,24 +778,24 @@ class pdf_standard extends ModelePDFProduct $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } }*/ - + $posy+=2; - + // Show list of linked objects $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); - + if ($showaddress) { /* // Sender properties $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); - + // Show sender $posy=42; $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; - + // Show sender frame $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); @@ -806,23 +805,23 @@ class pdf_standard extends ModelePDFProduct $pdf->SetFillColor(230,230,230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); $pdf->SetTextColor(0,0,60); - + // Show sender name $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); $posy=$pdf->getY(); - + // Show sender information $pdf->SetXY($posx+2,$posy); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); */ } - + $pdf->SetTextColor(0,0,0); } - + /** * Show footer of page. Need this->emetteur object * @@ -838,6 +837,6 @@ class pdf_standard extends ModelePDFProduct $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; return pdf_pagefoot($pdf,$outputlangs,'PRODUCT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); } - + } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index e050bf8e3eb..be4f5898f85 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -1066,6 +1066,8 @@ class doc_generic_project_odt extends ModelePDFProjects $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 334846ab69b..b2ad0f26c0e 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -154,11 +154,11 @@ class pdf_baleine extends ModelePDFProjects $task = new Task($this->db); $tasksarray = $task->getTasksArray(0,0,$object->id); - if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines + if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines { $tasksarray=array_slice($tasksarray, 0, min(5, count($tasksarray))); } - + $object->lines=$tasksarray; $nblignes=count($object->lines); @@ -329,6 +329,8 @@ class pdf_baleine extends ModelePDFProjects if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 2b58cd59c09..8a288c547d5 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -33,16 +33,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; -if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; -if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; -if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; +if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; +if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -223,7 +224,7 @@ class pdf_beluga extends ModelePDFProjects $iniY = $tab_top + 7; $curY = $tab_top + 7; $nexY = $tab_top + 7; - + $listofreferent=array( 'propal'=>array( 'name'=>"Proposals", @@ -311,7 +312,7 @@ class pdf_beluga extends ModelePDFProjects 'margin'=>'minus', 'disableamount'=>1, 'test'=>$conf->expensereport->enabled && $user->rights->expensereport->lire, - 'lang'=>'trip'), + 'lang'=>'trip'), 'agenda'=>array( 'name'=>"Agenda", 'title'=>"ListActionsAssociatedProject", @@ -322,8 +323,8 @@ class pdf_beluga extends ModelePDFProjects 'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->read, 'lang'=>'agenda') ); - - + + foreach ($listofreferent as $key => $value) { $title=$value['title']; @@ -333,13 +334,13 @@ class pdf_beluga extends ModelePDFProjects $qualified=$value['test']; $langstoload=$value['lang']; $langs->load($langstoload); - + if ($qualified) { //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); //var_dump($elementarray); - + $num = count($elementarray); if ($num >= 0) { @@ -347,7 +348,7 @@ class pdf_beluga extends ModelePDFProjects $curY = $nexY; $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); - + $selectList = $formproject->select_element($tablename, $project->thirdparty->id); $nexY = $pdf->GetY() + 1; $curY = $nexY; @@ -356,7 +357,9 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($this->posxdate, $curY); $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C'); $pdf->SetXY($this->posxsociety, $curY); - $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L'); + $titlethirdparty=$outputlangs->transnoentities("ThirdParty"); + if ($classname == 'ExpenseReport') $titlethirdparty=$langs->trans("User"); + $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $titlethirdparty, 1, 'L'); if (empty($value['disableamount'])) { $pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities("AmountHTShort"), 1, 'R'); @@ -368,30 +371,39 @@ class pdf_beluga extends ModelePDFProjects } $pdf->SetXY($this->posxstatut, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R'); - + if (is_array($elementarray) && count($elementarray) > 0) { $nexY = $pdf->GetY(); $curY = $nexY; - + $total_ht = 0; $total_ttc = 0; $num = count($elementarray); for ($i = 0; $i < $num; $i ++) { + $idofelement=$elementarray[$i]; + if ($classname == 'ExpenseReport') + { + // We get id of expense report + $expensereportline=new ExpenseReportLine($this->db); + $expensereportline->fetch($idofelement); + $idofelement = $expensereportline->fk_expensereport; + } + $element = new $classname($this->db); - $element->fetch($elementarray[$i]); + $element->fetch($idofelement); $element->fetch_thirdparty(); // print $classname; - + $qualifiedfortotal = true; if ($key == 'invoice') { if ($element->close_code == 'replaced') $qualifiedfortotal = false; // Replacement invoice } - + $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L'); - + // Date if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') $date = $element->date_commande; @@ -404,15 +416,23 @@ class pdf_beluga extends ModelePDFProjects if (empty($date)) $date = $element->datev; // Fiche inter } - + $pdf->SetXY($this->posxdate, $curY); $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, dol_print_date($date, 'day'), 1, 'C'); - + $pdf->SetXY($this->posxsociety, $curY); if (is_object($element->thirdparty)) + { $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $element->thirdparty->name, 1, 'L'); - - // Amount without tax + } + elseif ($classname == 'ExpenseReport') + { + $fuser=new User($this->db); + $fuser->fetch($element->fk_user_author); + $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1, 'L'); + } + + // Amount without tax if (empty($value['disableamount'])) { $pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ' '), 1, 'R'); @@ -422,7 +442,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R'); } - + // Status if ($element instanceof CommonInvoice) { // This applies for Facture and FactureFournisseur @@ -432,7 +452,7 @@ class pdf_beluga extends ModelePDFProjects } $pdf->SetXY($this->posxstatut, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1, 'R', false, 1, '', '', true, 0, true); - + if ($qualifiedfortotal) { $total_ht = $total_ht + $element->total_ht; $total_ttc = $total_ttc + $element->total_ttc; @@ -440,7 +460,7 @@ class pdf_beluga extends ModelePDFProjects $nexY = $pdf->GetY(); $curY = $nexY; } - + if (empty($value['disableamount'])) { $curY = $nexY; $pdf->SetXY($this->posxref, $curY); @@ -483,6 +503,8 @@ class pdf_beluga extends ModelePDFProjects if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index 49e4586d07b..fca1954c48a 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -75,7 +75,7 @@ class mod_project_simple extends ModeleNumRefProjects $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."projet"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); if ($resql) @@ -111,7 +111,7 @@ class mod_project_simple extends ModeleNumRefProjects $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."projet"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 187018e0031..17e08dd4fd3 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -829,6 +829,8 @@ class doc_generic_task_odt extends ModelePDFTask $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index 97203d402d5..fe4087cbd15 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -76,7 +76,7 @@ class mod_task_simple extends ModeleNumRefTask $sql = "SELECT MAX(CAST(SUBSTRING(task.ref FROM " . $posindice . ") AS SIGNED)) as max"; $sql .= " FROM " . MAIN_DB_PREFIX . "projet_task AS task, "; $sql .= MAIN_DB_PREFIX . "projet AS project WHERE task.fk_projet=project.rowid"; - $sql .= " AND task.ref LIKE '" . $this->prefix . "____-%'"; + $sql .= " AND task.ref LIKE '" . $this->db->escape($this->prefix) . "____-%'"; $sql .= " AND project.entity = " . $conf->entity; $resql=$db->query($sql); if ($resql) @@ -112,7 +112,7 @@ class mod_task_simple extends ModeleNumRefTask $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $resql=$db->query($sql); if ($resql) diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 0339f2ea255..372edb5e5de 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -167,7 +167,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte.=$file['name'].'
        '; } $texte.='
        '; - + if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { // Model for creation @@ -252,7 +252,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if (! is_object($object)) { $id = $object; - $object = new Propale($this->db); + $object = new Propal($this->db); $result=$object->fetch($id); if ($result < 0) { @@ -494,6 +494,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 972a75eecc8..913f1e3bc29 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -120,7 +120,7 @@ class pdf_azur extends ModelePDFPropales } $this->posxdiscount=162; $this->postotalht=174; - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup; $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { @@ -273,7 +273,7 @@ class pdf_azur extends ModelePDFPropales $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -292,10 +292,10 @@ class pdf_azur extends ModelePDFPropales $pdf->SetDrawColor(128,128,128); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); - $pdf->SetSubject($outputlangs->transnoentities("CommercialProposal")); + $pdf->SetSubject($outputlangs->transnoentities("PdfCommercialProposalTitle")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialProposal")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfCommercialProposalTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -322,19 +322,19 @@ class pdf_azur extends ModelePDFPropales $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - + $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0; $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; - + //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; + $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - + $tab_top = 90; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); $tab_height = 130; @@ -383,7 +383,7 @@ class pdf_azur extends ModelePDFPropales $notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs); if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email; if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone; - } + } if ($notetoshow) { $tab_top = 88 + $height_incoterms; @@ -451,8 +451,6 @@ class pdf_azur extends ModelePDFPropales // Description of product line $curX = $this->posxdesc-1; - $showpricebeforepagebreak=1; - $pdf->startTransaction(); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); $pageposafter=$pdf->getPage(); @@ -554,14 +552,14 @@ class pdf_azur extends ModelePDFPropales // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; $localtax2_rate=$object->lines[$i]->localtax2_tx; $localtax1_type=$object->lines[$i]->localtax1_type; - $localtax2_type=$object->lines[$i]->localtax2_type; - + $localtax2_type=$object->lines[$i]->localtax2_type; + if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100; if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; @@ -669,7 +667,7 @@ class pdf_azur extends ModelePDFPropales { $posy=$this->_signature_area($pdf, $object, $posy, $outputlangs); } - + // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); @@ -761,6 +759,8 @@ class pdf_azur extends ModelePDFPropales if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else @@ -1012,6 +1012,8 @@ class pdf_azur extends ModelePDFPropales // Show VAT by rates and total $pdf->SetFillColor(248,248,248); + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $this->atleastoneratenotnull=0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { @@ -1105,7 +1107,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1188,7 +1190,6 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); } @@ -1428,7 +1429,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('','B',$default_font_size + 3); $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $title=$outputlangs->transnoentities("CommercialProposal"); + $title=$outputlangs->transnoentities("PdfCommercialProposalTitle"); $pdf->MultiCell(100, 4, $title, '', 'R'); $pdf->SetFont('','B',$default_font_size); @@ -1481,7 +1482,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 28260de97d8..0e434fb1e38 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -75,7 +75,7 @@ class mod_propale_marbre extends ModeleNumRefPropales $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."propal"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -112,7 +112,7 @@ class mod_propale_marbre extends ModeleNumRefPropales $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."propal"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 25ccecb253c..ec0b0b241e2 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -88,9 +88,12 @@ class mod_propale_saphir extends ModeleNumRefPropales global $conf,$langs,$mysoc; $old_code_client=$mysoc->code_client; + $old_code_type=$mysoc->typent_code; $mysoc->code_client='CCCCCCCCCC'; + $mysoc->typent_code='TTTTTTTTTT'; $numExample = $this->getNextValue($mysoc,''); $mysoc->code_client=$old_code_client; + $mysoc->typent_code=$old_code_type; if (! $numExample) { @@ -121,8 +124,8 @@ class mod_propale_saphir extends ModeleNumRefPropales return 0; } - $date=$propal->datep; - $customercode=$objsoc->code_client; + $date = $propal->date; + $numFinal=get_next_value($db,$mask,'propal','ref','',$objsoc,$date); return $numFinal; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 11ee8a32d7d..da1223526db 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -275,7 +275,9 @@ class pdf_paiement if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); - + + $this->result = array('fullpath'=>$file); + return 1; } diff --git a/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php b/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php index f20e912e1ed..108b3bd6ce6 100644 --- a/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php @@ -274,6 +274,8 @@ class pdf_paiement_fourn if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index edee43b274c..539d5df8c2a 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -459,6 +459,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 6e875af78f2..fafde547659 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -82,7 +82,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; - $sql.= " WHERE ref LIKE '".$this->prefixinvoice."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefixinvoice)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); if ($resql) @@ -103,7 +103,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; - $sql.= " WHERE ref LIKE '".$this->prefixcreditnote."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefixcreditnote)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -124,7 +124,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; - $sql.= " WHERE ref LIKE '".$this->prefixdeposit."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefixdeposit)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -202,7 +202,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices { $date=$object->date; // This is invoice date (not creation date) $yymm = strftime("%y%m",$date); - + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is else $num = sprintf("%04s",$max+1); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 1e7e6f4bcad..b03f6348ebb 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -539,6 +539,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else @@ -620,7 +622,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -632,7 +634,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); @@ -717,16 +719,25 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $useborder=0; + // Total TTC $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0,0,60); $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); + $creditnoteamount=0; + $depositsamount=0; + //$creditnoteamount=$object->getSumCreditNotesUsed(); + //$depositsamount=$object->getSumDepositsUsed(); + //print "x".$creditnoteamount."-".$depositsamount;exit; + $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); + if (! empty($object->paye)) $resteapayer=0; + if ($deja_regle > 0) { $index++; @@ -743,7 +754,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1); $pdf->SetFont('','', $default_font_size - 1); $pdf->SetTextColor(0,0,0); } @@ -877,6 +888,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices */ function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { + global $conf; + + $sign=1; + if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; + $tab3_posx = 120; $tab3_top = $posy + 8; $tab3_width = 80; @@ -910,8 +926,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFont('','', $default_font_size - 4); + // Loop on each deposits and credit notes included + // + // Loop on each payment - $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,"; + $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,"; $sql.= " cp.code"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf, ".MAIN_DB_PREFIX."paiementfourn as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; @@ -929,7 +948,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($tab3_posx, $tab3_top+$y); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); $pdf->SetXY($tab3_posx+21, $tab3_top+$y); - $pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * (($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', 0); $pdf->SetXY($tab3_posx+40, $tab3_top+$y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code); diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index 0a017e3bc51..9788ac4c887 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -85,7 +85,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); if ($resql) @@ -120,7 +120,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index c882ed89800..7907ea741f9 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -110,17 +110,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($conf->global->PRODUCT_USE_UNITS) { - $this->posxtva=99; + $this->posxtva=95; $this->posxup=114; - $this->posxqty=130; + $this->posxqty=132; $this->posxunit=147; } else { - $this->posxtva=112; + $this->posxtva=110; $this->posxup=126; $this->posxqty=145; } - //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxup = $this->posxtva; // posxtva is picture position reference $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { @@ -167,6 +167,44 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $outputlangs->load("products"); $outputlangs->load("orders"); + $nblignes = count($object->lines); + + // Loop on each lines to detect if there is at least one image to show + $realpatharray=array(); + if (! empty($conf->global->MAIN_GENERATE_SUPPLIER_ORDER_WITH_PICTURE)) + { + for ($i = 0 ; $i < $nblignes ; $i++) + { + if (empty($object->lines[$i]->fk_product)) continue; + + $objphoto = new Product($this->db); + $objphoto->fetch($object->lines[$i]->fk_product); + + if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) + { + $pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/"; + $dir = $conf->product->dir_output.'/'.$pdir; + } + else + { + $pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/'; + $dir = $conf->product->dir_output.'/'.$pdir; + } + + $realpath=''; + foreach ($objphoto->liste_photos($dir,1) as $key => $obj) + { + $filename=$obj['photo']; + //if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette']; + $realpath = $dir.$filename; + break; + } + + if ($realpath) $realpatharray[$i]=$realpath; + } + } + if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva; + if ($conf->fournisseur->dir_output.'/commande') { $object->fetch_thirdparty(); @@ -338,16 +376,52 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage $pdf->SetTextColor(0,0,0); + // Define size of image if we need it + $imglinesize=array(); + if (! empty($realpatharray[$i])) $imglinesize=pdf_getSizeForImage($realpatharray[$i]); + $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore=$pdf->getPage(); + $showpricebeforepagebreak=1; + $posYAfterImage=0; + $posYAfterDescription=0; + + // We start with Photo of product line + if (!empty($imglinesize['width']) && !empty($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page + { + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($pageposbefore+1); + + $curY = $tab_top_newpage; + $showpricebeforepagebreak=0; + } + + if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) + { + $curX = $this->posxpicture-1; + $pdf->Image($realpatharray[$i], $curX + (($this->posxtva-$this->posxpicture-$imglinesize['width'])/2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi + // $pdf->Image does not increase value return by getY, so we save it manually + $posYAfterImage=$curY+$imglinesize['height']; + } // Description of product line $curX = $this->posxdesc-1; $showpricebeforepagebreak=1; $pdf->startTransaction(); - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1); + if ($posYAfterImage > 0) + { + $descWidth = $this->posxpicture-$curX; + } + else + { + $descWidth = $this->posxtva-$curX; + } + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$descWidth,3,$curX,$curY,$hideref,$hidedesc,1); + $pageposafter=$pdf->getPage(); if ($pageposafter > $pageposbefore) // There is a pagebreak { @@ -355,7 +429,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pageposafter=$pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,1); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$descWidth,3,$curX,$curY,$hideref,$hidedesc,1); $posyafter=$pdf->GetY(); if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text { @@ -439,7 +513,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -472,6 +546,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0; $this->tva[$vatrate] += $tvaligne; + if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage; // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) @@ -563,6 +638,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else @@ -718,7 +795,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -730,7 +807,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); @@ -829,7 +906,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->SetFont('','', $default_font_size - 1); @@ -840,7 +917,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders //$creditnoteamount=$object->getSumCreditNotesUsed(); //$depositsamount=$object->getSumDepositsUsed(); //print "x".$creditnoteamount."-".$depositsamount;exit; - $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); + $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); if (! empty($object->paye)) $resteapayer=0; if ($deja_regle > 0) @@ -924,7 +1001,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { - $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); + $pdf->line($this->posxtva, $tab_top, $this->posxtva, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxtva-3, $tab_top+1); @@ -932,7 +1009,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } } - $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); + $pdf->line($this->posxup, $tab_top, $this->posxup, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxup-1, $tab_top+1); @@ -1124,7 +1201,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=1; $pdf->SetTextColor(0,0,60); diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 6fbfb4b1bf4..2b657dbd962 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -442,6 +442,8 @@ class pdf_standard extends ModelePDFSuppliersPayments if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index fb06c028aed..97c7b077b22 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_payment/modules_supplier /** * Class to manage customer payment numbering rules Ant */ -class mod_supplier_payment_brodator extends ModeleNumRefPayments +class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments { var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $error = ''; diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php index e7146e2e1fd..b7eee9a3544 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_payment/modules_supplier /** * Class to manage customer payment numbering rules Cicada */ -class mod_supplier_payment_bronan extends ModeleNumRefPayments +class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments { var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $prefix='SPAY'; @@ -73,7 +73,7 @@ class mod_supplier_payment_bronan extends ModeleNumRefPayments $posindice=9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -107,7 +107,7 @@ class mod_supplier_payment_bronan extends ModeleNumRefPayments $posindice=10; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn"; - $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php index d8586777d30..56c5bd94ae0 100644 --- a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php +++ b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php @@ -48,11 +48,11 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator } /** - * \class ModeleNumRefPayments + * \class ModeleNumRefSupplierPayments * \brief Payment numbering references mother class */ -abstract class ModeleNumRefPayments +abstract class ModeleNumRefSupplierPayments { var $error=''; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 212685ba519..4f445501669 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -486,6 +486,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index c5aabf27bf9..d48543442f4 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -108,7 +108,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->posxqty=145; $this->posxdiscount=162; $this->postotalht=174; - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxup=$this->posxtva; $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { @@ -177,7 +177,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } - + $realpath=''; foreach ($objphoto->liste_photos($dir,1) as $key => $obj) { @@ -357,7 +357,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $posYAfterDescription=0; // We start with Photo of product line - if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page + if (!empty($imglinesize['width']) && !empty($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page { $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); @@ -368,7 +368,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $showpricebeforepagebreak=0; } - if (isset($imglinesize['width']) && isset($imglinesize['height'])) + if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) { $curX = $this->posxpicture-1; $pdf->Image($realpatharray[$i], $curX + (($this->posxtva-$this->posxpicture-$imglinesize['width'])/2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi @@ -380,7 +380,15 @@ class pdf_aurore extends ModelePDFSupplierProposal $curX = $this->posxdesc-1; $pdf->startTransaction(); - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); + if ($posYAfterImage > 0) + { + $descWidth = $this->posxpicture-$curX; + } + else + { + $descWidth = $this->posxtva-$curX; + } + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$descWidth,3,$curX,$curY,$hideref,$hidedesc,1); $pageposafter=$pdf->getPage(); if ($pageposafter > $pageposbefore) // There is a pagebreak @@ -389,7 +397,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pageposafter=$pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$descWidth,3,$curX,$curY,$hideref,$hidedesc); $pageposafter=$pdf->getPage(); $posyafter=$pdf->GetY(); @@ -445,7 +453,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($up_excl_tax > 0) $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); */ - + // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); @@ -466,11 +474,11 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($total_excl_tax > 0) $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); */ - + // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -597,6 +605,8 @@ class pdf_aurore extends ModelePDFSupplierProposal if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); + $this->result = array('fullpath'=>$file); + return 1; // Pas d'erreur } else @@ -941,7 +951,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1035,7 +1045,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $resteapayer = $object->total_ttc - $deja_regle; if (! empty($object->paye)) $resteapayer=0; */ - + if ($deja_regle > 0) { $index++; @@ -1131,20 +1141,10 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); } - if (! empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE)) - { - $pdf->line($this->posxpicture-1, $tab_top, $this->posxpicture-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - //$pdf->SetXY($this->posxpicture-1, $tab_top+1); - //$pdf->MultiCell($this->posxtva-$this->posxpicture-1,2, $outputlangs->transnoentities("Photo"),'','C'); - } - } - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { - //$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); - $pdf->line($this->posxtva-2, $tab_top, $this->posxtva-2, $tab_top + $tab_height); + $pdf->line($this->posxtva, $tab_top, $this->posxtva, $tab_top + $tab_height); + //$pdf->line($this->posxtva-2, $tab_top, $this->posxtva-2, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxtva-5, $tab_top+1); @@ -1297,7 +1297,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index 07d027a68dd..26ccb038dda 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -75,7 +75,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); @@ -112,7 +112,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal"; - $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index b059c63e003..34207496ea4 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -109,6 +109,11 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface if (empty($conf->global->SYSLOG_FILE)) $tmp=DOL_DATA_ROOT.'/dolibarr.log'; else $tmp=str_replace('DOL_DATA_ROOT', DOL_DATA_ROOT, $conf->global->SYSLOG_FILE); + if (! empty($conf->global->SYSLOG_FILE_ONEPERSESSION)) + { + $suffixinfilename = '_'.session_name(); + } + return $suffixinfilename?preg_replace('/\.log$/i', $suffixinfilename.'.log', $tmp):$tmp; } diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index e0283ac9a9f..1f2f499fbac 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -49,7 +49,7 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface public function isActive() { global $conf; - + // This function does not exists on some ISP (Ex: Free in France) if (!function_exists('openlog')) return 0; @@ -81,15 +81,15 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface */ public function checkConfiguration() { - global $langs; + global $conf, $langs; $errors = array(); - $facility = SYSLOG_FACILITY; + $facility = constant($conf->global->SYSLOG_FACILITY); if ($facility) { // Only LOG_USER supported on Windows - if (! empty($_SERVER["WINDIR"])) $facility='LOG_USER'; + if (! empty($_SERVER["WINDIR"])) $facility=constant('LOG_USER'); dol_syslog("admin/syslog: facility ".$facility); } diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index b7079dde30e..36d71568566 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -313,7 +313,7 @@ class doc_generic_user_odt extends ModelePDFUser { $socobject=$object->client; } - + // Open and load template require_once ODTPHP_PATH.'odf.php'; try { @@ -332,7 +332,7 @@ class doc_generic_user_odt extends ModelePDFUser $this->error=$e->getMessage(); return -1; } - + // Make substitutions into odt $array_user=$this->get_substitutionarray_user($object,$outputlangs); $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); @@ -366,7 +366,7 @@ class doc_generic_user_odt extends ModelePDFUser { } } - + // Replace labels translated $tmparray=$outputlangs->get_translations_for_substitutions(); foreach($tmparray as $key=>$value) @@ -408,6 +408,8 @@ class doc_generic_user_odt extends ModelePDFUser $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else @@ -420,12 +422,13 @@ class doc_generic_user_odt extends ModelePDFUser return -1; } - function get_substitutionarray_object($object,$outputlangs) { + function get_substitutionarray_object($object,$outputlangs,$array_key='object') { + $array_other=array(); foreach($object as $key => $value) { - if(!is_array($value) && !is_object($value)) { - $array_other['object_'.$key] = $value; + if (!is_array($value) && !is_object($value)) { + $array_other[$array_key.'_'.$key] = $value; } - } + } return $array_other; } diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 35367052796..453bde8515f 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -485,6 +485,8 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $odfHandler=null; // Destroy object + $this->result = array('fullpath'=>$file); + return 1; // Success } else diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 5b29d25202e..69056ff02be 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -36,7 +36,7 @@ $action=GETPOST('action','alpha'); $modulepart=GETPOST('modulepart','alpha')?GETPOST('modulepart','alpha'):'produit|service'; $original_file = GETPOST("file"); $backtourl=GETPOST('backtourl'); -$cancel=GETPOST("cancel"); +$cancel=GETPOST('cancel','alpha'); // Security check if (empty($modulepart)) accessforbidden('Bad value for modulepart'); diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 62821372e56..6c5f563e106 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2017 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2016 Charlie Benke * @@ -42,12 +42,12 @@ var alwayseditable = jQuery("#alwayseditable"); var list = jQuery("#list"); '); + init_typeoffields(''); jQuery("#type").change(function() { init_typeoffields($(this).val()); }); @@ -130,15 +130,15 @@ - + - + - +
        trans("Label"); ?>
        trans("Label"); ?>
        trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)
        trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)
        trans("Type"); ?> -selectarray('type',$type2label,GETPOST('type')); ?> +selectarray('type',$type2label,GETPOST('type','alpha')); ?>
        trans("Size"); ?>
        trans("Size"); ?>
        @@ -147,7 +147,7 @@ - + + + - + - + - + - + - +global->MAIN_CAN_HIDE_EXTRAFIELDS)) { ?> - + + +multicompany->enabled) { ?> + global->MAIN_FEATURES_LEVEL >= 2) { ?> +
        - + textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?> textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?> @@ -158,26 +158,31 @@
        trans("Position"); ?>
        trans("Position"); ?>
        trans("LanguageFile"); ?>
        textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>">
        textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
        trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>">
        trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>
        trans("Unique"); ?>>
        trans("Unique"); ?>>
        trans("Required"); ?>>
        trans("Required"); ?>>
        trans("AlwaysEditable"); ?>>
        trans("AlwaysEditable"); ?>>
        trans("Hidden"); ?>>
        trans("Hidden"); ?>>
        trans("AllEntities"); ?>>
        trans("ByDefaultInList"); ?> trans("FeatureNotYetSupported")); ?> ->
        >
        diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 6f049c506a3..85cfe510df8 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -41,12 +41,12 @@ var alwayseditable = jQuery("#alwayseditable"); var list = jQuery("#list"); // Case of computed field - if (type == 'varchar' || type == 'int' || type == 'double' || type == 'price') { - jQuery("tr.extra_computed_value").show(); + if (type == 'varchar' || type == 'int' || type == 'double' || type == 'price') { + jQuery("tr.extra_computed_value").show(); } else { computed_value.val(''); jQuery("tr.extra_computed_value").hide(); - } + } if (computed_value.val()) { console.log("We enter a computed formula"); @@ -73,7 +73,7 @@ jQuery("#default_value, #unique, #required, #alwayseditable, #ishidden, #list").attr('disabled', false); jQuery("tr.extra_default_value, tr.extra_unique, tr.extra_required, tr.extra_alwayseditable, tr.extra_ishidden, tr.extra_list").show(); } - + if (type == 'date') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'datetime') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} else if (type == 'double') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} @@ -91,19 +91,19 @@ else if (type == 'separate') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();} else { // type = string size.val('').prop('disabled', true); - unique.removeAttr('disabled'); + unique.removeAttr('disabled'); } if (type == 'separate') { - required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.val('').prop('disabled', true); - jQuery('#size, #default_value').val('').prop('disabled', true); + required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.val('').prop('disabled', true); + jQuery('#size, #default_value').val('').prop('disabled', true); } else { default_value.removeAttr('disabled'); - required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.val('').removeAttr('disabled'); - } + required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.val('').removeAttr('disabled'); + } } init_typeoffields(jQuery("#type").val()); jQuery("#type").change(function() { @@ -113,7 +113,7 @@ // If we enter a formula, we disable other fields jQuery("#computed_value").keyup(function() { init_typeoffields(jQuery('#type').val()); - }); + }); }); @@ -129,20 +129,20 @@ attribute_type[$attrname]; -$size=$extrafields->attribute_size[$attrname]; -$computed=$extrafields->attribute_computed[$attrname]; -$default=$extrafields->attribute_default[$attrname]; -$unique=$extrafields->attribute_unique[$attrname]; -$required=$extrafields->attribute_required[$attrname]; -$pos=$extrafields->attribute_pos[$attrname]; -$alwayseditable=$extrafields->attribute_alwayseditable[$attrname]; -$param=$extrafields->attribute_param[$attrname]; -$perms=$extrafields->attribute_perms[$attrname]; -$list=$extrafields->attribute_list[$attrname]; -if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) { - $ishidden=$extrafields->attribute_hidden[$attrname]; -} +$type=$extrafields->attributes[$elementtype]['type'][$attrname]; +$size=$extrafields->attributes[$elementtype]['size'][$attrname]; +$computed=$extrafields->attributes[$elementtype]['computed'][$attrname]; +$default=$extrafields->attributes[$elementtype]['default'][$attrname]; +$unique=$extrafields->attributes[$elementtype]['unique'][$attrname]; +$required=$extrafields->attributes[$elementtype]['required'][$attrname]; +$pos=$extrafields->attributes[$elementtype]['pos'][$attrname]; +$alwayseditable=$extrafields->attributes[$elementtype]['alwayseditable'][$attrname]; +$param=$extrafields->attributes[$elementtype]['param'][$attrname]; +$perms=$extrafields->attributes[$elementtype]['perms'][$attrname]; +$langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname]; +$list=$extrafields->attributes[$elementtype]['list'][$attrname]; +$ishidden=$extrafields->attributes[$elementtype]['hidden'][$attrname]; +$entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname]; if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) { @@ -183,7 +183,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) foreach($type2label as $key => $val) { $selected=''; - if ($key == (GETPOST('type')?GETPOST('type'):$type)) $selected=' selected="selected"'; + if ($key == (GETPOST('type','alpha')?GETPOST('type','alpha'):$type)) $selected=' selected="selected"'; if (in_array($key, $typewecanchangeinto[$type])) print ''; else print ''; } @@ -217,11 +217,13 @@ else - + + + - - + + @@ -232,6 +234,9 @@ else global->MAIN_CAN_HIDE_EXTRAFIELDS)) { ?> +multicompany->enabled) { ?> + +global->MAIN_FEATURES_LEVEL >= 2) { ?> '; print ''; print ''; if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print ''; +if ($conf->multicompany->enabled) { + print ''; +} print ''; print "\n"; @@ -68,6 +71,9 @@ if (count($extrafields->attribute_type)) print '\n"; print '\n"; if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '\n"; // Add hidden option on not working feature. Why hide if user can't see it. + if ($conf->multicompany->enabled) { + print ''; + } print '\n"; print ""; diff --git a/htdocs/core/tpl/bloc_showhide.tpl.php b/htdocs/core/tpl/bloc_showhide.tpl.php index 2c5d71c79d5..80b928815cb 100644 --- a/htdocs/core/tpl/bloc_showhide.tpl.php +++ b/htdocs/core/tpl/bloc_showhide.tpl.php @@ -21,43 +21,45 @@ if (isset($parameters['showblocbydefault'])) $hide=(empty($parameters['showblocb if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false); ?> + - +'."\n"; +print '$(document).ready(function() {'."\n"; +print '$("#hide-'.$blocname.'").click(function(){'."\n"; +print ' setShowHide(0);'."\n"; +print ' $("#'.$blocname.'_bloc").hide("blind", {direction: "vertical"}, 300).removeClass("nohideobject");'."\n"; +print ' $(this).hide();'."\n"; +print ' $("#show-'.$blocname.'").show();'."\n"; +print '});'."\n"; - +print 'function setShowHide(status) {'."\n"; +print ' var id = '.$object->id.";\n"; +print " var element = '".$object->element."';\n"; +print " var htmlelement = '".$blocname."';\n"; +print ' var type = "showhide";'."\n"; +print ' $.get("'.dol_buildpath('/core/ajax/extraparams.php', 1); +print '?id="+id+"&element="+element+"&htmlelement="+htmlelement+"&type="+type+"&value="+status);'."\n"; +print '}'."\n"; -
        -
        -
        +print '});'."\n"; +print ''."\n"; -
        +print '
        '.img_picto('', '1uparrow.png').'
        '."\n"; +print '
        '.img_picto('', '1downarrow.png').'
        '."\n"; +print '
        '.$title.'
        '."\n"; +print '
        '."\n"; - - -
        -
        - - \ No newline at end of file +include DOL_DOCUMENT_ROOT.'/core/tpl/'.$blocname.'.tpl.php'; +print '

        '; +?> + diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index d6defba0fa9..c7b3ea7342f 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -35,13 +35,13 @@ elseif ($module == 'project') { $permission=$user->rights->projet->creer; } elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; } elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; } elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } -elseif (! isset($permission) && isset($user->rights->$module->creer)) -{ - $permission=$user->rights->$module->creer; +elseif (! isset($permission) && isset($user->rights->$module->creer)) +{ + $permission=$user->rights->$module->creer; } elseif (! isset($permission) && isset($user->rights->$module->write)) { - $permission=$user->rights->$module->write; + $permission=$user->rights->$module->write; } $formcompany= new FormCompany($db); @@ -55,8 +55,8 @@ $userstatic=new User($db);
        -
        trans("Nature"); ?>
        @@ -72,7 +72,7 @@ if ($permission) { $var=true; if (empty($hideaddcontactforuser)) { - + ?> " /> @@ -87,10 +87,10 @@ if ($permission) { element == 'shipping' && is_object($objectsrc)) $tmpobject=$objectsrc; - echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal'); + echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal'); ?>
         
        -
        ">
        +
        ">
        trans("ThirdPartyContacts"); ?>
        socid; ?> - selectTypeContact($tmpobject, '', 'type','external'); ?>
         
        -
        +
        ">
        -
        diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 064eda8e5b5..e613c479ee0 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -80,7 +80,7 @@ $formfile->form_attach_new_file( $disablemove=1; if ($modulepart == 'produit') $disablemove=0; - + // List of document $formfile->list_of_documents( $filearray, diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 0f1d581c99f..56eb8652d2b 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -37,10 +37,14 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +//var_dump($extrafields->attributes); if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { + // Load language if required + if (! empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]); + if ($action == 'edit_extras') { $value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options["options_" . $key]); @@ -77,6 +81,7 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][ if ($object->element=='shipping') $permok=$user->rights->expedition->creer; if ($object->element=='delivery') $permok=$user->rights->expedition->livraison->creer; if ($object->element=='productlot') $permok=$user->rights->stock->creer; + if ($object->element=='facturerec') $permok=$user->rights->facture->creer; if (($object->statut == 0 || ! empty($extrafields->attributes[$object->table_element]['alwayseditable'][$key])) && $permok && ($action != 'edit_extras' || GETPOST('attribute') != $key) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 9cddb8d183d..251540b004e 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -17,7 +17,7 @@ */ // Need global variable $title to be defined by caller (like dol_loginfunction) - +// Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...); header('Cache-Control: Public, must-revalidate'); header("Content-type: text/html; charset=".$conf->file->character_set_client); @@ -49,7 +49,7 @@ print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disable ?> -global->MAIN_LOGIN_BACKGROUND)?'':' style="background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> +global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> dol_use_jmobile)) { ?> '."\n"; } } -?> -google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT)) { diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 2538e052ae4..45e7dc32697 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2014 Laurent Destailleur +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014-2017 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,9 +17,10 @@ * along with this program. If not, see . */ -// $cssclass must be defined by caller. For example cssclass='fieldtitle" -$module = $object->element; -$note_public = 'note_public'; +// $permission must be defined by caller. +// $cssclass must be defined by caller. For example cssclass='fieldtitle" +$module = $object->element; +$note_public = 'note_public'; $note_private = 'note_private'; $colwidth=(isset($colwidth)?$colwidth:(empty($cssclass)?'25':'')); @@ -66,21 +67,29 @@ elseif ($module == 'product') { $permission=$user->rights->produit->creer; if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%'; // Rem: This var is for all notes, not only thirdparties note. else $typeofdata='textarea:12:95%'; +print ''."\n"; +print '
        '."\n"; +if ($module != 'product') { + // No public note yet on products + print '
        '."\n"; + print '
        '."\n"; + print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); + print '
        '."\n"; + print '
        '."\n"; + print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n"; + print '
        '."\n"; + print '
        '."\n"; +} +if (empty($user->societe_id)) { + print '
        '."\n"; + print '
        '."\n"; + print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); + print '
        '."\n"; + print '
        '."\n"; + print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); + print '
        '."\n"; + print '
        '."\n"; +} +print '
        '."\n"; ?> - - -
        - -
        -
        >editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); ?>
        -
        editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?>
        -
        - -societe_id)) { ?> -
        -
        >editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); ?>
        -
        editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?>
        -
        - -
        diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 1be45a27f7d..9969740ff35 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -26,7 +26,7 @@ * $langs * $dateSelector * $forceall (0 by default, 1 for supplier invoices/orders) - * $senderissupplier (0 by default, 1 for supplier invoices/orders) + * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders) * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) */ @@ -37,7 +37,9 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob $usemargins=1; } -global $dateSelector, $forceall, $forcetoshowtitlelines, $senderissupplier, $inputalsopricewithtax; +if (! isset($dateSelector)) global $dateSelector; // Take global var only if not already defined into function calling (for example formAddObjectLine) +global $forceall, $forcetoshowtitlelines, $senderissupplier, $inputalsopricewithtax; + if (! isset($dateSelector)) $dateSelector=1; // For backward compatibility elseif (empty($dateSelector)) $dateSelector=0; if (empty($forceall)) $forceall=0; @@ -208,12 +210,13 @@ else { } else { + // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum if ($senderissupplier != 2) { $ajaxoptions=array( 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key - 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done - 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' + 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done + 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo) ); $alsoproductwithnosupplierprice=0; } @@ -222,6 +225,7 @@ else { $ajaxoptions = array(); $alsoproductwithnosupplierprice=1; } + $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice); } echo ''; @@ -370,6 +374,9 @@ else { elseif ($this->table_element_line=='facture_fourn_det') { $newline = new SupplierInvoiceLine($this->db); } + elseif ($this->table_element_line=='facturedet_rec') { + $newline = new FactureLigneRec($this->db); + } if (is_object($newline)) { print $newline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8)); } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php old mode 100755 new mode 100644 index c347c693691..f968fdcbfc7 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry + * Copyright (C) 2017 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +33,7 @@ * $usemargins (0 to disable all margins columns, 1 to show according to margin setup) * $object_rights->creer initialized from = $object->getRights() * $disableedit, $disablemove, $disableremove - * + * * $type, $text, $description, $line */ @@ -55,7 +56,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
        element == 'supplier_proposal') { ?> - - + - + multicurrency->enabled)) { ?> - + @@ -194,7 +204,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> - + rights->margins->creer)) { ?> @@ -220,7 +230,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; - statut == 0 && ($object_rights->creer)) { ?> - 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> > - - - - - multicurrency->enabled)) { ?> - - global->PRODUCT_USE_UNITS) echo ''; - ?> - - +'; +print ''; +print ''; +print ''; +print ''; +if (!empty($conf->multicurrency->enabled)) + print ''; + +print ''; +if($conf->global->PRODUCT_USE_UNITS) + print ''; + +print ''; +print ''."\n"; +?> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 96e8b467a02..9e155be88c9 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -35,7 +35,7 @@ print top_htmlhead('',$langs->trans('SendNewPassword')); ?> -global->MAIN_LOGIN_BACKGROUND)?'':' style="background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> +global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> dol_use_jmobile)) { ?> + form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0, $nameforformuserfile); +} +else print ' '; + +print ''; +// End Add new file area + + print ''; // End top panel, toolbar ?> -
        +
        '; if ($action == 'delete_section') { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); - } // End confirm @@ -430,7 +440,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti // Manual section $htmltooltip=$langs->trans("ECMAreaDesc2"); - + if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) { print '
        '; @@ -2104,6 +2114,7 @@ elseif (! empty($object->id)) // Add free products/services form global $forceall, $senderissupplier, $dateSelector; $forceall=1; $senderissupplier=1; $dateSelector=0; + if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. // Show object lines $inputalsopricewithtax=0; @@ -2258,7 +2269,7 @@ elseif (! empty($object->id)) /* * Action webservice */ - elseif ($action == 'webservice' && GETPOST('mode', 'alpha') != "send" && ! GETPOST('cancel')) + elseif ($action == 'webservice' && GETPOST('mode', 'alpha') != "send" && ! GETPOST('cancel','alpha')) { $mode = GETPOST('mode', 'alpha'); $ws_url = $object->thirdparty->webservices_url; @@ -2704,7 +2715,7 @@ elseif (! empty($object->id)) //print ''; print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefSupplierShort"),$_SERVER["PHP_SELF"], "ppf.ref_fourn",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Supplier"),$_SERVER["PHP_SELF"], "ppf.fk_soc",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"], "ppf.price",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("QtyMin"),$_SERVER["PHP_SELF"], "ppf.quantity",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("UnitPrice"),$_SERVER["PHP_SELF"], "ppf.unitprice",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("RefSupplierShort",$_SERVER["PHP_SELF"], "ppf.ref_fourn",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Label",$_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Supplier",$_SERVER["PHP_SELF"], "ppf.fk_soc",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("BuyingPrice",$_SERVER["PHP_SELF"], "ppf.price",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("QtyMin",$_SERVER["PHP_SELF"], "ppf.quantity",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("UnitPrice",$_SERVER["PHP_SELF"], "ppf.unitprice",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"]); print "\n"; diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 531f42fd47f..8ee0fb64b40 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -3,8 +3,8 @@ * Copyright (C) 2012-2016 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2014-2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,7 +41,6 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; $myparam = GETPOST("myparam"); $action=GETPOST('action', 'alpha'); $id=GETPOST('id', 'int'); -$userid = GETPOST('userid')?GETPOST('userid'):$user->id; // Protection if external user if ($user->societe_id > 0) accessforbidden(); @@ -61,7 +60,8 @@ if ($action == 'create') $object = new Holiday($db); // If no right to create a request - if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) + $fuserid = GETPOST('fuserid','int'); + if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all))) { $error++; setEventMessages($langs->trans('CantCreateCP'), null, 'errors'); @@ -86,7 +86,6 @@ if ($action == 'create') $valideur = GETPOST('valideur'); $description = trim(GETPOST('description')); - $userID = GETPOST('userID'); // If no type if ($type <= 0) @@ -119,7 +118,7 @@ if ($action == 'create') } // Check if there is already holiday for this period - $verifCP = $object->verifDateHolidayCP($userID, $date_debut, $date_fin, $halfday); + $verifCP = $object->verifDateHolidayCP($fuserid, $date_debut, $date_fin, $halfday); if (! $verifCP) { setEventMessages($langs->trans("alreadyCPexist"), null, 'errors'); @@ -145,11 +144,9 @@ if ($action == 'create') $result = 0; - $result = 0; - if (! $error) { - $object->fk_user = $userid; + $object->fk_user = $fuserid; $object->description = $description; $object->date_debut = $date_debut; $object->date_fin = $date_fin; @@ -158,10 +155,15 @@ if ($action == 'create') $object->fk_type = $type; $result = $object->create($user); + if ($result <= 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } } // If no SQL error we redirect to the request card - if (! $error && $result > 0) + if (! $error) { $db->commit(); @@ -722,7 +724,7 @@ llxHeader('', $langs->trans('CPTitreMenu')); if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create') { // Si l'utilisateur n'a pas le droit de faire une demande - if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) + if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all))) { $errors[]=$langs->trans('CantCreateCP'); } @@ -802,7 +804,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create // Formulaire de demande print ''."\n"; print ''."\n"; - print ''."\n"; dol_fiche_head(); @@ -833,10 +834,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print ''; print ''; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 9973223ba0f..ad9ead401dd 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -125,9 +125,9 @@ class Holiday extends CommonObject $now=dol_now(); // Check parameters - if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameter"; return -1; } - if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameter"; return -1; } - if (empty($this->fk_type) || ! is_numeric($this->fk_type) || $this->fk_type < 0) { $this->error="ErrorBadParameter"; return -1; } + if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameterFkUser"; return -1; } + if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameterFkValidator"; return -1; } + if (empty($this->fk_type) || ! is_numeric($this->fk_type) || $this->fk_type < 0) { $this->error="ErrorBadParameterFkType"; return -1; } // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday("; @@ -143,14 +143,14 @@ class Holiday extends CommonObject $sql.= "fk_user_create,"; $sql.= "entity"; $sql.= ") VALUES ("; - $sql.= "'".$this->fk_user."',"; + $sql.= "'".$this->db->escape($this->fk_user)."',"; $sql.= " '".$this->db->idate($now)."',"; $sql.= " '".$this->db->escape($this->description)."',"; $sql.= " '".$this->db->idate($this->date_debut)."',"; $sql.= " '".$this->db->idate($this->date_fin)."',"; $sql.= " ".$this->halfday.","; $sql.= " '1',"; - $sql.= " '".$this->fk_validator."',"; + $sql.= " '".$this->db->escape($this->fk_validator)."',"; $sql.= " ".$this->fk_type.","; $sql.= " ".$user->id.","; $sql.= " ".$conf->entity; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 88f3438dcaf..de8a7147267 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . -*/ + */ /** * File that defines the balance of paid holiday of users. @@ -71,8 +71,8 @@ $holiday = new Holiday($db); * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -84,7 +84,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_name=''; $toselect=''; @@ -265,7 +265,7 @@ else print ''; print ''; - print_liste_field_titre($langs->trans('Employee'), $_SERVER["PHP_SELF"]); + print_liste_field_titre('Employee', $_SERVER["PHP_SELF"]); if (count($typeleaves)) { foreach($typeleaves as $key => $val) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 5706307a16c..b041861b9d4 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -20,7 +20,7 @@ /** * \file htdocs/holiday/list.php * \ingroup holiday - * \brief List of holiday. + * \brief List of holiday */ require('../main.inc.php'); @@ -63,14 +63,13 @@ $month_start = GETPOST('month_start'); $year_start = GETPOST('year_start'); $month_end = GETPOST('month_end'); $year_end = GETPOST('year_end'); -$search_employe = GETPOST('search_employe'); +$search_employee = GETPOST('search_employee'); $search_valideur = GETPOST('search_valideur'); $search_statut = GETPOST('select_statut'); -$type = GETPOST('type','int'); +$search_type = GETPOST('search_type','int'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'cp.rowid'=>'Ref', 'cp.description'=>'Description', 'uu.lastname'=>'EmployeeLastname', 'uu.firstname'=>'EmployeeFirstname' @@ -82,7 +81,7 @@ $fieldstosearchall = array( * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_ref=""; $month_create=""; @@ -91,10 +90,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $year_start=""; $month_end=""; $year_end=""; - $search_employe=""; + $search_employee=""; $search_valideur=""; $search_statut=""; - $type=''; + $search_type=''; } @@ -121,13 +120,13 @@ llxHeader('', $langs->trans('CPTitreMenu')); $order = $db->order($sortfield,$sortorder).$db->plimit($limit + 1, $offset); -// WHERE +// Ref if(!empty($search_ref)) { - $filter.= " AND cp.rowid LIKE '%".$db->escape($search_ref)."%'\n"; + $filter.= " AND cp.rowid = ".$db->escape($search_ref); } -// DATE START +// Start date if($year_start > 0) { if($month_start > 0) { $filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,$month_start,1))."' AND '".$db->idate(dol_get_last_day($year_start,$month_start,1))."')"; @@ -142,7 +141,7 @@ if($year_start > 0) { } } -// DATE FIN +// End date if($year_end > 0) { if($month_end > 0) { $filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,$month_end,1))."' AND '".$db->idate(dol_get_last_day($year_end,$month_end,1))."')"; @@ -157,7 +156,7 @@ if($year_end > 0) { } } -// DATE CREATE +// Create date if($year_create > 0) { if($month_create > 0) { $filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($year_create,$month_create,1))."' AND '".$db->idate(dol_get_last_day($year_create,$month_create,1))."')"; @@ -172,17 +171,22 @@ if($year_create > 0) { } } -// EMPLOYE -if(!empty($search_employe) && $search_employe != -1) { - $filter.= " AND cp.fk_user = '".$db->escape($search_employe)."'\n"; +// Employee +if(!empty($search_employee) && $search_employee != -1) { + $filter.= " AND cp.fk_user = '".$db->escape($search_employee)."'\n"; } -// VALIDEUR +// Validator if(!empty($search_valideur) && $search_valideur != -1) { $filter.= " AND cp.fk_validator = '".$db->escape($search_valideur)."'\n"; } -// STATUT +// Type +if (!empty($search_type) && $search_type != -1) { + $filter.= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; +} + +// Status if(!empty($search_statut) && $search_statut != -1) { $filter.= " AND cp.statut = '".$db->escape($search_statut)."'\n"; } @@ -194,7 +198,6 @@ if (!empty($sall)) if (empty($user->rights->holiday->read_all)) $filter.=' AND cp.fk_user IN ('.join(',',$childids).')'; -if ($type > 0) $filter.=' AND cp.fk_type IN ('.$db->escape($type).')'; // Récupération de l'ID de l'utilisateur $user_id = $user->id; @@ -257,9 +260,16 @@ if ($id > 0) dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin); - print '
        '; + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + print '
        '; - print '
        '; + print '
        '; + + showMyBalance($holiday, $user_id); + } + + dol_fiche_end(); } else { @@ -267,23 +277,44 @@ else //print count($holiday->holiday); print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num, count($holiday->holiday), 'title_hrm.png', 0, '', '', $limit); - dol_fiche_head(''); + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + dol_fiche_head(''); + + showMyBalance($holiday, $user_id); + + dol_fiche_end(); + } } -$alltypeleaves=$holiday->getTypes(1,-1); // To have labels -$out=''; -$typeleaves=$holiday->getTypes(1,1); -foreach($typeleaves as $key => $val) + +/** + * Show balance of user + * + * @param Holiday $holiday Object $holiday + * @param int $user_id User id + * @return string Html code with balance + */ +function showMyBalance($holiday, $user_id) { - $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); - $nb_holiday += $nb_type; - $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
        '; -} -print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'
        '; -print $out; + global $conf, $langs; + + $alltypeleaves=$holiday->getTypes(1,-1); // To have labels + + $out=''; + $nb_holiday=0; + $typeleaves=$holiday->getTypes(1,1); + foreach($typeleaves as $key => $val) + { + $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); + $nb_holiday += $nb_type; + $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
        '; + } + print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'
        '; + print $out; +} -dol_fiche_end(); if ($id > 0) print '
        '; @@ -297,34 +328,34 @@ if ($sall) print '
        '; print '
        trans("Position"); ?>
        trans("Position"); ?>
        trans("LanguageFile"); ?>
        textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
        trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>
        trans("Unique"); ?>>
        trans("Hidden"); ?>>
        trans("AllEntities"); ?>>
        trans("ByDefaultInList"); ?> diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index a6d7e735735..f989ce448b5 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -49,6 +49,9 @@ print ''.$langs->trans("ComputedFormula").''.$langs->trans("Required").''.$langs->trans("AlwaysEditable").''.$langs->trans("Hidden").''.$langs->trans("Entities").' 
        '.yn($extrafields->attribute_required[$key])."'.yn($extrafields->attribute_alwayseditable[$key])."'.yn($extrafields->attribute_hidden[$key])."'.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).''.img_edit().''; print "  ".img_delete()."
        - info_bits & 2) == 2) { ?> @@ -83,7 +84,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; $discount->fetch($line->fk_remise_except); echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); // Add date of deposit - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; } elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) @@ -101,11 +102,11 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; else { $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; - + if ($line->fk_product > 0) { echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); - + // Show range echo get_date_range($line->date_start, $line->date_end, $format); @@ -138,17 +139,26 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
        ref_fourn; ?>tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); ?>tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); + if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); + if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); + if (empty($positiverates)) $positiverates='0'; + echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); + //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); + ?> subprice); ?>multicurrency_subprice); ?> pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?> pa_ht); ?> info_bits & 2) == 2 || ! empty($disableedit)) { ?> @@ -241,7 +251,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; ?> 0) { ?> diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php new file mode 100644 index 00000000000..8650ab4110d --- /dev/null +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -0,0 +1,135 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + +print ''; + +// Url list +print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':

        '; +print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':
        '; +print ''.getOnlinePaymentUrl(1,'free')."

        \n"; +if (! empty($conf->commande->enabled)) +{ + print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':
        '; + print ''.getOnlinePaymentUrl(1,'order')."
        \n"; + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN) && ! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + $langs->load("orders"); + print ''; + print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Order")).': '; + print ''; + print ''; + if (GETPOST('generate_order_ref','alpha')) + { + print '
        -> '; + $url=getOnlinePaymentUrl(0,'order',GETPOST('generate_order_ref','alpha')); + print $url; + print "
        \n"; + } + print ''; + } + print '
        '; +} +if (! empty($conf->facture->enabled)) +{ + print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':
        '; + print ''.getOnlinePaymentUrl(1,'invoice')."
        \n"; + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN) && ! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + $langs->load("bills"); + print '
        '; + print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Invoice")).': '; + print ''; + print ''; + if (GETPOST('generate_invoice_ref','alpha')) + { + print '
        -> '; + $url=getOnlinePaymentUrl(0,'invoice',GETPOST('generate_invoice_ref','alpha')); + print $url; + print "
        \n"; + } + print '
        '; + } + print '
        '; +} +if (! empty($conf->contrat->enabled)) +{ + print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':
        '; + print ''.getOnlinePaymentUrl(1,'contractline')."
        \n"; + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN) && ! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + $langs->load("contract"); + print '
        '; + print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Contract")).': '; + print ''; + print ''; + if (GETPOST('generate_contract_ref')) + { + print '
        -> '; + $url=getOnlinePaymentUrl(0,'contractline',GETPOST('generate_contract_ref','alpha')); + print $url; + print "
        \n"; + } + print '
        '; + } + print '
        '; +} +if (! empty($conf->adherent->enabled)) +{ + print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':
        '; + print ''.getOnlinePaymentUrl(1,'membersubscription')."
        \n"; + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN) && ! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + $langs->load("members"); + print '
        '; + print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Member")).': '; + print ''; + print ''; + if (GETPOST('generate_member_ref')) + { + print '
        -> '; + $url=getOnlinePaymentUrl(0,'membersubscription',GETPOST('generate_member_ref','alpha')); + print $url; + print "
        \n"; + } + print '
        '; + } + print '
        '; +} + +if (! empty($conf->use_javascript_ajax)) +{ + print "\n".''; +} + +print info_admin($langs->trans("YouCanAddTagOnUrl")); + +print ''; + diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php index 78006316f63..c8cd6674a7a 100644 --- a/htdocs/core/tpl/originproductline.tpl.php +++ b/htdocs/core/tpl/originproductline.tpl.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2017 Charlie Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,16 +19,20 @@ ?> -
        tpl['label']; ?>tpl['description']; ?>tpl['vat_rate']; ?>tpl['price']; ?>tpl['multicurrency_price']; ?>tpl['qty']; ?>'.$langs->trans($this->tpl['unit']).'tpl['remise_percent']; ?>
        '.$this->tpl['label'].''.$this->tpl['description'].''.$this->tpl['vat_rate'].''.$this->tpl['price'].''.$this->tpl['multicurrency_price'].''.$this->tpl['qty'].''.$langs->trans($this->tpl['unit']).''.$this->tpl['remise_percent'].'
        '; @@ -615,7 +625,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti // End left panel ?> -
        +
        -
        -use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section)) -{ - if (empty($section) || $section == -1) - { - ?> - - form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0, 'formuserfile'); -} -else print ' '; - - - -// End Add new file area -?> -
        use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) { include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index b613d336fc4..3fa2bc1dc7a 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -23,9 +23,6 @@ * \brief Main page for ECM section area */ -if (! defined('REQUIRE_JQUERY_LAYOUT')) define('REQUIRE_JQUERY_LAYOUT','1'); -if (! defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); - require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php'; @@ -50,10 +47,12 @@ $result = restrictedArea($user, 'ecm', 0); // Get parameters $socid=GETPOST('socid','int'); $action=GETPOST('action','aZ09'); -$section=GETPOST("section")?GETPOST("section","int"):GETPOST("section_id","int"); -$module=GETPOST("module"); +$section=GETPOST('section','int')?GETPOST('section','int'):GETPOST('section_id','int'); +$module=GETPOST('module','alpha'); if (! $section) $section=0; -$section_dir=GETPOST('section_dir'); +$section_dir=GETPOST('section_dir','alpha'); + +$search_doc_ref=GETPOST('search_doc_ref','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -88,57 +87,15 @@ $error=0; * Actions */ -// Upload file -if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) +// Purge search criteria +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { - // Define relativepath and upload_dir - $relativepath=''; - if ($ecmdir->id) $relativepath=$ecmdir->getRelativePath(); - else $relativepath=$section_dir; - $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; - - if (empty($_FILES['userfile']['tmp_name'])) - { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); - } - - if (! $error) - { - if (dol_mkdir($upload_dir) >= 0) - { - $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']); - if (is_numeric($resupload) && $resupload > 0) - { - $result=$ecmdir->changeNbOfFiles('+'); - } - else - { - $langs->load("errors"); - if ($resupload < 0) // Unknown error - { - setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors'); - } - else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus - { - setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors'); - } - else // Known error - { - setEventMessages($langs->trans($resupload), null, 'errors'); - } - } - } - else - { - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFailToCreateDir",$upload_dir), null, 'errors'); - } - } + $search_doc_ref=''; } + // Add directory if ($action == 'add' && $user->rights->ecm->setup) { @@ -154,7 +111,6 @@ if ($action == 'add' && $user->rights->ecm->setup) } else { - //TODO: Translate setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors'); $action = "create"; } @@ -203,6 +159,8 @@ if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes') } // Refresh directory view +// This refresh list of dirs, not list of files (for preformance reason). List of files is refresh only if dir was not synchronized. +// To refresh content of dir with cache, just open the dir in edit mode. if ($action == 'refreshmanual') { $ecmdirtmp = new EcmDirectory($db); @@ -348,8 +306,9 @@ if ($action == 'refreshmanual') //print $_SESSION["dol_screenheight"]; $maxheightwin=(isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 466)?($_SESSION["dol_screenheight"]-136):660; // Also into index.php file -$morejs=array(); -if (empty($conf->global->MAIN_ECM_DISABLE_JS)) $morejs=array("/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js"); +//$morejs=array(); +$morejs=array('includes/jquery/plugins/blockUI/jquery.blockUI.js','core/js/blockUI.js'); // Used by ecm/tpl/enabledfiletreeajax.tpl.pgp +if (empty($conf->global->MAIN_ECM_DISABLE_JS)) $morejs[]="/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js"; llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs,'',0,0); @@ -395,8 +354,10 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax)) $classviewhide='inline-block'; + + $head = ecm_prepare_dasboard_head(''); -dol_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), 1, ''); +dol_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), -1, ''); // Start container of all panels @@ -407,11 +368,11 @@ dol_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans '; +print '
        '; // Toolbar $url=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); -print ''; +print ''; print ''; print ''; @@ -497,7 +458,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti } -// End left banner +// End left panel ?>
        @@ -523,7 +484,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php'; // End of page -dol_fiche_end(1); +dol_fiche_end(); if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) { diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php index bbcbb7090a4..aadf3fdba22 100644 --- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php +++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php @@ -24,6 +24,10 @@ '; } + print ' '.$langs->trans("AddThirdParty").''; } print '
        '.$langs->trans("ToOrder").'
        '.$langs->trans("OrderDate").''; $date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - print $form->select_date($date_com,'',1,1,'',"commande",1,0,1); + print $form->select_date($date_com,'',1,1,'',"commande",1,1,1); print '
        '.$langs->trans("OrderMode").''; @@ -2721,7 +2732,8 @@ elseif (! empty($object->id)) print ''; print "
        "; } -if ($action != 'makeorder') + + if ($action != 'makeorder') { print '
        '; @@ -2756,7 +2768,7 @@ if ($action != 'makeorder') print ''; //print ''; print '\n"; print "
        '.$langs->trans("Receive").'
        '.$langs->trans("DeliveryDate").''; - print $form->select_date('','',1,1,'',"commande",1,0,1); + print $form->select_date('','',1,1,'',"commande",1,1,1); print "
        ".$langs->trans("Delivery")."\n"; @@ -2780,7 +2792,7 @@ if ($action != 'makeorder') // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'order_supplier',$socid,0,'listaction'.($genallowed?'largetitle':'')); + $somethingshown = $formactions->showactions($object,'order_supplier',$socid,1,'listaction'.($genallowed?'largetitle':'')); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index e89555a5d50..f4f05f96b78 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -28,6 +28,7 @@ * \ingroup commande * \brief Page to dispatch receiving */ + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_order/modules_commandefournisseur.php'; require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; @@ -84,17 +85,33 @@ if ($id > 0 || ! empty($ref)) { * Actions */ -if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(1); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(1); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error++; + $action = ''; + } + } + + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -102,19 +119,42 @@ if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } -if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(0); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(0); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error ++; + $action = ''; + } + } + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -122,19 +162,42 @@ if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANC $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } -if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(2); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(2); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error ++; + $action = ''; + } + } + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -142,6 +205,14 @@ if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_ $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) { @@ -150,10 +221,10 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) $db->begin(); $pos = 0; - foreach ($_POST as $key => $value) + foreach ($_POST as $key => $value) { // without batch module enabled - if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) + if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $pos ++; @@ -184,7 +255,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) } } // with batch module enabled - if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) + if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $pos ++; @@ -260,6 +331,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) } } + /* * View */ @@ -284,13 +356,13 @@ if ($id > 0 || ! empty($ref)) { $head = ordersupplier_prepare_head($object); $title = $langs->trans("SupplierOrder"); - dol_fiche_head($head, 'dispatch', $title, 0, 'order'); + dol_fiche_head($head, 'dispatch', $title, -1, 'order'); + - // Supplier order card $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
        '; // Ref supplier $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); @@ -331,14 +403,14 @@ if ($id > 0 || ! empty($ref)) { } } $morehtmlref.='
        '; - - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + print '
        '; print '
        '; - + print ''; // Date @@ -362,7 +434,7 @@ if ($id > 0 || ! empty($ref)) { print "
        "; print '
        '; - + // if ($mesg) print $mesg; print '
        '; @@ -382,7 +454,7 @@ if ($id > 0 || ! empty($ref)) { print '
        '; print ''; print ''; - + print '
        '; print ''; @@ -434,6 +506,7 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; print ''; + print ''; print ''; print "\n"; @@ -443,7 +516,7 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; print ''; - print ''; + print ''; print "\n"; } } @@ -456,7 +529,7 @@ if ($id > 0 || ! empty($ref)) { while ( $i < $num ) { $objp = $db->fetch_object($resql); - // On n'affiche pas les produits personnalises + // On n'affiche pas les produits libres if (! $objp->fk_product > 0) { $nbfreeproduct++; } else { @@ -511,7 +584,11 @@ if ($id > 0 || ! empty($ref)) { if (! empty($conf->productbatch->enabled) && $objp->tobatch == 1) { $type = 'batch'; - print ''; // Dispatch column + print ''; // Qty to dispatch + print ''; // Dispatch column print ''; // Warehouse column print ''; @@ -519,7 +596,7 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; print ''; // Qty ordered + qty already dispatached } else { $type = 'dispatch'; - print ''; // Dispatch column - print ''; + print ''; // Qty to dispatch + print ''; // Dispatch column + print ''; // Warehouse column print ''; print ''; print ''; } - // Dispatch + + // Qty to dispatch print ''; + + print ''; // Warehouse print ''; - + // Ref print ''; - + // Ref supplier print ''; - + // Date if ($objp->df > 0 ) { @@ -470,13 +572,13 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { print ''; } - + // Multicurrency - if (!empty($conf->multicurrency->enabled)) + if (!empty($conf->multicurrency->enabled)) { // Currency print '\n"; - + print ''; print ''; - + print ''; - + print ''; - - print ''; - + + print ''; + + // Amount print '"; - - // Multicurrency - if (!empty($conf->multicurrency->enabled)) + + // Multicurrency Price + if (! empty($conf->multicurrency->enabled)) { - print '"; + print ""; } - + print "\n"; $total+=$objp->total_ht; $total_ttc+=$objp->total_ttc; @@ -544,12 +672,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; print ''; - print ''; - if (!empty($conf->multicurrency->enabled)) print ''; + print ''; // Autofilled + if (!empty($conf->multicurrency->enabled)) print ''; print "\n"; } print "
        ' . $langs->trans("QtyOrdered") . '' . $langs->trans("QtyDispatchedShort") . '' . $langs->trans("QtyToDispatchShort") . '' . $langs->trans("Warehouse") . '
        ' . $langs->trans("batch_number") . '' . $langs->trans("EatByDate") . '' . $langs->trans("SellByDate") . '  
        ' . img_picto($langs->trans('AddDispatchBatchLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"') . ''; + print ''; + //print img_picto($langs->trans('AddDispatchBatchLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"'); + print '
        '; print ''; print ''; - + print ''; if (! empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) // Not tested ! { @@ -536,7 +613,7 @@ if ($id > 0 || ! empty($ref)) { print ''; - print ''; + print ''; print ''; $dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc' . $suffix . 'month'), GETPOST('dlc' . $suffix . 'day'), GETPOST('dlc' . $suffix . 'year')); @@ -549,15 +626,19 @@ if ($id > 0 || ! empty($ref)) { print ' ' . img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"') . ''; + print ''; + //print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"'); + print '
        '; print ''; print ''; - + print ''; if (! empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) // Not tested ! { @@ -567,23 +648,38 @@ if ($id > 0 || ! empty($ref)) { { print ''; } - + // hidden fields for js function print ''; print ''; print ''; print ''; + print ''; + if (! empty($conf->productbatch->enabled) && $objp->tobatch == 1) { + $type = 'batch'; + //print img_picto($langs->trans('AddDispatchBatchLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"'); + print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"'); + } + else + { + $type = 'dispatch'; + print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"'); + } + print ''; if (count($listwarehouses) > 1) { - print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 1, 0, $objp->fk_product); + print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 1, 0, $objp->fk_product, '', 1); } elseif (count($listwarehouses) == 1) { - print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 0, 0, $objp->fk_product); + print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 0, 0, $objp->fk_product, '', 1); } else { $langs->load("errors"); print $langs->trans("ErrorNoWarehouseDefined"); @@ -604,10 +700,10 @@ if ($id > 0 || ! empty($ref)) { print ''; print "
        \n"; - if ($nbproduct) + if ($nbproduct) { $checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5])); - + print '
        '; print $langs->trans("Comment") . ' : '; print '
        '; print ' '.$checkboxlabel; - + print '
        0 || ! empty($ref)) { if (! $nbproduct) { if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED)) print '
        '.$langs->trans("NoPredefinedProductToDispatch").'
        '; // No predefined line at all - else + else print '
        '.$langs->trans("NoMorePredefinedProductToDispatch").'
        '; // No predefined line that remain to be dispatched. } @@ -637,7 +733,7 @@ if ($id > 0 || ! empty($ref)) { dol_fiche_end(); - + // List of lines already dispatched $sql = "SELECT p.ref, p.label,"; $sql .= " e.rowid as warehouse_id, e.label as entrepot,"; @@ -718,7 +814,8 @@ if ($id > 0 || ! empty($ref)) { // Add button to check/uncheck disaptching print '
        '; - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) + { if (empty($objp->status)) { print '' . $langs->trans("Approve") . ''; print '' . $langs->trans("Deny") . ''; diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 68976e9b7c7..700ce7a770a 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -100,7 +100,7 @@ if ($object->id > 0) $head = ordersupplier_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans('SupplierOrder'), 0, 'order'); + dol_fiche_head($head, 'documents', $langs->trans('SupplierOrder'), -1, 'order'); // Construit liste des fichiers @@ -114,7 +114,7 @@ if ($object->id > 0) // Supplier order card $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
        '; // Ref supplier $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); @@ -155,13 +155,13 @@ if ($object->id > 0) } } $morehtmlref.='
        '; - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
        '; print '
        '; - + print ''; print ''; print ''; @@ -170,8 +170,8 @@ if ($object->id > 0) print "\n"; dol_fiche_end(); - - + + $modulepart = 'commande_fournisseur'; $permission = $user->rights->fournisseur->commande->creer; $permtoedit = $user->rights->fournisseur->commande->creer; diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 50b310a55e5..bd92039eb1c 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -68,7 +68,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $actioncode=''; $search_agenda_label=''; @@ -100,7 +100,7 @@ $now=dol_now(); $head = ordersupplier_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("SupplierOrder"), 0, 'order'); +dol_fiche_head($head, 'info', $langs->trans("SupplierOrder"), -1, 'order'); // Supplier order card @@ -197,13 +197,13 @@ if (!empty($object->id)) $param='&id='.$object->id; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - + print load_fiche_titre($langs->trans("ActionsOnOrder"),'',''); // List of actions on element /*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'project',0);*/ + $somethingshown = $formactions->showactions($object,'project',0);*/ // List of todo actions //show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 3e3fe658155..4794d72da6a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -172,8 +172,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction')) { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha')) { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -185,7 +185,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $ordermonth=''; $orderyear=''; @@ -535,9 +535,9 @@ if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed; //Required triple check because statut=0 means draft filter -if (GETPOST('statut', 'alpha') !== '') +if (GETPOST('statut', 'intcomma') !== '') { - $sql .= " AND cf.fk_statut IN (".$db->escape(GETPOST('statut', 'alpha')).")"; + $sql .= " AND cf.fk_statut IN (".$db->escape($db->escape(GETPOST('statut', 'intcomma'))).")"; } if ($search_status != '' && $search_status >= 0) { @@ -589,8 +589,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -688,7 +689,7 @@ if ($resql) { $langs->load("mails"); - if (! GETPOST('cancel')) + if (! GETPOST('cancel','alpha')) { $objecttmp=new CommandeFournisseur($db); $listofselectedid=array(); @@ -1052,7 +1053,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index a3334baa5d9..45e4bd80e3a 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -75,19 +75,19 @@ if ($id > 0 || ! empty($ref)) if ($result >= 0) { $object->fetch_thirdparty(); - + $author = new User($db); $author->fetch($object->user_author_id); $head = ordersupplier_prepare_head($object); $title=$langs->trans("SupplierOrder"); - dol_fiche_head($head, 'note', $title, 0, 'order'); + dol_fiche_head($head, 'note', $title, -1, 'order'); // Supplier order card - + $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
        '; // Ref supplier $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); @@ -128,19 +128,19 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
        '; - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
        '; print '
        '; - - + + $cssclass="titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; print '
        '; - + dol_fiche_end(); } else diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 86c177c4313..b1a8c0c08c1 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -501,12 +501,12 @@ if (($action != 'create' && $action != 'add') && !$error) { print ''; print '
        '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
        '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
        '; print ''; - print_liste_field_titre($langs->trans('Ref'), 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans('RefSupplier'), 'orderstoinvoice.php', 'c.ref_supplier', '', '&socid=' . $socid, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans('OrderDate'), 'orderstoinvoice.php', 'c.date_commande', '', '&socid=' . $socid, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans('DeliveryDate'), 'orderstoinvoice.php', 'c.date_livraison', '', '&socid=' . $socid, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans('Status'), '', '', '', '', 'align="right"'); - print_liste_field_titre($langs->trans('GenerateBill'), '', '', '', '', 'align="center"'); + print_liste_field_titre('Ref', 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder); + print_liste_field_titre('RefSupplier', 'orderstoinvoice.php', 'c.ref_supplier', '', '&socid=' . $socid, '', $sortfield, $sortorder); + print_liste_field_titre('OrderDate', 'orderstoinvoice.php', 'c.date_commande', '', '&socid=' . $socid, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre('DeliveryDate', 'orderstoinvoice.php', 'c.date_livraison', '', '&socid=' . $socid, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre('Status', '', '', '', '', 'align="right"'); + print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"'); print "\n"; // Lignes des champs de filtre diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index f9188c3c4dd..584b053b3ba 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -98,11 +98,11 @@ if ($result) print '
        '; print ''; - print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, "", "", $sortfield,$sortorder); - print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, "", "", $sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, "", "", $sortfield,$sortorder); - print_liste_field_titre($langs->trans("Email")); - print_liste_field_titre($langs->trans("Phone")); + print_liste_field_titre("Lastname",$_SERVER["PHP_SELF"],"p.name", $begin, "", "", $sortfield,$sortorder); + print_liste_field_titre("Firstname",$_SERVER["PHP_SELF"],"p.firstname", $begin, "", "", $sortfield,$sortorder); + print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom", $begin, "", "", $sortfield,$sortorder); + print_liste_field_titre("Email"); + print_liste_field_titre("Phone"); print "\n"; $var=True; @@ -111,7 +111,7 @@ if ($result) { $obj = $db->fetch_object($result); - + print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 956808b1fab..927347eb37e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -198,7 +198,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -239,8 +239,8 @@ if (empty($reshook)) // Define output language /*$outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) - $newlang = GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { @@ -274,7 +274,7 @@ if (empty($reshook)) } // Set supplier ref - if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) + if ($action == 'setref_supplier' && $user->rights->fournisseur->facture->creer) { $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); @@ -286,8 +286,8 @@ if (empty($reshook)) // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) - $newlang = GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { @@ -302,13 +302,13 @@ if (empty($reshook)) } // payments conditions - if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer) + if ($action == 'setconditions' && $user->rights->fournisseur->facture->creer) { $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); } // payment mode - else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) + else if ($action == 'setmode' && $user->rights->fournisseur->facture->creer) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); } @@ -976,21 +976,30 @@ if (empty($reshook)) if ($prod_entry_mode != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { - $idprod=0; $productsupplier=new ProductFournisseur($db); - if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-2; // Same behaviour than with combolist. When not select idprodfournprice is now -2 (to avoid conflict with next action that may return -1) + $idprod=0; + if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) - if (GETPOST('idprodfournprice') > 0) + if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + { + $idprod=$reg[1]; + $res=$productsupplier->fetch($idprod); + // Call to init properties of $productsupplier + // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price + $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist + } + elseif (GETPOST('idprodfournprice') > 0) { - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); + $res=$productsupplier->fetch($idprod); } //Replaces $fk_unit with the product's if ($idprod > 0) { - $result=$productsupplier->fetch($idprod); - $label = $productsupplier->label; $desc = $productsupplier->description; @@ -1005,10 +1014,29 @@ if (empty($reshook)) $type = $productsupplier->type; $price_base_type = 'HT'; - // TODO Save the product supplier ref into database into field ref_supplier (must rename field ref into ref_supplier first) - $result=$object->addline($desc, $productsupplier->fourn_pu, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, $idprod, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $productsupplier->fk_unit); + // TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first) + $result=$object->addline( + $desc, + $productsupplier->fourn_pu, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $qty, + $idprod, + $remise_percent, + $date_start, + $date_end, + 0, + $tva_npr, + $price_base_type, + $type, + -1, + 0, + $array_options, + $productsupplier->fk_unit + ); } - if ($idprod == -2 || $idprod == 0) + if ($idprod == -99 || $idprod == 0) { // Product not selected $error++; @@ -1064,7 +1092,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -1146,7 +1174,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -1459,6 +1487,7 @@ if ($action == 'create') }); '; } + print ' '.$langs->trans("AddThirdParty").''; } print ''; @@ -1996,8 +2025,8 @@ else $morehtmlref='
        '; // Ref supplier - $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1); + $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref.='
        '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project @@ -2005,7 +2034,7 @@ else { $langs->load("projects"); $morehtmlref.='
        '.$langs->trans('Project') . ' '; - if ($user->rights->fournisseur->commande->creer) + if ($user->rights->fournisseur->facture->creer) { if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; @@ -2756,7 +2785,6 @@ else } } print '
        '; - print '
        '; if ($action != 'edit') { @@ -2787,7 +2815,7 @@ else // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'invoice_supplier',$socid,0,'listaction'.($genallowed?'largetitle':'')); + $somethingshown = $formactions->showactions($object,'invoice_supplier',$socid,1,'listaction'.($genallowed?'largetitle':'')); print ''; //print '
        '; diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 7cfe9697891..7ad76d4426b 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -64,7 +64,7 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="f.date_lim_reglement"; if (! $sortorder) $sortorder="ASC"; -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { $search_ref=""; $search_ref_supplier=""; @@ -189,15 +189,15 @@ if ($user->rights->fournisseur->facture->lire) print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"f.ref_supplier","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AlreadyPaid"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"f.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("RefSupplier",$_SERVER["PHP_SELF"],"f.ref_supplier","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("DateDue",$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("AmountHT",$_SERVER["PHP_SELF"],"f.total_ht","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("AmountTTC",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("AlreadyPaid",$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder); print "\n"; // Lines with filter fields @@ -235,7 +235,7 @@ if ($user->rights->fournisseur->facture->lire) $facturestatic->statut = $objp->fk_statut; $facturestatic->date_echeance = $db->jdate($objp->datelimite); - + print ''; $classname = "impayee"; diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index f5ab9164042..73d6b94a0d6 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -46,6 +46,8 @@ $object = new FactureFournisseur($db); * View */ +$form = new Form($db); + $title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Info'); $helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; llxHeader('', $title, $helpurl); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index a9e372a9709..96473dd6e6e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -109,7 +109,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -183,8 +183,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -194,7 +194,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All test must be present to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha')) // All tests must be present to be compatible with all browsers { $search_all=""; $search_user=''; @@ -237,6 +237,7 @@ if (empty($reshook)) $objectclass='FactureFournisseur'; $objectlabel='SupplierInvoices'; $permtoread = $user->rights->fournisseur->facture->lire; + $permtocreate = $user->rights->fournisseur->facture->creer; $permtodelete = $user->rights->fournisseur->facture->supprimer; $uploaddir = $conf->fournisseur->facture->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -372,8 +373,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -426,6 +428,7 @@ if ($resql) { $soc = new Societe($db); $soc->fetch($socid); + if (empty($search_societe)) $search_societe = $soc->name; } $param='&socid='.$socid; @@ -463,7 +466,8 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), + 'validate'=>$langs->trans("Validate"), + //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); //if($user->rights->fournisseur->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); @@ -489,9 +493,9 @@ if ($resql) { $langs->load("mails"); - if (! GETPOST('cancel')) + if (! GETPOST('cancel','alpha')) { - $objecttmp=new FactureFourn($db); + $objecttmp=new FactureFournisseur($db); $listofselectedid=array(); $listofselectedthirdparties=array(); $listofselectedref=array(); @@ -890,7 +894,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 59b6e2a27e9..d6fd80e47fe 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,18 +34,23 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->load('companies'); $langs->load('bills'); $langs->load('banks'); $langs->load('compta'); -$action = GETPOST('action','alpha'); +// Security check +$action = GETPOST('action','alpha'); $confirm = GETPOST('confirm'); - -$facid=GETPOST('facid','int'); -$socid=GETPOST('socid','int'); +$facid = GETPOST('facid','int'); +$socid = GETPOST('socid','int'); $accountid = GETPOST('accountid'); +$day = GETPOST('day','int'); +$month = GETPOST('month','int'); +$year = GETPOST('year','int'); $search_ref=GETPOST("search_ref","int"); $search_account=GETPOST("search_account","int"); @@ -95,7 +101,7 @@ $arrayfields=array(); * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_ref=""; $search_account=""; @@ -214,7 +220,7 @@ if (empty($reshook)) setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors'); $error++; } - + // Check if payments in both currency if ($totalpayment > 0 && $multicurrency_totalpayment > 0) { @@ -316,11 +322,12 @@ $invoicesupplierstatic = new FactureFournisseur($db); llxHeader('',$langs->trans('ListPayment')); $form=new Form($db); +$formother=new FormOther($db); if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement') { $object = new FactureFournisseur($db); - $object->fetch($facid); + $result = $object->fetch($facid); $datefacture=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datefacture); @@ -341,9 +348,83 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { $obj = $db->fetch_object($resql); $total = $obj->total; - + print load_fiche_titre($langs->trans('DoPayment')); + // Add realtime total information + if (! empty($conf->use_javascript_ajax)) + { + print "\n".''."\n"; + } + print ''; print ''; print ''; @@ -353,7 +434,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; dol_fiche_head(null); - + print '
        '; print '
        '.$langs->trans('Company').''; @@ -384,7 +465,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
        '; dol_fiche_end(); - + $parameters=array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('paymentsupplierinvoices',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -408,6 +489,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $num = $db->num_rows($resql); if ($num > 0) { + $sign=1; + if ($object->type == 2) $sign=-1; + $i = 0; print '
        '; @@ -447,19 +531,37 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie while ($i < $num) { $objp = $db->fetch_object($resql); - + + $invoice=new FactureFournisseur($db); + $invoice->fetch($objp->facid); + $paiement = $invoice->getSommePaiement(); + $creditnotes=$invoice->getSumCreditNotesUsed(); + $deposits=$invoice->getSumDepositsUsed(); + $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); + $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); + + // Multicurrency Price + if (!empty($conf->multicurrency->enabled)) + { + $multicurrency_payment = $invoice->getSommePaiement(1); + $multicurrency_creditnotes=$invoice->getSumCreditNotesUsed(1); + $multicurrency_deposits=$invoice->getSumDepositsUsed(1); + $multicurrency_alreadypayed=price2num($multicurrency_payment + $multicurrency_creditnotes + $multicurrency_deposits,'MT'); + $multicurrency_remaintopay=price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits,'MT'); + } + print '
        '; $invoicesupplierstatic->ref=$objp->ref; $invoicesupplierstatic->id=$objp->facid; print $invoicesupplierstatic->getNomUrl(1); print ''.$objp->ref_supplier.'!!!'.$objp->multicurrency_code."'; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { @@ -485,14 +587,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) - { + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) + { print price($objp->multicurrency_am); } print ''; - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { print price($objp->multicurrency_total_ttc - $objp->multicurrency_am); } @@ -500,32 +602,58 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print ''.price($objp->total_ttc).''.price($objp->am).''.price($objp->total_ttc - $objp->am).''.price($remaintopay).''; + $namef = 'amount_'.$objp->facid; - if (!empty($conf->use_javascript_ajax)) - print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($objp->total_ttc - $objp->am)."'"); - print ''; + $nameRemain = 'remain_'.$objp->facid; + + if ($action != 'add_paiement') + { + if (!empty($conf->use_javascript_ajax)) + print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'"); + print ''; + print ''; + } + else + { + print ''; + print ''; + } print "'; + print ''; + + // Add remind multicurrency amount + $namef = 'multicurrency_amount_'.$objp->facid; + $nameRemain = 'multicurrency_remain_'.$objp->facid; + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { - $namef = 'multicurrency_amount_'.$objp->facid; - if (!empty($conf->use_javascript_ajax)) - print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($objp->multicurrency_total_ttc - $objp->multicurrency_am)."'"); - print ''; + if ($action != 'add_paiement') + { + if (!empty($conf->use_javascript_ajax)) + print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); + print ''; + print ''; + } + else + { + print ''; + print ''; + } } - print "
        '.price($total_ttc).''.price($totalrecu).''.price($total_ttc - $totalrecu).'  
        \n"; - + print "
        "; } $db->free($resql); @@ -574,7 +702,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
        '; if (!empty($totalpayment)) $text=$langs->trans('ConfirmSupplierPayment',price($totalpayment),$langs->trans("Currency".$conf->currency)); - if (!empty($multicurrency_totalpayment)) + if (!empty($multicurrency_totalpayment)) { $text.='
        '.$langs->trans('ConfirmSupplierPayment',price($multicurrency_totalpayment),$langs->trans("paymentInInvoiceCurrency")); } @@ -589,7 +717,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
        '; } } - else dol_print_error($db); + else dol_print_error($db); } /* @@ -601,7 +729,7 @@ if (empty($action)) $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); - if ($page == -1) { $page = 0 ; } + if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -626,6 +754,19 @@ if (empty($action)) if (!$user->rights->societe->client->voir) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql .= ' AND f.fk_soc = '.$socid; // Search criteria + if ($month > 0) + { + if ($year > 0 && empty($day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + else + $sql.= " AND date_format(p.datep, '%m') = '".$month."'"; + } + else if ($year > 0) + { + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + } if ($search_ref) $sql .= natural_search('p.rowid', $search_ref); if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'"; @@ -635,14 +776,14 @@ if (empty($action)) $sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.code, c.libelle, ba.rowid, ba.label"; if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= $db->order($sortfield,$sortorder); - + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } - + $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); @@ -655,6 +796,9 @@ if (empty($action)) $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($day) $param.=($day?"&day=".urlencode($day):""); + if ($month) $param.=($month?"&month=".urlencode($month):""); + if ($year) $param.=($year?"&year=".urlencode($year):""); if ($search_ref) $param.=($search_ref?"&search_ref=".urlencode($search_ref):""); if ($search_company) $param.=($search_company?"&search_company=".urlencode($search_company):""); if ($search_amount != '') $param.=($search_amount?"&search_amount=".urlencode($search_amount):""); @@ -667,37 +811,36 @@ if (empty($action)) $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + $massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); - + print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); print '
        '; if ($optioncss != '') print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - + $moreforfilter=''; - + $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; - + if ($moreforfilter) { print '
        '; print $moreforfilter; print '
        '; } - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
        '; print ''."\n"; @@ -706,7 +849,11 @@ if (empty($action)) print ''; - print ''; + print ''; print ''; @@ -729,21 +876,21 @@ if (empty($action)) print "\n"; print ''; - print_liste_field_titre($langs->trans('RefPayment'),$_SERVER["PHP_SELF"],'p.rowid','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'dp','',$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'c.libelle','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'p.amount','',$param,'align="right"',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],'p.rowid','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],'dp','',$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],'c.libelle','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Numero",$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Account",$_SERVER["PHP_SELF"],'ba.label','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],'p.amount','',$param,'align="right"',$sortfield,$sortorder); + //print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; - + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - + print ''; // Ref payment @@ -764,7 +911,7 @@ if (empty($action)) // Payment number print ''; - + print ''; // Ref print '
        '; print ''; print ' '; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($year?$year:-1,'year',1, 20, 5); + print ''; print ''; print '
        '.$objp->num_paiement.''; if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; else print ' '; diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index f2bb499d652..d0a0c5f0aea 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -56,10 +56,10 @@ if ($action == 'builddoc') $rap = new pdf_paiement_fourn($db); $outputlangs = $langs; - if (GETPOST('lang_id')) + if (GETPOST('lang_id','aZ09')) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang(GETPOST('lang_id')); + $outputlangs->setDefaultLang(GETPOST('lang_id','aZ09')); } // We save charset_output to restore it because write_file can change it if needed for diff --git a/htdocs/fourn/js/lib_dispatch.js b/htdocs/fourn/js/lib_dispatch.js index c58a4e1fe9d..84f74c30c54 100644 --- a/htdocs/fourn/js/lib_dispatch.js +++ b/htdocs/fourn/js/lib_dispatch.js @@ -26,16 +26,20 @@ * * @param index int index of produt line. 0 = first product line * @param type string type of dispatch (batch = batch dispatch, dispatch = non batch dispatch) + * @param mode string 'qtymissing' will create new line with qty missing, 'lessone' will keep 1 in old line and the rest in new one */ -function addDispatchLine(index,type) +function addDispatchLine(index, type, mode) { + mode = mode || 'qtymissing' + + console.log("Split line type="+type+" index="+index+" mode="+mode); var $row = $("tr[name='"+type+'_0_'+index+"']").clone(true), // clone first batch line to jQuery object nbrTrs = $("tr[name^='"+type+"_'][name$='_"+index+"']").length, // position of line for batch qtyOrdered = parseFloat($("#qty_ordered_"+(nbrTrs - 1)+"_"+index).val()), qty = parseFloat($("#qty_"+(nbrTrs - 1)+"_"+index).val()), qtyDispatched; - if (type === 'batch') + if (mode === 'lessone') { qtyDispatched = parseFloat($("#qty_dispatched_"+(nbrTrs - 1)+"_"+index).val()) + 1; } @@ -63,15 +67,22 @@ function addDispatchLine(index,type) /* Suffix of lines are: _ trs.length _ index */ $("#qty_"+nbrTrs+"_"+index).focus(); $("#qty_dispatched_"+(nbrTrs)+"_"+index).val(qtyDispatched); - if (type === 'batch') + + //hide all buttons then show only the last one + $("tr[name^='"+type+"_'][name$='_"+index+"'] .splitbutton").hide(); + $("tr[name^='"+type+"_'][name$='_"+index+"']:last .splitbutton").show(); + + if (mode === 'lessone') { $("#qty_"+(nbrTrs)+"_"+index).val(qty-1); $("#qty_"+(nbrTrs-1)+"_"+index).val(1); } else { - $("#qty_"+nbrTrs+"_"+index).val(qtyOrdered - qtyDispatched); - } + } + + //set focus on lot of new line (if it exists) + $("#lot_number_"+(nbrTrs)+"_"+index).focus(); } } \ No newline at end of file diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 40037dce274..f42cc1db110 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -150,7 +150,7 @@ if ($action == 'builddoc') if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); $outputlangs = $langs; - $newlang=GETPOST('lang_id','alpha'); + $newlang=GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { @@ -202,13 +202,13 @@ if ($result > 0) } $linkback = '' . $langs->trans("BackToList") . ''; - - + + dol_banner_tab($object,'id',$linkback,1,'rowid','ref'); - + print '
        '; print '
        '; - + print ''; /*print ''; @@ -278,7 +278,7 @@ if ($result > 0) print '
        '; print '
        '; - + print '
        '; /** @@ -315,7 +315,7 @@ if ($result > 0) while ($i < $num) { $objp = $db->fetch_object($resql); - + print '
        '.img_object($langs->trans('ShowBill'),'bill').' '; @@ -341,7 +341,7 @@ if ($result > 0) $i++; } } - + print "
        \n"; $db->free($resql); @@ -386,7 +386,7 @@ if ($result > 0) } } print '
        '; - + print '
        '; /* @@ -409,7 +409,7 @@ if ($result > 0) // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'supplier_payment',$socid,0,'listaction'.($genallowed?'largetitle':'')); + $somethingshown = $formactions->showactions($object,'supplier_payment',$socid,1,'listaction'.($genallowed?'largetitle':'')); print '
        '; //print '
        '; diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 00e2dbf939d..c6a8f24f98f 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -69,8 +69,8 @@ $extrafields = new ExtraFields($db); * Put here all code to do according to value of "action" parameter */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -82,7 +82,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $sref = ''; $sRefSupplier = ''; @@ -234,13 +234,13 @@ if ($resql) // Lignes des titres print '
        '; if (empty($user->rights->holiday->write_all)) { - print $form->select_dolusers($userid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print ''; + print $form->select_dolusers($fuserid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print ''; } - else print $form->select_dolusers(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0); + else print $form->select_dolusers(GETPOST('fuserid','int')?GETPOST('fuserid','int'):$user->id,'fuserid',0,'',0); print '
        '."\n"; -// FILTRES +// Filters print ''; print ''; -// DATE CREATE +// Create date print ''; -// UTILISATEUR +// User if ($user->rights->holiday->write_all) { print ''; } else { //print ''; print ''; } -// APPROVER +// Approve if($user->rights->holiday->write_all) { print ''; -// DUREE +// Duration print ''; -// DATE DEBUT +// Start date print ''; -// DATE FIN +// End date print ''; -// STATUT +// Status print ''; -// ACTION +// Actions print ''; print "\n"; print ''; -print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cp.rowid","",$param,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("DateCreateCP"),$_SERVER["PHP_SELF"],"cp.date_create","",$param,'align="center"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"cp.fk_user","",$param,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",$param,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','',$pram,'align="right"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",$param,'align="center"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",$param,'align="center"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",$param,'align="right"',$sortfield,$sortorder); +print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"cp.rowid","",$param,'',$sortfield,$sortorder); +print_liste_field_titre("DateCreateCP",$_SERVER["PHP_SELF"],"cp.date_create","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre("Employee",$_SERVER["PHP_SELF"],"cp.fk_user","",$param,'',$sortfield,$sortorder); +print_liste_field_titre("ValidatorCP",$_SERVER["PHP_SELF"],"cp.fk_validator","",$param,'',$sortfield,$sortorder); +print_liste_field_titre("Type",$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); +print_liste_field_titre("Duration",$_SERVER["PHP_SELF"],'','',$pram,'align="right"',$sortfield,$sortorder); +print_liste_field_titre("DateDebCP",$_SERVER["PHP_SELF"],"cp.date_debut","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre("DateFinCP",$_SERVER["PHP_SELF"],"cp.date_fin","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"cp.statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -404,7 +435,7 @@ if (! empty($holiday->holiday)) foreach($holiday->holiday as $infos_CP) { - // Utilisateur + // User $userstatic->id=$infos_CP['fk_user']; $userstatic->lastname=$infos_CP['user_lastname']; $userstatic->firstname=$infos_CP['user_firstname']; @@ -412,7 +443,7 @@ if (! empty($holiday->holiday)) $userstatic->statut=$infos_CP['user_statut']; $userstatic->photo=$infos_CP['user_photo']; - // Valideur + // Validator $approbatorstatic->id=$infos_CP['fk_validator']; $approbatorstatic->lastname=$infos_CP['validator_lastname']; $approbatorstatic->firstname=$infos_CP['validator_firstname']; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 17b374e5f4a..69bd6b6a190 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -91,14 +91,14 @@ print ''; print ''; print ''; -print_liste_field_titre($langs->trans('ID')); -print_liste_field_titre($langs->trans('Date'), $_SERVER["PHP_SELF"], '', '', '', 'align="center"'); -print_liste_field_titre($langs->trans('ActionByCP')); -print_liste_field_titre($langs->trans('UserUpdateCP')); -print_liste_field_titre($langs->trans('Description')); -print_liste_field_titre($langs->trans('Type')); -print_liste_field_titre($langs->trans('PrevSoldeCP'), $_SERVER["PHP_SELF"], '', '', '', 'align="right"'); -print_liste_field_titre($langs->trans('NewSoldeCP'), $_SERVER["PHP_SELF"], '', '', '', 'align="right"'); +print_liste_field_titre('ID'); +print_liste_field_titre('Date', $_SERVER["PHP_SELF"], '', '', '', 'align="center"'); +print_liste_field_titre('ActionByCP'); +print_liste_field_titre('UserUpdateCP'); +print_liste_field_titre('Description'); +print_liste_field_titre('Type'); +print_liste_field_titre('PrevSoldeCP', $_SERVER["PHP_SELF"], '', '', '', 'align="right"'); +print_liste_field_titre('NewSoldeCP', $_SERVER["PHP_SELF"], '', '', '', 'align="right"'); print ''; diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 091a2a15f06..077d76d0d32 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -90,12 +90,12 @@ if ($result) // Load attribute_label print '
        '; print ''; print ''; print ''; $formother->select_year($year_create,'year_create',1, $min_year, 0); print ''; - print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,0,0,'',0,'','maxwidth200'); + print $form->select_dolusers($search_employee,"search_employee",1,"",0,'','',0,0,0,'',0,'','maxwidth200'); print ' '; - print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,0,0,'',0,'','maxwidth200'); + print $form->select_dolusers($user->id,"search_employee",1,"",1,'','',0,0,0,'',0,'','maxwidth200'); print ''; @@ -352,30 +383,30 @@ foreach($typeleaves as $key => $val) //$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':''); $arraytypeleaves[$val['rowid']]=$labeltoshow; } -print $form->selectarray('type', $arraytypeleaves, (GETPOST('type')?GETPOST('type'):''), 1); +print $form->selectarray('search_type', $arraytypeleaves, (GETPOST('search_type')?GETPOST('search_type'):''), 1); print ' '; print ''; $formother->select_year($year_start,'year_start',1, $min_year, $max_year); print ''; print ''; $formother->select_year($year_end,'year_end',1, $min_year, $max_year); print ''; $holiday->selectStatutCP($search_statut); print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; @@ -384,15 +415,15 @@ print '
        '; - print ""; - print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"e.name","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Address"),$_SERVER["PHP_SELF"],"e.address","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Zipcode"),$_SERVER["PHP_SELF"],"e.zip","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"e.town","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"e.status","","",'align="right"',$sortfield,$sortorder); + print ''; + print_liste_field_titre("Name",$_SERVER["PHP_SELF"],"e.name","","","",$sortfield,$sortorder); + print_liste_field_titre("Address",$_SERVER["PHP_SELF"],"e.address","","","",$sortfield,$sortorder); + print_liste_field_titre("Zipcode",$_SERVER["PHP_SELF"],"e.zip","","","",$sortfield,$sortorder); + print_liste_field_titre("Town",$_SERVER["PHP_SELF"],"e.town","","","",$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"e.status","","",'align="right"',$sortfield,$sortorder); print "\n"; $var=true; @@ -107,12 +107,12 @@ if ($result) while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - + $establishmentstatic->id=$obj->rowid; $establishmentstatic->name=$obj->name; $establishmentstatic->status=$obj->status; - - + + print ''; print ''; print ''; diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 24038fd3403..5b3548cc8fb 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -109,7 +109,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; $i++; } - print '
        '.$establishmentstatic->getNomUrl(1).''.$obj->address.'
        '; + print '
        '; print ''; print '
        '; } @@ -171,12 +171,13 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $holidaystatic=new Holiday($db); $userstatic=new User($db); - + $listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon")); $typeleaves=$holidaystatic->getTypes(1,-1); - + $i = 0; + print '
        '; print ''; print ''; print ''; @@ -202,16 +203,16 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) print ''; print ''; print ''; - + $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning'; $endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon'; - + print ''; print ''; print ''; - + $i++; } @@ -220,7 +221,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) { print ''; } - print '
        '.$langs->trans("BoxTitleLastLeaveRequests",min($max,$num)).''.$holidaystatic->getNomUrl(1).''.$userstatic->getNomUrl(-1, 'leave').''.$typeleaves[$obj->fk_type]['label'].''.dol_print_date($obj->date_start,'day').' '.$langs->trans($listhalfday[$starthalfday]); print ''.dol_print_date($obj->date_end,'day').' '.$langs->trans($listhalfday[$endhalfday]); print ''.dol_print_date($db->jdate($obj->dm),'day').''.$holidaystatic->LibStatut($obj->status,3).'
        '.$langs->trans("None").'

        '; + print '

        '; } else dol_print_error($db); } @@ -279,7 +280,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) print ''.dol_print_date($db->jdate($obj->dm),'day').''; print ''.$deplacementstatic->LibStatut($obj->fk_statut,3).''; print ''; - + $i++; } @@ -346,7 +347,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire print ''.dol_print_date($db->jdate($obj->dm),'day').''; print ''.$expensereportstatic->LibStatut($obj->status,3).''; print ''; - + $i++; } diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 828e0f53719..2235812bae8 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -45,7 +45,7 @@ class Import var $error; var $errors; - + /** * Constructor @@ -242,7 +242,7 @@ class Import $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'import_model ('; $sql.= 'fk_user, label, type, field'; $sql.= ')'; - $sql.= " VALUES (".($user->id > 0 ? $user->id : 0).", '".$this->db->escape($this->model_name)."', '".$this->datatoimport."', '".$this->hexa."')"; + $sql.= " VALUES (".($user->id > 0 ? $user->id : 0).", '".$this->db->escape($this->model_name)."', '".$this->db->escape($this->datatoimport)."', '".$this->db->escape($this->hexa)."')"; dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/includes/ace/ace.js b/htdocs/includes/ace/ace.js new file mode 100644 index 00000000000..d93cddc1fd5 --- /dev/null +++ b/htdocs/includes/ace/ace.js @@ -0,0 +1,19560 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2010, Ajax.org B.V. + * 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 Ajax.org B.V. 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 AJAX.ORG B.V. 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. + * + * ***** END LICENSE BLOCK ***** */ + +/** + * Define a module along with a payload + * @param module a name for the payload + * @param payload a function to call with (require, exports, module) params + */ + +(function() { + +var ACE_NAMESPACE = "ace"; + +var global = (function() { return this; })(); +if (!global && typeof window != "undefined") global = window; // strict mode + + +if (!ACE_NAMESPACE && typeof requirejs !== "undefined") + return; + + +var define = function(module, deps, payload) { + if (typeof module !== "string") { + if (define.original) + define.original.apply(this, arguments); + else { + console.error("dropping module because define wasn\'t a string."); + console.trace(); + } + return; + } + if (arguments.length == 2) + payload = deps; + if (!define.modules[module]) { + define.payloads[module] = payload; + define.modules[module] = null; + } +}; + +define.modules = {}; +define.payloads = {}; + +/** + * Get at functionality define()ed using the function above + */ +var _require = function(parentId, module, callback) { + if (typeof module === "string") { + var payload = lookup(parentId, module); + if (payload != undefined) { + callback && callback(); + return payload; + } + } else if (Object.prototype.toString.call(module) === "[object Array]") { + var params = []; + for (var i = 0, l = module.length; i < l; ++i) { + var dep = lookup(parentId, module[i]); + if (dep == undefined && require.original) + return; + params.push(dep); + } + return callback && callback.apply(null, params) || true; + } +}; + +var require = function(module, callback) { + var packagedModule = _require("", module, callback); + if (packagedModule == undefined && require.original) + return require.original.apply(this, arguments); + return packagedModule; +}; + +var normalizeModule = function(parentId, moduleName) { + // normalize plugin requires + if (moduleName.indexOf("!") !== -1) { + var chunks = moduleName.split("!"); + return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]); + } + // normalize relative requires + if (moduleName.charAt(0) == ".") { + var base = parentId.split("/").slice(0, -1).join("/"); + moduleName = base + "/" + moduleName; + + while(moduleName.indexOf(".") !== -1 && previous != moduleName) { + var previous = moduleName; + moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + } + } + return moduleName; +}; + +/** + * Internal function to lookup moduleNames and resolve them by calling the + * definition function if needed. + */ +var lookup = function(parentId, moduleName) { + moduleName = normalizeModule(parentId, moduleName); + + var module = define.modules[moduleName]; + if (!module) { + module = define.payloads[moduleName]; + if (typeof module === 'function') { + var exports = {}; + var mod = { + id: moduleName, + uri: '', + exports: exports, + packaged: true + }; + + var req = function(module, callback) { + return _require(moduleName, module, callback); + }; + + var returnValue = module(req, exports, mod); + exports = returnValue || mod.exports; + define.modules[moduleName] = exports; + delete define.payloads[moduleName]; + } + module = define.modules[moduleName] = exports || module; + } + return module; +}; + +function exportAce(ns) { + var root = global; + if (ns) { + if (!global[ns]) + global[ns] = {}; + root = global[ns]; + } + + if (!root.define || !root.define.packaged) { + define.original = root.define; + root.define = define; + root.define.packaged = true; + } + + if (!root.require || !root.require.packaged) { + require.original = root.require; + root.require = require; + root.require.packaged = true; + } +} + +exportAce(ACE_NAMESPACE); + +})(); + +ace.define("ace/lib/regexp",["require","exports","module"], function(require, exports, module) { +"use strict"; + + var real = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }, + compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups + compliantLastIndexIncrement = function () { + var x = /^/g; + real.test.call(x, ""); + return !x.lastIndex; + }(); + + if (compliantLastIndexIncrement && compliantExecNpcg) + return; + RegExp.prototype.exec = function (str) { + var match = real.exec.apply(this, arguments), + name, r2; + if ( typeof(str) == 'string' && match) { + if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { + r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", "")); + real.replace.call(str.slice(match.index), r2, function () { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) + match[i] = undefined; + } + }); + } + if (this._xregexp && this._xregexp.captureNames) { + for (var i = 1; i < match.length; i++) { + name = this._xregexp.captureNames[i - 1]; + if (name) + match[name] = match[i]; + } + } + if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + } + return match; + }; + if (!compliantLastIndexIncrement) { + RegExp.prototype.test = function (str) { + var match = real.exec.call(this, str); + if (match && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + return !!match; + }; + } + + function getNativeFlags (regex) { + return (regex.global ? "g" : "") + + (regex.ignoreCase ? "i" : "") + + (regex.multiline ? "m" : "") + + (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 + (regex.sticky ? "y" : ""); + } + + function indexOf (array, item, from) { + if (Array.prototype.indexOf) // Use the native array method if available + return array.indexOf(item, from); + for (var i = from || 0; i < array.length; i++) { + if (array[i] === item) + return i; + } + return -1; + } + +}); + +ace.define("ace/lib/es5-shim",["require","exports","module"], function(require, exports, module) { + +function Empty() {} + +if (!Function.prototype.bind) { + Function.prototype.bind = function bind(that) { // .length is 1 + var target = this; + if (typeof target != "function") { + throw new TypeError("Function.prototype.bind called on incompatible " + target); + } + var args = slice.call(arguments, 1); // for normal call + var bound = function () { + + if (this instanceof bound) { + + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + + } + + }; + if(target.prototype) { + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; +} +var call = Function.prototype.call; +var prototypeOfArray = Array.prototype; +var prototypeOfObject = Object.prototype; +var slice = prototypeOfArray.slice; +var _toString = call.bind(prototypeOfObject.toString); +var owns = call.bind(prototypeOfObject.hasOwnProperty); +var defineGetter; +var defineSetter; +var lookupGetter; +var lookupSetter; +var supportsAccessors; +if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { + defineGetter = call.bind(prototypeOfObject.__defineGetter__); + defineSetter = call.bind(prototypeOfObject.__defineSetter__); + lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); + lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); +} +if ([1,2].splice(0).length != 2) { + if(function() { // test IE < 9 to splice bug - see issue #138 + function makeArray(l) { + var a = new Array(l+2); + a[0] = a[1] = 0; + return a; + } + var array = [], lengthBefore; + + array.splice.apply(array, makeArray(20)); + array.splice.apply(array, makeArray(26)); + + lengthBefore = array.length; //46 + array.splice(5, 0, "XXX"); // add one element + + lengthBefore + 1 == array.length + + if (lengthBefore + 1 == array.length) { + return true;// has right splice implementation without bugs + } + }()) {//IE 6/7 + var array_splice = Array.prototype.splice; + Array.prototype.splice = function(start, deleteCount) { + if (!arguments.length) { + return []; + } else { + return array_splice.apply(this, [ + start === void 0 ? 0 : start, + deleteCount === void 0 ? (this.length - start) : deleteCount + ].concat(slice.call(arguments, 2))) + } + }; + } else {//IE8 + Array.prototype.splice = function(pos, removeCount){ + var length = this.length; + if (pos > 0) { + if (pos > length) + pos = length; + } else if (pos == void 0) { + pos = 0; + } else if (pos < 0) { + pos = Math.max(length + pos, 0); + } + + if (!(pos+removeCount < length)) + removeCount = length - pos; + + var removed = this.slice(pos, pos+removeCount); + var insert = slice.call(arguments, 2); + var add = insert.length; + if (pos === length) { + if (add) { + this.push.apply(this, insert); + } + } else { + var remove = Math.min(removeCount, length - pos); + var tailOldPos = pos + remove; + var tailNewPos = tailOldPos + add - remove; + var tailCount = length - tailOldPos; + var lengthAfterRemove = length - remove; + + if (tailNewPos < tailOldPos) { // case A + for (var i = 0; i < tailCount; ++i) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } else if (tailNewPos > tailOldPos) { // case B + for (i = tailCount; i--; ) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } // else, add == remove (nothing to do) + + if (add && pos === lengthAfterRemove) { + this.length = lengthAfterRemove; // truncate array + this.push.apply(this, insert); + } else { + this.length = lengthAfterRemove + add; // reserves space + for (i = 0; i < add; ++i) { + this[pos+i] = insert[i]; + } + } + } + return removed; + }; + } +} +if (!Array.isArray) { + Array.isArray = function isArray(obj) { + return _toString(obj) == "[object Array]"; + }; +} +var boxedString = Object("a"), + splitString = boxedString[0] != "a" || !(0 in boxedString); + +if (!Array.prototype.forEach) { + Array.prototype.forEach = function forEach(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + thisp = arguments[1], + i = -1, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(); // TODO message + } + + while (++i < length) { + if (i in self) { + fun.call(thisp, self[i], i, object); + } + } + }; +} +if (!Array.prototype.map) { + Array.prototype.map = function map(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = Array(length), + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) + result[i] = fun.call(thisp, self[i], i, object); + } + return result; + }; +} +if (!Array.prototype.filter) { + Array.prototype.filter = function filter(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = [], + value, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) { + value = self[i]; + if (fun.call(thisp, value, i, object)) { + result.push(value); + } + } + } + return result; + }; +} +if (!Array.prototype.every) { + Array.prototype.every = function every(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && !fun.call(thisp, self[i], i, object)) { + return false; + } + } + return true; + }; +} +if (!Array.prototype.some) { + Array.prototype.some = function some(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && fun.call(thisp, self[i], i, object)) { + return true; + } + } + return false; + }; +} +if (!Array.prototype.reduce) { + Array.prototype.reduce = function reduce(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduce of empty array with no initial value"); + } + + var i = 0; + var result; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i++]; + break; + } + if (++i >= length) { + throw new TypeError("reduce of empty array with no initial value"); + } + } while (true); + } + + for (; i < length; i++) { + if (i in self) { + result = fun.call(void 0, result, self[i], i, object); + } + } + + return result; + }; +} +if (!Array.prototype.reduceRight) { + Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + + var result, i = length - 1; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i--]; + break; + } + if (--i < 0) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + } while (true); + } + + do { + if (i in this) { + result = fun.call(void 0, result, self[i], i, object); + } + } while (i--); + + return result; + }; +} +if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { + Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + + var i = 0; + if (arguments.length > 1) { + i = toInteger(arguments[1]); + } + i = i >= 0 ? i : Math.max(0, length + i); + for (; i < length; i++) { + if (i in self && self[i] === sought) { + return i; + } + } + return -1; + }; +} +if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { + Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + var i = length - 1; + if (arguments.length > 1) { + i = Math.min(i, toInteger(arguments[1])); + } + i = i >= 0 ? i : length - Math.abs(i); + for (; i >= 0; i--) { + if (i in self && sought === self[i]) { + return i; + } + } + return -1; + }; +} +if (!Object.getPrototypeOf) { + Object.getPrototypeOf = function getPrototypeOf(object) { + return object.__proto__ || ( + object.constructor ? + object.constructor.prototype : + prototypeOfObject + ); + }; +} +if (!Object.getOwnPropertyDescriptor) { + var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + + "non-object: "; + Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT + object); + if (!owns(object, property)) + return; + + var descriptor, getter, setter; + descriptor = { enumerable: true, configurable: true }; + if (supportsAccessors) { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + + var getter = lookupGetter(object, property); + var setter = lookupSetter(object, property); + object.__proto__ = prototype; + + if (getter || setter) { + if (getter) descriptor.get = getter; + if (setter) descriptor.set = setter; + return descriptor; + } + } + descriptor.value = object[property]; + return descriptor; + }; +} +if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function getOwnPropertyNames(object) { + return Object.keys(object); + }; +} +if (!Object.create) { + var createEmpty; + if (Object.prototype.__proto__ === null) { + createEmpty = function () { + return { "__proto__": null }; + }; + } else { + createEmpty = function () { + var empty = {}; + for (var i in empty) + empty[i] = null; + empty.constructor = + empty.hasOwnProperty = + empty.propertyIsEnumerable = + empty.isPrototypeOf = + empty.toLocaleString = + empty.toString = + empty.valueOf = + empty.__proto__ = null; + return empty; + } + } + + Object.create = function create(prototype, properties) { + var object; + if (prototype === null) { + object = createEmpty(); + } else { + if (typeof prototype != "object") + throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); + var Type = function () {}; + Type.prototype = prototype; + object = new Type(); + object.__proto__ = prototype; + } + if (properties !== void 0) + Object.defineProperties(object, properties); + return object; + }; +} + +function doesDefinePropertyWork(object) { + try { + Object.defineProperty(object, "sentinel", {}); + return "sentinel" in object; + } catch (exception) { + } +} +if (Object.defineProperty) { + var definePropertyWorksOnObject = doesDefinePropertyWork({}); + var definePropertyWorksOnDom = typeof document == "undefined" || + doesDefinePropertyWork(document.createElement("div")); + if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { + var definePropertyFallback = Object.defineProperty; + } +} + +if (!Object.defineProperty || definePropertyFallback) { + var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; + var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " + var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + + "on this javascript engine"; + + Object.defineProperty = function defineProperty(object, property, descriptor) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT_TARGET + object); + if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) + throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); + if (definePropertyFallback) { + try { + return definePropertyFallback.call(Object, object, property, descriptor); + } catch (exception) { + } + } + if (owns(descriptor, "value")) { + + if (supportsAccessors && (lookupGetter(object, property) || + lookupSetter(object, property))) + { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + delete object[property]; + object[property] = descriptor.value; + object.__proto__ = prototype; + } else { + object[property] = descriptor.value; + } + } else { + if (!supportsAccessors) + throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); + if (owns(descriptor, "get")) + defineGetter(object, property, descriptor.get); + if (owns(descriptor, "set")) + defineSetter(object, property, descriptor.set); + } + + return object; + }; +} +if (!Object.defineProperties) { + Object.defineProperties = function defineProperties(object, properties) { + for (var property in properties) { + if (owns(properties, property)) + Object.defineProperty(object, property, properties[property]); + } + return object; + }; +} +if (!Object.seal) { + Object.seal = function seal(object) { + return object; + }; +} +if (!Object.freeze) { + Object.freeze = function freeze(object) { + return object; + }; +} +try { + Object.freeze(function () {}); +} catch (exception) { + Object.freeze = (function freeze(freezeObject) { + return function freeze(object) { + if (typeof object == "function") { + return object; + } else { + return freezeObject(object); + } + }; + })(Object.freeze); +} +if (!Object.preventExtensions) { + Object.preventExtensions = function preventExtensions(object) { + return object; + }; +} +if (!Object.isSealed) { + Object.isSealed = function isSealed(object) { + return false; + }; +} +if (!Object.isFrozen) { + Object.isFrozen = function isFrozen(object) { + return false; + }; +} +if (!Object.isExtensible) { + Object.isExtensible = function isExtensible(object) { + if (Object(object) === object) { + throw new TypeError(); // TODO message + } + var name = ''; + while (owns(object, name)) { + name += '?'; + } + object[name] = true; + var returnValue = owns(object, name); + delete object[name]; + return returnValue; + }; +} +if (!Object.keys) { + var hasDontEnumBug = true, + dontEnums = [ + "toString", + "toLocaleString", + "valueOf", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "constructor" + ], + dontEnumsLength = dontEnums.length; + + for (var key in {"toString": null}) { + hasDontEnumBug = false; + } + + Object.keys = function keys(object) { + + if ( + (typeof object != "object" && typeof object != "function") || + object === null + ) { + throw new TypeError("Object.keys called on a non-object"); + } + + var keys = []; + for (var name in object) { + if (owns(object, name)) { + keys.push(name); + } + } + + if (hasDontEnumBug) { + for (var i = 0, ii = dontEnumsLength; i < ii; i++) { + var dontEnum = dontEnums[i]; + if (owns(object, dontEnum)) { + keys.push(dontEnum); + } + } + } + return keys; + }; + +} +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + + "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + + "\u2029\uFEFF"; +if (!String.prototype.trim || ws.trim()) { + ws = "[" + ws + "]"; + var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), + trimEndRegexp = new RegExp(ws + ws + "*$"); + String.prototype.trim = function trim() { + return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); + }; +} + +function toInteger(n) { + n = +n; + if (n !== n) { // isNaN + n = 0; + } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + return n; +} + +function isPrimitive(input) { + var type = typeof input; + return ( + input === null || + type === "undefined" || + type === "boolean" || + type === "number" || + type === "string" + ); +} + +function toPrimitive(input) { + var val, valueOf, toString; + if (isPrimitive(input)) { + return input; + } + valueOf = input.valueOf; + if (typeof valueOf === "function") { + val = valueOf.call(input); + if (isPrimitive(val)) { + return val; + } + } + toString = input.toString; + if (typeof toString === "function") { + val = toString.call(input); + if (isPrimitive(val)) { + return val; + } + } + throw new TypeError(); +} +var toObject = function (o) { + if (o == null) { // this matches both null and undefined + throw new TypeError("can't convert "+o+" to object"); + } + return Object(o); +}; + +}); + +ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"], function(require, exports, module) { +"use strict"; + +require("./regexp"); +require("./es5-shim"); + +}); + +ace.define("ace/lib/dom",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var XHTML_NS = "http://www.w3.org/1999/xhtml"; + +exports.getDocumentHead = function(doc) { + if (!doc) + doc = document; + return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; +} + +exports.createElement = function(tag, ns) { + return document.createElementNS ? + document.createElementNS(ns || XHTML_NS, tag) : + document.createElement(tag); +}; + +exports.hasCssClass = function(el, name) { + var classes = (el.className + "").split(/\s+/g); + return classes.indexOf(name) !== -1; +}; +exports.addCssClass = function(el, name) { + if (!exports.hasCssClass(el, name)) { + el.className += " " + name; + } +}; +exports.removeCssClass = function(el, name) { + var classes = el.className.split(/\s+/g); + while (true) { + var index = classes.indexOf(name); + if (index == -1) { + break; + } + classes.splice(index, 1); + } + el.className = classes.join(" "); +}; + +exports.toggleCssClass = function(el, name) { + var classes = el.className.split(/\s+/g), add = true; + while (true) { + var index = classes.indexOf(name); + if (index == -1) { + break; + } + add = false; + classes.splice(index, 1); + } + if (add) + classes.push(name); + + el.className = classes.join(" "); + return add; +}; +exports.setCssClass = function(node, className, include) { + if (include) { + exports.addCssClass(node, className); + } else { + exports.removeCssClass(node, className); + } +}; + +exports.hasCssString = function(id, doc) { + var index = 0, sheets; + doc = doc || document; + + if (doc.createStyleSheet && (sheets = doc.styleSheets)) { + while (index < sheets.length) + if (sheets[index++].owningElement.id === id) return true; + } else if ((sheets = doc.getElementsByTagName("style"))) { + while (index < sheets.length) + if (sheets[index++].id === id) return true; + } + + return false; +}; + +exports.importCssString = function importCssString(cssText, id, doc) { + doc = doc || document; + if (id && exports.hasCssString(id, doc)) + return null; + + var style; + + if (id) + cssText += "\n/*# sourceURL=ace/css/" + id + " */"; + + if (doc.createStyleSheet) { + style = doc.createStyleSheet(); + style.cssText = cssText; + if (id) + style.owningElement.id = id; + } else { + style = exports.createElement("style"); + style.appendChild(doc.createTextNode(cssText)); + if (id) + style.id = id; + + exports.getDocumentHead(doc).appendChild(style); + } +}; + +exports.importCssStylsheet = function(uri, doc) { + if (doc.createStyleSheet) { + doc.createStyleSheet(uri); + } else { + var link = exports.createElement('link'); + link.rel = 'stylesheet'; + link.href = uri; + + exports.getDocumentHead(doc).appendChild(link); + } +}; + +exports.getInnerWidth = function(element) { + return ( + parseInt(exports.computedStyle(element, "paddingLeft"), 10) + + parseInt(exports.computedStyle(element, "paddingRight"), 10) + + element.clientWidth + ); +}; + +exports.getInnerHeight = function(element) { + return ( + parseInt(exports.computedStyle(element, "paddingTop"), 10) + + parseInt(exports.computedStyle(element, "paddingBottom"), 10) + + element.clientHeight + ); +}; + +exports.scrollbarWidth = function(document) { + var inner = exports.createElement("ace_inner"); + inner.style.width = "100%"; + inner.style.minWidth = "0px"; + inner.style.height = "200px"; + inner.style.display = "block"; + + var outer = exports.createElement("ace_outer"); + var style = outer.style; + + style.position = "absolute"; + style.left = "-10000px"; + style.overflow = "hidden"; + style.width = "200px"; + style.minWidth = "0px"; + style.height = "150px"; + style.display = "block"; + + outer.appendChild(inner); + + var body = document.documentElement; + body.appendChild(outer); + + var noScrollbar = inner.offsetWidth; + + style.overflow = "scroll"; + var withScrollbar = inner.offsetWidth; + + if (noScrollbar == withScrollbar) { + withScrollbar = outer.clientWidth; + } + + body.removeChild(outer); + + return noScrollbar-withScrollbar; +}; + +if (typeof document == "undefined") { + exports.importCssString = function() {}; + return; +} + +if (window.pageYOffset !== undefined) { + exports.getPageScrollTop = function() { + return window.pageYOffset; + }; + + exports.getPageScrollLeft = function() { + return window.pageXOffset; + }; +} +else { + exports.getPageScrollTop = function() { + return document.body.scrollTop; + }; + + exports.getPageScrollLeft = function() { + return document.body.scrollLeft; + }; +} + +if (window.getComputedStyle) + exports.computedStyle = function(element, style) { + if (style) + return (window.getComputedStyle(element, "") || {})[style] || ""; + return window.getComputedStyle(element, "") || {}; + }; +else + exports.computedStyle = function(element, style) { + if (style) + return element.currentStyle[style]; + return element.currentStyle; + }; +exports.setInnerHtml = function(el, innerHtml) { + var element = el.cloneNode(false);//document.createElement("div"); + element.innerHTML = innerHtml; + el.parentNode.replaceChild(element, el); + return element; +}; + +if ("textContent" in document.documentElement) { + exports.setInnerText = function(el, innerText) { + el.textContent = innerText; + }; + + exports.getInnerText = function(el) { + return el.textContent; + }; +} +else { + exports.setInnerText = function(el, innerText) { + el.innerText = innerText; + }; + + exports.getInnerText = function(el) { + return el.innerText; + }; +} + +exports.getParentWindow = function(document) { + return document.defaultView || document.parentWindow; +}; + +}); + +ace.define("ace/lib/oop",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.inherits = function(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); +}; + +exports.mixin = function(obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + return obj; +}; + +exports.implement = function(proto, mixin) { + exports.mixin(proto, mixin); +}; + +}); + +ace.define("ace/lib/keys",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop"], function(require, exports, module) { +"use strict"; + +require("./fixoldbrowsers"); + +var oop = require("./oop"); +var Keys = (function() { + var ret = { + MODIFIER_KEYS: { + 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta' + }, + + KEY_MODS: { + "ctrl": 1, "alt": 2, "option" : 2, "shift": 4, + "super": 8, "meta": 8, "command": 8, "cmd": 8 + }, + + FUNCTION_KEYS : { + 8 : "Backspace", + 9 : "Tab", + 13 : "Return", + 19 : "Pause", + 27 : "Esc", + 32 : "Space", + 33 : "PageUp", + 34 : "PageDown", + 35 : "End", + 36 : "Home", + 37 : "Left", + 38 : "Up", + 39 : "Right", + 40 : "Down", + 44 : "Print", + 45 : "Insert", + 46 : "Delete", + 96 : "Numpad0", + 97 : "Numpad1", + 98 : "Numpad2", + 99 : "Numpad3", + 100: "Numpad4", + 101: "Numpad5", + 102: "Numpad6", + 103: "Numpad7", + 104: "Numpad8", + 105: "Numpad9", + '-13': "NumpadEnter", + 112: "F1", + 113: "F2", + 114: "F3", + 115: "F4", + 116: "F5", + 117: "F6", + 118: "F7", + 119: "F8", + 120: "F9", + 121: "F10", + 122: "F11", + 123: "F12", + 144: "Numlock", + 145: "Scrolllock" + }, + + PRINTABLE_KEYS: { + 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', + 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a', + 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', + 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', + 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', + 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.', + 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`', + 219: '[', 220: '\\',221: ']', 222: "'", 111: '/', 106: '*' + } + }; + var name, i; + for (i in ret.FUNCTION_KEYS) { + name = ret.FUNCTION_KEYS[i].toLowerCase(); + ret[name] = parseInt(i, 10); + } + for (i in ret.PRINTABLE_KEYS) { + name = ret.PRINTABLE_KEYS[i].toLowerCase(); + ret[name] = parseInt(i, 10); + } + oop.mixin(ret, ret.MODIFIER_KEYS); + oop.mixin(ret, ret.PRINTABLE_KEYS); + oop.mixin(ret, ret.FUNCTION_KEYS); + ret.enter = ret["return"]; + ret.escape = ret.esc; + ret.del = ret["delete"]; + ret[173] = '-'; + + (function() { + var mods = ["cmd", "ctrl", "alt", "shift"]; + for (var i = Math.pow(2, mods.length); i--;) { + ret.KEY_MODS[i] = mods.filter(function(x) { + return i & ret.KEY_MODS[x]; + }).join("-") + "-"; + } + })(); + + ret.KEY_MODS[0] = ""; + ret.KEY_MODS[-1] = "input-"; + + return ret; +})(); +oop.mixin(exports, Keys); + +exports.keyCodeToString = function(keyCode) { + var keyString = Keys[keyCode]; + if (typeof keyString != "string") + keyString = String.fromCharCode(keyCode); + return keyString.toLowerCase(); +}; + +}); + +ace.define("ace/lib/useragent",["require","exports","module"], function(require, exports, module) { +"use strict"; +exports.OS = { + LINUX: "LINUX", + MAC: "MAC", + WINDOWS: "WINDOWS" +}; +exports.getOS = function() { + if (exports.isMac) { + return exports.OS.MAC; + } else if (exports.isLinux) { + return exports.OS.LINUX; + } else { + return exports.OS.WINDOWS; + } +}; +if (typeof navigator != "object") + return; + +var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); +var ua = navigator.userAgent; +exports.isWin = (os == "win"); +exports.isMac = (os == "mac"); +exports.isLinux = (os == "linux"); +exports.isIE = + (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) + ? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]) + : parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]); // for ie + +exports.isOldIE = exports.isIE && exports.isIE < 9; +exports.isGecko = exports.isMozilla = (window.Controllers || window.controllers) && window.navigator.product === "Gecko"; +exports.isOldGecko = exports.isGecko && parseInt((ua.match(/rv:(\d+)/)||[])[1], 10) < 4; +exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]"; +exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; + +exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined; + +exports.isAIR = ua.indexOf("AdobeAIR") >= 0; + +exports.isIPad = ua.indexOf("iPad") >= 0; + +exports.isChromeOS = ua.indexOf(" CrOS ") >= 0; + +exports.isIOS = /iPad|iPhone|iPod/.test(ua) && !window.MSStream; + +if (exports.isIOS) exports.isMac = true; + +}); + +ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module) { +"use strict"; + +var keys = require("./keys"); +var useragent = require("./useragent"); + +var pressedKeys = null; +var ts = 0; + +exports.addListener = function(elem, type, callback) { + if (elem.addEventListener) { + return elem.addEventListener(type, callback, false); + } + if (elem.attachEvent) { + var wrapper = function() { + callback.call(elem, window.event); + }; + callback._wrapper = wrapper; + elem.attachEvent("on" + type, wrapper); + } +}; + +exports.removeListener = function(elem, type, callback) { + if (elem.removeEventListener) { + return elem.removeEventListener(type, callback, false); + } + if (elem.detachEvent) { + elem.detachEvent("on" + type, callback._wrapper || callback); + } +}; +exports.stopEvent = function(e) { + exports.stopPropagation(e); + exports.preventDefault(e); + return false; +}; + +exports.stopPropagation = function(e) { + if (e.stopPropagation) + e.stopPropagation(); + else + e.cancelBubble = true; +}; + +exports.preventDefault = function(e) { + if (e.preventDefault) + e.preventDefault(); + else + e.returnValue = false; +}; +exports.getButton = function(e) { + if (e.type == "dblclick") + return 0; + if (e.type == "contextmenu" || (useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey))) + return 2; + if (e.preventDefault) { + return e.button; + } + else { + return {1:0, 2:2, 4:1}[e.button]; + } +}; + +exports.capture = function(el, eventHandler, releaseCaptureHandler) { + function onMouseUp(e) { + eventHandler && eventHandler(e); + releaseCaptureHandler && releaseCaptureHandler(e); + + exports.removeListener(document, "mousemove", eventHandler, true); + exports.removeListener(document, "mouseup", onMouseUp, true); + exports.removeListener(document, "dragstart", onMouseUp, true); + } + + exports.addListener(document, "mousemove", eventHandler, true); + exports.addListener(document, "mouseup", onMouseUp, true); + exports.addListener(document, "dragstart", onMouseUp, true); + + return onMouseUp; +}; + +exports.addTouchMoveListener = function (el, callback) { + if ("ontouchmove" in el) { + var startx, starty; + exports.addListener(el, "touchstart", function (e) { + var touchObj = e.changedTouches[0]; + startx = touchObj.clientX; + starty = touchObj.clientY; + }); + exports.addListener(el, "touchmove", function (e) { + var factor = 1, + touchObj = e.changedTouches[0]; + + e.wheelX = -(touchObj.clientX - startx) / factor; + e.wheelY = -(touchObj.clientY - starty) / factor; + + startx = touchObj.clientX; + starty = touchObj.clientY; + + callback(e); + }); + } +}; + +exports.addMouseWheelListener = function(el, callback) { + if ("onmousewheel" in el) { + exports.addListener(el, "mousewheel", function(e) { + var factor = 8; + if (e.wheelDeltaX !== undefined) { + e.wheelX = -e.wheelDeltaX / factor; + e.wheelY = -e.wheelDeltaY / factor; + } else { + e.wheelX = 0; + e.wheelY = -e.wheelDelta / factor; + } + callback(e); + }); + } else if ("onwheel" in el) { + exports.addListener(el, "wheel", function(e) { + var factor = 0.35; + switch (e.deltaMode) { + case e.DOM_DELTA_PIXEL: + e.wheelX = e.deltaX * factor || 0; + e.wheelY = e.deltaY * factor || 0; + break; + case e.DOM_DELTA_LINE: + case e.DOM_DELTA_PAGE: + e.wheelX = (e.deltaX || 0) * 5; + e.wheelY = (e.deltaY || 0) * 5; + break; + } + + callback(e); + }); + } else { + exports.addListener(el, "DOMMouseScroll", function(e) { + if (e.axis && e.axis == e.HORIZONTAL_AXIS) { + e.wheelX = (e.detail || 0) * 5; + e.wheelY = 0; + } else { + e.wheelX = 0; + e.wheelY = (e.detail || 0) * 5; + } + callback(e); + }); + } +}; + +exports.addMultiMouseDownListener = function(elements, timeouts, eventHandler, callbackName) { + var clicks = 0; + var startX, startY, timer; + var eventNames = { + 2: "dblclick", + 3: "tripleclick", + 4: "quadclick" + }; + + function onMousedown(e) { + if (exports.getButton(e) !== 0) { + clicks = 0; + } else if (e.detail > 1) { + clicks++; + if (clicks > 4) + clicks = 1; + } else { + clicks = 1; + } + if (useragent.isIE) { + var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; + if (!timer || isNewClick) + clicks = 1; + if (timer) + clearTimeout(timer); + timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); + + if (clicks == 1) { + startX = e.clientX; + startY = e.clientY; + } + } + + e._clicks = clicks; + + eventHandler[callbackName]("mousedown", e); + + if (clicks > 4) + clicks = 0; + else if (clicks > 1) + return eventHandler[callbackName](eventNames[clicks], e); + } + function onDblclick(e) { + clicks = 2; + if (timer) + clearTimeout(timer); + timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); + eventHandler[callbackName]("mousedown", e); + eventHandler[callbackName](eventNames[clicks], e); + } + if (!Array.isArray(elements)) + elements = [elements]; + elements.forEach(function(el) { + exports.addListener(el, "mousedown", onMousedown); + if (useragent.isOldIE) + exports.addListener(el, "dblclick", onDblclick); + }); +}; + +var getModifierHash = useragent.isMac && useragent.isOpera && !("KeyboardEvent" in window) + ? function(e) { + return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0); + } + : function(e) { + return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); + }; + +exports.getModifierString = function(e) { + return keys.KEY_MODS[getModifierHash(e)]; +}; + +function normalizeCommandKeys(callback, e, keyCode) { + var hashId = getModifierHash(e); + + if (!useragent.isMac && pressedKeys) { + if (e.getModifierState && (e.getModifierState("OS") || e.getModifierState("Win"))) + hashId |= 8; + if (pressedKeys.altGr) { + if ((3 & hashId) != 3) + pressedKeys.altGr = 0; + else + return; + } + if (keyCode === 18 || keyCode === 17) { + var location = "location" in e ? e.location : e.keyLocation; + if (keyCode === 17 && location === 1) { + if (pressedKeys[keyCode] == 1) + ts = e.timeStamp; + } else if (keyCode === 18 && hashId === 3 && location === 2) { + var dt = e.timeStamp - ts; + if (dt < 50) + pressedKeys.altGr = true; + } + } + } + + if (keyCode in keys.MODIFIER_KEYS) { + keyCode = -1; + } + if (hashId & 8 && (keyCode >= 91 && keyCode <= 93)) { + keyCode = -1; + } + + if (!hashId && keyCode === 13) { + var location = "location" in e ? e.location : e.keyLocation; + if (location === 3) { + callback(e, hashId, -keyCode); + if (e.defaultPrevented) + return; + } + } + + if (useragent.isChromeOS && hashId & 8) { + callback(e, hashId, keyCode); + if (e.defaultPrevented) + return; + else + hashId &= ~8; + } + if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) { + return false; + } + + return callback(e, hashId, keyCode); +} + + +exports.addCommandKeyListener = function(el, callback) { + var addListener = exports.addListener; + if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) { + var lastKeyDownKeyCode = null; + addListener(el, "keydown", function(e) { + lastKeyDownKeyCode = e.keyCode; + }); + addListener(el, "keypress", function(e) { + return normalizeCommandKeys(callback, e, lastKeyDownKeyCode); + }); + } else { + var lastDefaultPrevented = null; + + addListener(el, "keydown", function(e) { + pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1; + var result = normalizeCommandKeys(callback, e, e.keyCode); + lastDefaultPrevented = e.defaultPrevented; + return result; + }); + + addListener(el, "keypress", function(e) { + if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) { + exports.stopEvent(e); + lastDefaultPrevented = null; + } + }); + + addListener(el, "keyup", function(e) { + pressedKeys[e.keyCode] = null; + }); + + if (!pressedKeys) { + resetPressedKeys(); + addListener(window, "focus", resetPressedKeys); + } + } +}; +function resetPressedKeys() { + pressedKeys = Object.create(null); +} + +if (typeof window == "object" && window.postMessage && !useragent.isOldIE) { + var postMessageId = 1; + exports.nextTick = function(callback, win) { + win = win || window; + var messageName = "zero-timeout-message-" + postMessageId; + exports.addListener(win, "message", function listener(e) { + if (e.data == messageName) { + exports.stopPropagation(e); + exports.removeListener(win, "message", listener); + callback(); + } + }); + win.postMessage(messageName, "*"); + }; +} + + +exports.nextFrame = typeof window == "object" && (window.requestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || window.msRequestAnimationFrame + || window.oRequestAnimationFrame); + +if (exports.nextFrame) + exports.nextFrame = exports.nextFrame.bind(window); +else + exports.nextFrame = function(callback) { + setTimeout(callback, 17); + }; +}); + +ace.define("ace/lib/lang",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.last = function(a) { + return a[a.length - 1]; +}; + +exports.stringReverse = function(string) { + return string.split("").reverse().join(""); +}; + +exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + + if (count >>= 1) + string += string; + } + return result; +}; + +var trimBeginRegexp = /^\s\s*/; +var trimEndRegexp = /\s\s*$/; + +exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); +}; + +exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); +}; + +exports.copyObject = function(obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; +}; + +exports.copyArray = function(array){ + var copy = []; + for (var i=0, l=array.length; i PLACEHOLDER.length) + data = data.substr(9); + else if (data.substr(0, 4) == PLACEHOLDER.substr(0, 4)) + data = data.substr(4, data.length - PLACEHOLDER.length + 1); + else if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) + data = data.slice(0, -1); + if (data == PLACEHOLDER.charAt(0)) { + } else if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) + data = data.slice(0, -1); + + if (data) + host.onTextInput(data); + } + if (copied) { + copied = false; + } + if (afterContextMenu) + afterContextMenu = false; + }; + var onInput = function(e) { + if (inComposition) + return; + var data = text.value; + sendText(data); + resetValue(); + }; + + var handleClipboardData = function(e, data, forceIEMime) { + var clipboardData = e.clipboardData || window.clipboardData; + if (!clipboardData || BROKEN_SETDATA) + return; + var mime = USE_IE_MIME_TYPE || forceIEMime ? "Text" : "text/plain"; + try { + if (data) { + return clipboardData.setData(mime, data) !== false; + } else { + return clipboardData.getData(mime); + } + } catch(e) { + if (!forceIEMime) + return handleClipboardData(e, data, true); + } + }; + + var doCopy = function(e, isCut) { + var data = host.getCopyText(); + if (!data) + return event.preventDefault(e); + + if (handleClipboardData(e, data)) { + if (useragent.isIOS) { + cut = isCut; + text.value = "\n aa" + data + "a a\n"; + text.setSelectionRange(4, 4 + data.length); + copied = { + value: data + }; + } + isCut ? host.onCut() : host.onCopy(); + if (!useragent.isIOS) event.preventDefault(e); + } else { + copied = true; + text.value = data; + text.select(); + setTimeout(function(){ + copied = false; + resetValue(); + resetSelection(); + isCut ? host.onCut() : host.onCopy(); + }); + } + }; + + var onCut = function(e) { + doCopy(e, true); + }; + + var onCopy = function(e) { + doCopy(e, false); + }; + + var onPaste = function(e) { + var data = handleClipboardData(e); + if (typeof data == "string") { + if (data) + host.onPaste(data, e); + if (useragent.isIE) + setTimeout(resetSelection); + event.preventDefault(e); + } + else { + text.value = ""; + pasted = true; + } + }; + + event.addCommandKeyListener(text, host.onCommandKey.bind(host)); + + event.addListener(text, "select", onSelect); + + event.addListener(text, "input", onInput); + + event.addListener(text, "cut", onCut); + event.addListener(text, "copy", onCopy); + event.addListener(text, "paste", onPaste); + var onCompositionStart = function(e) { + if (inComposition || !host.onCompositionStart || host.$readOnly) + return; + inComposition = {}; + inComposition.canUndo = host.session.$undoManager; + host.onCompositionStart(); + setTimeout(onCompositionUpdate, 0); + host.on("mousedown", onCompositionEnd); + if (inComposition.canUndo && !host.selection.isEmpty()) { + host.insert(""); + host.session.markUndoGroup(); + host.selection.clearSelection(); + } + host.session.markUndoGroup(); + }; + + var onCompositionUpdate = function() { + if (!inComposition || !host.onCompositionUpdate || host.$readOnly) + return; + var val = text.value.replace(/\x01/g, ""); + if (inComposition.lastValue === val) return; + + host.onCompositionUpdate(val); + if (inComposition.lastValue) + host.undo(); + if (inComposition.canUndo) + inComposition.lastValue = val; + if (inComposition.lastValue) { + var r = host.selection.getRange(); + host.insert(inComposition.lastValue); + host.session.markUndoGroup(); + inComposition.range = host.selection.getRange(); + host.selection.setRange(r); + host.selection.clearSelection(); + } + }; + + var onCompositionEnd = function(e) { + if (!host.onCompositionEnd || host.$readOnly) return; + var c = inComposition; + inComposition = false; + var timer = setTimeout(function() { + timer = null; + var str = text.value.replace(/\x01/g, ""); + if (inComposition) + return; + else if (str == c.lastValue) + resetValue(); + else if (!c.lastValue && str) { + resetValue(); + sendText(str); + } + }); + inputHandler = function compositionInputHandler(str) { + if (timer) + clearTimeout(timer); + str = str.replace(/\x01/g, ""); + if (str == c.lastValue) + return ""; + if (c.lastValue && timer) + host.undo(); + return str; + }; + host.onCompositionEnd(); + host.removeListener("mousedown", onCompositionEnd); + if (e.type == "compositionend" && c.range) { + host.selection.setRange(c.range); + } + var needsOnInput = + (!!useragent.isChrome && useragent.isChrome >= 53) || + (!!useragent.isWebKit && useragent.isWebKit >= 603); + + if (needsOnInput) { + onInput(); + } + }; + + + + var syncComposition = lang.delayedCall(onCompositionUpdate, 50); + + event.addListener(text, "compositionstart", onCompositionStart); + if (useragent.isGecko) { + event.addListener(text, "text", function(){syncComposition.schedule()}); + } else { + event.addListener(text, "keyup", function(){syncComposition.schedule()}); + event.addListener(text, "keydown", function(){syncComposition.schedule()}); + } + event.addListener(text, "compositionend", onCompositionEnd); + + this.getElement = function() { + return text; + }; + + this.setReadOnly = function(readOnly) { + text.readOnly = readOnly; + }; + + this.onContextMenu = function(e) { + afterContextMenu = true; + resetSelection(host.selection.isEmpty()); + host._emit("nativecontextmenu", {target: host, domEvent: e}); + this.moveToMouse(e, true); + }; + + this.moveToMouse = function(e, bringToFront) { + if (!tempStyle) + tempStyle = text.style.cssText; + text.style.cssText = (bringToFront ? "z-index:100000;" : "") + + "height:" + text.style.height + ";" + + (useragent.isIE ? "opacity:0.1;" : ""); + + var rect = host.container.getBoundingClientRect(); + var style = dom.computedStyle(host.container); + var top = rect.top + (parseInt(style.borderTopWidth) || 0); + var left = rect.left + (parseInt(rect.borderLeftWidth) || 0); + var maxTop = rect.bottom - top - text.clientHeight -2; + var move = function(e) { + text.style.left = e.clientX - left - 2 + "px"; + text.style.top = Math.min(e.clientY - top - 2, maxTop) + "px"; + }; + move(e); + + if (e.type != "mousedown") + return; + + if (host.renderer.$keepTextAreaAtCursor) + host.renderer.$keepTextAreaAtCursor = null; + + clearTimeout(closeTimeout); + if (useragent.isWin) + event.capture(host.container, move, onContextMenuClose); + }; + + this.onContextMenuClose = onContextMenuClose; + var closeTimeout; + function onContextMenuClose() { + clearTimeout(closeTimeout); + closeTimeout = setTimeout(function () { + if (tempStyle) { + text.style.cssText = tempStyle; + tempStyle = ''; + } + if (host.renderer.$keepTextAreaAtCursor == null) { + host.renderer.$keepTextAreaAtCursor = true; + host.renderer.$moveTextAreaToCursor(); + } + }, 0); + } + + var onContextMenu = function(e) { + host.textInput.onContextMenu(e); + onContextMenuClose(); + }; + event.addListener(text, "mouseup", onContextMenu); + event.addListener(text, "mousedown", function(e) { + e.preventDefault(); + onContextMenuClose(); + }); + event.addListener(host.renderer.scroller, "contextmenu", onContextMenu); + event.addListener(text, "contextmenu", onContextMenu); + + if (useragent.isIOS) { + var typingResetTimeout = null; + var typing = false; + + parentNode.addEventListener("keydown", function (e) { + if (typingResetTimeout) clearTimeout(typingResetTimeout); + typing = true; + }); + + parentNode.addEventListener("keyup", function (e) { + typingResetTimeout = setTimeout(function () { + typing = false; + }, 100); + }); + var detectArrowKeys = function(e) { + if (document.activeElement !== text) return; + if (typing) return; + + if (cut) { + return setTimeout(function () { + cut = false; + }, 100); + } + var selectionStart = text.selectionStart; + var selectionEnd = text.selectionEnd; + text.setSelectionRange(4, 5); + if (selectionStart == selectionEnd) { + switch (selectionStart) { + case 0: host.onCommandKey(null, 0, KEYS.up); break; + case 1: host.onCommandKey(null, 0, KEYS.home); break; + case 2: host.onCommandKey(null, MODS.option, KEYS.left); break; + case 4: host.onCommandKey(null, 0, KEYS.left); break; + case 5: host.onCommandKey(null, 0, KEYS.right); break; + case 7: host.onCommandKey(null, MODS.option, KEYS.right); break; + case 8: host.onCommandKey(null, 0, KEYS.end); break; + case 9: host.onCommandKey(null, 0, KEYS.down); break; + } + } else { + switch (selectionEnd) { + case 6: host.onCommandKey(null, MODS.shift, KEYS.right); break; + case 7: host.onCommandKey(null, MODS.shift | MODS.option, KEYS.right); break; + case 8: host.onCommandKey(null, MODS.shift, KEYS.end); break; + case 9: host.onCommandKey(null, MODS.shift, KEYS.down); break; + } + switch (selectionStart) { + case 0: host.onCommandKey(null, MODS.shift, KEYS.up); break; + case 1: host.onCommandKey(null, MODS.shift, KEYS.home); break; + case 2: host.onCommandKey(null, MODS.shift | MODS.option, KEYS.left); break; + case 3: host.onCommandKey(null, MODS.shift, KEYS.left); break; + } + } + } + document.addEventListener("selectionchange", detectArrowKeys); + host.on("destroy", function() { + document.removeEventListener("selectionchange", detectArrowKeys); + }) + } +}; + +exports.TextInput = TextInput; +}); + +ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/keyboard/textinput_ios"], function(require, exports, module) { +"use strict"; + +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); +var dom = require("../lib/dom"); +var lang = require("../lib/lang"); +var BROKEN_SETDATA = useragent.isChrome < 18; +var USE_IE_MIME_TYPE = useragent.isIE; + +var TextInputIOS = require("./textinput_ios").TextInput +var TextInput = function(parentNode, host) { + if (useragent.isIOS) + return TextInputIOS.call(this, parentNode, host); + + var text = dom.createElement("textarea"); + text.className = "ace_text-input"; + + text.setAttribute("wrap", "off"); + text.setAttribute("autocorrect", "off"); + text.setAttribute("autocapitalize", "off"); + text.setAttribute("spellcheck", false); + + text.style.opacity = "0"; + parentNode.insertBefore(text, parentNode.firstChild); + + var PLACEHOLDER = "\u2028\u2028"; + + var copied = false; + var pasted = false; + var inComposition = false; + var tempStyle = ''; + var isSelectionEmpty = true; + try { var isFocused = document.activeElement === text; } catch(e) {} + + event.addListener(text, "blur", function(e) { + host.onBlur(e); + isFocused = false; + }); + event.addListener(text, "focus", function(e) { + isFocused = true; + host.onFocus(e); + resetSelection(); + }); + this.focus = function() { + if (tempStyle) return text.focus(); + var top = text.style.top; + text.style.position = "fixed"; + text.style.top = "0px"; + text.focus(); + setTimeout(function() { + text.style.position = ""; + if (text.style.top == "0px") + text.style.top = top; + }, 0); + }; + this.blur = function() { + text.blur(); + }; + this.isFocused = function() { + return isFocused; + }; + var syncSelection = lang.delayedCall(function() { + isFocused && resetSelection(isSelectionEmpty); + }); + var syncValue = lang.delayedCall(function() { + if (!inComposition) { + text.value = PLACEHOLDER; + isFocused && resetSelection(); + } + }); + + function resetSelection(isEmpty) { + if (inComposition) + return; + inComposition = true; + + if (inputHandler) { + selectionStart = 0; + selectionEnd = isEmpty ? 0 : text.value.length - 1; + } else { + var selectionStart = isEmpty ? 2 : 1; + var selectionEnd = 2; + } + try { + text.setSelectionRange(selectionStart, selectionEnd); + } catch(e){} + + inComposition = false; + } + + function resetValue() { + if (inComposition) + return; + text.value = PLACEHOLDER; + if (useragent.isWebKit) + syncValue.schedule(); + } + + useragent.isWebKit || host.addEventListener('changeSelection', function() { + if (host.selection.isEmpty() != isSelectionEmpty) { + isSelectionEmpty = !isSelectionEmpty; + syncSelection.schedule(); + } + }); + + resetValue(); + if (isFocused) + host.onFocus(); + + + var isAllSelected = function(text) { + return text.selectionStart === 0 && text.selectionEnd === text.value.length; + }; + + var onSelect = function(e) { + if (copied) { + copied = false; + } else if (isAllSelected(text)) { + host.selectAll(); + resetSelection(); + } else if (inputHandler) { + resetSelection(host.selection.isEmpty()); + } + }; + + var inputHandler = null; + this.setInputHandler = function(cb) {inputHandler = cb}; + this.getInputHandler = function() {return inputHandler}; + var afterContextMenu = false; + + var sendText = function(data) { + if (inputHandler) { + data = inputHandler(data); + inputHandler = null; + } + if (pasted) { + resetSelection(); + if (data) + host.onPaste(data); + pasted = false; + } else if (data == PLACEHOLDER.charAt(0)) { + if (afterContextMenu) + host.execCommand("del", {source: "ace"}); + else // some versions of android do not fire keydown when pressing backspace + host.execCommand("backspace", {source: "ace"}); + } else { + if (data.substring(0, 2) == PLACEHOLDER) + data = data.substr(2); + else if (data.charAt(0) == PLACEHOLDER.charAt(0)) + data = data.substr(1); + else if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) + data = data.slice(0, -1); + if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) + data = data.slice(0, -1); + + if (data) + host.onTextInput(data); + } + if (afterContextMenu) + afterContextMenu = false; + }; + var onInput = function(e) { + if (inComposition) + return; + var data = text.value; + sendText(data); + resetValue(); + }; + + var handleClipboardData = function(e, data, forceIEMime) { + var clipboardData = e.clipboardData || window.clipboardData; + if (!clipboardData || BROKEN_SETDATA) + return; + var mime = USE_IE_MIME_TYPE || forceIEMime ? "Text" : "text/plain"; + try { + if (data) { + return clipboardData.setData(mime, data) !== false; + } else { + return clipboardData.getData(mime); + } + } catch(e) { + if (!forceIEMime) + return handleClipboardData(e, data, true); + } + }; + + var doCopy = function(e, isCut) { + var data = host.getCopyText(); + if (!data) + return event.preventDefault(e); + + if (handleClipboardData(e, data)) { + isCut ? host.onCut() : host.onCopy(); + event.preventDefault(e); + } else { + copied = true; + text.value = data; + text.select(); + setTimeout(function(){ + copied = false; + resetValue(); + resetSelection(); + isCut ? host.onCut() : host.onCopy(); + }); + } + }; + + var onCut = function(e) { + doCopy(e, true); + }; + + var onCopy = function(e) { + doCopy(e, false); + }; + + var onPaste = function(e) { + var data = handleClipboardData(e); + if (typeof data == "string") { + if (data) + host.onPaste(data, e); + if (useragent.isIE) + setTimeout(resetSelection); + event.preventDefault(e); + } + else { + text.value = ""; + pasted = true; + } + }; + + event.addCommandKeyListener(text, host.onCommandKey.bind(host)); + + event.addListener(text, "select", onSelect); + + event.addListener(text, "input", onInput); + + event.addListener(text, "cut", onCut); + event.addListener(text, "copy", onCopy); + event.addListener(text, "paste", onPaste); + if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)) { + event.addListener(parentNode, "keydown", function(e) { + if ((useragent.isMac && !e.metaKey) || !e.ctrlKey) + return; + + switch (e.keyCode) { + case 67: + onCopy(e); + break; + case 86: + onPaste(e); + break; + case 88: + onCut(e); + break; + } + }); + } + var onCompositionStart = function(e) { + if (inComposition || !host.onCompositionStart || host.$readOnly) + return; + inComposition = {}; + inComposition.canUndo = host.session.$undoManager; + host.onCompositionStart(); + setTimeout(onCompositionUpdate, 0); + host.on("mousedown", onCompositionEnd); + if (inComposition.canUndo && !host.selection.isEmpty()) { + host.insert(""); + host.session.markUndoGroup(); + host.selection.clearSelection(); + } + host.session.markUndoGroup(); + }; + + var onCompositionUpdate = function() { + if (!inComposition || !host.onCompositionUpdate || host.$readOnly) + return; + var val = text.value.replace(/\u2028/g, ""); + if (inComposition.lastValue === val) return; + + host.onCompositionUpdate(val); + if (inComposition.lastValue) + host.undo(); + if (inComposition.canUndo) + inComposition.lastValue = val; + if (inComposition.lastValue) { + var r = host.selection.getRange(); + host.insert(inComposition.lastValue); + host.session.markUndoGroup(); + inComposition.range = host.selection.getRange(); + host.selection.setRange(r); + host.selection.clearSelection(); + } + }; + + var onCompositionEnd = function(e) { + if (!host.onCompositionEnd || host.$readOnly) return; + var c = inComposition; + inComposition = false; + var timer = setTimeout(function() { + timer = null; + var str = text.value.replace(/\u2028/g, ""); + if (inComposition) + return; + else if (str == c.lastValue) + resetValue(); + else if (!c.lastValue && str) { + resetValue(); + sendText(str); + } + }); + inputHandler = function compositionInputHandler(str) { + if (timer) + clearTimeout(timer); + str = str.replace(/\u2028/g, ""); + if (str == c.lastValue) + return ""; + if (c.lastValue && timer) + host.undo(); + return str; + }; + host.onCompositionEnd(); + host.removeListener("mousedown", onCompositionEnd); + if (e.type == "compositionend" && c.range) { + host.selection.setRange(c.range); + } + var needsOnInput = + (!!useragent.isChrome && useragent.isChrome >= 53) || + (!!useragent.isWebKit && useragent.isWebKit >= 603); + + if (needsOnInput) { + onInput(); + } + }; + + + + var syncComposition = lang.delayedCall(onCompositionUpdate, 50); + + event.addListener(text, "compositionstart", onCompositionStart); + if (useragent.isGecko) { + event.addListener(text, "text", function(){syncComposition.schedule()}); + } else { + event.addListener(text, "keyup", function(){syncComposition.schedule()}); + event.addListener(text, "keydown", function(){syncComposition.schedule()}); + } + event.addListener(text, "compositionend", onCompositionEnd); + + this.getElement = function() { + return text; + }; + + this.setReadOnly = function(readOnly) { + text.readOnly = readOnly; + }; + + this.onContextMenu = function(e) { + afterContextMenu = true; + resetSelection(host.selection.isEmpty()); + host._emit("nativecontextmenu", {target: host, domEvent: e}); + this.moveToMouse(e, true); + }; + + this.moveToMouse = function(e, bringToFront) { + if (!tempStyle) + tempStyle = text.style.cssText; + text.style.cssText = (bringToFront ? "z-index:100000;" : "") + + "height:" + text.style.height + ";" + + (useragent.isIE ? "opacity:0.1;" : ""); + + var rect = host.container.getBoundingClientRect(); + var style = dom.computedStyle(host.container); + var top = rect.top + (parseInt(style.borderTopWidth) || 0); + var left = rect.left + (parseInt(rect.borderLeftWidth) || 0); + var maxTop = rect.bottom - top - text.clientHeight -2; + var move = function(e) { + text.style.left = e.clientX - left - 2 + "px"; + text.style.top = Math.min(e.clientY - top - 2, maxTop) + "px"; + }; + move(e); + + if (e.type != "mousedown") + return; + + if (host.renderer.$keepTextAreaAtCursor) + host.renderer.$keepTextAreaAtCursor = null; + + clearTimeout(closeTimeout); + if (useragent.isWin) + event.capture(host.container, move, onContextMenuClose); + }; + + this.onContextMenuClose = onContextMenuClose; + var closeTimeout; + function onContextMenuClose() { + clearTimeout(closeTimeout); + closeTimeout = setTimeout(function () { + if (tempStyle) { + text.style.cssText = tempStyle; + tempStyle = ''; + } + if (host.renderer.$keepTextAreaAtCursor == null) { + host.renderer.$keepTextAreaAtCursor = true; + host.renderer.$moveTextAreaToCursor(); + } + }, 0); + } + + var onContextMenu = function(e) { + host.textInput.onContextMenu(e); + onContextMenuClose(); + }; + event.addListener(text, "mouseup", onContextMenu); + event.addListener(text, "mousedown", function(e) { + e.preventDefault(); + onContextMenuClose(); + }); + event.addListener(host.renderer.scroller, "contextmenu", onContextMenu); + event.addListener(text, "contextmenu", onContextMenu); +}; + +exports.TextInput = TextInput; +}); + +ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"], function(require, exports, module) { +"use strict"; + +var dom = require("../lib/dom"); +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); + +var DRAG_OFFSET = 0; // pixels + +function DefaultHandlers(mouseHandler) { + mouseHandler.$clickSelection = null; + + var editor = mouseHandler.editor; + editor.setDefaultHandler("mousedown", this.onMouseDown.bind(mouseHandler)); + editor.setDefaultHandler("dblclick", this.onDoubleClick.bind(mouseHandler)); + editor.setDefaultHandler("tripleclick", this.onTripleClick.bind(mouseHandler)); + editor.setDefaultHandler("quadclick", this.onQuadClick.bind(mouseHandler)); + editor.setDefaultHandler("mousewheel", this.onMouseWheel.bind(mouseHandler)); + editor.setDefaultHandler("touchmove", this.onTouchMove.bind(mouseHandler)); + + var exports = ["select", "startSelect", "selectEnd", "selectAllEnd", "selectByWordsEnd", + "selectByLinesEnd", "dragWait", "dragWaitEnd", "focusWait"]; + + exports.forEach(function(x) { + mouseHandler[x] = this[x]; + }, this); + + mouseHandler.selectByLines = this.extendSelectionBy.bind(mouseHandler, "getLineRange"); + mouseHandler.selectByWords = this.extendSelectionBy.bind(mouseHandler, "getWordRange"); +} + +(function() { + + this.onMouseDown = function(ev) { + var inSelection = ev.inSelection(); + var pos = ev.getDocumentPosition(); + this.mousedownEvent = ev; + var editor = this.editor; + + var button = ev.getButton(); + if (button !== 0) { + var selectionRange = editor.getSelectionRange(); + var selectionEmpty = selectionRange.isEmpty(); + editor.$blockScrolling++; + if (selectionEmpty || button == 1) + editor.selection.moveToPosition(pos); + editor.$blockScrolling--; + if (button == 2) { + editor.textInput.onContextMenu(ev.domEvent); + if (!useragent.isMozilla) + ev.preventDefault(); + } + return; + } + + this.mousedownEvent.time = Date.now(); + if (inSelection && !editor.isFocused()) { + editor.focus(); + if (this.$focusTimout && !this.$clickSelection && !editor.inMultiSelectMode) { + this.setState("focusWait"); + this.captureMouse(ev); + return; + } + } + + this.captureMouse(ev); + this.startSelect(pos, ev.domEvent._clicks > 1); + return ev.preventDefault(); + }; + + this.startSelect = function(pos, waitForClickSelection) { + pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y); + var editor = this.editor; + editor.$blockScrolling++; + if (this.mousedownEvent.getShiftKey()) + editor.selection.selectToPosition(pos); + else if (!waitForClickSelection) + editor.selection.moveToPosition(pos); + if (!waitForClickSelection) + this.select(); + if (editor.renderer.scroller.setCapture) { + editor.renderer.scroller.setCapture(); + } + editor.setStyle("ace_selecting"); + this.setState("select"); + editor.$blockScrolling--; + }; + + this.select = function() { + var anchor, editor = this.editor; + var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y); + editor.$blockScrolling++; + if (this.$clickSelection) { + var cmp = this.$clickSelection.comparePoint(cursor); + + if (cmp == -1) { + anchor = this.$clickSelection.end; + } else if (cmp == 1) { + anchor = this.$clickSelection.start; + } else { + var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); + cursor = orientedRange.cursor; + anchor = orientedRange.anchor; + } + editor.selection.setSelectionAnchor(anchor.row, anchor.column); + } + editor.selection.selectToPosition(cursor); + editor.$blockScrolling--; + editor.renderer.scrollCursorIntoView(); + }; + + this.extendSelectionBy = function(unitName) { + var anchor, editor = this.editor; + var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y); + var range = editor.selection[unitName](cursor.row, cursor.column); + editor.$blockScrolling++; + if (this.$clickSelection) { + var cmpStart = this.$clickSelection.comparePoint(range.start); + var cmpEnd = this.$clickSelection.comparePoint(range.end); + + if (cmpStart == -1 && cmpEnd <= 0) { + anchor = this.$clickSelection.end; + if (range.end.row != cursor.row || range.end.column != cursor.column) + cursor = range.start; + } else if (cmpEnd == 1 && cmpStart >= 0) { + anchor = this.$clickSelection.start; + if (range.start.row != cursor.row || range.start.column != cursor.column) + cursor = range.end; + } else if (cmpStart == -1 && cmpEnd == 1) { + cursor = range.end; + anchor = range.start; + } else { + var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); + cursor = orientedRange.cursor; + anchor = orientedRange.anchor; + } + editor.selection.setSelectionAnchor(anchor.row, anchor.column); + } + editor.selection.selectToPosition(cursor); + editor.$blockScrolling--; + editor.renderer.scrollCursorIntoView(); + }; + + this.selectEnd = + this.selectAllEnd = + this.selectByWordsEnd = + this.selectByLinesEnd = function() { + this.$clickSelection = null; + this.editor.unsetStyle("ace_selecting"); + if (this.editor.renderer.scroller.releaseCapture) { + this.editor.renderer.scroller.releaseCapture(); + } + }; + + this.focusWait = function() { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + var time = Date.now(); + + if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimout) + this.startSelect(this.mousedownEvent.getDocumentPosition()); + }; + + this.onDoubleClick = function(ev) { + var pos = ev.getDocumentPosition(); + var editor = this.editor; + var session = editor.session; + + var range = session.getBracketRange(pos); + if (range) { + if (range.isEmpty()) { + range.start.column--; + range.end.column++; + } + this.setState("select"); + } else { + range = editor.selection.getWordRange(pos.row, pos.column); + this.setState("selectByWords"); + } + this.$clickSelection = range; + this.select(); + }; + + this.onTripleClick = function(ev) { + var pos = ev.getDocumentPosition(); + var editor = this.editor; + + this.setState("selectByLines"); + var range = editor.getSelectionRange(); + if (range.isMultiLine() && range.contains(pos.row, pos.column)) { + this.$clickSelection = editor.selection.getLineRange(range.start.row); + this.$clickSelection.end = editor.selection.getLineRange(range.end.row).end; + } else { + this.$clickSelection = editor.selection.getLineRange(pos.row); + } + this.select(); + }; + + this.onQuadClick = function(ev) { + var editor = this.editor; + + editor.selectAll(); + this.$clickSelection = editor.getSelectionRange(); + this.setState("selectAll"); + }; + + this.onMouseWheel = function(ev) { + if (ev.getAccelKey()) + return; + if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) { + ev.wheelX = ev.wheelY; + ev.wheelY = 0; + } + + var t = ev.domEvent.timeStamp; + var dt = t - (this.$lastScrollTime||0); + + var editor = this.editor; + var isScrolable = editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); + if (isScrolable || dt < 200) { + this.$lastScrollTime = t; + editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); + return ev.stop(); + } + }; + + this.onTouchMove = function (ev) { + var t = ev.domEvent.timeStamp; + var dt = t - (this.$lastScrollTime || 0); + + var editor = this.editor; + var isScrolable = editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); + if (isScrolable || dt < 200) { + this.$lastScrollTime = t; + editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); + return ev.stop(); + } + }; + +}).call(DefaultHandlers.prototype); + +exports.DefaultHandlers = DefaultHandlers; + +function calcDistance(ax, ay, bx, by) { + return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); +} + +function calcRangeOrientation(range, cursor) { + if (range.start.row == range.end.row) + var cmp = 2 * cursor.column - range.start.column - range.end.column; + else if (range.start.row == range.end.row - 1 && !range.start.column && !range.end.column) + var cmp = cursor.column - 4; + else + var cmp = 2 * cursor.row - range.start.row - range.end.row; + + if (cmp < 0) + return {cursor: range.start, anchor: range.end}; + else + return {cursor: range.end, anchor: range.start}; +} + +}); + +ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +function Tooltip (parentNode) { + this.isOpen = false; + this.$element = null; + this.$parentNode = parentNode; +} + +(function() { + this.$init = function() { + this.$element = dom.createElement("div"); + this.$element.className = "ace_tooltip"; + this.$element.style.display = "none"; + this.$parentNode.appendChild(this.$element); + return this.$element; + }; + this.getElement = function() { + return this.$element || this.$init(); + }; + this.setText = function(text) { + dom.setInnerText(this.getElement(), text); + }; + this.setHtml = function(html) { + this.getElement().innerHTML = html; + }; + this.setPosition = function(x, y) { + this.getElement().style.left = x + "px"; + this.getElement().style.top = y + "px"; + }; + this.setClassName = function(className) { + dom.addCssClass(this.getElement(), className); + }; + this.show = function(text, x, y) { + if (text != null) + this.setText(text); + if (x != null && y != null) + this.setPosition(x, y); + if (!this.isOpen) { + this.getElement().style.display = "block"; + this.isOpen = true; + } + }; + + this.hide = function() { + if (this.isOpen) { + this.getElement().style.display = "none"; + this.isOpen = false; + } + }; + this.getHeight = function() { + return this.getElement().offsetHeight; + }; + this.getWidth = function() { + return this.getElement().offsetWidth; + }; + + this.destroy = function() { + this.isOpen = false; + if (this.$element && this.$element.parentNode) { + this.$element.parentNode.removeChild(this.$element); + } + }; + +}).call(Tooltip.prototype); + +exports.Tooltip = Tooltip; +}); + +ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"], function(require, exports, module) { +"use strict"; +var dom = require("../lib/dom"); +var oop = require("../lib/oop"); +var event = require("../lib/event"); +var Tooltip = require("../tooltip").Tooltip; + +function GutterHandler(mouseHandler) { + var editor = mouseHandler.editor; + var gutter = editor.renderer.$gutterLayer; + var tooltip = new GutterTooltip(editor.container); + + mouseHandler.editor.setDefaultHandler("guttermousedown", function(e) { + if (!editor.isFocused() || e.getButton() != 0) + return; + var gutterRegion = gutter.getRegion(e); + + if (gutterRegion == "foldWidgets") + return; + + var row = e.getDocumentPosition().row; + var selection = editor.session.selection; + + if (e.getShiftKey()) + selection.selectTo(row, 0); + else { + if (e.domEvent.detail == 2) { + editor.selectAll(); + return e.preventDefault(); + } + mouseHandler.$clickSelection = editor.selection.getLineRange(row); + } + mouseHandler.setState("selectByLines"); + mouseHandler.captureMouse(e); + return e.preventDefault(); + }); + + + var tooltipTimeout, mouseEvent, tooltipAnnotation; + + function showTooltip() { + var row = mouseEvent.getDocumentPosition().row; + var annotation = gutter.$annotations[row]; + if (!annotation) + return hideTooltip(); + + var maxRow = editor.session.getLength(); + if (row == maxRow) { + var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row; + var pos = mouseEvent.$pos; + if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column)) + return hideTooltip(); + } + + if (tooltipAnnotation == annotation) + return; + tooltipAnnotation = annotation.text.join("
        "); + + tooltip.setHtml(tooltipAnnotation); + tooltip.show(); + editor._signal("showGutterTooltip", tooltip); + editor.on("mousewheel", hideTooltip); + + if (mouseHandler.$tooltipFollowsMouse) { + moveTooltip(mouseEvent); + } else { + var gutterElement = mouseEvent.domEvent.target; + var rect = gutterElement.getBoundingClientRect(); + var style = tooltip.getElement().style; + style.left = rect.right + "px"; + style.top = rect.bottom + "px"; + } + } + + function hideTooltip() { + if (tooltipTimeout) + tooltipTimeout = clearTimeout(tooltipTimeout); + if (tooltipAnnotation) { + tooltip.hide(); + tooltipAnnotation = null; + editor._signal("hideGutterTooltip", tooltip); + editor.removeEventListener("mousewheel", hideTooltip); + } + } + + function moveTooltip(e) { + tooltip.setPosition(e.x, e.y); + } + + mouseHandler.editor.setDefaultHandler("guttermousemove", function(e) { + var target = e.domEvent.target || e.domEvent.srcElement; + if (dom.hasCssClass(target, "ace_fold-widget")) + return hideTooltip(); + + if (tooltipAnnotation && mouseHandler.$tooltipFollowsMouse) + moveTooltip(e); + + mouseEvent = e; + if (tooltipTimeout) + return; + tooltipTimeout = setTimeout(function() { + tooltipTimeout = null; + if (mouseEvent && !mouseHandler.isMousePressed) + showTooltip(); + else + hideTooltip(); + }, 50); + }); + + event.addListener(editor.renderer.$gutter, "mouseout", function(e) { + mouseEvent = null; + if (!tooltipAnnotation || tooltipTimeout) + return; + + tooltipTimeout = setTimeout(function() { + tooltipTimeout = null; + hideTooltip(); + }, 50); + }); + + editor.on("changeSession", hideTooltip); +} + +function GutterTooltip(parentNode) { + Tooltip.call(this, parentNode); +} + +oop.inherits(GutterTooltip, Tooltip); + +(function(){ + this.setPosition = function(x, y) { + var windowWidth = window.innerWidth || document.documentElement.clientWidth; + var windowHeight = window.innerHeight || document.documentElement.clientHeight; + var width = this.getWidth(); + var height = this.getHeight(); + x += 15; + y += 15; + if (x + width > windowWidth) { + x -= (x + width) - windowWidth; + } + if (y + height > windowHeight) { + y -= 20 + height; + } + Tooltip.prototype.setPosition.call(this, x, y); + }; + +}).call(GutterTooltip.prototype); + + + +exports.GutterHandler = GutterHandler; + +}); + +ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"], function(require, exports, module) { +"use strict"; + +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); +var MouseEvent = exports.MouseEvent = function(domEvent, editor) { + this.domEvent = domEvent; + this.editor = editor; + + this.x = this.clientX = domEvent.clientX; + this.y = this.clientY = domEvent.clientY; + + this.$pos = null; + this.$inSelection = null; + + this.propagationStopped = false; + this.defaultPrevented = false; +}; + +(function() { + + this.stopPropagation = function() { + event.stopPropagation(this.domEvent); + this.propagationStopped = true; + }; + + this.preventDefault = function() { + event.preventDefault(this.domEvent); + this.defaultPrevented = true; + }; + + this.stop = function() { + this.stopPropagation(); + this.preventDefault(); + }; + this.getDocumentPosition = function() { + if (this.$pos) + return this.$pos; + + this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY); + return this.$pos; + }; + this.inSelection = function() { + if (this.$inSelection !== null) + return this.$inSelection; + + var editor = this.editor; + + + var selectionRange = editor.getSelectionRange(); + if (selectionRange.isEmpty()) + this.$inSelection = false; + else { + var pos = this.getDocumentPosition(); + this.$inSelection = selectionRange.contains(pos.row, pos.column); + } + + return this.$inSelection; + }; + this.getButton = function() { + return event.getButton(this.domEvent); + }; + this.getShiftKey = function() { + return this.domEvent.shiftKey; + }; + + this.getAccelKey = useragent.isMac + ? function() { return this.domEvent.metaKey; } + : function() { return this.domEvent.ctrlKey; }; + +}).call(MouseEvent.prototype); + +}); + +ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"], function(require, exports, module) { +"use strict"; + +var dom = require("../lib/dom"); +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); + +var AUTOSCROLL_DELAY = 200; +var SCROLL_CURSOR_DELAY = 200; +var SCROLL_CURSOR_HYSTERESIS = 5; + +function DragdropHandler(mouseHandler) { + + var editor = mouseHandler.editor; + + var blankImage = dom.createElement("img"); + blankImage.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (useragent.isOpera) + blankImage.style.cssText = "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"; + + var exports = ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"]; + + exports.forEach(function(x) { + mouseHandler[x] = this[x]; + }, this); + editor.addEventListener("mousedown", this.onMouseDown.bind(mouseHandler)); + + + var mouseTarget = editor.container; + var dragSelectionMarker, x, y; + var timerId, range; + var dragCursor, counter = 0; + var dragOperation; + var isInternal; + var autoScrollStartTime; + var cursorMovedTime; + var cursorPointOnCaretMoved; + + this.onDragStart = function(e) { + if (this.cancelDrag || !mouseTarget.draggable) { + var self = this; + setTimeout(function(){ + self.startSelect(); + self.captureMouse(e); + }, 0); + return e.preventDefault(); + } + range = editor.getSelectionRange(); + + var dataTransfer = e.dataTransfer; + dataTransfer.effectAllowed = editor.getReadOnly() ? "copy" : "copyMove"; + if (useragent.isOpera) { + editor.container.appendChild(blankImage); + blankImage.scrollTop = 0; + } + dataTransfer.setDragImage && dataTransfer.setDragImage(blankImage, 0, 0); + if (useragent.isOpera) { + editor.container.removeChild(blankImage); + } + dataTransfer.clearData(); + dataTransfer.setData("Text", editor.session.getTextRange()); + + isInternal = true; + this.setState("drag"); + }; + + this.onDragEnd = function(e) { + mouseTarget.draggable = false; + isInternal = false; + this.setState(null); + if (!editor.getReadOnly()) { + var dropEffect = e.dataTransfer.dropEffect; + if (!dragOperation && dropEffect == "move") + editor.session.remove(editor.getSelectionRange()); + editor.renderer.$cursorLayer.setBlinking(true); + } + this.editor.unsetStyle("ace_dragging"); + this.editor.renderer.setCursorStyle(""); + }; + + this.onDragEnter = function(e) { + if (editor.getReadOnly() || !canAccept(e.dataTransfer)) + return; + x = e.clientX; + y = e.clientY; + if (!dragSelectionMarker) + addDragMarker(); + counter++; + e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); + return event.preventDefault(e); + }; + + this.onDragOver = function(e) { + if (editor.getReadOnly() || !canAccept(e.dataTransfer)) + return; + x = e.clientX; + y = e.clientY; + if (!dragSelectionMarker) { + addDragMarker(); + counter++; + } + if (onMouseMoveTimer !== null) + onMouseMoveTimer = null; + + e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); + return event.preventDefault(e); + }; + + this.onDragLeave = function(e) { + counter--; + if (counter <= 0 && dragSelectionMarker) { + clearDragMarker(); + dragOperation = null; + return event.preventDefault(e); + } + }; + + this.onDrop = function(e) { + if (!dragCursor) + return; + var dataTransfer = e.dataTransfer; + if (isInternal) { + switch (dragOperation) { + case "move": + if (range.contains(dragCursor.row, dragCursor.column)) { + range = { + start: dragCursor, + end: dragCursor + }; + } else { + range = editor.moveText(range, dragCursor); + } + break; + case "copy": + range = editor.moveText(range, dragCursor, true); + break; + } + } else { + var dropData = dataTransfer.getData('Text'); + range = { + start: dragCursor, + end: editor.session.insert(dragCursor, dropData) + }; + editor.focus(); + dragOperation = null; + } + clearDragMarker(); + return event.preventDefault(e); + }; + + event.addListener(mouseTarget, "dragstart", this.onDragStart.bind(mouseHandler)); + event.addListener(mouseTarget, "dragend", this.onDragEnd.bind(mouseHandler)); + event.addListener(mouseTarget, "dragenter", this.onDragEnter.bind(mouseHandler)); + event.addListener(mouseTarget, "dragover", this.onDragOver.bind(mouseHandler)); + event.addListener(mouseTarget, "dragleave", this.onDragLeave.bind(mouseHandler)); + event.addListener(mouseTarget, "drop", this.onDrop.bind(mouseHandler)); + + function scrollCursorIntoView(cursor, prevCursor) { + var now = Date.now(); + var vMovement = !prevCursor || cursor.row != prevCursor.row; + var hMovement = !prevCursor || cursor.column != prevCursor.column; + if (!cursorMovedTime || vMovement || hMovement) { + editor.$blockScrolling += 1; + editor.moveCursorToPosition(cursor); + editor.$blockScrolling -= 1; + cursorMovedTime = now; + cursorPointOnCaretMoved = {x: x, y: y}; + } else { + var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y); + if (distance > SCROLL_CURSOR_HYSTERESIS) { + cursorMovedTime = null; + } else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) { + editor.renderer.scrollCursorIntoView(); + cursorMovedTime = null; + } + } + } + + function autoScroll(cursor, prevCursor) { + var now = Date.now(); + var lineHeight = editor.renderer.layerConfig.lineHeight; + var characterWidth = editor.renderer.layerConfig.characterWidth; + var editorRect = editor.renderer.scroller.getBoundingClientRect(); + var offsets = { + x: { + left: x - editorRect.left, + right: editorRect.right - x + }, + y: { + top: y - editorRect.top, + bottom: editorRect.bottom - y + } + }; + var nearestXOffset = Math.min(offsets.x.left, offsets.x.right); + var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom); + var scrollCursor = {row: cursor.row, column: cursor.column}; + if (nearestXOffset / characterWidth <= 2) { + scrollCursor.column += (offsets.x.left < offsets.x.right ? -3 : +2); + } + if (nearestYOffset / lineHeight <= 1) { + scrollCursor.row += (offsets.y.top < offsets.y.bottom ? -1 : +1); + } + var vScroll = cursor.row != scrollCursor.row; + var hScroll = cursor.column != scrollCursor.column; + var vMovement = !prevCursor || cursor.row != prevCursor.row; + if (vScroll || (hScroll && !vMovement)) { + if (!autoScrollStartTime) + autoScrollStartTime = now; + else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY) + editor.renderer.scrollCursorIntoView(scrollCursor); + } else { + autoScrollStartTime = null; + } + } + + function onDragInterval() { + var prevCursor = dragCursor; + dragCursor = editor.renderer.screenToTextCoordinates(x, y); + scrollCursorIntoView(dragCursor, prevCursor); + autoScroll(dragCursor, prevCursor); + } + + function addDragMarker() { + range = editor.selection.toOrientedRange(); + dragSelectionMarker = editor.session.addMarker(range, "ace_selection", editor.getSelectionStyle()); + editor.clearSelection(); + if (editor.isFocused()) + editor.renderer.$cursorLayer.setBlinking(false); + clearInterval(timerId); + onDragInterval(); + timerId = setInterval(onDragInterval, 20); + counter = 0; + event.addListener(document, "mousemove", onMouseMove); + } + + function clearDragMarker() { + clearInterval(timerId); + editor.session.removeMarker(dragSelectionMarker); + dragSelectionMarker = null; + editor.$blockScrolling += 1; + editor.selection.fromOrientedRange(range); + editor.$blockScrolling -= 1; + if (editor.isFocused() && !isInternal) + editor.renderer.$cursorLayer.setBlinking(!editor.getReadOnly()); + range = null; + dragCursor = null; + counter = 0; + autoScrollStartTime = null; + cursorMovedTime = null; + event.removeListener(document, "mousemove", onMouseMove); + } + var onMouseMoveTimer = null; + function onMouseMove() { + if (onMouseMoveTimer == null) { + onMouseMoveTimer = setTimeout(function() { + if (onMouseMoveTimer != null && dragSelectionMarker) + clearDragMarker(); + }, 20); + } + } + + function canAccept(dataTransfer) { + var types = dataTransfer.types; + return !types || Array.prototype.some.call(types, function(type) { + return type == 'text/plain' || type == 'Text'; + }); + } + + function getDropEffect(e) { + var copyAllowed = ['copy', 'copymove', 'all', 'uninitialized']; + var moveAllowed = ['move', 'copymove', 'linkmove', 'all', 'uninitialized']; + + var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey; + var effectAllowed = "uninitialized"; + try { + effectAllowed = e.dataTransfer.effectAllowed.toLowerCase(); + } catch (e) {} + var dropEffect = "none"; + + if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "copy"; + else if (moveAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "move"; + else if (copyAllowed.indexOf(effectAllowed) >= 0) + dropEffect = "copy"; + + return dropEffect; + } +} + +(function() { + + this.dragWait = function() { + var interval = Date.now() - this.mousedownEvent.time; + if (interval > this.editor.getDragDelay()) + this.startDrag(); + }; + + this.dragWaitEnd = function() { + var target = this.editor.container; + target.draggable = false; + this.startSelect(this.mousedownEvent.getDocumentPosition()); + this.selectEnd(); + }; + + this.dragReadyEnd = function(e) { + this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()); + this.editor.unsetStyle("ace_dragging"); + this.editor.renderer.setCursorStyle(""); + this.dragWaitEnd(); + }; + + this.startDrag = function(){ + this.cancelDrag = false; + var editor = this.editor; + var target = editor.container; + target.draggable = true; + editor.renderer.$cursorLayer.setBlinking(false); + editor.setStyle("ace_dragging"); + var cursorStyle = useragent.isWin ? "default" : "move"; + editor.renderer.setCursorStyle(cursorStyle); + this.setState("dragReady"); + }; + + this.onMouseDrag = function(e) { + var target = this.editor.container; + if (useragent.isIE && this.state == "dragReady") { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + if (distance > 3) + target.dragDrop(); + } + if (this.state === "dragWait") { + var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); + if (distance > 0) { + target.draggable = false; + this.startSelect(this.mousedownEvent.getDocumentPosition()); + } + } + }; + + this.onMouseDown = function(e) { + if (!this.$dragEnabled) + return; + this.mousedownEvent = e; + var editor = this.editor; + + var inSelection = e.inSelection(); + var button = e.getButton(); + var clickCount = e.domEvent.detail || 1; + if (clickCount === 1 && button === 0 && inSelection) { + if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey())) + return; + this.mousedownEvent.time = Date.now(); + var eventTarget = e.domEvent.target || e.domEvent.srcElement; + if ("unselectable" in eventTarget) + eventTarget.unselectable = "on"; + if (editor.getDragDelay()) { + if (useragent.isWebKit) { + this.cancelDrag = true; + var mouseTarget = editor.container; + mouseTarget.draggable = true; + } + this.setState("dragWait"); + } else { + this.startDrag(); + } + this.captureMouse(e, this.onMouseDrag.bind(this)); + e.defaultPrevented = true; + } + }; + +}).call(DragdropHandler.prototype); + + +function calcDistance(ax, ay, bx, by) { + return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); +} + +exports.DragdropHandler = DragdropHandler; + +}); + +ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +"use strict"; +var dom = require("./dom"); + +exports.get = function (url, callback) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + callback(xhr.responseText); + } + }; + xhr.send(null); +}; + +exports.loadScript = function(path, callback) { + var head = dom.getDocumentHead(); + var s = document.createElement('script'); + + s.src = path; + head.appendChild(s); + + s.onload = s.onreadystatechange = function(_, isAbort) { + if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") { + s = s.onload = s.onreadystatechange = null; + if (!isAbort) + callback(); + } + }; +}; +exports.qualifyURL = function(url) { + var a = document.createElement('a'); + a.href = url; + return a.href; +} + +}); + +ace.define("ace/lib/event_emitter",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var EventEmitter = {}; +var stopPropagation = function() { this.propagationStopped = true; }; +var preventDefault = function() { this.defaultPrevented = true; }; + +EventEmitter._emit = +EventEmitter._dispatchEvent = function(eventName, e) { + this._eventRegistry || (this._eventRegistry = {}); + this._defaultHandlers || (this._defaultHandlers = {}); + + var listeners = this._eventRegistry[eventName] || []; + var defaultHandler = this._defaultHandlers[eventName]; + if (!listeners.length && !defaultHandler) + return; + + if (typeof e != "object" || !e) + e = {}; + + if (!e.type) + e.type = eventName; + if (!e.stopPropagation) + e.stopPropagation = stopPropagation; + if (!e.preventDefault) + e.preventDefault = preventDefault; + + listeners = listeners.slice(); + for (var i=0; i 1) + base = parts[parts.length - 2]; + var path = options[component + "Path"]; + if (path == null) { + path = options.basePath; + } else if (sep == "/") { + component = sep = ""; + } + if (path && path.slice(-1) != "/") + path += "/"; + return path + component + sep + base + this.get("suffix"); +}; + +exports.setModuleUrl = function(name, subst) { + return options.$moduleUrls[name] = subst; +}; + +exports.$loading = {}; +exports.loadModule = function(moduleName, onLoad) { + var module, moduleType; + if (Array.isArray(moduleName)) { + moduleType = moduleName[0]; + moduleName = moduleName[1]; + } + + try { + module = require(moduleName); + } catch (e) {} + if (module && !exports.$loading[moduleName]) + return onLoad && onLoad(module); + + if (!exports.$loading[moduleName]) + exports.$loading[moduleName] = []; + + exports.$loading[moduleName].push(onLoad); + + if (exports.$loading[moduleName].length > 1) + return; + + var afterLoad = function() { + require([moduleName], function(module) { + exports._emit("load.module", {name: moduleName, module: module}); + var listeners = exports.$loading[moduleName]; + exports.$loading[moduleName] = null; + listeners.forEach(function(onLoad) { + onLoad && onLoad(module); + }); + }); + }; + + if (!exports.get("packaged")) + return afterLoad(); + net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); +}; +init(true);function init(packaged) { + + if (!global || !global.document) + return; + + options.packaged = packaged || require.packaged || module.packaged || (global.define && define.packaged); + + var scriptOptions = {}; + var scriptUrl = ""; + var currentScript = (document.currentScript || document._currentScript ); // native or polyfill + var currentDocument = currentScript && currentScript.ownerDocument || document; + + var scripts = currentDocument.getElementsByTagName("script"); + for (var i=0; i [" + this.end.row + "/" + this.end.column + "]"); + }; + + this.contains = function(row, column) { + return this.compare(row, column) == 0; + }; + this.compareRange = function(range) { + var cmp, + end = range.end, + start = range.start; + + cmp = this.compare(end.row, end.column); + if (cmp == 1) { + cmp = this.compare(start.row, start.column); + if (cmp == 1) { + return 2; + } else if (cmp == 0) { + return 1; + } else { + return 0; + } + } else if (cmp == -1) { + return -2; + } else { + cmp = this.compare(start.row, start.column); + if (cmp == -1) { + return -1; + } else if (cmp == 1) { + return 42; + } else { + return 0; + } + } + }; + this.comparePoint = function(p) { + return this.compare(p.row, p.column); + }; + this.containsRange = function(range) { + return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; + }; + this.intersects = function(range) { + var cmp = this.compareRange(range); + return (cmp == -1 || cmp == 0 || cmp == 1); + }; + this.isEnd = function(row, column) { + return this.end.row == row && this.end.column == column; + }; + this.isStart = function(row, column) { + return this.start.row == row && this.start.column == column; + }; + this.setStart = function(row, column) { + if (typeof row == "object") { + this.start.column = row.column; + this.start.row = row.row; + } else { + this.start.row = row; + this.start.column = column; + } + }; + this.setEnd = function(row, column) { + if (typeof row == "object") { + this.end.column = row.column; + this.end.row = row.row; + } else { + this.end.row = row; + this.end.column = column; + } + }; + this.inside = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column) || this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideStart = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideEnd = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.compare = function(row, column) { + if (!this.isMultiLine()) { + if (row === this.start.row) { + return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); + } + } + + if (row < this.start.row) + return -1; + + if (row > this.end.row) + return 1; + + if (this.start.row === row) + return column >= this.start.column ? 0 : -1; + + if (this.end.row === row) + return column <= this.end.column ? 0 : 1; + + return 0; + }; + this.compareStart = function(row, column) { + if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.compareEnd = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else { + return this.compare(row, column); + } + }; + this.compareInside = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.clipRows = function(firstRow, lastRow) { + if (this.end.row > lastRow) + var end = {row: lastRow + 1, column: 0}; + else if (this.end.row < firstRow) + var end = {row: firstRow, column: 0}; + + if (this.start.row > lastRow) + var start = {row: lastRow + 1, column: 0}; + else if (this.start.row < firstRow) + var start = {row: firstRow, column: 0}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + this.extend = function(row, column) { + var cmp = this.compare(row, column); + + if (cmp == 0) + return this; + else if (cmp == -1) + var start = {row: row, column: column}; + else + var end = {row: row, column: column}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + + this.isEmpty = function() { + return (this.start.row === this.end.row && this.start.column === this.end.column); + }; + this.isMultiLine = function() { + return (this.start.row !== this.end.row); + }; + this.clone = function() { + return Range.fromPoints(this.start, this.end); + }; + this.collapseRows = function() { + if (this.end.column == 0) + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) + else + return new Range(this.start.row, 0, this.end.row, 0) + }; + this.toScreenRange = function(session) { + var screenPosStart = session.documentToScreenPosition(this.start); + var screenPosEnd = session.documentToScreenPosition(this.end); + + return new Range( + screenPosStart.row, screenPosStart.column, + screenPosEnd.row, screenPosEnd.column + ); + }; + this.moveBy = function(row, column) { + this.start.row += row; + this.start.column += column; + this.end.row += row; + this.end.column += column; + }; + +}).call(Range.prototype); +Range.fromPoints = function(start, end) { + return new Range(start.row, start.column, end.row, end.column); +}; +Range.comparePoints = comparePoints; + +Range.comparePoints = function(p1, p2) { + return p1.row - p2.row || p1.column - p2.column; +}; + + +exports.Range = Range; +}); + +ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var lang = require("./lib/lang"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var Range = require("./range").Range; +var Selection = function(session) { + this.session = session; + this.doc = session.getDocument(); + + this.clearSelection(); + this.lead = this.selectionLead = this.doc.createAnchor(0, 0); + this.anchor = this.selectionAnchor = this.doc.createAnchor(0, 0); + + var self = this; + this.lead.on("change", function(e) { + self._emit("changeCursor"); + if (!self.$isEmpty) + self._emit("changeSelection"); + if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column) + self.$desiredColumn = null; + }); + + this.selectionAnchor.on("change", function() { + if (!self.$isEmpty) + self._emit("changeSelection"); + }); +}; + +(function() { + + oop.implement(this, EventEmitter); + this.isEmpty = function() { + return (this.$isEmpty || ( + this.anchor.row == this.lead.row && + this.anchor.column == this.lead.column + )); + }; + this.isMultiLine = function() { + if (this.isEmpty()) { + return false; + } + + return this.getRange().isMultiLine(); + }; + this.getCursor = function() { + return this.lead.getPosition(); + }; + this.setSelectionAnchor = function(row, column) { + this.anchor.setPosition(row, column); + + if (this.$isEmpty) { + this.$isEmpty = false; + this._emit("changeSelection"); + } + }; + this.getSelectionAnchor = function() { + if (this.$isEmpty) + return this.getSelectionLead(); + else + return this.anchor.getPosition(); + }; + this.getSelectionLead = function() { + return this.lead.getPosition(); + }; + this.shiftSelection = function(columns) { + if (this.$isEmpty) { + this.moveCursorTo(this.lead.row, this.lead.column + columns); + return; + } + + var anchor = this.getSelectionAnchor(); + var lead = this.getSelectionLead(); + + var isBackwards = this.isBackwards(); + + if (!isBackwards || anchor.column !== 0) + this.setSelectionAnchor(anchor.row, anchor.column + columns); + + if (isBackwards || lead.column !== 0) { + this.$moveSelection(function() { + this.moveCursorTo(lead.row, lead.column + columns); + }); + } + }; + this.isBackwards = function() { + var anchor = this.anchor; + var lead = this.lead; + return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column)); + }; + this.getRange = function() { + var anchor = this.anchor; + var lead = this.lead; + + if (this.isEmpty()) + return Range.fromPoints(lead, lead); + + if (this.isBackwards()) { + return Range.fromPoints(lead, anchor); + } + else { + return Range.fromPoints(anchor, lead); + } + }; + this.clearSelection = function() { + if (!this.$isEmpty) { + this.$isEmpty = true; + this._emit("changeSelection"); + } + }; + this.selectAll = function() { + var lastRow = this.doc.getLength() - 1; + this.setSelectionAnchor(0, 0); + this.moveCursorTo(lastRow, this.doc.getLine(lastRow).length); + }; + this.setRange = + this.setSelectionRange = function(range, reverse) { + if (reverse) { + this.setSelectionAnchor(range.end.row, range.end.column); + this.selectTo(range.start.row, range.start.column); + } else { + this.setSelectionAnchor(range.start.row, range.start.column); + this.selectTo(range.end.row, range.end.column); + } + if (this.getRange().isEmpty()) + this.$isEmpty = true; + this.$desiredColumn = null; + }; + + this.$moveSelection = function(mover) { + var lead = this.lead; + if (this.$isEmpty) + this.setSelectionAnchor(lead.row, lead.column); + + mover.call(this); + }; + this.selectTo = function(row, column) { + this.$moveSelection(function() { + this.moveCursorTo(row, column); + }); + }; + this.selectToPosition = function(pos) { + this.$moveSelection(function() { + this.moveCursorToPosition(pos); + }); + }; + this.moveTo = function(row, column) { + this.clearSelection(); + this.moveCursorTo(row, column); + }; + this.moveToPosition = function(pos) { + this.clearSelection(); + this.moveCursorToPosition(pos); + }; + this.selectUp = function() { + this.$moveSelection(this.moveCursorUp); + }; + this.selectDown = function() { + this.$moveSelection(this.moveCursorDown); + }; + this.selectRight = function() { + this.$moveSelection(this.moveCursorRight); + }; + this.selectLeft = function() { + this.$moveSelection(this.moveCursorLeft); + }; + this.selectLineStart = function() { + this.$moveSelection(this.moveCursorLineStart); + }; + this.selectLineEnd = function() { + this.$moveSelection(this.moveCursorLineEnd); + }; + this.selectFileEnd = function() { + this.$moveSelection(this.moveCursorFileEnd); + }; + this.selectFileStart = function() { + this.$moveSelection(this.moveCursorFileStart); + }; + this.selectWordRight = function() { + this.$moveSelection(this.moveCursorWordRight); + }; + this.selectWordLeft = function() { + this.$moveSelection(this.moveCursorWordLeft); + }; + this.getWordRange = function(row, column) { + if (typeof column == "undefined") { + var cursor = row || this.lead; + row = cursor.row; + column = cursor.column; + } + return this.session.getWordRange(row, column); + }; + this.selectWord = function() { + this.setSelectionRange(this.getWordRange()); + }; + this.selectAWord = function() { + var cursor = this.getCursor(); + var range = this.session.getAWordRange(cursor.row, cursor.column); + this.setSelectionRange(range); + }; + + this.getLineRange = function(row, excludeLastChar) { + var rowStart = typeof row == "number" ? row : this.lead.row; + var rowEnd; + + var foldLine = this.session.getFoldLine(rowStart); + if (foldLine) { + rowStart = foldLine.start.row; + rowEnd = foldLine.end.row; + } else { + rowEnd = rowStart; + } + if (excludeLastChar === true) + return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length); + else + return new Range(rowStart, 0, rowEnd + 1, 0); + }; + this.selectLine = function() { + this.setSelectionRange(this.getLineRange()); + }; + this.moveCursorUp = function() { + this.moveCursorBy(-1, 0); + }; + this.moveCursorDown = function() { + this.moveCursorBy(1, 0); + }; + this.wouldMoveIntoSoftTab = function(cursor, tabSize, direction) { + var start = cursor.column; + var end = cursor.column + tabSize; + + if (direction < 0) { + start = cursor.column - tabSize; + end = cursor.column; + } + return this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(start, end).split(" ").length-1 == tabSize + } + this.moveCursorLeft = function() { + var cursor = this.lead.getPosition(), + fold; + + if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) { + this.moveCursorTo(fold.start.row, fold.start.column); + } else if (cursor.column === 0) { + if (cursor.row > 0) { + this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length); + } + } + else { + var tabSize = this.session.getTabSize(); + if (this.wouldMoveIntoSoftTab(cursor, tabSize, -1) && !this.session.getNavigateWithinSoftTabs()) { + this.moveCursorBy(0, -tabSize); + } else { + this.moveCursorBy(0, -1); + } + } + }; + this.moveCursorRight = function() { + var cursor = this.lead.getPosition(), + fold; + if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) { + this.moveCursorTo(fold.end.row, fold.end.column); + } + else if (this.lead.column == this.doc.getLine(this.lead.row).length) { + if (this.lead.row < this.doc.getLength() - 1) { + this.moveCursorTo(this.lead.row + 1, 0); + } + } + else { + var tabSize = this.session.getTabSize(); + var cursor = this.lead; + if (this.wouldMoveIntoSoftTab(cursor, tabSize, 1) && !this.session.getNavigateWithinSoftTabs()) { + this.moveCursorBy(0, tabSize); + } else { + this.moveCursorBy(0, 1); + } + } + }; + this.moveCursorLineStart = function() { + var row = this.lead.row; + var column = this.lead.column; + var screenRow = this.session.documentToScreenRow(row, column); + var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0); + var beforeCursor = this.session.getDisplayLine( + row, null, firstColumnPosition.row, + firstColumnPosition.column + ); + + var leadingSpace = beforeCursor.match(/^\s*/); + if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart) + firstColumnPosition.column += leadingSpace[0].length; + this.moveCursorToPosition(firstColumnPosition); + }; + this.moveCursorLineEnd = function() { + var lead = this.lead; + var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column); + if (this.lead.column == lineEnd.column) { + var line = this.session.getLine(lineEnd.row); + if (lineEnd.column == line.length) { + var textEnd = line.search(/\s+$/); + if (textEnd > 0) + lineEnd.column = textEnd; + } + } + + this.moveCursorTo(lineEnd.row, lineEnd.column); + }; + this.moveCursorFileEnd = function() { + var row = this.doc.getLength() - 1; + var column = this.doc.getLine(row).length; + this.moveCursorTo(row, column); + }; + this.moveCursorFileStart = function() { + this.moveCursorTo(0, 0); + }; + this.moveCursorLongWordRight = function() { + var row = this.lead.row; + var column = this.lead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var match; + this.session.nonTokenRe.lastIndex = 0; + this.session.tokenRe.lastIndex = 0; + var fold = this.session.getFoldAt(row, column, 1); + if (fold) { + this.moveCursorTo(fold.end.row, fold.end.column); + return; + } + if (match = this.session.nonTokenRe.exec(rightOfCursor)) { + column += this.session.nonTokenRe.lastIndex; + this.session.nonTokenRe.lastIndex = 0; + rightOfCursor = line.substring(column); + } + if (column >= line.length) { + this.moveCursorTo(row, line.length); + this.moveCursorRight(); + if (row < this.doc.getLength() - 1) + this.moveCursorWordRight(); + return; + } + if (match = this.session.tokenRe.exec(rightOfCursor)) { + column += this.session.tokenRe.lastIndex; + this.session.tokenRe.lastIndex = 0; + } + + this.moveCursorTo(row, column); + }; + this.moveCursorLongWordLeft = function() { + var row = this.lead.row; + var column = this.lead.column; + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) { + this.moveCursorTo(fold.start.row, fold.start.column); + return; + } + + var str = this.session.getFoldStringAt(row, column, -1); + if (str == null) { + str = this.doc.getLine(row).substring(0, column); + } + + var leftOfCursor = lang.stringReverse(str); + var match; + this.session.nonTokenRe.lastIndex = 0; + this.session.tokenRe.lastIndex = 0; + if (match = this.session.nonTokenRe.exec(leftOfCursor)) { + column -= this.session.nonTokenRe.lastIndex; + leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex); + this.session.nonTokenRe.lastIndex = 0; + } + if (column <= 0) { + this.moveCursorTo(row, 0); + this.moveCursorLeft(); + if (row > 0) + this.moveCursorWordLeft(); + return; + } + if (match = this.session.tokenRe.exec(leftOfCursor)) { + column -= this.session.tokenRe.lastIndex; + this.session.tokenRe.lastIndex = 0; + } + + this.moveCursorTo(row, column); + }; + + this.$shortWordEndIndex = function(rightOfCursor) { + var match, index = 0, ch; + var whitespaceRe = /\s/; + var tokenRe = this.session.tokenRe; + + tokenRe.lastIndex = 0; + if (match = this.session.tokenRe.exec(rightOfCursor)) { + index = this.session.tokenRe.lastIndex; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + + if (index < 1) { + tokenRe.lastIndex = 0; + while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { + tokenRe.lastIndex = 0; + index ++; + if (whitespaceRe.test(ch)) { + if (index > 2) { + index--; + break; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + if (index > 2) + break; + } + } + } + } + } + tokenRe.lastIndex = 0; + + return index; + }; + + this.moveCursorShortWordRight = function() { + var row = this.lead.row; + var column = this.lead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var fold = this.session.getFoldAt(row, column, 1); + if (fold) + return this.moveCursorTo(fold.end.row, fold.end.column); + + if (column == line.length) { + var l = this.doc.getLength(); + do { + row++; + rightOfCursor = this.doc.getLine(row); + } while (row < l && /^\s*$/.test(rightOfCursor)); + + if (!/^\s+/.test(rightOfCursor)) + rightOfCursor = ""; + column = 0; + } + + var index = this.$shortWordEndIndex(rightOfCursor); + + this.moveCursorTo(row, column + index); + }; + + this.moveCursorShortWordLeft = function() { + var row = this.lead.row; + var column = this.lead.column; + + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) + return this.moveCursorTo(fold.start.row, fold.start.column); + + var line = this.session.getLine(row).substring(0, column); + if (column === 0) { + do { + row--; + line = this.doc.getLine(row); + } while (row > 0 && /^\s*$/.test(line)); + + column = line.length; + if (!/\s+$/.test(line)) + line = ""; + } + + var leftOfCursor = lang.stringReverse(line); + var index = this.$shortWordEndIndex(leftOfCursor); + + return this.moveCursorTo(row, column - index); + }; + + this.moveCursorWordRight = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordRight(); + else + this.moveCursorShortWordRight(); + }; + + this.moveCursorWordLeft = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordLeft(); + else + this.moveCursorShortWordLeft(); + }; + this.moveCursorBy = function(rows, chars) { + var screenPos = this.session.documentToScreenPosition( + this.lead.row, + this.lead.column + ); + + if (chars === 0) { + if (this.$desiredColumn) + screenPos.column = this.$desiredColumn; + else + this.$desiredColumn = screenPos.column; + } + + var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column); + + if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) { + if (this.session.lineWidgets && this.session.lineWidgets[docPos.row]) { + if (docPos.row > 0 || rows > 0) + docPos.row++; + } + } + this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0); + }; + this.moveCursorToPosition = function(position) { + this.moveCursorTo(position.row, position.column); + }; + this.moveCursorTo = function(row, column, keepDesiredColumn) { + var fold = this.session.getFoldAt(row, column, 1); + if (fold) { + row = fold.start.row; + column = fold.start.column; + } + + this.$keepDesiredColumnOnChange = true; + this.lead.setPosition(row, column); + this.$keepDesiredColumnOnChange = false; + + if (!keepDesiredColumn) + this.$desiredColumn = null; + }; + this.moveCursorToScreen = function(row, column, keepDesiredColumn) { + var pos = this.session.screenToDocumentPosition(row, column); + this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); + }; + this.detach = function() { + this.lead.detach(); + this.anchor.detach(); + this.session = this.doc = null; + }; + + this.fromOrientedRange = function(range) { + this.setSelectionRange(range, range.cursor == range.start); + this.$desiredColumn = range.desiredColumn || this.$desiredColumn; + }; + + this.toOrientedRange = function(range) { + var r = this.getRange(); + if (range) { + range.start.column = r.start.column; + range.start.row = r.start.row; + range.end.column = r.end.column; + range.end.row = r.end.row; + } else { + range = r; + } + + range.cursor = this.isBackwards() ? range.start : range.end; + range.desiredColumn = this.$desiredColumn; + return range; + }; + this.getRangeOfMovements = function(func) { + var start = this.getCursor(); + try { + func(this); + var end = this.getCursor(); + return Range.fromPoints(start,end); + } catch(e) { + return Range.fromPoints(start,start); + } finally { + this.moveCursorToPosition(start); + } + }; + + this.toJSON = function() { + if (this.rangeCount) { + var data = this.ranges.map(function(r) { + var r1 = r.clone(); + r1.isBackwards = r.cursor == r.start; + return r1; + }); + } else { + var data = this.getRange(); + data.isBackwards = this.isBackwards(); + } + return data; + }; + + this.fromJSON = function(data) { + if (data.start == undefined) { + if (this.rangeList) { + this.toSingleRange(data[0]); + for (var i = data.length; i--; ) { + var r = Range.fromPoints(data[i].start, data[i].end); + if (data[i].isBackwards) + r.cursor = r.start; + this.addRange(r, true); + } + return; + } else + data = data[0]; + } + if (this.rangeList) + this.toSingleRange(data); + this.setSelectionRange(data, data.isBackwards); + }; + + this.isEqual = function(data) { + if ((data.length || this.rangeCount) && data.length != this.rangeCount) + return false; + if (!data.length || !this.ranges) + return this.getRange().isEqual(data); + + for (var i = this.ranges.length; i--; ) { + if (!this.ranges[i].isEqual(data[i])) + return false; + } + return true; + }; + +}).call(Selection.prototype); + +exports.Selection = Selection; +}); + +ace.define("ace/tokenizer",["require","exports","module","ace/config"], function(require, exports, module) { +"use strict"; + +var config = require("./config"); +var MAX_TOKEN_COUNT = 2000; +var Tokenizer = function(rules) { + this.states = rules; + + this.regExps = {}; + this.matchMappings = {}; + for (var key in this.states) { + var state = this.states[key]; + var ruleRegExps = []; + var matchTotal = 0; + var mapping = this.matchMappings[key] = {defaultToken: "text"}; + var flag = "g"; + + var splitterRurles = []; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.defaultToken) + mapping.defaultToken = rule.defaultToken; + if (rule.caseInsensitive) + flag = "gi"; + if (rule.regex == null) + continue; + + if (rule.regex instanceof RegExp) + rule.regex = rule.regex.toString().slice(1, -1); + var adjustedregex = rule.regex; + var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; + if (Array.isArray(rule.token)) { + if (rule.token.length == 1 || matchcount == 1) { + rule.token = rule.token[0]; + } else if (matchcount - 1 != rule.token.length) { + this.reportError("number of classes and regexp groups doesn't match", { + rule: rule, + groupCount: matchcount - 1 + }); + rule.token = rule.token[0]; + } else { + rule.tokenArray = rule.token; + rule.token = null; + rule.onMatch = this.$arrayTokens; + } + } else if (typeof rule.token == "function" && !rule.onMatch) { + if (matchcount > 1) + rule.onMatch = this.$applyToken; + else + rule.onMatch = rule.token; + } + + if (matchcount > 1) { + if (/\\\d/.test(rule.regex)) { + adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) { + return "\\" + (parseInt(digit, 10) + matchTotal + 1); + }); + } else { + matchcount = 1; + adjustedregex = this.removeCapturingGroups(rule.regex); + } + if (!rule.splitRegex && typeof rule.token != "string") + splitterRurles.push(rule); // flag will be known only at the very end + } + + mapping[matchTotal] = i; + matchTotal += matchcount; + + ruleRegExps.push(adjustedregex); + if (!rule.onMatch) + rule.onMatch = null; + } + + if (!ruleRegExps.length) { + mapping[0] = 0; + ruleRegExps.push("$"); + } + + splitterRurles.forEach(function(rule) { + rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); + }, this); + + this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); + } +}; + +(function() { + this.$setMaxTokenCount = function(m) { + MAX_TOKEN_COUNT = m | 0; + }; + + this.$applyToken = function(str) { + var values = this.splitRegex.exec(str).slice(1); + var types = this.token.apply(this, values); + if (typeof types === "string") + return [{type: types, value: str}]; + + var tokens = []; + for (var i = 0, l = types.length; i < l; i++) { + if (values[i]) + tokens[tokens.length] = { + type: types[i], + value: values[i] + }; + } + return tokens; + }; + + this.$arrayTokens = function(str) { + if (!str) + return []; + var values = this.splitRegex.exec(str); + if (!values) + return "text"; + var tokens = []; + var types = this.tokenArray; + for (var i = 0, l = types.length; i < l; i++) { + if (values[i + 1]) + tokens[tokens.length] = { + type: types[i], + value: values[i + 1] + }; + } + return tokens; + }; + + this.removeCapturingGroups = function(src) { + var r = src.replace( + /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, + function(x, y) {return y ? "(?:" : x;} + ); + return r; + }; + + this.createSplitterRegexp = function(src, flag) { + if (src.indexOf("(?=") != -1) { + var stack = 0; + var inChClass = false; + var lastCapture = {}; + src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function( + m, esc, parenOpen, parenClose, square, index + ) { + if (inChClass) { + inChClass = square != "]"; + } else if (square) { + inChClass = true; + } else if (parenClose) { + if (stack == lastCapture.stack) { + lastCapture.end = index+1; + lastCapture.stack = -1; + } + stack--; + } else if (parenOpen) { + stack++; + if (parenOpen.length != 1) { + lastCapture.stack = stack + lastCapture.start = index; + } + } + return m; + }); + + if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end))) + src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end); + } + if (src.charAt(0) != "^") src = "^" + src; + if (src.charAt(src.length - 1) != "$") src += "$"; + + return new RegExp(src, (flag||"").replace("g", "")); + }; + this.getLineTokens = function(line, startState) { + if (startState && typeof startState != "string") { + var stack = startState.slice(0); + startState = stack[0]; + if (startState === "#tmp") { + stack.shift() + startState = stack.shift() + } + } else + var stack = []; + + var currentState = startState || "start"; + var state = this.states[currentState]; + if (!state) { + currentState = "start"; + state = this.states[currentState]; + } + var mapping = this.matchMappings[currentState]; + var re = this.regExps[currentState]; + re.lastIndex = 0; + + var match, tokens = []; + var lastIndex = 0; + var matchAttempts = 0; + + var token = {type: null, value: ""}; + + while (match = re.exec(line)) { + var type = mapping.defaultToken; + var rule = null; + var value = match[0]; + var index = re.lastIndex; + + if (index - value.length > lastIndex) { + var skipped = line.substring(lastIndex, index - value.length); + if (token.type == type) { + token.value += skipped; + } else { + if (token.type) + tokens.push(token); + token = {type: type, value: skipped}; + } + } + + for (var i = 0; i < match.length-2; i++) { + if (match[i + 1] === undefined) + continue; + + rule = state[mapping[i]]; + + if (rule.onMatch) + type = rule.onMatch(value, currentState, stack, line); + else + type = rule.token; + + if (rule.next) { + if (typeof rule.next == "string") { + currentState = rule.next; + } else { + currentState = rule.next(currentState, stack); + } + + state = this.states[currentState]; + if (!state) { + this.reportError("state doesn't exist", currentState); + currentState = "start"; + state = this.states[currentState]; + } + mapping = this.matchMappings[currentState]; + lastIndex = index; + re = this.regExps[currentState]; + re.lastIndex = index; + } + if (rule.consumeLineEnd) + lastIndex = index; + break; + } + + if (value) { + if (typeof type === "string") { + if ((!rule || rule.merge !== false) && token.type === type) { + token.value += value; + } else { + if (token.type) + tokens.push(token); + token = {type: type, value: value}; + } + } else if (type) { + if (token.type) + tokens.push(token); + token = {type: null, value: ""}; + for (var i = 0; i < type.length; i++) + tokens.push(type[i]); + } + } + + if (lastIndex == line.length) + break; + + lastIndex = index; + + if (matchAttempts++ > MAX_TOKEN_COUNT) { + if (matchAttempts > 2 * line.length) { + this.reportError("infinite loop with in ace tokenizer", { + startState: startState, + line: line + }); + } + while (lastIndex < line.length) { + if (token.type) + tokens.push(token); + token = { + value: line.substring(lastIndex, lastIndex += 2000), + type: "overflow" + }; + } + currentState = "start"; + stack = []; + break; + } + } + + if (token.type) + tokens.push(token); + + if (stack.length > 1) { + if (stack[0] !== currentState) + stack.unshift("#tmp", currentState); + } + return { + tokens : tokens, + state : stack.length ? stack : currentState + }; + }; + + this.reportError = config.reportError; + +}).call(Tokenizer.prototype); + +exports.Tokenizer = Tokenizer; +}); + +ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var lang = require("../lib/lang"); + +var TextHighlightRules = function() { + + this.$rules = { + "start" : [{ + token : "empty_line", + regex : '^$' + }, { + defaultToken : "text" + }] + }; +}; + +(function() { + + this.addRules = function(rules, prefix) { + if (!prefix) { + for (var key in rules) + this.$rules[key] = rules[key]; + return; + } + for (var key in rules) { + var state = rules[key]; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.next || rule.onMatch) { + if (typeof rule.next == "string") { + if (rule.next.indexOf(prefix) !== 0) + rule.next = prefix + rule.next; + } + if (rule.nextState && rule.nextState.indexOf(prefix) !== 0) + rule.nextState = prefix + rule.nextState; + } + } + this.$rules[prefix + key] = state; + } + }; + + this.getRules = function() { + return this.$rules; + }; + + this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) { + var embedRules = typeof HighlightRules == "function" + ? new HighlightRules().getRules() + : HighlightRules; + if (states) { + for (var i = 0; i < states.length; i++) + states[i] = prefix + states[i]; + } else { + states = []; + for (var key in embedRules) + states.push(prefix + key); + } + + this.addRules(embedRules, prefix); + + if (escapeRules) { + var addRules = Array.prototype[append ? "push" : "unshift"]; + for (var i = 0; i < states.length; i++) + addRules.apply(this.$rules[states[i]], lang.deepCopy(escapeRules)); + } + + if (!this.$embeds) + this.$embeds = []; + this.$embeds.push(prefix); + }; + + this.getEmbeds = function() { + return this.$embeds; + }; + + var pushState = function(currentState, stack) { + if (currentState != "start" || stack.length) + stack.unshift(this.nextState, currentState); + return this.nextState; + }; + var popState = function(currentState, stack) { + stack.shift(); + return stack.shift() || "start"; + }; + + this.normalizeRules = function() { + var id = 0; + var rules = this.$rules; + function processState(key) { + var state = rules[key]; + state.processed = true; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + var toInsert = null; + if (Array.isArray(rule)) { + toInsert = rule; + rule = {}; + } + if (!rule.regex && rule.start) { + rule.regex = rule.start; + if (!rule.next) + rule.next = []; + rule.next.push({ + defaultToken: rule.token + }, { + token: rule.token + ".end", + regex: rule.end || rule.start, + next: "pop" + }); + rule.token = rule.token + ".start"; + rule.push = true; + } + var next = rule.next || rule.push; + if (next && Array.isArray(next)) { + var stateName = rule.stateName; + if (!stateName) { + stateName = rule.token; + if (typeof stateName != "string") + stateName = stateName[0] || ""; + if (rules[stateName]) + stateName += id++; + } + rules[stateName] = next; + rule.next = stateName; + processState(stateName); + } else if (next == "pop") { + rule.next = popState; + } + + if (rule.push) { + rule.nextState = rule.next || rule.push; + rule.next = pushState; + delete rule.push; + } + + if (rule.rules) { + for (var r in rule.rules) { + if (rules[r]) { + if (rules[r].push) + rules[r].push.apply(rules[r], rule.rules[r]); + } else { + rules[r] = rule.rules[r]; + } + } + } + var includeName = typeof rule == "string" ? rule : rule.include; + if (includeName) { + if (Array.isArray(includeName)) + toInsert = includeName.map(function(x) { return rules[x]; }); + else + toInsert = rules[includeName]; + } + + if (toInsert) { + var args = [i, 1].concat(toInsert); + if (rule.noEscape) + args = args.filter(function(x) {return !x.next;}); + state.splice.apply(state, args); + i--; + } + + if (rule.keywordMap) { + rule.token = this.createKeywordMapper( + rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive + ); + delete rule.defaultToken; + } + } + } + Object.keys(rules).forEach(processState, this); + }; + + this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) { + var keywords = Object.create(null); + Object.keys(map).forEach(function(className) { + var a = map[className]; + if (ignoreCase) + a = a.toLowerCase(); + var list = a.split(splitChar || "|"); + for (var i = list.length; i--; ) + keywords[list[i]] = className; + }); + if (Object.getPrototypeOf(keywords)) { + keywords.__proto__ = null; + } + this.$keywordList = Object.keys(keywords); + map = null; + return ignoreCase + ? function(value) {return keywords[value.toLowerCase()] || defaultToken } + : function(value) {return keywords[value] || defaultToken }; + }; + + this.getKeywords = function() { + return this.$keywords; + }; + +}).call(TextHighlightRules.prototype); + +exports.TextHighlightRules = TextHighlightRules; +}); + +ace.define("ace/mode/behaviour",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var Behaviour = function() { + this.$behaviours = {}; +}; + +(function () { + + this.add = function (name, action, callback) { + switch (undefined) { + case this.$behaviours: + this.$behaviours = {}; + case this.$behaviours[name]: + this.$behaviours[name] = {}; + } + this.$behaviours[name][action] = callback; + } + + this.addBehaviours = function (behaviours) { + for (var key in behaviours) { + for (var action in behaviours[key]) { + this.add(key, action, behaviours[key][action]); + } + } + } + + this.remove = function (name) { + if (this.$behaviours && this.$behaviours[name]) { + delete this.$behaviours[name]; + } + } + + this.inherit = function (mode, filter) { + if (typeof mode === "function") { + var behaviours = new mode().getBehaviours(filter); + } else { + var behaviours = mode.getBehaviours(filter); + } + this.addBehaviours(behaviours); + } + + this.getBehaviours = function (filter) { + if (!filter) { + return this.$behaviours; + } else { + var ret = {} + for (var i = 0; i < filter.length; i++) { + if (this.$behaviours[filter[i]]) { + ret[filter[i]] = this.$behaviours[filter[i]]; + } + } + return ret; + } + } + +}).call(Behaviour.prototype); + +exports.Behaviour = Behaviour; +}); + +ace.define("ace/token_iterator",["require","exports","module"], function(require, exports, module) { +"use strict"; +var TokenIterator = function(session, initialRow, initialColumn) { + this.$session = session; + this.$row = initialRow; + this.$rowTokens = session.getTokens(initialRow); + + var token = session.getTokenAt(initialRow, initialColumn); + this.$tokenIndex = token ? token.index : -1; +}; + +(function() { + this.stepBackward = function() { + this.$tokenIndex -= 1; + + while (this.$tokenIndex < 0) { + this.$row -= 1; + if (this.$row < 0) { + this.$row = 0; + return null; + } + + this.$rowTokens = this.$session.getTokens(this.$row); + this.$tokenIndex = this.$rowTokens.length - 1; + } + + return this.$rowTokens[this.$tokenIndex]; + }; + this.stepForward = function() { + this.$tokenIndex += 1; + var rowCount; + while (this.$tokenIndex >= this.$rowTokens.length) { + this.$row += 1; + if (!rowCount) + rowCount = this.$session.getLength(); + if (this.$row >= rowCount) { + this.$row = rowCount - 1; + return null; + } + + this.$rowTokens = this.$session.getTokens(this.$row); + this.$tokenIndex = 0; + } + + return this.$rowTokens[this.$tokenIndex]; + }; + this.getCurrentToken = function () { + return this.$rowTokens[this.$tokenIndex]; + }; + this.getCurrentTokenRow = function () { + return this.$row; + }; + this.getCurrentTokenColumn = function() { + var rowTokens = this.$rowTokens; + var tokenIndex = this.$tokenIndex; + var column = rowTokens[tokenIndex].start; + if (column !== undefined) + return column; + + column = 0; + while (tokenIndex > 0) { + tokenIndex -= 1; + column += rowTokens[tokenIndex].value.length; + } + + return column; + }; + this.getCurrentTokenPosition = function() { + return {row: this.$row, column: this.getCurrentTokenColumn()}; + }; + +}).call(TokenIterator.prototype); + +exports.TokenIterator = TokenIterator; +}); + +ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +var SAFE_INSERT_IN_TOKENS = + ["text", "paren.rparen", "punctuation.operator"]; +var SAFE_INSERT_BEFORE_TOKENS = + ["text", "paren.rparen", "punctuation.operator", "comment"]; + +var context; +var contextCache = {}; +var defaultQuotes = {'"' : '"', "'" : "'"}; + +var initContext = function(editor) { + var id = -1; + if (editor.multiSelect) { + id = editor.selection.index; + if (contextCache.rangeCount != editor.multiSelect.rangeCount) + contextCache = {rangeCount: editor.multiSelect.rangeCount}; + } + if (contextCache[id]) + return context = contextCache[id]; + context = contextCache[id] = { + autoInsertedBrackets: 0, + autoInsertedRow: -1, + autoInsertedLineEnd: "", + maybeInsertedBrackets: 0, + maybeInsertedRow: -1, + maybeInsertedLineStart: "", + maybeInsertedLineEnd: "" + }; +}; + +var getWrapped = function(selection, selected, opening, closing) { + var rowDiff = selection.end.row - selection.start.row; + return { + text: opening + selected + closing, + selection: [ + 0, + selection.start.column + 1, + rowDiff, + selection.end.column + (rowDiff ? 0 : 1) + ] + }; +}; + +var CstyleBehaviour = function(options) { + this.add("braces", "insertion", function(state, action, editor, session, text) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (text == '{') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '{', '}'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options && options.braces) { + CstyleBehaviour.recordAutoInsert(editor, session, "}"); + return { + text: '{}', + selection: [1, 1] + }; + } else { + CstyleBehaviour.recordMaybeInsert(editor, session, "{"); + return { + text: '{', + selection: [1, 1] + }; + } + } + } else if (text == '}') { + initContext(editor); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == '}') { + var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } else if (text == "\n" || text == "\r\n") { + initContext(editor); + var closing = ""; + if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { + closing = lang.stringRepeat("}", context.maybeInsertedBrackets); + CstyleBehaviour.clearMaybeInsertedClosing(); + } + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === '}') { + var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); + if (!openBracePos) + return null; + var next_indent = this.$getIndent(session.getLine(openBracePos.row)); + } else if (closing) { + var next_indent = this.$getIndent(line); + } else { + CstyleBehaviour.clearMaybeInsertedClosing(); + return; + } + var indent = next_indent + session.getTabString(); + + return { + text: '\n' + indent + '\n' + next_indent + closing, + selection: [1, indent.length, 1, indent.length] + }; + } else { + CstyleBehaviour.clearMaybeInsertedClosing(); + } + }); + + this.add("braces", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '{') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar == '}') { + range.end.column++; + return range; + } else { + context.maybeInsertedBrackets--; + } + } + }); + + this.add("parens", "insertion", function(state, action, editor, session, text) { + if (text == '(') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '(', ')'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + CstyleBehaviour.recordAutoInsert(editor, session, ")"); + return { + text: '()', + selection: [1, 1] + }; + } + } else if (text == ')') { + initContext(editor); + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ')') { + var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } + }); + + this.add("parens", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '(') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ')') { + range.end.column++; + return range; + } + } + }); + + this.add("brackets", "insertion", function(state, action, editor, session, text) { + if (text == '[') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '[', ']'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + CstyleBehaviour.recordAutoInsert(editor, session, "]"); + return { + text: '[]', + selection: [1, 1] + }; + } + } else if (text == ']') { + initContext(editor); + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ']') { + var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } + }); + + this.add("brackets", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '[') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ']') { + range.end.column++; + return range; + } + } + }); + + this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { + var quotes = session.$mode.$quotes || defaultQuotes; + if (text.length == 1 && quotes[text]) { + if (this.lineCommentStart && this.lineCommentStart.indexOf(text) != -1) + return; + initContext(editor); + var quote = text; + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && (selected.length != 1 || !quotes[selected]) && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, quote, quote); + } else if (!selected) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var leftChar = line.substring(cursor.column-1, cursor.column); + var rightChar = line.substring(cursor.column, cursor.column + 1); + + var token = session.getTokenAt(cursor.row, cursor.column); + var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); + if (leftChar == "\\" && token && /escape/.test(token.type)) + return null; + + var stringBefore = token && /string|escape/.test(token.type); + var stringAfter = !rightToken || /string|escape/.test(rightToken.type); + + var pair; + if (rightChar == quote) { + pair = stringBefore !== stringAfter; + if (pair && /string\.end/.test(rightToken.type)) + pair = false; + } else { + if (stringBefore && !stringAfter) + return null; // wrap string with different quote + if (stringBefore && stringAfter) + return null; // do not pair quotes inside strings + var wordRe = session.$mode.tokenRe; + wordRe.lastIndex = 0; + var isWordBefore = wordRe.test(leftChar); + wordRe.lastIndex = 0; + var isWordAfter = wordRe.test(leftChar); + if (isWordBefore || isWordAfter) + return null; // before or after alphanumeric + if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) + return null; // there is rightChar and it isn't closing + pair = true; + } + return { + text: pair ? quote + quote : "", + selection: [1,1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + +}; + + +CstyleBehaviour.isSaneInsertion = function(editor, session) { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { + var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); + if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) + return false; + } + iterator.stepForward(); + return iterator.getCurrentTokenRow() !== cursor.row || + this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); +}; + +CstyleBehaviour.$matchTokenType = function(token, types) { + return types.indexOf(token.type || token) > -1; +}; + +CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) + context.autoInsertedBrackets = 0; + context.autoInsertedRow = cursor.row; + context.autoInsertedLineEnd = bracket + line.substr(cursor.column); + context.autoInsertedBrackets++; +}; + +CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isMaybeInsertedClosing(cursor, line)) + context.maybeInsertedBrackets = 0; + context.maybeInsertedRow = cursor.row; + context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; + context.maybeInsertedLineEnd = line.substr(cursor.column); + context.maybeInsertedBrackets++; +}; + +CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { + return context.autoInsertedBrackets > 0 && + cursor.row === context.autoInsertedRow && + bracket === context.autoInsertedLineEnd[0] && + line.substr(cursor.column) === context.autoInsertedLineEnd; +}; + +CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { + return context.maybeInsertedBrackets > 0 && + cursor.row === context.maybeInsertedRow && + line.substr(cursor.column) === context.maybeInsertedLineEnd && + line.substr(0, cursor.column) == context.maybeInsertedLineStart; +}; + +CstyleBehaviour.popAutoInsertedClosing = function() { + context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); + context.autoInsertedBrackets--; +}; + +CstyleBehaviour.clearMaybeInsertedClosing = function() { + if (context) { + context.maybeInsertedBrackets = 0; + context.maybeInsertedRow = -1; + } +}; + + + +oop.inherits(CstyleBehaviour, Behaviour); + +exports.CstyleBehaviour = CstyleBehaviour; +}); + +ace.define("ace/unicode",["require","exports","module"], function(require, exports, module) { +"use strict"; +exports.packages = {}; + +addUnicodePackage({ + L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", + Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A", + Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A", + Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC", + Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F", + Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", + M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26", + Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26", + Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC", + Me: "0488048906DE20DD-20E020E2-20E4A670-A672", + N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", + Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", + Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF", + No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835", + P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65", + Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D", + Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62", + Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63", + Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20", + Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21", + Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F", + Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65", + S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD", + Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC", + Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6", + Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3", + So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD", + Z: "002000A01680180E2000-200A20282029202F205F3000", + Zs: "002000A01680180E2000-200A202F205F3000", + Zl: "2028", + Zp: "2029", + C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF", + Cc: "0000-001F007F-009F", + Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB", + Co: "E000-F8FF", + Cs: "D800-DFFF", + Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF" +}); + +function addUnicodePackage (pack) { + var codePoint = /\w{4}/g; + for (var name in pack) + exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); +} + +}); + +ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"], function(require, exports, module) { +"use strict"; + +var Tokenizer = require("../tokenizer").Tokenizer; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var unicode = require("../unicode"); +var lang = require("../lib/lang"); +var TokenIterator = require("../token_iterator").TokenIterator; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = TextHighlightRules; +}; + +(function() { + this.$defaultBehaviour = new CstyleBehaviour(); + + this.tokenRe = new RegExp("^[" + + unicode.packages.L + + unicode.packages.Mn + unicode.packages.Mc + + unicode.packages.Nd + + unicode.packages.Pc + "\\$_]+", "g" + ); + + this.nonTokenRe = new RegExp("^(?:[^" + + unicode.packages.L + + unicode.packages.Mn + unicode.packages.Mc + + unicode.packages.Nd + + unicode.packages.Pc + "\\$_]|\\s])+", "g" + ); + + this.getTokenizer = function() { + if (!this.$tokenizer) { + this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig); + this.$tokenizer = new Tokenizer(this.$highlightRules.getRules()); + } + return this.$tokenizer; + }; + + this.lineCommentStart = ""; + this.blockComment = ""; + + this.toggleCommentLines = function(state, session, startRow, endRow) { + var doc = session.doc; + + var ignoreBlankLines = true; + var shouldRemove = true; + var minIndent = Infinity; + var tabSize = session.getTabSize(); + var insertAtTabStop = false; + + if (!this.lineCommentStart) { + if (!this.blockComment) + return false; + var lineCommentStart = this.blockComment.start; + var lineCommentEnd = this.blockComment.end; + var regexpStart = new RegExp("^(\\s*)(?:" + lang.escapeRegExp(lineCommentStart) + ")"); + var regexpEnd = new RegExp("(?:" + lang.escapeRegExp(lineCommentEnd) + ")\\s*$"); + + var comment = function(line, i) { + if (testRemove(line, i)) + return; + if (!ignoreBlankLines || /\S/.test(line)) { + doc.insertInLine({row: i, column: line.length}, lineCommentEnd); + doc.insertInLine({row: i, column: minIndent}, lineCommentStart); + } + }; + + var uncomment = function(line, i) { + var m; + if (m = line.match(regexpEnd)) + doc.removeInLine(i, line.length - m[0].length, line.length); + if (m = line.match(regexpStart)) + doc.removeInLine(i, m[1].length, m[0].length); + }; + + var testRemove = function(line, row) { + if (regexpStart.test(line)) + return true; + var tokens = session.getTokens(row); + for (var i = 0; i < tokens.length; i++) { + if (tokens[i].type === "comment") + return true; + } + }; + } else { + if (Array.isArray(this.lineCommentStart)) { + var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join("|"); + var lineCommentStart = this.lineCommentStart[0]; + } else { + var regexpStart = lang.escapeRegExp(this.lineCommentStart); + var lineCommentStart = this.lineCommentStart; + } + regexpStart = new RegExp("^(\\s*)(?:" + regexpStart + ") ?"); + + insertAtTabStop = session.getUseSoftTabs(); + + var uncomment = function(line, i) { + var m = line.match(regexpStart); + if (!m) return; + var start = m[1].length, end = m[0].length; + if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == " ") + end--; + doc.removeInLine(i, start, end); + }; + var commentWithSpace = lineCommentStart + " "; + var comment = function(line, i) { + if (!ignoreBlankLines || /\S/.test(line)) { + if (shouldInsertSpace(line, minIndent, minIndent)) + doc.insertInLine({row: i, column: minIndent}, commentWithSpace); + else + doc.insertInLine({row: i, column: minIndent}, lineCommentStart); + } + }; + var testRemove = function(line, i) { + return regexpStart.test(line); + }; + + var shouldInsertSpace = function(line, before, after) { + var spaces = 0; + while (before-- && line.charAt(before) == " ") + spaces++; + if (spaces % tabSize != 0) + return false; + var spaces = 0; + while (line.charAt(after++) == " ") + spaces++; + if (tabSize > 2) + return spaces % tabSize != tabSize - 1; + else + return spaces % tabSize == 0; + return true; + }; + } + + function iter(fun) { + for (var i = startRow; i <= endRow; i++) + fun(doc.getLine(i), i); + } + + + var minEmptyLength = Infinity; + iter(function(line, i) { + var indent = line.search(/\S/); + if (indent !== -1) { + if (indent < minIndent) + minIndent = indent; + if (shouldRemove && !testRemove(line, i)) + shouldRemove = false; + } else if (minEmptyLength > line.length) { + minEmptyLength = line.length; + } + }); + + if (minIndent == Infinity) { + minIndent = minEmptyLength; + ignoreBlankLines = false; + shouldRemove = false; + } + + if (insertAtTabStop && minIndent % tabSize != 0) + minIndent = Math.floor(minIndent / tabSize) * tabSize; + + iter(shouldRemove ? uncomment : comment); + }; + + this.toggleBlockComment = function(state, session, range, cursor) { + var comment = this.blockComment; + if (!comment) + return; + if (!comment.start && comment[0]) + comment = comment[0]; + + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + var sel = session.selection; + var initialRange = session.selection.toOrientedRange(); + var startRow, colDiff; + + if (token && /comment/.test(token.type)) { + var startRange, endRange; + while (token && /comment/.test(token.type)) { + var i = token.value.indexOf(comment.start); + if (i != -1) { + var row = iterator.getCurrentTokenRow(); + var column = iterator.getCurrentTokenColumn() + i; + startRange = new Range(row, column, row, column + comment.start.length); + break; + } + token = iterator.stepBackward(); + } + + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + while (token && /comment/.test(token.type)) { + var i = token.value.indexOf(comment.end); + if (i != -1) { + var row = iterator.getCurrentTokenRow(); + var column = iterator.getCurrentTokenColumn() + i; + endRange = new Range(row, column, row, column + comment.end.length); + break; + } + token = iterator.stepForward(); + } + if (endRange) + session.remove(endRange); + if (startRange) { + session.remove(startRange); + startRow = startRange.start.row; + colDiff = -comment.start.length; + } + } else { + colDiff = comment.start.length; + startRow = range.start.row; + session.insert(range.end, comment.end); + session.insert(range.start, comment.start); + } + if (initialRange.start.row == startRow) + initialRange.start.column += colDiff; + if (initialRange.end.row == startRow) + initialRange.end.column += colDiff; + session.selection.fromOrientedRange(initialRange); + }; + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.autoOutdent = function(state, doc, row) { + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + + this.createWorker = function(session) { + return null; + }; + + this.createModeDelegates = function (mapping) { + this.$embeds = []; + this.$modes = {}; + for (var i in mapping) { + if (mapping[i]) { + this.$embeds.push(i); + this.$modes[i] = new mapping[i](); + } + } + + var delegations = ["toggleBlockComment", "toggleCommentLines", "getNextLineIndent", + "checkOutdent", "autoOutdent", "transformAction", "getCompletions"]; + + for (var i = 0; i < delegations.length; i++) { + (function(scope) { + var functionName = delegations[i]; + var defaultHandler = scope[functionName]; + scope[delegations[i]] = function() { + return this.$delegator(functionName, arguments, defaultHandler); + }; + }(this)); + } + }; + + this.$delegator = function(method, args, defaultHandler) { + var state = args[0]; + if (typeof state != "string") + state = state[0]; + for (var i = 0; i < this.$embeds.length; i++) { + if (!this.$modes[this.$embeds[i]]) continue; + + var split = state.split(this.$embeds[i]); + if (!split[0] && split[1]) { + args[0] = split[1]; + var mode = this.$modes[this.$embeds[i]]; + return mode[method].apply(mode, args); + } + } + var ret = defaultHandler.apply(this, args); + return defaultHandler ? ret : undefined; + }; + + this.transformAction = function(state, action, editor, session, param) { + if (this.$behaviour) { + var behaviours = this.$behaviour.getBehaviours(); + for (var key in behaviours) { + if (behaviours[key][action]) { + var ret = behaviours[key][action].apply(this, arguments); + if (ret) { + return ret; + } + } + } + } + }; + + this.getKeywords = function(append) { + if (!this.completionKeywords) { + var rules = this.$tokenizer.rules; + var completionKeywords = []; + for (var rule in rules) { + var ruleItr = rules[rule]; + for (var r = 0, l = ruleItr.length; r < l; r++) { + if (typeof ruleItr[r].token === "string") { + if (/keyword|support|storage/.test(ruleItr[r].token)) + completionKeywords.push(ruleItr[r].regex); + } + else if (typeof ruleItr[r].token === "object") { + for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) { + if (/keyword|support|storage/.test(ruleItr[r].token[a])) { + var rule = ruleItr[r].regex.match(/\(.+?\)/g)[a]; + completionKeywords.push(rule.substr(1, rule.length - 2)); + } + } + } + } + } + this.completionKeywords = completionKeywords; + } + if (!append) + return this.$keywordList; + return completionKeywords.concat(this.$keywordList || []); + }; + + this.$createKeywordList = function() { + if (!this.$highlightRules) + this.getTokenizer(); + return this.$keywordList = this.$highlightRules.$keywordList || []; + }; + + this.getCompletions = function(state, session, pos, prefix) { + var keywords = this.$keywordList || this.$createKeywordList(); + return keywords.map(function(word) { + return { + name: word, + value: word, + score: 0, + meta: "keyword" + }; + }); + }; + + this.$id = "ace/mode/text"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/apply_delta",["require","exports","module"], function(require, exports, module) { +"use strict"; + +function throwDeltaError(delta, errorText){ + console.log("Invalid Delta:", delta); + throw "Invalid Delta: " + errorText; +} + +function positionInDocument(docLines, position) { + return position.row >= 0 && position.row < docLines.length && + position.column >= 0 && position.column <= docLines[position.row].length; +} + +function validateDelta(docLines, delta) { + if (delta.action != "insert" && delta.action != "remove") + throwDeltaError(delta, "delta.action must be 'insert' or 'remove'"); + if (!(delta.lines instanceof Array)) + throwDeltaError(delta, "delta.lines must be an Array"); + if (!delta.start || !delta.end) + throwDeltaError(delta, "delta.start/end must be an present"); + var start = delta.start; + if (!positionInDocument(docLines, delta.start)) + throwDeltaError(delta, "delta.start must be contained in document"); + var end = delta.end; + if (delta.action == "remove" && !positionInDocument(docLines, end)) + throwDeltaError(delta, "delta.end must contained in document for 'remove' actions"); + var numRangeRows = end.row - start.row; + var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0)); + if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars) + throwDeltaError(delta, "delta.range must match delta lines"); +} + +exports.applyDelta = function(docLines, delta, doNotValidate) { + + var row = delta.start.row; + var startColumn = delta.start.column; + var line = docLines[row] || ""; + switch (delta.action) { + case "insert": + var lines = delta.lines; + if (lines.length === 1) { + docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn); + } else { + var args = [row, 1].concat(delta.lines); + docLines.splice.apply(docLines, args); + docLines[row] = line.substring(0, startColumn) + docLines[row]; + docLines[row + delta.lines.length - 1] += line.substring(startColumn); + } + break; + case "remove": + var endColumn = delta.end.column; + var endRow = delta.end.row; + if (row === endRow) { + docLines[row] = line.substring(0, startColumn) + line.substring(endColumn); + } else { + docLines.splice( + row, endRow - row + 1, + line.substring(0, startColumn) + docLines[endRow].substring(endColumn) + ); + } + break; + } +} +}); + +ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; + +var Anchor = exports.Anchor = function(doc, row, column) { + this.$onChange = this.onChange.bind(this); + this.attach(doc); + + if (typeof column == "undefined") + this.setPosition(row.row, row.column); + else + this.setPosition(row, column); +}; + +(function() { + + oop.implement(this, EventEmitter); + this.getPosition = function() { + return this.$clipPositionToDocument(this.row, this.column); + }; + this.getDocument = function() { + return this.document; + }; + this.$insertRight = false; + this.onChange = function(delta) { + if (delta.start.row == delta.end.row && delta.start.row != this.row) + return; + + if (delta.start.row > this.row) + return; + + var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight); + this.setPosition(point.row, point.column, true); + }; + + function $pointsInOrder(point1, point2, equalPointsInOrder) { + var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column; + return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter); + } + + function $getTransformedPoint(delta, point, moveIfEqual) { + var deltaIsInsert = delta.action == "insert"; + var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row); + var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column); + var deltaStart = delta.start; + var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range. + if ($pointsInOrder(point, deltaStart, moveIfEqual)) { + return { + row: point.row, + column: point.column + }; + } + if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) { + return { + row: point.row + deltaRowShift, + column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0) + }; + } + + return { + row: deltaStart.row, + column: deltaStart.column + }; + } + this.setPosition = function(row, column, noClip) { + var pos; + if (noClip) { + pos = { + row: row, + column: column + }; + } else { + pos = this.$clipPositionToDocument(row, column); + } + + if (this.row == pos.row && this.column == pos.column) + return; + + var old = { + row: this.row, + column: this.column + }; + + this.row = pos.row; + this.column = pos.column; + this._signal("change", { + old: old, + value: pos + }); + }; + this.detach = function() { + this.document.removeEventListener("change", this.$onChange); + }; + this.attach = function(doc) { + this.document = doc || this.document; + this.document.on("change", this.$onChange); + }; + this.$clipPositionToDocument = function(row, column) { + var pos = {}; + + if (row >= this.document.getLength()) { + pos.row = Math.max(0, this.document.getLength() - 1); + pos.column = this.document.getLine(pos.row).length; + } + else if (row < 0) { + pos.row = 0; + pos.column = 0; + } + else { + pos.row = row; + pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); + } + + if (column < 0) + pos.column = 0; + + return pos; + }; + +}).call(Anchor.prototype); + +}); + +ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var applyDelta = require("./apply_delta").applyDelta; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var Range = require("./range").Range; +var Anchor = require("./anchor").Anchor; + +var Document = function(textOrLines) { + this.$lines = [""]; + if (textOrLines.length === 0) { + this.$lines = [""]; + } else if (Array.isArray(textOrLines)) { + this.insertMergedLines({row: 0, column: 0}, textOrLines); + } else { + this.insert({row: 0, column:0}, textOrLines); + } +}; + +(function() { + + oop.implement(this, EventEmitter); + this.setValue = function(text) { + var len = this.getLength() - 1; + this.remove(new Range(0, 0, len, this.getLine(len).length)); + this.insert({row: 0, column: 0}, text); + }; + this.getValue = function() { + return this.getAllLines().join(this.getNewLineCharacter()); + }; + this.createAnchor = function(row, column) { + return new Anchor(this, row, column); + }; + if ("aaa".split(/a/).length === 0) { + this.$split = function(text) { + return text.replace(/\r\n|\r/g, "\n").split("\n"); + }; + } else { + this.$split = function(text) { + return text.split(/\r\n|\r|\n/); + }; + } + + + this.$detectNewLine = function(text) { + var match = text.match(/^.*?(\r\n|\r|\n)/m); + this.$autoNewLine = match ? match[1] : "\n"; + this._signal("changeNewLineMode"); + }; + this.getNewLineCharacter = function() { + switch (this.$newLineMode) { + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine || "\n"; + } + }; + + this.$autoNewLine = ""; + this.$newLineMode = "auto"; + this.setNewLineMode = function(newLineMode) { + if (this.$newLineMode === newLineMode) + return; + + this.$newLineMode = newLineMode; + this._signal("changeNewLineMode"); + }; + this.getNewLineMode = function() { + return this.$newLineMode; + }; + this.isNewLine = function(text) { + return (text == "\r\n" || text == "\r" || text == "\n"); + }; + this.getLine = function(row) { + return this.$lines[row] || ""; + }; + this.getLines = function(firstRow, lastRow) { + return this.$lines.slice(firstRow, lastRow + 1); + }; + this.getAllLines = function() { + return this.getLines(0, this.getLength()); + }; + this.getLength = function() { + return this.$lines.length; + }; + this.getTextRange = function(range) { + return this.getLinesForRange(range).join(this.getNewLineCharacter()); + }; + this.getLinesForRange = function(range) { + var lines; + if (range.start.row === range.end.row) { + lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)]; + } else { + lines = this.getLines(range.start.row, range.end.row); + lines[0] = (lines[0] || "").substring(range.start.column); + var l = lines.length - 1; + if (range.end.row - range.start.row == l) + lines[l] = lines[l].substring(0, range.end.column); + } + return lines; + }; + this.insertLines = function(row, lines) { + console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."); + return this.insertFullLines(row, lines); + }; + this.removeLines = function(firstRow, lastRow) { + console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."); + return this.removeFullLines(firstRow, lastRow); + }; + this.insertNewLine = function(position) { + console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."); + return this.insertMergedLines(position, ["", ""]); + }; + this.insert = function(position, text) { + if (this.getLength() <= 1) + this.$detectNewLine(text); + + return this.insertMergedLines(position, this.$split(text)); + }; + this.insertInLine = function(position, text) { + var start = this.clippedPos(position.row, position.column); + var end = this.pos(position.row, position.column + text.length); + + this.applyDelta({ + start: start, + end: end, + action: "insert", + lines: [text] + }, true); + + return this.clonePos(end); + }; + + this.clippedPos = function(row, column) { + var length = this.getLength(); + if (row === undefined) { + row = length; + } else if (row < 0) { + row = 0; + } else if (row >= length) { + row = length - 1; + column = undefined; + } + var line = this.getLine(row); + if (column == undefined) + column = line.length; + column = Math.min(Math.max(column, 0), line.length); + return {row: row, column: column}; + }; + + this.clonePos = function(pos) { + return {row: pos.row, column: pos.column}; + }; + + this.pos = function(row, column) { + return {row: row, column: column}; + }; + + this.$clipPosition = function(position) { + var length = this.getLength(); + if (position.row >= length) { + position.row = Math.max(0, length - 1); + position.column = this.getLine(length - 1).length; + } else { + position.row = Math.max(0, position.row); + position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length); + } + return position; + }; + this.insertFullLines = function(row, lines) { + row = Math.min(Math.max(row, 0), this.getLength()); + var column = 0; + if (row < this.getLength()) { + lines = lines.concat([""]); + column = 0; + } else { + lines = [""].concat(lines); + row--; + column = this.$lines[row].length; + } + this.insertMergedLines({row: row, column: column}, lines); + }; + this.insertMergedLines = function(position, lines) { + var start = this.clippedPos(position.row, position.column); + var end = { + row: start.row + lines.length - 1, + column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length + }; + + this.applyDelta({ + start: start, + end: end, + action: "insert", + lines: lines + }); + + return this.clonePos(end); + }; + this.remove = function(range) { + var start = this.clippedPos(range.start.row, range.start.column); + var end = this.clippedPos(range.end.row, range.end.column); + this.applyDelta({ + start: start, + end: end, + action: "remove", + lines: this.getLinesForRange({start: start, end: end}) + }); + return this.clonePos(start); + }; + this.removeInLine = function(row, startColumn, endColumn) { + var start = this.clippedPos(row, startColumn); + var end = this.clippedPos(row, endColumn); + + this.applyDelta({ + start: start, + end: end, + action: "remove", + lines: this.getLinesForRange({start: start, end: end}) + }, true); + + return this.clonePos(start); + }; + this.removeFullLines = function(firstRow, lastRow) { + firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1); + lastRow = Math.min(Math.max(0, lastRow ), this.getLength() - 1); + var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0; + var deleteLastNewLine = lastRow < this.getLength() - 1; + var startRow = ( deleteFirstNewLine ? firstRow - 1 : firstRow ); + var startCol = ( deleteFirstNewLine ? this.getLine(startRow).length : 0 ); + var endRow = ( deleteLastNewLine ? lastRow + 1 : lastRow ); + var endCol = ( deleteLastNewLine ? 0 : this.getLine(endRow).length ); + var range = new Range(startRow, startCol, endRow, endCol); + var deletedLines = this.$lines.slice(firstRow, lastRow + 1); + + this.applyDelta({ + start: range.start, + end: range.end, + action: "remove", + lines: this.getLinesForRange(range) + }); + return deletedLines; + }; + this.removeNewLine = function(row) { + if (row < this.getLength() - 1 && row >= 0) { + this.applyDelta({ + start: this.pos(row, this.getLine(row).length), + end: this.pos(row + 1, 0), + action: "remove", + lines: ["", ""] + }); + } + }; + this.replace = function(range, text) { + if (!(range instanceof Range)) + range = Range.fromPoints(range.start, range.end); + if (text.length === 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + + this.remove(range); + var end; + if (text) { + end = this.insert(range.start, text); + } + else { + end = range.start; + } + + return end; + }; + this.applyDeltas = function(deltas) { + for (var i=0; i=0; i--) { + this.revertDelta(deltas[i]); + } + }; + this.applyDelta = function(delta, doNotValidate) { + var isInsert = delta.action == "insert"; + if (isInsert ? delta.lines.length <= 1 && !delta.lines[0] + : !Range.comparePoints(delta.start, delta.end)) { + return; + } + + if (isInsert && delta.lines.length > 20000) + this.$splitAndapplyLargeDelta(delta, 20000); + applyDelta(this.$lines, delta, doNotValidate); + this._signal("change", delta); + }; + + this.$splitAndapplyLargeDelta = function(delta, MAX) { + var lines = delta.lines; + var l = lines.length; + var row = delta.start.row; + var column = delta.start.column; + var from = 0, to = 0; + do { + from = to; + to += MAX - 1; + var chunk = lines.slice(from, to); + if (to > l) { + delta.lines = chunk; + delta.start.row = row + from; + delta.start.column = column; + break; + } + chunk.push(""); + this.applyDelta({ + start: this.pos(row + from, column), + end: this.pos(row + to, column = 0), + action: delta.action, + lines: chunk + }, true); + } while(true); + }; + this.revertDelta = function(delta) { + this.applyDelta({ + start: this.clonePos(delta.start), + end: this.clonePos(delta.end), + action: (delta.action == "insert" ? "remove" : "insert"), + lines: delta.lines.slice() + }); + }; + this.indexToPosition = function(index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return {row: i, column: index + lines[i].length + newlineLength}; + } + return {row: l-1, column: lines[l-1].length}; + }; + this.positionToIndex = function(pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + + return index + pos.column; + }; + +}).call(Document.prototype); + +exports.Document = Document; +}); + +ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; + +var BackgroundTokenizer = function(tokenizer, editor) { + this.running = false; + this.lines = []; + this.states = []; + this.currentLine = 0; + this.tokenizer = tokenizer; + + var self = this; + + this.$worker = function() { + if (!self.running) { return; } + + var workerStart = new Date(); + var currentLine = self.currentLine; + var endLine = -1; + var doc = self.doc; + + var startLine = currentLine; + while (self.lines[currentLine]) + currentLine++; + + var len = doc.getLength(); + var processedLines = 0; + self.running = false; + while (currentLine < len) { + self.$tokenizeRow(currentLine); + endLine = currentLine; + do { + currentLine++; + } while (self.lines[currentLine]); + processedLines ++; + if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) { + self.running = setTimeout(self.$worker, 20); + break; + } + } + self.currentLine = currentLine; + + if (endLine == -1) + endLine = currentLine; + + if (startLine <= endLine) + self.fireUpdateEvent(startLine, endLine); + }; +}; + +(function(){ + + oop.implement(this, EventEmitter); + this.setTokenizer = function(tokenizer) { + this.tokenizer = tokenizer; + this.lines = []; + this.states = []; + + this.start(0); + }; + this.setDocument = function(doc) { + this.doc = doc; + this.lines = []; + this.states = []; + + this.stop(); + }; + this.fireUpdateEvent = function(firstRow, lastRow) { + var data = { + first: firstRow, + last: lastRow + }; + this._signal("update", {data: data}); + }; + this.start = function(startRow) { + this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength()); + this.lines.splice(this.currentLine, this.lines.length); + this.states.splice(this.currentLine, this.states.length); + + this.stop(); + this.running = setTimeout(this.$worker, 700); + }; + + this.scheduleStart = function() { + if (!this.running) + this.running = setTimeout(this.$worker, 700); + } + + this.$updateOnChange = function(delta) { + var startRow = delta.start.row; + var len = delta.end.row - startRow; + + if (len === 0) { + this.lines[startRow] = null; + } else if (delta.action == "remove") { + this.lines.splice(startRow, len + 1, null); + this.states.splice(startRow, len + 1, null); + } else { + var args = Array(len + 1); + args.unshift(startRow, 1); + this.lines.splice.apply(this.lines, args); + this.states.splice.apply(this.states, args); + } + + this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength()); + + this.stop(); + }; + this.stop = function() { + if (this.running) + clearTimeout(this.running); + this.running = false; + }; + this.getTokens = function(row) { + return this.lines[row] || this.$tokenizeRow(row); + }; + this.getState = function(row) { + if (this.currentLine == row) + this.$tokenizeRow(row); + return this.states[row] || "start"; + }; + + this.$tokenizeRow = function(row) { + var line = this.doc.getLine(row); + var state = this.states[row - 1]; + + var data = this.tokenizer.getLineTokens(line, state, row); + + if (this.states[row] + "" !== data.state + "") { + this.states[row] = data.state; + this.lines[row + 1] = null; + if (this.currentLine > row + 1) + this.currentLine = row + 1; + } else if (this.currentLine == row) { + this.currentLine = row + 1; + } + + return this.lines[row] = data.tokens; + }; + +}).call(BackgroundTokenizer.prototype); + +exports.BackgroundTokenizer = BackgroundTokenizer; +}); + +ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(require, exports, module) { +"use strict"; + +var lang = require("./lib/lang"); +var oop = require("./lib/oop"); +var Range = require("./range").Range; + +var SearchHighlight = function(regExp, clazz, type) { + this.setRegexp(regExp); + this.clazz = clazz; + this.type = type || "text"; +}; + +(function() { + this.MAX_RANGES = 500; + + this.setRegexp = function(regExp) { + if (this.regExp+"" == regExp+"") + return; + this.regExp = regExp; + this.cache = []; + }; + + this.update = function(html, markerLayer, session, config) { + if (!this.regExp) + return; + var start = config.firstRow, end = config.lastRow; + + for (var i = start; i <= end; i++) { + var ranges = this.cache[i]; + if (ranges == null) { + ranges = lang.getMatchOffsets(session.getLine(i), this.regExp); + if (ranges.length > this.MAX_RANGES) + ranges = ranges.slice(0, this.MAX_RANGES); + ranges = ranges.map(function(match) { + return new Range(i, match.offset, i, match.offset + match.length); + }); + this.cache[i] = ranges.length ? ranges : ""; + } + + for (var j = ranges.length; j --; ) { + markerLayer.drawSingleLineMarker( + html, ranges[j].toScreenRange(session), this.clazz, config); + } + } + }; + +}).call(SearchHighlight.prototype); + +exports.SearchHighlight = SearchHighlight; +}); + +ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; +function FoldLine(foldData, folds) { + this.foldData = foldData; + if (Array.isArray(folds)) { + this.folds = folds; + } else { + folds = this.folds = [ folds ]; + } + + var last = folds[folds.length - 1]; + this.range = new Range(folds[0].start.row, folds[0].start.column, + last.end.row, last.end.column); + this.start = this.range.start; + this.end = this.range.end; + + this.folds.forEach(function(fold) { + fold.setFoldLine(this); + }, this); +} + +(function() { + this.shiftRow = function(shift) { + this.start.row += shift; + this.end.row += shift; + this.folds.forEach(function(fold) { + fold.start.row += shift; + fold.end.row += shift; + }); + }; + + this.addFold = function(fold) { + if (fold.sameRow) { + if (fold.start.row < this.startRow || fold.endRow > this.endRow) { + throw new Error("Can't add a fold to this FoldLine as it has no connection"); + } + this.folds.push(fold); + this.folds.sort(function(a, b) { + return -a.range.compareEnd(b.start.row, b.start.column); + }); + if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) { + this.end.row = fold.end.row; + this.end.column = fold.end.column; + } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) { + this.start.row = fold.start.row; + this.start.column = fold.start.column; + } + } else if (fold.start.row == this.end.row) { + this.folds.push(fold); + this.end.row = fold.end.row; + this.end.column = fold.end.column; + } else if (fold.end.row == this.start.row) { + this.folds.unshift(fold); + this.start.row = fold.start.row; + this.start.column = fold.start.column; + } else { + throw new Error("Trying to add fold to FoldRow that doesn't have a matching row"); + } + fold.foldLine = this; + }; + + this.containsRow = function(row) { + return row >= this.start.row && row <= this.end.row; + }; + + this.walk = function(callback, endRow, endColumn) { + var lastEnd = 0, + folds = this.folds, + fold, + cmp, stop, isNewRow = true; + + if (endRow == null) { + endRow = this.end.row; + endColumn = this.end.column; + } + + for (var i = 0; i < folds.length; i++) { + fold = folds[i]; + + cmp = fold.range.compareStart(endRow, endColumn); + if (cmp == -1) { + callback(null, endRow, endColumn, lastEnd, isNewRow); + return; + } + + stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow); + stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd); + if (stop || cmp === 0) { + return; + } + isNewRow = !fold.sameRow; + lastEnd = fold.end.column; + } + callback(null, endRow, endColumn, lastEnd, isNewRow); + }; + + this.getNextFoldTo = function(row, column) { + var fold, cmp; + for (var i = 0; i < this.folds.length; i++) { + fold = this.folds[i]; + cmp = fold.range.compareEnd(row, column); + if (cmp == -1) { + return { + fold: fold, + kind: "after" + }; + } else if (cmp === 0) { + return { + fold: fold, + kind: "inside" + }; + } + } + return null; + }; + + this.addRemoveChars = function(row, column, len) { + var ret = this.getNextFoldTo(row, column), + fold, folds; + if (ret) { + fold = ret.fold; + if (ret.kind == "inside" + && fold.start.column != column + && fold.start.row != row) + { + window.console && window.console.log(row, column, fold); + } else if (fold.start.row == row) { + folds = this.folds; + var i = folds.indexOf(fold); + if (i === 0) { + this.start.column += len; + } + for (i; i < folds.length; i++) { + fold = folds[i]; + fold.start.column += len; + if (!fold.sameRow) { + return; + } + fold.end.column += len; + } + this.end.column += len; + } + } + }; + + this.split = function(row, column) { + var pos = this.getNextFoldTo(row, column); + + if (!pos || pos.kind == "inside") + return null; + + var fold = pos.fold; + var folds = this.folds; + var foldData = this.foldData; + + var i = folds.indexOf(fold); + var foldBefore = folds[i - 1]; + this.end.row = foldBefore.end.row; + this.end.column = foldBefore.end.column; + folds = folds.splice(i, folds.length - i); + + var newFoldLine = new FoldLine(foldData, folds); + foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine); + return newFoldLine; + }; + + this.merge = function(foldLineNext) { + var folds = foldLineNext.folds; + for (var i = 0; i < folds.length; i++) { + this.addFold(folds[i]); + } + var foldData = this.foldData; + foldData.splice(foldData.indexOf(foldLineNext), 1); + }; + + this.toString = function() { + var ret = [this.range.toString() + ": [" ]; + + this.folds.forEach(function(fold) { + ret.push(" " + fold.toString()); + }); + ret.push("]"); + return ret.join("\n"); + }; + + this.idxToPosition = function(idx) { + var lastFoldEndColumn = 0; + + for (var i = 0; i < this.folds.length; i++) { + var fold = this.folds[i]; + + idx -= fold.start.column - lastFoldEndColumn; + if (idx < 0) { + return { + row: fold.start.row, + column: fold.start.column + idx + }; + } + + idx -= fold.placeholder.length; + if (idx < 0) { + return fold.start; + } + + lastFoldEndColumn = fold.end.column; + } + + return { + row: this.end.row, + column: this.end.column + idx + }; + }; +}).call(FoldLine.prototype); + +exports.FoldLine = FoldLine; +}); + +ace.define("ace/range_list",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; +var Range = require("./range").Range; +var comparePoints = Range.comparePoints; + +var RangeList = function() { + this.ranges = []; +}; + +(function() { + this.comparePoints = comparePoints; + + this.pointIndex = function(pos, excludeEdges, startIndex) { + var list = this.ranges; + + for (var i = startIndex || 0; i < list.length; i++) { + var range = list[i]; + var cmpEnd = comparePoints(pos, range.end); + if (cmpEnd > 0) + continue; + var cmpStart = comparePoints(pos, range.start); + if (cmpEnd === 0) + return excludeEdges && cmpStart !== 0 ? -i-2 : i; + if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges)) + return i; + + return -i-1; + } + return -i - 1; + }; + + this.add = function(range) { + var excludeEdges = !range.isEmpty(); + var startIndex = this.pointIndex(range.start, excludeEdges); + if (startIndex < 0) + startIndex = -startIndex - 1; + + var endIndex = this.pointIndex(range.end, excludeEdges, startIndex); + + if (endIndex < 0) + endIndex = -endIndex - 1; + else + endIndex++; + return this.ranges.splice(startIndex, endIndex - startIndex, range); + }; + + this.addList = function(list) { + var removed = []; + for (var i = list.length; i--; ) { + removed.push.apply(removed, this.add(list[i])); + } + return removed; + }; + + this.substractPoint = function(pos) { + var i = this.pointIndex(pos); + + if (i >= 0) + return this.ranges.splice(i, 1); + }; + this.merge = function() { + var removed = []; + var list = this.ranges; + + list = list.sort(function(a, b) { + return comparePoints(a.start, b.start); + }); + + var next = list[0], range; + for (var i = 1; i < list.length; i++) { + range = next; + next = list[i]; + var cmp = comparePoints(range.end, next.start); + if (cmp < 0) + continue; + + if (cmp == 0 && !range.isEmpty() && !next.isEmpty()) + continue; + + if (comparePoints(range.end, next.end) < 0) { + range.end.row = next.end.row; + range.end.column = next.end.column; + } + + list.splice(i, 1); + removed.push(next); + next = range; + i--; + } + + this.ranges = list; + + return removed; + }; + + this.contains = function(row, column) { + return this.pointIndex({row: row, column: column}) >= 0; + }; + + this.containsPoint = function(pos) { + return this.pointIndex(pos) >= 0; + }; + + this.rangeAtPoint = function(pos) { + var i = this.pointIndex(pos); + if (i >= 0) + return this.ranges[i]; + }; + + + this.clipRows = function(startRow, endRow) { + var list = this.ranges; + if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow) + return []; + + var startIndex = this.pointIndex({row: startRow, column: 0}); + if (startIndex < 0) + startIndex = -startIndex - 1; + var endIndex = this.pointIndex({row: endRow, column: 0}, startIndex); + if (endIndex < 0) + endIndex = -endIndex - 1; + + var clipped = []; + for (var i = startIndex; i < endIndex; i++) { + clipped.push(list[i]); + } + return clipped; + }; + + this.removeAll = function() { + return this.ranges.splice(0, this.ranges.length); + }; + + this.attach = function(session) { + if (this.session) + this.detach(); + + this.session = session; + this.onChange = this.$onChange.bind(this); + + this.session.on('change', this.onChange); + }; + + this.detach = function() { + if (!this.session) + return; + this.session.removeListener('change', this.onChange); + this.session = null; + }; + + this.$onChange = function(delta) { + if (delta.action == "insert"){ + var start = delta.start; + var end = delta.end; + } else { + var end = delta.start; + var start = delta.end; + } + var startRow = start.row; + var endRow = end.row; + var lineDif = endRow - startRow; + + var colDiff = -start.column + end.column; + var ranges = this.ranges; + + for (var i = 0, n = ranges.length; i < n; i++) { + var r = ranges[i]; + if (r.end.row < startRow) + continue; + if (r.start.row > startRow) + break; + + if (r.start.row == startRow && r.start.column >= start.column ) { + if (r.start.column == start.column && this.$insertRight) { + } else { + r.start.column += colDiff; + r.start.row += lineDif; + } + } + if (r.end.row == startRow && r.end.column >= start.column) { + if (r.end.column == start.column && this.$insertRight) { + continue; + } + if (r.end.column == start.column && colDiff > 0 && i < n - 1) { + if (r.end.column > r.start.column && r.end.column == ranges[i+1].start.column) + r.end.column -= colDiff; + } + r.end.column += colDiff; + r.end.row += lineDif; + } + } + + if (lineDif != 0 && i < n) { + for (; i < n; i++) { + var r = ranges[i]; + r.start.row += lineDif; + r.end.row += lineDif; + } + } + }; + +}).call(RangeList.prototype); + +exports.RangeList = RangeList; +}); + +ace.define("ace/edit_session/fold",["require","exports","module","ace/range","ace/range_list","ace/lib/oop"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; +var RangeList = require("../range_list").RangeList; +var oop = require("../lib/oop") +var Fold = exports.Fold = function(range, placeholder) { + this.foldLine = null; + this.placeholder = placeholder; + this.range = range; + this.start = range.start; + this.end = range.end; + + this.sameRow = range.start.row == range.end.row; + this.subFolds = this.ranges = []; +}; + +oop.inherits(Fold, RangeList); + +(function() { + + this.toString = function() { + return '"' + this.placeholder + '" ' + this.range.toString(); + }; + + this.setFoldLine = function(foldLine) { + this.foldLine = foldLine; + this.subFolds.forEach(function(fold) { + fold.setFoldLine(foldLine); + }); + }; + + this.clone = function() { + var range = this.range.clone(); + var fold = new Fold(range, this.placeholder); + this.subFolds.forEach(function(subFold) { + fold.subFolds.push(subFold.clone()); + }); + fold.collapseChildren = this.collapseChildren; + return fold; + }; + + this.addSubFold = function(fold) { + if (this.range.isEqual(fold)) + return; + + if (!this.range.containsRange(fold)) + throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); + consumeRange(fold, this.start); + + var row = fold.start.row, column = fold.start.column; + for (var i = 0, cmp = -1; i < this.subFolds.length; i++) { + cmp = this.subFolds[i].range.compare(row, column); + if (cmp != 1) + break; + } + var afterStart = this.subFolds[i]; + + if (cmp == 0) + return afterStart.addSubFold(fold); + var row = fold.range.end.row, column = fold.range.end.column; + for (var j = i, cmp = -1; j < this.subFolds.length; j++) { + cmp = this.subFolds[j].range.compare(row, column); + if (cmp != 1) + break; + } + var afterEnd = this.subFolds[j]; + + if (cmp == 0) + throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); + + var consumedFolds = this.subFolds.splice(i, j - i, fold); + fold.setFoldLine(this.foldLine); + + return fold; + }; + + this.restoreRange = function(range) { + return restoreRange(range, this.start); + }; + +}).call(Fold.prototype); + +function consumePoint(point, anchor) { + point.row -= anchor.row; + if (point.row == 0) + point.column -= anchor.column; +} +function consumeRange(range, anchor) { + consumePoint(range.start, anchor); + consumePoint(range.end, anchor); +} +function restorePoint(point, anchor) { + if (point.row == 0) + point.column += anchor.column; + point.row += anchor.row; +} +function restoreRange(range, anchor) { + restorePoint(range.start, anchor); + restorePoint(range.end, anchor); +} + +}); + +ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; +var FoldLine = require("./fold_line").FoldLine; +var Fold = require("./fold").Fold; +var TokenIterator = require("../token_iterator").TokenIterator; + +function Folding() { + this.getFoldAt = function(row, column, side) { + var foldLine = this.getFoldLine(row); + if (!foldLine) + return null; + + var folds = foldLine.folds; + for (var i = 0; i < folds.length; i++) { + var fold = folds[i]; + if (fold.range.contains(row, column)) { + if (side == 1 && fold.range.isEnd(row, column)) { + continue; + } else if (side == -1 && fold.range.isStart(row, column)) { + continue; + } + return fold; + } + } + }; + this.getFoldsInRange = function(range) { + var start = range.start; + var end = range.end; + var foldLines = this.$foldData; + var foundFolds = []; + + start.column += 1; + end.column -= 1; + + for (var i = 0; i < foldLines.length; i++) { + var cmp = foldLines[i].range.compareRange(range); + if (cmp == 2) { + continue; + } + else if (cmp == -2) { + break; + } + + var folds = foldLines[i].folds; + for (var j = 0; j < folds.length; j++) { + var fold = folds[j]; + cmp = fold.range.compareRange(range); + if (cmp == -2) { + break; + } else if (cmp == 2) { + continue; + } else + if (cmp == 42) { + break; + } + foundFolds.push(fold); + } + } + start.column -= 1; + end.column += 1; + + return foundFolds; + }; + + this.getFoldsInRangeList = function(ranges) { + if (Array.isArray(ranges)) { + var folds = []; + ranges.forEach(function(range) { + folds = folds.concat(this.getFoldsInRange(range)); + }, this); + } else { + var folds = this.getFoldsInRange(ranges); + } + return folds; + }; + this.getAllFolds = function() { + var folds = []; + var foldLines = this.$foldData; + + for (var i = 0; i < foldLines.length; i++) + for (var j = 0; j < foldLines[i].folds.length; j++) + folds.push(foldLines[i].folds[j]); + + return folds; + }; + this.getFoldStringAt = function(row, column, trim, foldLine) { + foldLine = foldLine || this.getFoldLine(row); + if (!foldLine) + return null; + + var lastFold = { + end: { column: 0 } + }; + var str, fold; + for (var i = 0; i < foldLine.folds.length; i++) { + fold = foldLine.folds[i]; + var cmp = fold.range.compareEnd(row, column); + if (cmp == -1) { + str = this + .getLine(fold.start.row) + .substring(lastFold.end.column, fold.start.column); + break; + } + else if (cmp === 0) { + return null; + } + lastFold = fold; + } + if (!str) + str = this.getLine(fold.start.row).substring(lastFold.end.column); + + if (trim == -1) + return str.substring(0, column - lastFold.end.column); + else if (trim == 1) + return str.substring(column - lastFold.end.column); + else + return str; + }; + + this.getFoldLine = function(docRow, startFoldLine) { + var foldData = this.$foldData; + var i = 0; + if (startFoldLine) + i = foldData.indexOf(startFoldLine); + if (i == -1) + i = 0; + for (i; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) { + return foldLine; + } else if (foldLine.end.row > docRow) { + return null; + } + } + return null; + }; + this.getNextFoldLine = function(docRow, startFoldLine) { + var foldData = this.$foldData; + var i = 0; + if (startFoldLine) + i = foldData.indexOf(startFoldLine); + if (i == -1) + i = 0; + for (i; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (foldLine.end.row >= docRow) { + return foldLine; + } + } + return null; + }; + + this.getFoldedRowCount = function(first, last) { + var foldData = this.$foldData, rowCount = last-first+1; + for (var i = 0; i < foldData.length; i++) { + var foldLine = foldData[i], + end = foldLine.end.row, + start = foldLine.start.row; + if (end >= last) { + if (start < last) { + if (start >= first) + rowCount -= last-start; + else + rowCount = 0; // in one fold + } + break; + } else if (end >= first){ + if (start >= first) // fold inside range + rowCount -= end-start; + else + rowCount -= end-first+1; + } + } + return rowCount; + }; + + this.$addFoldLine = function(foldLine) { + this.$foldData.push(foldLine); + this.$foldData.sort(function(a, b) { + return a.start.row - b.start.row; + }); + return foldLine; + }; + this.addFold = function(placeholder, range) { + var foldData = this.$foldData; + var added = false; + var fold; + + if (placeholder instanceof Fold) + fold = placeholder; + else { + fold = new Fold(range, placeholder); + fold.collapseChildren = range.collapseChildren; + } + this.$clipRangeToDocument(fold.range); + + var startRow = fold.start.row; + var startColumn = fold.start.column; + var endRow = fold.end.row; + var endColumn = fold.end.column; + if (!(startRow < endRow || + startRow == endRow && startColumn <= endColumn - 2)) + throw new Error("The range has to be at least 2 characters width"); + + var startFold = this.getFoldAt(startRow, startColumn, 1); + var endFold = this.getFoldAt(endRow, endColumn, -1); + if (startFold && endFold == startFold) + return startFold.addSubFold(fold); + + if (startFold && !startFold.range.isStart(startRow, startColumn)) + this.removeFold(startFold); + + if (endFold && !endFold.range.isEnd(endRow, endColumn)) + this.removeFold(endFold); + var folds = this.getFoldsInRange(fold.range); + if (folds.length > 0) { + this.removeFolds(folds); + folds.forEach(function(subFold) { + fold.addSubFold(subFold); + }); + } + + for (var i = 0; i < foldData.length; i++) { + var foldLine = foldData[i]; + if (endRow == foldLine.start.row) { + foldLine.addFold(fold); + added = true; + break; + } else if (startRow == foldLine.end.row) { + foldLine.addFold(fold); + added = true; + if (!fold.sameRow) { + var foldLineNext = foldData[i + 1]; + if (foldLineNext && foldLineNext.start.row == endRow) { + foldLine.merge(foldLineNext); + break; + } + } + break; + } else if (endRow <= foldLine.start.row) { + break; + } + } + + if (!added) + foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold)); + + if (this.$useWrapMode) + this.$updateWrapData(foldLine.start.row, foldLine.start.row); + else + this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row); + this.$modified = true; + this._signal("changeFold", { data: fold, action: "add" }); + + return fold; + }; + + this.addFolds = function(folds) { + folds.forEach(function(fold) { + this.addFold(fold); + }, this); + }; + + this.removeFold = function(fold) { + var foldLine = fold.foldLine; + var startRow = foldLine.start.row; + var endRow = foldLine.end.row; + + var foldLines = this.$foldData; + var folds = foldLine.folds; + if (folds.length == 1) { + foldLines.splice(foldLines.indexOf(foldLine), 1); + } else + if (foldLine.range.isEnd(fold.end.row, fold.end.column)) { + folds.pop(); + foldLine.end.row = folds[folds.length - 1].end.row; + foldLine.end.column = folds[folds.length - 1].end.column; + } else + if (foldLine.range.isStart(fold.start.row, fold.start.column)) { + folds.shift(); + foldLine.start.row = folds[0].start.row; + foldLine.start.column = folds[0].start.column; + } else + if (fold.sameRow) { + folds.splice(folds.indexOf(fold), 1); + } else + { + var newFoldLine = foldLine.split(fold.start.row, fold.start.column); + folds = newFoldLine.folds; + folds.shift(); + newFoldLine.start.row = folds[0].start.row; + newFoldLine.start.column = folds[0].start.column; + } + + if (!this.$updating) { + if (this.$useWrapMode) + this.$updateWrapData(startRow, endRow); + else + this.$updateRowLengthCache(startRow, endRow); + } + this.$modified = true; + this._signal("changeFold", { data: fold, action: "remove" }); + }; + + this.removeFolds = function(folds) { + var cloneFolds = []; + for (var i = 0; i < folds.length; i++) { + cloneFolds.push(folds[i]); + } + + cloneFolds.forEach(function(fold) { + this.removeFold(fold); + }, this); + this.$modified = true; + }; + + this.expandFold = function(fold) { + this.removeFold(fold); + fold.subFolds.forEach(function(subFold) { + fold.restoreRange(subFold); + this.addFold(subFold); + }, this); + if (fold.collapseChildren > 0) { + this.foldAll(fold.start.row+1, fold.end.row, fold.collapseChildren-1); + } + fold.subFolds = []; + }; + + this.expandFolds = function(folds) { + folds.forEach(function(fold) { + this.expandFold(fold); + }, this); + }; + + this.unfold = function(location, expandInner) { + var range, folds; + if (location == null) { + range = new Range(0, 0, this.getLength(), 0); + expandInner = true; + } else if (typeof location == "number") + range = new Range(location, 0, location, this.getLine(location).length); + else if ("row" in location) + range = Range.fromPoints(location, location); + else + range = location; + + folds = this.getFoldsInRangeList(range); + if (expandInner) { + this.removeFolds(folds); + } else { + var subFolds = folds; + while (subFolds.length) { + this.expandFolds(subFolds); + subFolds = this.getFoldsInRangeList(range); + } + } + if (folds.length) + return folds; + }; + this.isRowFolded = function(docRow, startFoldRow) { + return !!this.getFoldLine(docRow, startFoldRow); + }; + + this.getRowFoldEnd = function(docRow, startFoldRow) { + var foldLine = this.getFoldLine(docRow, startFoldRow); + return foldLine ? foldLine.end.row : docRow; + }; + + this.getRowFoldStart = function(docRow, startFoldRow) { + var foldLine = this.getFoldLine(docRow, startFoldRow); + return foldLine ? foldLine.start.row : docRow; + }; + + this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { + if (startRow == null) + startRow = foldLine.start.row; + if (startColumn == null) + startColumn = 0; + if (endRow == null) + endRow = foldLine.end.row; + if (endColumn == null) + endColumn = this.getLine(endRow).length; + var doc = this.doc; + var textLine = ""; + + foldLine.walk(function(placeholder, row, column, lastColumn) { + if (row < startRow) + return; + if (row == startRow) { + if (column < startColumn) + return; + lastColumn = Math.max(startColumn, lastColumn); + } + + if (placeholder != null) { + textLine += placeholder; + } else { + textLine += doc.getLine(row).substring(lastColumn, column); + } + }, endRow, endColumn); + return textLine; + }; + + this.getDisplayLine = function(row, endColumn, startRow, startColumn) { + var foldLine = this.getFoldLine(row); + + if (!foldLine) { + var line; + line = this.doc.getLine(row); + return line.substring(startColumn || 0, endColumn || line.length); + } else { + return this.getFoldDisplayLine( + foldLine, row, endColumn, startRow, startColumn); + } + }; + + this.$cloneFoldData = function() { + var fd = []; + fd = this.$foldData.map(function(foldLine) { + var folds = foldLine.folds.map(function(fold) { + return fold.clone(); + }); + return new FoldLine(fd, folds); + }); + + return fd; + }; + + this.toggleFold = function(tryToUnfold) { + var selection = this.selection; + var range = selection.getRange(); + var fold; + var bracketPos; + + if (range.isEmpty()) { + var cursor = range.start; + fold = this.getFoldAt(cursor.row, cursor.column); + + if (fold) { + this.expandFold(fold); + return; + } else if (bracketPos = this.findMatchingBracket(cursor)) { + if (range.comparePoint(bracketPos) == 1) { + range.end = bracketPos; + } else { + range.start = bracketPos; + range.start.column++; + range.end.column--; + } + } else if (bracketPos = this.findMatchingBracket({row: cursor.row, column: cursor.column + 1})) { + if (range.comparePoint(bracketPos) == 1) + range.end = bracketPos; + else + range.start = bracketPos; + + range.start.column++; + } else { + range = this.getCommentFoldRange(cursor.row, cursor.column) || range; + } + } else { + var folds = this.getFoldsInRange(range); + if (tryToUnfold && folds.length) { + this.expandFolds(folds); + return; + } else if (folds.length == 1 ) { + fold = folds[0]; + } + } + + if (!fold) + fold = this.getFoldAt(range.start.row, range.start.column); + + if (fold && fold.range.toString() == range.toString()) { + this.expandFold(fold); + return; + } + + var placeholder = "..."; + if (!range.isMultiLine()) { + placeholder = this.getTextRange(range); + if (placeholder.length < 4) + return; + placeholder = placeholder.trim().substring(0, 2) + ".."; + } + + this.addFold(placeholder, range); + }; + + this.getCommentFoldRange = function(row, column, dir) { + var iterator = new TokenIterator(this, row, column); + var token = iterator.getCurrentToken(); + var type = token.type; + if (token && /^comment|string/.test(type)) { + type = type.match(/comment|string/)[0]; + if (type == "comment") + type += "|doc-start"; + var re = new RegExp(type); + var range = new Range(); + if (dir != 1) { + do { + token = iterator.stepBackward(); + } while (token && re.test(token.type)); + iterator.stepForward(); + } + + range.start.row = iterator.getCurrentTokenRow(); + range.start.column = iterator.getCurrentTokenColumn() + 2; + + iterator = new TokenIterator(this, row, column); + + if (dir != -1) { + var lastRow = -1; + do { + token = iterator.stepForward(); + if (lastRow == -1) { + var state = this.getState(iterator.$row); + if (!re.test(state)) + lastRow = iterator.$row; + } else if (iterator.$row > lastRow) { + break; + } + } while (token && re.test(token.type)); + token = iterator.stepBackward(); + } else + token = iterator.getCurrentToken(); + + range.end.row = iterator.getCurrentTokenRow(); + range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 2; + return range; + } + }; + + this.foldAll = function(startRow, endRow, depth) { + if (depth == undefined) + depth = 100000; // JSON.stringify doesn't hanle Infinity + var foldWidgets = this.foldWidgets; + if (!foldWidgets) + return; // mode doesn't support folding + endRow = endRow || this.getLength(); + startRow = startRow || 0; + for (var row = startRow; row < endRow; row++) { + if (foldWidgets[row] == null) + foldWidgets[row] = this.getFoldWidget(row); + if (foldWidgets[row] != "start") + continue; + + var range = this.getFoldWidgetRange(row); + if (range && range.isMultiLine() + && range.end.row <= endRow + && range.start.row >= startRow + ) { + row = range.end.row; + try { + var fold = this.addFold("...", range); + if (fold) + fold.collapseChildren = depth; + } catch(e) {} + } + } + }; + this.$foldStyles = { + "manual": 1, + "markbegin": 1, + "markbeginend": 1 + }; + this.$foldStyle = "markbegin"; + this.setFoldStyle = function(style) { + if (!this.$foldStyles[style]) + throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]"); + + if (this.$foldStyle == style) + return; + + this.$foldStyle = style; + + if (style == "manual") + this.unfold(); + var mode = this.$foldMode; + this.$setFolding(null); + this.$setFolding(mode); + }; + + this.$setFolding = function(foldMode) { + if (this.$foldMode == foldMode) + return; + + this.$foldMode = foldMode; + + this.off('change', this.$updateFoldWidgets); + this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); + this._signal("changeAnnotation"); + + if (!foldMode || this.$foldStyle == "manual") { + this.foldWidgets = null; + return; + } + + this.foldWidgets = []; + this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle); + this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle); + + this.$updateFoldWidgets = this.updateFoldWidgets.bind(this); + this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this); + this.on('change', this.$updateFoldWidgets); + this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); + }; + + this.getParentFoldRangeData = function (row, ignoreCurrent) { + var fw = this.foldWidgets; + if (!fw || (ignoreCurrent && fw[row])) + return {}; + + var i = row - 1, firstRange; + while (i >= 0) { + var c = fw[i]; + if (c == null) + c = fw[i] = this.getFoldWidget(i); + + if (c == "start") { + var range = this.getFoldWidgetRange(i); + if (!firstRange) + firstRange = range; + if (range && range.end.row >= row) + break; + } + i--; + } + + return { + range: i !== -1 && range, + firstRange: firstRange + }; + }; + + this.onFoldWidgetClick = function(row, e) { + e = e.domEvent; + var options = { + children: e.shiftKey, + all: e.ctrlKey || e.metaKey, + siblings: e.altKey + }; + + var range = this.$toggleFoldWidget(row, options); + if (!range) { + var el = (e.target || e.srcElement); + if (el && /ace_fold-widget/.test(el.className)) + el.className += " ace_invalid"; + } + }; + + this.$toggleFoldWidget = function(row, options) { + if (!this.getFoldWidget) + return; + var type = this.getFoldWidget(row); + var line = this.getLine(row); + + var dir = type === "end" ? -1 : 1; + var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir); + + if (fold) { + if (options.children || options.all) + this.removeFold(fold); + else + this.expandFold(fold); + return fold; + } + + var range = this.getFoldWidgetRange(row, true); + if (range && !range.isMultiLine()) { + fold = this.getFoldAt(range.start.row, range.start.column, 1); + if (fold && range.isEqual(fold.range)) { + this.removeFold(fold); + return fold; + } + } + + if (options.siblings) { + var data = this.getParentFoldRangeData(row); + if (data.range) { + var startRow = data.range.start.row + 1; + var endRow = data.range.end.row; + } + this.foldAll(startRow, endRow, options.all ? 10000 : 0); + } else if (options.children) { + endRow = range ? range.end.row : this.getLength(); + this.foldAll(row + 1, endRow, options.all ? 10000 : 0); + } else if (range) { + if (options.all) + range.collapseChildren = 10000; + this.addFold("...", range); + } + + return range; + }; + + + + this.toggleFoldWidget = function(toggleParent) { + var row = this.selection.getCursor().row; + row = this.getRowFoldStart(row); + var range = this.$toggleFoldWidget(row, {}); + + if (range) + return; + var data = this.getParentFoldRangeData(row, true); + range = data.range || data.firstRange; + + if (range) { + row = range.start.row; + var fold = this.getFoldAt(row, this.getLine(row).length, 1); + + if (fold) { + this.removeFold(fold); + } else { + this.addFold("...", range); + } + } + }; + + this.updateFoldWidgets = function(delta) { + var firstRow = delta.start.row; + var len = delta.end.row - firstRow; + + if (len === 0) { + this.foldWidgets[firstRow] = null; + } else if (delta.action == 'remove') { + this.foldWidgets.splice(firstRow, len + 1, null); + } else { + var args = Array(len + 1); + args.unshift(firstRow, 1); + this.foldWidgets.splice.apply(this.foldWidgets, args); + } + }; + this.tokenizerUpdateFoldWidgets = function(e) { + var rows = e.data; + if (rows.first != rows.last) { + if (this.foldWidgets.length > rows.first) + this.foldWidgets.splice(rows.first, this.foldWidgets.length); + } + }; +} + +exports.Folding = Folding; + +}); + +ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; +var Range = require("../range").Range; + + +function BracketMatch() { + + this.findMatchingBracket = function(position, chr) { + if (position.column == 0) return null; + + var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column-1); + if (charBeforeCursor == "") return null; + + var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); + if (!match) + return null; + + if (match[1]) + return this.$findClosingBracket(match[1], position); + else + return this.$findOpeningBracket(match[2], position); + }; + + this.getBracketRange = function(pos) { + var line = this.getLine(pos.row); + var before = true, range; + + var chr = line.charAt(pos.column-1); + var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); + if (!match) { + chr = line.charAt(pos.column); + pos = {row: pos.row, column: pos.column + 1}; + match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); + before = false; + } + if (!match) + return null; + + if (match[1]) { + var bracketPos = this.$findClosingBracket(match[1], pos); + if (!bracketPos) + return null; + range = Range.fromPoints(pos, bracketPos); + if (!before) { + range.end.column++; + range.start.column--; + } + range.cursor = range.end; + } else { + var bracketPos = this.$findOpeningBracket(match[2], pos); + if (!bracketPos) + return null; + range = Range.fromPoints(bracketPos, pos); + if (!before) { + range.start.column++; + range.end.column--; + } + range.cursor = range.start; + } + + return range; + }; + + this.$brackets = { + ")": "(", + "(": ")", + "]": "[", + "[": "]", + "{": "}", + "}": "{" + }; + + this.$findOpeningBracket = function(bracket, position, typeRe) { + var openBracket = this.$brackets[bracket]; + var depth = 1; + + var iterator = new TokenIterator(this, position.row, position.column); + var token = iterator.getCurrentToken(); + if (!token) + token = iterator.stepForward(); + if (!token) + return; + + if (!typeRe){ + typeRe = new RegExp( + "(\\.?" + + token.type.replace(".", "\\.").replace("rparen", ".paren") + .replace(/\b(?:end)\b/, "(?:start|begin|end)") + + ")+" + ); + } + var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2; + var value = token.value; + + while (true) { + + while (valueIndex >= 0) { + var chr = value.charAt(valueIndex); + if (chr == openBracket) { + depth -= 1; + if (depth == 0) { + return {row: iterator.getCurrentTokenRow(), + column: valueIndex + iterator.getCurrentTokenColumn()}; + } + } + else if (chr == bracket) { + depth += 1; + } + valueIndex -= 1; + } + do { + token = iterator.stepBackward(); + } while (token && !typeRe.test(token.type)); + + if (token == null) + break; + + value = token.value; + valueIndex = value.length - 1; + } + + return null; + }; + + this.$findClosingBracket = function(bracket, position, typeRe) { + var closingBracket = this.$brackets[bracket]; + var depth = 1; + + var iterator = new TokenIterator(this, position.row, position.column); + var token = iterator.getCurrentToken(); + if (!token) + token = iterator.stepForward(); + if (!token) + return; + + if (!typeRe){ + typeRe = new RegExp( + "(\\.?" + + token.type.replace(".", "\\.").replace("lparen", ".paren") + .replace(/\b(?:start|begin)\b/, "(?:start|begin|end)") + + ")+" + ); + } + var valueIndex = position.column - iterator.getCurrentTokenColumn(); + + while (true) { + + var value = token.value; + var valueLength = value.length; + while (valueIndex < valueLength) { + var chr = value.charAt(valueIndex); + if (chr == closingBracket) { + depth -= 1; + if (depth == 0) { + return {row: iterator.getCurrentTokenRow(), + column: valueIndex + iterator.getCurrentTokenColumn()}; + } + } + else if (chr == bracket) { + depth += 1; + } + valueIndex += 1; + } + do { + token = iterator.stepForward(); + } while (token && !typeRe.test(token.type)); + + if (token == null) + break; + + valueIndex = 0; + } + + return null; + }; +} +exports.BracketMatch = BracketMatch; + +}); + +ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var lang = require("./lib/lang"); +var config = require("./config"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var Selection = require("./selection").Selection; +var TextMode = require("./mode/text").Mode; +var Range = require("./range").Range; +var Document = require("./document").Document; +var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer; +var SearchHighlight = require("./search_highlight").SearchHighlight; + +var EditSession = function(text, mode) { + this.$breakpoints = []; + this.$decorations = []; + this.$frontMarkers = {}; + this.$backMarkers = {}; + this.$markerId = 1; + this.$undoSelect = true; + + this.$foldData = []; + this.id = "session" + (++EditSession.$uid); + this.$foldData.toString = function() { + return this.join("\n"); + }; + this.on("changeFold", this.onChangeFold.bind(this)); + this.$onChange = this.onChange.bind(this); + + if (typeof text != "object" || !text.getLine) + text = new Document(text); + + this.setDocument(text); + this.selection = new Selection(this); + + config.resetOptions(this); + this.setMode(mode); + config._signal("session", this); +}; + + +EditSession.$uid = 0; + +(function() { + + oop.implement(this, EventEmitter); + this.setDocument = function(doc) { + if (this.doc) + this.doc.removeListener("change", this.$onChange); + + this.doc = doc; + doc.on("change", this.$onChange); + + if (this.bgTokenizer) + this.bgTokenizer.setDocument(this.getDocument()); + + this.resetCaches(); + }; + this.getDocument = function() { + return this.doc; + }; + this.$resetRowCache = function(docRow) { + if (!docRow) { + this.$docRowCache = []; + this.$screenRowCache = []; + return; + } + var l = this.$docRowCache.length; + var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1; + if (l > i) { + this.$docRowCache.splice(i, l); + this.$screenRowCache.splice(i, l); + } + }; + + this.$getRowCacheIndex = function(cacheArray, val) { + var low = 0; + var hi = cacheArray.length - 1; + + while (low <= hi) { + var mid = (low + hi) >> 1; + var c = cacheArray[mid]; + + if (val > c) + low = mid + 1; + else if (val < c) + hi = mid - 1; + else + return mid; + } + + return low -1; + }; + + this.resetCaches = function() { + this.$modified = true; + this.$wrapData = []; + this.$rowLengthCache = []; + this.$resetRowCache(0); + if (this.bgTokenizer) + this.bgTokenizer.start(0); + }; + + this.onChangeFold = function(e) { + var fold = e.data; + this.$resetRowCache(fold.start.row); + }; + + this.onChange = function(delta) { + this.$modified = true; + + this.$resetRowCache(delta.start.row); + + var removedFolds = this.$updateInternalDataOnChange(delta); + if (!this.$fromUndo && this.$undoManager && !delta.ignore) { + this.$deltasDoc.push(delta); + if (removedFolds && removedFolds.length != 0) { + this.$deltasFold.push({ + action: "removeFolds", + folds: removedFolds + }); + } + + this.$informUndoManager.schedule(); + } + + this.bgTokenizer && this.bgTokenizer.$updateOnChange(delta); + this._signal("change", delta); + }; + this.setValue = function(text) { + this.doc.setValue(text); + this.selection.moveTo(0, 0); + + this.$resetRowCache(0); + this.$deltas = []; + this.$deltasDoc = []; + this.$deltasFold = []; + this.setUndoManager(this.$undoManager); + this.getUndoManager().reset(); + }; + this.getValue = + this.toString = function() { + return this.doc.getValue(); + }; + this.getSelection = function() { + return this.selection; + }; + this.getState = function(row) { + return this.bgTokenizer.getState(row); + }; + this.getTokens = function(row) { + return this.bgTokenizer.getTokens(row); + }; + this.getTokenAt = function(row, column) { + var tokens = this.bgTokenizer.getTokens(row); + var token, c = 0; + if (column == null) { + i = tokens.length - 1; + c = this.getLine(row).length; + } else { + for (var i = 0; i < tokens.length; i++) { + c += tokens[i].value.length; + if (c >= column) + break; + } + } + token = tokens[i]; + if (!token) + return null; + token.index = i; + token.start = c - token.value.length; + return token; + }; + this.setUndoManager = function(undoManager) { + this.$undoManager = undoManager; + this.$deltas = []; + this.$deltasDoc = []; + this.$deltasFold = []; + + if (this.$informUndoManager) + this.$informUndoManager.cancel(); + + if (undoManager) { + var self = this; + + this.$syncInformUndoManager = function() { + self.$informUndoManager.cancel(); + + if (self.$deltasFold.length) { + self.$deltas.push({ + group: "fold", + deltas: self.$deltasFold + }); + self.$deltasFold = []; + } + + if (self.$deltasDoc.length) { + self.$deltas.push({ + group: "doc", + deltas: self.$deltasDoc + }); + self.$deltasDoc = []; + } + + if (self.$deltas.length > 0) { + undoManager.execute({ + action: "aceupdate", + args: [self.$deltas, self], + merge: self.mergeUndoDeltas + }); + } + self.mergeUndoDeltas = false; + self.$deltas = []; + }; + this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); + } + }; + this.markUndoGroup = function() { + if (this.$syncInformUndoManager) + this.$syncInformUndoManager(); + }; + + this.$defaultUndoManager = { + undo: function() {}, + redo: function() {}, + reset: function() {} + }; + this.getUndoManager = function() { + return this.$undoManager || this.$defaultUndoManager; + }; + this.getTabString = function() { + if (this.getUseSoftTabs()) { + return lang.stringRepeat(" ", this.getTabSize()); + } else { + return "\t"; + } + }; + this.setUseSoftTabs = function(val) { + this.setOption("useSoftTabs", val); + }; + this.getUseSoftTabs = function() { + return this.$useSoftTabs && !this.$mode.$indentWithTabs; + }; + this.setTabSize = function(tabSize) { + this.setOption("tabSize", tabSize); + }; + this.getTabSize = function() { + return this.$tabSize; + }; + this.isTabStop = function(position) { + return this.$useSoftTabs && (position.column % this.$tabSize === 0); + }; + this.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) { + this.setOption("navigateWithinSoftTabs", navigateWithinSoftTabs) + } + this.getNavigateWithinSoftTabs = function() { + return this.$navigateWithinSoftTabs; + } + + this.$overwrite = false; + this.setOverwrite = function(overwrite) { + this.setOption("overwrite", overwrite); + }; + this.getOverwrite = function() { + return this.$overwrite; + }; + this.toggleOverwrite = function() { + this.setOverwrite(!this.$overwrite); + }; + this.addGutterDecoration = function(row, className) { + if (!this.$decorations[row]) + this.$decorations[row] = ""; + this.$decorations[row] += " " + className; + this._signal("changeBreakpoint", {}); + }; + this.removeGutterDecoration = function(row, className) { + this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, ""); + this._signal("changeBreakpoint", {}); + }; + this.getBreakpoints = function() { + return this.$breakpoints; + }; + this.setBreakpoints = function(rows) { + this.$breakpoints = []; + for (var i=0; i 0) + inToken = !!line.charAt(column - 1).match(this.tokenRe); + + if (!inToken) + inToken = !!line.charAt(column).match(this.tokenRe); + + if (inToken) + var re = this.tokenRe; + else if (/^\s+$/.test(line.slice(column-1, column+1))) + var re = /\s/; + else + var re = this.nonTokenRe; + + var start = column; + if (start > 0) { + do { + start--; + } + while (start >= 0 && line.charAt(start).match(re)); + start++; + } + + var end = column; + while (end < line.length && line.charAt(end).match(re)) { + end++; + } + + return new Range(row, start, row, end); + }; + this.getAWordRange = function(row, column) { + var wordRange = this.getWordRange(row, column); + var line = this.getLine(wordRange.end.row); + + while (line.charAt(wordRange.end.column).match(/[ \t]/)) { + wordRange.end.column += 1; + } + return wordRange; + }; + this.setNewLineMode = function(newLineMode) { + this.doc.setNewLineMode(newLineMode); + }; + this.getNewLineMode = function() { + return this.doc.getNewLineMode(); + }; + this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); }; + this.getUseWorker = function() { return this.$useWorker; }; + this.onReloadTokenizer = function(e) { + var rows = e.data; + this.bgTokenizer.start(rows.first); + this._signal("tokenizerUpdate", e); + }; + + this.$modes = {}; + this.$mode = null; + this.$modeId = null; + this.setMode = function(mode, cb) { + if (mode && typeof mode === "object") { + if (mode.getTokenizer) + return this.$onChangeMode(mode); + var options = mode; + var path = options.path; + } else { + path = mode || "ace/mode/text"; + } + if (!this.$modes["ace/mode/text"]) + this.$modes["ace/mode/text"] = new TextMode(); + + if (this.$modes[path] && !options) { + this.$onChangeMode(this.$modes[path]); + cb && cb(); + return; + } + this.$modeId = path; + config.loadModule(["mode", path], function(m) { + if (this.$modeId !== path) + return cb && cb(); + if (this.$modes[path] && !options) { + this.$onChangeMode(this.$modes[path]); + } else if (m && m.Mode) { + m = new m.Mode(options); + if (!options) { + this.$modes[path] = m; + m.$id = path; + } + this.$onChangeMode(m); + } + cb && cb(); + }.bind(this)); + if (!this.$mode) + this.$onChangeMode(this.$modes["ace/mode/text"], true); + }; + + this.$onChangeMode = function(mode, $isPlaceholder) { + if (!$isPlaceholder) + this.$modeId = mode.$id; + if (this.$mode === mode) + return; + + this.$mode = mode; + + this.$stopWorker(); + + if (this.$useWorker) + this.$startWorker(); + + var tokenizer = mode.getTokenizer(); + + if(tokenizer.addEventListener !== undefined) { + var onReloadTokenizer = this.onReloadTokenizer.bind(this); + tokenizer.addEventListener("update", onReloadTokenizer); + } + + if (!this.bgTokenizer) { + this.bgTokenizer = new BackgroundTokenizer(tokenizer); + var _self = this; + this.bgTokenizer.addEventListener("update", function(e) { + _self._signal("tokenizerUpdate", e); + }); + } else { + this.bgTokenizer.setTokenizer(tokenizer); + } + + this.bgTokenizer.setDocument(this.getDocument()); + + this.tokenRe = mode.tokenRe; + this.nonTokenRe = mode.nonTokenRe; + + + if (!$isPlaceholder) { + if (mode.attachToSession) + mode.attachToSession(this); + this.$options.wrapMethod.set.call(this, this.$wrapMethod); + this.$setFolding(mode.foldingRules); + this.bgTokenizer.start(0); + this._emit("changeMode"); + } + }; + + this.$stopWorker = function() { + if (this.$worker) { + this.$worker.terminate(); + this.$worker = null; + } + }; + + this.$startWorker = function() { + try { + this.$worker = this.$mode.createWorker(this); + } catch (e) { + config.warn("Could not load worker", e); + this.$worker = null; + } + }; + this.getMode = function() { + return this.$mode; + }; + + this.$scrollTop = 0; + this.setScrollTop = function(scrollTop) { + if (this.$scrollTop === scrollTop || isNaN(scrollTop)) + return; + + this.$scrollTop = scrollTop; + this._signal("changeScrollTop", scrollTop); + }; + this.getScrollTop = function() { + return this.$scrollTop; + }; + + this.$scrollLeft = 0; + this.setScrollLeft = function(scrollLeft) { + if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft)) + return; + + this.$scrollLeft = scrollLeft; + this._signal("changeScrollLeft", scrollLeft); + }; + this.getScrollLeft = function() { + return this.$scrollLeft; + }; + this.getScreenWidth = function() { + this.$computeWidth(); + if (this.lineWidgets) + return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth); + return this.screenWidth; + }; + + this.getLineWidgetMaxWidth = function() { + if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth; + var width = 0; + this.lineWidgets.forEach(function(w) { + if (w && w.screenWidth > width) + width = w.screenWidth; + }); + return this.lineWidgetWidth = width; + }; + + this.$computeWidth = function(force) { + if (this.$modified || force) { + this.$modified = false; + + if (this.$useWrapMode) + return this.screenWidth = this.$wrapLimit; + + var lines = this.doc.getAllLines(); + var cache = this.$rowLengthCache; + var longestScreenLine = 0; + var foldIndex = 0; + var foldLine = this.$foldData[foldIndex]; + var foldStart = foldLine ? foldLine.start.row : Infinity; + var len = lines.length; + + for (var i = 0; i < len; i++) { + if (i > foldStart) { + i = foldLine.end.row + 1; + if (i >= len) + break; + foldLine = this.$foldData[foldIndex++]; + foldStart = foldLine ? foldLine.start.row : Infinity; + } + + if (cache[i] == null) + cache[i] = this.$getStringScreenWidth(lines[i])[0]; + + if (cache[i] > longestScreenLine) + longestScreenLine = cache[i]; + } + this.screenWidth = longestScreenLine; + } + }; + this.getLine = function(row) { + return this.doc.getLine(row); + }; + this.getLines = function(firstRow, lastRow) { + return this.doc.getLines(firstRow, lastRow); + }; + this.getLength = function() { + return this.doc.getLength(); + }; + this.getTextRange = function(range) { + return this.doc.getTextRange(range || this.selection.getRange()); + }; + this.insert = function(position, text) { + return this.doc.insert(position, text); + }; + this.remove = function(range) { + return this.doc.remove(range); + }; + this.removeFullLines = function(firstRow, lastRow){ + return this.doc.removeFullLines(firstRow, lastRow); + }; + this.undoChanges = function(deltas, dontSelect) { + if (!deltas.length) + return; + + this.$fromUndo = true; + var lastUndoRange = null; + for (var i = deltas.length - 1; i != -1; i--) { + var delta = deltas[i]; + if (delta.group == "doc") { + this.doc.revertDeltas(delta.deltas); + lastUndoRange = + this.$getUndoSelection(delta.deltas, true, lastUndoRange); + } else { + delta.deltas.forEach(function(foldDelta) { + this.addFolds(foldDelta.folds); + }, this); + } + } + this.$fromUndo = false; + lastUndoRange && + this.$undoSelect && + !dontSelect && + this.selection.setSelectionRange(lastUndoRange); + return lastUndoRange; + }; + this.redoChanges = function(deltas, dontSelect) { + if (!deltas.length) + return; + + this.$fromUndo = true; + var lastUndoRange = null; + for (var i = 0; i < deltas.length; i++) { + var delta = deltas[i]; + if (delta.group == "doc") { + this.doc.applyDeltas(delta.deltas); + lastUndoRange = + this.$getUndoSelection(delta.deltas, false, lastUndoRange); + } + } + this.$fromUndo = false; + lastUndoRange && + this.$undoSelect && + !dontSelect && + this.selection.setSelectionRange(lastUndoRange); + return lastUndoRange; + }; + this.setUndoSelect = function(enable) { + this.$undoSelect = enable; + }; + + this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { + function isInsert(delta) { + return isUndo ? delta.action !== "insert" : delta.action === "insert"; + } + + var delta = deltas[0]; + var range, point; + var lastDeltaIsInsert = false; + if (isInsert(delta)) { + range = Range.fromPoints(delta.start, delta.end); + lastDeltaIsInsert = true; + } else { + range = Range.fromPoints(delta.start, delta.start); + lastDeltaIsInsert = false; + } + + for (var i = 1; i < deltas.length; i++) { + delta = deltas[i]; + if (isInsert(delta)) { + point = delta.start; + if (range.compare(point.row, point.column) == -1) { + range.setStart(point); + } + point = delta.end; + if (range.compare(point.row, point.column) == 1) { + range.setEnd(point); + } + lastDeltaIsInsert = true; + } else { + point = delta.start; + if (range.compare(point.row, point.column) == -1) { + range = Range.fromPoints(delta.start, delta.start); + } + lastDeltaIsInsert = false; + } + } + if (lastUndoRange != null) { + if (Range.comparePoints(lastUndoRange.start, range.start) === 0) { + lastUndoRange.start.column += range.end.column - range.start.column; + lastUndoRange.end.column += range.end.column - range.start.column; + } + + var cmp = lastUndoRange.compareRange(range); + if (cmp == 1) { + range.setStart(lastUndoRange.start); + } else if (cmp == -1) { + range.setEnd(lastUndoRange.end); + } + } + + return range; + }; + this.replace = function(range, text) { + return this.doc.replace(range, text); + }; + this.moveText = function(fromRange, toPosition, copy) { + var text = this.getTextRange(fromRange); + var folds = this.getFoldsInRange(fromRange); + + var toRange = Range.fromPoints(toPosition, toPosition); + if (!copy) { + this.remove(fromRange); + var rowDiff = fromRange.start.row - fromRange.end.row; + var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column; + if (collDiff) { + if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column) + toRange.start.column += collDiff; + if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column) + toRange.end.column += collDiff; + } + if (rowDiff && toRange.start.row >= fromRange.end.row) { + toRange.start.row += rowDiff; + toRange.end.row += rowDiff; + } + } + + toRange.end = this.insert(toRange.start, text); + if (folds.length) { + var oldStart = fromRange.start; + var newStart = toRange.start; + var rowDiff = newStart.row - oldStart.row; + var collDiff = newStart.column - oldStart.column; + this.addFolds(folds.map(function(x) { + x = x.clone(); + if (x.start.row == oldStart.row) + x.start.column += collDiff; + if (x.end.row == oldStart.row) + x.end.column += collDiff; + x.start.row += rowDiff; + x.end.row += rowDiff; + return x; + })); + } + + return toRange; + }; + this.indentRows = function(startRow, endRow, indentString) { + indentString = indentString.replace(/\t/g, this.getTabString()); + for (var row=startRow; row<=endRow; row++) + this.doc.insertInLine({row: row, column: 0}, indentString); + }; + this.outdentRows = function (range) { + var rowRange = range.collapseRows(); + var deleteRange = new Range(0, 0, 0, 0); + var size = this.getTabSize(); + + for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) { + var line = this.getLine(i); + + deleteRange.start.row = i; + deleteRange.end.row = i; + for (var j = 0; j < size; ++j) + if (line.charAt(j) != ' ') + break; + if (j < size && line.charAt(j) == '\t') { + deleteRange.start.column = j; + deleteRange.end.column = j + 1; + } else { + deleteRange.start.column = 0; + deleteRange.end.column = j; + } + this.remove(deleteRange); + } + }; + + this.$moveLines = function(firstRow, lastRow, dir) { + firstRow = this.getRowFoldStart(firstRow); + lastRow = this.getRowFoldEnd(lastRow); + if (dir < 0) { + var row = this.getRowFoldStart(firstRow + dir); + if (row < 0) return 0; + var diff = row-firstRow; + } else if (dir > 0) { + var row = this.getRowFoldEnd(lastRow + dir); + if (row > this.doc.getLength()-1) return 0; + var diff = row-lastRow; + } else { + firstRow = this.$clipRowToDocument(firstRow); + lastRow = this.$clipRowToDocument(lastRow); + var diff = lastRow - firstRow + 1; + } + + var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE); + var folds = this.getFoldsInRange(range).map(function(x){ + x = x.clone(); + x.start.row += diff; + x.end.row += diff; + return x; + }); + + var lines = dir == 0 + ? this.doc.getLines(firstRow, lastRow) + : this.doc.removeFullLines(firstRow, lastRow); + this.doc.insertFullLines(firstRow+diff, lines); + folds.length && this.addFolds(folds); + return diff; + }; + this.moveLinesUp = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, -1); + }; + this.moveLinesDown = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, 1); + }; + this.duplicateLines = function(firstRow, lastRow) { + return this.$moveLines(firstRow, lastRow, 0); + }; + + + this.$clipRowToDocument = function(row) { + return Math.max(0, Math.min(row, this.doc.getLength()-1)); + }; + + this.$clipColumnToRow = function(row, column) { + if (column < 0) + return 0; + return Math.min(this.doc.getLine(row).length, column); + }; + + + this.$clipPositionToDocument = function(row, column) { + column = Math.max(0, column); + + if (row < 0) { + row = 0; + column = 0; + } else { + var len = this.doc.getLength(); + if (row >= len) { + row = len - 1; + column = this.doc.getLine(len-1).length; + } else { + column = Math.min(this.doc.getLine(row).length, column); + } + } + + return { + row: row, + column: column + }; + }; + + this.$clipRangeToDocument = function(range) { + if (range.start.row < 0) { + range.start.row = 0; + range.start.column = 0; + } else { + range.start.column = this.$clipColumnToRow( + range.start.row, + range.start.column + ); + } + + var len = this.doc.getLength() - 1; + if (range.end.row > len) { + range.end.row = len; + range.end.column = this.doc.getLine(len).length; + } else { + range.end.column = this.$clipColumnToRow( + range.end.row, + range.end.column + ); + } + return range; + }; + this.$wrapLimit = 80; + this.$useWrapMode = false; + this.$wrapLimitRange = { + min : null, + max : null + }; + this.setUseWrapMode = function(useWrapMode) { + if (useWrapMode != this.$useWrapMode) { + this.$useWrapMode = useWrapMode; + this.$modified = true; + this.$resetRowCache(0); + if (useWrapMode) { + var len = this.getLength(); + this.$wrapData = Array(len); + this.$updateWrapData(0, len - 1); + } + + this._signal("changeWrapMode"); + } + }; + this.getUseWrapMode = function() { + return this.$useWrapMode; + }; + this.setWrapLimitRange = function(min, max) { + if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { + this.$wrapLimitRange = { min: min, max: max }; + this.$modified = true; + if (this.$useWrapMode) + this._signal("changeWrapMode"); + } + }; + this.adjustWrapLimit = function(desiredLimit, $printMargin) { + var limits = this.$wrapLimitRange; + if (limits.max < 0) + limits = {min: $printMargin, max: $printMargin}; + var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max); + if (wrapLimit != this.$wrapLimit && wrapLimit > 1) { + this.$wrapLimit = wrapLimit; + this.$modified = true; + if (this.$useWrapMode) { + this.$updateWrapData(0, this.getLength() - 1); + this.$resetRowCache(0); + this._signal("changeWrapLimit"); + } + return true; + } + return false; + }; + + this.$constrainWrapLimit = function(wrapLimit, min, max) { + if (min) + wrapLimit = Math.max(min, wrapLimit); + + if (max) + wrapLimit = Math.min(max, wrapLimit); + + return wrapLimit; + }; + this.getWrapLimit = function() { + return this.$wrapLimit; + }; + this.setWrapLimit = function (limit) { + this.setWrapLimitRange(limit, limit); + }; + this.getWrapLimitRange = function() { + return { + min : this.$wrapLimitRange.min, + max : this.$wrapLimitRange.max + }; + }; + + this.$updateInternalDataOnChange = function(delta) { + var useWrapMode = this.$useWrapMode; + var action = delta.action; + var start = delta.start; + var end = delta.end; + var firstRow = start.row; + var lastRow = end.row; + var len = lastRow - firstRow; + var removedFolds = null; + + this.$updating = true; + if (len != 0) { + if (action === "remove") { + this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len); + + var foldLines = this.$foldData; + removedFolds = this.getFoldsInRange(delta); + this.removeFolds(removedFolds); + + var foldLine = this.getFoldLine(end.row); + var idx = 0; + if (foldLine) { + foldLine.addRemoveChars(end.row, end.column, start.column - end.column); + foldLine.shiftRow(-len); + + var foldLineBefore = this.getFoldLine(firstRow); + if (foldLineBefore && foldLineBefore !== foldLine) { + foldLineBefore.merge(foldLine); + foldLine = foldLineBefore; + } + idx = foldLines.indexOf(foldLine) + 1; + } + + for (idx; idx < foldLines.length; idx++) { + var foldLine = foldLines[idx]; + if (foldLine.start.row >= end.row) { + foldLine.shiftRow(-len); + } + } + + lastRow = firstRow; + } else { + var args = Array(len); + args.unshift(firstRow, 0); + var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache + arr.splice.apply(arr, args); + var foldLines = this.$foldData; + var foldLine = this.getFoldLine(firstRow); + var idx = 0; + if (foldLine) { + var cmp = foldLine.range.compareInside(start.row, start.column); + if (cmp == 0) { + foldLine = foldLine.split(start.row, start.column); + if (foldLine) { + foldLine.shiftRow(len); + foldLine.addRemoveChars(lastRow, 0, end.column - start.column); + } + } else + if (cmp == -1) { + foldLine.addRemoveChars(firstRow, 0, end.column - start.column); + foldLine.shiftRow(len); + } + idx = foldLines.indexOf(foldLine) + 1; + } + + for (idx; idx < foldLines.length; idx++) { + var foldLine = foldLines[idx]; + if (foldLine.start.row >= firstRow) { + foldLine.shiftRow(len); + } + } + } + } else { + len = Math.abs(delta.start.column - delta.end.column); + if (action === "remove") { + removedFolds = this.getFoldsInRange(delta); + this.removeFolds(removedFolds); + + len = -len; + } + var foldLine = this.getFoldLine(firstRow); + if (foldLine) { + foldLine.addRemoveChars(firstRow, start.column, len); + } + } + + if (useWrapMode && this.$wrapData.length != this.doc.getLength()) { + console.error("doc.getLength() and $wrapData.length have to be the same!"); + } + this.$updating = false; + + if (useWrapMode) + this.$updateWrapData(firstRow, lastRow); + else + this.$updateRowLengthCache(firstRow, lastRow); + + return removedFolds; + }; + + this.$updateRowLengthCache = function(firstRow, lastRow, b) { + this.$rowLengthCache[firstRow] = null; + this.$rowLengthCache[lastRow] = null; + }; + + this.$updateWrapData = function(firstRow, lastRow) { + var lines = this.doc.getAllLines(); + var tabSize = this.getTabSize(); + var wrapData = this.$wrapData; + var wrapLimit = this.$wrapLimit; + var tokens; + var foldLine; + + var row = firstRow; + lastRow = Math.min(lastRow, lines.length - 1); + while (row <= lastRow) { + foldLine = this.getFoldLine(row, foldLine); + if (!foldLine) { + tokens = this.$getDisplayTokens(lines[row]); + wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); + row ++; + } else { + tokens = []; + foldLine.walk(function(placeholder, row, column, lastColumn) { + var walkTokens; + if (placeholder != null) { + walkTokens = this.$getDisplayTokens( + placeholder, tokens.length); + walkTokens[0] = PLACEHOLDER_START; + for (var i = 1; i < walkTokens.length; i++) { + walkTokens[i] = PLACEHOLDER_BODY; + } + } else { + walkTokens = this.$getDisplayTokens( + lines[row].substring(lastColumn, column), + tokens.length); + } + tokens = tokens.concat(walkTokens); + }.bind(this), + foldLine.end.row, + lines[foldLine.end.row].length + 1 + ); + + wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); + row = foldLine.end.row + 1; + } + } + }; + var CHAR = 1, + CHAR_EXT = 2, + PLACEHOLDER_START = 3, + PLACEHOLDER_BODY = 4, + PUNCTUATION = 9, + SPACE = 10, + TAB = 11, + TAB_SPACE = 12; + + + this.$computeWrapSplits = function(tokens, wrapLimit, tabSize) { + if (tokens.length == 0) { + return []; + } + + var splits = []; + var displayLength = tokens.length; + var lastSplit = 0, lastDocSplit = 0; + + var isCode = this.$wrapAsCode; + + var indentedSoftWrap = this.$indentedSoftWrap; + var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8) + || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2); + + function getWrapIndent() { + var indentation = 0; + if (maxIndent === 0) + return indentation; + if (indentedSoftWrap) { + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (token == SPACE) + indentation += 1; + else if (token == TAB) + indentation += tabSize; + else if (token == TAB_SPACE) + continue; + else + break; + } + } + if (isCode && indentedSoftWrap !== false) + indentation += tabSize; + return Math.min(indentation, maxIndent); + } + function addSplit(screenPos) { + var displayed = tokens.slice(lastSplit, screenPos); + var len = displayed.length; + displayed.join("") + .replace(/12/g, function() { + len -= 1; + }) + .replace(/2/g, function() { + len -= 1; + }); + + if (!splits.length) { + indent = getWrapIndent(); + splits.indent = indent; + } + lastDocSplit += len; + splits.push(lastDocSplit); + lastSplit = screenPos; + } + var indent = 0; + while (displayLength - lastSplit > wrapLimit - indent) { + var split = lastSplit + wrapLimit - indent; + if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) { + addSplit(split); + continue; + } + if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) { + for (split; split != lastSplit - 1; split--) { + if (tokens[split] == PLACEHOLDER_START) { + break; + } + } + if (split > lastSplit) { + addSplit(split); + continue; + } + split = lastSplit + wrapLimit; + for (split; split < tokens.length; split++) { + if (tokens[split] != PLACEHOLDER_BODY) { + break; + } + } + if (split == tokens.length) { + break; // Breaks the while-loop. + } + addSplit(split); + continue; + } + var minSplit = Math.max(split - (wrapLimit -(wrapLimit>>2)), lastSplit - 1); + while (split > minSplit && tokens[split] < PLACEHOLDER_START) { + split --; + } + if (isCode) { + while (split > minSplit && tokens[split] < PLACEHOLDER_START) { + split --; + } + while (split > minSplit && tokens[split] == PUNCTUATION) { + split --; + } + } else { + while (split > minSplit && tokens[split] < SPACE) { + split --; + } + } + if (split > minSplit) { + addSplit(++split); + continue; + } + split = lastSplit + wrapLimit; + if (tokens[split] == CHAR_EXT) + split--; + addSplit(split - indent); + } + return splits; + }; + this.$getDisplayTokens = function(str, offset) { + var arr = []; + var tabSize; + offset = offset || 0; + + for (var i = 0; i < str.length; i++) { + var c = str.charCodeAt(i); + if (c == 9) { + tabSize = this.getScreenTabSize(arr.length + offset); + arr.push(TAB); + for (var n = 1; n < tabSize; n++) { + arr.push(TAB_SPACE); + } + } + else if (c == 32) { + arr.push(SPACE); + } else if((c > 39 && c < 48) || (c > 57 && c < 64)) { + arr.push(PUNCTUATION); + } + else if (c >= 0x1100 && isFullWidth(c)) { + arr.push(CHAR, CHAR_EXT); + } else { + arr.push(CHAR); + } + } + return arr; + }; + this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { + if (maxScreenColumn == 0) + return [0, 0]; + if (maxScreenColumn == null) + maxScreenColumn = Infinity; + screenColumn = screenColumn || 0; + + var c, column; + for (column = 0; column < str.length; column++) { + c = str.charCodeAt(column); + if (c == 9) { + screenColumn += this.getScreenTabSize(screenColumn); + } + else if (c >= 0x1100 && isFullWidth(c)) { + screenColumn += 2; + } else { + screenColumn += 1; + } + if (screenColumn > maxScreenColumn) { + break; + } + } + + return [screenColumn, column]; + }; + + this.lineWidgets = null; + this.getRowLength = function(row) { + if (this.lineWidgets) + var h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; + else + h = 0 + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1 + h; + } else { + return this.$wrapData[row].length + 1 + h; + } + }; + this.getRowLineCount = function(row) { + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1; + } else { + return this.$wrapData[row].length + 1; + } + }; + + this.getRowWrapIndent = function(screenRow) { + if (this.$useWrapMode) { + var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); + var splits = this.$wrapData[pos.row]; + return splits.length && splits[0] < pos.column ? splits.indent : 0; + } else { + return 0; + } + } + this.getScreenLastRowColumn = function(screenRow) { + var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); + return this.documentToScreenColumn(pos.row, pos.column); + }; + this.getDocumentLastRowColumn = function(docRow, docColumn) { + var screenRow = this.documentToScreenRow(docRow, docColumn); + return this.getScreenLastRowColumn(screenRow); + }; + this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { + var screenRow = this.documentToScreenRow(docRow, docColumn); + return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); + }; + this.getRowSplitData = function(row) { + if (!this.$useWrapMode) { + return undefined; + } else { + return this.$wrapData[row]; + } + }; + this.getScreenTabSize = function(screenColumn) { + return this.$tabSize - screenColumn % this.$tabSize; + }; + + + this.screenToDocumentRow = function(screenRow, screenColumn) { + return this.screenToDocumentPosition(screenRow, screenColumn).row; + }; + + + this.screenToDocumentColumn = function(screenRow, screenColumn) { + return this.screenToDocumentPosition(screenRow, screenColumn).column; + }; + this.screenToDocumentPosition = function(screenRow, screenColumn) { + if (screenRow < 0) + return {row: 0, column: 0}; + + var line; + var docRow = 0; + var docColumn = 0; + var column; + var row = 0; + var rowLength = 0; + + var rowCache = this.$screenRowCache; + var i = this.$getRowCacheIndex(rowCache, screenRow); + var l = rowCache.length; + if (l && i >= 0) { + var row = rowCache[i]; + var docRow = this.$docRowCache[i]; + var doCache = screenRow > rowCache[l - 1]; + } else { + var doCache = !l; + } + + var maxRow = this.getLength() - 1; + var foldLine = this.getNextFoldLine(docRow); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (row <= screenRow) { + rowLength = this.getRowLength(docRow); + if (row + rowLength > screenRow || docRow >= maxRow) { + break; + } else { + row += rowLength; + docRow++; + if (docRow > foldStart) { + docRow = foldLine.end.row+1; + foldLine = this.getNextFoldLine(docRow, foldLine); + foldStart = foldLine ? foldLine.start.row : Infinity; + } + } + + if (doCache) { + this.$docRowCache.push(docRow); + this.$screenRowCache.push(row); + } + } + + if (foldLine && foldLine.start.row <= docRow) { + line = this.getFoldDisplayLine(foldLine); + docRow = foldLine.start.row; + } else if (row + rowLength <= screenRow || docRow > maxRow) { + return { + row: maxRow, + column: this.getLine(maxRow).length + }; + } else { + line = this.getLine(docRow); + foldLine = null; + } + var wrapIndent = 0; + if (this.$useWrapMode) { + var splits = this.$wrapData[docRow]; + if (splits) { + var splitIndex = Math.floor(screenRow - row); + column = splits[splitIndex]; + if(splitIndex > 0 && splits.length) { + wrapIndent = splits.indent; + docColumn = splits[splitIndex - 1] || splits[splits.length - 1]; + line = line.substring(docColumn); + } + } + } + + docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1]; + if (this.$useWrapMode && docColumn >= column) + docColumn = column - 1; + + if (foldLine) + return foldLine.idxToPosition(docColumn); + + return {row: docRow, column: docColumn}; + }; + this.documentToScreenPosition = function(docRow, docColumn) { + if (typeof docColumn === "undefined") + var pos = this.$clipPositionToDocument(docRow.row, docRow.column); + else + pos = this.$clipPositionToDocument(docRow, docColumn); + + docRow = pos.row; + docColumn = pos.column; + + var screenRow = 0; + var foldStartRow = null; + var fold = null; + fold = this.getFoldAt(docRow, docColumn, 1); + if (fold) { + docRow = fold.start.row; + docColumn = fold.start.column; + } + + var rowEnd, row = 0; + + + var rowCache = this.$docRowCache; + var i = this.$getRowCacheIndex(rowCache, docRow); + var l = rowCache.length; + if (l && i >= 0) { + var row = rowCache[i]; + var screenRow = this.$screenRowCache[i]; + var doCache = docRow > rowCache[l - 1]; + } else { + var doCache = !l; + } + + var foldLine = this.getNextFoldLine(row); + var foldStart = foldLine ?foldLine.start.row :Infinity; + + while (row < docRow) { + if (row >= foldStart) { + rowEnd = foldLine.end.row + 1; + if (rowEnd > docRow) + break; + foldLine = this.getNextFoldLine(rowEnd, foldLine); + foldStart = foldLine ?foldLine.start.row :Infinity; + } + else { + rowEnd = row + 1; + } + + screenRow += this.getRowLength(row); + row = rowEnd; + + if (doCache) { + this.$docRowCache.push(row); + this.$screenRowCache.push(screenRow); + } + } + var textLine = ""; + if (foldLine && row >= foldStart) { + textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn); + foldStartRow = foldLine.start.row; + } else { + textLine = this.getLine(docRow).substring(0, docColumn); + foldStartRow = docRow; + } + var wrapIndent = 0; + if (this.$useWrapMode) { + var wrapRow = this.$wrapData[foldStartRow]; + if (wrapRow) { + var screenRowOffset = 0; + while (textLine.length >= wrapRow[screenRowOffset]) { + screenRow ++; + screenRowOffset++; + } + textLine = textLine.substring( + wrapRow[screenRowOffset - 1] || 0, textLine.length + ); + wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0; + } + } + + return { + row: screenRow, + column: wrapIndent + this.$getStringScreenWidth(textLine)[0] + }; + }; + this.documentToScreenColumn = function(row, docColumn) { + return this.documentToScreenPosition(row, docColumn).column; + }; + this.documentToScreenRow = function(docRow, docColumn) { + return this.documentToScreenPosition(docRow, docColumn).row; + }; + this.getScreenLength = function() { + var screenRows = 0; + var fold = null; + if (!this.$useWrapMode) { + screenRows = this.getLength(); + var foldData = this.$foldData; + for (var i = 0; i < foldData.length; i++) { + fold = foldData[i]; + screenRows -= fold.end.row - fold.start.row; + } + } else { + var lastRow = this.$wrapData.length; + var row = 0, i = 0; + var fold = this.$foldData[i++]; + var foldStart = fold ? fold.start.row :Infinity; + + while (row < lastRow) { + var splits = this.$wrapData[row]; + screenRows += splits ? splits.length + 1 : 1; + row ++; + if (row > foldStart) { + row = fold.end.row+1; + fold = this.$foldData[i++]; + foldStart = fold ?fold.start.row :Infinity; + } + } + } + if (this.lineWidgets) + screenRows += this.$getWidgetScreenLength(); + + return screenRows; + }; + this.$setFontMetrics = function(fm) { + if (!this.$enableVarChar) return; + this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { + if (maxScreenColumn === 0) + return [0, 0]; + if (!maxScreenColumn) + maxScreenColumn = Infinity; + screenColumn = screenColumn || 0; + + var c, column; + for (column = 0; column < str.length; column++) { + c = str.charAt(column); + if (c === "\t") { + screenColumn += this.getScreenTabSize(screenColumn); + } else { + screenColumn += fm.getCharacterWidth(c); + } + if (screenColumn > maxScreenColumn) { + break; + } + } + + return [screenColumn, column]; + }; + }; + + this.destroy = function() { + if (this.bgTokenizer) { + this.bgTokenizer.setDocument(null); + this.bgTokenizer = null; + } + this.$stopWorker(); + }; + function isFullWidth(c) { + if (c < 0x1100) + return false; + return c >= 0x1100 && c <= 0x115F || + c >= 0x11A3 && c <= 0x11A7 || + c >= 0x11FA && c <= 0x11FF || + c >= 0x2329 && c <= 0x232A || + c >= 0x2E80 && c <= 0x2E99 || + c >= 0x2E9B && c <= 0x2EF3 || + c >= 0x2F00 && c <= 0x2FD5 || + c >= 0x2FF0 && c <= 0x2FFB || + c >= 0x3000 && c <= 0x303E || + c >= 0x3041 && c <= 0x3096 || + c >= 0x3099 && c <= 0x30FF || + c >= 0x3105 && c <= 0x312D || + c >= 0x3131 && c <= 0x318E || + c >= 0x3190 && c <= 0x31BA || + c >= 0x31C0 && c <= 0x31E3 || + c >= 0x31F0 && c <= 0x321E || + c >= 0x3220 && c <= 0x3247 || + c >= 0x3250 && c <= 0x32FE || + c >= 0x3300 && c <= 0x4DBF || + c >= 0x4E00 && c <= 0xA48C || + c >= 0xA490 && c <= 0xA4C6 || + c >= 0xA960 && c <= 0xA97C || + c >= 0xAC00 && c <= 0xD7A3 || + c >= 0xD7B0 && c <= 0xD7C6 || + c >= 0xD7CB && c <= 0xD7FB || + c >= 0xF900 && c <= 0xFAFF || + c >= 0xFE10 && c <= 0xFE19 || + c >= 0xFE30 && c <= 0xFE52 || + c >= 0xFE54 && c <= 0xFE66 || + c >= 0xFE68 && c <= 0xFE6B || + c >= 0xFF01 && c <= 0xFF60 || + c >= 0xFFE0 && c <= 0xFFE6; + } + +}).call(EditSession.prototype); + +require("./edit_session/folding").Folding.call(EditSession.prototype); +require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype); + + +config.defineOptions(EditSession.prototype, "session", { + wrap: { + set: function(value) { + if (!value || value == "off") + value = false; + else if (value == "free") + value = true; + else if (value == "printMargin") + value = -1; + else if (typeof value == "string") + value = parseInt(value, 10) || false; + + if (this.$wrap == value) + return; + this.$wrap = value; + if (!value) { + this.setUseWrapMode(false); + } else { + var col = typeof value == "number" ? value : null; + this.setWrapLimitRange(col, col); + this.setUseWrapMode(true); + } + }, + get: function() { + if (this.getUseWrapMode()) { + if (this.$wrap == -1) + return "printMargin"; + if (!this.getWrapLimitRange().min) + return "free"; + return this.$wrap; + } + return "off"; + }, + handlesSet: true + }, + wrapMethod: { + set: function(val) { + val = val == "auto" + ? this.$mode.type != "text" + : val != "text"; + if (val != this.$wrapAsCode) { + this.$wrapAsCode = val; + if (this.$useWrapMode) { + this.$modified = true; + this.$resetRowCache(0); + this.$updateWrapData(0, this.getLength() - 1); + } + } + }, + initialValue: "auto" + }, + indentedSoftWrap: { initialValue: true }, + firstLineNumber: { + set: function() {this._signal("changeBreakpoint");}, + initialValue: 1 + }, + useWorker: { + set: function(useWorker) { + this.$useWorker = useWorker; + + this.$stopWorker(); + if (useWorker) + this.$startWorker(); + }, + initialValue: true + }, + useSoftTabs: {initialValue: true}, + tabSize: { + set: function(tabSize) { + if (isNaN(tabSize) || this.$tabSize === tabSize) return; + + this.$modified = true; + this.$rowLengthCache = []; + this.$tabSize = tabSize; + this._signal("changeTabSize"); + }, + initialValue: 4, + handlesSet: true + }, + navigateWithinSoftTabs: {initialValue: false}, + overwrite: { + set: function(val) {this._signal("changeOverwrite");}, + initialValue: false + }, + newLineMode: { + set: function(val) {this.doc.setNewLineMode(val)}, + get: function() {return this.doc.getNewLineMode()}, + handlesSet: true + }, + mode: { + set: function(val) { this.setMode(val) }, + get: function() { return this.$modeId } + } +}); + +exports.EditSession = EditSession; +}); + +ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(require, exports, module) { +"use strict"; + +var lang = require("./lib/lang"); +var oop = require("./lib/oop"); +var Range = require("./range").Range; + +var Search = function() { + this.$options = {}; +}; + +(function() { + this.set = function(options) { + oop.mixin(this.$options, options); + return this; + }; + this.getOptions = function() { + return lang.copyObject(this.$options); + }; + this.setOptions = function(options) { + this.$options = options; + }; + this.find = function(session) { + var options = this.$options; + var iterator = this.$matchIterator(session, options); + if (!iterator) + return false; + + var firstRange = null; + iterator.forEach(function(sr, sc, er, ec) { + firstRange = new Range(sr, sc, er, ec); + if (sc == ec && options.start && options.start.start + && options.skipCurrent != false && firstRange.isEqual(options.start) + ) { + firstRange = null; + return false; + } + + return true; + }); + + return firstRange; + }; + this.findAll = function(session) { + var options = this.$options; + if (!options.needle) + return []; + this.$assembleRegExp(options); + + var range = options.range; + var lines = range + ? session.getLines(range.start.row, range.end.row) + : session.doc.getAllLines(); + + var ranges = []; + var re = options.re; + if (options.$isMultiLine) { + var len = re.length; + var maxRow = lines.length - len; + var prevRange; + outer: for (var row = re.offset || 0; row <= maxRow; row++) { + for (var j = 0; j < len; j++) + if (lines[row + j].search(re[j]) == -1) + continue outer; + + var startLine = lines[row]; + var line = lines[row + len - 1]; + var startIndex = startLine.length - startLine.match(re[0])[0].length; + var endIndex = line.match(re[len - 1])[0].length; + + if (prevRange && prevRange.end.row === row && + prevRange.end.column > startIndex + ) { + continue; + } + ranges.push(prevRange = new Range( + row, startIndex, row + len - 1, endIndex + )); + if (len > 2) + row = row + len - 2; + } + } else { + for (var i = 0; i < lines.length; i++) { + var matches = lang.getMatchOffsets(lines[i], re); + for (var j = 0; j < matches.length; j++) { + var match = matches[j]; + ranges.push(new Range(i, match.offset, i, match.offset + match.length)); + } + } + } + + if (range) { + var startColumn = range.start.column; + var endColumn = range.start.column; + var i = 0, j = ranges.length - 1; + while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == range.start.row) + i++; + + while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == range.end.row) + j--; + + ranges = ranges.slice(i, j + 1); + for (i = 0, j = ranges.length; i < j; i++) { + ranges[i].start.row += range.start.row; + ranges[i].end.row += range.start.row; + } + } + + return ranges; + }; + this.replace = function(input, replacement) { + var options = this.$options; + + var re = this.$assembleRegExp(options); + if (options.$isMultiLine) + return replacement; + + if (!re) + return; + + var match = re.exec(input); + if (!match || match[0].length != input.length) + return null; + + replacement = input.replace(re, replacement); + if (options.preserveCase) { + replacement = replacement.split(""); + for (var i = Math.min(input.length, input.length); i--; ) { + var ch = input[i]; + if (ch && ch.toLowerCase() != ch) + replacement[i] = replacement[i].toUpperCase(); + else + replacement[i] = replacement[i].toLowerCase(); + } + replacement = replacement.join(""); + } + + return replacement; + }; + + this.$assembleRegExp = function(options, $disableFakeMultiline) { + if (options.needle instanceof RegExp) + return options.re = options.needle; + + var needle = options.needle; + + if (!options.needle) + return options.re = false; + + if (!options.regExp) + needle = lang.escapeRegExp(needle); + + if (options.wholeWord) + needle = addWordBoundary(needle, options); + + var modifier = options.caseSensitive ? "gm" : "gmi"; + + options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle); + if (options.$isMultiLine) + return options.re = this.$assembleMultilineRegExp(needle, modifier); + + try { + var re = new RegExp(needle, modifier); + } catch(e) { + re = false; + } + return options.re = re; + }; + + this.$assembleMultilineRegExp = function(needle, modifier) { + var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n"); + var re = []; + for (var i = 0; i < parts.length; i++) try { + re.push(new RegExp(parts[i], modifier)); + } catch(e) { + return false; + } + return re; + }; + + this.$matchIterator = function(session, options) { + var re = this.$assembleRegExp(options); + if (!re) + return false; + var backwards = options.backwards == true; + var skipCurrent = options.skipCurrent != false; + + var range = options.range; + var start = options.start; + if (!start) + start = range ? range[backwards ? "end" : "start"] : session.selection.getRange(); + + if (start.start) + start = start[skipCurrent != backwards ? "end" : "start"]; + + var firstRow = range ? range.start.row : 0; + var lastRow = range ? range.end.row : session.getLength() - 1; + + if (backwards) { + var forEach = function(callback) { + var row = start.row; + if (forEachInLine(row, start.column, callback)) + return; + for (row--; row >= firstRow; row--) + if (forEachInLine(row, Number.MAX_VALUE, callback)) + return; + if (options.wrap == false) + return; + for (row = lastRow, firstRow = start.row; row >= firstRow; row--) + if (forEachInLine(row, Number.MAX_VALUE, callback)) + return; + }; + } + else { + var forEach = function(callback) { + var row = start.row; + if (forEachInLine(row, start.column, callback)) + return; + for (row = row + 1; row <= lastRow; row++) + if (forEachInLine(row, 0, callback)) + return; + if (options.wrap == false) + return; + for (row = firstRow, lastRow = start.row; row <= lastRow; row++) + if (forEachInLine(row, 0, callback)) + return; + }; + } + + if (options.$isMultiLine) { + var len = re.length; + var forEachInLine = function(row, offset, callback) { + var startRow = backwards ? row - len + 1 : row; + if (startRow < 0) return; + var line = session.getLine(startRow); + var startIndex = line.search(re[0]) + if (!backwards && startIndex < offset || startIndex === -1) return; + for (var i = 1; i < len; i++) { + line = session.getLine(startRow + i); + if (line.search(re[i]) == -1) + return; + } + var endIndex = line.match(re[len - 1])[0].length; + if (backwards && endIndex > offset) return; + if (callback(startRow, startIndex, startRow + len - 1, endIndex)) + return true; + }; + } + else if (backwards) { + var forEachInLine = function(row, endIndex, callback) { + var line = session.getLine(row); + var matches = []; + var m, last = 0; + re.lastIndex = 0; + while((m = re.exec(line))) { + var length = m[0].length; + last = m.index; + if (!length) { + if (last >= line.length) break; + re.lastIndex = last += 1; + } + if (m.index + length > endIndex) + break; + matches.push(m.index, length) + } + for (var i = matches.length - 1; i >= 0; i -= 2) { + var column = matches[i - 1]; + var length = matches[i]; + if (callback(row, column, row, column + length)) + return true; + } + }; + } + else { + var forEachInLine = function(row, startIndex, callback) { + var line = session.getLine(row); + var m; + var last = startIndex; + re.lastIndex = startIndex; + while((m = re.exec(line))) { + var length = m[0].length; + last = m.index; + if (callback(row, last, row,last + length)) + return true; + if (!length) { + re.lastIndex = last += 1; + if (last >= line.length) return false; + } + } + }; + } + return {forEach: forEach}; + }; + +}).call(Search.prototype); + +function addWordBoundary(needle, options) { + function wordBoundary(c) { + if (/\w/.test(c) || options.regExp) return "\\b"; + return ""; + } + return wordBoundary(needle[0]) + needle + + wordBoundary(needle[needle.length - 1]); +} + +exports.Search = Search; +}); + +ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module) { +"use strict"; + +var keyUtil = require("../lib/keys"); +var useragent = require("../lib/useragent"); +var KEY_MODS = keyUtil.KEY_MODS; + +function HashHandler(config, platform) { + this.platform = platform || (useragent.isMac ? "mac" : "win"); + this.commands = {}; + this.commandKeyBinding = {}; + this.addCommands(config); + this.$singleCommand = true; +} + +function MultiHashHandler(config, platform) { + HashHandler.call(this, config, platform); + this.$singleCommand = false; +} + +MultiHashHandler.prototype = HashHandler.prototype; + +(function() { + + + this.addCommand = function(command) { + if (this.commands[command.name]) + this.removeCommand(command); + + this.commands[command.name] = command; + + if (command.bindKey) + this._buildKeyHash(command); + }; + + this.removeCommand = function(command, keepCommand) { + var name = command && (typeof command === 'string' ? command : command.name); + command = this.commands[name]; + if (!keepCommand) + delete this.commands[name]; + var ckb = this.commandKeyBinding; + for (var keyId in ckb) { + var cmdGroup = ckb[keyId]; + if (cmdGroup == command) { + delete ckb[keyId]; + } else if (Array.isArray(cmdGroup)) { + var i = cmdGroup.indexOf(command); + if (i != -1) { + cmdGroup.splice(i, 1); + if (cmdGroup.length == 1) + ckb[keyId] = cmdGroup[0]; + } + } + } + }; + + this.bindKey = function(key, command, position) { + if (typeof key == "object" && key) { + if (position == undefined) + position = key.position; + key = key[this.platform]; + } + if (!key) + return; + if (typeof command == "function") + return this.addCommand({exec: command, bindKey: key, name: command.name || key}); + + key.split("|").forEach(function(keyPart) { + var chain = ""; + if (keyPart.indexOf(" ") != -1) { + var parts = keyPart.split(/\s+/); + keyPart = parts.pop(); + parts.forEach(function(keyPart) { + var binding = this.parseKeys(keyPart); + var id = KEY_MODS[binding.hashId] + binding.key; + chain += (chain ? " " : "") + id; + this._addCommandToBinding(chain, "chainKeys"); + }, this); + chain += " "; + } + var binding = this.parseKeys(keyPart); + var id = KEY_MODS[binding.hashId] + binding.key; + this._addCommandToBinding(chain + id, command, position); + }, this); + }; + + function getPosition(command) { + return typeof command == "object" && command.bindKey + && command.bindKey.position + || (command.isDefault ? -100 : 0); + } + this._addCommandToBinding = function(keyId, command, position) { + var ckb = this.commandKeyBinding, i; + if (!command) { + delete ckb[keyId]; + } else if (!ckb[keyId] || this.$singleCommand) { + ckb[keyId] = command; + } else { + if (!Array.isArray(ckb[keyId])) { + ckb[keyId] = [ckb[keyId]]; + } else if ((i = ckb[keyId].indexOf(command)) != -1) { + ckb[keyId].splice(i, 1); + } + + if (typeof position != "number") { + position = getPosition(command); + } + + var commands = ckb[keyId]; + for (i = 0; i < commands.length; i++) { + var other = commands[i]; + var otherPos = getPosition(other); + if (otherPos > position) + break; + } + commands.splice(i, 0, command); + } + }; + + this.addCommands = function(commands) { + commands && Object.keys(commands).forEach(function(name) { + var command = commands[name]; + if (!command) + return; + + if (typeof command === "string") + return this.bindKey(command, name); + + if (typeof command === "function") + command = { exec: command }; + + if (typeof command !== "object") + return; + + if (!command.name) + command.name = name; + + this.addCommand(command); + }, this); + }; + + this.removeCommands = function(commands) { + Object.keys(commands).forEach(function(name) { + this.removeCommand(commands[name]); + }, this); + }; + + this.bindKeys = function(keyList) { + Object.keys(keyList).forEach(function(key) { + this.bindKey(key, keyList[key]); + }, this); + }; + + this._buildKeyHash = function(command) { + this.bindKey(command.bindKey, command); + }; + this.parseKeys = function(keys) { + var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x}); + var key = parts.pop(); + + var keyCode = keyUtil[key]; + if (keyUtil.FUNCTION_KEYS[keyCode]) + key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase(); + else if (!parts.length) + return {key: key, hashId: -1}; + else if (parts.length == 1 && parts[0] == "shift") + return {key: key.toUpperCase(), hashId: -1}; + + var hashId = 0; + for (var i = parts.length; i--;) { + var modifier = keyUtil.KEY_MODS[parts[i]]; + if (modifier == null) { + if (typeof console != "undefined") + console.error("invalid modifier " + parts[i] + " in " + keys); + return false; + } + hashId |= modifier; + } + return {key: key, hashId: hashId}; + }; + + this.findKeyCommand = function findKeyCommand(hashId, keyString) { + var key = KEY_MODS[hashId] + keyString; + return this.commandKeyBinding[key]; + }; + + this.handleKeyboard = function(data, hashId, keyString, keyCode) { + if (keyCode < 0) return; + var key = KEY_MODS[hashId] + keyString; + var command = this.commandKeyBinding[key]; + if (data.$keyChain) { + data.$keyChain += " " + key; + command = this.commandKeyBinding[data.$keyChain] || command; + } + + if (command) { + if (command == "chainKeys" || command[command.length - 1] == "chainKeys") { + data.$keyChain = data.$keyChain || key; + return {command: "null"}; + } + } + + if (data.$keyChain) { + if ((!hashId || hashId == 4) && keyString.length == 1) + data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input + else if (hashId == -1 || keyCode > 0) + data.$keyChain = ""; // reset keyChain + } + return {command: command}; + }; + + this.getStatusText = function(editor, data) { + return data.$keyChain || ""; + }; + +}).call(HashHandler.prototype); + +exports.HashHandler = HashHandler; +exports.MultiHashHandler = MultiHashHandler; +}); + +ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var MultiHashHandler = require("../keyboard/hash_handler").MultiHashHandler; +var EventEmitter = require("../lib/event_emitter").EventEmitter; + +var CommandManager = function(platform, commands) { + MultiHashHandler.call(this, commands, platform); + this.byName = this.commands; + this.setDefaultHandler("exec", function(e) { + return e.command.exec(e.editor, e.args || {}); + }); +}; + +oop.inherits(CommandManager, MultiHashHandler); + +(function() { + + oop.implement(this, EventEmitter); + + this.exec = function(command, editor, args) { + if (Array.isArray(command)) { + for (var i = command.length; i--; ) { + if (this.exec(command[i], editor, args)) return true; + } + return false; + } + + if (typeof command === "string") + command = this.commands[command]; + + if (!command) + return false; + + if (editor && editor.$readOnly && !command.readOnly) + return false; + + if (command.isAvailable && !command.isAvailable(editor)) + return false; + + var e = {editor: editor, command: command, args: args}; + e.returnValue = this._emit("exec", e); + this._signal("afterExec", e); + + return e.returnValue === false ? false : true; + }; + + this.toggleRecording = function(editor) { + if (this.$inReplay) + return; + + editor && editor._emit("changeStatus"); + if (this.recording) { + this.macro.pop(); + this.removeEventListener("exec", this.$addCommandToMacro); + + if (!this.macro.length) + this.macro = this.oldMacro; + + return this.recording = false; + } + if (!this.$addCommandToMacro) { + this.$addCommandToMacro = function(e) { + this.macro.push([e.command, e.args]); + }.bind(this); + } + + this.oldMacro = this.macro; + this.macro = []; + this.on("exec", this.$addCommandToMacro); + return this.recording = true; + }; + + this.replay = function(editor) { + if (this.$inReplay || !this.macro) + return; + + if (this.recording) + return this.toggleRecording(editor); + + try { + this.$inReplay = true; + this.macro.forEach(function(x) { + if (typeof x == "string") + this.exec(x, editor); + else + this.exec(x[0], editor, x[1]); + }, this); + } finally { + this.$inReplay = false; + } + }; + + this.trimMacro = function(m) { + return m.map(function(x){ + if (typeof x[0] != "string") + x[0] = x[0].name; + if (!x[1]) + x = x[0]; + return x; + }); + }; + +}).call(CommandManager.prototype); + +exports.CommandManager = CommandManager; + +}); + +ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"], function(require, exports, module) { +"use strict"; + +var lang = require("../lib/lang"); +var config = require("../config"); +var Range = require("../range").Range; + +function bindKey(win, mac) { + return {win: win, mac: mac}; +} +exports.commands = [{ + name: "showSettingsMenu", + bindKey: bindKey("Ctrl-,", "Command-,"), + exec: function(editor) { + config.loadModule("ace/ext/settings_menu", function(module) { + module.init(editor); + editor.showSettingsMenu(); + }); + }, + readOnly: true +}, { + name: "goToNextError", + bindKey: bindKey("Alt-E", "F4"), + exec: function(editor) { + config.loadModule("ace/ext/error_marker", function(module) { + module.showErrorMarker(editor, 1); + }); + }, + scrollIntoView: "animate", + readOnly: true +}, { + name: "goToPreviousError", + bindKey: bindKey("Alt-Shift-E", "Shift-F4"), + exec: function(editor) { + config.loadModule("ace/ext/error_marker", function(module) { + module.showErrorMarker(editor, -1); + }); + }, + scrollIntoView: "animate", + readOnly: true +}, { + name: "selectall", + bindKey: bindKey("Ctrl-A", "Command-A"), + exec: function(editor) { editor.selectAll(); }, + readOnly: true +}, { + name: "centerselection", + bindKey: bindKey(null, "Ctrl-L"), + exec: function(editor) { editor.centerSelection(); }, + readOnly: true +}, { + name: "gotoline", + bindKey: bindKey("Ctrl-L", "Command-L"), + exec: function(editor) { + var line = parseInt(prompt("Enter line number:"), 10); + if (!isNaN(line)) { + editor.gotoLine(line); + } + }, + readOnly: true +}, { + name: "fold", + bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), + exec: function(editor) { editor.session.toggleFold(false); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true +}, { + name: "unfold", + bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"), + exec: function(editor) { editor.session.toggleFold(true); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true +}, { + name: "toggleFoldWidget", + bindKey: bindKey("F2", "F2"), + exec: function(editor) { editor.session.toggleFoldWidget(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true +}, { + name: "toggleParentFoldWidget", + bindKey: bindKey("Alt-F2", "Alt-F2"), + exec: function(editor) { editor.session.toggleFoldWidget(true); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true +}, { + name: "foldall", + bindKey: bindKey(null, "Ctrl-Command-Option-0"), + exec: function(editor) { editor.session.foldAll(); }, + scrollIntoView: "center", + readOnly: true +}, { + name: "foldOther", + bindKey: bindKey("Alt-0", "Command-Option-0"), + exec: function(editor) { + editor.session.foldAll(); + editor.session.unfold(editor.selection.getAllRanges()); + }, + scrollIntoView: "center", + readOnly: true +}, { + name: "unfoldall", + bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"), + exec: function(editor) { editor.session.unfold(); }, + scrollIntoView: "center", + readOnly: true +}, { + name: "findnext", + bindKey: bindKey("Ctrl-K", "Command-G"), + exec: function(editor) { editor.findNext(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true +}, { + name: "findprevious", + bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), + exec: function(editor) { editor.findPrevious(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true +}, { + name: "selectOrFindNext", + bindKey: bindKey("Alt-K", "Ctrl-G"), + exec: function(editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findNext(); + }, + readOnly: true +}, { + name: "selectOrFindPrevious", + bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), + exec: function(editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findPrevious(); + }, + readOnly: true +}, { + name: "find", + bindKey: bindKey("Ctrl-F", "Command-F"), + exec: function(editor) { + config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor)}); + }, + readOnly: true +}, { + name: "overwrite", + bindKey: "Insert", + exec: function(editor) { editor.toggleOverwrite(); }, + readOnly: true +}, { + name: "selecttostart", + bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"), + exec: function(editor) { editor.getSelection().selectFileStart(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" +}, { + name: "gotostart", + bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"), + exec: function(editor) { editor.navigateFileStart(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" +}, { + name: "selectup", + bindKey: bindKey("Shift-Up", "Shift-Up|Ctrl-Shift-P"), + exec: function(editor) { editor.getSelection().selectUp(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "golineup", + bindKey: bindKey("Up", "Up|Ctrl-P"), + exec: function(editor, args) { editor.navigateUp(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selecttoend", + bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"), + exec: function(editor) { editor.getSelection().selectFileEnd(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" +}, { + name: "gotoend", + bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"), + exec: function(editor) { editor.navigateFileEnd(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" +}, { + name: "selectdown", + bindKey: bindKey("Shift-Down", "Shift-Down|Ctrl-Shift-N"), + exec: function(editor) { editor.getSelection().selectDown(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "golinedown", + bindKey: bindKey("Down", "Down|Ctrl-N"), + exec: function(editor, args) { editor.navigateDown(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectwordleft", + bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), + exec: function(editor) { editor.getSelection().selectWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotowordleft", + bindKey: bindKey("Ctrl-Left", "Option-Left"), + exec: function(editor) { editor.navigateWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selecttolinestart", + bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"), + exec: function(editor) { editor.getSelection().selectLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotolinestart", + bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), + exec: function(editor) { editor.navigateLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectleft", + bindKey: bindKey("Shift-Left", "Shift-Left|Ctrl-Shift-B"), + exec: function(editor) { editor.getSelection().selectLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotoleft", + bindKey: bindKey("Left", "Left|Ctrl-B"), + exec: function(editor, args) { editor.navigateLeft(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectwordright", + bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), + exec: function(editor) { editor.getSelection().selectWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotowordright", + bindKey: bindKey("Ctrl-Right", "Option-Right"), + exec: function(editor) { editor.navigateWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selecttolineend", + bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"), + exec: function(editor) { editor.getSelection().selectLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotolineend", + bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), + exec: function(editor) { editor.navigateLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectright", + bindKey: bindKey("Shift-Right", "Shift-Right"), + exec: function(editor) { editor.getSelection().selectRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "gotoright", + bindKey: bindKey("Right", "Right|Ctrl-F"), + exec: function(editor, args) { editor.navigateRight(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectpagedown", + bindKey: "Shift-PageDown", + exec: function(editor) { editor.selectPageDown(); }, + readOnly: true +}, { + name: "pagedown", + bindKey: bindKey(null, "Option-PageDown"), + exec: function(editor) { editor.scrollPageDown(); }, + readOnly: true +}, { + name: "gotopagedown", + bindKey: bindKey("PageDown", "PageDown|Ctrl-V"), + exec: function(editor) { editor.gotoPageDown(); }, + readOnly: true +}, { + name: "selectpageup", + bindKey: "Shift-PageUp", + exec: function(editor) { editor.selectPageUp(); }, + readOnly: true +}, { + name: "pageup", + bindKey: bindKey(null, "Option-PageUp"), + exec: function(editor) { editor.scrollPageUp(); }, + readOnly: true +}, { + name: "gotopageup", + bindKey: "PageUp", + exec: function(editor) { editor.gotoPageUp(); }, + readOnly: true +}, { + name: "scrollup", + bindKey: bindKey("Ctrl-Up", null), + exec: function(e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); }, + readOnly: true +}, { + name: "scrolldown", + bindKey: bindKey("Ctrl-Down", null), + exec: function(e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); }, + readOnly: true +}, { + name: "selectlinestart", + bindKey: "Shift-Home", + exec: function(editor) { editor.getSelection().selectLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectlineend", + bindKey: "Shift-End", + exec: function(editor) { editor.getSelection().selectLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "togglerecording", + bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"), + exec: function(editor) { editor.commands.toggleRecording(editor); }, + readOnly: true +}, { + name: "replaymacro", + bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"), + exec: function(editor) { editor.commands.replay(editor); }, + readOnly: true +}, { + name: "jumptomatching", + bindKey: bindKey("Ctrl-P", "Ctrl-P"), + exec: function(editor) { editor.jumpToMatching(); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true +}, { + name: "selecttomatching", + bindKey: bindKey("Ctrl-Shift-P", "Ctrl-Shift-P"), + exec: function(editor) { editor.jumpToMatching(true); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true +}, { + name: "expandToMatching", + bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"), + exec: function(editor) { editor.jumpToMatching(true, true); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true +}, { + name: "passKeysToBrowser", + bindKey: bindKey(null, null), + exec: function() {}, + passEvent: true, + readOnly: true +}, { + name: "copy", + exec: function(editor) { + }, + readOnly: true +}, +{ + name: "cut", + exec: function(editor) { + var range = editor.getSelectionRange(); + editor._emit("cut", range); + + if (!editor.selection.isEmpty()) { + editor.session.remove(range); + editor.clearSelection(); + } + }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" +}, { + name: "paste", + exec: function(editor, args) { + editor.$handlePaste(args); + }, + scrollIntoView: "cursor" +}, { + name: "removeline", + bindKey: bindKey("Ctrl-D", "Command-D"), + exec: function(editor) { editor.removeLines(); }, + scrollIntoView: "cursor", + multiSelectAction: "forEachLine" +}, { + name: "duplicateSelection", + bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"), + exec: function(editor) { editor.duplicateSelection(); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" +}, { + name: "sortlines", + bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"), + exec: function(editor) { editor.sortLines(); }, + scrollIntoView: "selection", + multiSelectAction: "forEachLine" +}, { + name: "togglecomment", + bindKey: bindKey("Ctrl-/", "Command-/"), + exec: function(editor) { editor.toggleCommentLines(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" +}, { + name: "toggleBlockComment", + bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"), + exec: function(editor) { editor.toggleBlockComment(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" +}, { + name: "modifyNumberUp", + bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"), + exec: function(editor) { editor.modifyNumber(1); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" +}, { + name: "modifyNumberDown", + bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), + exec: function(editor) { editor.modifyNumber(-1); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" +}, { + name: "replace", + bindKey: bindKey("Ctrl-H", "Command-Option-F"), + exec: function(editor) { + config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor, true)}); + } +}, { + name: "undo", + bindKey: bindKey("Ctrl-Z", "Command-Z"), + exec: function(editor) { editor.undo(); } +}, { + name: "redo", + bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), + exec: function(editor) { editor.redo(); } +}, { + name: "copylinesup", + bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"), + exec: function(editor) { editor.copyLinesUp(); }, + scrollIntoView: "cursor" +}, { + name: "movelinesup", + bindKey: bindKey("Alt-Up", "Option-Up"), + exec: function(editor) { editor.moveLinesUp(); }, + scrollIntoView: "cursor" +}, { + name: "copylinesdown", + bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"), + exec: function(editor) { editor.copyLinesDown(); }, + scrollIntoView: "cursor" +}, { + name: "movelinesdown", + bindKey: bindKey("Alt-Down", "Option-Down"), + exec: function(editor) { editor.moveLinesDown(); }, + scrollIntoView: "cursor" +}, { + name: "del", + bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"), + exec: function(editor) { editor.remove("right"); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "backspace", + bindKey: bindKey( + "Shift-Backspace|Backspace", + "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H" + ), + exec: function(editor) { editor.remove("left"); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "cut_or_delete", + bindKey: bindKey("Shift-Delete", null), + exec: function(editor) { + if (editor.selection.isEmpty()) { + editor.remove("left"); + } else { + return false; + } + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "removetolinestart", + bindKey: bindKey("Alt-Backspace", "Command-Backspace"), + exec: function(editor) { editor.removeToLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "removetolineend", + bindKey: bindKey("Alt-Delete", "Ctrl-K"), + exec: function(editor) { editor.removeToLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "removewordleft", + bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), + exec: function(editor) { editor.removeWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "removewordright", + bindKey: bindKey("Ctrl-Delete", "Alt-Delete"), + exec: function(editor) { editor.removeWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "outdent", + bindKey: bindKey("Shift-Tab", "Shift-Tab"), + exec: function(editor) { editor.blockOutdent(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" +}, { + name: "indent", + bindKey: bindKey("Tab", "Tab"), + exec: function(editor) { editor.indent(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" +}, { + name: "blockoutdent", + bindKey: bindKey("Ctrl-[", "Ctrl-["), + exec: function(editor) { editor.blockOutdent(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" +}, { + name: "blockindent", + bindKey: bindKey("Ctrl-]", "Ctrl-]"), + exec: function(editor) { editor.blockIndent(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" +}, { + name: "insertstring", + exec: function(editor, str) { editor.insert(str); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "inserttext", + exec: function(editor, args) { + editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "splitline", + bindKey: bindKey(null, "Ctrl-O"), + exec: function(editor) { editor.splitLine(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "transposeletters", + bindKey: bindKey("Alt-Shift-X", "Ctrl-T"), + exec: function(editor) { editor.transposeLetters(); }, + multiSelectAction: function(editor) {editor.transposeSelections(1); }, + scrollIntoView: "cursor" +}, { + name: "touppercase", + bindKey: bindKey("Ctrl-U", "Ctrl-U"), + exec: function(editor) { editor.toUpperCase(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "tolowercase", + bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"), + exec: function(editor) { editor.toLowerCase(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" +}, { + name: "expandtoline", + bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"), + exec: function(editor) { + var range = editor.selection.getRange(); + + range.start.column = range.end.column = 0; + range.end.row++; + editor.selection.setRange(range, false); + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true +}, { + name: "joinlines", + bindKey: bindKey(null, null), + exec: function(editor) { + var isBackwards = editor.selection.isBackwards(); + var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor(); + var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead(); + var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length; + var selectedText = editor.session.doc.getTextRange(editor.selection.getRange()); + var selectedCount = selectedText.replace(/\n\s*/, " ").length; + var insertLine = editor.session.doc.getLine(selectionStart.row); + + for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) { + var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i))); + if (curLine.length !== 0) { + curLine = " " + curLine; + } + insertLine += curLine; + } + + if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) { + insertLine += editor.session.doc.getNewLineCharacter(); + } + + editor.clearSelection(); + editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine); + + if (selectedCount > 0) { + editor.selection.moveCursorTo(selectionStart.row, selectionStart.column); + editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount); + } else { + firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol; + editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol); + } + }, + multiSelectAction: "forEach", + readOnly: true +}, { + name: "invertSelection", + bindKey: bindKey(null, null), + exec: function(editor) { + var endRow = editor.session.doc.getLength() - 1; + var endCol = editor.session.doc.getLine(endRow).length; + var ranges = editor.selection.rangeList.ranges; + var newRanges = []; + if (ranges.length < 1) { + ranges = [editor.selection.getRange()]; + } + + for (var i = 0; i < ranges.length; i++) { + if (i == (ranges.length - 1)) { + if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) { + newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol)); + } + } + + if (i === 0) { + if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) { + newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column)); + } + } else { + newRanges.push(new Range(ranges[i-1].end.row, ranges[i-1].end.column, ranges[i].start.row, ranges[i].start.column)); + } + } + + editor.exitMultiSelectMode(); + editor.clearSelection(); + + for(var i = 0; i < newRanges.length; i++) { + editor.selection.addRange(newRanges[i], false); + } + }, + readOnly: true, + scrollIntoView: "none" +}]; + +}); + +ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +require("./lib/fixoldbrowsers"); + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var lang = require("./lib/lang"); +var useragent = require("./lib/useragent"); +var TextInput = require("./keyboard/textinput").TextInput; +var MouseHandler = require("./mouse/mouse_handler").MouseHandler; +var FoldHandler = require("./mouse/fold_handler").FoldHandler; +var KeyBinding = require("./keyboard/keybinding").KeyBinding; +var EditSession = require("./edit_session").EditSession; +var Search = require("./search").Search; +var Range = require("./range").Range; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var CommandManager = require("./commands/command_manager").CommandManager; +var defaultCommands = require("./commands/default_commands").commands; +var config = require("./config"); +var TokenIterator = require("./token_iterator").TokenIterator; +var Editor = function(renderer, session) { + var container = renderer.getContainerElement(); + this.container = container; + this.renderer = renderer; + this.id = "editor" + (++Editor.$uid); + + this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); + if (typeof document == "object") { + this.textInput = new TextInput(renderer.getTextAreaContainer(), this); + this.renderer.textarea = this.textInput.getElement(); + this.$mouseHandler = new MouseHandler(this); + new FoldHandler(this); + } + + this.keyBinding = new KeyBinding(this); + + this.$blockScrolling = 0; + this.$search = new Search().set({ + wrap: true + }); + + this.$historyTracker = this.$historyTracker.bind(this); + this.commands.on("exec", this.$historyTracker); + + this.$initOperationListeners(); + + this._$emitInputEvent = lang.delayedCall(function() { + this._signal("input", {}); + if (this.session && this.session.bgTokenizer) + this.session.bgTokenizer.scheduleStart(); + }.bind(this)); + + this.on("change", function(_, _self) { + _self._$emitInputEvent.schedule(31); + }); + + this.setSession(session || new EditSession("")); + config.resetOptions(this); + config._signal("editor", this); +}; + +Editor.$uid = 0; + +(function(){ + + oop.implement(this, EventEmitter); + + this.$initOperationListeners = function() { + function last(a) {return a[a.length - 1]} + + this.selections = []; + this.commands.on("exec", this.startOperation.bind(this), true); + this.commands.on("afterExec", this.endOperation.bind(this), true); + + this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this)); + + this.on("change", function() { + this.curOp || this.startOperation(); + this.curOp.docChanged = true; + }.bind(this), true); + + this.on("changeSelection", function() { + this.curOp || this.startOperation(); + this.curOp.selectionChanged = true; + }.bind(this), true); + }; + + this.curOp = null; + this.prevOp = {}; + this.startOperation = function(commadEvent) { + if (this.curOp) { + if (!commadEvent || this.curOp.command) + return; + this.prevOp = this.curOp; + } + if (!commadEvent) { + this.previousCommand = null; + commadEvent = {}; + } + + this.$opResetTimer.schedule(); + this.curOp = { + command: commadEvent.command || {}, + args: commadEvent.args, + scrollTop: this.renderer.scrollTop + }; + if (this.curOp.command.name && this.curOp.command.scrollIntoView !== undefined) + this.$blockScrolling++; + }; + + this.endOperation = function(e) { + if (this.curOp) { + if (e && e.returnValue === false) + return this.curOp = null; + this._signal("beforeEndOperation"); + var command = this.curOp.command; + if (command.name && this.$blockScrolling > 0) + this.$blockScrolling--; + var scrollIntoView = command && command.scrollIntoView; + if (scrollIntoView) { + switch (scrollIntoView) { + case "center-animate": + scrollIntoView = "animate"; + case "center": + this.renderer.scrollCursorIntoView(null, 0.5); + break; + case "animate": + case "cursor": + this.renderer.scrollCursorIntoView(); + break; + case "selectionPart": + var range = this.selection.getRange(); + var config = this.renderer.layerConfig; + if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) { + this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead); + } + break; + default: + break; + } + if (scrollIntoView == "animate") + this.renderer.animateScrolling(this.curOp.scrollTop); + } + + this.prevOp = this.curOp; + this.curOp = null; + } + }; + this.$mergeableCommands = ["backspace", "del", "insertstring"]; + this.$historyTracker = function(e) { + if (!this.$mergeUndoDeltas) + return; + + var prev = this.prevOp; + var mergeableCommands = this.$mergeableCommands; + var shouldMerge = prev.command && (e.command.name == prev.command.name); + if (e.command.name == "insertstring") { + var text = e.args; + if (this.mergeNextCommand === undefined) + this.mergeNextCommand = true; + + shouldMerge = shouldMerge + && this.mergeNextCommand // previous command allows to coalesce with + && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type + + this.mergeNextCommand = true; + } else { + shouldMerge = shouldMerge + && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable + } + + if ( + this.$mergeUndoDeltas != "always" + && Date.now() - this.sequenceStartTime > 2000 + ) { + shouldMerge = false; // the sequence is too long + } + + if (shouldMerge) + this.session.mergeUndoDeltas = true; + else if (mergeableCommands.indexOf(e.command.name) !== -1) + this.sequenceStartTime = Date.now(); + }; + this.setKeyboardHandler = function(keyboardHandler, cb) { + if (keyboardHandler && typeof keyboardHandler === "string") { + this.$keybindingId = keyboardHandler; + var _self = this; + config.loadModule(["keybinding", keyboardHandler], function(module) { + if (_self.$keybindingId == keyboardHandler) + _self.keyBinding.setKeyboardHandler(module && module.handler); + cb && cb(); + }); + } else { + this.$keybindingId = null; + this.keyBinding.setKeyboardHandler(keyboardHandler); + cb && cb(); + } + }; + this.getKeyboardHandler = function() { + return this.keyBinding.getKeyboardHandler(); + }; + this.setSession = function(session) { + if (this.session == session) + return; + if (this.curOp) this.endOperation(); + this.curOp = {}; + + var oldSession = this.session; + if (oldSession) { + this.session.off("change", this.$onDocumentChange); + this.session.off("changeMode", this.$onChangeMode); + this.session.off("tokenizerUpdate", this.$onTokenizerUpdate); + this.session.off("changeTabSize", this.$onChangeTabSize); + this.session.off("changeWrapLimit", this.$onChangeWrapLimit); + this.session.off("changeWrapMode", this.$onChangeWrapMode); + this.session.off("changeFold", this.$onChangeFold); + this.session.off("changeFrontMarker", this.$onChangeFrontMarker); + this.session.off("changeBackMarker", this.$onChangeBackMarker); + this.session.off("changeBreakpoint", this.$onChangeBreakpoint); + this.session.off("changeAnnotation", this.$onChangeAnnotation); + this.session.off("changeOverwrite", this.$onCursorChange); + this.session.off("changeScrollTop", this.$onScrollTopChange); + this.session.off("changeScrollLeft", this.$onScrollLeftChange); + + var selection = this.session.getSelection(); + selection.off("changeCursor", this.$onCursorChange); + selection.off("changeSelection", this.$onSelectionChange); + } + + this.session = session; + if (session) { + this.$onDocumentChange = this.onDocumentChange.bind(this); + session.on("change", this.$onDocumentChange); + this.renderer.setSession(session); + + this.$onChangeMode = this.onChangeMode.bind(this); + session.on("changeMode", this.$onChangeMode); + + this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this); + session.on("tokenizerUpdate", this.$onTokenizerUpdate); + + this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer); + session.on("changeTabSize", this.$onChangeTabSize); + + this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this); + session.on("changeWrapLimit", this.$onChangeWrapLimit); + + this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); + session.on("changeWrapMode", this.$onChangeWrapMode); + + this.$onChangeFold = this.onChangeFold.bind(this); + session.on("changeFold", this.$onChangeFold); + + this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); + this.session.on("changeFrontMarker", this.$onChangeFrontMarker); + + this.$onChangeBackMarker = this.onChangeBackMarker.bind(this); + this.session.on("changeBackMarker", this.$onChangeBackMarker); + + this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this); + this.session.on("changeBreakpoint", this.$onChangeBreakpoint); + + this.$onChangeAnnotation = this.onChangeAnnotation.bind(this); + this.session.on("changeAnnotation", this.$onChangeAnnotation); + + this.$onCursorChange = this.onCursorChange.bind(this); + this.session.on("changeOverwrite", this.$onCursorChange); + + this.$onScrollTopChange = this.onScrollTopChange.bind(this); + this.session.on("changeScrollTop", this.$onScrollTopChange); + + this.$onScrollLeftChange = this.onScrollLeftChange.bind(this); + this.session.on("changeScrollLeft", this.$onScrollLeftChange); + + this.selection = session.getSelection(); + this.selection.on("changeCursor", this.$onCursorChange); + + this.$onSelectionChange = this.onSelectionChange.bind(this); + this.selection.on("changeSelection", this.$onSelectionChange); + + this.onChangeMode(); + + this.$blockScrolling += 1; + this.onCursorChange(); + this.$blockScrolling -= 1; + + this.onScrollTopChange(); + this.onScrollLeftChange(); + this.onSelectionChange(); + this.onChangeFrontMarker(); + this.onChangeBackMarker(); + this.onChangeBreakpoint(); + this.onChangeAnnotation(); + this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(); + this.renderer.updateFull(); + } else { + this.selection = null; + this.renderer.setSession(session); + } + + this._signal("changeSession", { + session: session, + oldSession: oldSession + }); + + this.curOp = null; + + oldSession && oldSession._signal("changeEditor", {oldEditor: this}); + session && session._signal("changeEditor", {editor: this}); + + if (session && session.bgTokenizer) + session.bgTokenizer.scheduleStart(); + }; + this.getSession = function() { + return this.session; + }; + this.setValue = function(val, cursorPos) { + this.session.doc.setValue(val); + + if (!cursorPos) + this.selectAll(); + else if (cursorPos == 1) + this.navigateFileEnd(); + else if (cursorPos == -1) + this.navigateFileStart(); + + return val; + }; + this.getValue = function() { + return this.session.getValue(); + }; + this.getSelection = function() { + return this.selection; + }; + this.resize = function(force) { + this.renderer.onResize(force); + }; + this.setTheme = function(theme, cb) { + this.renderer.setTheme(theme, cb); + }; + this.getTheme = function() { + return this.renderer.getTheme(); + }; + this.setStyle = function(style) { + this.renderer.setStyle(style); + }; + this.unsetStyle = function(style) { + this.renderer.unsetStyle(style); + }; + this.getFontSize = function () { + return this.getOption("fontSize") || + dom.computedStyle(this.container, "fontSize"); + }; + this.setFontSize = function(size) { + this.setOption("fontSize", size); + }; + + this.$highlightBrackets = function() { + if (this.session.$bracketHighlight) { + this.session.removeMarker(this.session.$bracketHighlight); + this.session.$bracketHighlight = null; + } + + if (this.$highlightPending) { + return; + } + var self = this; + this.$highlightPending = true; + setTimeout(function() { + self.$highlightPending = false; + var session = self.session; + if (!session || !session.bgTokenizer) return; + var pos = session.findMatchingBracket(self.getCursorPosition()); + if (pos) { + var range = new Range(pos.row, pos.column, pos.row, pos.column + 1); + } else if (session.$mode.getMatching) { + var range = session.$mode.getMatching(self.session); + } + if (range) + session.$bracketHighlight = session.addMarker(range, "ace_bracket", "text"); + }, 50); + }; + this.$highlightTags = function() { + if (this.$highlightTagPending) + return; + var self = this; + this.$highlightTagPending = true; + setTimeout(function() { + self.$highlightTagPending = false; + + var session = self.session; + if (!session || !session.bgTokenizer) return; + + var pos = self.getCursorPosition(); + var iterator = new TokenIterator(self.session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + + if (!token || !/\b(?:tag-open|tag-name)/.test(token.type)) { + session.removeMarker(session.$tagHighlight); + session.$tagHighlight = null; + return; + } + + if (token.type.indexOf("tag-open") != -1) { + token = iterator.stepForward(); + if (!token) + return; + } + + var tag = token.value; + var depth = 0; + var prevToken = iterator.stepBackward(); + + if (prevToken.value == '<'){ + do { + prevToken = token; + token = iterator.stepForward(); + + if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) { + if (prevToken.value === '<'){ + depth++; + } else if (prevToken.value === '= 0); + } else { + do { + token = prevToken; + prevToken = iterator.stepBackward(); + + if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) { + if (prevToken.value === '<') { + depth++; + } else if (prevToken.value === ' 1)) + highlight = false; + } + + if (session.$highlightLineMarker && !highlight) { + session.removeMarker(session.$highlightLineMarker.id); + session.$highlightLineMarker = null; + } else if (!session.$highlightLineMarker && highlight) { + var range = new Range(highlight.row, highlight.column, highlight.row, Infinity); + range.id = session.addMarker(range, "ace_active-line", "screenLine"); + session.$highlightLineMarker = range; + } else if (highlight) { + session.$highlightLineMarker.start.row = highlight.row; + session.$highlightLineMarker.end.row = highlight.row; + session.$highlightLineMarker.start.column = highlight.column; + session._signal("changeBackMarker"); + } + }; + + this.onSelectionChange = function(e) { + var session = this.session; + + if (session.$selectionMarker) { + session.removeMarker(session.$selectionMarker); + } + session.$selectionMarker = null; + + if (!this.selection.isEmpty()) { + var range = this.selection.getRange(); + var style = this.getSelectionStyle(); + session.$selectionMarker = session.addMarker(range, "ace_selection", style); + } else { + this.$updateHighlightActiveLine(); + } + + var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp(); + this.session.highlight(re); + + this._signal("changeSelection"); + }; + + this.$getSelectionHighLightRegexp = function() { + var session = this.session; + + var selection = this.getSelectionRange(); + if (selection.isEmpty() || selection.isMultiLine()) + return; + + var startOuter = selection.start.column - 1; + var endOuter = selection.end.column + 1; + var line = session.getLine(selection.start.row); + var lineCols = line.length; + var needle = line.substring(Math.max(startOuter, 0), + Math.min(endOuter, lineCols)); + if ((startOuter >= 0 && /^[\w\d]/.test(needle)) || + (endOuter <= lineCols && /[\w\d]$/.test(needle))) + return; + + needle = line.substring(selection.start.column, selection.end.column); + if (!/^[\w\d]+$/.test(needle)) + return; + + var re = this.$search.$assembleRegExp({ + wholeWord: true, + caseSensitive: true, + needle: needle + }); + + return re; + }; + + + this.onChangeFrontMarker = function() { + this.renderer.updateFrontMarkers(); + }; + + this.onChangeBackMarker = function() { + this.renderer.updateBackMarkers(); + }; + + + this.onChangeBreakpoint = function() { + this.renderer.updateBreakpoints(); + }; + + this.onChangeAnnotation = function() { + this.renderer.setAnnotations(this.session.getAnnotations()); + }; + + + this.onChangeMode = function(e) { + this.renderer.updateText(); + this._emit("changeMode", e); + }; + + + this.onChangeWrapLimit = function() { + this.renderer.updateFull(); + }; + + this.onChangeWrapMode = function() { + this.renderer.onResize(true); + }; + + + this.onChangeFold = function() { + this.$updateHighlightActiveLine(); + this.renderer.updateFull(); + }; + this.getSelectedText = function() { + return this.session.getTextRange(this.getSelectionRange()); + }; + this.getCopyText = function() { + var text = this.getSelectedText(); + this._signal("copy", text); + return text; + }; + this.onCopy = function() { + this.commands.exec("copy", this); + }; + this.onCut = function() { + this.commands.exec("cut", this); + }; + this.onPaste = function(text, event) { + var e = {text: text, event: event}; + this.commands.exec("paste", this, e); + }; + + this.$handlePaste = function(e) { + if (typeof e == "string") + e = {text: e}; + this._signal("paste", e); + var text = e.text; + if (!this.inMultiSelectMode || this.inVirtualSelectionMode) { + this.insert(text); + } else { + var lines = text.split(/\r\n|\r|\n/); + var ranges = this.selection.rangeList.ranges; + + if (lines.length > ranges.length || lines.length < 2 || !lines[1]) + return this.commands.exec("insertstring", this, text); + + for (var i = ranges.length; i--;) { + var range = ranges[i]; + if (!range.isEmpty()) + this.session.remove(range); + + this.session.insert(range.start, lines[i]); + } + } + }; + + this.execCommand = function(command, args) { + return this.commands.exec(command, this, args); + }; + this.insert = function(text, pasted) { + var session = this.session; + var mode = session.getMode(); + var cursor = this.getCursorPosition(); + + if (this.getBehavioursEnabled() && !pasted) { + var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); + if (transform) { + if (text !== transform.text) { + this.session.mergeUndoDeltas = false; + this.$mergeNextCommand = false; + } + text = transform.text; + + } + } + + if (text == "\t") + text = this.session.getTabString(); + if (!this.selection.isEmpty()) { + var range = this.getSelectionRange(); + cursor = this.session.remove(range); + this.clearSelection(); + } + else if (this.session.getOverwrite() && text.indexOf("\n") == -1) { + var range = new Range.fromPoints(cursor, cursor); + range.end.column += text.length; + this.session.remove(range); + } + + if (text == "\n" || text == "\r\n") { + var line = session.getLine(cursor.row); + if (cursor.column > line.search(/\S|$/)) { + var d = line.substr(cursor.column).search(/\S|$/); + session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d); + } + } + this.clearSelection(); + + var start = cursor.column; + var lineState = session.getState(cursor.row); + var line = session.getLine(cursor.row); + var shouldOutdent = mode.checkOutdent(lineState, line, text); + var end = session.insert(cursor, text); + + if (transform && transform.selection) { + if (transform.selection.length == 2) { // Transform relative to the current column + this.selection.setSelectionRange( + new Range(cursor.row, start + transform.selection[0], + cursor.row, start + transform.selection[1])); + } else { // Transform relative to the current row. + this.selection.setSelectionRange( + new Range(cursor.row + transform.selection[0], + transform.selection[1], + cursor.row + transform.selection[2], + transform.selection[3])); + } + } + + if (session.getDocument().isNewLine(text)) { + var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); + + session.insert({row: cursor.row+1, column: 0}, lineIndent); + } + if (shouldOutdent) + mode.autoOutdent(lineState, session, cursor.row); + }; + + this.onTextInput = function(text) { + this.keyBinding.onTextInput(text); + }; + + this.onCommandKey = function(e, hashId, keyCode) { + this.keyBinding.onCommandKey(e, hashId, keyCode); + }; + this.setOverwrite = function(overwrite) { + this.session.setOverwrite(overwrite); + }; + this.getOverwrite = function() { + return this.session.getOverwrite(); + }; + this.toggleOverwrite = function() { + this.session.toggleOverwrite(); + }; + this.setScrollSpeed = function(speed) { + this.setOption("scrollSpeed", speed); + }; + this.getScrollSpeed = function() { + return this.getOption("scrollSpeed"); + }; + this.setDragDelay = function(dragDelay) { + this.setOption("dragDelay", dragDelay); + }; + this.getDragDelay = function() { + return this.getOption("dragDelay"); + }; + this.setSelectionStyle = function(val) { + this.setOption("selectionStyle", val); + }; + this.getSelectionStyle = function() { + return this.getOption("selectionStyle"); + }; + this.setHighlightActiveLine = function(shouldHighlight) { + this.setOption("highlightActiveLine", shouldHighlight); + }; + this.getHighlightActiveLine = function() { + return this.getOption("highlightActiveLine"); + }; + this.setHighlightGutterLine = function(shouldHighlight) { + this.setOption("highlightGutterLine", shouldHighlight); + }; + + this.getHighlightGutterLine = function() { + return this.getOption("highlightGutterLine"); + }; + this.setHighlightSelectedWord = function(shouldHighlight) { + this.setOption("highlightSelectedWord", shouldHighlight); + }; + this.getHighlightSelectedWord = function() { + return this.$highlightSelectedWord; + }; + + this.setAnimatedScroll = function(shouldAnimate){ + this.renderer.setAnimatedScroll(shouldAnimate); + }; + + this.getAnimatedScroll = function(){ + return this.renderer.getAnimatedScroll(); + }; + this.setShowInvisibles = function(showInvisibles) { + this.renderer.setShowInvisibles(showInvisibles); + }; + this.getShowInvisibles = function() { + return this.renderer.getShowInvisibles(); + }; + + this.setDisplayIndentGuides = function(display) { + this.renderer.setDisplayIndentGuides(display); + }; + + this.getDisplayIndentGuides = function() { + return this.renderer.getDisplayIndentGuides(); + }; + this.setShowPrintMargin = function(showPrintMargin) { + this.renderer.setShowPrintMargin(showPrintMargin); + }; + this.getShowPrintMargin = function() { + return this.renderer.getShowPrintMargin(); + }; + this.setPrintMarginColumn = function(showPrintMargin) { + this.renderer.setPrintMarginColumn(showPrintMargin); + }; + this.getPrintMarginColumn = function() { + return this.renderer.getPrintMarginColumn(); + }; + this.setReadOnly = function(readOnly) { + this.setOption("readOnly", readOnly); + }; + this.getReadOnly = function() { + return this.getOption("readOnly"); + }; + this.setBehavioursEnabled = function (enabled) { + this.setOption("behavioursEnabled", enabled); + }; + this.getBehavioursEnabled = function () { + return this.getOption("behavioursEnabled"); + }; + this.setWrapBehavioursEnabled = function (enabled) { + this.setOption("wrapBehavioursEnabled", enabled); + }; + this.getWrapBehavioursEnabled = function () { + return this.getOption("wrapBehavioursEnabled"); + }; + this.setShowFoldWidgets = function(show) { + this.setOption("showFoldWidgets", show); + + }; + this.getShowFoldWidgets = function() { + return this.getOption("showFoldWidgets"); + }; + + this.setFadeFoldWidgets = function(fade) { + this.setOption("fadeFoldWidgets", fade); + }; + + this.getFadeFoldWidgets = function() { + return this.getOption("fadeFoldWidgets"); + }; + this.remove = function(dir) { + if (this.selection.isEmpty()){ + if (dir == "left") + this.selection.selectLeft(); + else + this.selection.selectRight(); + } + + var range = this.getSelectionRange(); + if (this.getBehavioursEnabled()) { + var session = this.session; + var state = session.getState(range.start.row); + var new_range = session.getMode().transformAction(state, 'deletion', this, session, range); + + if (range.end.column === 0) { + var text = session.getTextRange(range); + if (text[text.length - 1] == "\n") { + var line = session.getLine(range.end.row); + if (/^\s+$/.test(line)) { + range.end.column = line.length; + } + } + } + if (new_range) + range = new_range; + } + + this.session.remove(range); + this.clearSelection(); + }; + this.removeWordRight = function() { + if (this.selection.isEmpty()) + this.selection.selectWordRight(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeWordLeft = function() { + if (this.selection.isEmpty()) + this.selection.selectWordLeft(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeToLineStart = function() { + if (this.selection.isEmpty()) + this.selection.selectLineStart(); + + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + }; + this.removeToLineEnd = function() { + if (this.selection.isEmpty()) + this.selection.selectLineEnd(); + + var range = this.getSelectionRange(); + if (range.start.column == range.end.column && range.start.row == range.end.row) { + range.end.column = 0; + range.end.row++; + } + + this.session.remove(range); + this.clearSelection(); + }; + this.splitLine = function() { + if (!this.selection.isEmpty()) { + this.session.remove(this.getSelectionRange()); + this.clearSelection(); + } + + var cursor = this.getCursorPosition(); + this.insert("\n"); + this.moveCursorToPosition(cursor); + }; + this.transposeLetters = function() { + if (!this.selection.isEmpty()) { + return; + } + + var cursor = this.getCursorPosition(); + var column = cursor.column; + if (column === 0) + return; + + var line = this.session.getLine(cursor.row); + var swap, range; + if (column < line.length) { + swap = line.charAt(column) + line.charAt(column-1); + range = new Range(cursor.row, column-1, cursor.row, column+1); + } + else { + swap = line.charAt(column-1) + line.charAt(column-2); + range = new Range(cursor.row, column-2, cursor.row, column); + } + this.session.replace(range, swap); + this.session.selection.moveToPosition(range.end); + }; + this.toLowerCase = function() { + var originalRange = this.getSelectionRange(); + if (this.selection.isEmpty()) { + this.selection.selectWord(); + } + + var range = this.getSelectionRange(); + var text = this.session.getTextRange(range); + this.session.replace(range, text.toLowerCase()); + this.selection.setSelectionRange(originalRange); + }; + this.toUpperCase = function() { + var originalRange = this.getSelectionRange(); + if (this.selection.isEmpty()) { + this.selection.selectWord(); + } + + var range = this.getSelectionRange(); + var text = this.session.getTextRange(range); + this.session.replace(range, text.toUpperCase()); + this.selection.setSelectionRange(originalRange); + }; + this.indent = function() { + var session = this.session; + var range = this.getSelectionRange(); + + if (range.start.row < range.end.row) { + var rows = this.$getSelectedRows(); + session.indentRows(rows.first, rows.last, "\t"); + return; + } else if (range.start.column < range.end.column) { + var text = session.getTextRange(range); + if (!/^\s+$/.test(text)) { + var rows = this.$getSelectedRows(); + session.indentRows(rows.first, rows.last, "\t"); + return; + } + } + + var line = session.getLine(range.start.row); + var position = range.start; + var size = session.getTabSize(); + var column = session.documentToScreenColumn(position.row, position.column); + + if (this.session.getUseSoftTabs()) { + var count = (size - column % size); + var indentString = lang.stringRepeat(" ", count); + } else { + var count = column % size; + while (line[range.start.column - 1] == " " && count) { + range.start.column--; + count--; + } + this.selection.setSelectionRange(range); + indentString = "\t"; + } + return this.insert(indentString); + }; + this.blockIndent = function() { + var rows = this.$getSelectedRows(); + this.session.indentRows(rows.first, rows.last, "\t"); + }; + this.blockOutdent = function() { + var selection = this.session.getSelection(); + this.session.outdentRows(selection.getRange()); + }; + this.sortLines = function() { + var rows = this.$getSelectedRows(); + var session = this.session; + + var lines = []; + for (i = rows.first; i <= rows.last; i++) + lines.push(session.getLine(i)); + + lines.sort(function(a, b) { + if (a.toLowerCase() < b.toLowerCase()) return -1; + if (a.toLowerCase() > b.toLowerCase()) return 1; + return 0; + }); + + var deleteRange = new Range(0, 0, 0, 0); + for (var i = rows.first; i <= rows.last; i++) { + var line = session.getLine(i); + deleteRange.start.row = i; + deleteRange.end.row = i; + deleteRange.end.column = line.length; + session.replace(deleteRange, lines[i-rows.first]); + } + }; + this.toggleCommentLines = function() { + var state = this.session.getState(this.getCursorPosition().row); + var rows = this.$getSelectedRows(); + this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); + }; + + this.toggleBlockComment = function() { + var cursor = this.getCursorPosition(); + var state = this.session.getState(cursor.row); + var range = this.getSelectionRange(); + this.session.getMode().toggleBlockComment(state, this.session, range, cursor); + }; + this.getNumberAt = function(row, column) { + var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g; + _numberRx.lastIndex = 0; + + var s = this.session.getLine(row); + while (_numberRx.lastIndex < column) { + var m = _numberRx.exec(s); + if(m.index <= column && m.index+m[0].length >= column){ + var number = { + value: m[0], + start: m.index, + end: m.index+m[0].length + }; + return number; + } + } + return null; + }; + this.modifyNumber = function(amount) { + var row = this.selection.getCursor().row; + var column = this.selection.getCursor().column; + var charRange = new Range(row, column-1, row, column); + + var c = this.session.getTextRange(charRange); + if (!isNaN(parseFloat(c)) && isFinite(c)) { + var nr = this.getNumberAt(row, column); + if (nr) { + var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end; + var decimals = nr.start + nr.value.length - fp; + + var t = parseFloat(nr.value); + t *= Math.pow(10, decimals); + + + if(fp !== nr.end && column < fp){ + amount *= Math.pow(10, nr.end - column - 1); + } else { + amount *= Math.pow(10, nr.end - column); + } + + t += amount; + t /= Math.pow(10, decimals); + var nnr = t.toFixed(decimals); + var replaceRange = new Range(row, nr.start, row, nr.end); + this.session.replace(replaceRange, nnr); + this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length)); + + } + } + }; + this.removeLines = function() { + var rows = this.$getSelectedRows(); + this.session.removeFullLines(rows.first, rows.last); + this.clearSelection(); + }; + + this.duplicateSelection = function() { + var sel = this.selection; + var doc = this.session; + var range = sel.getRange(); + var reverse = sel.isBackwards(); + if (range.isEmpty()) { + var row = range.start.row; + doc.duplicateLines(row, row); + } else { + var point = reverse ? range.start : range.end; + var endPoint = doc.insert(point, doc.getTextRange(range), false); + range.start = point; + range.end = endPoint; + + sel.setSelectionRange(range, reverse); + } + }; + this.moveLinesDown = function() { + this.$moveLines(1, false); + }; + this.moveLinesUp = function() { + this.$moveLines(-1, false); + }; + this.moveText = function(range, toPosition, copy) { + return this.session.moveText(range, toPosition, copy); + }; + this.copyLinesUp = function() { + this.$moveLines(-1, true); + }; + this.copyLinesDown = function() { + this.$moveLines(1, true); + }; + this.$moveLines = function(dir, copy) { + var rows, moved; + var selection = this.selection; + if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) { + var range = selection.toOrientedRange(); + rows = this.$getSelectedRows(range); + moved = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir); + if (copy && dir == -1) moved = 0; + range.moveBy(moved, 0); + selection.fromOrientedRange(range); + } else { + var ranges = selection.rangeList.ranges; + selection.rangeList.detach(this.session); + this.inVirtualSelectionMode = true; + + var diff = 0; + var totalDiff = 0; + var l = ranges.length; + for (var i = 0; i < l; i++) { + var rangeIndex = i; + ranges[i].moveBy(diff, 0); + rows = this.$getSelectedRows(ranges[i]); + var first = rows.first; + var last = rows.last; + while (++i < l) { + if (totalDiff) ranges[i].moveBy(totalDiff, 0); + var subRows = this.$getSelectedRows(ranges[i]); + if (copy && subRows.first != last) + break; + else if (!copy && subRows.first > last + 1) + break; + last = subRows.last; + } + i--; + diff = this.session.$moveLines(first, last, copy ? 0 : dir); + if (copy && dir == -1) rangeIndex = i + 1; + while (rangeIndex <= i) { + ranges[rangeIndex].moveBy(diff, 0); + rangeIndex++; + } + if (!copy) diff = 0; + totalDiff += diff; + } + + selection.fromOrientedRange(selection.ranges[0]); + selection.rangeList.attach(this.session); + this.inVirtualSelectionMode = false; + } + }; + this.$getSelectedRows = function(range) { + range = (range || this.getSelectionRange()).collapseRows(); + + return { + first: this.session.getRowFoldStart(range.start.row), + last: this.session.getRowFoldEnd(range.end.row) + }; + }; + + this.onCompositionStart = function(text) { + this.renderer.showComposition(this.getCursorPosition()); + }; + + this.onCompositionUpdate = function(text) { + this.renderer.setCompositionText(text); + }; + + this.onCompositionEnd = function() { + this.renderer.hideComposition(); + }; + this.getFirstVisibleRow = function() { + return this.renderer.getFirstVisibleRow(); + }; + this.getLastVisibleRow = function() { + return this.renderer.getLastVisibleRow(); + }; + this.isRowVisible = function(row) { + return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); + }; + this.isRowFullyVisible = function(row) { + return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow()); + }; + this.$getVisibleRowCount = function() { + return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; + }; + + this.$moveByPage = function(dir, select) { + var renderer = this.renderer; + var config = this.renderer.layerConfig; + var rows = dir * Math.floor(config.height / config.lineHeight); + + this.$blockScrolling++; + if (select === true) { + this.selection.$moveSelection(function(){ + this.moveCursorBy(rows, 0); + }); + } else if (select === false) { + this.selection.moveCursorBy(rows, 0); + this.selection.clearSelection(); + } + this.$blockScrolling--; + + var scrollTop = renderer.scrollTop; + + renderer.scrollBy(0, rows * config.lineHeight); + if (select != null) + renderer.scrollCursorIntoView(null, 0.5); + + renderer.animateScrolling(scrollTop); + }; + this.selectPageDown = function() { + this.$moveByPage(1, true); + }; + this.selectPageUp = function() { + this.$moveByPage(-1, true); + }; + this.gotoPageDown = function() { + this.$moveByPage(1, false); + }; + this.gotoPageUp = function() { + this.$moveByPage(-1, false); + }; + this.scrollPageDown = function() { + this.$moveByPage(1); + }; + this.scrollPageUp = function() { + this.$moveByPage(-1); + }; + this.scrollToRow = function(row) { + this.renderer.scrollToRow(row); + }; + this.scrollToLine = function(line, center, animate, callback) { + this.renderer.scrollToLine(line, center, animate, callback); + }; + this.centerSelection = function() { + var range = this.getSelectionRange(); + var pos = { + row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2), + column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2) + }; + this.renderer.alignCursor(pos, 0.5); + }; + this.getCursorPosition = function() { + return this.selection.getCursor(); + }; + this.getCursorPositionScreen = function() { + return this.session.documentToScreenPosition(this.getCursorPosition()); + }; + this.getSelectionRange = function() { + return this.selection.getRange(); + }; + this.selectAll = function() { + this.$blockScrolling += 1; + this.selection.selectAll(); + this.$blockScrolling -= 1; + }; + this.clearSelection = function() { + this.selection.clearSelection(); + }; + this.moveCursorTo = function(row, column) { + this.selection.moveCursorTo(row, column); + }; + this.moveCursorToPosition = function(pos) { + this.selection.moveCursorToPosition(pos); + }; + this.jumpToMatching = function(select, expand) { + var cursor = this.getCursorPosition(); + var iterator = new TokenIterator(this.session, cursor.row, cursor.column); + var prevToken = iterator.getCurrentToken(); + var token = prevToken || iterator.stepForward(); + + if (!token) return; + var matchType; + var found = false; + var depth = {}; + var i = cursor.column - token.start; + var bracketType; + var brackets = { + ")": "(", + "(": "(", + "]": "[", + "[": "[", + "{": "{", + "}": "{" + }; + + do { + if (token.value.match(/[{}()\[\]]/g)) { + for (; i < token.value.length && !found; i++) { + if (!brackets[token.value[i]]) { + continue; + } + + bracketType = brackets[token.value[i]] + '.' + token.type.replace("rparen", "lparen"); + + if (isNaN(depth[bracketType])) { + depth[bracketType] = 0; + } + + switch (token.value[i]) { + case '(': + case '[': + case '{': + depth[bracketType]++; + break; + case ')': + case ']': + case '}': + depth[bracketType]--; + + if (depth[bracketType] === -1) { + matchType = 'bracket'; + found = true; + } + break; + } + } + } + else if (token && token.type.indexOf('tag-name') !== -1) { + if (isNaN(depth[token.value])) { + depth[token.value] = 0; + } + + if (prevToken.value === '<') { + depth[token.value]++; + } + else if (prevToken.value === '= 0; --i) { + if(this.$tryReplace(ranges[i], replacement)) { + replaced++; + } + } + + this.selection.setSelectionRange(selection); + this.$blockScrolling -= 1; + + return replaced; + }; + + this.$tryReplace = function(range, replacement) { + var input = this.session.getTextRange(range); + replacement = this.$search.replace(input, replacement); + if (replacement !== null) { + range.end = this.session.replace(range, replacement); + return range; + } else { + return null; + } + }; + this.getLastSearchOptions = function() { + return this.$search.getOptions(); + }; + this.find = function(needle, options, animate) { + if (!options) + options = {}; + + if (typeof needle == "string" || needle instanceof RegExp) + options.needle = needle; + else if (typeof needle == "object") + oop.mixin(options, needle); + + var range = this.selection.getRange(); + if (options.needle == null) { + needle = this.session.getTextRange(range) + || this.$search.$options.needle; + if (!needle) { + range = this.session.getWordRange(range.start.row, range.start.column); + needle = this.session.getTextRange(range); + } + this.$search.set({needle: needle}); + } + + this.$search.set(options); + if (!options.start) + this.$search.set({start: range}); + + var newRange = this.$search.find(this.session); + if (options.preventScroll) + return newRange; + if (newRange) { + this.revealRange(newRange, animate); + return newRange; + } + if (options.backwards) + range.start = range.end; + else + range.end = range.start; + this.selection.setRange(range); + }; + this.findNext = function(options, animate) { + this.find({skipCurrent: true, backwards: false}, options, animate); + }; + this.findPrevious = function(options, animate) { + this.find(options, {skipCurrent: true, backwards: true}, animate); + }; + + this.revealRange = function(range, animate) { + this.$blockScrolling += 1; + this.session.unfold(range); + this.selection.setSelectionRange(range); + this.$blockScrolling -= 1; + + var scrollTop = this.renderer.scrollTop; + this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); + if (animate !== false) + this.renderer.animateScrolling(scrollTop); + }; + this.undo = function() { + this.$blockScrolling++; + this.session.getUndoManager().undo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); + }; + this.redo = function() { + this.$blockScrolling++; + this.session.getUndoManager().redo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); + }; + this.destroy = function() { + this.renderer.destroy(); + this._signal("destroy", this); + if (this.session) { + this.session.destroy(); + } + }; + this.setAutoScrollEditorIntoView = function(enable) { + if (!enable) + return; + var rect; + var self = this; + var shouldScroll = false; + if (!this.$scrollAnchor) + this.$scrollAnchor = document.createElement("div"); + var scrollAnchor = this.$scrollAnchor; + scrollAnchor.style.cssText = "position:absolute"; + this.container.insertBefore(scrollAnchor, this.container.firstChild); + var onChangeSelection = this.on("changeSelection", function() { + shouldScroll = true; + }); + var onBeforeRender = this.renderer.on("beforeRender", function() { + if (shouldScroll) + rect = self.renderer.container.getBoundingClientRect(); + }); + var onAfterRender = this.renderer.on("afterRender", function() { + if (shouldScroll && rect && (self.isFocused() + || self.searchBox && self.searchBox.isFocused()) + ) { + var renderer = self.renderer; + var pos = renderer.$cursorLayer.$pixelPos; + var config = renderer.layerConfig; + var top = pos.top - config.offset; + if (pos.top >= 0 && top + rect.top < 0) { + shouldScroll = true; + } else if (pos.top < config.height && + pos.top + rect.top + config.lineHeight > window.innerHeight) { + shouldScroll = false; + } else { + shouldScroll = null; + } + if (shouldScroll != null) { + scrollAnchor.style.top = top + "px"; + scrollAnchor.style.left = pos.left + "px"; + scrollAnchor.style.height = config.lineHeight + "px"; + scrollAnchor.scrollIntoView(shouldScroll); + } + shouldScroll = rect = null; + } + }); + this.setAutoScrollEditorIntoView = function(enable) { + if (enable) + return; + delete this.setAutoScrollEditorIntoView; + this.off("changeSelection", onChangeSelection); + this.renderer.off("afterRender", onAfterRender); + this.renderer.off("beforeRender", onBeforeRender); + }; + }; + + + this.$resetCursorStyle = function() { + var style = this.$cursorStyle || "ace"; + var cursorLayer = this.renderer.$cursorLayer; + if (!cursorLayer) + return; + cursorLayer.setSmoothBlinking(/smooth/.test(style)); + cursorLayer.isBlinking = !this.$readOnly && style != "wide"; + dom.setCssClass(cursorLayer.element, "ace_slim-cursors", /slim/.test(style)); + }; + +}).call(Editor.prototype); + + + +config.defineOptions(Editor.prototype, "editor", { + selectionStyle: { + set: function(style) { + this.onSelectionChange(); + this._signal("changeSelectionStyle", {data: style}); + }, + initialValue: "line" + }, + highlightActiveLine: { + set: function() {this.$updateHighlightActiveLine();}, + initialValue: true + }, + highlightSelectedWord: { + set: function(shouldHighlight) {this.$onSelectionChange();}, + initialValue: true + }, + readOnly: { + set: function(readOnly) { + this.$resetCursorStyle(); + }, + initialValue: false + }, + cursorStyle: { + set: function(val) { this.$resetCursorStyle(); }, + values: ["ace", "slim", "smooth", "wide"], + initialValue: "ace" + }, + mergeUndoDeltas: { + values: [false, true, "always"], + initialValue: true + }, + behavioursEnabled: {initialValue: true}, + wrapBehavioursEnabled: {initialValue: true}, + autoScrollEditorIntoView: { + set: function(val) {this.setAutoScrollEditorIntoView(val)} + }, + keyboardHandler: { + set: function(val) { this.setKeyboardHandler(val); }, + get: function() { return this.keybindingId; }, + handlesSet: true + }, + + hScrollBarAlwaysVisible: "renderer", + vScrollBarAlwaysVisible: "renderer", + highlightGutterLine: "renderer", + animatedScroll: "renderer", + showInvisibles: "renderer", + showPrintMargin: "renderer", + printMarginColumn: "renderer", + printMargin: "renderer", + fadeFoldWidgets: "renderer", + showFoldWidgets: "renderer", + showLineNumbers: "renderer", + showGutter: "renderer", + displayIndentGuides: "renderer", + fontSize: "renderer", + fontFamily: "renderer", + maxLines: "renderer", + minLines: "renderer", + scrollPastEnd: "renderer", + fixedWidthGutter: "renderer", + theme: "renderer", + + scrollSpeed: "$mouseHandler", + dragDelay: "$mouseHandler", + dragEnabled: "$mouseHandler", + focusTimout: "$mouseHandler", + tooltipFollowsMouse: "$mouseHandler", + + firstLineNumber: "session", + overwrite: "session", + newLineMode: "session", + useWorker: "session", + useSoftTabs: "session", + tabSize: "session", + wrap: "session", + indentedSoftWrap: "session", + foldStyle: "session", + mode: "session" +}); + +exports.Editor = Editor; +}); + +ace.define("ace/undomanager",["require","exports","module"], function(require, exports, module) { +"use strict"; +var UndoManager = function() { + this.reset(); +}; + +(function() { + this.execute = function(options) { + var deltaSets = options.args[0]; + this.$doc = options.args[1]; + if (options.merge && this.hasUndo()){ + this.dirtyCounter--; + deltaSets = this.$undoStack.pop().concat(deltaSets); + } + this.$undoStack.push(deltaSets); + this.$redoStack = []; + if (this.dirtyCounter < 0) { + this.dirtyCounter = NaN; + } + this.dirtyCounter++; + }; + this.undo = function(dontSelect) { + var deltaSets = this.$undoStack.pop(); + var undoSelectionRange = null; + if (deltaSets) { + undoSelectionRange = this.$doc.undoChanges(deltaSets, dontSelect); + this.$redoStack.push(deltaSets); + this.dirtyCounter--; + } + + return undoSelectionRange; + }; + this.redo = function(dontSelect) { + var deltaSets = this.$redoStack.pop(); + var redoSelectionRange = null; + if (deltaSets) { + redoSelectionRange = + this.$doc.redoChanges(this.$deserializeDeltas(deltaSets), dontSelect); + this.$undoStack.push(deltaSets); + this.dirtyCounter++; + } + return redoSelectionRange; + }; + this.reset = function() { + this.$undoStack = []; + this.$redoStack = []; + this.dirtyCounter = 0; + }; + this.hasUndo = function() { + return this.$undoStack.length > 0; + }; + this.hasRedo = function() { + return this.$redoStack.length > 0; + }; + this.markClean = function() { + this.dirtyCounter = 0; + }; + this.isClean = function() { + return this.dirtyCounter === 0; + }; + this.$serializeDeltas = function(deltaSets) { + return cloneDeltaSetsObj(deltaSets, $serializeDelta); + }; + this.$deserializeDeltas = function(deltaSets) { + return cloneDeltaSetsObj(deltaSets, $deserializeDelta); + }; + + function $serializeDelta(delta){ + return { + action: delta.action, + start: delta.start, + end: delta.end, + lines: delta.lines.length == 1 ? null : delta.lines, + text: delta.lines.length == 1 ? delta.lines[0] : null + }; + } + + function $deserializeDelta(delta) { + return { + action: delta.action, + start: delta.start, + end: delta.end, + lines: delta.lines || [delta.text] + }; + } + + function cloneDeltaSetsObj(deltaSets_old, fnGetModifiedDelta) { + var deltaSets_new = new Array(deltaSets_old.length); + for (var i = 0; i < deltaSets_old.length; i++) { + var deltaSet_old = deltaSets_old[i]; + var deltaSet_new = { group: deltaSet_old.group, deltas: new Array(deltaSet_old.length)}; + + for (var j = 0; j < deltaSet_old.deltas.length; j++) { + var delta_old = deltaSet_old.deltas[j]; + deltaSet_new.deltas[j] = fnGetModifiedDelta(delta_old); + } + + deltaSets_new[i] = deltaSet_new; + } + return deltaSets_new; + } + +}).call(UndoManager.prototype); + +exports.UndoManager = UndoManager; +}); + +ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter"], function(require, exports, module) { +"use strict"; + +var dom = require("../lib/dom"); +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var EventEmitter = require("../lib/event_emitter").EventEmitter; + +var Gutter = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_gutter-layer"; + parentEl.appendChild(this.element); + this.setShowFoldWidgets(this.$showFoldWidgets); + + this.gutterWidth = 0; + + this.$annotations = []; + this.$updateAnnotations = this.$updateAnnotations.bind(this); + + this.$cells = []; +}; + +(function() { + + oop.implement(this, EventEmitter); + + this.setSession = function(session) { + if (this.session) + this.session.removeEventListener("change", this.$updateAnnotations); + this.session = session; + if (session) + session.on("change", this.$updateAnnotations); + }; + + this.addGutterDecoration = function(row, className){ + if (window.console) + console.warn && console.warn("deprecated use session.addGutterDecoration"); + this.session.addGutterDecoration(row, className); + }; + + this.removeGutterDecoration = function(row, className){ + if (window.console) + console.warn && console.warn("deprecated use session.removeGutterDecoration"); + this.session.removeGutterDecoration(row, className); + }; + + this.setAnnotations = function(annotations) { + this.$annotations = []; + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + var row = annotation.row; + var rowInfo = this.$annotations[row]; + if (!rowInfo) + rowInfo = this.$annotations[row] = {text: []}; + + var annoText = annotation.text; + annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || ""; + + if (rowInfo.text.indexOf(annoText) === -1) + rowInfo.text.push(annoText); + + var type = annotation.type; + if (type == "error") + rowInfo.className = " ace_error"; + else if (type == "warning" && rowInfo.className != " ace_error") + rowInfo.className = " ace_warning"; + else if (type == "info" && (!rowInfo.className)) + rowInfo.className = " ace_info"; + } + }; + + this.$updateAnnotations = function (delta) { + if (!this.$annotations.length) + return; + var firstRow = delta.start.row; + var len = delta.end.row - firstRow; + if (len === 0) { + } else if (delta.action == 'remove') { + this.$annotations.splice(firstRow, len + 1, null); + } else { + var args = new Array(len + 1); + args.unshift(firstRow, 1); + this.$annotations.splice.apply(this.$annotations, args); + } + }; + + this.update = function(config) { + var session = this.session; + var firstRow = config.firstRow; + var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar + session.getLength() - 1); + var fold = session.getNextFoldLine(firstRow); + var foldStart = fold ? fold.start.row : Infinity; + var foldWidgets = this.$showFoldWidgets && session.foldWidgets; + var breakpoints = session.$breakpoints; + var decorations = session.$decorations; + var firstLineNumber = session.$firstLineNumber; + var lastLineNumber = 0; + + var gutterRenderer = session.gutterRenderer || this.$renderer; + + var cell = null; + var index = -1; + var row = firstRow; + while (true) { + if (row > foldStart) { + row = fold.end.row + 1; + fold = session.getNextFoldLine(row, fold); + foldStart = fold ? fold.start.row : Infinity; + } + if (row > lastRow) { + while (this.$cells.length > index + 1) { + cell = this.$cells.pop(); + this.element.removeChild(cell.element); + } + break; + } + + cell = this.$cells[++index]; + if (!cell) { + cell = {element: null, textNode: null, foldWidget: null}; + cell.element = dom.createElement("div"); + cell.textNode = document.createTextNode(''); + cell.element.appendChild(cell.textNode); + this.element.appendChild(cell.element); + this.$cells[index] = cell; + } + + var className = "ace_gutter-cell "; + if (breakpoints[row]) + className += breakpoints[row]; + if (decorations[row]) + className += decorations[row]; + if (this.$annotations[row]) + className += this.$annotations[row].className; + if (cell.element.className != className) + cell.element.className = className; + + var height = session.getRowLength(row) * config.lineHeight + "px"; + if (height != cell.element.style.height) + cell.element.style.height = height; + + if (foldWidgets) { + var c = foldWidgets[row]; + if (c == null) + c = foldWidgets[row] = session.getFoldWidget(row); + } + + if (c) { + if (!cell.foldWidget) { + cell.foldWidget = dom.createElement("span"); + cell.element.appendChild(cell.foldWidget); + } + var className = "ace_fold-widget ace_" + c; + if (c == "start" && row == foldStart && row < fold.end.row) + className += " ace_closed"; + else + className += " ace_open"; + if (cell.foldWidget.className != className) + cell.foldWidget.className = className; + + var height = config.lineHeight + "px"; + if (cell.foldWidget.style.height != height) + cell.foldWidget.style.height = height; + } else { + if (cell.foldWidget) { + cell.element.removeChild(cell.foldWidget); + cell.foldWidget = null; + } + } + + var text = lastLineNumber = gutterRenderer + ? gutterRenderer.getText(session, row) + : row + firstLineNumber; + if (text !== cell.textNode.data) + cell.textNode.data = text; + + row++; + } + + this.element.style.height = config.minHeight + "px"; + + if (this.$fixedWidth || session.$useWrapMode) + lastLineNumber = session.getLength() + firstLineNumber; + + var gutterWidth = gutterRenderer + ? gutterRenderer.getWidth(session, lastLineNumber, config) + : lastLineNumber.toString().length * config.characterWidth; + + var padding = this.$padding || this.$computePadding(); + gutterWidth += padding.left + padding.right; + if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) { + this.gutterWidth = gutterWidth; + this.element.style.width = Math.ceil(this.gutterWidth) + "px"; + this._emit("changeGutterWidth", gutterWidth); + } + }; + + this.$fixedWidth = false; + + this.$showLineNumbers = true; + this.$renderer = ""; + this.setShowLineNumbers = function(show) { + this.$renderer = !show && { + getWidth: function() {return ""}, + getText: function() {return ""} + }; + }; + + this.getShowLineNumbers = function() { + return this.$showLineNumbers; + }; + + this.$showFoldWidgets = true; + this.setShowFoldWidgets = function(show) { + if (show) + dom.addCssClass(this.element, "ace_folding-enabled"); + else + dom.removeCssClass(this.element, "ace_folding-enabled"); + + this.$showFoldWidgets = show; + this.$padding = null; + }; + + this.getShowFoldWidgets = function() { + return this.$showFoldWidgets; + }; + + this.$computePadding = function() { + if (!this.element.firstChild) + return {left: 0, right: 0}; + var style = dom.computedStyle(this.element.firstChild); + this.$padding = {}; + this.$padding.left = parseInt(style.paddingLeft) + 1 || 0; + this.$padding.right = parseInt(style.paddingRight) || 0; + return this.$padding; + }; + + this.getRegion = function(point) { + var padding = this.$padding || this.$computePadding(); + var rect = this.element.getBoundingClientRect(); + if (point.x < padding.left + rect.left) + return "markers"; + if (this.$showFoldWidgets && point.x > rect.right - padding.right) + return "foldWidgets"; + }; + +}).call(Gutter.prototype); + +exports.Gutter = Gutter; + +}); + +ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; +var dom = require("../lib/dom"); + +var Marker = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_marker-layer"; + parentEl.appendChild(this.element); +}; + +(function() { + + this.$padding = 0; + + this.setPadding = function(padding) { + this.$padding = padding; + }; + this.setSession = function(session) { + this.session = session; + }; + + this.setMarkers = function(markers) { + this.markers = markers; + }; + + this.update = function(config) { + if (!config) return; + + this.config = config; + + + var html = []; + for (var key in this.markers) { + var marker = this.markers[key]; + + if (!marker.range) { + marker.update(html, this, this.session, config); + continue; + } + + var range = marker.range.clipRows(config.firstRow, config.lastRow); + if (range.isEmpty()) continue; + + range = range.toScreenRange(this.session); + if (marker.renderer) { + var top = this.$getTop(range.start.row, config); + var left = this.$padding + range.start.column * config.characterWidth; + marker.renderer(html, range, left, top, config); + } else if (marker.type == "fullLine") { + this.drawFullLineMarker(html, range, marker.clazz, config); + } else if (marker.type == "screenLine") { + this.drawScreenLineMarker(html, range, marker.clazz, config); + } else if (range.isMultiLine()) { + if (marker.type == "text") + this.drawTextMarker(html, range, marker.clazz, config); + else + this.drawMultiLineMarker(html, range, marker.clazz, config); + } else { + this.drawSingleLineMarker(html, range, marker.clazz + " ace_start" + " ace_br15", config); + } + } + this.element.innerHTML = html.join(""); + }; + + this.$getTop = function(row, layerConfig) { + return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; + }; + + function getBorderClass(tl, tr, br, bl) { + return (tl ? 1 : 0) | (tr ? 2 : 0) | (br ? 4 : 0) | (bl ? 8 : 0); + } + this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) { + var session = this.session; + var start = range.start.row; + var end = range.end.row; + var row = start; + var prev = 0; + var curr = 0; + var next = session.getScreenLastRowColumn(row); + var lineRange = new Range(row, range.start.column, row, curr); + for (; row <= end; row++) { + lineRange.start.row = lineRange.end.row = row; + lineRange.start.column = row == start ? range.start.column : session.getRowWrapIndent(row); + lineRange.end.column = next; + prev = curr; + curr = next; + next = row + 1 < end ? session.getScreenLastRowColumn(row + 1) : row == end ? 0 : range.end.column; + this.drawSingleLineMarker(stringBuilder, lineRange, + clazz + (row == start ? " ace_start" : "") + " ace_br" + + getBorderClass(row == start || row == start + 1 && range.start.column, prev < curr, curr > next, row == end), + layerConfig, row == end ? 0 : 1, extraStyle); + } + }; + this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var padding = this.$padding; + var height = config.lineHeight; + var top = this.$getTop(range.start.row, config); + var left = padding + range.start.column * config.characterWidth; + extraStyle = extraStyle || ""; + + stringBuilder.push( + "
        " + ); + top = this.$getTop(range.end.row, config); + var width = range.end.column * config.characterWidth; + + stringBuilder.push( + "
        " + ); + height = (range.end.row - range.start.row - 1) * config.lineHeight; + if (height <= 0) + return; + top = this.$getTop(range.start.row + 1, config); + + var radiusClass = (range.start.column ? 1 : 0) | (range.end.column ? 0 : 8); + + stringBuilder.push( + "
        " + ); + }; + this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) { + var height = config.lineHeight; + var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth; + + var top = this.$getTop(range.start.row, config); + var left = this.$padding + range.start.column * config.characterWidth; + + stringBuilder.push( + "
        " + ); + }; + + this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var top = this.$getTop(range.start.row, config); + var height = config.lineHeight; + if (range.start.row != range.end.row) + height += this.$getTop(range.end.row, config) - top; + + stringBuilder.push( + "
        " + ); + }; + + this.drawScreenLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + var top = this.$getTop(range.start.row, config); + var height = config.lineHeight; + + stringBuilder.push( + "
        " + ); + }; + +}).call(Marker.prototype); + +exports.Marker = Marker; + +}); + +ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var dom = require("../lib/dom"); +var lang = require("../lib/lang"); +var useragent = require("../lib/useragent"); +var EventEmitter = require("../lib/event_emitter").EventEmitter; + +var Text = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_text-layer"; + parentEl.appendChild(this.element); + this.$updateEolChar = this.$updateEolChar.bind(this); +}; + +(function() { + + oop.implement(this, EventEmitter); + + this.EOF_CHAR = "\xB6"; + this.EOL_CHAR_LF = "\xAC"; + this.EOL_CHAR_CRLF = "\xa4"; + this.EOL_CHAR = this.EOL_CHAR_LF; + this.TAB_CHAR = "\u2014"; //"\u21E5"; + this.SPACE_CHAR = "\xB7"; + this.$padding = 0; + + this.$updateEolChar = function() { + var EOL_CHAR = this.session.doc.getNewLineCharacter() == "\n" + ? this.EOL_CHAR_LF + : this.EOL_CHAR_CRLF; + if (this.EOL_CHAR != EOL_CHAR) { + this.EOL_CHAR = EOL_CHAR; + return true; + } + } + + this.setPadding = function(padding) { + this.$padding = padding; + this.element.style.padding = "0 " + padding + "px"; + }; + + this.getLineHeight = function() { + return this.$fontMetrics.$characterSize.height || 0; + }; + + this.getCharacterWidth = function() { + return this.$fontMetrics.$characterSize.width || 0; + }; + + this.$setFontMetrics = function(measure) { + this.$fontMetrics = measure; + this.$fontMetrics.on("changeCharacterSize", function(e) { + this._signal("changeCharacterSize", e); + }.bind(this)); + this.$pollSizeChanges(); + } + + this.checkForSizeChanges = function() { + this.$fontMetrics.checkForSizeChanges(); + }; + this.$pollSizeChanges = function() { + return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges(); + }; + this.setSession = function(session) { + this.session = session; + if (session) + this.$computeTabString(); + }; + + this.showInvisibles = false; + this.setShowInvisibles = function(showInvisibles) { + if (this.showInvisibles == showInvisibles) + return false; + + this.showInvisibles = showInvisibles; + this.$computeTabString(); + return true; + }; + + this.displayIndentGuides = true; + this.setDisplayIndentGuides = function(display) { + if (this.displayIndentGuides == display) + return false; + + this.displayIndentGuides = display; + this.$computeTabString(); + return true; + }; + + this.$tabStrings = []; + this.onChangeTabSize = + this.$computeTabString = function() { + var tabSize = this.session.getTabSize(); + this.tabSize = tabSize; + var tabStr = this.$tabStrings = [0]; + for (var i = 1; i < tabSize + 1; i++) { + if (this.showInvisibles) { + tabStr.push("" + + lang.stringRepeat(this.TAB_CHAR, i) + + ""); + } else { + tabStr.push(lang.stringRepeat(" ", i)); + } + } + if (this.displayIndentGuides) { + this.$indentGuideRe = /\s\S| \t|\t |\s$/; + var className = "ace_indent-guide"; + var spaceClass = ""; + var tabClass = ""; + if (this.showInvisibles) { + className += " ace_invisible"; + spaceClass = " ace_invisible_space"; + tabClass = " ace_invisible_tab"; + var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize); + var tabContent = lang.stringRepeat(this.TAB_CHAR, this.tabSize); + } else{ + var spaceContent = lang.stringRepeat(" ", this.tabSize); + var tabContent = spaceContent; + } + + this.$tabStrings[" "] = "" + spaceContent + ""; + this.$tabStrings["\t"] = "" + tabContent + ""; + } + }; + + this.updateLines = function(config, firstRow, lastRow) { + if (this.config.lastRow != config.lastRow || + this.config.firstRow != config.firstRow) { + this.scrollLines(config); + } + this.config = config; + + var first = Math.max(firstRow, config.firstRow); + var last = Math.min(lastRow, config.lastRow); + + var lineElements = this.element.childNodes; + var lineElementsIdx = 0; + + for (var row = config.firstRow; row < first; row++) { + var foldLine = this.session.getFoldLine(row); + if (foldLine) { + if (foldLine.containsRow(first)) { + first = foldLine.start.row; + break; + } else { + row = foldLine.end.row; + } + } + lineElementsIdx ++; + } + + var row = first; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row :Infinity; + } + if (row > last) + break; + + var lineElement = lineElements[lineElementsIdx++]; + if (lineElement) { + var html = []; + this.$renderLine( + html, row, !this.$useLineGroups(), row == foldStart ? foldLine : false + ); + lineElement.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; + lineElement.innerHTML = html.join(""); + } + row++; + } + }; + + this.scrollLines = function(config) { + var oldConfig = this.config; + this.config = config; + + if (!oldConfig || oldConfig.lastRow < config.firstRow) + return this.update(config); + + if (config.lastRow < oldConfig.firstRow) + return this.update(config); + + var el = this.element; + if (oldConfig.firstRow < config.firstRow) + for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--) + el.removeChild(el.firstChild); + + if (oldConfig.lastRow > config.lastRow) + for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--) + el.removeChild(el.lastChild); + + if (config.firstRow < oldConfig.firstRow) { + var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1); + if (el.firstChild) + el.insertBefore(fragment, el.firstChild); + else + el.appendChild(fragment); + } + + if (config.lastRow > oldConfig.lastRow) { + var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow); + el.appendChild(fragment); + } + }; + + this.$renderLinesFragment = function(config, firstRow, lastRow) { + var fragment = this.element.ownerDocument.createDocumentFragment(); + var row = firstRow; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row : Infinity; + } + if (row > lastRow) + break; + + var container = dom.createElement("div"); + + var html = []; + this.$renderLine(html, row, false, row == foldStart ? foldLine : false); + container.innerHTML = html.join(""); + if (this.$useLineGroups()) { + container.className = 'ace_line_group'; + fragment.appendChild(container); + container.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; + + } else { + while(container.firstChild) + fragment.appendChild(container.firstChild); + } + + row++; + } + return fragment; + }; + + this.update = function(config) { + this.config = config; + + var html = []; + var firstRow = config.firstRow, lastRow = config.lastRow; + + var row = firstRow; + var foldLine = this.session.getNextFoldLine(row); + var foldStart = foldLine ? foldLine.start.row : Infinity; + + while (true) { + if (row > foldStart) { + row = foldLine.end.row+1; + foldLine = this.session.getNextFoldLine(row, foldLine); + foldStart = foldLine ? foldLine.start.row :Infinity; + } + if (row > lastRow) + break; + + if (this.$useLineGroups()) + html.push("
        ") + + this.$renderLine(html, row, false, row == foldStart ? foldLine : false); + + if (this.$useLineGroups()) + html.push("
        "); // end the line group + + row++; + } + this.element.innerHTML = html.join(""); + }; + + this.$textToken = { + "text": true, + "rparen": true, + "lparen": true + }; + + this.$renderToken = function(stringBuilder, screenColumn, token, value) { + var self = this; + var replaceReg = /\t|&|<|>|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF\uFFF9-\uFFFC])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; + var replaceFunc = function(c, a, b, tabIdx, idx4) { + if (a) { + return self.showInvisibles + ? "" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "" + : c; + } else if (c == "&") { + return "&"; + } else if (c == "<") { + return "<"; + } else if (c == ">") { + return ">"; + } else if (c == "\t") { + var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); + screenColumn += tabSize - 1; + return self.$tabStrings[tabSize]; + } else if (c == "\u3000") { + var classToUse = self.showInvisibles ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk"; + var space = self.showInvisibles ? self.SPACE_CHAR : ""; + screenColumn += 1; + return "" + space + ""; + } else if (b) { + return "" + self.SPACE_CHAR + ""; + } else { + screenColumn += 1; + return "" + c + ""; + } + }; + + var output = value.replace(replaceReg, replaceFunc); + + if (!this.$textToken[token.type]) { + var classes = "ace_" + token.type.replace(/\./g, " ace_"); + var style = ""; + if (token.type == "fold") + style = " style='width:" + (token.value.length * this.config.characterWidth) + "px;' "; + stringBuilder.push("", output, ""); + } + else { + stringBuilder.push(output); + } + return screenColumn + value.length; + }; + + this.renderIndentGuide = function(stringBuilder, value, max) { + var cols = value.search(this.$indentGuideRe); + if (cols <= 0 || cols >= max) + return value; + if (value[0] == " ") { + cols -= cols % this.tabSize; + stringBuilder.push(lang.stringRepeat(this.$tabStrings[" "], cols/this.tabSize)); + return value.substr(cols); + } else if (value[0] == "\t") { + stringBuilder.push(lang.stringRepeat(this.$tabStrings["\t"], cols)); + return value.substr(cols); + } + return value; + }; + + this.$renderWrappedLine = function(stringBuilder, tokens, splits, onlyContents) { + var chars = 0; + var split = 0; + var splitChars = splits[0]; + var screenColumn = 0; + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + var value = token.value; + if (i == 0 && this.displayIndentGuides) { + chars = value.length; + value = this.renderIndentGuide(stringBuilder, value, splitChars); + if (!value) + continue; + chars -= value.length; + } + + if (chars + value.length < splitChars) { + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + chars += value.length; + } else { + while (chars + value.length >= splitChars) { + screenColumn = this.$renderToken( + stringBuilder, screenColumn, + token, value.substring(0, splitChars - chars) + ); + value = value.substring(splitChars - chars); + chars = splitChars; + + if (!onlyContents) { + stringBuilder.push("
        ", + "
        " + ); + } + + stringBuilder.push(lang.stringRepeat("\xa0", splits.indent)); + + split ++; + screenColumn = 0; + splitChars = splits[split] || Number.MAX_VALUE; + } + if (value.length != 0) { + chars += value.length; + screenColumn = this.$renderToken( + stringBuilder, screenColumn, token, value + ); + } + } + } + }; + + this.$renderSimpleLine = function(stringBuilder, tokens) { + var screenColumn = 0; + var token = tokens[0]; + var value = token.value; + if (this.displayIndentGuides) + value = this.renderIndentGuide(stringBuilder, value); + if (value) + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + for (var i = 1; i < tokens.length; i++) { + token = tokens[i]; + value = token.value; + screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); + } + }; + this.$renderLine = function(stringBuilder, row, onlyContents, foldLine) { + if (!foldLine && foldLine != false) + foldLine = this.session.getFoldLine(row); + + if (foldLine) + var tokens = this.$getFoldLineTokens(row, foldLine); + else + var tokens = this.session.getTokens(row); + + + if (!onlyContents) { + stringBuilder.push( + "
        " + ); + } + + if (tokens.length) { + var splits = this.session.getRowSplitData(row); + if (splits && splits.length) + this.$renderWrappedLine(stringBuilder, tokens, splits, onlyContents); + else + this.$renderSimpleLine(stringBuilder, tokens); + } + + if (this.showInvisibles) { + if (foldLine) + row = foldLine.end.row + + stringBuilder.push( + "", + row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, + "" + ); + } + if (!onlyContents) + stringBuilder.push("
        "); + }; + + this.$getFoldLineTokens = function(row, foldLine) { + var session = this.session; + var renderTokens = []; + + function addTokens(tokens, from, to) { + var idx = 0, col = 0; + while ((col + tokens[idx].value.length) < from) { + col += tokens[idx].value.length; + idx++; + + if (idx == tokens.length) + return; + } + if (col != from) { + var value = tokens[idx].value.substring(from - col); + if (value.length > (to - from)) + value = value.substring(0, to - from); + + renderTokens.push({ + type: tokens[idx].type, + value: value + }); + + col = from + value.length; + idx += 1; + } + + while (col < to && idx < tokens.length) { + var value = tokens[idx].value; + if (value.length + col > to) { + renderTokens.push({ + type: tokens[idx].type, + value: value.substring(0, to - col) + }); + } else + renderTokens.push(tokens[idx]); + col += value.length; + idx += 1; + } + } + + var tokens = session.getTokens(row); + foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { + if (placeholder != null) { + renderTokens.push({ + type: "fold", + value: placeholder + }); + } else { + if (isNewRow) + tokens = session.getTokens(row); + + if (tokens.length) + addTokens(tokens, lastColumn, column); + } + }, foldLine.end.row, this.session.getLine(foldLine.end.row).length); + + return renderTokens; + }; + + this.$useLineGroups = function() { + return this.session.getUseWrapMode(); + }; + + this.destroy = function() { + clearInterval(this.$pollSizeChangesTimer); + if (this.$measureNode) + this.$measureNode.parentNode.removeChild(this.$measureNode); + delete this.$measureNode; + }; + +}).call(Text.prototype); + +exports.Text = Text; + +}); + +ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +var dom = require("../lib/dom"); +var isIE8; + +var Cursor = function(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_cursor-layer"; + parentEl.appendChild(this.element); + + if (isIE8 === undefined) + isIE8 = !("opacity" in this.element.style); + + this.isVisible = false; + this.isBlinking = true; + this.blinkInterval = 1000; + this.smoothBlinking = false; + + this.cursors = []; + this.cursor = this.addCursor(); + dom.addCssClass(this.element, "ace_hidden-cursors"); + this.$updateCursors = (isIE8 + ? this.$updateVisibility + : this.$updateOpacity).bind(this); +}; + +(function() { + + this.$updateVisibility = function(val) { + var cursors = this.cursors; + for (var i = cursors.length; i--; ) + cursors[i].style.visibility = val ? "" : "hidden"; + }; + this.$updateOpacity = function(val) { + var cursors = this.cursors; + for (var i = cursors.length; i--; ) + cursors[i].style.opacity = val ? "" : "0"; + }; + + + this.$padding = 0; + this.setPadding = function(padding) { + this.$padding = padding; + }; + + this.setSession = function(session) { + this.session = session; + }; + + this.setBlinking = function(blinking) { + if (blinking != this.isBlinking){ + this.isBlinking = blinking; + this.restartTimer(); + } + }; + + this.setBlinkInterval = function(blinkInterval) { + if (blinkInterval != this.blinkInterval){ + this.blinkInterval = blinkInterval; + this.restartTimer(); + } + }; + + this.setSmoothBlinking = function(smoothBlinking) { + if (smoothBlinking != this.smoothBlinking && !isIE8) { + this.smoothBlinking = smoothBlinking; + dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking); + this.$updateCursors(true); + this.$updateCursors = (this.$updateOpacity).bind(this); + this.restartTimer(); + } + }; + + this.addCursor = function() { + var el = dom.createElement("div"); + el.className = "ace_cursor"; + this.element.appendChild(el); + this.cursors.push(el); + return el; + }; + + this.removeCursor = function() { + if (this.cursors.length > 1) { + var el = this.cursors.pop(); + el.parentNode.removeChild(el); + return el; + } + }; + + this.hideCursor = function() { + this.isVisible = false; + dom.addCssClass(this.element, "ace_hidden-cursors"); + this.restartTimer(); + }; + + this.showCursor = function() { + this.isVisible = true; + dom.removeCssClass(this.element, "ace_hidden-cursors"); + this.restartTimer(); + }; + + this.restartTimer = function() { + var update = this.$updateCursors; + clearInterval(this.intervalId); + clearTimeout(this.timeoutId); + if (this.smoothBlinking) { + dom.removeCssClass(this.element, "ace_smooth-blinking"); + } + + update(true); + + if (!this.isBlinking || !this.blinkInterval || !this.isVisible) + return; + + if (this.smoothBlinking) { + setTimeout(function(){ + dom.addCssClass(this.element, "ace_smooth-blinking"); + }.bind(this)); + } + + var blink = function(){ + this.timeoutId = setTimeout(function() { + update(false); + }, 0.6 * this.blinkInterval); + }.bind(this); + + this.intervalId = setInterval(function() { + update(true); + blink(); + }, this.blinkInterval); + + blink(); + }; + + this.getPixelPosition = function(position, onScreen) { + if (!this.config || !this.session) + return {left : 0, top : 0}; + + if (!position) + position = this.session.selection.getCursor(); + var pos = this.session.documentToScreenPosition(position); + var cursorLeft = this.$padding + pos.column * this.config.characterWidth; + var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * + this.config.lineHeight; + + return {left : cursorLeft, top : cursorTop}; + }; + + this.update = function(config) { + this.config = config; + + var selections = this.session.$selectionMarkers; + var i = 0, cursorIndex = 0; + + if (selections === undefined || selections.length === 0){ + selections = [{cursor: null}]; + } + + for (var i = 0, n = selections.length; i < n; i++) { + var pixelPos = this.getPixelPosition(selections[i].cursor, true); + if ((pixelPos.top > config.height + config.offset || + pixelPos.top < 0) && i > 1) { + continue; + } + + var style = (this.cursors[cursorIndex++] || this.addCursor()).style; + + if (!this.drawCursor) { + style.left = pixelPos.left + "px"; + style.top = pixelPos.top + "px"; + style.width = config.characterWidth + "px"; + style.height = config.lineHeight + "px"; + } else { + this.drawCursor(style, pixelPos, config, selections[i], this.session); + } + } + while (this.cursors.length > cursorIndex) + this.removeCursor(); + + var overwrite = this.session.getOverwrite(); + this.$setOverwrite(overwrite); + this.$pixelPos = pixelPos; + this.restartTimer(); + }; + + this.drawCursor = null; + + this.$setOverwrite = function(overwrite) { + if (overwrite != this.overwrite) { + this.overwrite = overwrite; + if (overwrite) + dom.addCssClass(this.element, "ace_overwrite-cursors"); + else + dom.removeCssClass(this.element, "ace_overwrite-cursors"); + } + }; + + this.destroy = function() { + clearInterval(this.intervalId); + clearTimeout(this.timeoutId); + }; + +}).call(Cursor.prototype); + +exports.Cursor = Cursor; + +}); + +ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var event = require("./lib/event"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var MAX_SCROLL_H = 0x8000; +var ScrollBar = function(parent) { + this.element = dom.createElement("div"); + this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix; + + this.inner = dom.createElement("div"); + this.inner.className = "ace_scrollbar-inner"; + this.element.appendChild(this.inner); + + parent.appendChild(this.element); + + this.setVisible(false); + this.skipEvent = false; + + event.addListener(this.element, "scroll", this.onScroll.bind(this)); + event.addListener(this.element, "mousedown", event.preventDefault); +}; + +(function() { + oop.implement(this, EventEmitter); + + this.setVisible = function(isVisible) { + this.element.style.display = isVisible ? "" : "none"; + this.isVisible = isVisible; + this.coeff = 1; + }; +}).call(ScrollBar.prototype); +var VScrollBar = function(parent, renderer) { + ScrollBar.call(this, parent); + this.scrollTop = 0; + this.scrollHeight = 0; + renderer.$scrollbarWidth = + this.width = dom.scrollbarWidth(parent.ownerDocument); + this.inner.style.width = + this.element.style.width = (this.width || 15) + 5 + "px"; + this.$minWidth = 0; +}; + +oop.inherits(VScrollBar, ScrollBar); + +(function() { + + this.classSuffix = '-v'; + this.onScroll = function() { + if (!this.skipEvent) { + this.scrollTop = this.element.scrollTop; + if (this.coeff != 1) { + var h = this.element.clientHeight / this.scrollHeight; + this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h); + } + this._emit("scroll", {data: this.scrollTop}); + } + this.skipEvent = false; + }; + this.getWidth = function() { + return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0); + }; + this.setHeight = function(height) { + this.element.style.height = height + "px"; + }; + this.setInnerHeight = + this.setScrollHeight = function(height) { + this.scrollHeight = height; + if (height > MAX_SCROLL_H) { + this.coeff = MAX_SCROLL_H / height; + height = MAX_SCROLL_H; + } else if (this.coeff != 1) { + this.coeff = 1 + } + this.inner.style.height = height + "px"; + }; + this.setScrollTop = function(scrollTop) { + if (this.scrollTop != scrollTop) { + this.skipEvent = true; + this.scrollTop = scrollTop; + this.element.scrollTop = scrollTop * this.coeff; + } + }; + +}).call(VScrollBar.prototype); +var HScrollBar = function(parent, renderer) { + ScrollBar.call(this, parent); + this.scrollLeft = 0; + this.height = renderer.$scrollbarWidth; + this.inner.style.height = + this.element.style.height = (this.height || 15) + 5 + "px"; +}; + +oop.inherits(HScrollBar, ScrollBar); + +(function() { + + this.classSuffix = '-h'; + this.onScroll = function() { + if (!this.skipEvent) { + this.scrollLeft = this.element.scrollLeft; + this._emit("scroll", {data: this.scrollLeft}); + } + this.skipEvent = false; + }; + this.getHeight = function() { + return this.isVisible ? this.height : 0; + }; + this.setWidth = function(width) { + this.element.style.width = width + "px"; + }; + this.setInnerWidth = function(width) { + this.inner.style.width = width + "px"; + }; + this.setScrollWidth = function(width) { + this.inner.style.width = width + "px"; + }; + this.setScrollLeft = function(scrollLeft) { + if (this.scrollLeft != scrollLeft) { + this.skipEvent = true; + this.scrollLeft = this.element.scrollLeft = scrollLeft; + } + }; + +}).call(HScrollBar.prototype); + + +exports.ScrollBar = VScrollBar; // backward compatibility +exports.ScrollBarV = VScrollBar; // backward compatibility +exports.ScrollBarH = HScrollBar; // backward compatibility + +exports.VScrollBar = VScrollBar; +exports.HScrollBar = HScrollBar; +}); + +ace.define("ace/renderloop",["require","exports","module","ace/lib/event"], function(require, exports, module) { +"use strict"; + +var event = require("./lib/event"); + + +var RenderLoop = function(onRender, win) { + this.onRender = onRender; + this.pending = false; + this.changes = 0; + this.window = win || window; +}; + +(function() { + + + this.schedule = function(change) { + this.changes = this.changes | change; + if (!this.pending && this.changes) { + this.pending = true; + var _self = this; + event.nextFrame(function() { + _self.pending = false; + var changes; + while (changes = _self.changes) { + _self.changes = 0; + _self.onRender(changes); + } + }, this.window); + } + }; + +}).call(RenderLoop.prototype); + +exports.RenderLoop = RenderLoop; +}); + +ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var dom = require("../lib/dom"); +var lang = require("../lib/lang"); +var useragent = require("../lib/useragent"); +var EventEmitter = require("../lib/event_emitter").EventEmitter; + +var CHAR_COUNT = 0; + +var FontMetrics = exports.FontMetrics = function(parentEl) { + this.el = dom.createElement("div"); + this.$setMeasureNodeStyles(this.el.style, true); + + this.$main = dom.createElement("div"); + this.$setMeasureNodeStyles(this.$main.style); + + this.$measureNode = dom.createElement("div"); + this.$setMeasureNodeStyles(this.$measureNode.style); + + + this.el.appendChild(this.$main); + this.el.appendChild(this.$measureNode); + parentEl.appendChild(this.el); + + if (!CHAR_COUNT) + this.$testFractionalRect(); + this.$measureNode.innerHTML = lang.stringRepeat("X", CHAR_COUNT); + + this.$characterSize = {width: 0, height: 0}; + this.checkForSizeChanges(); +}; + +(function() { + + oop.implement(this, EventEmitter); + + this.$characterSize = {width: 0, height: 0}; + + this.$testFractionalRect = function() { + var el = dom.createElement("div"); + this.$setMeasureNodeStyles(el.style); + el.style.width = "0.2px"; + document.documentElement.appendChild(el); + var w = el.getBoundingClientRect().width; + if (w > 0 && w < 1) + CHAR_COUNT = 50; + else + CHAR_COUNT = 100; + el.parentNode.removeChild(el); + }; + + this.$setMeasureNodeStyles = function(style, isRoot) { + style.width = style.height = "auto"; + style.left = style.top = "0px"; + style.visibility = "hidden"; + style.position = "absolute"; + style.whiteSpace = "pre"; + + if (useragent.isIE < 8) { + style["font-family"] = "inherit"; + } else { + style.font = "inherit"; + } + style.overflow = isRoot ? "hidden" : "visible"; + }; + + this.checkForSizeChanges = function() { + var size = this.$measureSizes(); + if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { + this.$measureNode.style.fontWeight = "bold"; + var boldSize = this.$measureSizes(); + this.$measureNode.style.fontWeight = ""; + this.$characterSize = size; + this.charSizes = Object.create(null); + this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height; + this._emit("changeCharacterSize", {data: size}); + } + }; + + this.$pollSizeChanges = function() { + if (this.$pollSizeChangesTimer) + return this.$pollSizeChangesTimer; + var self = this; + return this.$pollSizeChangesTimer = setInterval(function() { + self.checkForSizeChanges(); + }, 500); + }; + + this.setPolling = function(val) { + if (val) { + this.$pollSizeChanges(); + } else if (this.$pollSizeChangesTimer) { + clearInterval(this.$pollSizeChangesTimer); + this.$pollSizeChangesTimer = 0; + } + }; + + this.$measureSizes = function() { + if (CHAR_COUNT === 50) { + var rect = null; + try { + rect = this.$measureNode.getBoundingClientRect(); + } catch(e) { + rect = {width: 0, height:0 }; + } + var size = { + height: rect.height, + width: rect.width / CHAR_COUNT + }; + } else { + var size = { + height: this.$measureNode.clientHeight, + width: this.$measureNode.clientWidth / CHAR_COUNT + }; + } + if (size.width === 0 || size.height === 0) + return null; + return size; + }; + + this.$measureCharWidth = function(ch) { + this.$main.innerHTML = lang.stringRepeat(ch, CHAR_COUNT); + var rect = this.$main.getBoundingClientRect(); + return rect.width / CHAR_COUNT; + }; + + this.getCharacterWidth = function(ch) { + var w = this.charSizes[ch]; + if (w === undefined) { + w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width; + } + return w; + }; + + this.destroy = function() { + clearInterval(this.$pollSizeChangesTimer); + if (this.el && this.el.parentNode) + this.el.parentNode.removeChild(this.el); + }; + +}).call(FontMetrics.prototype); + +}); + +ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/lib/useragent","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var config = require("./config"); +var useragent = require("./lib/useragent"); +var GutterLayer = require("./layer/gutter").Gutter; +var MarkerLayer = require("./layer/marker").Marker; +var TextLayer = require("./layer/text").Text; +var CursorLayer = require("./layer/cursor").Cursor; +var HScrollBar = require("./scrollbar").HScrollBar; +var VScrollBar = require("./scrollbar").VScrollBar; +var RenderLoop = require("./renderloop").RenderLoop; +var FontMetrics = require("./layer/font_metrics").FontMetrics; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var editorCss = ".ace_editor {\ +position: relative;\ +overflow: hidden;\ +font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\ +direction: ltr;\ +text-align: left;\ +-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\ +}\ +.ace_scroller {\ +position: absolute;\ +overflow: hidden;\ +top: 0;\ +bottom: 0;\ +background-color: inherit;\ +-ms-user-select: none;\ +-moz-user-select: none;\ +-webkit-user-select: none;\ +user-select: none;\ +cursor: text;\ +}\ +.ace_content {\ +position: absolute;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +min-width: 100%;\ +}\ +.ace_dragging .ace_scroller:before{\ +position: absolute;\ +top: 0;\ +left: 0;\ +right: 0;\ +bottom: 0;\ +content: '';\ +background: rgba(250, 250, 250, 0.01);\ +z-index: 1000;\ +}\ +.ace_dragging.ace_dark .ace_scroller:before{\ +background: rgba(0, 0, 0, 0.01);\ +}\ +.ace_selecting, .ace_selecting * {\ +cursor: text !important;\ +}\ +.ace_gutter {\ +position: absolute;\ +overflow : hidden;\ +width: auto;\ +top: 0;\ +bottom: 0;\ +left: 0;\ +cursor: default;\ +z-index: 4;\ +-ms-user-select: none;\ +-moz-user-select: none;\ +-webkit-user-select: none;\ +user-select: none;\ +}\ +.ace_gutter-active-line {\ +position: absolute;\ +left: 0;\ +right: 0;\ +}\ +.ace_scroller.ace_scroll-left {\ +box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\ +}\ +.ace_gutter-cell {\ +padding-left: 19px;\ +padding-right: 6px;\ +background-repeat: no-repeat;\ +}\ +.ace_gutter-cell.ace_error {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\ +background-repeat: no-repeat;\ +background-position: 2px center;\ +}\ +.ace_gutter-cell.ace_warning {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\ +background-position: 2px center;\ +}\ +.ace_gutter-cell.ace_info {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\ +background-position: 2px center;\ +}\ +.ace_dark .ace_gutter-cell.ace_info {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\ +}\ +.ace_scrollbar {\ +position: absolute;\ +right: 0;\ +bottom: 0;\ +z-index: 6;\ +}\ +.ace_scrollbar-inner {\ +position: absolute;\ +cursor: text;\ +left: 0;\ +top: 0;\ +}\ +.ace_scrollbar-v{\ +overflow-x: hidden;\ +overflow-y: scroll;\ +top: 0;\ +}\ +.ace_scrollbar-h {\ +overflow-x: scroll;\ +overflow-y: hidden;\ +left: 0;\ +}\ +.ace_print-margin {\ +position: absolute;\ +height: 100%;\ +}\ +.ace_text-input {\ +position: absolute;\ +z-index: 0;\ +width: 0.5em;\ +height: 1em;\ +opacity: 0;\ +background: transparent;\ +-moz-appearance: none;\ +appearance: none;\ +border: none;\ +resize: none;\ +outline: none;\ +overflow: hidden;\ +font: inherit;\ +padding: 0 1px;\ +margin: 0 -1px;\ +text-indent: -1em;\ +-ms-user-select: text;\ +-moz-user-select: text;\ +-webkit-user-select: text;\ +user-select: text;\ +white-space: pre!important;\ +}\ +.ace_text-input.ace_composition {\ +background: inherit;\ +color: inherit;\ +z-index: 1000;\ +opacity: 1;\ +text-indent: 0;\ +}\ +.ace_layer {\ +z-index: 1;\ +position: absolute;\ +overflow: hidden;\ +word-wrap: normal;\ +white-space: pre;\ +height: 100%;\ +width: 100%;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +pointer-events: none;\ +}\ +.ace_gutter-layer {\ +position: relative;\ +width: auto;\ +text-align: right;\ +pointer-events: auto;\ +}\ +.ace_text-layer {\ +font: inherit !important;\ +}\ +.ace_cjk {\ +display: inline-block;\ +text-align: center;\ +}\ +.ace_cursor-layer {\ +z-index: 4;\ +}\ +.ace_cursor {\ +z-index: 4;\ +position: absolute;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +border-left: 2px solid;\ +transform: translatez(0);\ +}\ +.ace_multiselect .ace_cursor {\ +border-left-width: 1px;\ +}\ +.ace_slim-cursors .ace_cursor {\ +border-left-width: 1px;\ +}\ +.ace_overwrite-cursors .ace_cursor {\ +border-left-width: 0;\ +border-bottom: 1px solid;\ +}\ +.ace_hidden-cursors .ace_cursor {\ +opacity: 0.2;\ +}\ +.ace_smooth-blinking .ace_cursor {\ +-webkit-transition: opacity 0.18s;\ +transition: opacity 0.18s;\ +}\ +.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\ +position: absolute;\ +z-index: 3;\ +}\ +.ace_marker-layer .ace_selection {\ +position: absolute;\ +z-index: 5;\ +}\ +.ace_marker-layer .ace_bracket {\ +position: absolute;\ +z-index: 6;\ +}\ +.ace_marker-layer .ace_active-line {\ +position: absolute;\ +z-index: 2;\ +}\ +.ace_marker-layer .ace_selected-word {\ +position: absolute;\ +z-index: 4;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +}\ +.ace_line .ace_fold {\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +display: inline-block;\ +height: 11px;\ +margin-top: -2px;\ +vertical-align: middle;\ +background-image:\ +url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\ +url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\ +background-repeat: no-repeat, repeat-x;\ +background-position: center center, top left;\ +color: transparent;\ +border: 1px solid black;\ +border-radius: 2px;\ +cursor: pointer;\ +pointer-events: auto;\ +}\ +.ace_dark .ace_fold {\ +}\ +.ace_fold:hover{\ +background-image:\ +url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\ +url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\ +}\ +.ace_tooltip {\ +background-color: #FFF;\ +background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));\ +background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));\ +border: 1px solid gray;\ +border-radius: 1px;\ +box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\ +color: black;\ +max-width: 100%;\ +padding: 3px 4px;\ +position: fixed;\ +z-index: 999999;\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +cursor: default;\ +white-space: pre;\ +word-wrap: break-word;\ +line-height: normal;\ +font-style: normal;\ +font-weight: normal;\ +letter-spacing: normal;\ +pointer-events: none;\ +}\ +.ace_folding-enabled > .ace_gutter-cell {\ +padding-right: 13px;\ +}\ +.ace_fold-widget {\ +-moz-box-sizing: border-box;\ +-webkit-box-sizing: border-box;\ +box-sizing: border-box;\ +margin: 0 -12px 0 1px;\ +display: none;\ +width: 11px;\ +vertical-align: top;\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\ +background-repeat: no-repeat;\ +background-position: center;\ +border-radius: 3px;\ +border: 1px solid transparent;\ +cursor: pointer;\ +}\ +.ace_folding-enabled .ace_fold-widget {\ +display: inline-block; \ +}\ +.ace_fold-widget.ace_end {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\ +}\ +.ace_fold-widget.ace_closed {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\ +}\ +.ace_fold-widget:hover {\ +border: 1px solid rgba(0, 0, 0, 0.3);\ +background-color: rgba(255, 255, 255, 0.2);\ +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ +}\ +.ace_fold-widget:active {\ +border: 1px solid rgba(0, 0, 0, 0.4);\ +background-color: rgba(0, 0, 0, 0.05);\ +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ +}\ +.ace_dark .ace_fold-widget {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\ +}\ +.ace_dark .ace_fold-widget.ace_end {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\ +}\ +.ace_dark .ace_fold-widget.ace_closed {\ +background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\ +}\ +.ace_dark .ace_fold-widget:hover {\ +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ +background-color: rgba(255, 255, 255, 0.1);\ +}\ +.ace_dark .ace_fold-widget:active {\ +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ +}\ +.ace_fold-widget.ace_invalid {\ +background-color: #FFB4B4;\ +border-color: #DE5555;\ +}\ +.ace_fade-fold-widgets .ace_fold-widget {\ +-webkit-transition: opacity 0.4s ease 0.05s;\ +transition: opacity 0.4s ease 0.05s;\ +opacity: 0;\ +}\ +.ace_fade-fold-widgets:hover .ace_fold-widget {\ +-webkit-transition: opacity 0.05s ease 0.05s;\ +transition: opacity 0.05s ease 0.05s;\ +opacity:1;\ +}\ +.ace_underline {\ +text-decoration: underline;\ +}\ +.ace_bold {\ +font-weight: bold;\ +}\ +.ace_nobold .ace_bold {\ +font-weight: normal;\ +}\ +.ace_italic {\ +font-style: italic;\ +}\ +.ace_error-marker {\ +background-color: rgba(255, 0, 0,0.2);\ +position: absolute;\ +z-index: 9;\ +}\ +.ace_highlight-marker {\ +background-color: rgba(255, 255, 0,0.2);\ +position: absolute;\ +z-index: 8;\ +}\ +.ace_br1 {border-top-left-radius : 3px;}\ +.ace_br2 {border-top-right-radius : 3px;}\ +.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\ +.ace_br4 {border-bottom-right-radius: 3px;}\ +.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\ +.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\ +.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\ +.ace_br8 {border-bottom-left-radius : 3px;}\ +.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\ +.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\ +.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\ +.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\ +.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\ +.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\ +.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\ +.ace_text-input-ios {\ +position: absolute !important;\ +top: -100000px !important;\ +left: -100000px !important;\ +}\ +"; + +dom.importCssString(editorCss, "ace_editor.css"); + +var VirtualRenderer = function(container, theme) { + var _self = this; + + this.container = container || dom.createElement("div"); + this.$keepTextAreaAtCursor = !useragent.isOldIE; + + dom.addCssClass(this.container, "ace_editor"); + + this.setTheme(theme); + + this.$gutter = dom.createElement("div"); + this.$gutter.className = "ace_gutter"; + this.container.appendChild(this.$gutter); + + this.scroller = dom.createElement("div"); + this.scroller.className = "ace_scroller"; + this.container.appendChild(this.scroller); + + this.content = dom.createElement("div"); + this.content.className = "ace_content"; + this.scroller.appendChild(this.content); + + this.$gutterLayer = new GutterLayer(this.$gutter); + this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)); + + this.$markerBack = new MarkerLayer(this.content); + + var textLayer = this.$textLayer = new TextLayer(this.content); + this.canvas = textLayer.element; + + this.$markerFront = new MarkerLayer(this.content); + + this.$cursorLayer = new CursorLayer(this.content); + this.$horizScroll = false; + this.$vScroll = false; + + this.scrollBar = + this.scrollBarV = new VScrollBar(this.container, this); + this.scrollBarH = new HScrollBar(this.container, this); + this.scrollBarV.addEventListener("scroll", function(e) { + if (!_self.$scrollAnimation) + _self.session.setScrollTop(e.data - _self.scrollMargin.top); + }); + this.scrollBarH.addEventListener("scroll", function(e) { + if (!_self.$scrollAnimation) + _self.session.setScrollLeft(e.data - _self.scrollMargin.left); + }); + + this.scrollTop = 0; + this.scrollLeft = 0; + + this.cursorPos = { + row : 0, + column : 0 + }; + + this.$fontMetrics = new FontMetrics(this.container); + this.$textLayer.$setFontMetrics(this.$fontMetrics); + this.$textLayer.addEventListener("changeCharacterSize", function(e) { + _self.updateCharacterSize(); + _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); + _self._signal("changeCharacterSize", e); + }); + + this.$size = { + width: 0, + height: 0, + scrollerHeight: 0, + scrollerWidth: 0, + $dirty: true + }; + + this.layerConfig = { + width : 1, + padding : 0, + firstRow : 0, + firstRowScreen: 0, + lastRow : 0, + lineHeight : 0, + characterWidth : 0, + minHeight : 1, + maxHeight : 1, + offset : 0, + height : 1, + gutterOffset: 1 + }; + + this.scrollMargin = { + left: 0, + right: 0, + top: 0, + bottom: 0, + v: 0, + h: 0 + }; + + this.$loop = new RenderLoop( + this.$renderChanges.bind(this), + this.container.ownerDocument.defaultView + ); + this.$loop.schedule(this.CHANGE_FULL); + + this.updateCharacterSize(); + this.setPadding(4); + config.resetOptions(this); + config._emit("renderer", this); +}; + +(function() { + + this.CHANGE_CURSOR = 1; + this.CHANGE_MARKER = 2; + this.CHANGE_GUTTER = 4; + this.CHANGE_SCROLL = 8; + this.CHANGE_LINES = 16; + this.CHANGE_TEXT = 32; + this.CHANGE_SIZE = 64; + this.CHANGE_MARKER_BACK = 128; + this.CHANGE_MARKER_FRONT = 256; + this.CHANGE_FULL = 512; + this.CHANGE_H_SCROLL = 1024; + + oop.implement(this, EventEmitter); + + this.updateCharacterSize = function() { + if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) { + this.$allowBoldFonts = this.$textLayer.allowBoldFonts; + this.setStyle("ace_nobold", !this.$allowBoldFonts); + } + + this.layerConfig.characterWidth = + this.characterWidth = this.$textLayer.getCharacterWidth(); + this.layerConfig.lineHeight = + this.lineHeight = this.$textLayer.getLineHeight(); + this.$updatePrintMargin(); + }; + this.setSession = function(session) { + if (this.session) + this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode); + + this.session = session; + if (session && this.scrollMargin.top && session.getScrollTop() <= 0) + session.setScrollTop(-this.scrollMargin.top); + + this.$cursorLayer.setSession(session); + this.$markerBack.setSession(session); + this.$markerFront.setSession(session); + this.$gutterLayer.setSession(session); + this.$textLayer.setSession(session); + if (!session) + return; + + this.$loop.schedule(this.CHANGE_FULL); + this.session.$setFontMetrics(this.$fontMetrics); + this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null; + + this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this); + this.onChangeNewLineMode() + this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode); + }; + this.updateLines = function(firstRow, lastRow, force) { + if (lastRow === undefined) + lastRow = Infinity; + + if (!this.$changedLines) { + this.$changedLines = { + firstRow: firstRow, + lastRow: lastRow + }; + } + else { + if (this.$changedLines.firstRow > firstRow) + this.$changedLines.firstRow = firstRow; + + if (this.$changedLines.lastRow < lastRow) + this.$changedLines.lastRow = lastRow; + } + if (this.$changedLines.lastRow < this.layerConfig.firstRow) { + if (force) + this.$changedLines.lastRow = this.layerConfig.lastRow; + else + return; + } + if (this.$changedLines.firstRow > this.layerConfig.lastRow) + return; + this.$loop.schedule(this.CHANGE_LINES); + }; + + this.onChangeNewLineMode = function() { + this.$loop.schedule(this.CHANGE_TEXT); + this.$textLayer.$updateEolChar(); + }; + + this.onChangeTabSize = function() { + this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); + this.$textLayer.onChangeTabSize(); + }; + this.updateText = function() { + this.$loop.schedule(this.CHANGE_TEXT); + }; + this.updateFull = function(force) { + if (force) + this.$renderChanges(this.CHANGE_FULL, true); + else + this.$loop.schedule(this.CHANGE_FULL); + }; + this.updateFontSize = function() { + this.$textLayer.checkForSizeChanges(); + }; + + this.$changes = 0; + this.$updateSizeAsync = function() { + if (this.$loop.pending) + this.$size.$dirty = true; + else + this.onResize(); + }; + this.onResize = function(force, gutterWidth, width, height) { + if (this.resizing > 2) + return; + else if (this.resizing > 0) + this.resizing++; + else + this.resizing = force ? 1 : 0; + var el = this.container; + if (!height) + height = el.clientHeight || el.scrollHeight; + if (!width) + width = el.clientWidth || el.scrollWidth; + var changes = this.$updateCachedSize(force, gutterWidth, width, height); + + + if (!this.$size.scrollerHeight || (!width && !height)) + return this.resizing = 0; + + if (force) + this.$gutterLayer.$padding = null; + + if (force) + this.$renderChanges(changes | this.$changes, true); + else + this.$loop.schedule(changes | this.$changes); + + if (this.resizing) + this.resizing = 0; + this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null; + }; + + this.$updateCachedSize = function(force, gutterWidth, width, height) { + height -= (this.$extraHeight || 0); + var changes = 0; + var size = this.$size; + var oldSize = { + width: size.width, + height: size.height, + scrollerHeight: size.scrollerHeight, + scrollerWidth: size.scrollerWidth + }; + if (height && (force || size.height != height)) { + size.height = height; + changes |= this.CHANGE_SIZE; + + size.scrollerHeight = size.height; + if (this.$horizScroll) + size.scrollerHeight -= this.scrollBarH.getHeight(); + this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px"; + + changes = changes | this.CHANGE_SCROLL; + } + + if (width && (force || size.width != width)) { + changes |= this.CHANGE_SIZE; + size.width = width; + + if (gutterWidth == null) + gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; + + this.gutterWidth = gutterWidth; + + this.scrollBarH.element.style.left = + this.scroller.style.left = gutterWidth + "px"; + size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth()); + + this.scrollBarH.element.style.right = + this.scroller.style.right = this.scrollBarV.getWidth() + "px"; + this.scroller.style.bottom = this.scrollBarH.getHeight() + "px"; + + if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) + changes |= this.CHANGE_FULL; + } + + size.$dirty = !width || !height; + + if (changes) + this._signal("resize", oldSize); + + return changes; + }; + + this.onGutterResize = function() { + var gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; + if (gutterWidth != this.gutterWidth) + this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height); + + if (this.session.getUseWrapMode() && this.adjustWrapLimit()) { + this.$loop.schedule(this.CHANGE_FULL); + } else if (this.$size.$dirty) { + this.$loop.schedule(this.CHANGE_FULL); + } else { + this.$computeLayerConfig(); + this.$loop.schedule(this.CHANGE_MARKER); + } + }; + this.adjustWrapLimit = function() { + var availableWidth = this.$size.scrollerWidth - this.$padding * 2; + var limit = Math.floor(availableWidth / this.characterWidth); + return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn); + }; + this.setAnimatedScroll = function(shouldAnimate){ + this.setOption("animatedScroll", shouldAnimate); + }; + this.getAnimatedScroll = function() { + return this.$animatedScroll; + }; + this.setShowInvisibles = function(showInvisibles) { + this.setOption("showInvisibles", showInvisibles); + }; + this.getShowInvisibles = function() { + return this.getOption("showInvisibles"); + }; + this.getDisplayIndentGuides = function() { + return this.getOption("displayIndentGuides"); + }; + + this.setDisplayIndentGuides = function(display) { + this.setOption("displayIndentGuides", display); + }; + this.setShowPrintMargin = function(showPrintMargin) { + this.setOption("showPrintMargin", showPrintMargin); + }; + this.getShowPrintMargin = function() { + return this.getOption("showPrintMargin"); + }; + this.setPrintMarginColumn = function(showPrintMargin) { + this.setOption("printMarginColumn", showPrintMargin); + }; + this.getPrintMarginColumn = function() { + return this.getOption("printMarginColumn"); + }; + this.getShowGutter = function(){ + return this.getOption("showGutter"); + }; + this.setShowGutter = function(show){ + return this.setOption("showGutter", show); + }; + + this.getFadeFoldWidgets = function(){ + return this.getOption("fadeFoldWidgets") + }; + + this.setFadeFoldWidgets = function(show) { + this.setOption("fadeFoldWidgets", show); + }; + + this.setHighlightGutterLine = function(shouldHighlight) { + this.setOption("highlightGutterLine", shouldHighlight); + }; + + this.getHighlightGutterLine = function() { + return this.getOption("highlightGutterLine"); + }; + + this.$updateGutterLineHighlight = function() { + var pos = this.$cursorLayer.$pixelPos; + var height = this.layerConfig.lineHeight; + if (this.session.getUseWrapMode()) { + var cursor = this.session.selection.getCursor(); + cursor.column = 0; + pos = this.$cursorLayer.getPixelPosition(cursor, true); + height *= this.session.getRowLength(cursor.row); + } + this.$gutterLineHighlight.style.top = pos.top - this.layerConfig.offset + "px"; + this.$gutterLineHighlight.style.height = height + "px"; + }; + + this.$updatePrintMargin = function() { + if (!this.$showPrintMargin && !this.$printMarginEl) + return; + + if (!this.$printMarginEl) { + var containerEl = dom.createElement("div"); + containerEl.className = "ace_layer ace_print-margin-layer"; + this.$printMarginEl = dom.createElement("div"); + this.$printMarginEl.className = "ace_print-margin"; + containerEl.appendChild(this.$printMarginEl); + this.content.insertBefore(containerEl, this.content.firstChild); + } + + var style = this.$printMarginEl.style; + style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px"; + style.visibility = this.$showPrintMargin ? "visible" : "hidden"; + + if (this.session && this.session.$wrap == -1) + this.adjustWrapLimit(); + }; + this.getContainerElement = function() { + return this.container; + }; + this.getMouseEventTarget = function() { + return this.scroller; + }; + this.getTextAreaContainer = function() { + return this.container; + }; + this.$moveTextAreaToCursor = function() { + if (!this.$keepTextAreaAtCursor) + return; + var config = this.layerConfig; + var posTop = this.$cursorLayer.$pixelPos.top; + var posLeft = this.$cursorLayer.$pixelPos.left; + posTop -= config.offset; + + var style = this.textarea.style; + var h = this.lineHeight; + if (posTop < 0 || posTop > config.height - h) { + style.top = style.left = "0"; + return; + } + + var w = this.characterWidth; + if (this.$composition) { + var val = this.textarea.value.replace(/^\x01+/, ""); + w *= (this.session.$getStringScreenWidth(val)[0]+2); + h += 2; + } + posLeft -= this.scrollLeft; + if (posLeft > this.$size.scrollerWidth - w) + posLeft = this.$size.scrollerWidth - w; + + posLeft += this.gutterWidth; + style.height = h + "px"; + style.width = w + "px"; + style.left = Math.min(posLeft, this.$size.scrollerWidth - w) + "px"; + style.top = Math.min(posTop, this.$size.height - h) + "px"; + }; + this.getFirstVisibleRow = function() { + return this.layerConfig.firstRow; + }; + this.getFirstFullyVisibleRow = function() { + return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); + }; + this.getLastFullyVisibleRow = function() { + var config = this.layerConfig; + var lastRow = config.lastRow + var top = this.session.documentToScreenRow(lastRow, 0) * config.lineHeight; + if (top - this.session.getScrollTop() > config.height - config.lineHeight) + return lastRow - 1; + return lastRow; + }; + this.getLastVisibleRow = function() { + return this.layerConfig.lastRow; + }; + + this.$padding = null; + this.setPadding = function(padding) { + this.$padding = padding; + this.$textLayer.setPadding(padding); + this.$cursorLayer.setPadding(padding); + this.$markerFront.setPadding(padding); + this.$markerBack.setPadding(padding); + this.$loop.schedule(this.CHANGE_FULL); + this.$updatePrintMargin(); + }; + + this.setScrollMargin = function(top, bottom, left, right) { + var sm = this.scrollMargin; + sm.top = top|0; + sm.bottom = bottom|0; + sm.right = right|0; + sm.left = left|0; + sm.v = sm.top + sm.bottom; + sm.h = sm.left + sm.right; + if (sm.top && this.scrollTop <= 0 && this.session) + this.session.setScrollTop(-sm.top); + this.updateFull(); + }; + this.getHScrollBarAlwaysVisible = function() { + return this.$hScrollBarAlwaysVisible; + }; + this.setHScrollBarAlwaysVisible = function(alwaysVisible) { + this.setOption("hScrollBarAlwaysVisible", alwaysVisible); + }; + this.getVScrollBarAlwaysVisible = function() { + return this.$vScrollBarAlwaysVisible; + }; + this.setVScrollBarAlwaysVisible = function(alwaysVisible) { + this.setOption("vScrollBarAlwaysVisible", alwaysVisible); + }; + + this.$updateScrollBarV = function() { + var scrollHeight = this.layerConfig.maxHeight; + var scrollerHeight = this.$size.scrollerHeight; + if (!this.$maxLines && this.$scrollPastEnd) { + scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd; + if (this.scrollTop > scrollHeight - scrollerHeight) { + scrollHeight = this.scrollTop + scrollerHeight; + this.scrollBarV.scrollTop = null; + } + } + this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v); + this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top); + }; + this.$updateScrollBarH = function() { + this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h); + this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left); + }; + + this.$frozen = false; + this.freeze = function() { + this.$frozen = true; + }; + + this.unfreeze = function() { + this.$frozen = false; + }; + + this.$renderChanges = function(changes, force) { + if (this.$changes) { + changes |= this.$changes; + this.$changes = 0; + } + if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) { + this.$changes |= changes; + return; + } + if (this.$size.$dirty) { + this.$changes |= changes; + return this.onResize(true); + } + if (!this.lineHeight) { + this.$textLayer.checkForSizeChanges(); + } + + this._signal("beforeRender"); + var config = this.layerConfig; + if (changes & this.CHANGE_FULL || + changes & this.CHANGE_SIZE || + changes & this.CHANGE_TEXT || + changes & this.CHANGE_LINES || + changes & this.CHANGE_SCROLL || + changes & this.CHANGE_H_SCROLL + ) { + changes |= this.$computeLayerConfig(); + if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) { + var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight; + if (st > 0) { + this.scrollTop = st; + changes = changes | this.CHANGE_SCROLL; + changes |= this.$computeLayerConfig(); + } + } + config = this.layerConfig; + this.$updateScrollBarV(); + if (changes & this.CHANGE_H_SCROLL) + this.$updateScrollBarH(); + this.$gutterLayer.element.style.marginTop = (-config.offset) + "px"; + this.content.style.marginTop = (-config.offset) + "px"; + this.content.style.width = config.width + 2 * this.$padding + "px"; + this.content.style.height = config.minHeight + "px"; + } + if (changes & this.CHANGE_H_SCROLL) { + this.content.style.marginLeft = -this.scrollLeft + "px"; + this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left"; + } + if (changes & this.CHANGE_FULL) { + this.$textLayer.update(config); + if (this.$showGutter) + this.$gutterLayer.update(config); + this.$markerBack.update(config); + this.$markerFront.update(config); + this.$cursorLayer.update(config); + this.$moveTextAreaToCursor(); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + this._signal("afterRender"); + return; + } + if (changes & this.CHANGE_SCROLL) { + if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES) + this.$textLayer.update(config); + else + this.$textLayer.scrollLines(config); + + if (this.$showGutter) + this.$gutterLayer.update(config); + this.$markerBack.update(config); + this.$markerFront.update(config); + this.$cursorLayer.update(config); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + this.$moveTextAreaToCursor(); + this._signal("afterRender"); + return; + } + + if (changes & this.CHANGE_TEXT) { + this.$textLayer.update(config); + if (this.$showGutter) + this.$gutterLayer.update(config); + } + else if (changes & this.CHANGE_LINES) { + if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter) + this.$gutterLayer.update(config); + } + else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) { + if (this.$showGutter) + this.$gutterLayer.update(config); + } + + if (changes & this.CHANGE_CURSOR) { + this.$cursorLayer.update(config); + this.$moveTextAreaToCursor(); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); + } + + if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { + this.$markerFront.update(config); + } + + if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { + this.$markerBack.update(config); + } + + this._signal("afterRender"); + }; + + + this.$autosize = function() { + var height = this.session.getScreenLength() * this.lineHeight; + var maxHeight = this.$maxLines * this.lineHeight; + var desiredHeight = Math.min(maxHeight, + Math.max((this.$minLines || 1) * this.lineHeight, height) + ) + this.scrollMargin.v + (this.$extraHeight || 0); + if (this.$horizScroll) + desiredHeight += this.scrollBarH.getHeight(); + if (this.$maxPixelHeight && desiredHeight > this.$maxPixelHeight) + desiredHeight = this.$maxPixelHeight; + var vScroll = height > maxHeight; + + if (desiredHeight != this.desiredHeight || + this.$size.height != this.desiredHeight || vScroll != this.$vScroll) { + if (vScroll != this.$vScroll) { + this.$vScroll = vScroll; + this.scrollBarV.setVisible(vScroll); + } + + var w = this.container.clientWidth; + this.container.style.height = desiredHeight + "px"; + this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight); + this.desiredHeight = desiredHeight; + + this._signal("autosize"); + } + }; + + this.$computeLayerConfig = function() { + var session = this.session; + var size = this.$size; + + var hideScrollbars = size.height <= 2 * this.lineHeight; + var screenLines = this.session.getScreenLength(); + var maxHeight = screenLines * this.lineHeight; + + var longestLine = this.$getLongestLine(); + + var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible || + size.scrollerWidth - longestLine - 2 * this.$padding < 0); + + var hScrollChanged = this.$horizScroll !== horizScroll; + if (hScrollChanged) { + this.$horizScroll = horizScroll; + this.scrollBarH.setVisible(horizScroll); + } + var vScrollBefore = this.$vScroll; // autosize can change vscroll value in which case we need to update longestLine + if (this.$maxLines && this.lineHeight > 1) + this.$autosize(); + + var offset = this.scrollTop % this.lineHeight; + var minHeight = size.scrollerHeight + this.lineHeight; + + var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd + ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd + : 0; + maxHeight += scrollPastEnd; + + var sm = this.scrollMargin; + this.session.setScrollTop(Math.max(-sm.top, + Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom))); + + this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, + longestLine + 2 * this.$padding - size.scrollerWidth + sm.right))); + + var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || + size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop > sm.top); + var vScrollChanged = vScrollBefore !== vScroll; + if (vScrollChanged) { + this.$vScroll = vScroll; + this.scrollBarV.setVisible(vScroll); + } + + var lineCount = Math.ceil(minHeight / this.lineHeight) - 1; + var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight)); + var lastRow = firstRow + lineCount; + var firstRowScreen, firstRowHeight; + var lineHeight = this.lineHeight; + firstRow = session.screenToDocumentRow(firstRow, 0); + var foldLine = session.getFoldLine(firstRow); + if (foldLine) { + firstRow = foldLine.start.row; + } + + firstRowScreen = session.documentToScreenRow(firstRow, 0); + firstRowHeight = session.getRowLength(firstRow) * lineHeight; + + lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); + minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + + firstRowHeight; + + offset = this.scrollTop - firstRowScreen * lineHeight; + + var changes = 0; + if (this.layerConfig.width != longestLine) + changes = this.CHANGE_H_SCROLL; + if (hScrollChanged || vScrollChanged) { + changes = this.$updateCachedSize(true, this.gutterWidth, size.width, size.height); + this._signal("scrollbarVisibilityChanged"); + if (vScrollChanged) + longestLine = this.$getLongestLine(); + } + + this.layerConfig = { + width : longestLine, + padding : this.$padding, + firstRow : firstRow, + firstRowScreen: firstRowScreen, + lastRow : lastRow, + lineHeight : lineHeight, + characterWidth : this.characterWidth, + minHeight : minHeight, + maxHeight : maxHeight, + offset : offset, + gutterOffset : lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0, + height : this.$size.scrollerHeight + }; + + return changes; + }; + + this.$updateLines = function() { + if (!this.$changedLines) return; + var firstRow = this.$changedLines.firstRow; + var lastRow = this.$changedLines.lastRow; + this.$changedLines = null; + + var layerConfig = this.layerConfig; + + if (firstRow > layerConfig.lastRow + 1) { return; } + if (lastRow < layerConfig.firstRow) { return; } + if (lastRow === Infinity) { + if (this.$showGutter) + this.$gutterLayer.update(layerConfig); + this.$textLayer.update(layerConfig); + return; + } + this.$textLayer.updateLines(layerConfig, firstRow, lastRow); + return true; + }; + + this.$getLongestLine = function() { + var charCount = this.session.getScreenWidth(); + if (this.showInvisibles && !this.session.$useWrapMode) + charCount += 1; + + return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth)); + }; + this.updateFrontMarkers = function() { + this.$markerFront.setMarkers(this.session.getMarkers(true)); + this.$loop.schedule(this.CHANGE_MARKER_FRONT); + }; + this.updateBackMarkers = function() { + this.$markerBack.setMarkers(this.session.getMarkers()); + this.$loop.schedule(this.CHANGE_MARKER_BACK); + }; + this.addGutterDecoration = function(row, className){ + this.$gutterLayer.addGutterDecoration(row, className); + }; + this.removeGutterDecoration = function(row, className){ + this.$gutterLayer.removeGutterDecoration(row, className); + }; + this.updateBreakpoints = function(rows) { + this.$loop.schedule(this.CHANGE_GUTTER); + }; + this.setAnnotations = function(annotations) { + this.$gutterLayer.setAnnotations(annotations); + this.$loop.schedule(this.CHANGE_GUTTER); + }; + this.updateCursor = function() { + this.$loop.schedule(this.CHANGE_CURSOR); + }; + this.hideCursor = function() { + this.$cursorLayer.hideCursor(); + }; + this.showCursor = function() { + this.$cursorLayer.showCursor(); + }; + + this.scrollSelectionIntoView = function(anchor, lead, offset) { + this.scrollCursorIntoView(anchor, offset); + this.scrollCursorIntoView(lead, offset); + }; + this.scrollCursorIntoView = function(cursor, offset, $viewMargin) { + if (this.$size.scrollerHeight === 0) + return; + + var pos = this.$cursorLayer.getPixelPosition(cursor); + + var left = pos.left; + var top = pos.top; + + var topMargin = $viewMargin && $viewMargin.top || 0; + var bottomMargin = $viewMargin && $viewMargin.bottom || 0; + + var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop; + + if (scrollTop + topMargin > top) { + if (offset && scrollTop + topMargin > top + this.lineHeight) + top -= offset * this.$size.scrollerHeight; + if (top === 0) + top = -this.scrollMargin.top; + this.session.setScrollTop(top); + } else if (scrollTop + this.$size.scrollerHeight - bottomMargin < top + this.lineHeight) { + if (offset && scrollTop + this.$size.scrollerHeight - bottomMargin < top - this.lineHeight) + top += offset * this.$size.scrollerHeight; + this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); + } + + var scrollLeft = this.scrollLeft; + + if (scrollLeft > left) { + if (left < this.$padding + 2 * this.layerConfig.characterWidth) + left = -this.scrollMargin.left; + this.session.setScrollLeft(left); + } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { + this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); + } else if (scrollLeft <= this.$padding && left - scrollLeft < this.characterWidth) { + this.session.setScrollLeft(0); + } + }; + this.getScrollTop = function() { + return this.session.getScrollTop(); + }; + this.getScrollLeft = function() { + return this.session.getScrollLeft(); + }; + this.getScrollTopRow = function() { + return this.scrollTop / this.lineHeight; + }; + this.getScrollBottomRow = function() { + return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); + }; + this.scrollToRow = function(row) { + this.session.setScrollTop(row * this.lineHeight); + }; + + this.alignCursor = function(cursor, alignment) { + if (typeof cursor == "number") + cursor = {row: cursor, column: 0}; + + var pos = this.$cursorLayer.getPixelPosition(cursor); + var h = this.$size.scrollerHeight - this.lineHeight; + var offset = pos.top - h * (alignment || 0); + + this.session.setScrollTop(offset); + return offset; + }; + + this.STEPS = 8; + this.$calcSteps = function(fromValue, toValue){ + var i = 0; + var l = this.STEPS; + var steps = []; + + var func = function(t, x_min, dx) { + return dx * (Math.pow(t - 1, 3) + 1) + x_min; + }; + + for (i = 0; i < l; ++i) + steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); + + return steps; + }; + this.scrollToLine = function(line, center, animate, callback) { + var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); + var offset = pos.top; + if (center) + offset -= this.$size.scrollerHeight / 2; + + var initialScroll = this.scrollTop; + this.session.setScrollTop(offset); + if (animate !== false) + this.animateScrolling(initialScroll, callback); + }; + + this.animateScrolling = function(fromValue, callback) { + var toValue = this.scrollTop; + if (!this.$animatedScroll) + return; + var _self = this; + + if (fromValue == toValue) + return; + + if (this.$scrollAnimation) { + var oldSteps = this.$scrollAnimation.steps; + if (oldSteps.length) { + fromValue = oldSteps[0]; + if (fromValue == toValue) + return; + } + } + + var steps = _self.$calcSteps(fromValue, toValue); + this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps}; + + clearInterval(this.$timer); + + _self.session.setScrollTop(steps.shift()); + _self.session.$scrollTop = toValue; + this.$timer = setInterval(function() { + if (steps.length) { + _self.session.setScrollTop(steps.shift()); + _self.session.$scrollTop = toValue; + } else if (toValue != null) { + _self.session.$scrollTop = -1; + _self.session.setScrollTop(toValue); + toValue = null; + } else { + _self.$timer = clearInterval(_self.$timer); + _self.$scrollAnimation = null; + callback && callback(); + } + }, 10); + }; + this.scrollToY = function(scrollTop) { + if (this.scrollTop !== scrollTop) { + this.$loop.schedule(this.CHANGE_SCROLL); + this.scrollTop = scrollTop; + } + }; + this.scrollToX = function(scrollLeft) { + if (this.scrollLeft !== scrollLeft) + this.scrollLeft = scrollLeft; + this.$loop.schedule(this.CHANGE_H_SCROLL); + }; + this.scrollTo = function(x, y) { + this.session.setScrollTop(y); + this.session.setScrollLeft(y); + }; + this.scrollBy = function(deltaX, deltaY) { + deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY); + deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX); + }; + this.isScrollableBy = function(deltaX, deltaY) { + if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) + return true; + if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight + - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom) + return true; + if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) + return true; + if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth + - this.layerConfig.width < -1 + this.scrollMargin.right) + return true; + }; + + this.pixelToScreenCoordinates = function(x, y) { + var canvasPos = this.scroller.getBoundingClientRect(); + + var offset = (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth; + var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight); + var col = Math.round(offset); + + return {row: row, column: col, side: offset - col > 0 ? 1 : -1}; + }; + + this.screenToTextCoordinates = function(x, y) { + var canvasPos = this.scroller.getBoundingClientRect(); + + var col = Math.round( + (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth + ); + + var row = (y + this.scrollTop - canvasPos.top) / this.lineHeight; + + return this.session.screenToDocumentPosition(row, Math.max(col, 0)); + }; + this.textToScreenCoordinates = function(row, column) { + var canvasPos = this.scroller.getBoundingClientRect(); + var pos = this.session.documentToScreenPosition(row, column); + + var x = this.$padding + Math.round(pos.column * this.characterWidth); + var y = pos.row * this.lineHeight; + + return { + pageX: canvasPos.left + x - this.scrollLeft, + pageY: canvasPos.top + y - this.scrollTop + }; + }; + this.visualizeFocus = function() { + dom.addCssClass(this.container, "ace_focus"); + }; + this.visualizeBlur = function() { + dom.removeCssClass(this.container, "ace_focus"); + }; + this.showComposition = function(position) { + if (!this.$composition) + this.$composition = { + keepTextAreaAtCursor: this.$keepTextAreaAtCursor, + cssText: this.textarea.style.cssText + }; + + this.$keepTextAreaAtCursor = true; + dom.addCssClass(this.textarea, "ace_composition"); + this.textarea.style.cssText = ""; + this.$moveTextAreaToCursor(); + }; + this.setCompositionText = function(text) { + this.$moveTextAreaToCursor(); + }; + this.hideComposition = function() { + if (!this.$composition) + return; + + dom.removeCssClass(this.textarea, "ace_composition"); + this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor; + this.textarea.style.cssText = this.$composition.cssText; + this.$composition = null; + }; + this.setTheme = function(theme, cb) { + var _self = this; + this.$themeId = theme; + _self._dispatchEvent('themeChange',{theme:theme}); + + if (!theme || typeof theme == "string") { + var moduleName = theme || this.$options.theme.initialValue; + config.loadModule(["theme", moduleName], afterLoad); + } else { + afterLoad(theme); + } + + function afterLoad(module) { + if (_self.$themeId != theme) + return cb && cb(); + if (!module || !module.cssClass) + throw new Error("couldn't load module " + theme + " or it didn't call define"); + dom.importCssString( + module.cssText, + module.cssClass, + _self.container.ownerDocument + ); + + if (_self.theme) + dom.removeCssClass(_self.container, _self.theme.cssClass); + + var padding = "padding" in module ? module.padding + : "padding" in (_self.theme || {}) ? 4 : _self.$padding; + if (_self.$padding && padding != _self.$padding) + _self.setPadding(padding); + _self.$theme = module.cssClass; + + _self.theme = module; + dom.addCssClass(_self.container, module.cssClass); + dom.setCssClass(_self.container, "ace_dark", module.isDark); + if (_self.$size) { + _self.$size.width = 0; + _self.$updateSizeAsync(); + } + + _self._dispatchEvent('themeLoaded', {theme:module}); + cb && cb(); + } + }; + this.getTheme = function() { + return this.$themeId; + }; + this.setStyle = function(style, include) { + dom.setCssClass(this.container, style, include !== false); + }; + this.unsetStyle = function(style) { + dom.removeCssClass(this.container, style); + }; + + this.setCursorStyle = function(style) { + if (this.scroller.style.cursor != style) + this.scroller.style.cursor = style; + }; + this.setMouseCursor = function(cursorStyle) { + this.scroller.style.cursor = cursorStyle; + }; + this.destroy = function() { + this.$textLayer.destroy(); + this.$cursorLayer.destroy(); + }; + +}).call(VirtualRenderer.prototype); + + +config.defineOptions(VirtualRenderer.prototype, "renderer", { + animatedScroll: {initialValue: false}, + showInvisibles: { + set: function(value) { + if (this.$textLayer.setShowInvisibles(value)) + this.$loop.schedule(this.CHANGE_TEXT); + }, + initialValue: false + }, + showPrintMargin: { + set: function() { this.$updatePrintMargin(); }, + initialValue: true + }, + printMarginColumn: { + set: function() { this.$updatePrintMargin(); }, + initialValue: 80 + }, + printMargin: { + set: function(val) { + if (typeof val == "number") + this.$printMarginColumn = val; + this.$showPrintMargin = !!val; + this.$updatePrintMargin(); + }, + get: function() { + return this.$showPrintMargin && this.$printMarginColumn; + } + }, + showGutter: { + set: function(show){ + this.$gutter.style.display = show ? "block" : "none"; + this.$loop.schedule(this.CHANGE_FULL); + this.onGutterResize(); + }, + initialValue: true + }, + fadeFoldWidgets: { + set: function(show) { + dom.setCssClass(this.$gutter, "ace_fade-fold-widgets", show); + }, + initialValue: false + }, + showFoldWidgets: { + set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)}, + initialValue: true + }, + showLineNumbers: { + set: function(show) { + this.$gutterLayer.setShowLineNumbers(show); + this.$loop.schedule(this.CHANGE_GUTTER); + }, + initialValue: true + }, + displayIndentGuides: { + set: function(show) { + if (this.$textLayer.setDisplayIndentGuides(show)) + this.$loop.schedule(this.CHANGE_TEXT); + }, + initialValue: true + }, + highlightGutterLine: { + set: function(shouldHighlight) { + if (!this.$gutterLineHighlight) { + this.$gutterLineHighlight = dom.createElement("div"); + this.$gutterLineHighlight.className = "ace_gutter-active-line"; + this.$gutter.appendChild(this.$gutterLineHighlight); + return; + } + + this.$gutterLineHighlight.style.display = shouldHighlight ? "" : "none"; + if (this.$cursorLayer.$pixelPos) + this.$updateGutterLineHighlight(); + }, + initialValue: false, + value: true + }, + hScrollBarAlwaysVisible: { + set: function(val) { + if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: false + }, + vScrollBarAlwaysVisible: { + set: function(val) { + if (!this.$vScrollBarAlwaysVisible || !this.$vScroll) + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: false + }, + fontSize: { + set: function(size) { + if (typeof size == "number") + size = size + "px"; + this.container.style.fontSize = size; + this.updateFontSize(); + }, + initialValue: 12 + }, + fontFamily: { + set: function(name) { + this.container.style.fontFamily = name; + this.updateFontSize(); + } + }, + maxLines: { + set: function(val) { + this.updateFull(); + } + }, + minLines: { + set: function(val) { + this.updateFull(); + } + }, + maxPixelHeight: { + set: function(val) { + this.updateFull(); + }, + initialValue: 0 + }, + scrollPastEnd: { + set: function(val) { + val = +val || 0; + if (this.$scrollPastEnd == val) + return; + this.$scrollPastEnd = val; + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: 0, + handlesSet: true + }, + fixedWidthGutter: { + set: function(val) { + this.$gutterLayer.$fixedWidth = !!val; + this.$loop.schedule(this.CHANGE_GUTTER); + } + }, + theme: { + set: function(val) { this.setTheme(val) }, + get: function() { return this.$themeId || this.theme; }, + initialValue: "./theme/textmate", + handlesSet: true + } +}); + +exports.VirtualRenderer = VirtualRenderer; +}); + +ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var net = require("../lib/net"); +var EventEmitter = require("../lib/event_emitter").EventEmitter; +var config = require("../config"); + +function $workerBlob(workerUrl) { + var script = "importScripts('" + net.qualifyURL(workerUrl) + "');"; + try { + return new Blob([script], {"type": "application/javascript"}); + } catch (e) { // Backwards-compatibility + var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder; + var blobBuilder = new BlobBuilder(); + blobBuilder.append(script); + return blobBuilder.getBlob("application/javascript"); + } +} + +function createWorker(workerUrl) { + var blob = $workerBlob(workerUrl); + var URL = window.URL || window.webkitURL; + var blobURL = URL.createObjectURL(blob); + return new Worker(blobURL); +} + +var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl, importScripts) { + this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); + this.changeListener = this.changeListener.bind(this); + this.onMessage = this.onMessage.bind(this); + if (require.nameToUrl && !require.toUrl) + require.toUrl = require.nameToUrl; + + if (config.get("packaged") || !require.toUrl) { + workerUrl = workerUrl || config.moduleUrl(mod, "worker"); + } else { + var normalizePath = this.$normalizePath; + workerUrl = workerUrl || normalizePath(require.toUrl("ace/worker/worker.js", null, "_")); + + var tlns = {}; + topLevelNamespaces.forEach(function(ns) { + tlns[ns] = normalizePath(require.toUrl(ns, null, "_").replace(/(\.js)?(\?.*)?$/, "")); + }); + } + + this.$worker = createWorker(workerUrl); + if (importScripts) { + this.send("importScripts", importScripts); + } + this.$worker.postMessage({ + init : true, + tlns : tlns, + module : mod, + classname : classname + }); + + this.callbackId = 1; + this.callbacks = {}; + + this.$worker.onmessage = this.onMessage; +}; + +(function(){ + + oop.implement(this, EventEmitter); + + this.onMessage = function(e) { + var msg = e.data; + switch (msg.type) { + case "event": + this._signal(msg.name, {data: msg.data}); + break; + case "call": + var callback = this.callbacks[msg.id]; + if (callback) { + callback(msg.data); + delete this.callbacks[msg.id]; + } + break; + case "error": + this.reportError(msg.data); + break; + case "log": + window.console && console.log && console.log.apply(console, msg.data); + break; + } + }; + + this.reportError = function(err) { + window.console && console.error && console.error(err); + }; + + this.$normalizePath = function(path) { + return net.qualifyURL(path); + }; + + this.terminate = function() { + this._signal("terminate", {}); + this.deltaQueue = null; + this.$worker.terminate(); + this.$worker = null; + if (this.$doc) + this.$doc.off("change", this.changeListener); + this.$doc = null; + }; + + this.send = function(cmd, args) { + this.$worker.postMessage({command: cmd, args: args}); + }; + + this.call = function(cmd, args, callback) { + if (callback) { + var id = this.callbackId++; + this.callbacks[id] = callback; + args.push(id); + } + this.send(cmd, args); + }; + + this.emit = function(event, data) { + try { + this.$worker.postMessage({event: event, data: {data: data.data}}); + } + catch(ex) { + console.error(ex.stack); + } + }; + + this.attachToDocument = function(doc) { + if (this.$doc) + this.terminate(); + + this.$doc = doc; + this.call("setValue", [doc.getValue()]); + doc.on("change", this.changeListener); + }; + + this.changeListener = function(delta) { + if (!this.deltaQueue) { + this.deltaQueue = []; + setTimeout(this.$sendDeltaQueue, 0); + } + if (delta.action == "insert") + this.deltaQueue.push(delta.start, delta.lines); + else + this.deltaQueue.push(delta.start, delta.end); + }; + + this.$sendDeltaQueue = function() { + var q = this.deltaQueue; + if (!q) return; + this.deltaQueue = null; + if (q.length > 50 && q.length > this.$doc.getLength() >> 1) { + this.call("setValue", [this.$doc.getValue()]); + } else + this.emit("change", {data: q}); + }; + +}).call(WorkerClient.prototype); + + +var UIWorkerClient = function(topLevelNamespaces, mod, classname) { + this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); + this.changeListener = this.changeListener.bind(this); + this.callbackId = 1; + this.callbacks = {}; + this.messageBuffer = []; + + var main = null; + var emitSync = false; + var sender = Object.create(EventEmitter); + var _self = this; + + this.$worker = {}; + this.$worker.terminate = function() {}; + this.$worker.postMessage = function(e) { + _self.messageBuffer.push(e); + if (main) { + if (emitSync) + setTimeout(processNext); + else + processNext(); + } + }; + this.setEmitSync = function(val) { emitSync = val }; + + var processNext = function() { + var msg = _self.messageBuffer.shift(); + if (msg.command) + main[msg.command].apply(main, msg.args); + else if (msg.event) + sender._signal(msg.event, msg.data); + }; + + sender.postMessage = function(msg) { + _self.onMessage({data: msg}); + }; + sender.callback = function(data, callbackId) { + this.postMessage({type: "call", id: callbackId, data: data}); + }; + sender.emit = function(name, data) { + this.postMessage({type: "event", name: name, data: data}); + }; + + config.loadModule(["worker", mod], function(Main) { + main = new Main[classname](sender); + while (_self.messageBuffer.length) + processNext(); + }); +}; + +UIWorkerClient.prototype = WorkerClient.prototype; + +exports.UIWorkerClient = UIWorkerClient; +exports.WorkerClient = WorkerClient; +exports.createWorker = createWorker; + + +}); + +ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"], function(require, exports, module) { +"use strict"; + +var Range = require("./range").Range; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var oop = require("./lib/oop"); + +var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) { + var _self = this; + this.length = length; + this.session = session; + this.doc = session.getDocument(); + this.mainClass = mainClass; + this.othersClass = othersClass; + this.$onUpdate = this.onUpdate.bind(this); + this.doc.on("change", this.$onUpdate); + this.$others = others; + + this.$onCursorChange = function() { + setTimeout(function() { + _self.onCursorChange(); + }); + }; + + this.$pos = pos; + var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || {length: -1}; + this.$undoStackDepth = undoStack.length; + this.setup(); + + session.selection.on("changeCursor", this.$onCursorChange); +}; + +(function() { + + oop.implement(this, EventEmitter); + this.setup = function() { + var _self = this; + var doc = this.doc; + var session = this.session; + + this.selectionBefore = session.selection.toJSON(); + if (session.selection.inMultiSelectMode) + session.selection.toSingleRange(); + + this.pos = doc.createAnchor(this.$pos.row, this.$pos.column); + var pos = this.pos; + pos.$insertRight = true; + pos.detach(); + pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false); + this.others = []; + this.$others.forEach(function(other) { + var anchor = doc.createAnchor(other.row, other.column); + anchor.$insertRight = true; + anchor.detach(); + _self.others.push(anchor); + }); + session.setUndoSelect(false); + }; + this.showOtherMarkers = function() { + if (this.othersActive) return; + var session = this.session; + var _self = this; + this.othersActive = true; + this.others.forEach(function(anchor) { + anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column+_self.length), _self.othersClass, null, false); + }); + }; + this.hideOtherMarkers = function() { + if (!this.othersActive) return; + this.othersActive = false; + for (var i = 0; i < this.others.length; i++) { + this.session.removeMarker(this.others[i].markerId); + } + }; + this.onUpdate = function(delta) { + if (this.$updating) + return this.updateAnchors(delta); + + var range = delta; + if (range.start.row !== range.end.row) return; + if (range.start.row !== this.pos.row) return; + this.$updating = true; + var lengthDiff = delta.action === "insert" ? range.end.column - range.start.column : range.start.column - range.end.column; + var inMainRange = range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1; + var distanceFromStart = range.start.column - this.pos.column; + + this.updateAnchors(delta); + + if (inMainRange) + this.length += lengthDiff; + + if (inMainRange && !this.session.$fromUndo) { + if (delta.action === 'insert') { + for (var i = this.others.length - 1; i >= 0; i--) { + var otherPos = this.others[i]; + var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; + this.doc.insertMergedLines(newPos, delta.lines); + } + } else if (delta.action === 'remove') { + for (var i = this.others.length - 1; i >= 0; i--) { + var otherPos = this.others[i]; + var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; + this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff)); + } + } + } + + this.$updating = false; + this.updateMarkers(); + }; + + this.updateAnchors = function(delta) { + this.pos.onChange(delta); + for (var i = this.others.length; i--;) + this.others[i].onChange(delta); + this.updateMarkers(); + }; + + this.updateMarkers = function() { + if (this.$updating) + return; + var _self = this; + var session = this.session; + var updateMarker = function(pos, className) { + session.removeMarker(pos.markerId); + pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column+_self.length), className, null, false); + }; + updateMarker(this.pos, this.mainClass); + for (var i = this.others.length; i--;) + updateMarker(this.others[i], this.othersClass); + }; + + this.onCursorChange = function(event) { + if (this.$updating || !this.session) return; + var pos = this.session.selection.getCursor(); + if (pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) { + this.showOtherMarkers(); + this._emit("cursorEnter", event); + } else { + this.hideOtherMarkers(); + this._emit("cursorLeave", event); + } + }; + this.detach = function() { + this.session.removeMarker(this.pos && this.pos.markerId); + this.hideOtherMarkers(); + this.doc.removeEventListener("change", this.$onUpdate); + this.session.selection.removeEventListener("changeCursor", this.$onCursorChange); + this.session.setUndoSelect(true); + this.session = null; + }; + this.cancel = function() { + if (this.$undoStackDepth === -1) + return; + var undoManager = this.session.getUndoManager(); + var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth; + for (var i = 0; i < undosRequired; i++) { + undoManager.undo(true); + } + if (this.selectionBefore) + this.session.selection.fromJSON(this.selectionBefore); + }; +}).call(PlaceHolder.prototype); + + +exports.PlaceHolder = PlaceHolder; +}); + +ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"], function(require, exports, module) { + +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); +function isSamePoint(p1, p2) { + return p1.row == p2.row && p1.column == p2.column; +} + +function onMouseDown(e) { + var ev = e.domEvent; + var alt = ev.altKey; + var shift = ev.shiftKey; + var ctrl = ev.ctrlKey; + var accel = e.getAccelKey(); + var button = e.getButton(); + + if (ctrl && useragent.isMac) + button = ev.button; + + if (e.editor.inMultiSelectMode && button == 2) { + e.editor.textInput.onContextMenu(e.domEvent); + return; + } + + if (!ctrl && !alt && !accel) { + if (button === 0 && e.editor.inMultiSelectMode) + e.editor.exitMultiSelectMode(); + return; + } + + if (button !== 0) + return; + + var editor = e.editor; + var selection = editor.selection; + var isMultiSelect = editor.inMultiSelectMode; + var pos = e.getDocumentPosition(); + var cursor = selection.getCursor(); + var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor)); + + var mouseX = e.x, mouseY = e.y; + var onMouseSelection = function(e) { + mouseX = e.clientX; + mouseY = e.clientY; + }; + + var session = editor.session; + var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); + var screenCursor = screenAnchor; + + var selectionMode; + if (editor.$mouseHandler.$enableJumpToDef) { + if (ctrl && alt || accel && alt) + selectionMode = shift ? "block" : "add"; + else if (alt && editor.$blockSelectEnabled) + selectionMode = "block"; + } else { + if (accel && !alt) { + selectionMode = "add"; + if (!isMultiSelect && shift) + return; + } else if (alt && editor.$blockSelectEnabled) { + selectionMode = "block"; + } + } + + if (selectionMode && useragent.isMac && ev.ctrlKey) { + editor.$mouseHandler.cancelContextMenu(); + } + + if (selectionMode == "add") { + if (!isMultiSelect && inSelection) + return; // dragging + + if (!isMultiSelect) { + var range = selection.toOrientedRange(); + editor.addSelectionMarker(range); + } + + var oldRange = selection.rangeList.rangeAtPoint(pos); + + + editor.$blockScrolling++; + editor.inVirtualSelectionMode = true; + + if (shift) { + oldRange = null; + range = selection.ranges[0] || range; + editor.removeSelectionMarker(range); + } + editor.once("mouseup", function() { + var tmpSel = selection.toOrientedRange(); + + if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor)) + selection.substractPoint(tmpSel.cursor); + else { + if (shift) { + selection.substractPoint(range.cursor); + } else if (range) { + editor.removeSelectionMarker(range); + selection.addRange(range); + } + selection.addRange(tmpSel); + } + editor.$blockScrolling--; + editor.inVirtualSelectionMode = false; + }); + + } else if (selectionMode == "block") { + e.stop(); + editor.inVirtualSelectionMode = true; + var initialRange; + var rectSel = []; + var blockSelect = function() { + var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); + var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column); + + if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead)) + return; + screenCursor = newCursor; + + editor.$blockScrolling++; + editor.selection.moveToPosition(cursor); + editor.renderer.scrollCursorIntoView(); + + editor.removeSelectionMarkers(rectSel); + rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor); + if (editor.$mouseHandler.$clickSelection && rectSel.length == 1 && rectSel[0].isEmpty()) + rectSel[0] = editor.$mouseHandler.$clickSelection.clone(); + rectSel.forEach(editor.addSelectionMarker, editor); + editor.updateSelectionMarkers(); + editor.$blockScrolling--; + }; + editor.$blockScrolling++; + if (isMultiSelect && !accel) { + selection.toSingleRange(); + } else if (!isMultiSelect && accel) { + initialRange = selection.toOrientedRange(); + editor.addSelectionMarker(initialRange); + } + + if (shift) + screenAnchor = session.documentToScreenPosition(selection.lead); + else + selection.moveToPosition(pos); + editor.$blockScrolling--; + + screenCursor = {row: -1, column: -1}; + + var onMouseSelectionEnd = function(e) { + clearInterval(timerId); + editor.removeSelectionMarkers(rectSel); + if (!rectSel.length) + rectSel = [selection.toOrientedRange()]; + editor.$blockScrolling++; + if (initialRange) { + editor.removeSelectionMarker(initialRange); + selection.toSingleRange(initialRange); + } + for (var i = 0; i < rectSel.length; i++) + selection.addRange(rectSel[i]); + editor.inVirtualSelectionMode = false; + editor.$mouseHandler.$clickSelection = null; + editor.$blockScrolling--; + }; + + var onSelectionInterval = blockSelect; + + event.capture(editor.container, onMouseSelection, onMouseSelectionEnd); + var timerId = setInterval(function() {onSelectionInterval();}, 20); + + return e.preventDefault(); + } +} + + +exports.onMouseDown = onMouseDown; + +}); + +ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"], function(require, exports, module) { +exports.defaultCommands = [{ + name: "addCursorAbove", + exec: function(editor) { editor.selectMoreLines(-1); }, + bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"}, + scrollIntoView: "cursor", + readOnly: true +}, { + name: "addCursorBelow", + exec: function(editor) { editor.selectMoreLines(1); }, + bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"}, + scrollIntoView: "cursor", + readOnly: true +}, { + name: "addCursorAboveSkipCurrent", + exec: function(editor) { editor.selectMoreLines(-1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"}, + scrollIntoView: "cursor", + readOnly: true +}, { + name: "addCursorBelowSkipCurrent", + exec: function(editor) { editor.selectMoreLines(1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"}, + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectMoreBefore", + exec: function(editor) { editor.selectMore(-1); }, + bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"}, + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectMoreAfter", + exec: function(editor) { editor.selectMore(1); }, + bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"}, + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectNextBefore", + exec: function(editor) { editor.selectMore(-1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"}, + scrollIntoView: "cursor", + readOnly: true +}, { + name: "selectNextAfter", + exec: function(editor) { editor.selectMore(1, true); }, + bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"}, + scrollIntoView: "cursor", + readOnly: true +}, { + name: "splitIntoLines", + exec: function(editor) { editor.multiSelect.splitIntoLines(); }, + bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"}, + readOnly: true +}, { + name: "alignCursors", + exec: function(editor) { editor.alignCursors(); }, + bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"}, + scrollIntoView: "cursor" +}, { + name: "findAll", + exec: function(editor) { editor.findAll(); }, + bindKey: {win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G"}, + scrollIntoView: "cursor", + readOnly: true +}]; +exports.multiSelectCommands = [{ + name: "singleSelection", + bindKey: "esc", + exec: function(editor) { editor.exitMultiSelectMode(); }, + scrollIntoView: "cursor", + readOnly: true, + isAvailable: function(editor) {return editor && editor.inMultiSelectMode} +}]; + +var HashHandler = require("../keyboard/hash_handler").HashHandler; +exports.keyboardHandler = new HashHandler(exports.multiSelectCommands); + +}); + +ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"], function(require, exports, module) { + +var RangeList = require("./range_list").RangeList; +var Range = require("./range").Range; +var Selection = require("./selection").Selection; +var onMouseDown = require("./mouse/multi_select_handler").onMouseDown; +var event = require("./lib/event"); +var lang = require("./lib/lang"); +var commands = require("./commands/multi_select_commands"); +exports.commands = commands.defaultCommands.concat(commands.multiSelectCommands); +var Search = require("./search").Search; +var search = new Search(); + +function find(session, needle, dir) { + search.$options.wrap = true; + search.$options.needle = needle; + search.$options.backwards = dir == -1; + return search.find(session); +} +var EditSession = require("./edit_session").EditSession; +(function() { + this.getSelectionMarkers = function() { + return this.$selectionMarkers; + }; +}).call(EditSession.prototype); +(function() { + this.ranges = null; + this.rangeList = null; + this.addRange = function(range, $blockChangeEvents) { + if (!range) + return; + + if (!this.inMultiSelectMode && this.rangeCount === 0) { + var oldRange = this.toOrientedRange(); + this.rangeList.add(oldRange); + this.rangeList.add(range); + if (this.rangeList.ranges.length != 2) { + this.rangeList.removeAll(); + return $blockChangeEvents || this.fromOrientedRange(range); + } + this.rangeList.removeAll(); + this.rangeList.add(oldRange); + this.$onAddRange(oldRange); + } + + if (!range.cursor) + range.cursor = range.end; + + var removed = this.rangeList.add(range); + + this.$onAddRange(range); + + if (removed.length) + this.$onRemoveRange(removed); + + if (this.rangeCount > 1 && !this.inMultiSelectMode) { + this._signal("multiSelect"); + this.inMultiSelectMode = true; + this.session.$undoSelect = false; + this.rangeList.attach(this.session); + } + + return $blockChangeEvents || this.fromOrientedRange(range); + }; + + this.toSingleRange = function(range) { + range = range || this.ranges[0]; + var removed = this.rangeList.removeAll(); + if (removed.length) + this.$onRemoveRange(removed); + + range && this.fromOrientedRange(range); + }; + this.substractPoint = function(pos) { + var removed = this.rangeList.substractPoint(pos); + if (removed) { + this.$onRemoveRange(removed); + return removed[0]; + } + }; + this.mergeOverlappingRanges = function() { + var removed = this.rangeList.merge(); + if (removed.length) + this.$onRemoveRange(removed); + else if(this.ranges[0]) + this.fromOrientedRange(this.ranges[0]); + }; + + this.$onAddRange = function(range) { + this.rangeCount = this.rangeList.ranges.length; + this.ranges.unshift(range); + this._signal("addRange", {range: range}); + }; + + this.$onRemoveRange = function(removed) { + this.rangeCount = this.rangeList.ranges.length; + if (this.rangeCount == 1 && this.inMultiSelectMode) { + var lastRange = this.rangeList.ranges.pop(); + removed.push(lastRange); + this.rangeCount = 0; + } + + for (var i = removed.length; i--; ) { + var index = this.ranges.indexOf(removed[i]); + this.ranges.splice(index, 1); + } + + this._signal("removeRange", {ranges: removed}); + + if (this.rangeCount === 0 && this.inMultiSelectMode) { + this.inMultiSelectMode = false; + this._signal("singleSelect"); + this.session.$undoSelect = true; + this.rangeList.detach(this.session); + } + + lastRange = lastRange || this.ranges[0]; + if (lastRange && !lastRange.isEqual(this.getRange())) + this.fromOrientedRange(lastRange); + }; + this.$initRangeList = function() { + if (this.rangeList) + return; + + this.rangeList = new RangeList(); + this.ranges = []; + this.rangeCount = 0; + }; + this.getAllRanges = function() { + return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()]; + }; + + this.splitIntoLines = function () { + if (this.rangeCount > 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var range = this.getRange(); + var isBackwards = this.isBackwards(); + var startRow = range.start.row; + var endRow = range.end.row; + if (startRow == endRow) { + if (isBackwards) + var start = range.end, end = range.start; + else + var start = range.start, end = range.end; + + this.addRange(Range.fromPoints(end, end)); + this.addRange(Range.fromPoints(start, start)); + return; + } + + var rectSel = []; + var r = this.getLineRange(startRow, true); + r.start.column = range.start.column; + rectSel.push(r); + + for (var i = startRow + 1; i < endRow; i++) + rectSel.push(this.getLineRange(i, true)); + + r = this.getLineRange(endRow, true); + r.end.column = range.end.column; + rectSel.push(r); + + rectSel.forEach(this.addRange, this); + } + }; + this.toggleBlockSelection = function () { + if (this.rangeCount > 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var cursor = this.session.documentToScreenPosition(this.selectionLead); + var anchor = this.session.documentToScreenPosition(this.selectionAnchor); + + var rectSel = this.rectangularRangeBlock(cursor, anchor); + rectSel.forEach(this.addRange, this); + } + }; + this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) { + var rectSel = []; + + var xBackwards = screenCursor.column < screenAnchor.column; + if (xBackwards) { + var startColumn = screenCursor.column; + var endColumn = screenAnchor.column; + } else { + var startColumn = screenAnchor.column; + var endColumn = screenCursor.column; + } + + var yBackwards = screenCursor.row < screenAnchor.row; + if (yBackwards) { + var startRow = screenCursor.row; + var endRow = screenAnchor.row; + } else { + var startRow = screenAnchor.row; + var endRow = screenCursor.row; + } + + if (startColumn < 0) + startColumn = 0; + if (startRow < 0) + startRow = 0; + + if (startRow == endRow) + includeEmptyLines = true; + + for (var row = startRow; row <= endRow; row++) { + var range = Range.fromPoints( + this.session.screenToDocumentPosition(row, startColumn), + this.session.screenToDocumentPosition(row, endColumn) + ); + if (range.isEmpty()) { + if (docEnd && isSamePoint(range.end, docEnd)) + break; + var docEnd = range.end; + } + range.cursor = xBackwards ? range.start : range.end; + rectSel.push(range); + } + + if (yBackwards) + rectSel.reverse(); + + if (!includeEmptyLines) { + var end = rectSel.length - 1; + while (rectSel[end].isEmpty() && end > 0) + end--; + if (end > 0) { + var start = 0; + while (rectSel[start].isEmpty()) + start++; + } + for (var i = end; i >= start; i--) { + if (rectSel[i].isEmpty()) + rectSel.splice(i, 1); + } + } + + return rectSel; + }; +}).call(Selection.prototype); +var Editor = require("./editor").Editor; +(function() { + this.updateSelectionMarkers = function() { + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + this.addSelectionMarker = function(orientedRange) { + if (!orientedRange.cursor) + orientedRange.cursor = orientedRange.end; + + var style = this.getSelectionStyle(); + orientedRange.marker = this.session.addMarker(orientedRange, "ace_selection", style); + + this.session.$selectionMarkers.push(orientedRange); + this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + return orientedRange; + }; + this.removeSelectionMarker = function(range) { + if (!range.marker) + return; + this.session.removeMarker(range.marker); + var index = this.session.$selectionMarkers.indexOf(range); + if (index != -1) + this.session.$selectionMarkers.splice(index, 1); + this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + }; + + this.removeSelectionMarkers = function(ranges) { + var markerList = this.session.$selectionMarkers; + for (var i = ranges.length; i--; ) { + var range = ranges[i]; + if (!range.marker) + continue; + this.session.removeMarker(range.marker); + var index = markerList.indexOf(range); + if (index != -1) + markerList.splice(index, 1); + } + this.session.selectionMarkerCount = markerList.length; + }; + + this.$onAddRange = function(e) { + this.addSelectionMarker(e.range); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onRemoveRange = function(e) { + this.removeSelectionMarkers(e.ranges); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onMultiSelect = function(e) { + if (this.inMultiSelectMode) + return; + this.inMultiSelectMode = true; + + this.setStyle("ace_multiselect"); + this.keyBinding.addKeyboardHandler(commands.keyboardHandler); + this.commands.setDefaultHandler("exec", this.$onMultiSelectExec); + + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + + this.$onSingleSelect = function(e) { + if (this.session.multiSelect.inVirtualMode) + return; + this.inMultiSelectMode = false; + + this.unsetStyle("ace_multiselect"); + this.keyBinding.removeKeyboardHandler(commands.keyboardHandler); + + this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + this._emit("changeSelection"); + }; + + this.$onMultiSelectExec = function(e) { + var command = e.command; + var editor = e.editor; + if (!editor.multiSelect) + return; + if (!command.multiSelectAction) { + var result = command.exec(editor, e.args || {}); + editor.multiSelect.addRange(editor.multiSelect.toOrientedRange()); + editor.multiSelect.mergeOverlappingRanges(); + } else if (command.multiSelectAction == "forEach") { + result = editor.forEachSelection(command, e.args); + } else if (command.multiSelectAction == "forEachLine") { + result = editor.forEachSelection(command, e.args, true); + } else if (command.multiSelectAction == "single") { + editor.exitMultiSelectMode(); + result = command.exec(editor, e.args || {}); + } else { + result = command.multiSelectAction(editor, e.args || {}); + } + return result; + }; + this.forEachSelection = function(cmd, args, options) { + if (this.inVirtualSelectionMode) + return; + var keepOrder = options && options.keepOrder; + var $byLines = options == true || options && options.$byLines + var session = this.session; + var selection = this.selection; + var rangeList = selection.rangeList; + var ranges = (keepOrder ? selection : rangeList).ranges; + var result; + + if (!ranges.length) + return cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {}); + + var reg = selection._eventRegistry; + selection._eventRegistry = {}; + + var tmpSel = new Selection(session); + this.inVirtualSelectionMode = true; + for (var i = ranges.length; i--;) { + if ($byLines) { + while (i > 0 && ranges[i].start.row == ranges[i - 1].end.row) + i--; + } + tmpSel.fromOrientedRange(ranges[i]); + tmpSel.index = i; + this.selection = session.selection = tmpSel; + var cmdResult = cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {}); + if (!result && cmdResult !== undefined) + result = cmdResult; + tmpSel.toOrientedRange(ranges[i]); + } + tmpSel.detach(); + + this.selection = session.selection = selection; + this.inVirtualSelectionMode = false; + selection._eventRegistry = reg; + selection.mergeOverlappingRanges(); + + var anim = this.renderer.$scrollAnimation; + this.onCursorChange(); + this.onSelectionChange(); + if (anim && anim.from == anim.to) + this.renderer.animateScrolling(anim.from); + + return result; + }; + this.exitMultiSelectMode = function() { + if (!this.inMultiSelectMode || this.inVirtualSelectionMode) + return; + this.multiSelect.toSingleRange(); + }; + + this.getSelectedText = function() { + var text = ""; + if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { + var ranges = this.multiSelect.rangeList.ranges; + var buf = []; + for (var i = 0; i < ranges.length; i++) { + buf.push(this.session.getTextRange(ranges[i])); + } + var nl = this.session.getDocument().getNewLineCharacter(); + text = buf.join(nl); + if (text.length == (buf.length - 1) * nl.length) + text = ""; + } else if (!this.selection.isEmpty()) { + text = this.session.getTextRange(this.getSelectionRange()); + } + return text; + }; + + this.$checkMultiselectChange = function(e, anchor) { + if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { + var range = this.multiSelect.ranges[0]; + if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor) + return; + var pos = anchor == this.multiSelect.anchor + ? range.cursor == range.start ? range.end : range.start + : range.cursor; + if (pos.row != anchor.row + || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column) + this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()); + } + }; + this.findAll = function(needle, options, additive) { + options = options || {}; + options.needle = needle || options.needle; + if (options.needle == undefined) { + var range = this.selection.isEmpty() + ? this.selection.getWordRange() + : this.selection.getRange(); + options.needle = this.session.getTextRange(range); + } + this.$search.set(options); + + var ranges = this.$search.findAll(this.session); + if (!ranges.length) + return 0; + + this.$blockScrolling += 1; + var selection = this.multiSelect; + + if (!additive) + selection.toSingleRange(ranges[0]); + + for (var i = ranges.length; i--; ) + selection.addRange(ranges[i], true); + if (range && selection.rangeList.rangeAtPoint(range.start)) + selection.addRange(range, true); + + this.$blockScrolling -= 1; + + return ranges.length; + }; + this.selectMoreLines = function(dir, skip) { + var range = this.selection.toOrientedRange(); + var isBackwards = range.cursor == range.end; + + var screenLead = this.session.documentToScreenPosition(range.cursor); + if (this.selection.$desiredColumn) + screenLead.column = this.selection.$desiredColumn; + + var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column); + + if (!range.isEmpty()) { + var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start); + var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column); + } else { + var anchor = lead; + } + + if (isBackwards) { + var newRange = Range.fromPoints(lead, anchor); + newRange.cursor = newRange.start; + } else { + var newRange = Range.fromPoints(anchor, lead); + newRange.cursor = newRange.end; + } + + newRange.desiredColumn = screenLead.column; + if (!this.selection.inMultiSelectMode) { + this.selection.addRange(range); + } else { + if (skip) + var toRemove = range.cursor; + } + + this.selection.addRange(newRange); + if (toRemove) + this.selection.substractPoint(toRemove); + }; + this.transposeSelections = function(dir) { + var session = this.session; + var sel = session.multiSelect; + var all = sel.ranges; + + for (var i = all.length; i--; ) { + var range = all[i]; + if (range.isEmpty()) { + var tmp = session.getWordRange(range.start.row, range.start.column); + range.start.row = tmp.start.row; + range.start.column = tmp.start.column; + range.end.row = tmp.end.row; + range.end.column = tmp.end.column; + } + } + sel.mergeOverlappingRanges(); + + var words = []; + for (var i = all.length; i--; ) { + var range = all[i]; + words.unshift(session.getTextRange(range)); + } + + if (dir < 0) + words.unshift(words.pop()); + else + words.push(words.shift()); + + for (var i = all.length; i--; ) { + var range = all[i]; + var tmp = range.clone(); + session.replace(range, words[i]); + range.start.row = tmp.start.row; + range.start.column = tmp.start.column; + } + }; + this.selectMore = function(dir, skip, stopAtFirst) { + var session = this.session; + var sel = session.multiSelect; + + var range = sel.toOrientedRange(); + if (range.isEmpty()) { + range = session.getWordRange(range.start.row, range.start.column); + range.cursor = dir == -1 ? range.start : range.end; + this.multiSelect.addRange(range); + if (stopAtFirst) + return; + } + var needle = session.getTextRange(range); + + var newRange = find(session, needle, dir); + if (newRange) { + newRange.cursor = dir == -1 ? newRange.start : newRange.end; + this.$blockScrolling += 1; + this.session.unfold(newRange); + this.multiSelect.addRange(newRange); + this.$blockScrolling -= 1; + this.renderer.scrollCursorIntoView(null, 0.5); + } + if (skip) + this.multiSelect.substractPoint(range.cursor); + }; + this.alignCursors = function() { + var session = this.session; + var sel = session.multiSelect; + var ranges = sel.ranges; + var row = -1; + var sameRowRanges = ranges.filter(function(r) { + if (r.cursor.row == row) + return true; + row = r.cursor.row; + }); + + if (!ranges.length || sameRowRanges.length == ranges.length - 1) { + var range = this.selection.getRange(); + var fr = range.start.row, lr = range.end.row; + var guessRange = fr == lr; + if (guessRange) { + var max = this.session.getLength(); + var line; + do { + line = this.session.getLine(lr); + } while (/[=:]/.test(line) && ++lr < max); + do { + line = this.session.getLine(fr); + } while (/[=:]/.test(line) && --fr > 0); + + if (fr < 0) fr = 0; + if (lr >= max) lr = max - 1; + } + var lines = this.session.removeFullLines(fr, lr); + lines = this.$reAlignText(lines, guessRange); + this.session.insert({row: fr, column: 0}, lines.join("\n") + "\n"); + if (!guessRange) { + range.start.column = 0; + range.end.column = lines[lines.length - 1].length; + } + this.selection.setRange(range); + } else { + sameRowRanges.forEach(function(r) { + sel.substractPoint(r.cursor); + }); + + var maxCol = 0; + var minSpace = Infinity; + var spaceOffsets = ranges.map(function(r) { + var p = r.cursor; + var line = session.getLine(p.row); + var spaceOffset = line.substr(p.column).search(/\S/g); + if (spaceOffset == -1) + spaceOffset = 0; + + if (p.column > maxCol) + maxCol = p.column; + if (spaceOffset < minSpace) + minSpace = spaceOffset; + return spaceOffset; + }); + ranges.forEach(function(r, i) { + var p = r.cursor; + var l = maxCol - p.column; + var d = spaceOffsets[i] - minSpace; + if (l > d) + session.insert(p, lang.stringRepeat(" ", l - d)); + else + session.remove(new Range(p.row, p.column, p.row, p.column - l + d)); + + r.start.column = r.end.column = maxCol; + r.start.row = r.end.row = p.row; + r.cursor = r.end; + }); + sel.fromOrientedRange(ranges[0]); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + } + }; + + this.$reAlignText = function(lines, forceLeft) { + var isLeftAligned = true, isRightAligned = true; + var startW, textW, endW; + + return lines.map(function(line) { + var m = line.match(/(\s*)(.*?)(\s*)([=:].*)/); + if (!m) + return [line]; + + if (startW == null) { + startW = m[1].length; + textW = m[2].length; + endW = m[3].length; + return m; + } + + if (startW + textW + endW != m[1].length + m[2].length + m[3].length) + isRightAligned = false; + if (startW != m[1].length) + isLeftAligned = false; + + if (startW > m[1].length) + startW = m[1].length; + if (textW < m[2].length) + textW = m[2].length; + if (endW > m[3].length) + endW = m[3].length; + + return m; + }).map(forceLeft ? alignLeft : + isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign); + + function spaces(n) { + return lang.stringRepeat(" ", n); + } + + function alignLeft(m) { + return !m[2] ? m[0] : spaces(startW) + m[2] + + spaces(textW - m[2].length + endW) + + m[4].replace(/^([=:])\s+/, "$1 "); + } + function alignRight(m) { + return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2] + + spaces(endW, " ") + + m[4].replace(/^([=:])\s+/, "$1 "); + } + function unAlign(m) { + return !m[2] ? m[0] : spaces(startW) + m[2] + + spaces(endW) + + m[4].replace(/^([=:])\s+/, "$1 "); + } + }; +}).call(Editor.prototype); + + +function isSamePoint(p1, p2) { + return p1.row == p2.row && p1.column == p2.column; +} +exports.onSessionChange = function(e) { + var session = e.session; + if (session && !session.multiSelect) { + session.$selectionMarkers = []; + session.selection.$initRangeList(); + session.multiSelect = session.selection; + } + this.multiSelect = session && session.multiSelect; + + var oldSession = e.oldSession; + if (oldSession) { + oldSession.multiSelect.off("addRange", this.$onAddRange); + oldSession.multiSelect.off("removeRange", this.$onRemoveRange); + oldSession.multiSelect.off("multiSelect", this.$onMultiSelect); + oldSession.multiSelect.off("singleSelect", this.$onSingleSelect); + oldSession.multiSelect.lead.off("change", this.$checkMultiselectChange); + oldSession.multiSelect.anchor.off("change", this.$checkMultiselectChange); + } + + if (session) { + session.multiSelect.on("addRange", this.$onAddRange); + session.multiSelect.on("removeRange", this.$onRemoveRange); + session.multiSelect.on("multiSelect", this.$onMultiSelect); + session.multiSelect.on("singleSelect", this.$onSingleSelect); + session.multiSelect.lead.on("change", this.$checkMultiselectChange); + session.multiSelect.anchor.on("change", this.$checkMultiselectChange); + } + + if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) { + if (session.selection.inMultiSelectMode) + this.$onMultiSelect(); + else + this.$onSingleSelect(); + } +}; +function MultiSelect(editor) { + if (editor.$multiselectOnSessionChange) + return; + editor.$onAddRange = editor.$onAddRange.bind(editor); + editor.$onRemoveRange = editor.$onRemoveRange.bind(editor); + editor.$onMultiSelect = editor.$onMultiSelect.bind(editor); + editor.$onSingleSelect = editor.$onSingleSelect.bind(editor); + editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor); + editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor); + + editor.$multiselectOnSessionChange(editor); + editor.on("changeSession", editor.$multiselectOnSessionChange); + + editor.on("mousedown", onMouseDown); + editor.commands.addCommands(commands.defaultCommands); + + addAltCursorListeners(editor); +} + +function addAltCursorListeners(editor){ + var el = editor.textInput.getElement(); + var altCursor = false; + event.addListener(el, "keydown", function(e) { + var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey); + if (editor.$blockSelectEnabled && altDown) { + if (!altCursor) { + editor.renderer.setMouseCursor("crosshair"); + altCursor = true; + } + } else if (altCursor) { + reset(); + } + }); + + event.addListener(el, "keyup", reset); + event.addListener(el, "blur", reset); + function reset(e) { + if (altCursor) { + editor.renderer.setMouseCursor(""); + altCursor = false; + } + } +} + +exports.MultiSelect = MultiSelect; + + +require("./config").defineOptions(Editor.prototype, "editor", { + enableMultiselect: { + set: function(val) { + MultiSelect(this); + if (val) { + this.on("changeSession", this.$multiselectOnSessionChange); + this.on("mousedown", onMouseDown); + } else { + this.off("changeSession", this.$multiselectOnSessionChange); + this.off("mousedown", onMouseDown); + } + }, + value: true + }, + enableBlockSelect: { + set: function(val) { + this.$blockSelectEnabled = val; + }, + value: true + } +}); + + + +}); + +ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; + +(function() { + + this.foldingStartMarker = null; + this.foldingStopMarker = null; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + if (this.foldingStartMarker.test(line)) + return "start"; + if (foldStyle == "markbeginend" + && this.foldingStopMarker + && this.foldingStopMarker.test(line)) + return "end"; + return ""; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + return null; + }; + + this.indentationBlock = function(session, row, column) { + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1) + return; + + var startColumn = column || line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + var level = session.getLine(row).search(re); + + if (level == -1) + continue; + + if (level <= startLevel) + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + + this.openingBracketBlock = function(session, bracket, row, column, typeRe) { + var start = {row: row, column: column + 1}; + var end = session.$findClosingBracket(bracket, start, typeRe); + if (!end) + return; + + var fw = session.foldWidgets[end.row]; + if (fw == null) + fw = session.getFoldWidget(end.row); + + if (fw == "start" && end.row > start.row) { + end.row --; + end.column = session.getLine(end.row).length; + } + return Range.fromPoints(start, end); + }; + + this.closingBracketBlock = function(session, bracket, row, column, typeRe) { + var end = {row: row, column: column}; + var start = session.$findOpeningBracket(bracket, end); + + if (!start) + return; + + start.column++; + end.column--; + + return Range.fromPoints(start, end); + }; +}).call(FoldMode.prototype); + +}); + +ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +exports.isDark = false; +exports.cssClass = "ace-tm"; +exports.cssText = ".ace-tm .ace_gutter {\ +background: #f0f0f0;\ +color: #333;\ +}\ +.ace-tm .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-tm .ace_fold {\ +background-color: #6B72E6;\ +}\ +.ace-tm {\ +background-color: #FFFFFF;\ +color: black;\ +}\ +.ace-tm .ace_cursor {\ +color: black;\ +}\ +.ace-tm .ace_invisible {\ +color: rgb(191, 191, 191);\ +}\ +.ace-tm .ace_storage,\ +.ace-tm .ace_keyword {\ +color: blue;\ +}\ +.ace-tm .ace_constant {\ +color: rgb(197, 6, 11);\ +}\ +.ace-tm .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-tm .ace_constant.ace_language {\ +color: rgb(88, 92, 246);\ +}\ +.ace-tm .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-tm .ace_invalid {\ +background-color: rgba(255, 0, 0, 0.1);\ +color: red;\ +}\ +.ace-tm .ace_support.ace_function {\ +color: rgb(60, 76, 114);\ +}\ +.ace-tm .ace_support.ace_constant {\ +color: rgb(6, 150, 14);\ +}\ +.ace-tm .ace_support.ace_type,\ +.ace-tm .ace_support.ace_class {\ +color: rgb(109, 121, 222);\ +}\ +.ace-tm .ace_keyword.ace_operator {\ +color: rgb(104, 118, 135);\ +}\ +.ace-tm .ace_string {\ +color: rgb(3, 106, 7);\ +}\ +.ace-tm .ace_comment {\ +color: rgb(76, 136, 107);\ +}\ +.ace-tm .ace_comment.ace_doc {\ +color: rgb(0, 102, 255);\ +}\ +.ace-tm .ace_comment.ace_doc.ace_tag {\ +color: rgb(128, 159, 191);\ +}\ +.ace-tm .ace_constant.ace_numeric {\ +color: rgb(0, 0, 205);\ +}\ +.ace-tm .ace_variable {\ +color: rgb(49, 132, 149);\ +}\ +.ace-tm .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-tm .ace_entity.ace_name.ace_function {\ +color: #0000A2;\ +}\ +.ace-tm .ace_heading {\ +color: rgb(12, 7, 255);\ +}\ +.ace-tm .ace_list {\ +color:rgb(185, 6, 144);\ +}\ +.ace-tm .ace_meta.ace_tag {\ +color:rgb(0, 22, 142);\ +}\ +.ace-tm .ace_string.ace_regex {\ +color: rgb(255, 0, 0)\ +}\ +.ace-tm .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-tm.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px white;\ +}\ +.ace-tm .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-tm .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-tm .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-tm .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.07);\ +}\ +.ace-tm .ace_gutter-active-line {\ +background-color : #dcdcdc;\ +}\ +.ace-tm .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-tm .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); + +ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var Range = require("./range").Range; + + +function LineWidgets(session) { + this.session = session; + this.session.widgetManager = this; + this.session.getRowLength = this.getRowLength; + this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; + this.updateOnChange = this.updateOnChange.bind(this); + this.renderWidgets = this.renderWidgets.bind(this); + this.measureWidgets = this.measureWidgets.bind(this); + this.session._changedWidgets = []; + this.$onChangeEditor = this.$onChangeEditor.bind(this); + + this.session.on("change", this.updateOnChange); + this.session.on("changeFold", this.updateOnFold); + this.session.on("changeEditor", this.$onChangeEditor); +} + +(function() { + this.getRowLength = function(row) { + var h; + if (this.lineWidgets) + h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; + else + h = 0; + if (!this.$useWrapMode || !this.$wrapData[row]) { + return 1 + h; + } else { + return this.$wrapData[row].length + 1 + h; + } + }; + + this.$getWidgetScreenLength = function() { + var screenRows = 0; + this.lineWidgets.forEach(function(w){ + if (w && w.rowCount && !w.hidden) + screenRows += w.rowCount; + }); + return screenRows; + }; + + this.$onChangeEditor = function(e) { + this.attach(e.editor); + }; + + this.attach = function(editor) { + if (editor && editor.widgetManager && editor.widgetManager != this) + editor.widgetManager.detach(); + + if (this.editor == editor) + return; + + this.detach(); + this.editor = editor; + + if (editor) { + editor.widgetManager = this; + editor.renderer.on("beforeRender", this.measureWidgets); + editor.renderer.on("afterRender", this.renderWidgets); + } + }; + this.detach = function(e) { + var editor = this.editor; + if (!editor) + return; + + this.editor = null; + editor.widgetManager = null; + + editor.renderer.off("beforeRender", this.measureWidgets); + editor.renderer.off("afterRender", this.renderWidgets); + var lineWidgets = this.session.lineWidgets; + lineWidgets && lineWidgets.forEach(function(w) { + if (w && w.el && w.el.parentNode) { + w._inDocument = false; + w.el.parentNode.removeChild(w.el); + } + }); + }; + + this.updateOnFold = function(e, session) { + var lineWidgets = session.lineWidgets; + if (!lineWidgets || !e.action) + return; + var fold = e.data; + var start = fold.start.row; + var end = fold.end.row; + var hide = e.action == "add"; + for (var i = start + 1; i < end; i++) { + if (lineWidgets[i]) + lineWidgets[i].hidden = hide; + } + if (lineWidgets[end]) { + if (hide) { + if (!lineWidgets[start]) + lineWidgets[start] = lineWidgets[end]; + else + lineWidgets[end].hidden = hide; + } else { + if (lineWidgets[start] == lineWidgets[end]) + lineWidgets[start] = undefined; + lineWidgets[end].hidden = hide; + } + } + }; + + this.updateOnChange = function(delta) { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) return; + + var startRow = delta.start.row; + var len = delta.end.row - startRow; + + if (len === 0) { + } else if (delta.action == 'remove') { + var removed = lineWidgets.splice(startRow + 1, len); + removed.forEach(function(w) { + w && this.removeLineWidget(w); + }, this); + this.$updateRows(); + } else { + var args = new Array(len); + args.unshift(startRow, 0); + lineWidgets.splice.apply(lineWidgets, args); + this.$updateRows(); + } + }; + + this.$updateRows = function() { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) return; + var noWidgets = true; + lineWidgets.forEach(function(w, i) { + if (w) { + noWidgets = false; + w.row = i; + while (w.$oldWidget) { + w.$oldWidget.row = i; + w = w.$oldWidget; + } + } + }); + if (noWidgets) + this.session.lineWidgets = null; + }; + + this.addLineWidget = function(w) { + if (!this.session.lineWidgets) + this.session.lineWidgets = new Array(this.session.getLength()); + + var old = this.session.lineWidgets[w.row]; + if (old) { + w.$oldWidget = old; + if (old.el && old.el.parentNode) { + old.el.parentNode.removeChild(old.el); + old._inDocument = false; + } + } + + this.session.lineWidgets[w.row] = w; + + w.session = this.session; + + var renderer = this.editor.renderer; + if (w.html && !w.el) { + w.el = dom.createElement("div"); + w.el.innerHTML = w.html; + } + if (w.el) { + dom.addCssClass(w.el, "ace_lineWidgetContainer"); + w.el.style.position = "absolute"; + w.el.style.zIndex = 5; + renderer.container.appendChild(w.el); + w._inDocument = true; + } + + if (!w.coverGutter) { + w.el.style.zIndex = 3; + } + if (w.pixelHeight == null) { + w.pixelHeight = w.el.offsetHeight; + } + if (w.rowCount == null) { + w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; + } + + var fold = this.session.getFoldAt(w.row, 0); + w.$fold = fold; + if (fold) { + var lineWidgets = this.session.lineWidgets; + if (w.row == fold.end.row && !lineWidgets[fold.start.row]) + lineWidgets[fold.start.row] = w; + else + w.hidden = true; + } + + this.session._emit("changeFold", {data:{start:{row: w.row}}}); + + this.$updateRows(); + this.renderWidgets(null, renderer); + this.onWidgetChanged(w); + return w; + }; + + this.removeLineWidget = function(w) { + w._inDocument = false; + w.session = null; + if (w.el && w.el.parentNode) + w.el.parentNode.removeChild(w.el); + if (w.editor && w.editor.destroy) try { + w.editor.destroy(); + } catch(e){} + if (this.session.lineWidgets) { + var w1 = this.session.lineWidgets[w.row] + if (w1 == w) { + this.session.lineWidgets[w.row] = w.$oldWidget; + if (w.$oldWidget) + this.onWidgetChanged(w.$oldWidget); + } else { + while (w1) { + if (w1.$oldWidget == w) { + w1.$oldWidget = w.$oldWidget; + break; + } + w1 = w1.$oldWidget; + } + } + } + this.session._emit("changeFold", {data:{start:{row: w.row}}}); + this.$updateRows(); + }; + + this.getWidgetsAtRow = function(row) { + var lineWidgets = this.session.lineWidgets; + var w = lineWidgets && lineWidgets[row]; + var list = []; + while (w) { + list.push(w); + w = w.$oldWidget; + } + return list; + }; + + this.onWidgetChanged = function(w) { + this.session._changedWidgets.push(w); + this.editor && this.editor.renderer.updateFull(); + }; + + this.measureWidgets = function(e, renderer) { + var changedWidgets = this.session._changedWidgets; + var config = renderer.layerConfig; + + if (!changedWidgets || !changedWidgets.length) return; + var min = Infinity; + for (var i = 0; i < changedWidgets.length; i++) { + var w = changedWidgets[i]; + if (!w || !w.el) continue; + if (w.session != this.session) continue; + if (!w._inDocument) { + if (this.session.lineWidgets[w.row] != w) + continue; + w._inDocument = true; + renderer.container.appendChild(w.el); + } + + w.h = w.el.offsetHeight; + + if (!w.fixedWidth) { + w.w = w.el.offsetWidth; + w.screenWidth = Math.ceil(w.w / config.characterWidth); + } + + var rowCount = w.h / config.lineHeight; + if (w.coverLine) { + rowCount -= this.session.getRowLineCount(w.row); + if (rowCount < 0) + rowCount = 0; + } + if (w.rowCount != rowCount) { + w.rowCount = rowCount; + if (w.row < min) + min = w.row; + } + } + if (min != Infinity) { + this.session._emit("changeFold", {data:{start:{row: min}}}); + this.session.lineWidgetWidth = null; + } + this.session._changedWidgets = []; + }; + + this.renderWidgets = function(e, renderer) { + var config = renderer.layerConfig; + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) + return; + var first = Math.min(this.firstRow, config.firstRow); + var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); + + while (first > 0 && !lineWidgets[first]) + first--; + + this.firstRow = config.firstRow; + this.lastRow = config.lastRow; + + renderer.$cursorLayer.config = config; + for (var i = first; i <= last; i++) { + var w = lineWidgets[i]; + if (!w || !w.el) continue; + if (w.hidden) { + w.el.style.top = -100 - (w.pixelHeight || 0) + "px"; + continue; + } + if (!w._inDocument) { + w._inDocument = true; + renderer.container.appendChild(w.el); + } + var top = renderer.$cursorLayer.getPixelPosition({row: i, column:0}, true).top; + if (!w.coverLine) + top += config.lineHeight * this.session.getRowLineCount(w.row); + w.el.style.top = top - config.offset + "px"; + + var left = w.coverGutter ? 0 : renderer.gutterWidth; + if (!w.fixedWidth) + left -= renderer.scrollLeft; + w.el.style.left = left + "px"; + + if (w.fullWidth && w.screenWidth) { + w.el.style.minWidth = config.width + 2 * config.padding + "px"; + } + + if (w.fixedWidth) { + w.el.style.right = renderer.scrollBar.getWidth() + "px"; + } else { + w.el.style.right = ""; + } + } + }; + +}).call(LineWidgets.prototype); + + +exports.LineWidgets = LineWidgets; + +}); + +ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"], function(require, exports, module) { +"use strict"; +var LineWidgets = require("../line_widgets").LineWidgets; +var dom = require("../lib/dom"); +var Range = require("../range").Range; + +function binarySearch(array, needle, comparator) { + var first = 0; + var last = array.length - 1; + + while (first <= last) { + var mid = (first + last) >> 1; + var c = comparator(needle, array[mid]); + if (c > 0) + first = mid + 1; + else if (c < 0) + last = mid - 1; + else + return mid; + } + return -(first + 1); +} + +function findAnnotations(session, row, dir) { + var annotations = session.getAnnotations().sort(Range.comparePoints); + if (!annotations.length) + return; + + var i = binarySearch(annotations, {row: row, column: -1}, Range.comparePoints); + if (i < 0) + i = -i - 1; + + if (i >= annotations.length) + i = dir > 0 ? 0 : annotations.length - 1; + else if (i === 0 && dir < 0) + i = annotations.length - 1; + + var annotation = annotations[i]; + if (!annotation || !dir) + return; + + if (annotation.row === row) { + do { + annotation = annotations[i += dir]; + } while (annotation && annotation.row === row); + if (!annotation) + return annotations.slice(); + } + + + var matched = []; + row = annotation.row; + do { + matched[dir < 0 ? "unshift" : "push"](annotation); + annotation = annotations[i += dir]; + } while (annotation && annotation.row == row); + return matched.length && matched; +} + +exports.showErrorMarker = function(editor, dir) { + var session = editor.session; + if (!session.widgetManager) { + session.widgetManager = new LineWidgets(session); + session.widgetManager.attach(editor); + } + + var pos = editor.getCursorPosition(); + var row = pos.row; + var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function(w) { + return w.type == "errorMarker"; + })[0]; + if (oldWidget) { + oldWidget.destroy(); + } else { + row -= dir; + } + var annotations = findAnnotations(session, row, dir); + var gutterAnno; + if (annotations) { + var annotation = annotations[0]; + pos.column = (annotation.pos && typeof annotation.column != "number" + ? annotation.pos.sc + : annotation.column) || 0; + pos.row = annotation.row; + gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row]; + } else if (oldWidget) { + return; + } else { + gutterAnno = { + text: ["Looks good!"], + className: "ace_ok" + }; + } + editor.session.unfold(pos.row); + editor.selection.moveToPosition(pos); + + var w = { + row: pos.row, + fixedWidth: true, + coverGutter: true, + el: dom.createElement("div"), + type: "errorMarker" + }; + var el = w.el.appendChild(dom.createElement("div")); + var arrow = w.el.appendChild(dom.createElement("div")); + arrow.className = "error_widget_arrow " + gutterAnno.className; + + var left = editor.renderer.$cursorLayer + .getPixelPosition(pos).left; + arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px"; + + w.el.className = "error_widget_wrapper"; + el.className = "error_widget " + gutterAnno.className; + el.innerHTML = gutterAnno.text.join("
        "); + + el.appendChild(dom.createElement("div")); + + var kb = function(_, hashId, keyString) { + if (hashId === 0 && (keyString === "esc" || keyString === "return")) { + w.destroy(); + return {command: "null"}; + } + }; + + w.destroy = function() { + if (editor.$mouseHandler.isMousePressed) + return; + editor.keyBinding.removeKeyboardHandler(kb); + session.widgetManager.removeLineWidget(w); + editor.off("changeSelection", w.destroy); + editor.off("changeSession", w.destroy); + editor.off("mouseup", w.destroy); + editor.off("change", w.destroy); + }; + + editor.keyBinding.addKeyboardHandler(kb); + editor.on("changeSelection", w.destroy); + editor.on("changeSession", w.destroy); + editor.on("mouseup", w.destroy); + editor.on("change", w.destroy); + + editor.session.widgetManager.addLineWidget(w); + + w.el.onmousedown = editor.focus.bind(editor); + + editor.renderer.scrollCursorIntoView(null, 0.5, {bottom: w.el.offsetHeight}); +}; + + +dom.importCssString("\ + .error_widget_wrapper {\ + background: inherit;\ + color: inherit;\ + border:none\ + }\ + .error_widget {\ + border-top: solid 2px;\ + border-bottom: solid 2px;\ + margin: 5px 0;\ + padding: 10px 40px;\ + white-space: pre-wrap;\ + }\ + .error_widget.ace_error, .error_widget_arrow.ace_error{\ + border-color: #ff5a5a\ + }\ + .error_widget.ace_warning, .error_widget_arrow.ace_warning{\ + border-color: #F1D817\ + }\ + .error_widget.ace_info, .error_widget_arrow.ace_info{\ + border-color: #5a5a5a\ + }\ + .error_widget.ace_ok, .error_widget_arrow.ace_ok{\ + border-color: #5aaa5a\ + }\ + .error_widget_arrow {\ + position: absolute;\ + border: solid 5px;\ + border-top-color: transparent!important;\ + border-right-color: transparent!important;\ + border-left-color: transparent!important;\ + top: -5px;\ + }\ +", ""); + +}); + +ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"], function(require, exports, module) { +"use strict"; + +require("./lib/fixoldbrowsers"); + +var dom = require("./lib/dom"); +var event = require("./lib/event"); + +var Editor = require("./editor").Editor; +var EditSession = require("./edit_session").EditSession; +var UndoManager = require("./undomanager").UndoManager; +var Renderer = require("./virtual_renderer").VirtualRenderer; +require("./worker/worker_client"); +require("./keyboard/hash_handler"); +require("./placeholder"); +require("./multi_select"); +require("./mode/folding/fold_mode"); +require("./theme/textmate"); +require("./ext/error_marker"); + +exports.config = require("./config"); +exports.require = require; + +if (typeof define === "function") + exports.define = define; +exports.edit = function(el) { + if (typeof el == "string") { + var _id = el; + el = document.getElementById(_id); + if (!el) + throw new Error("ace.edit can't find div #" + _id); + } + + if (el && el.env && el.env.editor instanceof Editor) + return el.env.editor; + + var value = ""; + if (el && /input|textarea/i.test(el.tagName)) { + var oldNode = el; + value = oldNode.value; + el = dom.createElement("pre"); + oldNode.parentNode.replaceChild(el, oldNode); + } else if (el) { + value = dom.getInnerText(el); + el.innerHTML = ""; + } + + var doc = exports.createEditSession(value); + + var editor = new Editor(new Renderer(el)); + editor.setSession(doc); + + var env = { + document: doc, + editor: editor, + onResize: editor.resize.bind(editor, null) + }; + if (oldNode) env.textarea = oldNode; + event.addListener(window, "resize", env.onResize); + editor.on("destroy", function() { + event.removeListener(window, "resize", env.onResize); + env.editor.container.env = null; // prevent memory leak on old ie + }); + editor.container.env = editor.env = env; + return editor; +}; +exports.createEditSession = function(text, mode) { + var doc = new EditSession(text, mode); + doc.setUndoManager(new UndoManager()); + return doc; +} +exports.EditSession = EditSession; +exports.UndoManager = UndoManager; +exports.version = "1.2.8"; +}); + (function() { + ace.require(["ace/ace"], function(a) { + if (a) { + a.config.init(true); + a.define = ace.define; + } + if (!window.ace) + window.ace = a; + for (var key in a) if (a.hasOwnProperty(key)) + window.ace[key] = a[key]; + }); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-beautify.js b/htdocs/includes/ace/ext-beautify.js new file mode 100644 index 00000000000..ba499b776e5 --- /dev/null +++ b/htdocs/includes/ace/ext-beautify.js @@ -0,0 +1,334 @@ +ace.define("ace/ext/beautify/php_rules",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; +var TokenIterator = require("ace/token_iterator").TokenIterator; +exports.newLines = [{ + type: 'support.php_tag', + value: '' +}, { + type: 'paren.lparen', + value: '{', + indent: true +}, { + type: 'paren.rparen', + breakBefore: true, + value: '}', + indent: false +}, { + type: 'paren.rparen', + breakBefore: true, + value: '})', + indent: false, + dontBreak: true +}, { + type: 'comment' +}, { + type: 'text', + value: ';' +}, { + type: 'text', + value: ':', + context: 'php' +}, { + type: 'keyword', + value: 'case', + indent: true, + dontBreak: true +}, { + type: 'keyword', + value: 'default', + indent: true, + dontBreak: true +}, { + type: 'keyword', + value: 'break', + indent: false, + dontBreak: true +}, { + type: 'punctuation.doctype.end', + value: '>' +}, { + type: 'meta.tag.punctuation.end', + value: '>' +}, { + type: 'meta.tag.punctuation.begin', + value: '<', + blockTag: true, + indent: true, + dontBreak: true +}, { + type: 'meta.tag.punctuation.begin', + value: '' ){ + context = 'php'; + } + else if( token.type == 'support.php_tag' && token.value == '?>' ){ + context = 'html'; + } + else if( token.type == 'meta.tag.name.style' && context != 'css' ){ + context = 'css'; + } + else if( token.type == 'meta.tag.name.style' && context == 'css' ){ + context = 'html'; + } + else if( token.type == 'meta.tag.name.script' && context != 'js' ){ + context = 'js'; + } + else if( token.type == 'meta.tag.name.script' && context == 'js' ){ + context = 'html'; + } + + nextToken = iterator.stepForward(); + if (nextToken && nextToken.type.indexOf('meta.tag.name') == 0) { + nextTag = nextToken.value; + } + if ( lastToken.type == 'support.php_tag' && lastToken.value == '' ) { + dontBreak = false; + } + lastTag = tag; + + lastToken = token; + + token = nextToken; + + if (token===null) { + break; + } + } + + return code; +}; + + + +}); + +ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator","ace/ext/beautify/php_rules"], function(require, exports, module) { +"use strict"; +var TokenIterator = require("ace/token_iterator").TokenIterator; + +var phpTransform = require("./beautify/php_rules").transform; + +exports.beautify = function(session) { + var iterator = new TokenIterator(session, 0, 0); + var token = iterator.getCurrentToken(); + + var context = session.$modeId.split("/").pop(); + + var code = phpTransform(iterator, context); + session.doc.setValue(code); +}; + +exports.commands = [{ + name: "beautify", + exec: function(editor) { + exports.beautify(editor.session); + }, + bindKey: "Ctrl-Shift-B" +}] + +}); + (function() { + ace.require(["ace/ext/beautify"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-chromevox.js b/htdocs/includes/ace/ext-chromevox.js new file mode 100644 index 00000000000..a321335c6c0 --- /dev/null +++ b/htdocs/includes/ace/ext-chromevox.js @@ -0,0 +1,540 @@ +ace.define("ace/ext/chromevox",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) { +var cvoxAce = {}; +cvoxAce.SpeechProperty; +cvoxAce.Cursor; +cvoxAce.Token; +cvoxAce.Annotation; +var CONSTANT_PROP = { + 'rate': 0.8, + 'pitch': 0.4, + 'volume': 0.9 +}; +var DEFAULT_PROP = { + 'rate': 1, + 'pitch': 0.5, + 'volume': 0.9 +}; +var ENTITY_PROP = { + 'rate': 0.8, + 'pitch': 0.8, + 'volume': 0.9 +}; +var KEYWORD_PROP = { + 'rate': 0.8, + 'pitch': 0.3, + 'volume': 0.9 +}; +var STORAGE_PROP = { + 'rate': 0.8, + 'pitch': 0.7, + 'volume': 0.9 +}; +var VARIABLE_PROP = { + 'rate': 0.8, + 'pitch': 0.8, + 'volume': 0.9 +}; +var DELETED_PROP = { + 'punctuationEcho': 'none', + 'relativePitch': -0.6 +}; +var ERROR_EARCON = 'ALERT_NONMODAL'; +var MODE_SWITCH_EARCON = 'ALERT_MODAL'; +var NO_MATCH_EARCON = 'INVALID_KEYPRESS'; +var INSERT_MODE_STATE = 'insertMode'; +var COMMAND_MODE_STATE = 'start'; + +var REPLACE_LIST = [ + { + substr: ';', + newSubstr: ' semicolon ' + }, + { + substr: ':', + newSubstr: ' colon ' + } +]; +var Command = { + SPEAK_ANNOT: 'annots', + SPEAK_ALL_ANNOTS: 'all_annots', + TOGGLE_LOCATION: 'toggle_location', + SPEAK_MODE: 'mode', + SPEAK_ROW_COL: 'row_col', + TOGGLE_DISPLACEMENT: 'toggle_displacement', + FOCUS_TEXT: 'focus_text' +}; +var KEY_PREFIX = 'CONTROL + SHIFT '; +cvoxAce.editor = null; +var lastCursor = null; +var annotTable = {}; +var shouldSpeakRowLocation = false; +var shouldSpeakDisplacement = false; +var changed = false; +var vimState = null; +var keyCodeToShortcutMap = {}; +var cmdToShortcutMap = {}; +var getKeyShortcutString = function(keyCode) { + return KEY_PREFIX + String.fromCharCode(keyCode); +}; +var isVimMode = function() { + var keyboardHandler = cvoxAce.editor.keyBinding.getKeyboardHandler(); + return keyboardHandler.$id === 'ace/keyboard/vim'; +}; +var getCurrentToken = function(cursor) { + return cvoxAce.editor.getSession().getTokenAt(cursor.row, cursor.column + 1); +}; +var getCurrentLine = function(cursor) { + return cvoxAce.editor.getSession().getLine(cursor.row); +}; +var onRowChange = function(currCursor) { + if (annotTable[currCursor.row]) { + cvox.Api.playEarcon(ERROR_EARCON); + } + if (shouldSpeakRowLocation) { + cvox.Api.stop(); + speakChar(currCursor); + speakTokenQueue(getCurrentToken(currCursor)); + speakLine(currCursor.row, 1); + } else { + speakLine(currCursor.row, 0); + } +}; +var isWord = function(cursor) { + var line = getCurrentLine(cursor); + var lineSuffix = line.substr(cursor.column - 1); + if (cursor.column === 0) { + lineSuffix = ' ' + line; + } + var firstWordRegExp = /^\W(\w+)/; + var words = firstWordRegExp.exec(lineSuffix); + return words !== null; +}; +var rules = { + 'constant': { + prop: CONSTANT_PROP + }, + 'entity': { + prop: ENTITY_PROP + }, + 'keyword': { + prop: KEYWORD_PROP + }, + 'storage': { + prop: STORAGE_PROP + }, + 'variable': { + prop: VARIABLE_PROP + }, + 'meta': { + prop: DEFAULT_PROP, + replace: [ + { + substr: '', + newSubstr: ' close tag ' + }, + { + substr: '<', + newSubstr: ' tag start ' + }, + { + substr: '>', + newSubstr: ' tag end ' + } + ] + } +}; +var DEFAULT_RULE = { + prop: DEFAULT_RULE +}; +var expand = function(value, replaceRules) { + var newValue = value; + for (var i = 0; i < replaceRules.length; i++) { + var replaceRule = replaceRules[i]; + var regexp = new RegExp(replaceRule.substr, 'g'); + newValue = newValue.replace(regexp, replaceRule.newSubstr); + } + return newValue; +}; +var mergeTokens = function(tokens, start, end) { + var newToken = {}; + newToken.value = ''; + newToken.type = tokens[start].type; + for (var j = start; j < end; j++) { + newToken.value += tokens[j].value; + } + return newToken; +}; +var mergeLikeTokens = function(tokens) { + if (tokens.length <= 1) { + return tokens; + } + var newTokens = []; + var lastLikeIndex = 0; + for (var i = 1; i < tokens.length; i++) { + var lastLikeToken = tokens[lastLikeIndex]; + var currToken = tokens[i]; + if (getTokenRule(lastLikeToken) !== getTokenRule(currToken)) { + newTokens.push(mergeTokens(tokens, lastLikeIndex, i)); + lastLikeIndex = i; + } + } + newTokens.push(mergeTokens(tokens, lastLikeIndex, tokens.length)); + return newTokens; +}; +var isRowWhiteSpace = function(row) { + var line = cvoxAce.editor.getSession().getLine(row); + var whiteSpaceRegexp = /^\s*$/; + return whiteSpaceRegexp.exec(line) !== null; +}; +var speakLine = function(row, queue) { + var tokens = cvoxAce.editor.getSession().getTokens(row); + if (tokens.length === 0 || isRowWhiteSpace(row)) { + cvox.Api.playEarcon('EDITABLE_TEXT'); + return; + } + tokens = mergeLikeTokens(tokens); + var firstToken = tokens[0]; + tokens = tokens.filter(function(token) { + return token !== firstToken; + }); + speakToken_(firstToken, queue); + tokens.forEach(speakTokenQueue); +}; +var speakTokenFlush = function(token) { + speakToken_(token, 0); +}; +var speakTokenQueue = function(token) { + speakToken_(token, 1); +}; +var getTokenRule = function(token) { + if (!token || !token.type) { + return; + } + var split = token.type.split('.'); + if (split.length === 0) { + return; + } + var type = split[0]; + var rule = rules[type]; + if (!rule) { + return DEFAULT_RULE; + } + return rule; +}; +var speakToken_ = function(token, queue) { + var rule = getTokenRule(token); + var value = expand(token.value, REPLACE_LIST); + if (rule.replace) { + value = expand(value, rule.replace); + } + cvox.Api.speak(value, queue, rule.prop); +}; +var speakChar = function(cursor) { + var line = getCurrentLine(cursor); + cvox.Api.speak(line[cursor.column], 1); +}; +var speakDisplacement = function(lastCursor, currCursor) { + var line = getCurrentLine(currCursor); + var displace = line.substring(lastCursor.column, currCursor.column); + displace = displace.replace(/ /g, ' space '); + cvox.Api.speak(displace); +}; +var speakCharOrWordOrLine = function(lastCursor, currCursor) { + if (Math.abs(lastCursor.column - currCursor.column) !== 1) { + var currLineLength = getCurrentLine(currCursor).length; + if (currCursor.column === 0 || currCursor.column === currLineLength) { + speakLine(currCursor.row, 0); + return; + } + if (isWord(currCursor)) { + cvox.Api.stop(); + speakTokenQueue(getCurrentToken(currCursor)); + return; + } + } + speakChar(currCursor); +}; +var onColumnChange = function(lastCursor, currCursor) { + if (!cvoxAce.editor.selection.isEmpty()) { + speakDisplacement(lastCursor, currCursor); + cvox.Api.speak('selected', 1); + } + else if (shouldSpeakDisplacement) { + speakDisplacement(lastCursor, currCursor); + } else { + speakCharOrWordOrLine(lastCursor, currCursor); + } +}; +var onCursorChange = function(evt) { + if (changed) { + changed = false; + return; + } + var currCursor = cvoxAce.editor.selection.getCursor(); + if (currCursor.row !== lastCursor.row) { + onRowChange(currCursor); + } else { + onColumnChange(lastCursor, currCursor); + } + lastCursor = currCursor; +}; +var onSelectionChange = function(evt) { + if (cvoxAce.editor.selection.isEmpty()) { + cvox.Api.speak('unselected'); + } +}; +var onChange = function(delta) { + switch (delta.action) { + case 'remove': + cvox.Api.speak(delta.text, 0, DELETED_PROP); + changed = true; + break; + case 'insert': + cvox.Api.speak(delta.text, 0); + changed = true; + break; + } +}; +var isNewAnnotation = function(annot) { + var row = annot.row; + var col = annot.column; + return !annotTable[row] || !annotTable[row][col]; +}; +var populateAnnotations = function(annotations) { + annotTable = {}; + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + var row = annotation.row; + var col = annotation.column; + if (!annotTable[row]) { + annotTable[row] = {}; + } + annotTable[row][col] = annotation; + } +}; +var onAnnotationChange = function(evt) { + var annotations = cvoxAce.editor.getSession().getAnnotations(); + var newAnnotations = annotations.filter(isNewAnnotation); + if (newAnnotations.length > 0) { + cvox.Api.playEarcon(ERROR_EARCON); + } + populateAnnotations(annotations); +}; +var speakAnnot = function(annot) { + var annotText = annot.type + ' ' + annot.text + ' on ' + + rowColToString(annot.row, annot.column); + annotText = annotText.replace(';', 'semicolon'); + cvox.Api.speak(annotText, 1); +}; +var speakAnnotsByRow = function(row) { + var annots = annotTable[row]; + for (var col in annots) { + speakAnnot(annots[col]); + } +}; +var rowColToString = function(row, col) { + return 'row ' + (row + 1) + ' column ' + (col + 1); +}; +var speakCurrRowAndCol = function() { + cvox.Api.speak(rowColToString(lastCursor.row, lastCursor.column)); +}; +var speakAllAnnots = function() { + for (var row in annotTable) { + speakAnnotsByRow(row); + } +}; +var speakMode = function() { + if (!isVimMode()) { + return; + } + switch (cvoxAce.editor.keyBinding.$data.state) { + case INSERT_MODE_STATE: + cvox.Api.speak('Insert mode'); + break; + case COMMAND_MODE_STATE: + cvox.Api.speak('Command mode'); + break; + } +}; +var toggleSpeakRowLocation = function() { + shouldSpeakRowLocation = !shouldSpeakRowLocation; + if (shouldSpeakRowLocation) { + cvox.Api.speak('Speak location on row change enabled.'); + } else { + cvox.Api.speak('Speak location on row change disabled.'); + } +}; +var toggleSpeakDisplacement = function() { + shouldSpeakDisplacement = !shouldSpeakDisplacement; + if (shouldSpeakDisplacement) { + cvox.Api.speak('Speak displacement on column changes.'); + } else { + cvox.Api.speak('Speak current character or word on column changes.'); + } +}; +var onKeyDown = function(evt) { + if (evt.ctrlKey && evt.shiftKey) { + var shortcut = keyCodeToShortcutMap[evt.keyCode]; + if (shortcut) { + shortcut.func(); + } + } +}; +var onChangeStatus = function(evt, editor) { + if (!isVimMode()) { + return; + } + var state = editor.keyBinding.$data.state; + if (state === vimState) { + return; + } + switch (state) { + case INSERT_MODE_STATE: + cvox.Api.playEarcon(MODE_SWITCH_EARCON); + cvox.Api.setKeyEcho(true); + break; + case COMMAND_MODE_STATE: + cvox.Api.playEarcon(MODE_SWITCH_EARCON); + cvox.Api.setKeyEcho(false); + break; + } + vimState = state; +}; +var contextMenuHandler = function(evt) { + var cmd = evt.detail['customCommand']; + var shortcut = cmdToShortcutMap[cmd]; + if (shortcut) { + shortcut.func(); + cvoxAce.editor.focus(); + } +}; +var initContextMenu = function() { + var ACTIONS = SHORTCUTS.map(function(shortcut) { + return { + desc: shortcut.desc + getKeyShortcutString(shortcut.keyCode), + cmd: shortcut.cmd + }; + }); + var body = document.querySelector('body'); + body.setAttribute('contextMenuActions', JSON.stringify(ACTIONS)); + body.addEventListener('ATCustomEvent', contextMenuHandler, true); +}; +var onFindSearchbox = function(evt) { + if (evt.match) { + speakLine(lastCursor.row, 0); + } else { + cvox.Api.playEarcon(NO_MATCH_EARCON); + } +}; +var focus = function() { + cvoxAce.editor.focus(); +}; +var SHORTCUTS = [ + { + keyCode: 49, + func: function() { + speakAnnotsByRow(lastCursor.row); + }, + cmd: Command.SPEAK_ANNOT, + desc: 'Speak annotations on line' + }, + { + keyCode: 50, + func: speakAllAnnots, + cmd: Command.SPEAK_ALL_ANNOTS, + desc: 'Speak all annotations' + }, + { + keyCode: 51, + func: speakMode, + cmd: Command.SPEAK_MODE, + desc: 'Speak Vim mode' + }, + { + keyCode: 52, + func: toggleSpeakRowLocation, + cmd: Command.TOGGLE_LOCATION, + desc: 'Toggle speak row location' + }, + { + keyCode: 53, + func: speakCurrRowAndCol, + cmd: Command.SPEAK_ROW_COL, + desc: 'Speak row and column' + }, + { + keyCode: 54, + func: toggleSpeakDisplacement, + cmd: Command.TOGGLE_DISPLACEMENT, + desc: 'Toggle speak displacement' + }, + { + keyCode: 55, + func: focus, + cmd: Command.FOCUS_TEXT, + desc: 'Focus text' + } +]; +var onFocus = function(_, editor) { + cvoxAce.editor = editor; + editor.getSession().selection.on('changeCursor', onCursorChange); + editor.getSession().selection.on('changeSelection', onSelectionChange); + editor.getSession().on('change', onChange); + editor.getSession().on('changeAnnotation', onAnnotationChange); + editor.on('changeStatus', onChangeStatus); + editor.on('findSearchBox', onFindSearchbox); + editor.container.addEventListener('keydown', onKeyDown); + + lastCursor = editor.selection.getCursor(); +}; +var init = function(editor) { + onFocus(null, editor); + SHORTCUTS.forEach(function(shortcut) { + keyCodeToShortcutMap[shortcut.keyCode] = shortcut; + cmdToShortcutMap[shortcut.cmd] = shortcut; + }); + + editor.on('focus', onFocus); + if (isVimMode()) { + cvox.Api.setKeyEcho(false); + } + initContextMenu(); +}; +function cvoxApiExists() { + return (typeof(cvox) !== 'undefined') && cvox && cvox.Api; +} +var tries = 0; +var MAX_TRIES = 15; +function watchForCvoxLoad(editor) { + if (cvoxApiExists()) { + init(editor); + } else { + tries++; + if (tries >= MAX_TRIES) { + return; + } + window.setTimeout(watchForCvoxLoad, 500, editor); + } +} + +var Editor = require('../editor').Editor; +require('../config').defineOptions(Editor.prototype, 'editor', { + enableChromevoxEnhancements: { + set: function(val) { + if (val) { + watchForCvoxLoad(this); + } + }, + value: true // turn it on by default or check for window.cvox + } +}); + +}); + (function() { + ace.require(["ace/ext/chromevox"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-elastic_tabstops_lite.js b/htdocs/includes/ace/ext-elastic_tabstops_lite.js new file mode 100644 index 00000000000..14e8855f1f5 --- /dev/null +++ b/htdocs/includes/ace/ext-elastic_tabstops_lite.js @@ -0,0 +1,274 @@ +ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) { +"use strict"; + +var ElasticTabstopsLite = function(editor) { + this.$editor = editor; + var self = this; + var changedRows = []; + var recordChanges = false; + this.onAfterExec = function() { + recordChanges = false; + self.processRows(changedRows); + changedRows = []; + }; + this.onExec = function() { + recordChanges = true; + }; + this.onChange = function(delta) { + if (recordChanges) { + if (changedRows.indexOf(delta.start.row) == -1) + changedRows.push(delta.start.row); + if (delta.end.row != delta.start.row) + changedRows.push(delta.end.row); + } + }; +}; + +(function() { + this.processRows = function(rows) { + this.$inChange = true; + var checkedRows = []; + + for (var r = 0, rowCount = rows.length; r < rowCount; r++) { + var row = rows[r]; + + if (checkedRows.indexOf(row) > -1) + continue; + + var cellWidthObj = this.$findCellWidthsForBlock(row); + var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths); + var rowIndex = cellWidthObj.firstRow; + + for (var w = 0, l = cellWidths.length; w < l; w++) { + var widths = cellWidths[w]; + checkedRows.push(rowIndex); + this.$adjustRow(rowIndex, widths); + rowIndex++; + } + } + this.$inChange = false; + }; + + this.$findCellWidthsForBlock = function(row) { + var cellWidths = [], widths; + var rowIter = row; + while (rowIter >= 0) { + widths = this.$cellWidthsForRow(rowIter); + if (widths.length == 0) + break; + + cellWidths.unshift(widths); + rowIter--; + } + var firstRow = rowIter + 1; + rowIter = row; + var numRows = this.$editor.session.getLength(); + + while (rowIter < numRows - 1) { + rowIter++; + + widths = this.$cellWidthsForRow(rowIter); + if (widths.length == 0) + break; + + cellWidths.push(widths); + } + + return { cellWidths: cellWidths, firstRow: firstRow }; + }; + + this.$cellWidthsForRow = function(row) { + var selectionColumns = this.$selectionColumnsForRow(row); + + var tabs = [-1].concat(this.$tabsForRow(row)); + var widths = tabs.map(function(el) { return 0; } ).slice(1); + var line = this.$editor.session.getLine(row); + + for (var i = 0, len = tabs.length - 1; i < len; i++) { + var leftEdge = tabs[i]+1; + var rightEdge = tabs[i+1]; + + var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge); + var cell = line.substring(leftEdge, rightEdge); + widths[i] = Math.max(cell.replace(/\s+$/g,'').length, rightmostSelection - leftEdge); + } + + return widths; + }; + + this.$selectionColumnsForRow = function(row) { + var selections = [], cursor = this.$editor.getCursorPosition(); + if (this.$editor.session.getSelection().isEmpty()) { + if (row == cursor.row) + selections.push(cursor.column); + } + + return selections; + }; + + this.$setBlockCellWidthsToMax = function(cellWidths) { + var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth; + var columnInfo = this.$izip_longest(cellWidths); + + for (var c = 0, l = columnInfo.length; c < l; c++) { + var column = columnInfo[c]; + if (!column.push) { + console.error(column); + continue; + } + column.push(NaN); + + for (var r = 0, s = column.length; r < s; r++) { + var width = column[r]; + if (startingNewBlock) { + blockStartRow = r; + maxWidth = 0; + startingNewBlock = false; + } + if (isNaN(width)) { + blockEndRow = r; + + for (var j = blockStartRow; j < blockEndRow; j++) { + cellWidths[j][c] = maxWidth; + } + startingNewBlock = true; + } + + maxWidth = Math.max(maxWidth, width); + } + } + + return cellWidths; + }; + + this.$rightmostSelectionInCell = function(selectionColumns, cellRightEdge) { + var rightmost = 0; + + if (selectionColumns.length) { + var lengths = []; + for (var s = 0, length = selectionColumns.length; s < length; s++) { + if (selectionColumns[s] <= cellRightEdge) + lengths.push(s); + else + lengths.push(0); + } + rightmost = Math.max.apply(Math, lengths); + } + + return rightmost; + }; + + this.$tabsForRow = function(row) { + var rowTabs = [], line = this.$editor.session.getLine(row), + re = /\t/g, match; + + while ((match = re.exec(line)) != null) { + rowTabs.push(match.index); + } + + return rowTabs; + }; + + this.$adjustRow = function(row, widths) { + var rowTabs = this.$tabsForRow(row); + + if (rowTabs.length == 0) + return; + + var bias = 0, location = -1; + var expandedSet = this.$izip(widths, rowTabs); + + for (var i = 0, l = expandedSet.length; i < l; i++) { + var w = expandedSet[i][0], it = expandedSet[i][1]; + location += 1 + w; + it += bias; + var difference = location - it; + + if (difference == 0) + continue; + + var partialLine = this.$editor.session.getLine(row).substr(0, it ); + var strippedPartialLine = partialLine.replace(/\s*$/g, ""); + var ispaces = partialLine.length - strippedPartialLine.length; + + if (difference > 0) { + this.$editor.session.getDocument().insertInLine({row: row, column: it + 1}, Array(difference + 1).join(" ") + "\t"); + this.$editor.session.getDocument().removeInLine(row, it, it + 1); + + bias += difference; + } + + if (difference < 0 && ispaces >= -difference) { + this.$editor.session.getDocument().removeInLine(row, it + difference, it); + bias += difference; + } + } + }; + this.$izip_longest = function(iterables) { + if (!iterables[0]) + return []; + var longest = iterables[0].length; + var iterablesLength = iterables.length; + + for (var i = 1; i < iterablesLength; i++) { + var iLength = iterables[i].length; + if (iLength > longest) + longest = iLength; + } + + var expandedSet = []; + + for (var l = 0; l < longest; l++) { + var set = []; + for (var i = 0; i < iterablesLength; i++) { + if (iterables[i][l] === "") + set.push(NaN); + else + set.push(iterables[i][l]); + } + + expandedSet.push(set); + } + + + return expandedSet; + }; + this.$izip = function(widths, tabs) { + var size = widths.length >= tabs.length ? tabs.length : widths.length; + + var expandedSet = []; + for (var i = 0; i < size; i++) { + var set = [ widths[i], tabs[i] ]; + expandedSet.push(set); + } + return expandedSet; + }; + +}).call(ElasticTabstopsLite.prototype); + +exports.ElasticTabstopsLite = ElasticTabstopsLite; + +var Editor = require("../editor").Editor; +require("../config").defineOptions(Editor.prototype, "editor", { + useElasticTabstops: { + set: function(val) { + if (val) { + if (!this.elasticTabstops) + this.elasticTabstops = new ElasticTabstopsLite(this); + this.commands.on("afterExec", this.elasticTabstops.onAfterExec); + this.commands.on("exec", this.elasticTabstops.onExec); + this.on("change", this.elasticTabstops.onChange); + } else if (this.elasticTabstops) { + this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec); + this.commands.removeListener("exec", this.elasticTabstops.onExec); + this.removeListener("change", this.elasticTabstops.onChange); + } + } + } +}); + +}); + (function() { + ace.require(["ace/ext/elastic_tabstops_lite"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-emmet.js b/htdocs/includes/ace/ext-emmet.js new file mode 100644 index 00000000000..c2f2d1a18fa --- /dev/null +++ b/htdocs/includes/ace/ext-emmet.js @@ -0,0 +1,1223 @@ +ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"], function(require, exports, module) { +"use strict"; +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var lang = require("./lib/lang"); +var Range = require("./range").Range; +var Anchor = require("./anchor").Anchor; +var HashHandler = require("./keyboard/hash_handler").HashHandler; +var Tokenizer = require("./tokenizer").Tokenizer; +var comparePoints = Range.comparePoints; + +var SnippetManager = function() { + this.snippetMap = {}; + this.snippetNameMap = {}; +}; + +(function() { + oop.implement(this, EventEmitter); + + this.getTokenizer = function() { + function TabstopToken(str, _, stack) { + str = str.substr(1); + if (/^\d+$/.test(str) && !stack.inFormatString) + return [{tabstopId: parseInt(str, 10)}]; + return [{text: str}]; + } + function escape(ch) { + return "(?:[^\\\\" + ch + "]|\\\\.)"; + } + SnippetManager.$tokenizer = new Tokenizer({ + start: [ + {regex: /:/, onMatch: function(val, state, stack) { + if (stack.length && stack[0].expectIf) { + stack[0].expectIf = false; + stack[0].elseBranch = stack[0]; + return [stack[0]]; + } + return ":"; + }}, + {regex: /\\./, onMatch: function(val, state, stack) { + var ch = val[1]; + if (ch == "}" && stack.length) { + val = ch; + }else if ("`$\\".indexOf(ch) != -1) { + val = ch; + } else if (stack.inFormatString) { + if (ch == "n") + val = "\n"; + else if (ch == "t") + val = "\n"; + else if ("ulULE".indexOf(ch) != -1) { + val = {changeCase: ch, local: ch > "a"}; + } + } + + return [val]; + }}, + {regex: /}/, onMatch: function(val, state, stack) { + return [stack.length ? stack.shift() : val]; + }}, + {regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken}, + {regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) { + var t = TabstopToken(str.substr(1), state, stack); + stack.unshift(t[0]); + return t; + }, next: "snippetVar"}, + {regex: /\n/, token: "newline", merge: false} + ], + snippetVar: [ + {regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) { + stack[0].choices = val.slice(1, -1).split(","); + }, next: "start"}, + {regex: "/(" + escape("/") + "+)/(?:(" + escape("/") + "*)/)(\\w*):?", + onMatch: function(val, state, stack) { + var ts = stack[0]; + ts.fmtString = val; + + val = this.splitRegex.exec(val); + ts.guard = val[1]; + ts.fmt = val[2]; + ts.flag = val[3]; + return ""; + }, next: "start"}, + {regex: "`" + escape("`") + "*`", onMatch: function(val, state, stack) { + stack[0].code = val.splice(1, -1); + return ""; + }, next: "start"}, + {regex: "\\?", onMatch: function(val, state, stack) { + if (stack[0]) + stack[0].expectIf = true; + }, next: "start"}, + {regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"} + ], + formatString: [ + {regex: "/(" + escape("/") + "+)/", token: "regex"}, + {regex: "", onMatch: function(val, state, stack) { + stack.inFormatString = true; + }, next: "start"} + ] + }); + SnippetManager.prototype.getTokenizer = function() { + return SnippetManager.$tokenizer; + }; + return SnippetManager.$tokenizer; + }; + + this.tokenizeTmSnippet = function(str, startState) { + return this.getTokenizer().getLineTokens(str, startState).tokens.map(function(x) { + return x.value || x; + }); + }; + + this.$getDefaultValue = function(editor, name) { + if (/^[A-Z]\d+$/.test(name)) { + var i = name.substr(1); + return (this.variables[name[0] + "__"] || {})[i]; + } + if (/^\d+$/.test(name)) { + return (this.variables.__ || {})[name]; + } + name = name.replace(/^TM_/, ""); + + if (!editor) + return; + var s = editor.session; + switch(name) { + case "CURRENT_WORD": + var r = s.getWordRange(); + case "SELECTION": + case "SELECTED_TEXT": + return s.getTextRange(r); + case "CURRENT_LINE": + return s.getLine(editor.getCursorPosition().row); + case "PREV_LINE": // not possible in textmate + return s.getLine(editor.getCursorPosition().row - 1); + case "LINE_INDEX": + return editor.getCursorPosition().column; + case "LINE_NUMBER": + return editor.getCursorPosition().row + 1; + case "SOFT_TABS": + return s.getUseSoftTabs() ? "YES" : "NO"; + case "TAB_SIZE": + return s.getTabSize(); + case "FILENAME": + case "FILEPATH": + return ""; + case "FULLNAME": + return "Ace"; + } + }; + this.variables = {}; + this.getVariableValue = function(editor, varName) { + if (this.variables.hasOwnProperty(varName)) + return this.variables[varName](editor, varName) || ""; + return this.$getDefaultValue(editor, varName) || ""; + }; + this.tmStrFormat = function(str, ch, editor) { + var flag = ch.flag || ""; + var re = ch.guard; + re = new RegExp(re, flag.replace(/[^gi]/, "")); + var fmtTokens = this.tokenizeTmSnippet(ch.fmt, "formatString"); + var _self = this; + var formatted = str.replace(re, function() { + _self.variables.__ = arguments; + var fmtParts = _self.resolveVariables(fmtTokens, editor); + var gChangeCase = "E"; + for (var i = 0; i < fmtParts.length; i++) { + var ch = fmtParts[i]; + if (typeof ch == "object") { + fmtParts[i] = ""; + if (ch.changeCase && ch.local) { + var next = fmtParts[i + 1]; + if (next && typeof next == "string") { + if (ch.changeCase == "u") + fmtParts[i] = next[0].toUpperCase(); + else + fmtParts[i] = next[0].toLowerCase(); + fmtParts[i + 1] = next.substr(1); + } + } else if (ch.changeCase) { + gChangeCase = ch.changeCase; + } + } else if (gChangeCase == "U") { + fmtParts[i] = ch.toUpperCase(); + } else if (gChangeCase == "L") { + fmtParts[i] = ch.toLowerCase(); + } + } + return fmtParts.join(""); + }); + this.variables.__ = null; + return formatted; + }; + + this.resolveVariables = function(snippet, editor) { + var result = []; + for (var i = 0; i < snippet.length; i++) { + var ch = snippet[i]; + if (typeof ch == "string") { + result.push(ch); + } else if (typeof ch != "object") { + continue; + } else if (ch.skip) { + gotoNext(ch); + } else if (ch.processed < i) { + continue; + } else if (ch.text) { + var value = this.getVariableValue(editor, ch.text); + if (value && ch.fmtString) + value = this.tmStrFormat(value, ch); + ch.processed = i; + if (ch.expectIf == null) { + if (value) { + result.push(value); + gotoNext(ch); + } + } else { + if (value) { + ch.skip = ch.elseBranch; + } else + gotoNext(ch); + } + } else if (ch.tabstopId != null) { + result.push(ch); + } else if (ch.changeCase != null) { + result.push(ch); + } + } + function gotoNext(ch) { + var i1 = snippet.indexOf(ch, i + 1); + if (i1 != -1) + i = i1; + } + return result; + }; + + this.insertSnippetForSelection = function(editor, snippetText) { + var cursor = editor.getCursorPosition(); + var line = editor.session.getLine(cursor.row); + var tabString = editor.session.getTabString(); + var indentString = line.match(/^\s*/)[0]; + + if (cursor.column < indentString.length) + indentString = indentString.slice(0, cursor.column); + + snippetText = snippetText.replace(/\r/g, ""); + var tokens = this.tokenizeTmSnippet(snippetText); + tokens = this.resolveVariables(tokens, editor); + tokens = tokens.map(function(x) { + if (x == "\n") + return x + indentString; + if (typeof x == "string") + return x.replace(/\t/g, tabString); + return x; + }); + var tabstops = []; + tokens.forEach(function(p, i) { + if (typeof p != "object") + return; + var id = p.tabstopId; + var ts = tabstops[id]; + if (!ts) { + ts = tabstops[id] = []; + ts.index = id; + ts.value = ""; + } + if (ts.indexOf(p) !== -1) + return; + ts.push(p); + var i1 = tokens.indexOf(p, i + 1); + if (i1 === -1) + return; + + var value = tokens.slice(i + 1, i1); + var isNested = value.some(function(t) {return typeof t === "object"}); + if (isNested && !ts.value) { + ts.value = value; + } else if (value.length && (!ts.value || typeof ts.value !== "string")) { + ts.value = value.join(""); + } + }); + tabstops.forEach(function(ts) {ts.length = 0}); + var expanding = {}; + function copyValue(val) { + var copy = []; + for (var i = 0; i < val.length; i++) { + var p = val[i]; + if (typeof p == "object") { + if (expanding[p.tabstopId]) + continue; + var j = val.lastIndexOf(p, i - 1); + p = copy[j] || {tabstopId: p.tabstopId}; + } + copy[i] = p; + } + return copy; + } + for (var i = 0; i < tokens.length; i++) { + var p = tokens[i]; + if (typeof p != "object") + continue; + var id = p.tabstopId; + var i1 = tokens.indexOf(p, i + 1); + if (expanding[id]) { + if (expanding[id] === p) + expanding[id] = null; + continue; + } + + var ts = tabstops[id]; + var arg = typeof ts.value == "string" ? [ts.value] : copyValue(ts.value); + arg.unshift(i + 1, Math.max(0, i1 - i)); + arg.push(p); + expanding[id] = p; + tokens.splice.apply(tokens, arg); + + if (ts.indexOf(p) === -1) + ts.push(p); + } + var row = 0, column = 0; + var text = ""; + tokens.forEach(function(t) { + if (typeof t === "string") { + var lines = t.split("\n"); + if (lines.length > 1){ + column = lines[lines.length - 1].length; + row += lines.length - 1; + } else + column += t.length; + text += t; + } else { + if (!t.start) + t.start = {row: row, column: column}; + else + t.end = {row: row, column: column}; + } + }); + var range = editor.getSelectionRange(); + var end = editor.session.replace(range, text); + + var tabstopManager = new TabstopManager(editor); + var selectionId = editor.inVirtualSelectionMode && editor.selection.index; + tabstopManager.addTabstops(tabstops, range.start, end, selectionId); + }; + + this.insertSnippet = function(editor, snippetText) { + var self = this; + if (editor.inVirtualSelectionMode) + return self.insertSnippetForSelection(editor, snippetText); + + editor.forEachSelection(function() { + self.insertSnippetForSelection(editor, snippetText); + }, null, {keepOrder: true}); + + if (editor.tabstopManager) + editor.tabstopManager.tabNext(); + }; + + this.$getScope = function(editor) { + var scope = editor.session.$mode.$id || ""; + scope = scope.split("/").pop(); + if (scope === "html" || scope === "php") { + if (scope === "php" && !editor.session.$mode.inlinePhp) + scope = "html"; + var c = editor.getCursorPosition(); + var state = editor.session.getState(c.row); + if (typeof state === "object") { + state = state[0]; + } + if (state.substring) { + if (state.substring(0, 3) == "js-") + scope = "javascript"; + else if (state.substring(0, 4) == "css-") + scope = "css"; + else if (state.substring(0, 4) == "php-") + scope = "php"; + } + } + + return scope; + }; + + this.getActiveScopes = function(editor) { + var scope = this.$getScope(editor); + var scopes = [scope]; + var snippetMap = this.snippetMap; + if (snippetMap[scope] && snippetMap[scope].includeScopes) { + scopes.push.apply(scopes, snippetMap[scope].includeScopes); + } + scopes.push("_"); + return scopes; + }; + + this.expandWithTab = function(editor, options) { + var self = this; + var result = editor.forEachSelection(function() { + return self.expandSnippetForSelection(editor, options); + }, null, {keepOrder: true}); + if (result && editor.tabstopManager) + editor.tabstopManager.tabNext(); + return result; + }; + + this.expandSnippetForSelection = function(editor, options) { + var cursor = editor.getCursorPosition(); + var line = editor.session.getLine(cursor.row); + var before = line.substring(0, cursor.column); + var after = line.substr(cursor.column); + + var snippetMap = this.snippetMap; + var snippet; + this.getActiveScopes(editor).some(function(scope) { + var snippets = snippetMap[scope]; + if (snippets) + snippet = this.findMatchingSnippet(snippets, before, after); + return !!snippet; + }, this); + if (!snippet) + return false; + if (options && options.dryRun) + return true; + editor.session.doc.removeInLine(cursor.row, + cursor.column - snippet.replaceBefore.length, + cursor.column + snippet.replaceAfter.length + ); + + this.variables.M__ = snippet.matchBefore; + this.variables.T__ = snippet.matchAfter; + this.insertSnippetForSelection(editor, snippet.content); + + this.variables.M__ = this.variables.T__ = null; + return true; + }; + + this.findMatchingSnippet = function(snippetList, before, after) { + for (var i = snippetList.length; i--;) { + var s = snippetList[i]; + if (s.startRe && !s.startRe.test(before)) + continue; + if (s.endRe && !s.endRe.test(after)) + continue; + if (!s.startRe && !s.endRe) + continue; + + s.matchBefore = s.startRe ? s.startRe.exec(before) : [""]; + s.matchAfter = s.endRe ? s.endRe.exec(after) : [""]; + s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : ""; + s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : ""; + return s; + } + }; + + this.snippetMap = {}; + this.snippetNameMap = {}; + this.register = function(snippets, scope) { + var snippetMap = this.snippetMap; + var snippetNameMap = this.snippetNameMap; + var self = this; + + if (!snippets) + snippets = []; + + function wrapRegexp(src) { + if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src)) + src = "(?:" + src + ")"; + + return src || ""; + } + function guardedRegexp(re, guard, opening) { + re = wrapRegexp(re); + guard = wrapRegexp(guard); + if (opening) { + re = guard + re; + if (re && re[re.length - 1] != "$") + re = re + "$"; + } else { + re = re + guard; + if (re && re[0] != "^") + re = "^" + re; + } + return new RegExp(re); + } + + function addSnippet(s) { + if (!s.scope) + s.scope = scope || "_"; + scope = s.scope; + if (!snippetMap[scope]) { + snippetMap[scope] = []; + snippetNameMap[scope] = {}; + } + + var map = snippetNameMap[scope]; + if (s.name) { + var old = map[s.name]; + if (old) + self.unregister(old); + map[s.name] = s; + } + snippetMap[scope].push(s); + + if (s.tabTrigger && !s.trigger) { + if (!s.guard && /^\w/.test(s.tabTrigger)) + s.guard = "\\b"; + s.trigger = lang.escapeRegExp(s.tabTrigger); + } + + if (!s.trigger && !s.guard && !s.endTrigger && !s.endGuard) + return; + + s.startRe = guardedRegexp(s.trigger, s.guard, true); + s.triggerRe = new RegExp(s.trigger, "", true); + + s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true); + s.endTriggerRe = new RegExp(s.endTrigger, "", true); + } + + if (snippets && snippets.content) + addSnippet(snippets); + else if (Array.isArray(snippets)) + snippets.forEach(addSnippet); + + this._signal("registerSnippets", {scope: scope}); + }; + this.unregister = function(snippets, scope) { + var snippetMap = this.snippetMap; + var snippetNameMap = this.snippetNameMap; + + function removeSnippet(s) { + var nameMap = snippetNameMap[s.scope||scope]; + if (nameMap && nameMap[s.name]) { + delete nameMap[s.name]; + var map = snippetMap[s.scope||scope]; + var i = map && map.indexOf(s); + if (i >= 0) + map.splice(i, 1); + } + } + if (snippets.content) + removeSnippet(snippets); + else if (Array.isArray(snippets)) + snippets.forEach(removeSnippet); + }; + this.parseSnippetFile = function(str) { + str = str.replace(/\r/g, ""); + var list = [], snippet = {}; + var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm; + var m; + while (m = re.exec(str)) { + if (m[1]) { + try { + snippet = JSON.parse(m[1]); + list.push(snippet); + } catch (e) {} + } if (m[4]) { + snippet.content = m[4].replace(/^\t/gm, ""); + list.push(snippet); + snippet = {}; + } else { + var key = m[2], val = m[3]; + if (key == "regex") { + var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g; + snippet.guard = guardRe.exec(val)[1]; + snippet.trigger = guardRe.exec(val)[1]; + snippet.endTrigger = guardRe.exec(val)[1]; + snippet.endGuard = guardRe.exec(val)[1]; + } else if (key == "snippet") { + snippet.tabTrigger = val.match(/^\S*/)[0]; + if (!snippet.name) + snippet.name = val; + } else { + snippet[key] = val; + } + } + } + return list; + }; + this.getSnippetByName = function(name, editor) { + var snippetMap = this.snippetNameMap; + var snippet; + this.getActiveScopes(editor).some(function(scope) { + var snippets = snippetMap[scope]; + if (snippets) + snippet = snippets[name]; + return !!snippet; + }, this); + return snippet; + }; + +}).call(SnippetManager.prototype); + + +var TabstopManager = function(editor) { + if (editor.tabstopManager) + return editor.tabstopManager; + editor.tabstopManager = this; + this.$onChange = this.onChange.bind(this); + this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule; + this.$onChangeSession = this.onChangeSession.bind(this); + this.$onAfterExec = this.onAfterExec.bind(this); + this.attach(editor); +}; +(function() { + this.attach = function(editor) { + this.index = 0; + this.ranges = []; + this.tabstops = []; + this.$openTabstops = null; + this.selectedTabstop = null; + + this.editor = editor; + this.editor.on("change", this.$onChange); + this.editor.on("changeSelection", this.$onChangeSelection); + this.editor.on("changeSession", this.$onChangeSession); + this.editor.commands.on("afterExec", this.$onAfterExec); + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + }; + this.detach = function() { + this.tabstops.forEach(this.removeTabstopMarkers, this); + this.ranges = null; + this.tabstops = null; + this.selectedTabstop = null; + this.editor.removeListener("change", this.$onChange); + this.editor.removeListener("changeSelection", this.$onChangeSelection); + this.editor.removeListener("changeSession", this.$onChangeSession); + this.editor.commands.removeListener("afterExec", this.$onAfterExec); + this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); + this.editor.tabstopManager = null; + this.editor = null; + }; + + this.onChange = function(delta) { + var changeRange = delta; + var isRemove = delta.action[0] == "r"; + var start = delta.start; + var end = delta.end; + var startRow = start.row; + var endRow = end.row; + var lineDif = endRow - startRow; + var colDiff = end.column - start.column; + + if (isRemove) { + lineDif = -lineDif; + colDiff = -colDiff; + } + if (!this.$inChange && isRemove) { + var ts = this.selectedTabstop; + var changedOutside = ts && !ts.some(function(r) { + return comparePoints(r.start, start) <= 0 && comparePoints(r.end, end) >= 0; + }); + if (changedOutside) + return this.detach(); + } + var ranges = this.ranges; + for (var i = 0; i < ranges.length; i++) { + var r = ranges[i]; + if (r.end.row < start.row) + continue; + + if (isRemove && comparePoints(start, r.start) < 0 && comparePoints(end, r.end) > 0) { + this.removeRange(r); + i--; + continue; + } + + if (r.start.row == startRow && r.start.column > start.column) + r.start.column += colDiff; + if (r.end.row == startRow && r.end.column >= start.column) + r.end.column += colDiff; + if (r.start.row >= startRow) + r.start.row += lineDif; + if (r.end.row >= startRow) + r.end.row += lineDif; + + if (comparePoints(r.start, r.end) > 0) + this.removeRange(r); + } + if (!ranges.length) + this.detach(); + }; + this.updateLinkedFields = function() { + var ts = this.selectedTabstop; + if (!ts || !ts.hasLinkedRanges) + return; + this.$inChange = true; + var session = this.editor.session; + var text = session.getTextRange(ts.firstNonLinked); + for (var i = ts.length; i--;) { + var range = ts[i]; + if (!range.linked) + continue; + var fmt = exports.snippetManager.tmStrFormat(text, range.original); + session.replace(range, fmt); + } + this.$inChange = false; + }; + this.onAfterExec = function(e) { + if (e.command && !e.command.readOnly) + this.updateLinkedFields(); + }; + this.onChangeSelection = function() { + if (!this.editor) + return; + var lead = this.editor.selection.lead; + var anchor = this.editor.selection.anchor; + var isEmpty = this.editor.selection.isEmpty(); + for (var i = this.ranges.length; i--;) { + if (this.ranges[i].linked) + continue; + var containsLead = this.ranges[i].contains(lead.row, lead.column); + var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column); + if (containsLead && containsAnchor) + return; + } + this.detach(); + }; + this.onChangeSession = function() { + this.detach(); + }; + this.tabNext = function(dir) { + var max = this.tabstops.length; + var index = this.index + (dir || 1); + index = Math.min(Math.max(index, 1), max); + if (index == max) + index = 0; + this.selectTabstop(index); + if (index === 0) + this.detach(); + }; + this.selectTabstop = function(index) { + this.$openTabstops = null; + var ts = this.tabstops[this.index]; + if (ts) + this.addTabstopMarkers(ts); + this.index = index; + ts = this.tabstops[this.index]; + if (!ts || !ts.length) + return; + + this.selectedTabstop = ts; + if (!this.editor.inVirtualSelectionMode) { + var sel = this.editor.multiSelect; + sel.toSingleRange(ts.firstNonLinked.clone()); + for (var i = ts.length; i--;) { + if (ts.hasLinkedRanges && ts[i].linked) + continue; + sel.addRange(ts[i].clone(), true); + } + if (sel.ranges[0]) + sel.addRange(sel.ranges[0].clone()); + } else { + this.editor.selection.setRange(ts.firstNonLinked); + } + + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + }; + this.addTabstops = function(tabstops, start, end) { + if (!this.$openTabstops) + this.$openTabstops = []; + if (!tabstops[0]) { + var p = Range.fromPoints(end, end); + moveRelative(p.start, start); + moveRelative(p.end, start); + tabstops[0] = [p]; + tabstops[0].index = 0; + } + + var i = this.index; + var arg = [i + 1, 0]; + var ranges = this.ranges; + tabstops.forEach(function(ts, index) { + var dest = this.$openTabstops[index] || ts; + + for (var i = ts.length; i--;) { + var p = ts[i]; + var range = Range.fromPoints(p.start, p.end || p.start); + movePoint(range.start, start); + movePoint(range.end, start); + range.original = p; + range.tabstop = dest; + ranges.push(range); + if (dest != ts) + dest.unshift(range); + else + dest[i] = range; + if (p.fmtString) { + range.linked = true; + dest.hasLinkedRanges = true; + } else if (!dest.firstNonLinked) + dest.firstNonLinked = range; + } + if (!dest.firstNonLinked) + dest.hasLinkedRanges = false; + if (dest === ts) { + arg.push(dest); + this.$openTabstops[index] = dest; + } + this.addTabstopMarkers(dest); + }, this); + + if (arg.length > 2) { + if (this.tabstops.length) + arg.push(arg.splice(2, 1)[0]); + this.tabstops.splice.apply(this.tabstops, arg); + } + }; + + this.addTabstopMarkers = function(ts) { + var session = this.editor.session; + ts.forEach(function(range) { + if (!range.markerId) + range.markerId = session.addMarker(range, "ace_snippet-marker", "text"); + }); + }; + this.removeTabstopMarkers = function(ts) { + var session = this.editor.session; + ts.forEach(function(range) { + session.removeMarker(range.markerId); + range.markerId = null; + }); + }; + this.removeRange = function(range) { + var i = range.tabstop.indexOf(range); + range.tabstop.splice(i, 1); + i = this.ranges.indexOf(range); + this.ranges.splice(i, 1); + this.editor.session.removeMarker(range.markerId); + if (!range.tabstop.length) { + i = this.tabstops.indexOf(range.tabstop); + if (i != -1) + this.tabstops.splice(i, 1); + if (!this.tabstops.length) + this.detach(); + } + }; + + this.keyboardHandler = new HashHandler(); + this.keyboardHandler.bindKeys({ + "Tab": function(ed) { + if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) { + return; + } + + ed.tabstopManager.tabNext(1); + }, + "Shift-Tab": function(ed) { + ed.tabstopManager.tabNext(-1); + }, + "Esc": function(ed) { + ed.tabstopManager.detach(); + }, + "Return": function(ed) { + return false; + } + }); +}).call(TabstopManager.prototype); + + + +var changeTracker = {}; +changeTracker.onChange = Anchor.prototype.onChange; +changeTracker.setPosition = function(row, column) { + this.pos.row = row; + this.pos.column = column; +}; +changeTracker.update = function(pos, delta, $insertRight) { + this.$insertRight = $insertRight; + this.pos = pos; + this.onChange(delta); +}; + +var movePoint = function(point, diff) { + if (point.row == 0) + point.column += diff.column; + point.row += diff.row; +}; + +var moveRelative = function(point, start) { + if (point.row == start.row) + point.column -= start.column; + point.row -= start.row; +}; + + +require("./lib/dom").importCssString("\ +.ace_snippet-marker {\ + -moz-box-sizing: border-box;\ + box-sizing: border-box;\ + background: rgba(194, 193, 208, 0.09);\ + border: 1px dotted rgba(211, 208, 235, 0.62);\ + position: absolute;\ +}"); + +exports.snippetManager = new SnippetManager(); + + +var Editor = require("./editor").Editor; +(function() { + this.insertSnippet = function(content, options) { + return exports.snippetManager.insertSnippet(this, content, options); + }; + this.expandSnippet = function(options) { + return exports.snippetManager.expandWithTab(this, options); + }; +}).call(Editor.prototype); + +}); + +ace.define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","tabStops","resources","utils","actions","ace/config","ace/config"], function(require, exports, module) { +"use strict"; +var HashHandler = require("ace/keyboard/hash_handler").HashHandler; +var Editor = require("ace/editor").Editor; +var snippetManager = require("ace/snippets").snippetManager; +var Range = require("ace/range").Range; +var emmet, emmetPath; +function AceEmmetEditor() {} + +AceEmmetEditor.prototype = { + setupContext: function(editor) { + this.ace = editor; + this.indentation = editor.session.getTabString(); + if (!emmet) + emmet = window.emmet; + var resources = emmet.resources || emmet.require("resources"); + resources.setVariable("indentation", this.indentation); + this.$syntax = null; + this.$syntax = this.getSyntax(); + }, + getSelectionRange: function() { + var range = this.ace.getSelectionRange(); + var doc = this.ace.session.doc; + return { + start: doc.positionToIndex(range.start), + end: doc.positionToIndex(range.end) + }; + }, + createSelection: function(start, end) { + var doc = this.ace.session.doc; + this.ace.selection.setRange({ + start: doc.indexToPosition(start), + end: doc.indexToPosition(end) + }); + }, + getCurrentLineRange: function() { + var ace = this.ace; + var row = ace.getCursorPosition().row; + var lineLength = ace.session.getLine(row).length; + var index = ace.session.doc.positionToIndex({row: row, column: 0}); + return { + start: index, + end: index + lineLength + }; + }, + getCaretPos: function(){ + var pos = this.ace.getCursorPosition(); + return this.ace.session.doc.positionToIndex(pos); + }, + setCaretPos: function(index){ + var pos = this.ace.session.doc.indexToPosition(index); + this.ace.selection.moveToPosition(pos); + }, + getCurrentLine: function() { + var row = this.ace.getCursorPosition().row; + return this.ace.session.getLine(row); + }, + replaceContent: function(value, start, end, noIndent) { + if (end == null) + end = start == null ? this.getContent().length : start; + if (start == null) + start = 0; + + var editor = this.ace; + var doc = editor.session.doc; + var range = Range.fromPoints(doc.indexToPosition(start), doc.indexToPosition(end)); + editor.session.remove(range); + + range.end = range.start; + + value = this.$updateTabstops(value); + snippetManager.insertSnippet(editor, value); + }, + getContent: function(){ + return this.ace.getValue(); + }, + getSyntax: function() { + if (this.$syntax) + return this.$syntax; + var syntax = this.ace.session.$modeId.split("/").pop(); + if (syntax == "html" || syntax == "php") { + var cursor = this.ace.getCursorPosition(); + var state = this.ace.session.getState(cursor.row); + if (typeof state != "string") + state = state[0]; + if (state) { + state = state.split("-"); + if (state.length > 1) + syntax = state[0]; + else if (syntax == "php") + syntax = "html"; + } + } + return syntax; + }, + getProfileName: function() { + var resources = emmet.resources || emmet.require("resources"); + switch (this.getSyntax()) { + case "css": return "css"; + case "xml": + case "xsl": + return "xml"; + case "html": + var profile = resources.getVariable("profile"); + if (!profile) + profile = this.ace.session.getLines(0,2).join("").search(/]+XHTML/i) != -1 ? "xhtml": "html"; + return profile; + default: + var mode = this.ace.session.$mode; + return mode.emmetConfig && mode.emmetConfig.profile || "xhtml"; + } + }, + prompt: function(title) { + return prompt(title); + }, + getSelection: function() { + return this.ace.session.getTextRange(); + }, + getFilePath: function() { + return ""; + }, + $updateTabstops: function(value) { + var base = 1000; + var zeroBase = 0; + var lastZero = null; + var ts = emmet.tabStops || emmet.require('tabStops'); + var resources = emmet.resources || emmet.require("resources"); + var settings = resources.getVocabulary("user"); + var tabstopOptions = { + tabstop: function(data) { + var group = parseInt(data.group, 10); + var isZero = group === 0; + if (isZero) + group = ++zeroBase; + else + group += base; + + var placeholder = data.placeholder; + if (placeholder) { + placeholder = ts.processText(placeholder, tabstopOptions); + } + + var result = '${' + group + (placeholder ? ':' + placeholder : '') + '}'; + + if (isZero) { + lastZero = [data.start, result]; + } + + return result; + }, + escape: function(ch) { + if (ch == '$') return '\\$'; + if (ch == '\\') return '\\\\'; + return ch; + } + }; + + value = ts.processText(value, tabstopOptions); + + if (settings.variables['insert_final_tabstop'] && !/\$\{0\}$/.test(value)) { + value += '${0}'; + } else if (lastZero) { + var common = emmet.utils ? emmet.utils.common : emmet.require('utils'); + value = common.replaceSubstring(value, '${0}', lastZero[0], lastZero[1]); + } + + return value; + } +}; + + +var keymap = { + expand_abbreviation: {"mac": "ctrl+alt+e", "win": "alt+e"}, + match_pair_outward: {"mac": "ctrl+d", "win": "ctrl+,"}, + match_pair_inward: {"mac": "ctrl+j", "win": "ctrl+shift+0"}, + matching_pair: {"mac": "ctrl+alt+j", "win": "alt+j"}, + next_edit_point: "alt+right", + prev_edit_point: "alt+left", + toggle_comment: {"mac": "command+/", "win": "ctrl+/"}, + split_join_tag: {"mac": "shift+command+'", "win": "shift+ctrl+`"}, + remove_tag: {"mac": "command+'", "win": "shift+ctrl+;"}, + evaluate_math_expression: {"mac": "shift+command+y", "win": "shift+ctrl+y"}, + increment_number_by_1: "ctrl+up", + decrement_number_by_1: "ctrl+down", + increment_number_by_01: "alt+up", + decrement_number_by_01: "alt+down", + increment_number_by_10: {"mac": "alt+command+up", "win": "shift+alt+up"}, + decrement_number_by_10: {"mac": "alt+command+down", "win": "shift+alt+down"}, + select_next_item: {"mac": "shift+command+.", "win": "shift+ctrl+."}, + select_previous_item: {"mac": "shift+command+,", "win": "shift+ctrl+,"}, + reflect_css_value: {"mac": "shift+command+r", "win": "shift+ctrl+r"}, + + encode_decode_data_url: {"mac": "shift+ctrl+d", "win": "ctrl+'"}, + expand_abbreviation_with_tab: "Tab", + wrap_with_abbreviation: {"mac": "shift+ctrl+a", "win": "shift+ctrl+a"} +}; + +var editorProxy = new AceEmmetEditor(); +exports.commands = new HashHandler(); +exports.runEmmetCommand = function runEmmetCommand(editor) { + try { + editorProxy.setupContext(editor); + var actions = emmet.actions || emmet.require("actions"); + + if (this.action == "expand_abbreviation_with_tab") { + if (!editor.selection.isEmpty()) + return false; + var pos = editor.selection.lead; + var token = editor.session.getTokenAt(pos.row, pos.column); + if (token && /\btag\b/.test(token.type)) + return false; + } + + if (this.action == "wrap_with_abbreviation") { + return setTimeout(function() { + actions.run("wrap_with_abbreviation", editorProxy); + }, 0); + } + + var result = actions.run(this.action, editorProxy); + } catch(e) { + if (!emmet) { + load(runEmmetCommand.bind(this, editor)); + return true; + } + editor._signal("changeStatus", typeof e == "string" ? e : e.message); + console.log(e); + result = false; + } + return result; +}; + +for (var command in keymap) { + exports.commands.addCommand({ + name: "emmet:" + command, + action: command, + bindKey: keymap[command], + exec: exports.runEmmetCommand, + multiSelectAction: "forEach" + }); +} + +exports.updateCommands = function(editor, enabled) { + if (enabled) { + editor.keyBinding.addKeyboardHandler(exports.commands); + } else { + editor.keyBinding.removeKeyboardHandler(exports.commands); + } +}; + +exports.isSupportedMode = function(mode) { + if (!mode) return false; + if (mode.emmetConfig) return true; + var id = mode.$id || mode; + return /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(id); +}; + +exports.isAvailable = function(editor, command) { + if (/(evaluate_math_expression|expand_abbreviation)$/.test(command)) + return true; + var mode = editor.session.$mode; + var isSupported = exports.isSupportedMode(mode); + if (isSupported && mode.$modes) { + try { + editorProxy.setupContext(editor); + if (/js|php/.test(editorProxy.getSyntax())) + isSupported = false; + } catch(e) {} + } + return isSupported; +} + +var onChangeMode = function(e, target) { + var editor = target; + if (!editor) + return; + var enabled = exports.isSupportedMode(editor.session.$mode); + if (e.enableEmmet === false) + enabled = false; + if (enabled) + load(); + exports.updateCommands(editor, enabled); +}; + +var load = function(cb) { + if (typeof emmetPath == "string") { + require("ace/config").loadModule(emmetPath, function() { + emmetPath = null; + cb && cb(); + }); + } +}; + +exports.AceEmmetEditor = AceEmmetEditor; +require("ace/config").defineOptions(Editor.prototype, "editor", { + enableEmmet: { + set: function(val) { + this[val ? "on" : "removeListener"]("changeMode", onChangeMode); + onChangeMode({enableEmmet: !!val}, this); + }, + value: true + } +}); + +exports.setCore = function(e) { + if (typeof e == "string") + emmetPath = e; + else + emmet = e; +}; +}); + (function() { + ace.require(["ace/ext/emmet"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-error_marker.js b/htdocs/includes/ace/ext-error_marker.js new file mode 100644 index 00000000000..d4c9eb9131b --- /dev/null +++ b/htdocs/includes/ace/ext-error_marker.js @@ -0,0 +1,6 @@ + +; + (function() { + ace.require(["ace/ext/error_marker"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-keybinding_menu.js b/htdocs/includes/ace/ext-keybinding_menu.js new file mode 100644 index 00000000000..ede7d8dbe4e --- /dev/null +++ b/htdocs/includes/ace/ext-keybinding_menu.js @@ -0,0 +1,170 @@ +ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +'use strict'; +var dom = require("../../lib/dom"); +var cssText = "#ace_settingsmenu, #kbshortcutmenu {\ +background-color: #F7F7F7;\ +color: black;\ +box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\ +padding: 1em 0.5em 2em 1em;\ +overflow: auto;\ +position: absolute;\ +margin: 0;\ +bottom: 0;\ +right: 0;\ +top: 0;\ +z-index: 9991;\ +cursor: default;\ +}\ +.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\ +box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\ +background-color: rgba(255, 255, 255, 0.6);\ +color: black;\ +}\ +.ace_optionsMenuEntry:hover {\ +background-color: rgba(100, 100, 100, 0.1);\ +-webkit-transition: all 0.5s;\ +transition: all 0.3s\ +}\ +.ace_closeButton {\ +background: rgba(245, 146, 146, 0.5);\ +border: 1px solid #F48A8A;\ +border-radius: 50%;\ +padding: 7px;\ +position: absolute;\ +right: -8px;\ +top: -8px;\ +z-index: 1000;\ +}\ +.ace_closeButton{\ +background: rgba(245, 146, 146, 0.9);\ +}\ +.ace_optionsMenuKey {\ +color: darkslateblue;\ +font-weight: bold;\ +}\ +.ace_optionsMenuCommand {\ +color: darkcyan;\ +font-weight: normal;\ +}"; +dom.importCssString(cssText); +module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) { + top = top ? 'top: ' + top + ';' : ''; + bottom = bottom ? 'bottom: ' + bottom + ';' : ''; + right = right ? 'right: ' + right + ';' : ''; + left = left ? 'left: ' + left + ';' : ''; + + var closer = document.createElement('div'); + var contentContainer = document.createElement('div'); + + function documentEscListener(e) { + if (e.keyCode === 27) { + closer.click(); + } + } + + closer.style.cssText = 'margin: 0; padding: 0; ' + + 'position: fixed; top:0; bottom:0; left:0; right:0;' + + 'z-index: 9990; ' + + 'background-color: rgba(0, 0, 0, 0.3);'; + closer.addEventListener('click', function() { + document.removeEventListener('keydown', documentEscListener); + closer.parentNode.removeChild(closer); + editor.focus(); + closer = null; + }); + document.addEventListener('keydown', documentEscListener); + + contentContainer.style.cssText = top + right + bottom + left; + contentContainer.addEventListener('click', function(e) { + e.stopPropagation(); + }); + + var wrapper = dom.createElement("div"); + wrapper.style.position = "relative"; + + var closeButton = dom.createElement("div"); + closeButton.className = "ace_closeButton"; + closeButton.addEventListener('click', function() { + closer.click(); + }); + + wrapper.appendChild(closeButton); + contentContainer.appendChild(wrapper); + + contentContainer.appendChild(contentElement); + closer.appendChild(contentContainer); + document.body.appendChild(closer); + editor.blur(); +}; + +}); + +ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"], function(require, exports, module) { +"use strict"; +var keys = require("../../lib/keys"); +module.exports.getEditorKeybordShortcuts = function(editor) { + var KEY_MODS = keys.KEY_MODS; + var keybindings = []; + var commandMap = {}; + editor.keyBinding.$handlers.forEach(function(handler) { + var ckb = handler.commandKeyBinding; + for (var i in ckb) { + var key = i.replace(/(^|-)\w/g, function(x) { return x.toUpperCase(); }); + var commands = ckb[i]; + if (!Array.isArray(commands)) + commands = [commands]; + commands.forEach(function(command) { + if (typeof command != "string") + command = command.name + if (commandMap[command]) { + commandMap[command].key += "|" + key; + } else { + commandMap[command] = {key: key, command: command}; + keybindings.push(commandMap[command]); + } + }); + } + }); + return keybindings; +}; + +}); + +ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"], function(require, exports, module) { + "use strict"; + var Editor = require("ace/editor").Editor; + function showKeyboardShortcuts (editor) { + if(!document.getElementById('kbshortcutmenu')) { + var overlayPage = require('./menu_tools/overlay_page').overlayPage; + var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts; + var kb = getEditorKeybordShortcuts(editor); + var el = document.createElement('div'); + var commands = kb.reduce(function(previous, current) { + return previous + '
        ' + + current.command + ' : ' + + '' + current.key + '
        '; + }, ''); + + el.id = 'kbshortcutmenu'; + el.innerHTML = '

        Keyboard Shortcuts

        ' + commands + '
        '; + overlayPage(editor, el, '0', '0', '0', null); + } + } + module.exports.init = function(editor) { + Editor.prototype.showKeyboardShortcuts = function() { + showKeyboardShortcuts(this); + }; + editor.commands.addCommands([{ + name: "showKeyboardShortcuts", + bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"}, + exec: function(editor, line) { + editor.showKeyboardShortcuts(); + } + }]); + }; + +}); + (function() { + ace.require(["ace/ext/keybinding_menu"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-language_tools.js b/htdocs/includes/ace/ext-language_tools.js new file mode 100644 index 00000000000..133669510d9 --- /dev/null +++ b/htdocs/includes/ace/ext-language_tools.js @@ -0,0 +1,1956 @@ +ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"], function(require, exports, module) { +"use strict"; +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var lang = require("./lib/lang"); +var Range = require("./range").Range; +var Anchor = require("./anchor").Anchor; +var HashHandler = require("./keyboard/hash_handler").HashHandler; +var Tokenizer = require("./tokenizer").Tokenizer; +var comparePoints = Range.comparePoints; + +var SnippetManager = function() { + this.snippetMap = {}; + this.snippetNameMap = {}; +}; + +(function() { + oop.implement(this, EventEmitter); + + this.getTokenizer = function() { + function TabstopToken(str, _, stack) { + str = str.substr(1); + if (/^\d+$/.test(str) && !stack.inFormatString) + return [{tabstopId: parseInt(str, 10)}]; + return [{text: str}]; + } + function escape(ch) { + return "(?:[^\\\\" + ch + "]|\\\\.)"; + } + SnippetManager.$tokenizer = new Tokenizer({ + start: [ + {regex: /:/, onMatch: function(val, state, stack) { + if (stack.length && stack[0].expectIf) { + stack[0].expectIf = false; + stack[0].elseBranch = stack[0]; + return [stack[0]]; + } + return ":"; + }}, + {regex: /\\./, onMatch: function(val, state, stack) { + var ch = val[1]; + if (ch == "}" && stack.length) { + val = ch; + }else if ("`$\\".indexOf(ch) != -1) { + val = ch; + } else if (stack.inFormatString) { + if (ch == "n") + val = "\n"; + else if (ch == "t") + val = "\n"; + else if ("ulULE".indexOf(ch) != -1) { + val = {changeCase: ch, local: ch > "a"}; + } + } + + return [val]; + }}, + {regex: /}/, onMatch: function(val, state, stack) { + return [stack.length ? stack.shift() : val]; + }}, + {regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken}, + {regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) { + var t = TabstopToken(str.substr(1), state, stack); + stack.unshift(t[0]); + return t; + }, next: "snippetVar"}, + {regex: /\n/, token: "newline", merge: false} + ], + snippetVar: [ + {regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) { + stack[0].choices = val.slice(1, -1).split(","); + }, next: "start"}, + {regex: "/(" + escape("/") + "+)/(?:(" + escape("/") + "*)/)(\\w*):?", + onMatch: function(val, state, stack) { + var ts = stack[0]; + ts.fmtString = val; + + val = this.splitRegex.exec(val); + ts.guard = val[1]; + ts.fmt = val[2]; + ts.flag = val[3]; + return ""; + }, next: "start"}, + {regex: "`" + escape("`") + "*`", onMatch: function(val, state, stack) { + stack[0].code = val.splice(1, -1); + return ""; + }, next: "start"}, + {regex: "\\?", onMatch: function(val, state, stack) { + if (stack[0]) + stack[0].expectIf = true; + }, next: "start"}, + {regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"} + ], + formatString: [ + {regex: "/(" + escape("/") + "+)/", token: "regex"}, + {regex: "", onMatch: function(val, state, stack) { + stack.inFormatString = true; + }, next: "start"} + ] + }); + SnippetManager.prototype.getTokenizer = function() { + return SnippetManager.$tokenizer; + }; + return SnippetManager.$tokenizer; + }; + + this.tokenizeTmSnippet = function(str, startState) { + return this.getTokenizer().getLineTokens(str, startState).tokens.map(function(x) { + return x.value || x; + }); + }; + + this.$getDefaultValue = function(editor, name) { + if (/^[A-Z]\d+$/.test(name)) { + var i = name.substr(1); + return (this.variables[name[0] + "__"] || {})[i]; + } + if (/^\d+$/.test(name)) { + return (this.variables.__ || {})[name]; + } + name = name.replace(/^TM_/, ""); + + if (!editor) + return; + var s = editor.session; + switch(name) { + case "CURRENT_WORD": + var r = s.getWordRange(); + case "SELECTION": + case "SELECTED_TEXT": + return s.getTextRange(r); + case "CURRENT_LINE": + return s.getLine(editor.getCursorPosition().row); + case "PREV_LINE": // not possible in textmate + return s.getLine(editor.getCursorPosition().row - 1); + case "LINE_INDEX": + return editor.getCursorPosition().column; + case "LINE_NUMBER": + return editor.getCursorPosition().row + 1; + case "SOFT_TABS": + return s.getUseSoftTabs() ? "YES" : "NO"; + case "TAB_SIZE": + return s.getTabSize(); + case "FILENAME": + case "FILEPATH": + return ""; + case "FULLNAME": + return "Ace"; + } + }; + this.variables = {}; + this.getVariableValue = function(editor, varName) { + if (this.variables.hasOwnProperty(varName)) + return this.variables[varName](editor, varName) || ""; + return this.$getDefaultValue(editor, varName) || ""; + }; + this.tmStrFormat = function(str, ch, editor) { + var flag = ch.flag || ""; + var re = ch.guard; + re = new RegExp(re, flag.replace(/[^gi]/, "")); + var fmtTokens = this.tokenizeTmSnippet(ch.fmt, "formatString"); + var _self = this; + var formatted = str.replace(re, function() { + _self.variables.__ = arguments; + var fmtParts = _self.resolveVariables(fmtTokens, editor); + var gChangeCase = "E"; + for (var i = 0; i < fmtParts.length; i++) { + var ch = fmtParts[i]; + if (typeof ch == "object") { + fmtParts[i] = ""; + if (ch.changeCase && ch.local) { + var next = fmtParts[i + 1]; + if (next && typeof next == "string") { + if (ch.changeCase == "u") + fmtParts[i] = next[0].toUpperCase(); + else + fmtParts[i] = next[0].toLowerCase(); + fmtParts[i + 1] = next.substr(1); + } + } else if (ch.changeCase) { + gChangeCase = ch.changeCase; + } + } else if (gChangeCase == "U") { + fmtParts[i] = ch.toUpperCase(); + } else if (gChangeCase == "L") { + fmtParts[i] = ch.toLowerCase(); + } + } + return fmtParts.join(""); + }); + this.variables.__ = null; + return formatted; + }; + + this.resolveVariables = function(snippet, editor) { + var result = []; + for (var i = 0; i < snippet.length; i++) { + var ch = snippet[i]; + if (typeof ch == "string") { + result.push(ch); + } else if (typeof ch != "object") { + continue; + } else if (ch.skip) { + gotoNext(ch); + } else if (ch.processed < i) { + continue; + } else if (ch.text) { + var value = this.getVariableValue(editor, ch.text); + if (value && ch.fmtString) + value = this.tmStrFormat(value, ch); + ch.processed = i; + if (ch.expectIf == null) { + if (value) { + result.push(value); + gotoNext(ch); + } + } else { + if (value) { + ch.skip = ch.elseBranch; + } else + gotoNext(ch); + } + } else if (ch.tabstopId != null) { + result.push(ch); + } else if (ch.changeCase != null) { + result.push(ch); + } + } + function gotoNext(ch) { + var i1 = snippet.indexOf(ch, i + 1); + if (i1 != -1) + i = i1; + } + return result; + }; + + this.insertSnippetForSelection = function(editor, snippetText) { + var cursor = editor.getCursorPosition(); + var line = editor.session.getLine(cursor.row); + var tabString = editor.session.getTabString(); + var indentString = line.match(/^\s*/)[0]; + + if (cursor.column < indentString.length) + indentString = indentString.slice(0, cursor.column); + + snippetText = snippetText.replace(/\r/g, ""); + var tokens = this.tokenizeTmSnippet(snippetText); + tokens = this.resolveVariables(tokens, editor); + tokens = tokens.map(function(x) { + if (x == "\n") + return x + indentString; + if (typeof x == "string") + return x.replace(/\t/g, tabString); + return x; + }); + var tabstops = []; + tokens.forEach(function(p, i) { + if (typeof p != "object") + return; + var id = p.tabstopId; + var ts = tabstops[id]; + if (!ts) { + ts = tabstops[id] = []; + ts.index = id; + ts.value = ""; + } + if (ts.indexOf(p) !== -1) + return; + ts.push(p); + var i1 = tokens.indexOf(p, i + 1); + if (i1 === -1) + return; + + var value = tokens.slice(i + 1, i1); + var isNested = value.some(function(t) {return typeof t === "object"}); + if (isNested && !ts.value) { + ts.value = value; + } else if (value.length && (!ts.value || typeof ts.value !== "string")) { + ts.value = value.join(""); + } + }); + tabstops.forEach(function(ts) {ts.length = 0}); + var expanding = {}; + function copyValue(val) { + var copy = []; + for (var i = 0; i < val.length; i++) { + var p = val[i]; + if (typeof p == "object") { + if (expanding[p.tabstopId]) + continue; + var j = val.lastIndexOf(p, i - 1); + p = copy[j] || {tabstopId: p.tabstopId}; + } + copy[i] = p; + } + return copy; + } + for (var i = 0; i < tokens.length; i++) { + var p = tokens[i]; + if (typeof p != "object") + continue; + var id = p.tabstopId; + var i1 = tokens.indexOf(p, i + 1); + if (expanding[id]) { + if (expanding[id] === p) + expanding[id] = null; + continue; + } + + var ts = tabstops[id]; + var arg = typeof ts.value == "string" ? [ts.value] : copyValue(ts.value); + arg.unshift(i + 1, Math.max(0, i1 - i)); + arg.push(p); + expanding[id] = p; + tokens.splice.apply(tokens, arg); + + if (ts.indexOf(p) === -1) + ts.push(p); + } + var row = 0, column = 0; + var text = ""; + tokens.forEach(function(t) { + if (typeof t === "string") { + var lines = t.split("\n"); + if (lines.length > 1){ + column = lines[lines.length - 1].length; + row += lines.length - 1; + } else + column += t.length; + text += t; + } else { + if (!t.start) + t.start = {row: row, column: column}; + else + t.end = {row: row, column: column}; + } + }); + var range = editor.getSelectionRange(); + var end = editor.session.replace(range, text); + + var tabstopManager = new TabstopManager(editor); + var selectionId = editor.inVirtualSelectionMode && editor.selection.index; + tabstopManager.addTabstops(tabstops, range.start, end, selectionId); + }; + + this.insertSnippet = function(editor, snippetText) { + var self = this; + if (editor.inVirtualSelectionMode) + return self.insertSnippetForSelection(editor, snippetText); + + editor.forEachSelection(function() { + self.insertSnippetForSelection(editor, snippetText); + }, null, {keepOrder: true}); + + if (editor.tabstopManager) + editor.tabstopManager.tabNext(); + }; + + this.$getScope = function(editor) { + var scope = editor.session.$mode.$id || ""; + scope = scope.split("/").pop(); + if (scope === "html" || scope === "php") { + if (scope === "php" && !editor.session.$mode.inlinePhp) + scope = "html"; + var c = editor.getCursorPosition(); + var state = editor.session.getState(c.row); + if (typeof state === "object") { + state = state[0]; + } + if (state.substring) { + if (state.substring(0, 3) == "js-") + scope = "javascript"; + else if (state.substring(0, 4) == "css-") + scope = "css"; + else if (state.substring(0, 4) == "php-") + scope = "php"; + } + } + + return scope; + }; + + this.getActiveScopes = function(editor) { + var scope = this.$getScope(editor); + var scopes = [scope]; + var snippetMap = this.snippetMap; + if (snippetMap[scope] && snippetMap[scope].includeScopes) { + scopes.push.apply(scopes, snippetMap[scope].includeScopes); + } + scopes.push("_"); + return scopes; + }; + + this.expandWithTab = function(editor, options) { + var self = this; + var result = editor.forEachSelection(function() { + return self.expandSnippetForSelection(editor, options); + }, null, {keepOrder: true}); + if (result && editor.tabstopManager) + editor.tabstopManager.tabNext(); + return result; + }; + + this.expandSnippetForSelection = function(editor, options) { + var cursor = editor.getCursorPosition(); + var line = editor.session.getLine(cursor.row); + var before = line.substring(0, cursor.column); + var after = line.substr(cursor.column); + + var snippetMap = this.snippetMap; + var snippet; + this.getActiveScopes(editor).some(function(scope) { + var snippets = snippetMap[scope]; + if (snippets) + snippet = this.findMatchingSnippet(snippets, before, after); + return !!snippet; + }, this); + if (!snippet) + return false; + if (options && options.dryRun) + return true; + editor.session.doc.removeInLine(cursor.row, + cursor.column - snippet.replaceBefore.length, + cursor.column + snippet.replaceAfter.length + ); + + this.variables.M__ = snippet.matchBefore; + this.variables.T__ = snippet.matchAfter; + this.insertSnippetForSelection(editor, snippet.content); + + this.variables.M__ = this.variables.T__ = null; + return true; + }; + + this.findMatchingSnippet = function(snippetList, before, after) { + for (var i = snippetList.length; i--;) { + var s = snippetList[i]; + if (s.startRe && !s.startRe.test(before)) + continue; + if (s.endRe && !s.endRe.test(after)) + continue; + if (!s.startRe && !s.endRe) + continue; + + s.matchBefore = s.startRe ? s.startRe.exec(before) : [""]; + s.matchAfter = s.endRe ? s.endRe.exec(after) : [""]; + s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : ""; + s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : ""; + return s; + } + }; + + this.snippetMap = {}; + this.snippetNameMap = {}; + this.register = function(snippets, scope) { + var snippetMap = this.snippetMap; + var snippetNameMap = this.snippetNameMap; + var self = this; + + if (!snippets) + snippets = []; + + function wrapRegexp(src) { + if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src)) + src = "(?:" + src + ")"; + + return src || ""; + } + function guardedRegexp(re, guard, opening) { + re = wrapRegexp(re); + guard = wrapRegexp(guard); + if (opening) { + re = guard + re; + if (re && re[re.length - 1] != "$") + re = re + "$"; + } else { + re = re + guard; + if (re && re[0] != "^") + re = "^" + re; + } + return new RegExp(re); + } + + function addSnippet(s) { + if (!s.scope) + s.scope = scope || "_"; + scope = s.scope; + if (!snippetMap[scope]) { + snippetMap[scope] = []; + snippetNameMap[scope] = {}; + } + + var map = snippetNameMap[scope]; + if (s.name) { + var old = map[s.name]; + if (old) + self.unregister(old); + map[s.name] = s; + } + snippetMap[scope].push(s); + + if (s.tabTrigger && !s.trigger) { + if (!s.guard && /^\w/.test(s.tabTrigger)) + s.guard = "\\b"; + s.trigger = lang.escapeRegExp(s.tabTrigger); + } + + if (!s.trigger && !s.guard && !s.endTrigger && !s.endGuard) + return; + + s.startRe = guardedRegexp(s.trigger, s.guard, true); + s.triggerRe = new RegExp(s.trigger, "", true); + + s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true); + s.endTriggerRe = new RegExp(s.endTrigger, "", true); + } + + if (snippets && snippets.content) + addSnippet(snippets); + else if (Array.isArray(snippets)) + snippets.forEach(addSnippet); + + this._signal("registerSnippets", {scope: scope}); + }; + this.unregister = function(snippets, scope) { + var snippetMap = this.snippetMap; + var snippetNameMap = this.snippetNameMap; + + function removeSnippet(s) { + var nameMap = snippetNameMap[s.scope||scope]; + if (nameMap && nameMap[s.name]) { + delete nameMap[s.name]; + var map = snippetMap[s.scope||scope]; + var i = map && map.indexOf(s); + if (i >= 0) + map.splice(i, 1); + } + } + if (snippets.content) + removeSnippet(snippets); + else if (Array.isArray(snippets)) + snippets.forEach(removeSnippet); + }; + this.parseSnippetFile = function(str) { + str = str.replace(/\r/g, ""); + var list = [], snippet = {}; + var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm; + var m; + while (m = re.exec(str)) { + if (m[1]) { + try { + snippet = JSON.parse(m[1]); + list.push(snippet); + } catch (e) {} + } if (m[4]) { + snippet.content = m[4].replace(/^\t/gm, ""); + list.push(snippet); + snippet = {}; + } else { + var key = m[2], val = m[3]; + if (key == "regex") { + var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g; + snippet.guard = guardRe.exec(val)[1]; + snippet.trigger = guardRe.exec(val)[1]; + snippet.endTrigger = guardRe.exec(val)[1]; + snippet.endGuard = guardRe.exec(val)[1]; + } else if (key == "snippet") { + snippet.tabTrigger = val.match(/^\S*/)[0]; + if (!snippet.name) + snippet.name = val; + } else { + snippet[key] = val; + } + } + } + return list; + }; + this.getSnippetByName = function(name, editor) { + var snippetMap = this.snippetNameMap; + var snippet; + this.getActiveScopes(editor).some(function(scope) { + var snippets = snippetMap[scope]; + if (snippets) + snippet = snippets[name]; + return !!snippet; + }, this); + return snippet; + }; + +}).call(SnippetManager.prototype); + + +var TabstopManager = function(editor) { + if (editor.tabstopManager) + return editor.tabstopManager; + editor.tabstopManager = this; + this.$onChange = this.onChange.bind(this); + this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule; + this.$onChangeSession = this.onChangeSession.bind(this); + this.$onAfterExec = this.onAfterExec.bind(this); + this.attach(editor); +}; +(function() { + this.attach = function(editor) { + this.index = 0; + this.ranges = []; + this.tabstops = []; + this.$openTabstops = null; + this.selectedTabstop = null; + + this.editor = editor; + this.editor.on("change", this.$onChange); + this.editor.on("changeSelection", this.$onChangeSelection); + this.editor.on("changeSession", this.$onChangeSession); + this.editor.commands.on("afterExec", this.$onAfterExec); + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + }; + this.detach = function() { + this.tabstops.forEach(this.removeTabstopMarkers, this); + this.ranges = null; + this.tabstops = null; + this.selectedTabstop = null; + this.editor.removeListener("change", this.$onChange); + this.editor.removeListener("changeSelection", this.$onChangeSelection); + this.editor.removeListener("changeSession", this.$onChangeSession); + this.editor.commands.removeListener("afterExec", this.$onAfterExec); + this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); + this.editor.tabstopManager = null; + this.editor = null; + }; + + this.onChange = function(delta) { + var changeRange = delta; + var isRemove = delta.action[0] == "r"; + var start = delta.start; + var end = delta.end; + var startRow = start.row; + var endRow = end.row; + var lineDif = endRow - startRow; + var colDiff = end.column - start.column; + + if (isRemove) { + lineDif = -lineDif; + colDiff = -colDiff; + } + if (!this.$inChange && isRemove) { + var ts = this.selectedTabstop; + var changedOutside = ts && !ts.some(function(r) { + return comparePoints(r.start, start) <= 0 && comparePoints(r.end, end) >= 0; + }); + if (changedOutside) + return this.detach(); + } + var ranges = this.ranges; + for (var i = 0; i < ranges.length; i++) { + var r = ranges[i]; + if (r.end.row < start.row) + continue; + + if (isRemove && comparePoints(start, r.start) < 0 && comparePoints(end, r.end) > 0) { + this.removeRange(r); + i--; + continue; + } + + if (r.start.row == startRow && r.start.column > start.column) + r.start.column += colDiff; + if (r.end.row == startRow && r.end.column >= start.column) + r.end.column += colDiff; + if (r.start.row >= startRow) + r.start.row += lineDif; + if (r.end.row >= startRow) + r.end.row += lineDif; + + if (comparePoints(r.start, r.end) > 0) + this.removeRange(r); + } + if (!ranges.length) + this.detach(); + }; + this.updateLinkedFields = function() { + var ts = this.selectedTabstop; + if (!ts || !ts.hasLinkedRanges) + return; + this.$inChange = true; + var session = this.editor.session; + var text = session.getTextRange(ts.firstNonLinked); + for (var i = ts.length; i--;) { + var range = ts[i]; + if (!range.linked) + continue; + var fmt = exports.snippetManager.tmStrFormat(text, range.original); + session.replace(range, fmt); + } + this.$inChange = false; + }; + this.onAfterExec = function(e) { + if (e.command && !e.command.readOnly) + this.updateLinkedFields(); + }; + this.onChangeSelection = function() { + if (!this.editor) + return; + var lead = this.editor.selection.lead; + var anchor = this.editor.selection.anchor; + var isEmpty = this.editor.selection.isEmpty(); + for (var i = this.ranges.length; i--;) { + if (this.ranges[i].linked) + continue; + var containsLead = this.ranges[i].contains(lead.row, lead.column); + var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column); + if (containsLead && containsAnchor) + return; + } + this.detach(); + }; + this.onChangeSession = function() { + this.detach(); + }; + this.tabNext = function(dir) { + var max = this.tabstops.length; + var index = this.index + (dir || 1); + index = Math.min(Math.max(index, 1), max); + if (index == max) + index = 0; + this.selectTabstop(index); + if (index === 0) + this.detach(); + }; + this.selectTabstop = function(index) { + this.$openTabstops = null; + var ts = this.tabstops[this.index]; + if (ts) + this.addTabstopMarkers(ts); + this.index = index; + ts = this.tabstops[this.index]; + if (!ts || !ts.length) + return; + + this.selectedTabstop = ts; + if (!this.editor.inVirtualSelectionMode) { + var sel = this.editor.multiSelect; + sel.toSingleRange(ts.firstNonLinked.clone()); + for (var i = ts.length; i--;) { + if (ts.hasLinkedRanges && ts[i].linked) + continue; + sel.addRange(ts[i].clone(), true); + } + if (sel.ranges[0]) + sel.addRange(sel.ranges[0].clone()); + } else { + this.editor.selection.setRange(ts.firstNonLinked); + } + + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + }; + this.addTabstops = function(tabstops, start, end) { + if (!this.$openTabstops) + this.$openTabstops = []; + if (!tabstops[0]) { + var p = Range.fromPoints(end, end); + moveRelative(p.start, start); + moveRelative(p.end, start); + tabstops[0] = [p]; + tabstops[0].index = 0; + } + + var i = this.index; + var arg = [i + 1, 0]; + var ranges = this.ranges; + tabstops.forEach(function(ts, index) { + var dest = this.$openTabstops[index] || ts; + + for (var i = ts.length; i--;) { + var p = ts[i]; + var range = Range.fromPoints(p.start, p.end || p.start); + movePoint(range.start, start); + movePoint(range.end, start); + range.original = p; + range.tabstop = dest; + ranges.push(range); + if (dest != ts) + dest.unshift(range); + else + dest[i] = range; + if (p.fmtString) { + range.linked = true; + dest.hasLinkedRanges = true; + } else if (!dest.firstNonLinked) + dest.firstNonLinked = range; + } + if (!dest.firstNonLinked) + dest.hasLinkedRanges = false; + if (dest === ts) { + arg.push(dest); + this.$openTabstops[index] = dest; + } + this.addTabstopMarkers(dest); + }, this); + + if (arg.length > 2) { + if (this.tabstops.length) + arg.push(arg.splice(2, 1)[0]); + this.tabstops.splice.apply(this.tabstops, arg); + } + }; + + this.addTabstopMarkers = function(ts) { + var session = this.editor.session; + ts.forEach(function(range) { + if (!range.markerId) + range.markerId = session.addMarker(range, "ace_snippet-marker", "text"); + }); + }; + this.removeTabstopMarkers = function(ts) { + var session = this.editor.session; + ts.forEach(function(range) { + session.removeMarker(range.markerId); + range.markerId = null; + }); + }; + this.removeRange = function(range) { + var i = range.tabstop.indexOf(range); + range.tabstop.splice(i, 1); + i = this.ranges.indexOf(range); + this.ranges.splice(i, 1); + this.editor.session.removeMarker(range.markerId); + if (!range.tabstop.length) { + i = this.tabstops.indexOf(range.tabstop); + if (i != -1) + this.tabstops.splice(i, 1); + if (!this.tabstops.length) + this.detach(); + } + }; + + this.keyboardHandler = new HashHandler(); + this.keyboardHandler.bindKeys({ + "Tab": function(ed) { + if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) { + return; + } + + ed.tabstopManager.tabNext(1); + }, + "Shift-Tab": function(ed) { + ed.tabstopManager.tabNext(-1); + }, + "Esc": function(ed) { + ed.tabstopManager.detach(); + }, + "Return": function(ed) { + return false; + } + }); +}).call(TabstopManager.prototype); + + + +var changeTracker = {}; +changeTracker.onChange = Anchor.prototype.onChange; +changeTracker.setPosition = function(row, column) { + this.pos.row = row; + this.pos.column = column; +}; +changeTracker.update = function(pos, delta, $insertRight) { + this.$insertRight = $insertRight; + this.pos = pos; + this.onChange(delta); +}; + +var movePoint = function(point, diff) { + if (point.row == 0) + point.column += diff.column; + point.row += diff.row; +}; + +var moveRelative = function(point, start) { + if (point.row == start.row) + point.column -= start.column; + point.row -= start.row; +}; + + +require("./lib/dom").importCssString("\ +.ace_snippet-marker {\ + -moz-box-sizing: border-box;\ + box-sizing: border-box;\ + background: rgba(194, 193, 208, 0.09);\ + border: 1px dotted rgba(211, 208, 235, 0.62);\ + position: absolute;\ +}"); + +exports.snippetManager = new SnippetManager(); + + +var Editor = require("./editor").Editor; +(function() { + this.insertSnippet = function(content, options) { + return exports.snippetManager.insertSnippet(this, content, options); + }; + this.expandSnippet = function(options) { + return exports.snippetManager.expandWithTab(this, options); + }; +}).call(Editor.prototype); + +}); + +ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +var Renderer = require("../virtual_renderer").VirtualRenderer; +var Editor = require("../editor").Editor; +var Range = require("../range").Range; +var event = require("../lib/event"); +var lang = require("../lib/lang"); +var dom = require("../lib/dom"); + +var $singleLineEditor = function(el) { + var renderer = new Renderer(el); + + renderer.$maxLines = 4; + + var editor = new Editor(renderer); + + editor.setHighlightActiveLine(false); + editor.setShowPrintMargin(false); + editor.renderer.setShowGutter(false); + editor.renderer.setHighlightGutterLine(false); + + editor.$mouseHandler.$focusWaitTimout = 0; + editor.$highlightTagPending = true; + + return editor; +}; + +var AcePopup = function(parentNode) { + var el = dom.createElement("div"); + var popup = new $singleLineEditor(el); + + if (parentNode) + parentNode.appendChild(el); + el.style.display = "none"; + popup.renderer.content.style.cursor = "default"; + popup.renderer.setStyle("ace_autocomplete"); + + popup.setOption("displayIndentGuides", false); + popup.setOption("dragDelay", 150); + + var noop = function(){}; + + popup.focus = noop; + popup.$isFocused = true; + + popup.renderer.$cursorLayer.restartTimer = noop; + popup.renderer.$cursorLayer.element.style.opacity = 0; + + popup.renderer.$maxLines = 8; + popup.renderer.$keepTextAreaAtCursor = false; + + popup.setHighlightActiveLine(false); + popup.session.highlight(""); + popup.session.$searchHighlight.clazz = "ace_highlight-marker"; + + popup.on("mousedown", function(e) { + var pos = e.getDocumentPosition(); + popup.selection.moveToPosition(pos); + selectionMarker.start.row = selectionMarker.end.row = pos.row; + e.stop(); + }); + + var lastMouseEvent; + var hoverMarker = new Range(-1,0,-1,Infinity); + var selectionMarker = new Range(-1,0,-1,Infinity); + selectionMarker.id = popup.session.addMarker(selectionMarker, "ace_active-line", "fullLine"); + popup.setSelectOnHover = function(val) { + if (!val) { + hoverMarker.id = popup.session.addMarker(hoverMarker, "ace_line-hover", "fullLine"); + } else if (hoverMarker.id) { + popup.session.removeMarker(hoverMarker.id); + hoverMarker.id = null; + } + }; + popup.setSelectOnHover(false); + popup.on("mousemove", function(e) { + if (!lastMouseEvent) { + lastMouseEvent = e; + return; + } + if (lastMouseEvent.x == e.x && lastMouseEvent.y == e.y) { + return; + } + lastMouseEvent = e; + lastMouseEvent.scrollTop = popup.renderer.scrollTop; + var row = lastMouseEvent.getDocumentPosition().row; + if (hoverMarker.start.row != row) { + if (!hoverMarker.id) + popup.setRow(row); + setHoverMarker(row); + } + }); + popup.renderer.on("beforeRender", function() { + if (lastMouseEvent && hoverMarker.start.row != -1) { + lastMouseEvent.$pos = null; + var row = lastMouseEvent.getDocumentPosition().row; + if (!hoverMarker.id) + popup.setRow(row); + setHoverMarker(row, true); + } + }); + popup.renderer.on("afterRender", function() { + var row = popup.getRow(); + var t = popup.renderer.$textLayer; + var selected = t.element.childNodes[row - t.config.firstRow]; + if (selected == t.selectedNode) + return; + if (t.selectedNode) + dom.removeCssClass(t.selectedNode, "ace_selected"); + t.selectedNode = selected; + if (selected) + dom.addCssClass(selected, "ace_selected"); + }); + var hideHoverMarker = function() { setHoverMarker(-1) }; + var setHoverMarker = function(row, suppressRedraw) { + if (row !== hoverMarker.start.row) { + hoverMarker.start.row = hoverMarker.end.row = row; + if (!suppressRedraw) + popup.session._emit("changeBackMarker"); + popup._emit("changeHoverMarker"); + } + }; + popup.getHoveredRow = function() { + return hoverMarker.start.row; + }; + + event.addListener(popup.container, "mouseout", hideHoverMarker); + popup.on("hide", hideHoverMarker); + popup.on("changeSelection", hideHoverMarker); + + popup.session.doc.getLength = function() { + return popup.data.length; + }; + popup.session.doc.getLine = function(i) { + var data = popup.data[i]; + if (typeof data == "string") + return data; + return (data && data.value) || ""; + }; + + var bgTokenizer = popup.session.bgTokenizer; + bgTokenizer.$tokenizeRow = function(row) { + var data = popup.data[row]; + var tokens = []; + if (!data) + return tokens; + if (typeof data == "string") + data = {value: data}; + if (!data.caption) + data.caption = data.value || data.name; + + var last = -1; + var flag, c; + for (var i = 0; i < data.caption.length; i++) { + c = data.caption[i]; + flag = data.matchMask & (1 << i) ? 1 : 0; + if (last !== flag) { + tokens.push({type: data.className || "" + ( flag ? "completion-highlight" : ""), value: c}); + last = flag; + } else { + tokens[tokens.length - 1].value += c; + } + } + + if (data.meta) { + var maxW = popup.renderer.$size.scrollerWidth / popup.renderer.layerConfig.characterWidth; + var metaData = data.meta; + if (metaData.length + data.caption.length > maxW - 2) { + metaData = metaData.substr(0, maxW - data.caption.length - 3) + "\u2026" + } + tokens.push({type: "rightAlignedText", value: metaData}); + } + return tokens; + }; + bgTokenizer.$updateOnChange = noop; + bgTokenizer.start = noop; + + popup.session.$computeWidth = function() { + return this.screenWidth = 0; + }; + + popup.$blockScrolling = Infinity; + popup.isOpen = false; + popup.isTopdown = false; + popup.autoSelect = true; + + popup.data = []; + popup.setData = function(list) { + popup.setValue(lang.stringRepeat("\n", list.length), -1); + popup.data = list || []; + popup.setRow(0); + }; + popup.getData = function(row) { + return popup.data[row]; + }; + + popup.getRow = function() { + return selectionMarker.start.row; + }; + popup.setRow = function(line) { + line = Math.max(this.autoSelect ? 0 : -1, Math.min(this.data.length, line)); + if (selectionMarker.start.row != line) { + popup.selection.clearSelection(); + selectionMarker.start.row = selectionMarker.end.row = line || 0; + popup.session._emit("changeBackMarker"); + popup.moveCursorTo(line || 0, 0); + if (popup.isOpen) + popup._signal("select"); + } + }; + + popup.on("changeSelection", function() { + if (popup.isOpen) + popup.setRow(popup.selection.lead.row); + popup.renderer.scrollCursorIntoView(); + }); + + popup.hide = function() { + this.container.style.display = "none"; + this._signal("hide"); + popup.isOpen = false; + }; + popup.show = function(pos, lineHeight, topdownOnly) { + var el = this.container; + var screenHeight = window.innerHeight; + var screenWidth = window.innerWidth; + var renderer = this.renderer; + var maxH = renderer.$maxLines * lineHeight * 1.4; + var top = pos.top + this.$borderSize; + var allowTopdown = top > screenHeight / 2 && !topdownOnly; + if (allowTopdown && top + lineHeight + maxH > screenHeight) { + renderer.$maxPixelHeight = top - 2 * this.$borderSize; + el.style.top = ""; + el.style.bottom = screenHeight - top + "px"; + popup.isTopdown = false; + } else { + top += lineHeight; + renderer.$maxPixelHeight = screenHeight - top - 0.2 * lineHeight; + el.style.top = top + "px"; + el.style.bottom = ""; + popup.isTopdown = true; + } + + el.style.display = ""; + this.renderer.$textLayer.checkForSizeChanges(); + + var left = pos.left; + if (left + el.offsetWidth > screenWidth) + left = screenWidth - el.offsetWidth; + + el.style.left = left + "px"; + + this._signal("show"); + lastMouseEvent = null; + popup.isOpen = true; + }; + + popup.getTextLeftOffset = function() { + return this.$borderSize + this.renderer.$padding + this.$imageSize; + }; + + popup.$imageSize = 0; + popup.$borderSize = 1; + + return popup; +}; + +dom.importCssString("\ +.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\ + background-color: #CAD6FA;\ + z-index: 1;\ +}\ +.ace_editor.ace_autocomplete .ace_line-hover {\ + border: 1px solid #abbffe;\ + margin-top: -1px;\ + background: rgba(233,233,253,0.4);\ +}\ +.ace_editor.ace_autocomplete .ace_line-hover {\ + position: absolute;\ + z-index: 2;\ +}\ +.ace_editor.ace_autocomplete .ace_scroller {\ + background: none;\ + border: none;\ + box-shadow: none;\ +}\ +.ace_rightAlignedText {\ + color: gray;\ + display: inline-block;\ + position: absolute;\ + right: 4px;\ + text-align: right;\ + z-index: -1;\ +}\ +.ace_editor.ace_autocomplete .ace_completion-highlight{\ + color: #000;\ + text-shadow: 0 0 0.01em;\ +}\ +.ace_editor.ace_autocomplete {\ + width: 280px;\ + z-index: 200000;\ + background: #fbfbfb;\ + color: #444;\ + border: 1px lightgray solid;\ + position: fixed;\ + box-shadow: 2px 3px 5px rgba(0,0,0,.2);\ + line-height: 1.4;\ +}"); + +exports.AcePopup = AcePopup; + +}); + +ace.define("ace/autocomplete/util",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.parForEach = function(array, fn, callback) { + var completed = 0; + var arLength = array.length; + if (arLength === 0) + callback(); + for (var i = 0; i < arLength; i++) { + fn(array[i], function(result, err) { + completed++; + if (completed === arLength) + callback(result, err); + }); + } +}; + +var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/; + +exports.retrievePrecedingIdentifier = function(text, pos, regex) { + regex = regex || ID_REGEX; + var buf = []; + for (var i = pos-1; i >= 0; i--) { + if (regex.test(text[i])) + buf.push(text[i]); + else + break; + } + return buf.reverse().join(""); +}; + +exports.retrieveFollowingIdentifier = function(text, pos, regex) { + regex = regex || ID_REGEX; + var buf = []; + for (var i = pos; i < text.length; i++) { + if (regex.test(text[i])) + buf.push(text[i]); + else + break; + } + return buf; +}; + +exports.getCompletionPrefix = function (editor) { + var pos = editor.getCursorPosition(); + var line = editor.session.getLine(pos.row); + var prefix; + editor.completers.forEach(function(completer) { + if (completer.identifierRegexps) { + completer.identifierRegexps.forEach(function(identifierRegex) { + if (!prefix && identifierRegex) + prefix = this.retrievePrecedingIdentifier(line, pos.column, identifierRegex); + }.bind(this)); + } + }.bind(this)); + return prefix || this.retrievePrecedingIdentifier(line, pos.column); +}; + +}); + +ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/snippets"], function(require, exports, module) { +"use strict"; + +var HashHandler = require("./keyboard/hash_handler").HashHandler; +var AcePopup = require("./autocomplete/popup").AcePopup; +var util = require("./autocomplete/util"); +var event = require("./lib/event"); +var lang = require("./lib/lang"); +var dom = require("./lib/dom"); +var snippetManager = require("./snippets").snippetManager; + +var Autocomplete = function() { + this.autoInsert = false; + this.autoSelect = true; + this.exactMatch = false; + this.gatherCompletionsId = 0; + this.keyboardHandler = new HashHandler(); + this.keyboardHandler.bindKeys(this.commands); + + this.blurListener = this.blurListener.bind(this); + this.changeListener = this.changeListener.bind(this); + this.mousedownListener = this.mousedownListener.bind(this); + this.mousewheelListener = this.mousewheelListener.bind(this); + + this.changeTimer = lang.delayedCall(function() { + this.updateCompletions(true); + }.bind(this)); + + this.tooltipTimer = lang.delayedCall(this.updateDocTooltip.bind(this), 50); +}; + +(function() { + + this.$init = function() { + this.popup = new AcePopup(document.body || document.documentElement); + this.popup.on("click", function(e) { + this.insertMatch(); + e.stop(); + }.bind(this)); + this.popup.focus = this.editor.focus.bind(this.editor); + this.popup.on("show", this.tooltipTimer.bind(null, null)); + this.popup.on("select", this.tooltipTimer.bind(null, null)); + this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null)); + return this.popup; + }; + + this.getPopup = function() { + return this.popup || this.$init(); + }; + + this.openPopup = function(editor, prefix, keepPopupPosition) { + if (!this.popup) + this.$init(); + + this.popup.autoSelect = this.autoSelect; + + this.popup.setData(this.completions.filtered); + + editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + + var renderer = editor.renderer; + this.popup.setRow(this.autoSelect ? 0 : -1); + if (!keepPopupPosition) { + this.popup.setTheme(editor.getTheme()); + this.popup.setFontSize(editor.getFontSize()); + + var lineHeight = renderer.layerConfig.lineHeight; + + var pos = renderer.$cursorLayer.getPixelPosition(this.base, true); + pos.left -= this.popup.getTextLeftOffset(); + + var rect = editor.container.getBoundingClientRect(); + pos.top += rect.top - renderer.layerConfig.offset; + pos.left += rect.left - editor.renderer.scrollLeft; + pos.left += renderer.gutterWidth; + + this.popup.show(pos, lineHeight); + } else if (keepPopupPosition && !prefix) { + this.detach(); + } + }; + + this.detach = function() { + this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); + this.editor.off("changeSelection", this.changeListener); + this.editor.off("blur", this.blurListener); + this.editor.off("mousedown", this.mousedownListener); + this.editor.off("mousewheel", this.mousewheelListener); + this.changeTimer.cancel(); + this.hideDocTooltip(); + + this.gatherCompletionsId += 1; + if (this.popup && this.popup.isOpen) + this.popup.hide(); + + if (this.base) + this.base.detach(); + this.activated = false; + this.completions = this.base = null; + }; + + this.changeListener = function(e) { + var cursor = this.editor.selection.lead; + if (cursor.row != this.base.row || cursor.column < this.base.column) { + this.detach(); + } + if (this.activated) + this.changeTimer.schedule(); + else + this.detach(); + }; + + this.blurListener = function(e) { + var el = document.activeElement; + var text = this.editor.textInput.getElement(); + var fromTooltip = e.relatedTarget && this.tooltipNode && this.tooltipNode.contains(e.relatedTarget); + var container = this.popup && this.popup.container; + if (el != text && el.parentNode != container && !fromTooltip + && el != this.tooltipNode && e.relatedTarget != text + ) { + this.detach(); + } + }; + + this.mousedownListener = function(e) { + this.detach(); + }; + + this.mousewheelListener = function(e) { + this.detach(); + }; + + this.goTo = function(where) { + var row = this.popup.getRow(); + var max = this.popup.session.getLength() - 1; + + switch(where) { + case "up": row = row <= 0 ? max : row - 1; break; + case "down": row = row >= max ? -1 : row + 1; break; + case "start": row = 0; break; + case "end": row = max; break; + } + + this.popup.setRow(row); + }; + + this.insertMatch = function(data, options) { + if (!data) + data = this.popup.getData(this.popup.getRow()); + if (!data) + return false; + + if (data.completer && data.completer.insertMatch) { + data.completer.insertMatch(this.editor, data); + } else { + if (this.completions.filterText) { + var ranges = this.editor.selection.getAllRanges(); + for (var i = 0, range; range = ranges[i]; i++) { + range.start.column -= this.completions.filterText.length; + this.editor.session.remove(range); + } + } + if (data.snippet) + snippetManager.insertSnippet(this.editor, data.snippet); + else + this.editor.execCommand("insertstring", data.value || data); + } + this.detach(); + }; + + + this.commands = { + "Up": function(editor) { editor.completer.goTo("up"); }, + "Down": function(editor) { editor.completer.goTo("down"); }, + "Ctrl-Up|Ctrl-Home": function(editor) { editor.completer.goTo("start"); }, + "Ctrl-Down|Ctrl-End": function(editor) { editor.completer.goTo("end"); }, + + "Esc": function(editor) { editor.completer.detach(); }, + "Return": function(editor) { return editor.completer.insertMatch(); }, + "Shift-Return": function(editor) { editor.completer.insertMatch(null, {deleteSuffix: true}); }, + "Tab": function(editor) { + var result = editor.completer.insertMatch(); + if (!result && !editor.tabstopManager) + editor.completer.goTo("down"); + else + return result; + }, + + "PageUp": function(editor) { editor.completer.popup.gotoPageUp(); }, + "PageDown": function(editor) { editor.completer.popup.gotoPageDown(); } + }; + + this.gatherCompletions = function(editor, callback) { + var session = editor.getSession(); + var pos = editor.getCursorPosition(); + + var prefix = util.getCompletionPrefix(editor); + + this.base = session.doc.createAnchor(pos.row, pos.column - prefix.length); + this.base.$insertRight = true; + + var matches = []; + var total = editor.completers.length; + editor.completers.forEach(function(completer, i) { + completer.getCompletions(editor, session, pos, prefix, function(err, results) { + if (!err && results) + matches = matches.concat(results); + callback(null, { + prefix: util.getCompletionPrefix(editor), + matches: matches, + finished: (--total === 0) + }); + }); + }); + return true; + }; + + this.showPopup = function(editor) { + if (this.editor) + this.detach(); + + this.activated = true; + + this.editor = editor; + if (editor.completer != this) { + if (editor.completer) + editor.completer.detach(); + editor.completer = this; + } + + editor.on("changeSelection", this.changeListener); + editor.on("blur", this.blurListener); + editor.on("mousedown", this.mousedownListener); + editor.on("mousewheel", this.mousewheelListener); + + this.updateCompletions(); + }; + + this.updateCompletions = function(keepPopupPosition) { + if (keepPopupPosition && this.base && this.completions) { + var pos = this.editor.getCursorPosition(); + var prefix = this.editor.session.getTextRange({start: this.base, end: pos}); + if (prefix == this.completions.filterText) + return; + this.completions.setFilter(prefix); + if (!this.completions.filtered.length) + return this.detach(); + if (this.completions.filtered.length == 1 + && this.completions.filtered[0].value == prefix + && !this.completions.filtered[0].snippet) + return this.detach(); + this.openPopup(this.editor, prefix, keepPopupPosition); + return; + } + var _id = this.gatherCompletionsId; + this.gatherCompletions(this.editor, function(err, results) { + var detachIfFinished = function() { + if (!results.finished) return; + return this.detach(); + }.bind(this); + + var prefix = results.prefix; + var matches = results && results.matches; + + if (!matches || !matches.length) + return detachIfFinished(); + if (prefix.indexOf(results.prefix) !== 0 || _id != this.gatherCompletionsId) + return; + + this.completions = new FilteredList(matches); + + if (this.exactMatch) + this.completions.exactMatch = true; + + this.completions.setFilter(prefix); + var filtered = this.completions.filtered; + if (!filtered.length) + return detachIfFinished(); + if (filtered.length == 1 && filtered[0].value == prefix && !filtered[0].snippet) + return detachIfFinished(); + if (this.autoInsert && filtered.length == 1 && results.finished) + return this.insertMatch(filtered[0]); + + this.openPopup(this.editor, prefix, keepPopupPosition); + }.bind(this)); + }; + + this.cancelContextMenu = function() { + this.editor.$mouseHandler.cancelContextMenu(); + }; + + this.updateDocTooltip = function() { + var popup = this.popup; + var all = popup.data; + var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]); + var doc = null; + if (!selected || !this.editor || !this.popup.isOpen) + return this.hideDocTooltip(); + this.editor.completers.some(function(completer) { + if (completer.getDocTooltip) + doc = completer.getDocTooltip(selected); + return doc; + }); + if (!doc) + doc = selected; + + if (typeof doc == "string") + doc = {docText: doc}; + if (!doc || !(doc.docHTML || doc.docText)) + return this.hideDocTooltip(); + this.showDocTooltip(doc); + }; + + this.showDocTooltip = function(item) { + if (!this.tooltipNode) { + this.tooltipNode = dom.createElement("div"); + this.tooltipNode.className = "ace_tooltip ace_doc-tooltip"; + this.tooltipNode.style.margin = 0; + this.tooltipNode.style.pointerEvents = "auto"; + this.tooltipNode.tabIndex = -1; + this.tooltipNode.onblur = this.blurListener.bind(this); + this.tooltipNode.onclick = this.onTooltipClick.bind(this); + } + + var tooltipNode = this.tooltipNode; + if (item.docHTML) { + tooltipNode.innerHTML = item.docHTML; + } else if (item.docText) { + tooltipNode.textContent = item.docText; + } + + if (!tooltipNode.parentNode) + document.body.appendChild(tooltipNode); + var popup = this.popup; + var rect = popup.container.getBoundingClientRect(); + tooltipNode.style.top = popup.container.style.top; + tooltipNode.style.bottom = popup.container.style.bottom; + + if (window.innerWidth - rect.right < 320) { + tooltipNode.style.right = window.innerWidth - rect.left + "px"; + tooltipNode.style.left = ""; + } else { + tooltipNode.style.left = (rect.right + 1) + "px"; + tooltipNode.style.right = ""; + } + tooltipNode.style.display = "block"; + }; + + this.hideDocTooltip = function() { + this.tooltipTimer.cancel(); + if (!this.tooltipNode) return; + var el = this.tooltipNode; + if (!this.editor.isFocused() && document.activeElement == el) + this.editor.focus(); + this.tooltipNode = null; + if (el.parentNode) + el.parentNode.removeChild(el); + }; + + this.onTooltipClick = function(e) { + var a = e.target; + while (a && a != this.tooltipNode) { + if (a.nodeName == "A" && a.href) { + a.rel = "noreferrer"; + a.target = "_blank"; + break; + } + a = a.parentNode; + } + } + +}).call(Autocomplete.prototype); + +Autocomplete.startCommand = { + name: "startAutocomplete", + exec: function(editor) { + if (!editor.completer) + editor.completer = new Autocomplete(); + editor.completer.autoInsert = false; + editor.completer.autoSelect = true; + editor.completer.showPopup(editor); + editor.completer.cancelContextMenu(); + }, + bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" +}; + +var FilteredList = function(array, filterText) { + this.all = array; + this.filtered = array; + this.filterText = filterText || ""; + this.exactMatch = false; +}; +(function(){ + this.setFilter = function(str) { + if (str.length > this.filterText && str.lastIndexOf(this.filterText, 0) === 0) + var matches = this.filtered; + else + var matches = this.all; + + this.filterText = str; + matches = this.filterCompletions(matches, this.filterText); + matches = matches.sort(function(a, b) { + return b.exactMatch - a.exactMatch || b.score - a.score; + }); + var prev = null; + matches = matches.filter(function(item){ + var caption = item.snippet || item.caption || item.value; + if (caption === prev) return false; + prev = caption; + return true; + }); + + this.filtered = matches; + }; + this.filterCompletions = function(items, needle) { + var results = []; + var upper = needle.toUpperCase(); + var lower = needle.toLowerCase(); + loop: for (var i = 0, item; item = items[i]; i++) { + var caption = item.value || item.caption || item.snippet; + if (!caption) continue; + var lastIndex = -1; + var matchMask = 0; + var penalty = 0; + var index, distance; + + if (this.exactMatch) { + if (needle !== caption.substr(0, needle.length)) + continue loop; + }else{ + for (var j = 0; j < needle.length; j++) { + var i1 = caption.indexOf(lower[j], lastIndex + 1); + var i2 = caption.indexOf(upper[j], lastIndex + 1); + index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2; + if (index < 0) + continue loop; + distance = index - lastIndex - 1; + if (distance > 0) { + if (lastIndex === -1) + penalty += 10; + penalty += distance; + } + matchMask = matchMask | (1 << index); + lastIndex = index; + } + } + item.matchMask = matchMask; + item.exactMatch = penalty ? 0 : 1; + item.score = (item.score || 0) - penalty; + results.push(item); + } + return results; + }; +}).call(FilteredList.prototype); + +exports.Autocomplete = Autocomplete; +exports.FilteredList = FilteredList; + +}); + +ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"], function(require, exports, module) { + var Range = require("../range").Range; + + var splitRegex = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/; + + function getWordIndex(doc, pos) { + var textBefore = doc.getTextRange(Range.fromPoints({row: 0, column:0}, pos)); + return textBefore.split(splitRegex).length - 1; + } + function wordDistance(doc, pos) { + var prefixPos = getWordIndex(doc, pos); + var words = doc.getValue().split(splitRegex); + var wordScores = Object.create(null); + + var currentWord = words[prefixPos]; + + words.forEach(function(word, idx) { + if (!word || word === currentWord) return; + + var distance = Math.abs(prefixPos - idx); + var score = words.length - distance; + if (wordScores[word]) { + wordScores[word] = Math.max(score, wordScores[word]); + } else { + wordScores[word] = score; + } + }); + return wordScores; + } + + exports.getCompletions = function(editor, session, pos, prefix, callback) { + var wordScore = wordDistance(session, pos, prefix); + var wordList = Object.keys(wordScore); + callback(null, wordList.map(function(word) { + return { + caption: word, + value: word, + score: wordScore[word], + meta: "local" + }; + })); + }; +}); + +ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"], function(require, exports, module) { +"use strict"; + +var snippetManager = require("../snippets").snippetManager; +var Autocomplete = require("../autocomplete").Autocomplete; +var config = require("../config"); +var lang = require("../lib/lang"); +var util = require("../autocomplete/util"); + +var textCompleter = require("../autocomplete/text_completer"); +var keyWordCompleter = { + getCompletions: function(editor, session, pos, prefix, callback) { + if (session.$mode.completer) { + return session.$mode.completer.getCompletions(editor, session, pos, prefix, callback); + } + var state = editor.session.getState(pos.row); + var completions = session.$mode.getCompletions(state, session, pos, prefix); + callback(null, completions); + } +}; + +var snippetCompleter = { + getCompletions: function(editor, session, pos, prefix, callback) { + var snippetMap = snippetManager.snippetMap; + var completions = []; + snippetManager.getActiveScopes(editor).forEach(function(scope) { + var snippets = snippetMap[scope] || []; + for (var i = snippets.length; i--;) { + var s = snippets[i]; + var caption = s.name || s.tabTrigger; + if (!caption) + continue; + completions.push({ + caption: caption, + snippet: s.content, + meta: s.tabTrigger && !s.name ? s.tabTrigger + "\u21E5 " : "snippet", + type: "snippet" + }); + } + }, this); + callback(null, completions); + }, + getDocTooltip: function(item) { + if (item.type == "snippet" && !item.docHTML) { + item.docHTML = [ + "", lang.escapeHTML(item.caption), "", "
        ", + lang.escapeHTML(item.snippet) + ].join(""); + } + } +}; + +var completers = [snippetCompleter, textCompleter, keyWordCompleter]; +exports.setCompleters = function(val) { + completers.length = 0; + if (val) completers.push.apply(completers, val); +}; +exports.addCompleter = function(completer) { + completers.push(completer); +}; +exports.textCompleter = textCompleter; +exports.keyWordCompleter = keyWordCompleter; +exports.snippetCompleter = snippetCompleter; + +var expandSnippet = { + name: "expandSnippet", + exec: function(editor) { + return snippetManager.expandWithTab(editor); + }, + bindKey: "Tab" +}; + +var onChangeMode = function(e, editor) { + loadSnippetsForMode(editor.session.$mode); +}; + +var loadSnippetsForMode = function(mode) { + var id = mode.$id; + if (!snippetManager.files) + snippetManager.files = {}; + loadSnippetFile(id); + if (mode.modes) + mode.modes.forEach(loadSnippetsForMode); +}; + +var loadSnippetFile = function(id) { + if (!id || snippetManager.files[id]) + return; + var snippetFilePath = id.replace("mode", "snippets"); + snippetManager.files[id] = {}; + config.loadModule(snippetFilePath, function(m) { + if (m) { + snippetManager.files[id] = m; + if (!m.snippets && m.snippetText) + m.snippets = snippetManager.parseSnippetFile(m.snippetText); + snippetManager.register(m.snippets || [], m.scope); + if (m.includeScopes) { + snippetManager.snippetMap[m.scope].includeScopes = m.includeScopes; + m.includeScopes.forEach(function(x) { + loadSnippetFile("ace/mode/" + x); + }); + } + } + }); +}; + +var doLiveAutocomplete = function(e) { + var editor = e.editor; + var hasCompleter = editor.completer && editor.completer.activated; + if (e.command.name === "backspace") { + if (hasCompleter && !util.getCompletionPrefix(editor)) + editor.completer.detach(); + } + else if (e.command.name === "insertstring") { + var prefix = util.getCompletionPrefix(editor); + if (prefix && !hasCompleter) { + if (!editor.completer) { + editor.completer = new Autocomplete(); + } + editor.completer.autoInsert = false; + editor.completer.showPopup(editor); + } + } +}; + +var Editor = require("../editor").Editor; +require("../config").defineOptions(Editor.prototype, "editor", { + enableBasicAutocompletion: { + set: function(val) { + if (val) { + if (!this.completers) + this.completers = Array.isArray(val)? val: completers; + this.commands.addCommand(Autocomplete.startCommand); + } else { + this.commands.removeCommand(Autocomplete.startCommand); + } + }, + value: false + }, + enableLiveAutocompletion: { + set: function(val) { + if (val) { + if (!this.completers) + this.completers = Array.isArray(val)? val: completers; + this.commands.on('afterExec', doLiveAutocomplete); + } else { + this.commands.removeListener('afterExec', doLiveAutocomplete); + } + }, + value: false + }, + enableSnippets: { + set: function(val) { + if (val) { + this.commands.addCommand(expandSnippet); + this.on("changeMode", onChangeMode); + onChangeMode(null, this); + } else { + this.commands.removeCommand(expandSnippet); + this.off("changeMode", onChangeMode); + } + }, + value: false + } +}); +}); + (function() { + ace.require(["ace/ext/language_tools"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-linking.js b/htdocs/includes/ace/ext-linking.js new file mode 100644 index 00000000000..baa7570254d --- /dev/null +++ b/htdocs/includes/ace/ext-linking.js @@ -0,0 +1,61 @@ +ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) { + +var Editor = require("ace/editor").Editor; + +require("../config").defineOptions(Editor.prototype, "editor", { + enableLinking: { + set: function(val) { + if (val) { + this.on("click", onClick); + this.on("mousemove", onMouseMove); + } else { + this.off("click", onClick); + this.off("mousemove", onMouseMove); + } + }, + value: false + } +}) + +exports.previousLinkingHover = false; + +function onMouseMove(e) { + var editor = e.editor; + var ctrl = e.getAccelKey(); + + if (ctrl) { + var editor = e.editor; + var docPos = e.getDocumentPosition(); + var session = editor.session; + var token = session.getTokenAt(docPos.row, docPos.column); + + if (exports.previousLinkingHover && exports.previousLinkingHover != token) { + editor._emit("linkHoverOut"); + } + editor._emit("linkHover", {position: docPos, token: token}); + exports.previousLinkingHover = token; + } else if (exports.previousLinkingHover) { + editor._emit("linkHoverOut"); + exports.previousLinkingHover = false; + } +} + +function onClick(e) { + var ctrl = e.getAccelKey(); + var button = e.getButton(); + + if (button == 0 && ctrl) { + var editor = e.editor; + var docPos = e.getDocumentPosition(); + var session = editor.session; + var token = session.getTokenAt(docPos.row, docPos.column); + + editor._emit("linkClick", {position: docPos, token: token}); + } +} + +}); + (function() { + ace.require(["ace/ext/linking"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-modelist.js b/htdocs/includes/ace/ext-modelist.js new file mode 100644 index 00000000000..b0c7fd0dba0 --- /dev/null +++ b/htdocs/includes/ace/ext-modelist.js @@ -0,0 +1,209 @@ +ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var modes = []; +function getModeForPath(path) { + var mode = modesByName.text; + var fileName = path.split(/[\/\\]/).pop(); + for (var i = 0; i < modes.length; i++) { + if (modes[i].supportsFile(fileName)) { + mode = modes[i]; + break; + } + } + return mode; +} + +var Mode = function(name, caption, extensions) { + this.name = name; + this.caption = caption; + this.mode = "ace/mode/" + name; + this.extensions = extensions; + var re; + if (/\^/.test(extensions)) { + re = extensions.replace(/\|(\^)?/g, function(a, b){ + return "$|" + (b ? "^" : "^.*\\."); + }) + "$"; + } else { + re = "^.*\\.(" + extensions + ")$"; + } + + this.extRe = new RegExp(re, "gi"); +}; + +Mode.prototype.supportsFile = function(filename) { + return filename.match(this.extRe); +}; +var supportedModes = { + ABAP: ["abap"], + ABC: ["abc"], + ActionScript:["as"], + ADA: ["ada|adb"], + Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], + AsciiDoc: ["asciidoc|adoc"], + Assembly_x86:["asm|a"], + AutoHotKey: ["ahk"], + BatchFile: ["bat|cmd"], + Bro: ["bro"], + C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"], + C9Search: ["c9search_results"], + Cirru: ["cirru|cr"], + Clojure: ["clj|cljs"], + Cobol: ["CBL|COB"], + coffee: ["coffee|cf|cson|^Cakefile"], + ColdFusion: ["cfm"], + CSharp: ["cs"], + CSS: ["css"], + Curly: ["curly"], + D: ["d|di"], + Dart: ["dart"], + Diff: ["diff|patch"], + Dockerfile: ["^Dockerfile"], + Dot: ["dot"], + Drools: ["drl"], + Dummy: ["dummy"], + DummySyntax: ["dummy"], + Eiffel: ["e|ge"], + EJS: ["ejs"], + Elixir: ["ex|exs"], + Elm: ["elm"], + Erlang: ["erl|hrl"], + Forth: ["frt|fs|ldr|fth|4th"], + Fortran: ["f|f90"], + FTL: ["ftl"], + Gcode: ["gcode"], + Gherkin: ["feature"], + Gitignore: ["^.gitignore"], + Glsl: ["glsl|frag|vert"], + Gobstones: ["gbs"], + golang: ["go"], + GraphQLSchema: ["gql"], + Groovy: ["groovy"], + HAML: ["haml"], + Handlebars: ["hbs|handlebars|tpl|mustache"], + Haskell: ["hs"], + Haskell_Cabal: ["cabal"], + haXe: ["hx"], + Hjson: ["hjson"], + HTML: ["html|htm|xhtml"], + HTML_Elixir: ["eex|html.eex"], + HTML_Ruby: ["erb|rhtml|html.erb"], + INI: ["ini|conf|cfg|prefs"], + Io: ["io"], + Jack: ["jack"], + Jade: ["jade|pug"], + Java: ["java"], + JavaScript: ["js|jsm|jsx"], + JSON: ["json"], + JSONiq: ["jq"], + JSP: ["jsp"], + JSX: ["jsx"], + Julia: ["jl"], + Kotlin: ["kt|kts"], + LaTeX: ["tex|latex|ltx|bib"], + LESS: ["less"], + Liquid: ["liquid"], + Lisp: ["lisp"], + LiveScript: ["ls"], + LogiQL: ["logic|lql"], + LSL: ["lsl"], + Lua: ["lua"], + LuaPage: ["lp"], + Lucene: ["lucene"], + Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], + Markdown: ["md|markdown"], + Mask: ["mask"], + MATLAB: ["matlab"], + Maze: ["mz"], + MEL: ["mel"], + MUSHCode: ["mc|mush"], + MySQL: ["mysql"], + Nix: ["nix"], + NSIS: ["nsi|nsh"], + ObjectiveC: ["m|mm"], + OCaml: ["ml|mli"], + Pascal: ["pas|p"], + Perl: ["pl|pm"], + pgSQL: ["pgsql"], + PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"], + Pig: ["pig"], + Powershell: ["ps1"], + Praat: ["praat|praatscript|psc|proc"], + Prolog: ["plg|prolog"], + Properties: ["properties"], + Protobuf: ["proto"], + Python: ["py"], + R: ["r"], + Razor: ["cshtml|asp"], + RDoc: ["Rd"], + RHTML: ["Rhtml"], + RST: ["rst"], + Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], + Rust: ["rs"], + SASS: ["sass"], + SCAD: ["scad"], + Scala: ["scala"], + Scheme: ["scm|sm|rkt|oak|scheme"], + SCSS: ["scss"], + SH: ["sh|bash|^.bashrc"], + SJS: ["sjs"], + Smarty: ["smarty|tpl"], + snippets: ["snippets"], + Soy_Template:["soy"], + Space: ["space"], + SQL: ["sql"], + SQLServer: ["sqlserver"], + Stylus: ["styl|stylus"], + SVG: ["svg"], + Swift: ["swift"], + Tcl: ["tcl"], + Tex: ["tex"], + Text: ["txt"], + Textile: ["textile"], + Toml: ["toml"], + TSX: ["tsx"], + Twig: ["twig|swig"], + Typescript: ["ts|typescript|str"], + Vala: ["vala"], + VBScript: ["vbs|vb"], + Velocity: ["vm"], + Verilog: ["v|vh|sv|svh"], + VHDL: ["vhd|vhdl"], + Wollok: ["wlk|wpgm|wtest"], + XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"], + XQuery: ["xq"], + YAML: ["yaml|yml"], + Django: ["html"] +}; + +var nameOverrides = { + ObjectiveC: "Objective-C", + CSharp: "C#", + golang: "Go", + C_Cpp: "C and C++", + coffee: "CoffeeScript", + HTML_Ruby: "HTML (Ruby)", + HTML_Elixir: "HTML (Elixir)", + FTL: "FreeMarker" +}; +var modesByName = {}; +for (var name in supportedModes) { + var data = supportedModes[name]; + var displayName = (nameOverrides[name] || name).replace(/_/g, " "); + var filename = name.toLowerCase(); + var mode = new Mode(filename, displayName, data[0]); + modesByName[filename] = mode; + modes.push(mode); +} + +module.exports = { + getModeForPath: getModeForPath, + modes: modes, + modesByName: modesByName +}; + +}); + (function() { + ace.require(["ace/ext/modelist"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-old_ie.js b/htdocs/includes/ace/ext-old_ie.js new file mode 100644 index 00000000000..f0f225c8b64 --- /dev/null +++ b/htdocs/includes/ace/ext-old_ie.js @@ -0,0 +1,502 @@ +ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) { +"use strict"; + +var dom = require("../lib/dom"); +var lang = require("../lib/lang"); +var event = require("../lib/event"); +var searchboxCss = "\ +.ace_search {\ +background-color: #ddd;\ +border: 1px solid #cbcbcb;\ +border-top: 0 none;\ +max-width: 325px;\ +overflow: hidden;\ +margin: 0;\ +padding: 4px;\ +padding-right: 6px;\ +padding-bottom: 0;\ +position: absolute;\ +top: 0px;\ +z-index: 99;\ +white-space: normal;\ +}\ +.ace_search.left {\ +border-left: 0 none;\ +border-radius: 0px 0px 5px 0px;\ +left: 0;\ +}\ +.ace_search.right {\ +border-radius: 0px 0px 0px 5px;\ +border-right: 0 none;\ +right: 0;\ +}\ +.ace_search_form, .ace_replace_form {\ +border-radius: 3px;\ +border: 1px solid #cbcbcb;\ +float: left;\ +margin-bottom: 4px;\ +overflow: hidden;\ +}\ +.ace_search_form.ace_nomatch {\ +outline: 1px solid red;\ +}\ +.ace_search_field {\ +background-color: white;\ +color: black;\ +border-right: 1px solid #cbcbcb;\ +border: 0 none;\ +-webkit-box-sizing: border-box;\ +-moz-box-sizing: border-box;\ +box-sizing: border-box;\ +float: left;\ +height: 22px;\ +outline: 0;\ +padding: 0 7px;\ +width: 214px;\ +margin: 0;\ +}\ +.ace_searchbtn,\ +.ace_replacebtn {\ +background: #fff;\ +border: 0 none;\ +border-left: 1px solid #dcdcdc;\ +cursor: pointer;\ +float: left;\ +height: 22px;\ +margin: 0;\ +position: relative;\ +}\ +.ace_searchbtn:last-child,\ +.ace_replacebtn:last-child {\ +border-top-right-radius: 3px;\ +border-bottom-right-radius: 3px;\ +}\ +.ace_searchbtn:disabled {\ +background: none;\ +cursor: default;\ +}\ +.ace_searchbtn {\ +background-position: 50% 50%;\ +background-repeat: no-repeat;\ +width: 27px;\ +}\ +.ace_searchbtn.prev {\ +background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); \ +}\ +.ace_searchbtn.next {\ +background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); \ +}\ +.ace_searchbtn_close {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\ +border-radius: 50%;\ +border: 0 none;\ +color: #656565;\ +cursor: pointer;\ +float: right;\ +font: 16px/16px Arial;\ +height: 14px;\ +margin: 5px 1px 9px 5px;\ +padding: 0;\ +text-align: center;\ +width: 14px;\ +}\ +.ace_searchbtn_close:hover {\ +background-color: #656565;\ +background-position: 50% 100%;\ +color: white;\ +}\ +.ace_replacebtn.prev {\ +width: 54px\ +}\ +.ace_replacebtn.next {\ +width: 27px\ +}\ +.ace_button {\ +margin-left: 2px;\ +cursor: pointer;\ +-webkit-user-select: none;\ +-moz-user-select: none;\ +-o-user-select: none;\ +-ms-user-select: none;\ +user-select: none;\ +overflow: hidden;\ +opacity: 0.7;\ +border: 1px solid rgba(100,100,100,0.23);\ +padding: 1px;\ +-moz-box-sizing: border-box;\ +box-sizing: border-box;\ +color: black;\ +}\ +.ace_button:hover {\ +background-color: #eee;\ +opacity:1;\ +}\ +.ace_button:active {\ +background-color: #ddd;\ +}\ +.ace_button.checked {\ +border-color: #3399ff;\ +opacity:1;\ +}\ +.ace_search_options{\ +margin-bottom: 3px;\ +text-align: right;\ +-webkit-user-select: none;\ +-moz-user-select: none;\ +-o-user-select: none;\ +-ms-user-select: none;\ +user-select: none;\ +}"; +var HashHandler = require("../keyboard/hash_handler").HashHandler; +var keyUtil = require("../lib/keys"); + +dom.importCssString(searchboxCss, "ace_searchbox"); + +var html = ''.replace(/>\s+/g, ">"); + +var SearchBox = function(editor, range, showReplaceForm) { + var div = dom.createElement("div"); + div.innerHTML = html; + this.element = div.firstChild; + + this.$init(); + this.setEditor(editor); +}; + +(function() { + this.setEditor = function(editor) { + editor.searchBox = this; + editor.container.appendChild(this.element); + this.editor = editor; + }; + + this.$initElements = function(sb) { + this.searchBox = sb.querySelector(".ace_search_form"); + this.replaceBox = sb.querySelector(".ace_replace_form"); + this.searchOptions = sb.querySelector(".ace_search_options"); + this.regExpOption = sb.querySelector("[action=toggleRegexpMode]"); + this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]"); + this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]"); + this.searchInput = this.searchBox.querySelector(".ace_search_field"); + this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); + }; + + this.$init = function() { + var sb = this.element; + + this.$initElements(sb); + + var _this = this; + event.addListener(sb, "mousedown", function(e) { + setTimeout(function(){ + _this.activeInput.focus(); + }, 0); + event.stopPropagation(e); + }); + event.addListener(sb, "click", function(e) { + var t = e.target || e.srcElement; + var action = t.getAttribute("action"); + if (action && _this[action]) + _this[action](); + else if (_this.$searchBarKb.commands[action]) + _this.$searchBarKb.commands[action].exec(_this); + event.stopPropagation(e); + }); + + event.addCommandKeyListener(sb, function(e, hashId, keyCode) { + var keyString = keyUtil.keyCodeToString(keyCode); + var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); + if (command && command.exec) { + command.exec(_this); + event.stopEvent(e); + } + }); + + this.$onChange = lang.delayedCall(function() { + _this.find(false, false); + }); + + event.addListener(this.searchInput, "input", function() { + _this.$onChange.schedule(20); + }); + event.addListener(this.searchInput, "focus", function() { + _this.activeInput = _this.searchInput; + _this.searchInput.value && _this.highlight(); + }); + event.addListener(this.replaceInput, "focus", function() { + _this.activeInput = _this.replaceInput; + _this.searchInput.value && _this.highlight(); + }); + }; + this.$closeSearchBarKb = new HashHandler([{ + bindKey: "Esc", + name: "closeSearchBar", + exec: function(editor) { + editor.searchBox.hide(); + } + }]); + this.$searchBarKb = new HashHandler(); + this.$searchBarKb.bindKeys({ + "Ctrl-f|Command-f": function(sb) { + var isReplace = sb.isReplace = !sb.isReplace; + sb.replaceBox.style.display = isReplace ? "" : "none"; + sb.searchInput.focus(); + }, + "Ctrl-H|Command-Option-F": function(sb) { + sb.replaceBox.style.display = ""; + sb.replaceInput.focus(); + }, + "Ctrl-G|Command-G": function(sb) { + sb.findNext(); + }, + "Ctrl-Shift-G|Command-Shift-G": function(sb) { + sb.findPrev(); + }, + "esc": function(sb) { + setTimeout(function() { sb.hide();}); + }, + "Return": function(sb) { + if (sb.activeInput == sb.replaceInput) + sb.replace(); + sb.findNext(); + }, + "Shift-Return": function(sb) { + if (sb.activeInput == sb.replaceInput) + sb.replace(); + sb.findPrev(); + }, + "Alt-Return": function(sb) { + if (sb.activeInput == sb.replaceInput) + sb.replaceAll(); + sb.findAll(); + }, + "Tab": function(sb) { + (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); + } + }); + + this.$searchBarKb.addCommands([{ + name: "toggleRegexpMode", + bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"}, + exec: function(sb) { + sb.regExpOption.checked = !sb.regExpOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleCaseSensitive", + bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"}, + exec: function(sb) { + sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleWholeWords", + bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"}, + exec: function(sb) { + sb.wholeWordOption.checked = !sb.wholeWordOption.checked; + sb.$syncOptions(); + } + }]); + + this.$syncOptions = function() { + dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked); + dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked); + dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked); + this.find(false, false); + }; + + this.highlight = function(re) { + this.editor.session.highlight(re || this.editor.$search.$options.re); + this.editor.renderer.updateBackMarkers() + }; + this.find = function(skipCurrent, backwards, preventScroll) { + var range = this.editor.find(this.searchInput.value, { + skipCurrent: skipCurrent, + backwards: backwards, + wrap: true, + regExp: this.regExpOption.checked, + caseSensitive: this.caseSensitiveOption.checked, + wholeWord: this.wholeWordOption.checked, + preventScroll: preventScroll + }); + var noMatch = !range && this.searchInput.value; + dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); + this.editor._emit("findSearchBox", { match: !noMatch }); + this.highlight(); + }; + this.findNext = function() { + this.find(true, false); + }; + this.findPrev = function() { + this.find(true, true); + }; + this.findAll = function(){ + var range = this.editor.findAll(this.searchInput.value, { + regExp: this.regExpOption.checked, + caseSensitive: this.caseSensitiveOption.checked, + wholeWord: this.wholeWordOption.checked + }); + var noMatch = !range && this.searchInput.value; + dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); + this.editor._emit("findSearchBox", { match: !noMatch }); + this.highlight(); + this.hide(); + }; + this.replace = function() { + if (!this.editor.getReadOnly()) + this.editor.replace(this.replaceInput.value); + }; + this.replaceAndFindNext = function() { + if (!this.editor.getReadOnly()) { + this.editor.replace(this.replaceInput.value); + this.findNext() + } + }; + this.replaceAll = function() { + if (!this.editor.getReadOnly()) + this.editor.replaceAll(this.replaceInput.value); + }; + + this.hide = function() { + this.element.style.display = "none"; + this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); + this.editor.focus(); + }; + this.show = function(value, isReplace) { + this.element.style.display = ""; + this.replaceBox.style.display = isReplace ? "" : "none"; + + this.isReplace = isReplace; + + if (value) + this.searchInput.value = value; + + this.find(false, false, true); + + this.searchInput.focus(); + this.searchInput.select(); + + this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); + }; + + this.isFocused = function() { + var el = document.activeElement; + return el == this.searchInput || el == this.replaceInput; + } +}).call(SearchBox.prototype); + +exports.SearchBox = SearchBox; + +exports.Search = function(editor, isReplace) { + var sb = editor.searchBox || new SearchBox(editor); + sb.show(editor.session.getTextRange(), isReplace); +}; + +}); + +ace.define("ace/ext/old_ie",["require","exports","module","ace/lib/useragent","ace/tokenizer","ace/ext/searchbox","ace/mode/text"], function(require, exports, module) { +"use strict"; +var MAX_TOKEN_COUNT = 1000; +var useragent = require("../lib/useragent"); +var TokenizerModule = require("../tokenizer"); + +function patch(obj, name, regexp, replacement) { + eval("obj['" + name + "']=" + obj[name].toString().replace( + regexp, replacement + )); +} + +if (useragent.isIE && useragent.isIE < 10 && window.top.document.compatMode === "BackCompat") + useragent.isOldIE = true; + +if (typeof document != "undefined" && !document.documentElement.querySelector) { + useragent.isOldIE = true; + var qs = function(el, selector) { + if (selector.charAt(0) == ".") { + var classNeme = selector.slice(1); + } else { + var m = selector.match(/(\w+)=(\w+)/); + var attr = m && m[1]; + var attrVal = m && m[2]; + } + for (var i = 0; i < el.all.length; i++) { + var ch = el.all[i]; + if (classNeme) { + if (ch.className.indexOf(classNeme) != -1) + return ch; + } else if (attr) { + if (ch.getAttribute(attr) == attrVal) + return ch; + } + } + }; + var sb = require("./searchbox").SearchBox.prototype; + patch( + sb, "$initElements", + /([^\s=]*).querySelector\((".*?")\)/g, + "qs($1, $2)" + ); +} + +var compliantExecNpcg = /()??/.exec("")[1] === undefined; +if (compliantExecNpcg) + return; +var proto = TokenizerModule.Tokenizer.prototype; +TokenizerModule.Tokenizer_orig = TokenizerModule.Tokenizer; +proto.getLineTokens_orig = proto.getLineTokens; + +patch( + TokenizerModule, "Tokenizer", + "ruleRegExps.push(adjustedregex);\n", + function(m) { + return m + '\ + if (state[i].next && RegExp(adjustedregex).test(""))\n\ + rule._qre = RegExp(adjustedregex, "g");\n\ + '; + } +); +TokenizerModule.Tokenizer.prototype = proto; +patch( + proto, "getLineTokens", + /if \(match\[i \+ 1\] === undefined\)\s*continue;/, + "if (!match[i + 1]) {\n\ + if (value)continue;\n\ + var qre = state[mapping[i]]._qre;\n\ + if (!qre) continue;\n\ + qre.lastIndex = lastIndex;\n\ + if (!qre.exec(line) || qre.lastIndex != lastIndex)\n\ + continue;\n\ + }" +); + +patch( + require("../mode/text").Mode.prototype, "getTokenizer", + /Tokenizer/, + "TokenizerModule.Tokenizer" +); + +useragent.isOldIE = true; + +}); + (function() { + ace.require(["ace/ext/old_ie"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-searchbox.js b/htdocs/includes/ace/ext-searchbox.js new file mode 100644 index 00000000000..81b936bd3a0 --- /dev/null +++ b/htdocs/includes/ace/ext-searchbox.js @@ -0,0 +1,509 @@ +ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) { +"use strict"; + +var dom = require("../lib/dom"); +var lang = require("../lib/lang"); +var event = require("../lib/event"); +var searchboxCss = "\ +.ace_search {\ +background-color: #ddd;\ +color: #666;\ +border: 1px solid #cbcbcb;\ +border-top: 0 none;\ +overflow: hidden;\ +margin: 0;\ +padding: 4px 6px 0 4px;\ +position: absolute;\ +top: 0;\ +z-index: 99;\ +white-space: normal;\ +}\ +.ace_search.left {\ +border-left: 0 none;\ +border-radius: 0px 0px 5px 0px;\ +left: 0;\ +}\ +.ace_search.right {\ +border-radius: 0px 0px 0px 5px;\ +border-right: 0 none;\ +right: 0;\ +}\ +.ace_search_form, .ace_replace_form {\ +margin: 0 20px 4px 0;\ +overflow: hidden;\ +line-height: 1.9;\ +}\ +.ace_replace_form {\ +margin-right: 0;\ +}\ +.ace_search_form.ace_nomatch {\ +outline: 1px solid red;\ +}\ +.ace_search_field {\ +border-radius: 3px 0 0 3px;\ +background-color: white;\ +color: black;\ +border: 1px solid #cbcbcb;\ +border-right: 0 none;\ +box-sizing: border-box!important;\ +outline: 0;\ +padding: 0;\ +font-size: inherit;\ +margin: 0;\ +line-height: inherit;\ +padding: 0 6px;\ +min-width: 17em;\ +vertical-align: top;\ +}\ +.ace_searchbtn {\ +border: 1px solid #cbcbcb;\ +line-height: inherit;\ +display: inline-block;\ +padding: 0 6px;\ +background: #fff;\ +border-right: 0 none;\ +border-left: 1px solid #dcdcdc;\ +cursor: pointer;\ +margin: 0;\ +position: relative;\ +box-sizing: content-box!important;\ +color: #666;\ +}\ +.ace_searchbtn:last-child {\ +border-radius: 0 3px 3px 0;\ +border-right: 1px solid #cbcbcb;\ +}\ +.ace_searchbtn:disabled {\ +background: none;\ +cursor: default;\ +}\ +.ace_searchbtn:hover {\ +background-color: #eef1f6;\ +}\ +.ace_searchbtn.prev, .ace_searchbtn.next {\ +padding: 0px 0.7em\ +}\ +.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\ +content: \"\";\ +border: solid 2px #888;\ +width: 0.5em;\ +height: 0.5em;\ +border-width: 2px 0 0 2px;\ +display:inline-block;\ +transform: rotate(-45deg);\ +}\ +.ace_searchbtn.next:after {\ +border-width: 0 2px 2px 0 ;\ +}\ +.ace_searchbtn_close {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\ +border-radius: 50%;\ +border: 0 none;\ +color: #656565;\ +cursor: pointer;\ +font: 16px/16px Arial;\ +padding: 0;\ +height: 14px;\ +width: 14px;\ +top: 9px;\ +right: 7px;\ +position: absolute;\ +}\ +.ace_searchbtn_close:hover {\ +background-color: #656565;\ +background-position: 50% 100%;\ +color: white;\ +}\ +.ace_button {\ +margin-left: 2px;\ +cursor: pointer;\ +-webkit-user-select: none;\ +-moz-user-select: none;\ +-o-user-select: none;\ +-ms-user-select: none;\ +user-select: none;\ +overflow: hidden;\ +opacity: 0.7;\ +border: 1px solid rgba(100,100,100,0.23);\ +padding: 1px;\ +box-sizing: border-box!important;\ +color: black;\ +}\ +.ace_button:hover {\ +background-color: #eee;\ +opacity:1;\ +}\ +.ace_button:active {\ +background-color: #ddd;\ +}\ +.ace_button.checked {\ +border-color: #3399ff;\ +opacity:1;\ +}\ +.ace_search_options{\ +margin-bottom: 3px;\ +text-align: right;\ +-webkit-user-select: none;\ +-moz-user-select: none;\ +-o-user-select: none;\ +-ms-user-select: none;\ +user-select: none;\ +clear: both;\ +}\ +.ace_search_counter {\ +float: left;\ +font-family: arial;\ +padding: 0 8px;\ +}"; +var HashHandler = require("../keyboard/hash_handler").HashHandler; +var keyUtil = require("../lib/keys"); + +var MAX_COUNT = 999; + +dom.importCssString(searchboxCss, "ace_searchbox"); + +var html = ''.replace(/> +/g, ">"); + +var SearchBox = function(editor, range, showReplaceForm) { + var div = dom.createElement("div"); + div.innerHTML = html; + this.element = div.firstChild; + + this.setSession = this.setSession.bind(this); + + this.$init(); + this.setEditor(editor); +}; + +(function() { + this.setEditor = function(editor) { + editor.searchBox = this; + editor.renderer.scroller.appendChild(this.element); + this.editor = editor; + }; + + this.setSession = function(e) { + debugger + this.searchRange = null; + this.$syncOptions(true); + } + + this.$initElements = function(sb) { + this.searchBox = sb.querySelector(".ace_search_form"); + this.replaceBox = sb.querySelector(".ace_replace_form"); + this.searchOption = sb.querySelector("[action=searchInSelection]"); + this.replaceOption = sb.querySelector("[action=toggleReplace]"); + this.regExpOption = sb.querySelector("[action=toggleRegexpMode]"); + this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]"); + this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]"); + this.searchInput = this.searchBox.querySelector(".ace_search_field"); + this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); + this.searchCounter = sb.querySelector(".ace_search_counter"); + }; + + this.$init = function() { + var sb = this.element; + + this.$initElements(sb); + + var _this = this; + event.addListener(sb, "mousedown", function(e) { + setTimeout(function(){ + _this.activeInput.focus(); + }, 0); + event.stopPropagation(e); + }); + event.addListener(sb, "click", function(e) { + var t = e.target || e.srcElement; + var action = t.getAttribute("action"); + if (action && _this[action]) + _this[action](); + else if (_this.$searchBarKb.commands[action]) + _this.$searchBarKb.commands[action].exec(_this); + event.stopPropagation(e); + }); + + event.addCommandKeyListener(sb, function(e, hashId, keyCode) { + var keyString = keyUtil.keyCodeToString(keyCode); + var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); + if (command && command.exec) { + command.exec(_this); + event.stopEvent(e); + } + }); + + this.$onChange = lang.delayedCall(function() { + _this.find(false, false); + }); + + event.addListener(this.searchInput, "input", function() { + _this.$onChange.schedule(20); + }); + event.addListener(this.searchInput, "focus", function() { + _this.activeInput = _this.searchInput; + _this.searchInput.value && _this.highlight(); + }); + event.addListener(this.replaceInput, "focus", function() { + _this.activeInput = _this.replaceInput; + _this.searchInput.value && _this.highlight(); + }); + }; + this.$closeSearchBarKb = new HashHandler([{ + bindKey: "Esc", + name: "closeSearchBar", + exec: function(editor) { + editor.searchBox.hide(); + } + }]); + this.$searchBarKb = new HashHandler(); + this.$searchBarKb.bindKeys({ + "Ctrl-f|Command-f": function(sb) { + var isReplace = sb.isReplace = !sb.isReplace; + sb.replaceBox.style.display = isReplace ? "" : "none"; + sb.replaceOption.checked = false; + sb.$syncOptions(); + sb.searchInput.focus(); + }, + "Ctrl-H|Command-Option-F": function(sb) { + sb.replaceOption.checked = true; + sb.$syncOptions(); + sb.replaceInput.focus(); + }, + "Ctrl-G|Command-G": function(sb) { + sb.findNext(); + }, + "Ctrl-Shift-G|Command-Shift-G": function(sb) { + sb.findPrev(); + }, + "esc": function(sb) { + setTimeout(function() { sb.hide();}); + }, + "Return": function(sb) { + if (sb.activeInput == sb.replaceInput) + sb.replace(); + sb.findNext(); + }, + "Shift-Return": function(sb) { + if (sb.activeInput == sb.replaceInput) + sb.replace(); + sb.findPrev(); + }, + "Alt-Return": function(sb) { + if (sb.activeInput == sb.replaceInput) + sb.replaceAll(); + sb.findAll(); + }, + "Tab": function(sb) { + (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); + } + }); + + this.$searchBarKb.addCommands([{ + name: "toggleRegexpMode", + bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"}, + exec: function(sb) { + sb.regExpOption.checked = !sb.regExpOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleCaseSensitive", + bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"}, + exec: function(sb) { + sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleWholeWords", + bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"}, + exec: function(sb) { + sb.wholeWordOption.checked = !sb.wholeWordOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleReplace", + exec: function(sb) { + sb.replaceOption.checked = !sb.replaceOption.checked; + sb.$syncOptions(); + } + }, { + name: "searchInSelection", + exec: function(sb) { + sb.searchOption.checked = !sb.searchRange; + sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange()); + sb.$syncOptions(); + } + }]); + + this.setSearchRange = function(range) { + this.searchRange = range; + if (range) { + this.searchRangeMarker = this.editor.session.addMarker(range, "ace_active-line"); + } else if (this.searchRangeMarker) { + this.editor.session.removeMarker(this.searchRangeMarker); + this.searchRangeMarker = null; + } + } + + this.$syncOptions = function(preventScroll) { + dom.setCssClass(this.replaceOption, "checked", this.searchRange); + dom.setCssClass(this.searchOption, "checked", this.searchOption.checked); + this.replaceOption.textContent = this.replaceOption.checked ? "-" : "+"; + dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked); + dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked); + dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked); + this.replaceBox.style.display = this.replaceOption.checked ? "" : "none"; + this.find(false, false, preventScroll); + }; + + this.highlight = function(re) { + this.editor.session.highlight(re || this.editor.$search.$options.re); + this.editor.renderer.updateBackMarkers() + }; + this.find = function(skipCurrent, backwards, preventScroll) { + var range = this.editor.find(this.searchInput.value, { + skipCurrent: skipCurrent, + backwards: backwards, + wrap: true, + regExp: this.regExpOption.checked, + caseSensitive: this.caseSensitiveOption.checked, + wholeWord: this.wholeWordOption.checked, + preventScroll: preventScroll, + range: this.searchRange + }); + var noMatch = !range && this.searchInput.value; + dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); + this.editor._emit("findSearchBox", { match: !noMatch }); + this.highlight(); + this.updateCounter(); + }; + this.updateCounter = function() { + var editor = this.editor; + var regex = editor.$search.$options.re; + var all = 0; + var before = 0 + if (regex) { + var value = this.searchRange + ? editor.session.getTextRange(this.searchRange) + : editor.getValue(); + + var offset = editor.session.doc.positionToIndex(editor.selection.anchor); + if (this.searchRange) + offset -= editor.session.doc.positionToIndex(this.searchRange.start); + + var last = regex.lastIndex = 0; + var m; + while ((m = regex.exec(value))) { + all++; + last = m.index; + if (last <= offset) + before++; + if (all > MAX_COUNT) + break + if (!m[0]) { + regex.lastIndex = last += 1; + if (last >= value.length) + break; + } + } + } + this.searchCounter.textContent = before + " of " + (all > MAX_COUNT ? MAX_COUNT + "+" : all); + }; + this.findNext = function() { + this.find(true, false); + }; + this.findPrev = function() { + this.find(true, true); + }; + this.findAll = function(){ + var range = this.editor.findAll(this.searchInput.value, { + regExp: this.regExpOption.checked, + caseSensitive: this.caseSensitiveOption.checked, + wholeWord: this.wholeWordOption.checked + }); + var noMatch = !range && this.searchInput.value; + dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); + this.editor._emit("findSearchBox", { match: !noMatch }); + this.highlight(); + this.hide(); + }; + this.replace = function() { + if (!this.editor.getReadOnly()) + this.editor.replace(this.replaceInput.value); + }; + this.replaceAndFindNext = function() { + if (!this.editor.getReadOnly()) { + this.editor.replace(this.replaceInput.value); + this.findNext() + } + }; + this.replaceAll = function() { + if (!this.editor.getReadOnly()) + this.editor.replaceAll(this.replaceInput.value); + }; + + this.hide = function() { + this.active = false; + this.setSearchRange(null) + this.editor.off("changeSession", this.setSession); + + this.element.style.display = "none"; + this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); + this.editor.focus(); + }; + this.show = function(value, isReplace) { + this.active = true; + this.editor.on("changeSession", this.setSession); + this.element.style.display = ""; + this.replaceOption.checked = isReplace; + + if (value) + this.searchInput.value = value; + + this.searchInput.focus(); + this.searchInput.select(); + + this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); + + this.$syncOptions(true); + }; + + this.isFocused = function() { + var el = document.activeElement; + return el == this.searchInput || el == this.replaceInput; + } +}).call(SearchBox.prototype); + +exports.SearchBox = SearchBox; + +exports.Search = function(editor, isReplace) { + var sb = editor.searchBox || new SearchBox(editor); + sb.show(editor.session.getTextRange(), isReplace); +}; + +}); + (function() { + ace.require(["ace/ext/searchbox"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-settings_menu.js b/htdocs/includes/ace/ext-settings_menu.js new file mode 100644 index 00000000000..a00b28f88a1 --- /dev/null +++ b/htdocs/includes/ace/ext-settings_menu.js @@ -0,0 +1,663 @@ +ace.define("ace/ext/menu_tools/element_generator",["require","exports","module"], function(require, exports, module) { +'use strict'; +module.exports.createOption = function createOption (obj) { + var attribute; + var el = document.createElement('option'); + for(attribute in obj) { + if(obj.hasOwnProperty(attribute)) { + if(attribute === 'selected') { + el.setAttribute(attribute, obj[attribute]); + } else { + el[attribute] = obj[attribute]; + } + } + } + return el; +}; +module.exports.createCheckbox = function createCheckbox (id, checked, clss) { + var el = document.createElement('input'); + el.setAttribute('type', 'checkbox'); + el.setAttribute('id', id); + el.setAttribute('name', id); + el.setAttribute('value', checked); + el.setAttribute('class', clss); + if(checked) { + el.setAttribute('checked', 'checked'); + } + return el; +}; +module.exports.createInput = function createInput (id, value, clss) { + var el = document.createElement('input'); + el.setAttribute('type', 'text'); + el.setAttribute('id', id); + el.setAttribute('name', id); + el.setAttribute('value', value); + el.setAttribute('class', clss); + return el; +}; +module.exports.createLabel = function createLabel (text, labelFor) { + var el = document.createElement('label'); + el.setAttribute('for', labelFor); + el.textContent = text; + return el; +}; +module.exports.createSelection = function createSelection (id, values, clss) { + var el = document.createElement('select'); + el.setAttribute('id', id); + el.setAttribute('name', id); + el.setAttribute('class', clss); + values.forEach(function(item) { + el.appendChild(module.exports.createOption(item)); + }); + return el; +}; + +}); + +ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var modes = []; +function getModeForPath(path) { + var mode = modesByName.text; + var fileName = path.split(/[\/\\]/).pop(); + for (var i = 0; i < modes.length; i++) { + if (modes[i].supportsFile(fileName)) { + mode = modes[i]; + break; + } + } + return mode; +} + +var Mode = function(name, caption, extensions) { + this.name = name; + this.caption = caption; + this.mode = "ace/mode/" + name; + this.extensions = extensions; + var re; + if (/\^/.test(extensions)) { + re = extensions.replace(/\|(\^)?/g, function(a, b){ + return "$|" + (b ? "^" : "^.*\\."); + }) + "$"; + } else { + re = "^.*\\.(" + extensions + ")$"; + } + + this.extRe = new RegExp(re, "gi"); +}; + +Mode.prototype.supportsFile = function(filename) { + return filename.match(this.extRe); +}; +var supportedModes = { + ABAP: ["abap"], + ABC: ["abc"], + ActionScript:["as"], + ADA: ["ada|adb"], + Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], + AsciiDoc: ["asciidoc|adoc"], + Assembly_x86:["asm|a"], + AutoHotKey: ["ahk"], + BatchFile: ["bat|cmd"], + Bro: ["bro"], + C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"], + C9Search: ["c9search_results"], + Cirru: ["cirru|cr"], + Clojure: ["clj|cljs"], + Cobol: ["CBL|COB"], + coffee: ["coffee|cf|cson|^Cakefile"], + ColdFusion: ["cfm"], + CSharp: ["cs"], + CSS: ["css"], + Curly: ["curly"], + D: ["d|di"], + Dart: ["dart"], + Diff: ["diff|patch"], + Dockerfile: ["^Dockerfile"], + Dot: ["dot"], + Drools: ["drl"], + Dummy: ["dummy"], + DummySyntax: ["dummy"], + Eiffel: ["e|ge"], + EJS: ["ejs"], + Elixir: ["ex|exs"], + Elm: ["elm"], + Erlang: ["erl|hrl"], + Forth: ["frt|fs|ldr|fth|4th"], + Fortran: ["f|f90"], + FTL: ["ftl"], + Gcode: ["gcode"], + Gherkin: ["feature"], + Gitignore: ["^.gitignore"], + Glsl: ["glsl|frag|vert"], + Gobstones: ["gbs"], + golang: ["go"], + GraphQLSchema: ["gql"], + Groovy: ["groovy"], + HAML: ["haml"], + Handlebars: ["hbs|handlebars|tpl|mustache"], + Haskell: ["hs"], + Haskell_Cabal: ["cabal"], + haXe: ["hx"], + Hjson: ["hjson"], + HTML: ["html|htm|xhtml"], + HTML_Elixir: ["eex|html.eex"], + HTML_Ruby: ["erb|rhtml|html.erb"], + INI: ["ini|conf|cfg|prefs"], + Io: ["io"], + Jack: ["jack"], + Jade: ["jade|pug"], + Java: ["java"], + JavaScript: ["js|jsm|jsx"], + JSON: ["json"], + JSONiq: ["jq"], + JSP: ["jsp"], + JSX: ["jsx"], + Julia: ["jl"], + Kotlin: ["kt|kts"], + LaTeX: ["tex|latex|ltx|bib"], + LESS: ["less"], + Liquid: ["liquid"], + Lisp: ["lisp"], + LiveScript: ["ls"], + LogiQL: ["logic|lql"], + LSL: ["lsl"], + Lua: ["lua"], + LuaPage: ["lp"], + Lucene: ["lucene"], + Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], + Markdown: ["md|markdown"], + Mask: ["mask"], + MATLAB: ["matlab"], + Maze: ["mz"], + MEL: ["mel"], + MUSHCode: ["mc|mush"], + MySQL: ["mysql"], + Nix: ["nix"], + NSIS: ["nsi|nsh"], + ObjectiveC: ["m|mm"], + OCaml: ["ml|mli"], + Pascal: ["pas|p"], + Perl: ["pl|pm"], + pgSQL: ["pgsql"], + PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"], + Pig: ["pig"], + Powershell: ["ps1"], + Praat: ["praat|praatscript|psc|proc"], + Prolog: ["plg|prolog"], + Properties: ["properties"], + Protobuf: ["proto"], + Python: ["py"], + R: ["r"], + Razor: ["cshtml|asp"], + RDoc: ["Rd"], + RHTML: ["Rhtml"], + RST: ["rst"], + Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], + Rust: ["rs"], + SASS: ["sass"], + SCAD: ["scad"], + Scala: ["scala"], + Scheme: ["scm|sm|rkt|oak|scheme"], + SCSS: ["scss"], + SH: ["sh|bash|^.bashrc"], + SJS: ["sjs"], + Smarty: ["smarty|tpl"], + snippets: ["snippets"], + Soy_Template:["soy"], + Space: ["space"], + SQL: ["sql"], + SQLServer: ["sqlserver"], + Stylus: ["styl|stylus"], + SVG: ["svg"], + Swift: ["swift"], + Tcl: ["tcl"], + Tex: ["tex"], + Text: ["txt"], + Textile: ["textile"], + Toml: ["toml"], + TSX: ["tsx"], + Twig: ["twig|swig"], + Typescript: ["ts|typescript|str"], + Vala: ["vala"], + VBScript: ["vbs|vb"], + Velocity: ["vm"], + Verilog: ["v|vh|sv|svh"], + VHDL: ["vhd|vhdl"], + Wollok: ["wlk|wpgm|wtest"], + XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"], + XQuery: ["xq"], + YAML: ["yaml|yml"], + Django: ["html"] +}; + +var nameOverrides = { + ObjectiveC: "Objective-C", + CSharp: "C#", + golang: "Go", + C_Cpp: "C and C++", + coffee: "CoffeeScript", + HTML_Ruby: "HTML (Ruby)", + HTML_Elixir: "HTML (Elixir)", + FTL: "FreeMarker" +}; +var modesByName = {}; +for (var name in supportedModes) { + var data = supportedModes[name]; + var displayName = (nameOverrides[name] || name).replace(/_/g, " "); + var filename = name.toLowerCase(); + var mode = new Mode(filename, displayName, data[0]); + modesByName[filename] = mode; + modes.push(mode); +} + +module.exports = { + getModeForPath: getModeForPath, + modes: modes, + modesByName: modesByName +}; + +}); + +ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) { +"use strict"; +require("ace/lib/fixoldbrowsers"); + +var themeData = [ + ["Chrome" ], + ["Clouds" ], + ["Crimson Editor" ], + ["Dawn" ], + ["Dreamweaver" ], + ["Eclipse" ], + ["GitHub" ], + ["IPlastic" ], + ["Solarized Light"], + ["TextMate" ], + ["Tomorrow" ], + ["XCode" ], + ["Kuroir"], + ["KatzenMilch"], + ["SQL Server" ,"sqlserver" , "light"], + ["Ambiance" ,"ambiance" , "dark"], + ["Chaos" ,"chaos" , "dark"], + ["Clouds Midnight" ,"clouds_midnight" , "dark"], + ["Cobalt" ,"cobalt" , "dark"], + ["Gruvbox" ,"gruvbox" , "dark"], + ["Green on Black" ,"gob" , "dark"], + ["idle Fingers" ,"idle_fingers" , "dark"], + ["krTheme" ,"kr_theme" , "dark"], + ["Merbivore" ,"merbivore" , "dark"], + ["Merbivore Soft" ,"merbivore_soft" , "dark"], + ["Mono Industrial" ,"mono_industrial" , "dark"], + ["Monokai" ,"monokai" , "dark"], + ["Pastel on dark" ,"pastel_on_dark" , "dark"], + ["Solarized Dark" ,"solarized_dark" , "dark"], + ["Terminal" ,"terminal" , "dark"], + ["Tomorrow Night" ,"tomorrow_night" , "dark"], + ["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"], + ["Tomorrow Night Bright","tomorrow_night_bright" , "dark"], + ["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"], + ["Twilight" ,"twilight" , "dark"], + ["Vibrant Ink" ,"vibrant_ink" , "dark"] +]; + + +exports.themesByName = {}; +exports.themes = themeData.map(function(data) { + var name = data[1] || data[0].replace(/ /g, "_").toLowerCase(); + var theme = { + caption: data[0], + theme: "ace/theme/" + name, + isDark: data[2] == "dark", + name: name + }; + exports.themesByName[name] = theme; + return theme; +}); + +}); + +ace.define("ace/ext/menu_tools/add_editor_menu_options",["require","exports","module","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module) { +'use strict'; +module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) { + var modelist = require('../modelist'); + var themelist = require('../themelist'); + editor.menuOptions = { + setNewLineMode: [{ + textContent: "unix", + value: "unix" + }, { + textContent: "windows", + value: "windows" + }, { + textContent: "auto", + value: "auto" + }], + setTheme: [], + setMode: [], + setKeyboardHandler: [{ + textContent: "ace", + value: "" + }, { + textContent: "vim", + value: "ace/keyboard/vim" + }, { + textContent: "emacs", + value: "ace/keyboard/emacs" + }, { + textContent: "textarea", + value: "ace/keyboard/textarea" + }, { + textContent: "sublime", + value: "ace/keyboard/sublime" + }] + }; + + editor.menuOptions.setTheme = themelist.themes.map(function(theme) { + return { + textContent: theme.caption, + value: theme.theme + }; + }); + + editor.menuOptions.setMode = modelist.modes.map(function(mode) { + return { + textContent: mode.name, + value: mode.mode + }; + }); +}; + + +}); + +ace.define("ace/ext/menu_tools/get_set_functions",["require","exports","module"], function(require, exports, module) { +'use strict'; +module.exports.getSetFunctions = function getSetFunctions (editor) { + var out = []; + var my = { + 'editor' : editor, + 'session' : editor.session, + 'renderer' : editor.renderer + }; + var opts = []; + var skip = [ + 'setOption', + 'setUndoManager', + 'setDocument', + 'setValue', + 'setBreakpoints', + 'setScrollTop', + 'setScrollLeft', + 'setSelectionStyle', + 'setWrapLimitRange' + ]; + ['renderer', 'session', 'editor'].forEach(function(esra) { + var esr = my[esra]; + var clss = esra; + for(var fn in esr) { + if(skip.indexOf(fn) === -1) { + if(/^set/.test(fn) && opts.indexOf(fn) === -1) { + opts.push(fn); + out.push({ + 'functionName' : fn, + 'parentObj' : esr, + 'parentName' : clss + }); + } + } + } + }); + return out; +}; + +}); + +ace.define("ace/ext/menu_tools/generate_settings_menu",["require","exports","module","ace/ext/menu_tools/element_generator","ace/ext/menu_tools/add_editor_menu_options","ace/ext/menu_tools/get_set_functions","ace/ace"], function(require, exports, module) { +'use strict'; +var egen = require('./element_generator'); +var addEditorMenuOptions = require('./add_editor_menu_options').addEditorMenuOptions; +var getSetFunctions = require('./get_set_functions').getSetFunctions; +module.exports.generateSettingsMenu = function generateSettingsMenu (editor) { + var elements = []; + function cleanupElementsList() { + elements.sort(function(a, b) { + var x = a.getAttribute('contains'); + var y = b.getAttribute('contains'); + return x.localeCompare(y); + }); + } + function wrapElements() { + var topmenu = document.createElement('div'); + topmenu.setAttribute('id', 'ace_settingsmenu'); + elements.forEach(function(element) { + topmenu.appendChild(element); + }); + + var el = topmenu.appendChild(document.createElement('div')); + var version = require("../../ace").version; + el.style.padding = "1em"; + el.textContent = "Ace version " + version; + + return topmenu; + } + function createNewEntry(obj, clss, item, val) { + var el; + var div = document.createElement('div'); + div.setAttribute('contains', item); + div.setAttribute('class', 'ace_optionsMenuEntry'); + div.setAttribute('style', 'clear: both;'); + + div.appendChild(egen.createLabel( + item.replace(/^set/, '').replace(/([A-Z])/g, ' $1').trim(), + item + )); + + if (Array.isArray(val)) { + el = egen.createSelection(item, val, clss); + el.addEventListener('change', function(e) { + try{ + editor.menuOptions[e.target.id].forEach(function(x) { + if(x.textContent !== e.target.textContent) { + delete x.selected; + } + }); + obj[e.target.id](e.target.value); + } catch (err) { + throw new Error(err); + } + }); + } else if(typeof val === 'boolean') { + el = egen.createCheckbox(item, val, clss); + el.addEventListener('change', function(e) { + try{ + obj[e.target.id](!!e.target.checked); + } catch (err) { + throw new Error(err); + } + }); + } else { + el = egen.createInput(item, val, clss); + el.addEventListener('change', function(e) { + try{ + if(e.target.value === 'true') { + obj[e.target.id](true); + } else if(e.target.value === 'false') { + obj[e.target.id](false); + } else { + obj[e.target.id](e.target.value); + } + } catch (err) { + throw new Error(err); + } + }); + } + el.style.cssText = 'float:right;'; + div.appendChild(el); + return div; + } + function makeDropdown(item, esr, clss, fn) { + var val = editor.menuOptions[item]; + var currentVal = esr[fn](); + if (typeof currentVal == 'object') + currentVal = currentVal.$id; + val.forEach(function(valuex) { + if (valuex.value === currentVal) + valuex.selected = 'selected'; + }); + return createNewEntry(esr, clss, item, val); + } + function handleSet(setObj) { + var item = setObj.functionName; + var esr = setObj.parentObj; + var clss = setObj.parentName; + var val; + var fn = item.replace(/^set/, 'get'); + if(editor.menuOptions[item] !== undefined) { + elements.push(makeDropdown(item, esr, clss, fn)); + } else if(typeof esr[fn] === 'function') { + try { + val = esr[fn](); + if(typeof val === 'object') { + val = val.$id; + } + elements.push( + createNewEntry(esr, clss, item, val) + ); + } catch (e) { + } + } + } + addEditorMenuOptions(editor); + getSetFunctions(editor).forEach(function(setObj) { + handleSet(setObj); + }); + cleanupElementsList(); + return wrapElements(); +}; + +}); + +ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +'use strict'; +var dom = require("../../lib/dom"); +var cssText = "#ace_settingsmenu, #kbshortcutmenu {\ +background-color: #F7F7F7;\ +color: black;\ +box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\ +padding: 1em 0.5em 2em 1em;\ +overflow: auto;\ +position: absolute;\ +margin: 0;\ +bottom: 0;\ +right: 0;\ +top: 0;\ +z-index: 9991;\ +cursor: default;\ +}\ +.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\ +box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\ +background-color: rgba(255, 255, 255, 0.6);\ +color: black;\ +}\ +.ace_optionsMenuEntry:hover {\ +background-color: rgba(100, 100, 100, 0.1);\ +-webkit-transition: all 0.5s;\ +transition: all 0.3s\ +}\ +.ace_closeButton {\ +background: rgba(245, 146, 146, 0.5);\ +border: 1px solid #F48A8A;\ +border-radius: 50%;\ +padding: 7px;\ +position: absolute;\ +right: -8px;\ +top: -8px;\ +z-index: 1000;\ +}\ +.ace_closeButton{\ +background: rgba(245, 146, 146, 0.9);\ +}\ +.ace_optionsMenuKey {\ +color: darkslateblue;\ +font-weight: bold;\ +}\ +.ace_optionsMenuCommand {\ +color: darkcyan;\ +font-weight: normal;\ +}"; +dom.importCssString(cssText); +module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) { + top = top ? 'top: ' + top + ';' : ''; + bottom = bottom ? 'bottom: ' + bottom + ';' : ''; + right = right ? 'right: ' + right + ';' : ''; + left = left ? 'left: ' + left + ';' : ''; + + var closer = document.createElement('div'); + var contentContainer = document.createElement('div'); + + function documentEscListener(e) { + if (e.keyCode === 27) { + closer.click(); + } + } + + closer.style.cssText = 'margin: 0; padding: 0; ' + + 'position: fixed; top:0; bottom:0; left:0; right:0;' + + 'z-index: 9990; ' + + 'background-color: rgba(0, 0, 0, 0.3);'; + closer.addEventListener('click', function() { + document.removeEventListener('keydown', documentEscListener); + closer.parentNode.removeChild(closer); + editor.focus(); + closer = null; + }); + document.addEventListener('keydown', documentEscListener); + + contentContainer.style.cssText = top + right + bottom + left; + contentContainer.addEventListener('click', function(e) { + e.stopPropagation(); + }); + + var wrapper = dom.createElement("div"); + wrapper.style.position = "relative"; + + var closeButton = dom.createElement("div"); + closeButton.className = "ace_closeButton"; + closeButton.addEventListener('click', function() { + closer.click(); + }); + + wrapper.appendChild(closeButton); + contentContainer.appendChild(wrapper); + + contentContainer.appendChild(contentElement); + closer.appendChild(contentContainer); + document.body.appendChild(closer); + editor.blur(); +}; + +}); + +ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/menu_tools/generate_settings_menu","ace/ext/menu_tools/overlay_page","ace/editor"], function(require, exports, module) { +"use strict"; +var generateSettingsMenu = require('./menu_tools/generate_settings_menu').generateSettingsMenu; +var overlayPage = require('./menu_tools/overlay_page').overlayPage; +function showSettingsMenu(editor) { + var sm = document.getElementById('ace_settingsmenu'); + if (!sm) + overlayPage(editor, generateSettingsMenu(editor), '0', '0', '0'); +} +module.exports.init = function(editor) { + var Editor = require("ace/editor").Editor; + Editor.prototype.showSettingsMenu = function() { + showSettingsMenu(this); + }; +}; +}); + (function() { + ace.require(["ace/ext/settings_menu"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-spellcheck.js b/htdocs/includes/ace/ext-spellcheck.js new file mode 100644 index 00000000000..8d3b5f6cb11 --- /dev/null +++ b/htdocs/includes/ace/ext-spellcheck.js @@ -0,0 +1,71 @@ +ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"], function(require, exports, module) { +"use strict"; +var event = require("../lib/event"); + +exports.contextMenuHandler = function(e){ + var host = e.target; + var text = host.textInput.getElement(); + if (!host.selection.isEmpty()) + return; + var c = host.getCursorPosition(); + var r = host.session.getWordRange(c.row, c.column); + var w = host.session.getTextRange(r); + + host.session.tokenRe.lastIndex = 0; + if (!host.session.tokenRe.test(w)) + return; + var PLACEHOLDER = "\x01\x01"; + var value = w + " " + PLACEHOLDER; + text.value = value; + text.setSelectionRange(w.length, w.length + 1); + text.setSelectionRange(0, 0); + text.setSelectionRange(0, w.length); + + var afterKeydown = false; + event.addListener(text, "keydown", function onKeydown() { + event.removeListener(text, "keydown", onKeydown); + afterKeydown = true; + }); + + host.textInput.setInputHandler(function(newVal) { + console.log(newVal , value, text.selectionStart, text.selectionEnd) + if (newVal == value) + return ''; + if (newVal.lastIndexOf(value, 0) === 0) + return newVal.slice(value.length); + if (newVal.substr(text.selectionEnd) == value) + return newVal.slice(0, -value.length); + if (newVal.slice(-2) == PLACEHOLDER) { + var val = newVal.slice(0, -2); + if (val.slice(-1) == " ") { + if (afterKeydown) + return val.substring(0, text.selectionEnd); + val = val.slice(0, -1); + host.session.replace(r, val); + return ""; + } + } + + return newVal; + }); +}; +var Editor = require("../editor").Editor; +require("../config").defineOptions(Editor.prototype, "editor", { + spellcheck: { + set: function(val) { + var text = this.textInput.getElement(); + text.spellcheck = !!val; + if (!val) + this.removeListener("nativecontextmenu", exports.contextMenuHandler); + else + this.on("nativecontextmenu", exports.contextMenuHandler); + }, + value: true + } +}); + +}); + (function() { + ace.require(["ace/ext/spellcheck"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-split.js b/htdocs/includes/ace/ext-split.js new file mode 100644 index 00000000000..29dd20efbea --- /dev/null +++ b/htdocs/includes/ace/ext-split.js @@ -0,0 +1,246 @@ +ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var lang = require("./lib/lang"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; + +var Editor = require("./editor").Editor; +var Renderer = require("./virtual_renderer").VirtualRenderer; +var EditSession = require("./edit_session").EditSession; + + +var Split = function(container, theme, splits) { + this.BELOW = 1; + this.BESIDE = 0; + + this.$container = container; + this.$theme = theme; + this.$splits = 0; + this.$editorCSS = ""; + this.$editors = []; + this.$orientation = this.BESIDE; + + this.setSplits(splits || 1); + this.$cEditor = this.$editors[0]; + + + this.on("focus", function(editor) { + this.$cEditor = editor; + }.bind(this)); +}; + +(function(){ + + oop.implement(this, EventEmitter); + + this.$createEditor = function() { + var el = document.createElement("div"); + el.className = this.$editorCSS; + el.style.cssText = "position: absolute; top:0px; bottom:0px"; + this.$container.appendChild(el); + var editor = new Editor(new Renderer(el, this.$theme)); + + editor.on("focus", function() { + this._emit("focus", editor); + }.bind(this)); + + this.$editors.push(editor); + editor.setFontSize(this.$fontSize); + return editor; + }; + + this.setSplits = function(splits) { + var editor; + if (splits < 1) { + throw "The number of splits have to be > 0!"; + } + + if (splits == this.$splits) { + return; + } else if (splits > this.$splits) { + while (this.$splits < this.$editors.length && this.$splits < splits) { + editor = this.$editors[this.$splits]; + this.$container.appendChild(editor.container); + editor.setFontSize(this.$fontSize); + this.$splits ++; + } + while (this.$splits < splits) { + this.$createEditor(); + this.$splits ++; + } + } else { + while (this.$splits > splits) { + editor = this.$editors[this.$splits - 1]; + this.$container.removeChild(editor.container); + this.$splits --; + } + } + this.resize(); + }; + this.getSplits = function() { + return this.$splits; + }; + this.getEditor = function(idx) { + return this.$editors[idx]; + }; + this.getCurrentEditor = function() { + return this.$cEditor; + }; + this.focus = function() { + this.$cEditor.focus(); + }; + this.blur = function() { + this.$cEditor.blur(); + }; + this.setTheme = function(theme) { + this.$editors.forEach(function(editor) { + editor.setTheme(theme); + }); + }; + this.setKeyboardHandler = function(keybinding) { + this.$editors.forEach(function(editor) { + editor.setKeyboardHandler(keybinding); + }); + }; + this.forEach = function(callback, scope) { + this.$editors.forEach(callback, scope); + }; + + + this.$fontSize = ""; + this.setFontSize = function(size) { + this.$fontSize = size; + this.forEach(function(editor) { + editor.setFontSize(size); + }); + }; + + this.$cloneSession = function(session) { + var s = new EditSession(session.getDocument(), session.getMode()); + + var undoManager = session.getUndoManager(); + if (undoManager) { + var undoManagerProxy = new UndoManagerProxy(undoManager, s); + s.setUndoManager(undoManagerProxy); + } + s.$informUndoManager = lang.delayedCall(function() { s.$deltas = []; }); + s.setTabSize(session.getTabSize()); + s.setUseSoftTabs(session.getUseSoftTabs()); + s.setOverwrite(session.getOverwrite()); + s.setBreakpoints(session.getBreakpoints()); + s.setUseWrapMode(session.getUseWrapMode()); + s.setUseWorker(session.getUseWorker()); + s.setWrapLimitRange(session.$wrapLimitRange.min, + session.$wrapLimitRange.max); + s.$foldData = session.$cloneFoldData(); + + return s; + }; + this.setSession = function(session, idx) { + var editor; + if (idx == null) { + editor = this.$cEditor; + } else { + editor = this.$editors[idx]; + } + var isUsed = this.$editors.some(function(editor) { + return editor.session === session; + }); + + if (isUsed) { + session = this.$cloneSession(session); + } + editor.setSession(session); + return session; + }; + this.getOrientation = function() { + return this.$orientation; + }; + this.setOrientation = function(orientation) { + if (this.$orientation == orientation) { + return; + } + this.$orientation = orientation; + this.resize(); + }; + this.resize = function() { + var width = this.$container.clientWidth; + var height = this.$container.clientHeight; + var editor; + + if (this.$orientation == this.BESIDE) { + var editorWidth = width / this.$splits; + for (var i = 0; i < this.$splits; i++) { + editor = this.$editors[i]; + editor.container.style.width = editorWidth + "px"; + editor.container.style.top = "0px"; + editor.container.style.left = i * editorWidth + "px"; + editor.container.style.height = height + "px"; + editor.resize(); + } + } else { + var editorHeight = height / this.$splits; + for (var i = 0; i < this.$splits; i++) { + editor = this.$editors[i]; + editor.container.style.width = width + "px"; + editor.container.style.top = i * editorHeight + "px"; + editor.container.style.left = "0px"; + editor.container.style.height = editorHeight + "px"; + editor.resize(); + } + } + }; + +}).call(Split.prototype); + + +function UndoManagerProxy(undoManager, session) { + this.$u = undoManager; + this.$doc = session; +} + +(function() { + this.execute = function(options) { + this.$u.execute(options); + }; + + this.undo = function() { + var selectionRange = this.$u.undo(true); + if (selectionRange) { + this.$doc.selection.setSelectionRange(selectionRange); + } + }; + + this.redo = function() { + var selectionRange = this.$u.redo(true); + if (selectionRange) { + this.$doc.selection.setSelectionRange(selectionRange); + } + }; + + this.reset = function() { + this.$u.reset(); + }; + + this.hasUndo = function() { + return this.$u.hasUndo(); + }; + + this.hasRedo = function() { + return this.$u.hasRedo(); + }; +}).call(UndoManagerProxy.prototype); + +exports.Split = Split; +}); + +ace.define("ace/ext/split",["require","exports","module","ace/split"], function(require, exports, module) { +"use strict"; +module.exports = require("../split"); + +}); + (function() { + ace.require(["ace/ext/split"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-static_highlight.js b/htdocs/includes/ace/ext-static_highlight.js new file mode 100644 index 00000000000..a875f9d7a01 --- /dev/null +++ b/htdocs/includes/ace/ext-static_highlight.js @@ -0,0 +1,161 @@ +ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +var EditSession = require("../edit_session").EditSession; +var TextLayer = require("../layer/text").Text; +var baseStyles = ".ace_static_highlight {\ +font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\ +font-size: 12px;\ +white-space: pre-wrap\ +}\ +.ace_static_highlight .ace_gutter {\ +width: 2em;\ +text-align: right;\ +padding: 0 3px 0 0;\ +margin-right: 3px;\ +}\ +.ace_static_highlight.ace_show_gutter .ace_line {\ +padding-left: 2.6em;\ +}\ +.ace_static_highlight .ace_line { position: relative; }\ +.ace_static_highlight .ace_gutter-cell {\ +-moz-user-select: -moz-none;\ +-khtml-user-select: none;\ +-webkit-user-select: none;\ +user-select: none;\ +top: 0;\ +bottom: 0;\ +left: 0;\ +position: absolute;\ +}\ +.ace_static_highlight .ace_gutter-cell:before {\ +content: counter(ace_line, decimal);\ +counter-increment: ace_line;\ +}\ +.ace_static_highlight {\ +counter-reset: ace_line;\ +}\ +"; +var config = require("../config"); +var dom = require("../lib/dom"); + +var SimpleTextLayer = function() { + this.config = {}; +}; +SimpleTextLayer.prototype = TextLayer.prototype; + +var highlight = function(el, opts, callback) { + var m = el.className.match(/lang-(\w+)/); + var mode = opts.mode || m && ("ace/mode/" + m[1]); + if (!mode) + return false; + var theme = opts.theme || "ace/theme/textmate"; + + var data = ""; + var nodes = []; + + if (el.firstElementChild) { + var textLen = 0; + for (var i = 0; i < el.childNodes.length; i++) { + var ch = el.childNodes[i]; + if (ch.nodeType == 3) { + textLen += ch.data.length; + data += ch.data; + } else { + nodes.push(textLen, ch); + } + } + } else { + data = dom.getInnerText(el); + if (opts.trim) + data = data.trim(); + } + + highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) { + dom.importCssString(highlighted.css, "ace_highlight"); + el.innerHTML = highlighted.html; + var container = el.firstChild.firstChild; + for (var i = 0; i < nodes.length; i += 2) { + var pos = highlighted.session.doc.indexToPosition(nodes[i]); + var node = nodes[i + 1]; + var lineEl = container.children[pos.row]; + lineEl && lineEl.appendChild(node); + } + callback && callback(); + }); +}; +highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) { + var waiting = 1; + var modeCache = EditSession.prototype.$modes; + if (typeof theme == "string") { + waiting++; + config.loadModule(['theme', theme], function(m) { + theme = m; + --waiting || done(); + }); + } + var modeOptions; + if (mode && typeof mode === "object" && !mode.getTokenizer) { + modeOptions = mode; + mode = modeOptions.path; + } + if (typeof mode == "string") { + waiting++; + config.loadModule(['mode', mode], function(m) { + if (!modeCache[mode] || modeOptions) + modeCache[mode] = new m.Mode(modeOptions); + mode = modeCache[mode]; + --waiting || done(); + }); + } + function done() { + var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter); + return callback ? callback(result) : result; + } + return --waiting || done(); +}; +highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) { + lineStart = parseInt(lineStart || 1, 10); + + var session = new EditSession(""); + session.setUseWorker(false); + session.setMode(mode); + + var textLayer = new SimpleTextLayer(); + textLayer.setSession(session); + + session.setValue(input); + + var stringBuilder = []; + var length = session.getLength(); + + for(var ix = 0; ix < length; ix++) { + stringBuilder.push("
        "); + if (!disableGutter) + stringBuilder.push("" + /*(ix + lineStart) + */ ""); + textLayer.$renderLine(stringBuilder, ix, true, false); + stringBuilder.push("\n
        "); + } + var html = "
        " + + "
        " + + stringBuilder.join("") + + "
        " + + "
        "; + + textLayer.destroy(); + + return { + css: baseStyles + theme.cssText, + html: html, + session: session + }; +}; + +module.exports = highlight; +module.exports.highlight = highlight; +}); + (function() { + ace.require(["ace/ext/static_highlight"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-statusbar.js b/htdocs/includes/ace/ext-statusbar.js new file mode 100644 index 00000000000..0c46b3812e3 --- /dev/null +++ b/htdocs/includes/ace/ext-statusbar.js @@ -0,0 +1,53 @@ +ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"], function(require, exports, module) { +"use strict"; +var dom = require("ace/lib/dom"); +var lang = require("ace/lib/lang"); + +var StatusBar = function(editor, parentNode) { + this.element = dom.createElement("div"); + this.element.className = "ace_status-indicator"; + this.element.style.cssText = "display: inline-block;"; + parentNode.appendChild(this.element); + + var statusUpdate = lang.delayedCall(function(){ + this.updateStatus(editor) + }.bind(this)).schedule.bind(null, 100); + + editor.on("changeStatus", statusUpdate); + editor.on("changeSelection", statusUpdate); + editor.on("keyboardActivity", statusUpdate); +}; + +(function(){ + this.updateStatus = function(editor) { + var status = []; + function add(str, separator) { + str && status.push(str, separator || "|"); + } + + add(editor.keyBinding.getStatusText(editor)); + if (editor.commands.recording) + add("REC"); + + var sel = editor.selection; + var c = sel.lead; + + if (!sel.isEmpty()) { + var r = editor.getSelectionRange(); + add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")", " "); + } + add(c.row + ":" + c.column, " "); + if (sel.rangeCount) + add("[" + sel.rangeCount + "]", " "); + status.pop(); + this.element.textContent = status.join(""); + }; +}).call(StatusBar.prototype); + +exports.StatusBar = StatusBar; + +}); + (function() { + ace.require(["ace/ext/statusbar"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-textarea.js b/htdocs/includes/ace/ext-textarea.js new file mode 100644 index 00000000000..f3bc70afda1 --- /dev/null +++ b/htdocs/includes/ace/ext-textarea.js @@ -0,0 +1,560 @@ +ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +exports.isDark = false; +exports.cssClass = "ace-tm"; +exports.cssText = ".ace-tm .ace_gutter {\ +background: #f0f0f0;\ +color: #333;\ +}\ +.ace-tm .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-tm .ace_fold {\ +background-color: #6B72E6;\ +}\ +.ace-tm {\ +background-color: #FFFFFF;\ +color: black;\ +}\ +.ace-tm .ace_cursor {\ +color: black;\ +}\ +.ace-tm .ace_invisible {\ +color: rgb(191, 191, 191);\ +}\ +.ace-tm .ace_storage,\ +.ace-tm .ace_keyword {\ +color: blue;\ +}\ +.ace-tm .ace_constant {\ +color: rgb(197, 6, 11);\ +}\ +.ace-tm .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-tm .ace_constant.ace_language {\ +color: rgb(88, 92, 246);\ +}\ +.ace-tm .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-tm .ace_invalid {\ +background-color: rgba(255, 0, 0, 0.1);\ +color: red;\ +}\ +.ace-tm .ace_support.ace_function {\ +color: rgb(60, 76, 114);\ +}\ +.ace-tm .ace_support.ace_constant {\ +color: rgb(6, 150, 14);\ +}\ +.ace-tm .ace_support.ace_type,\ +.ace-tm .ace_support.ace_class {\ +color: rgb(109, 121, 222);\ +}\ +.ace-tm .ace_keyword.ace_operator {\ +color: rgb(104, 118, 135);\ +}\ +.ace-tm .ace_string {\ +color: rgb(3, 106, 7);\ +}\ +.ace-tm .ace_comment {\ +color: rgb(76, 136, 107);\ +}\ +.ace-tm .ace_comment.ace_doc {\ +color: rgb(0, 102, 255);\ +}\ +.ace-tm .ace_comment.ace_doc.ace_tag {\ +color: rgb(128, 159, 191);\ +}\ +.ace-tm .ace_constant.ace_numeric {\ +color: rgb(0, 0, 205);\ +}\ +.ace-tm .ace_variable {\ +color: rgb(49, 132, 149);\ +}\ +.ace-tm .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-tm .ace_entity.ace_name.ace_function {\ +color: #0000A2;\ +}\ +.ace-tm .ace_heading {\ +color: rgb(12, 7, 255);\ +}\ +.ace-tm .ace_list {\ +color:rgb(185, 6, 144);\ +}\ +.ace-tm .ace_meta.ace_tag {\ +color:rgb(0, 22, 142);\ +}\ +.ace-tm .ace_string.ace_regex {\ +color: rgb(255, 0, 0)\ +}\ +.ace-tm .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-tm.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px white;\ +}\ +.ace-tm .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-tm .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-tm .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-tm .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.07);\ +}\ +.ace-tm .ace_gutter-active-line {\ +background-color : #dcdcdc;\ +}\ +.ace-tm .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-tm .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); + +ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"], function(require, exports, module) { +"use strict"; + +var event = require("../lib/event"); +var UA = require("../lib/useragent"); +var net = require("../lib/net"); +var ace = require("../ace"); + +require("../theme/textmate"); + +module.exports = exports = ace; +var getCSSProperty = function(element, container, property) { + var ret = element.style[property]; + + if (!ret) { + if (window.getComputedStyle) { + ret = window.getComputedStyle(element, '').getPropertyValue(property); + } else { + ret = element.currentStyle[property]; + } + } + + if (!ret || ret == 'auto' || ret == 'intrinsic') { + ret = container.style[property]; + } + return ret; +}; + +function applyStyles(elm, styles) { + for (var style in styles) { + elm.style[style] = styles[style]; + } +} + +function setupContainer(element, getValue) { + if (element.type != 'textarea') { + throw new Error("Textarea required!"); + } + + var parentNode = element.parentNode; + var container = document.createElement('div'); + var resizeEvent = function() { + var style = 'position:relative;'; + [ + 'margin-top', 'margin-left', 'margin-right', 'margin-bottom' + ].forEach(function(item) { + style += item + ':' + + getCSSProperty(element, container, item) + ';'; + }); + var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px"); + var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px"); + style += 'height:' + height + ';width:' + width + ';'; + style += 'display:inline-block;'; + container.setAttribute('style', style); + }; + event.addListener(window, 'resize', resizeEvent); + resizeEvent(); + parentNode.insertBefore(container, element.nextSibling); + while (parentNode !== document) { + if (parentNode.tagName.toUpperCase() === 'FORM') { + var oldSumit = parentNode.onsubmit; + parentNode.onsubmit = function(evt) { + element.value = getValue(); + if (oldSumit) { + oldSumit.call(this, evt); + } + }; + break; + } + parentNode = parentNode.parentNode; + } + return container; +} + +exports.transformTextarea = function(element, options) { + var session; + var container = setupContainer(element, function() { + return session.getValue(); + }); + element.style.display = 'none'; + container.style.background = 'white'; + var editorDiv = document.createElement("div"); + applyStyles(editorDiv, { + top: "0px", + left: "0px", + right: "0px", + bottom: "0px", + border: "1px solid gray", + position: "absolute" + }); + container.appendChild(editorDiv); + + var settingOpener = document.createElement("div"); + applyStyles(settingOpener, { + position: "absolute", + right: "0px", + bottom: "0px", + background: "red", + cursor: "nw-resize", + borderStyle: "solid", + borderWidth: "9px 8px 10px 9px", + width: "2px", + borderColor: "lightblue gray gray lightblue", + zIndex: 101 + }); + + var settingDiv = document.createElement("div"); + var settingDivStyles = { + top: "0px", + left: "20%", + right: "0px", + bottom: "0px", + position: "absolute", + padding: "5px", + zIndex: 100, + color: "white", + display: "none", + overflow: "auto", + fontSize: "14px", + boxShadow: "-5px 2px 3px gray" + }; + if (!UA.isOldIE) { + settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)"; + } else { + settingDivStyles.backgroundColor = "#333"; + } + + applyStyles(settingDiv, settingDivStyles); + container.appendChild(settingDiv); + + options = options || exports.defaultOptions; + var editor = ace.edit(editorDiv); + session = editor.getSession(); + + session.setValue(element.value || element.innerHTML); + editor.focus(); + container.appendChild(settingOpener); + setupApi(editor, editorDiv, settingDiv, ace, options, load); + setupSettingPanel(settingDiv, settingOpener, editor); + + var state = ""; + event.addListener(settingOpener, "mousemove", function(e) { + var rect = this.getBoundingClientRect(); + var x = e.clientX - rect.left, y = e.clientY - rect.top; + if (x + y < (rect.width + rect.height)/2) { + this.style.cursor = "pointer"; + state = "toggle"; + } else { + state = "resize"; + this.style.cursor = "nw-resize"; + } + }); + + event.addListener(settingOpener, "mousedown", function(e) { + if (state == "toggle") { + editor.setDisplaySettings(); + return; + } + container.style.zIndex = 100000; + var rect = container.getBoundingClientRect(); + var startX = rect.width + rect.left - e.clientX; + var startY = rect.height + rect.top - e.clientY; + event.capture(settingOpener, function(e) { + container.style.width = e.clientX - rect.left + startX + "px"; + container.style.height = e.clientY - rect.top + startY + "px"; + editor.resize(); + }, function() {}); + }); + + return editor; +}; + +function load(url, module, callback) { + net.loadScript(url, function() { + require([module], callback); + }); +} + +function setupApi(editor, editorDiv, settingDiv, ace, options, loader) { + var session = editor.getSession(); + var renderer = editor.renderer; + loader = loader || load; + + function toBool(value) { + return value === "true" || value == true; + } + + editor.setDisplaySettings = function(display) { + if (display == null) + display = settingDiv.style.display == "none"; + if (display) { + settingDiv.style.display = "block"; + settingDiv.hideButton.focus(); + editor.on("focus", function onFocus() { + editor.removeListener("focus", onFocus); + settingDiv.style.display = "none"; + }); + } else { + editor.focus(); + } + }; + + editor.$setOption = editor.setOption; + editor.$getOption = editor.getOption; + editor.setOption = function(key, value) { + switch (key) { + case "mode": + editor.$setOption("mode", "ace/mode/" + value) + break; + case "theme": + editor.$setOption("theme", "ace/theme/" + value) + break; + case "keybindings": + switch (value) { + case "vim": + editor.setKeyboardHandler("ace/keyboard/vim"); + break; + case "emacs": + editor.setKeyboardHandler("ace/keyboard/emacs"); + break; + default: + editor.setKeyboardHandler(null); + } + break; + + case "softWrap": + case "fontSize": + editor.$setOption(key, value); + break; + + default: + editor.$setOption(key, toBool(value)); + } + }; + + editor.getOption = function(key) { + switch (key) { + case "mode": + return editor.$getOption("mode").substr("ace/mode/".length) + break; + + case "theme": + return editor.$getOption("theme").substr("ace/theme/".length) + break; + + case "keybindings": + var value = editor.getKeyboardHandler() + switch (value && value.$id) { + case "ace/keyboard/vim": + return "vim"; + case "ace/keyboard/emacs": + return "emacs"; + default: + return "ace"; + } + break; + + default: + return editor.$getOption(key); + } + }; + + editor.setOptions(options); + return editor; +} + +function setupSettingPanel(settingDiv, settingOpener, editor) { + var BOOL = null; + + var desc = { + mode: "Mode:", + wrap: "Soft Wrap:", + theme: "Theme:", + fontSize: "Font Size:", + showGutter: "Display Gutter:", + keybindings: "Keyboard", + showPrintMargin: "Show Print Margin:", + useSoftTabs: "Use Soft Tabs:", + showInvisibles: "Show Invisibles" + }; + + var optionValues = { + mode: { + text: "Plain", + javascript: "JavaScript", + xml: "XML", + html: "HTML", + css: "CSS", + scss: "SCSS", + python: "Python", + php: "PHP", + java: "Java", + ruby: "Ruby", + c_cpp: "C/C++", + coffee: "CoffeeScript", + json: "json", + perl: "Perl", + clojure: "Clojure", + ocaml: "OCaml", + csharp: "C#", + haxe: "haXe", + svg: "SVG", + textile: "Textile", + groovy: "Groovy", + liquid: "Liquid", + Scala: "Scala" + }, + theme: { + clouds: "Clouds", + clouds_midnight: "Clouds Midnight", + cobalt: "Cobalt", + crimson_editor: "Crimson Editor", + dawn: "Dawn", + gob: "Green on Black", + eclipse: "Eclipse", + idle_fingers: "Idle Fingers", + kr_theme: "Kr Theme", + merbivore: "Merbivore", + merbivore_soft: "Merbivore Soft", + mono_industrial: "Mono Industrial", + monokai: "Monokai", + pastel_on_dark: "Pastel On Dark", + solarized_dark: "Solarized Dark", + solarized_light: "Solarized Light", + textmate: "Textmate", + twilight: "Twilight", + vibrant_ink: "Vibrant Ink" + }, + showGutter: BOOL, + fontSize: { + "10px": "10px", + "11px": "11px", + "12px": "12px", + "14px": "14px", + "16px": "16px" + }, + wrap: { + off: "Off", + 40: "40", + 80: "80", + free: "Free" + }, + keybindings: { + ace: "ace", + vim: "vim", + emacs: "emacs" + }, + showPrintMargin: BOOL, + useSoftTabs: BOOL, + showInvisibles: BOOL + }; + + var table = []; + table.push(""); + + function renderOption(builder, option, obj, cValue) { + if (!obj) { + builder.push( + "" + ); + return; + } + builder.push(""); + } + + for (var option in exports.defaultOptions) { + table.push(""); + table.push(""); + } + table.push("
        SettingValue
        ", desc[option], ""); + renderOption(table, option, optionValues[option], editor.getOption(option)); + table.push("
        "); + settingDiv.innerHTML = table.join(""); + + var onChange = function(e) { + var select = e.currentTarget; + editor.setOption(select.title, select.value); + }; + var onClick = function(e) { + var cb = e.currentTarget; + editor.setOption(cb.title, cb.checked); + }; + var selects = settingDiv.getElementsByTagName("select"); + for (var i = 0; i < selects.length; i++) + selects[i].onchange = onChange; + var cbs = settingDiv.getElementsByTagName("input"); + for (var i = 0; i < cbs.length; i++) + cbs[i].onclick = onClick; + + + var button = document.createElement("input"); + button.type = "button"; + button.value = "Hide"; + event.addListener(button, "click", function() { + editor.setDisplaySettings(false); + }); + settingDiv.appendChild(button); + settingDiv.hideButton = button; +} +exports.defaultOptions = { + mode: "javascript", + theme: "textmate", + wrap: "off", + fontSize: "12px", + showGutter: "false", + keybindings: "ace", + showPrintMargin: "false", + useSoftTabs: "true", + showInvisibles: "false" +}; + +}); + (function() { + ace.require(["ace/ext/textarea"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-themelist.js b/htdocs/includes/ace/ext-themelist.js new file mode 100644 index 00000000000..53225ada739 --- /dev/null +++ b/htdocs/includes/ace/ext-themelist.js @@ -0,0 +1,62 @@ +ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) { +"use strict"; +require("ace/lib/fixoldbrowsers"); + +var themeData = [ + ["Chrome" ], + ["Clouds" ], + ["Crimson Editor" ], + ["Dawn" ], + ["Dreamweaver" ], + ["Eclipse" ], + ["GitHub" ], + ["IPlastic" ], + ["Solarized Light"], + ["TextMate" ], + ["Tomorrow" ], + ["XCode" ], + ["Kuroir"], + ["KatzenMilch"], + ["SQL Server" ,"sqlserver" , "light"], + ["Ambiance" ,"ambiance" , "dark"], + ["Chaos" ,"chaos" , "dark"], + ["Clouds Midnight" ,"clouds_midnight" , "dark"], + ["Cobalt" ,"cobalt" , "dark"], + ["Gruvbox" ,"gruvbox" , "dark"], + ["Green on Black" ,"gob" , "dark"], + ["idle Fingers" ,"idle_fingers" , "dark"], + ["krTheme" ,"kr_theme" , "dark"], + ["Merbivore" ,"merbivore" , "dark"], + ["Merbivore Soft" ,"merbivore_soft" , "dark"], + ["Mono Industrial" ,"mono_industrial" , "dark"], + ["Monokai" ,"monokai" , "dark"], + ["Pastel on dark" ,"pastel_on_dark" , "dark"], + ["Solarized Dark" ,"solarized_dark" , "dark"], + ["Terminal" ,"terminal" , "dark"], + ["Tomorrow Night" ,"tomorrow_night" , "dark"], + ["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"], + ["Tomorrow Night Bright","tomorrow_night_bright" , "dark"], + ["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"], + ["Twilight" ,"twilight" , "dark"], + ["Vibrant Ink" ,"vibrant_ink" , "dark"] +]; + + +exports.themesByName = {}; +exports.themes = themeData.map(function(data) { + var name = data[1] || data[0].replace(/ /g, "_").toLowerCase(); + var theme = { + caption: data[0], + theme: "ace/theme/" + name, + isDark: data[2] == "dark", + name: name + }; + exports.themesByName[name] = theme; + return theme; +}); + +}); + (function() { + ace.require(["ace/ext/themelist"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/ext-whitespace.js b/htdocs/includes/ace/ext-whitespace.js new file mode 100644 index 00000000000..8f4af96cf9a --- /dev/null +++ b/htdocs/includes/ace/ext-whitespace.js @@ -0,0 +1,206 @@ +ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var lang = require("../lib/lang"); +exports.$detectIndentation = function(lines, fallback) { + var stats = []; + var changes = []; + var tabIndents = 0; + var prevSpaces = 0; + var max = Math.min(lines.length, 1000); + for (var i = 0; i < max; i++) { + var line = lines[i]; + if (!/^\s*[^*+\-\s]/.test(line)) + continue; + + if (line[0] == "\t") { + tabIndents++; + prevSpaces = -Number.MAX_VALUE; + } else { + var spaces = line.match(/^ */)[0].length; + if (spaces && line[spaces] != "\t") { + var diff = spaces - prevSpaces; + if (diff > 0 && !(prevSpaces%diff) && !(spaces%diff)) + changes[diff] = (changes[diff] || 0) + 1; + + stats[spaces] = (stats[spaces] || 0) + 1; + } + prevSpaces = spaces; + } + while (i < max && line[line.length - 1] == "\\") + line = lines[i++]; + } + + function getScore(indent) { + var score = 0; + for (var i = indent; i < stats.length; i += indent) + score += stats[i] || 0; + return score; + } + + var changesTotal = changes.reduce(function(a,b){return a+b}, 0); + + var first = {score: 0, length: 0}; + var spaceIndents = 0; + for (var i = 1; i < 12; i++) { + var score = getScore(i); + if (i == 1) { + spaceIndents = score; + score = stats[1] ? 0.9 : 0.8; + if (!stats.length) + score = 0; + } else + score /= spaceIndents; + + if (changes[i]) + score += changes[i] / changesTotal; + + if (score > first.score) + first = {score: score, length: i}; + } + + if (first.score && first.score > 1.4) + var tabLength = first.length; + + if (tabIndents > spaceIndents + 1) { + if (tabLength == 1 || spaceIndents < tabIndents / 4 || first.score < 1.8) + tabLength = undefined; + return {ch: "\t", length: tabLength}; + } + if (spaceIndents > tabIndents + 1) + return {ch: " ", length: tabLength}; +}; + +exports.detectIndentation = function(session) { + var lines = session.getLines(0, 1000); + var indent = exports.$detectIndentation(lines) || {}; + + if (indent.ch) + session.setUseSoftTabs(indent.ch == " "); + + if (indent.length) + session.setTabSize(indent.length); + return indent; +}; +exports.trimTrailingSpace = function(session, options) { + var doc = session.getDocument(); + var lines = doc.getAllLines(); + + var min = options && options.trimEmpty ? -1 : 0; + var cursors = [], ci = -1; + if (options && options.keepCursorPosition) { + if (session.selection.rangeCount) { + session.selection.rangeList.ranges.forEach(function(x, i, ranges) { + var next = ranges[i + 1]; + if (next && next.cursor.row == x.cursor.row) + return; + cursors.push(x.cursor); + }); + } else { + cursors.push(session.selection.getCursor()); + } + ci = 0; + } + var cursorRow = cursors[ci] && cursors[ci].row; + + for (var i = 0, l=lines.length; i < l; i++) { + var line = lines[i]; + var index = line.search(/\s+$/); + + if (i == cursorRow) { + if (index < cursors[ci].column && index > min) + index = cursors[ci].column; + ci++; + cursorRow = cursors[ci] ? cursors[ci].row : -1; + } + + if (index > min) + doc.removeInLine(i, index, line.length); + } +}; + +exports.convertIndentation = function(session, ch, len) { + var oldCh = session.getTabString()[0]; + var oldLen = session.getTabSize(); + if (!len) len = oldLen; + if (!ch) ch = oldCh; + + var tab = ch == "\t" ? ch: lang.stringRepeat(ch, len); + + var doc = session.doc; + var lines = doc.getAllLines(); + + var cache = {}; + var spaceCache = {}; + for (var i = 0, l=lines.length; i < l; i++) { + var line = lines[i]; + var match = line.match(/^\s*/)[0]; + if (match) { + var w = session.$getStringScreenWidth(match)[0]; + var tabCount = Math.floor(w/oldLen); + var reminder = w%oldLen; + var toInsert = cache[tabCount] || (cache[tabCount] = lang.stringRepeat(tab, tabCount)); + toInsert += spaceCache[reminder] || (spaceCache[reminder] = lang.stringRepeat(" ", reminder)); + + if (toInsert != match) { + doc.removeInLine(i, 0, match.length); + doc.insertInLine({row: i, column: 0}, toInsert); + } + } + } + session.setTabSize(len); + session.setUseSoftTabs(ch == " "); +}; + +exports.$parseStringArg = function(text) { + var indent = {}; + if (/t/.test(text)) + indent.ch = "\t"; + else if (/s/.test(text)) + indent.ch = " "; + var m = text.match(/\d+/); + if (m) + indent.length = parseInt(m[0], 10); + return indent; +}; + +exports.$parseArg = function(arg) { + if (!arg) + return {}; + if (typeof arg == "string") + return exports.$parseStringArg(arg); + if (typeof arg.text == "string") + return exports.$parseStringArg(arg.text); + return arg; +}; + +exports.commands = [{ + name: "detectIndentation", + exec: function(editor) { + exports.detectIndentation(editor.session); + } +}, { + name: "trimTrailingSpace", + exec: function(editor) { + exports.trimTrailingSpace(editor.session); + } +}, { + name: "convertIndentation", + exec: function(editor, arg) { + var indent = exports.$parseArg(arg); + exports.convertIndentation(editor.session, indent.ch, indent.length); + } +}, { + name: "setIndentation", + exec: function(editor, arg) { + var indent = exports.$parseArg(arg); + indent.length && editor.session.setTabSize(indent.length); + indent.ch && editor.session.setUseSoftTabs(indent.ch == " "); + } +}]; + +}); + (function() { + ace.require(["ace/ext/whitespace"], function() {}); + })(); + \ No newline at end of file diff --git a/htdocs/includes/ace/keybinding-emacs.js b/htdocs/includes/ace/keybinding-emacs.js new file mode 100644 index 00000000000..a6cb038e95b --- /dev/null +++ b/htdocs/includes/ace/keybinding-emacs.js @@ -0,0 +1,1181 @@ +ace.define("ace/occur",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/edit_session","ace/search_highlight","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var Range = require("./range").Range; +var Search = require("./search").Search; +var EditSession = require("./edit_session").EditSession; +var SearchHighlight = require("./search_highlight").SearchHighlight; +function Occur() {} + +oop.inherits(Occur, Search); + +(function() { + this.enter = function(editor, options) { + if (!options.needle) return false; + var pos = editor.getCursorPosition(); + this.displayOccurContent(editor, options); + var translatedPos = this.originalToOccurPosition(editor.session, pos); + editor.moveCursorToPosition(translatedPos); + return true; + } + this.exit = function(editor, options) { + var pos = options.translatePosition && editor.getCursorPosition(); + var translatedPos = pos && this.occurToOriginalPosition(editor.session, pos); + this.displayOriginalContent(editor); + if (translatedPos) + editor.moveCursorToPosition(translatedPos); + return true; + } + + this.highlight = function(sess, regexp) { + var hl = sess.$occurHighlight = sess.$occurHighlight || sess.addDynamicMarker( + new SearchHighlight(null, "ace_occur-highlight", "text")); + hl.setRegexp(regexp); + sess._emit("changeBackMarker"); // force highlight layer redraw + } + + this.displayOccurContent = function(editor, options) { + this.$originalSession = editor.session; + var found = this.matchingLines(editor.session, options); + var lines = found.map(function(foundLine) { return foundLine.content; }); + var occurSession = new EditSession(lines.join('\n')); + occurSession.$occur = this; + occurSession.$occurMatchingLines = found; + editor.setSession(occurSession); + this.$useEmacsStyleLineStart = this.$originalSession.$useEmacsStyleLineStart; + occurSession.$useEmacsStyleLineStart = this.$useEmacsStyleLineStart; + this.highlight(occurSession, options.re); + occurSession._emit('changeBackMarker'); + } + + this.displayOriginalContent = function(editor) { + editor.setSession(this.$originalSession); + this.$originalSession.$useEmacsStyleLineStart = this.$useEmacsStyleLineStart; + } + this.originalToOccurPosition = function(session, pos) { + var lines = session.$occurMatchingLines; + var nullPos = {row: 0, column: 0}; + if (!lines) return nullPos; + for (var i = 0; i < lines.length; i++) { + if (lines[i].row === pos.row) + return {row: i, column: pos.column}; + } + return nullPos; + } + this.occurToOriginalPosition = function(session, pos) { + var lines = session.$occurMatchingLines; + if (!lines || !lines[pos.row]) + return pos; + return {row: lines[pos.row].row, column: pos.column}; + } + + this.matchingLines = function(session, options) { + options = oop.mixin({}, options); + if (!session || !options.needle) return []; + var search = new Search(); + search.set(options); + return search.findAll(session).reduce(function(lines, range) { + var row = range.start.row; + var last = lines[lines.length-1]; + return last && last.row === row ? + lines : + lines.concat({row: row, content: session.getLine(row)}); + }, []); + } + +}).call(Occur.prototype); + +var dom = require('./lib/dom'); +dom.importCssString(".ace_occur-highlight {\n\ + border-radius: 4px;\n\ + background-color: rgba(87, 255, 8, 0.25);\n\ + position: absolute;\n\ + z-index: 4;\n\ + -moz-box-sizing: border-box;\n\ + -webkit-box-sizing: border-box;\n\ + box-sizing: border-box;\n\ + box-shadow: 0 0 4px rgb(91, 255, 50);\n\ +}\n\ +.ace_dark .ace_occur-highlight {\n\ + background-color: rgb(80, 140, 85);\n\ + box-shadow: 0 0 4px rgb(60, 120, 70);\n\ +}\n", "incremental-occur-highlighting"); + +exports.Occur = Occur; + +}); + +ace.define("ace/commands/occur_commands",["require","exports","module","ace/config","ace/occur","ace/keyboard/hash_handler","ace/lib/oop"], function(require, exports, module) { + +var config = require("../config"), + Occur = require("../occur").Occur; +var occurStartCommand = { + name: "occur", + exec: function(editor, options) { + var alreadyInOccur = !!editor.session.$occur; + var occurSessionActive = new Occur().enter(editor, options); + if (occurSessionActive && !alreadyInOccur) + OccurKeyboardHandler.installIn(editor); + }, + readOnly: true +}; + +var occurCommands = [{ + name: "occurexit", + bindKey: 'esc|Ctrl-G', + exec: function(editor) { + var occur = editor.session.$occur; + if (!occur) return; + occur.exit(editor, {}); + if (!editor.session.$occur) OccurKeyboardHandler.uninstallFrom(editor); + }, + readOnly: true +}, { + name: "occuraccept", + bindKey: 'enter', + exec: function(editor) { + var occur = editor.session.$occur; + if (!occur) return; + occur.exit(editor, {translatePosition: true}); + if (!editor.session.$occur) OccurKeyboardHandler.uninstallFrom(editor); + }, + readOnly: true +}]; + +var HashHandler = require("../keyboard/hash_handler").HashHandler; +var oop = require("../lib/oop"); + + +function OccurKeyboardHandler() {} + +oop.inherits(OccurKeyboardHandler, HashHandler); + +(function() { + + this.isOccurHandler = true; + + this.attach = function(editor) { + HashHandler.call(this, occurCommands, editor.commands.platform); + this.$editor = editor; + } + + var handleKeyboard$super = this.handleKeyboard; + this.handleKeyboard = function(data, hashId, key, keyCode) { + var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); + return (cmd && cmd.command) ? cmd : undefined; + } + +}).call(OccurKeyboardHandler.prototype); + +OccurKeyboardHandler.installIn = function(editor) { + var handler = new this(); + editor.keyBinding.addKeyboardHandler(handler); + editor.commands.addCommands(occurCommands); +} + +OccurKeyboardHandler.uninstallFrom = function(editor) { + editor.commands.removeCommands(occurCommands); + var handler = editor.getKeyboardHandler(); + if (handler.isOccurHandler) + editor.keyBinding.removeKeyboardHandler(handler); +} + +exports.occurStartCommand = occurStartCommand; + +}); + +ace.define("ace/commands/incremental_search_commands",["require","exports","module","ace/config","ace/lib/oop","ace/keyboard/hash_handler","ace/commands/occur_commands"], function(require, exports, module) { + +var config = require("../config"); +var oop = require("../lib/oop"); +var HashHandler = require("../keyboard/hash_handler").HashHandler; +var occurStartCommand = require("./occur_commands").occurStartCommand; +exports.iSearchStartCommands = [{ + name: "iSearch", + bindKey: {win: "Ctrl-F", mac: "Command-F"}, + exec: function(editor, options) { + config.loadModule(["core", "ace/incremental_search"], function(e) { + var iSearch = e.iSearch = e.iSearch || new e.IncrementalSearch(); + iSearch.activate(editor, options.backwards); + if (options.jumpToFirstMatch) iSearch.next(options); + }); + }, + readOnly: true +}, { + name: "iSearchBackwards", + exec: function(editor, jumpToNext) { editor.execCommand('iSearch', {backwards: true}); }, + readOnly: true +}, { + name: "iSearchAndGo", + bindKey: {win: "Ctrl-K", mac: "Command-G"}, + exec: function(editor, jumpToNext) { editor.execCommand('iSearch', {jumpToFirstMatch: true, useCurrentOrPrevSearch: true}); }, + readOnly: true +}, { + name: "iSearchBackwardsAndGo", + bindKey: {win: "Ctrl-Shift-K", mac: "Command-Shift-G"}, + exec: function(editor) { editor.execCommand('iSearch', {jumpToFirstMatch: true, backwards: true, useCurrentOrPrevSearch: true}); }, + readOnly: true +}]; +exports.iSearchCommands = [{ + name: "restartSearch", + bindKey: {win: "Ctrl-F", mac: "Command-F"}, + exec: function(iSearch) { + iSearch.cancelSearch(true); + } +}, { + name: "searchForward", + bindKey: {win: "Ctrl-S|Ctrl-K", mac: "Ctrl-S|Command-G"}, + exec: function(iSearch, options) { + options.useCurrentOrPrevSearch = true; + iSearch.next(options); + } +}, { + name: "searchBackward", + bindKey: {win: "Ctrl-R|Ctrl-Shift-K", mac: "Ctrl-R|Command-Shift-G"}, + exec: function(iSearch, options) { + options.useCurrentOrPrevSearch = true; + options.backwards = true; + iSearch.next(options); + } +}, { + name: "extendSearchTerm", + exec: function(iSearch, string) { + iSearch.addString(string); + } +}, { + name: "extendSearchTermSpace", + bindKey: "space", + exec: function(iSearch) { iSearch.addString(' '); } +}, { + name: "shrinkSearchTerm", + bindKey: "backspace", + exec: function(iSearch) { + iSearch.removeChar(); + } +}, { + name: 'confirmSearch', + bindKey: 'return', + exec: function(iSearch) { iSearch.deactivate(); } +}, { + name: 'cancelSearch', + bindKey: 'esc|Ctrl-G', + exec: function(iSearch) { iSearch.deactivate(true); } +}, { + name: 'occurisearch', + bindKey: 'Ctrl-O', + exec: function(iSearch) { + var options = oop.mixin({}, iSearch.$options); + iSearch.deactivate(); + occurStartCommand.exec(iSearch.$editor, options); + } +}, { + name: "yankNextWord", + bindKey: "Ctrl-w", + exec: function(iSearch) { + var ed = iSearch.$editor, + range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorWordRight(); }), + string = ed.session.getTextRange(range); + iSearch.addString(string); + } +}, { + name: "yankNextChar", + bindKey: "Ctrl-Alt-y", + exec: function(iSearch) { + var ed = iSearch.$editor, + range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorRight(); }), + string = ed.session.getTextRange(range); + iSearch.addString(string); + } +}, { + name: 'recenterTopBottom', + bindKey: 'Ctrl-l', + exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); } +}, { + name: 'selectAllMatches', + bindKey: 'Ctrl-space', + exec: function(iSearch) { + var ed = iSearch.$editor, + hl = ed.session.$isearchHighlight, + ranges = hl && hl.cache ? hl.cache + .reduce(function(ranges, ea) { + return ranges.concat(ea ? ea : []); }, []) : []; + iSearch.deactivate(false); + ranges.forEach(ed.selection.addRange.bind(ed.selection)); + } +}, { + name: 'searchAsRegExp', + bindKey: 'Alt-r', + exec: function(iSearch) { + iSearch.convertNeedleToRegExp(); + } +}].map(function(cmd) { + cmd.readOnly = true; + cmd.isIncrementalSearchCommand = true; + cmd.scrollIntoView = "animate-cursor"; + return cmd; +}); + +function IncrementalSearchKeyboardHandler(iSearch) { + this.$iSearch = iSearch; +} + +oop.inherits(IncrementalSearchKeyboardHandler, HashHandler); + +(function() { + + this.attach = function(editor) { + var iSearch = this.$iSearch; + HashHandler.call(this, exports.iSearchCommands, editor.commands.platform); + this.$commandExecHandler = editor.commands.addEventListener('exec', function(e) { + if (!e.command.isIncrementalSearchCommand) + return iSearch.deactivate(); + e.stopPropagation(); + e.preventDefault(); + var scrollTop = editor.session.getScrollTop(); + var result = e.command.exec(iSearch, e.args || {}); + editor.renderer.scrollCursorIntoView(null, 0.5); + editor.renderer.animateScrolling(scrollTop); + return result; + }); + }; + + this.detach = function(editor) { + if (!this.$commandExecHandler) return; + editor.commands.removeEventListener('exec', this.$commandExecHandler); + delete this.$commandExecHandler; + }; + + var handleKeyboard$super = this.handleKeyboard; + this.handleKeyboard = function(data, hashId, key, keyCode) { + if (((hashId === 1/*ctrl*/ || hashId === 8/*command*/) && key === 'v') + || (hashId === 1/*ctrl*/ && key === 'y')) return null; + var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); + if (cmd.command) { return cmd; } + if (hashId == -1) { + var extendCmd = this.commands.extendSearchTerm; + if (extendCmd) { return {command: extendCmd, args: key}; } + } + return false; + }; + +}).call(IncrementalSearchKeyboardHandler.prototype); + + +exports.IncrementalSearchKeyboardHandler = IncrementalSearchKeyboardHandler; + +}); + +ace.define("ace/incremental_search",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/search_highlight","ace/commands/incremental_search_commands","ace/lib/dom","ace/commands/command_manager","ace/editor","ace/config"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var Range = require("./range").Range; +var Search = require("./search").Search; +var SearchHighlight = require("./search_highlight").SearchHighlight; +var iSearchCommandModule = require("./commands/incremental_search_commands"); +var ISearchKbd = iSearchCommandModule.IncrementalSearchKeyboardHandler; +function IncrementalSearch() { + this.$options = {wrap: false, skipCurrent: false}; + this.$keyboardHandler = new ISearchKbd(this); +} + +oop.inherits(IncrementalSearch, Search); + +function isRegExp(obj) { + return obj instanceof RegExp; +} + +function regExpToObject(re) { + var string = String(re), + start = string.indexOf('/'), + flagStart = string.lastIndexOf('/'); + return { + expression: string.slice(start+1, flagStart), + flags: string.slice(flagStart+1) + } +} + +function stringToRegExp(string, flags) { + try { + return new RegExp(string, flags); + } catch (e) { return string; } +} + +function objectToRegExp(obj) { + return stringToRegExp(obj.expression, obj.flags); +} + +(function() { + + this.activate = function(ed, backwards) { + this.$editor = ed; + this.$startPos = this.$currentPos = ed.getCursorPosition(); + this.$options.needle = ''; + this.$options.backwards = backwards; + ed.keyBinding.addKeyboardHandler(this.$keyboardHandler); + this.$originalEditorOnPaste = ed.onPaste; ed.onPaste = this.onPaste.bind(this); + this.$mousedownHandler = ed.addEventListener('mousedown', this.onMouseDown.bind(this)); + this.selectionFix(ed); + this.statusMessage(true); + }; + + this.deactivate = function(reset) { + this.cancelSearch(reset); + var ed = this.$editor; + ed.keyBinding.removeKeyboardHandler(this.$keyboardHandler); + if (this.$mousedownHandler) { + ed.removeEventListener('mousedown', this.$mousedownHandler); + delete this.$mousedownHandler; + } + ed.onPaste = this.$originalEditorOnPaste; + this.message(''); + }; + + this.selectionFix = function(editor) { + if (editor.selection.isEmpty() && !editor.session.$emacsMark) { + editor.clearSelection(); + } + }; + + this.highlight = function(regexp) { + var sess = this.$editor.session, + hl = sess.$isearchHighlight = sess.$isearchHighlight || sess.addDynamicMarker( + new SearchHighlight(null, "ace_isearch-result", "text")); + hl.setRegexp(regexp); + sess._emit("changeBackMarker"); // force highlight layer redraw + }; + + this.cancelSearch = function(reset) { + var e = this.$editor; + this.$prevNeedle = this.$options.needle; + this.$options.needle = ''; + if (reset) { + e.moveCursorToPosition(this.$startPos); + this.$currentPos = this.$startPos; + } else { + e.pushEmacsMark && e.pushEmacsMark(this.$startPos, false); + } + this.highlight(null); + return Range.fromPoints(this.$currentPos, this.$currentPos); + }; + + this.highlightAndFindWithNeedle = function(moveToNext, needleUpdateFunc) { + if (!this.$editor) return null; + var options = this.$options; + if (needleUpdateFunc) { + options.needle = needleUpdateFunc.call(this, options.needle || '') || ''; + } + if (options.needle.length === 0) { + this.statusMessage(true); + return this.cancelSearch(true); + } + options.start = this.$currentPos; + var session = this.$editor.session, + found = this.find(session), + shouldSelect = this.$editor.emacsMark ? + !!this.$editor.emacsMark() : !this.$editor.selection.isEmpty(); + if (found) { + if (options.backwards) found = Range.fromPoints(found.end, found.start); + this.$editor.selection.setRange(Range.fromPoints(shouldSelect ? this.$startPos : found.end, found.end)); + if (moveToNext) this.$currentPos = found.end; + this.highlight(options.re); + } + + this.statusMessage(found); + + return found; + }; + + this.addString = function(s) { + return this.highlightAndFindWithNeedle(false, function(needle) { + if (!isRegExp(needle)) + return needle + s; + var reObj = regExpToObject(needle); + reObj.expression += s; + return objectToRegExp(reObj); + }); + }; + + this.removeChar = function(c) { + return this.highlightAndFindWithNeedle(false, function(needle) { + if (!isRegExp(needle)) + return needle.substring(0, needle.length-1); + var reObj = regExpToObject(needle); + reObj.expression = reObj.expression.substring(0, reObj.expression.length-1); + return objectToRegExp(reObj); + }); + }; + + this.next = function(options) { + options = options || {}; + this.$options.backwards = !!options.backwards; + this.$currentPos = this.$editor.getCursorPosition(); + return this.highlightAndFindWithNeedle(true, function(needle) { + return options.useCurrentOrPrevSearch && needle.length === 0 ? + this.$prevNeedle || '' : needle; + }); + }; + + this.onMouseDown = function(evt) { + this.deactivate(); + return true; + }; + + this.onPaste = function(text) { + this.addString(text); + }; + + this.convertNeedleToRegExp = function() { + return this.highlightAndFindWithNeedle(false, function(needle) { + return isRegExp(needle) ? needle : stringToRegExp(needle, 'ig'); + }); + }; + + this.convertNeedleToString = function() { + return this.highlightAndFindWithNeedle(false, function(needle) { + return isRegExp(needle) ? regExpToObject(needle).expression : needle; + }); + }; + + this.statusMessage = function(found) { + var options = this.$options, msg = ''; + msg += options.backwards ? 'reverse-' : ''; + msg += 'isearch: ' + options.needle; + msg += found ? '' : ' (not found)'; + this.message(msg); + }; + + this.message = function(msg) { + if (this.$editor.showCommandLine) { + this.$editor.showCommandLine(msg); + this.$editor.focus(); + } else { + console.log(msg); + } + }; + +}).call(IncrementalSearch.prototype); + + +exports.IncrementalSearch = IncrementalSearch; + +var dom = require('./lib/dom'); +dom.importCssString && dom.importCssString("\ +.ace_marker-layer .ace_isearch-result {\ + position: absolute;\ + z-index: 6;\ + -moz-box-sizing: border-box;\ + -webkit-box-sizing: border-box;\ + box-sizing: border-box;\ +}\ +div.ace_isearch-result {\ + border-radius: 4px;\ + background-color: rgba(255, 200, 0, 0.5);\ + box-shadow: 0 0 4px rgb(255, 200, 0);\ +}\ +.ace_dark div.ace_isearch-result {\ + background-color: rgb(100, 110, 160);\ + box-shadow: 0 0 4px rgb(80, 90, 140);\ +}", "incremental-search-highlighting"); +var commands = require("./commands/command_manager"); +(function() { + this.setupIncrementalSearch = function(editor, val) { + if (this.usesIncrementalSearch == val) return; + this.usesIncrementalSearch = val; + var iSearchCommands = iSearchCommandModule.iSearchStartCommands; + var method = val ? 'addCommands' : 'removeCommands'; + this[method](iSearchCommands); + }; +}).call(commands.CommandManager.prototype); +var Editor = require("./editor").Editor; +require("./config").defineOptions(Editor.prototype, "editor", { + useIncrementalSearch: { + set: function(val) { + this.keyBinding.$handlers.forEach(function(handler) { + if (handler.setupIncrementalSearch) { + handler.setupIncrementalSearch(this, val); + } + }); + this._emit('incrementalSearchSettingChanged', {isEnabled: val}); + } + } +}); + +}); + +ace.define("ace/keyboard/emacs",["require","exports","module","ace/lib/dom","ace/incremental_search","ace/commands/incremental_search_commands","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) { +"use strict"; + +var dom = require("../lib/dom"); +require("../incremental_search"); +var iSearchCommandModule = require("../commands/incremental_search_commands"); + + +var screenToTextBlockCoordinates = function(x, y) { + var canvasPos = this.scroller.getBoundingClientRect(); + + var col = Math.floor( + (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth + ); + var row = Math.floor( + (y + this.scrollTop - canvasPos.top) / this.lineHeight + ); + + return this.session.screenToDocumentPosition(row, col); +}; + +var HashHandler = require("./hash_handler").HashHandler; +exports.handler = new HashHandler(); + +exports.handler.isEmacs = true; +exports.handler.$id = "ace/keyboard/emacs"; + +var initialized = false; +var $formerLongWords; +var $formerLineStart; + +exports.handler.attach = function(editor) { + if (!initialized) { + initialized = true; + dom.importCssString('\ + .emacs-mode .ace_cursor{\ + border: 1px rgba(50,250,50,0.8) solid!important;\ + -moz-box-sizing: border-box!important;\ + -webkit-box-sizing: border-box!important;\ + box-sizing: border-box!important;\ + background-color: rgba(0,250,0,0.9);\ + opacity: 0.5;\ + }\ + .emacs-mode .ace_hidden-cursors .ace_cursor{\ + opacity: 1;\ + background-color: transparent;\ + }\ + .emacs-mode .ace_overwrite-cursors .ace_cursor {\ + opacity: 1;\ + background-color: transparent;\ + border-width: 0 0 2px 2px !important;\ + }\ + .emacs-mode .ace_text-layer {\ + z-index: 4\ + }\ + .emacs-mode .ace_cursor-layer {\ + z-index: 2\ + }', 'emacsMode' + ); + } + $formerLongWords = editor.session.$selectLongWords; + editor.session.$selectLongWords = true; + $formerLineStart = editor.session.$useEmacsStyleLineStart; + editor.session.$useEmacsStyleLineStart = true; + + editor.session.$emacsMark = null; // the active mark + editor.session.$emacsMarkRing = editor.session.$emacsMarkRing || []; + + editor.emacsMark = function() { + return this.session.$emacsMark; + }; + + editor.setEmacsMark = function(p) { + this.session.$emacsMark = p; + }; + + editor.pushEmacsMark = function(p, activate) { + var prevMark = this.session.$emacsMark; + if (prevMark) + this.session.$emacsMarkRing.push(prevMark); + if (!p || activate) this.setEmacsMark(p); + else this.session.$emacsMarkRing.push(p); + }; + + editor.popEmacsMark = function() { + var mark = this.emacsMark(); + if (mark) { this.setEmacsMark(null); return mark; } + return this.session.$emacsMarkRing.pop(); + }; + + editor.getLastEmacsMark = function(p) { + return this.session.$emacsMark || this.session.$emacsMarkRing.slice(-1)[0]; + }; + + editor.emacsMarkForSelection = function(replacement) { + var sel = this.selection, + multiRangeLength = this.multiSelect ? + this.multiSelect.getAllRanges().length : 1, + selIndex = sel.index || 0, + markRing = this.session.$emacsMarkRing, + markIndex = markRing.length - (multiRangeLength - selIndex), + lastMark = markRing[markIndex] || sel.anchor; + if (replacement) { + markRing.splice(markIndex, 1, + "row" in replacement && "column" in replacement ? + replacement : undefined); + } + return lastMark; + } + + editor.on("click", $resetMarkMode); + editor.on("changeSession", $kbSessionChange); + editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates; + editor.setStyle("emacs-mode"); + editor.commands.addCommands(commands); + exports.handler.platform = editor.commands.platform; + editor.$emacsModeHandler = this; + editor.addEventListener('copy', this.onCopy); + editor.addEventListener('paste', this.onPaste); +}; + +exports.handler.detach = function(editor) { + delete editor.renderer.screenToTextCoordinates; + editor.session.$selectLongWords = $formerLongWords; + editor.session.$useEmacsStyleLineStart = $formerLineStart; + editor.removeEventListener("click", $resetMarkMode); + editor.removeEventListener("changeSession", $kbSessionChange); + editor.unsetStyle("emacs-mode"); + editor.commands.removeCommands(commands); + editor.removeEventListener('copy', this.onCopy); + editor.removeEventListener('paste', this.onPaste); + editor.$emacsModeHandler = null; +}; + +var $kbSessionChange = function(e) { + if (e.oldSession) { + e.oldSession.$selectLongWords = $formerLongWords; + e.oldSession.$useEmacsStyleLineStart = $formerLineStart; + } + + $formerLongWords = e.session.$selectLongWords; + e.session.$selectLongWords = true; + $formerLineStart = e.session.$useEmacsStyleLineStart; + e.session.$useEmacsStyleLineStart = true; + + if (!e.session.hasOwnProperty('$emacsMark')) + e.session.$emacsMark = null; + if (!e.session.hasOwnProperty('$emacsMarkRing')) + e.session.$emacsMarkRing = []; +}; + +var $resetMarkMode = function(e) { + e.editor.session.$emacsMark = null; +}; + +var keys = require("../lib/keys").KEY_MODS; +var eMods = {C: "ctrl", S: "shift", M: "alt", CMD: "command"}; +var combinations = ["C-S-M-CMD", + "S-M-CMD", "C-M-CMD", "C-S-CMD", "C-S-M", + "M-CMD", "S-CMD", "S-M", "C-CMD", "C-M", "C-S", + "CMD", "M", "S", "C"]; +combinations.forEach(function(c) { + var hashId = 0; + c.split("-").forEach(function(c) { + hashId = hashId | keys[eMods[c]]; + }); + eMods[hashId] = c.toLowerCase() + "-"; +}); + +exports.handler.onCopy = function(e, editor) { + if (editor.$handlesEmacsOnCopy) return; + editor.$handlesEmacsOnCopy = true; + exports.handler.commands.killRingSave.exec(editor); + editor.$handlesEmacsOnCopy = false; +}; + +exports.handler.onPaste = function(e, editor) { + editor.pushEmacsMark(editor.getCursorPosition()); +}; + +exports.handler.bindKey = function(key, command) { + if (typeof key == "object") + key = key[this.platform]; + if (!key) + return; + + var ckb = this.commandKeyBinding; + key.split("|").forEach(function(keyPart) { + keyPart = keyPart.toLowerCase(); + ckb[keyPart] = command; + var keyParts = keyPart.split(" ").slice(0,-1); + keyParts.reduce(function(keyMapKeys, keyPart, i) { + var prefix = keyMapKeys[i-1] ? keyMapKeys[i-1] + ' ' : ''; + return keyMapKeys.concat([prefix + keyPart]); + }, []).forEach(function(keyPart) { + if (!ckb[keyPart]) ckb[keyPart] = "null"; + }); + }, this); +}; + +exports.handler.getStatusText = function(editor, data) { + var str = ""; + if (data.count) + str += data.count; + if (data.keyChain) + str += " " + data.keyChain + return str; +}; + +exports.handler.handleKeyboard = function(data, hashId, key, keyCode) { + if (keyCode === -1) return undefined; + + var editor = data.editor; + editor._signal("changeStatus"); + if (hashId == -1) { + editor.pushEmacsMark(); + if (data.count) { + var str = new Array(data.count + 1).join(key); + data.count = null; + return {command: "insertstring", args: str}; + } + } + + var modifier = eMods[hashId]; + if (modifier == "c-" || data.count) { + var count = parseInt(key[key.length - 1]); + if (typeof count === 'number' && !isNaN(count)) { + data.count = Math.max(data.count, 0) || 0; + data.count = 10 * data.count + count; + return {command: "null"}; + } + } + if (modifier) key = modifier + key; + if (data.keyChain) key = data.keyChain += " " + key; + var command = this.commandKeyBinding[key]; + data.keyChain = command == "null" ? key : ""; + if (!command) return undefined; + if (command === "null") return {command: "null"}; + + if (command === "universalArgument") { + data.count = -4; + return {command: "null"}; + } + var args; + if (typeof command !== "string") { + args = command.args; + if (command.command) command = command.command; + if (command === "goorselect") { + command = editor.emacsMark() ? args[1] : args[0]; + args = null; + } + } + + if (typeof command === "string") { + if (command === "insertstring" || + command === "splitline" || + command === "togglecomment") { + editor.pushEmacsMark(); + } + command = this.commands[command] || editor.commands.commands[command]; + if (!command) return undefined; + } + + if (!command.readOnly && !command.isYank) + data.lastCommand = null; + + if (!command.readOnly && editor.emacsMark()) + editor.setEmacsMark(null) + + if (data.count) { + var count = data.count; + data.count = 0; + if (!command || !command.handlesCount) { + return { + args: args, + command: { + exec: function(editor, args) { + for (var i = 0; i < count; i++) + command.exec(editor, args); + }, + multiSelectAction: command.multiSelectAction + } + }; + } else { + if (!args) args = {}; + if (typeof args === 'object') args.count = count; + } + } + + return {command: command, args: args}; +}; + +exports.emacsKeys = { + "Up|C-p" : {command: "goorselect", args: ["golineup","selectup"]}, + "Down|C-n" : {command: "goorselect", args: ["golinedown","selectdown"]}, + "Left|C-b" : {command: "goorselect", args: ["gotoleft","selectleft"]}, + "Right|C-f" : {command: "goorselect", args: ["gotoright","selectright"]}, + "C-Left|M-b" : {command: "goorselect", args: ["gotowordleft","selectwordleft"]}, + "C-Right|M-f" : {command: "goorselect", args: ["gotowordright","selectwordright"]}, + "Home|C-a" : {command: "goorselect", args: ["gotolinestart","selecttolinestart"]}, + "End|C-e" : {command: "goorselect", args: ["gotolineend","selecttolineend"]}, + "C-Home|S-M-,": {command: "goorselect", args: ["gotostart","selecttostart"]}, + "C-End|S-M-." : {command: "goorselect", args: ["gotoend","selecttoend"]}, + "S-Up|S-C-p" : "selectup", + "S-Down|S-C-n" : "selectdown", + "S-Left|S-C-b" : "selectleft", + "S-Right|S-C-f" : "selectright", + "S-C-Left|S-M-b" : "selectwordleft", + "S-C-Right|S-M-f" : "selectwordright", + "S-Home|S-C-a" : "selecttolinestart", + "S-End|S-C-e" : "selecttolineend", + "S-C-Home" : "selecttostart", + "S-C-End" : "selecttoend", + + "C-l" : "recenterTopBottom", + "M-s" : "centerselection", + "M-g": "gotoline", + "C-x C-p": "selectall", + "C-Down": {command: "goorselect", args: ["gotopagedown","selectpagedown"]}, + "C-Up": {command: "goorselect", args: ["gotopageup","selectpageup"]}, + "PageDown|C-v": {command: "goorselect", args: ["gotopagedown","selectpagedown"]}, + "PageUp|M-v": {command: "goorselect", args: ["gotopageup","selectpageup"]}, + "S-C-Down": "selectpagedown", + "S-C-Up": "selectpageup", + + "C-s": "iSearch", + "C-r": "iSearchBackwards", + + "M-C-s": "findnext", + "M-C-r": "findprevious", + "S-M-5": "replace", + "Backspace": "backspace", + "Delete|C-d": "del", + "Return|C-m": {command: "insertstring", args: "\n"}, // "newline" + "C-o": "splitline", + + "M-d|C-Delete": {command: "killWord", args: "right"}, + "C-Backspace|M-Backspace|M-Delete": {command: "killWord", args: "left"}, + "C-k": "killLine", + + "C-y|S-Delete": "yank", + "M-y": "yankRotate", + "C-g": "keyboardQuit", + + "C-w|C-S-W": "killRegion", + "M-w": "killRingSave", + "C-Space": "setMark", + "C-x C-x": "exchangePointAndMark", + + "C-t": "transposeletters", + "M-u": "touppercase", // Doesn't work + "M-l": "tolowercase", + "M-/": "autocomplete", // Doesn't work + "C-u": "universalArgument", + + "M-;": "togglecomment", + + "C-/|C-x u|S-C--|C-z": "undo", + "S-C-/|S-C-x u|C--|S-C-z": "redo", // infinite undo? + "C-x r": "selectRectangularRegion", + "M-x": {command: "focusCommandLine", args: "M-x "} +}; + + +exports.handler.bindKeys(exports.emacsKeys); + +exports.handler.addCommands({ + recenterTopBottom: function(editor) { + var renderer = editor.renderer; + var pos = renderer.$cursorLayer.getPixelPosition(); + var h = renderer.$size.scrollerHeight - renderer.lineHeight; + var scrollTop = renderer.scrollTop; + if (Math.abs(pos.top - scrollTop) < 2) { + scrollTop = pos.top - h; + } else if (Math.abs(pos.top - scrollTop - h * 0.5) < 2) { + scrollTop = pos.top; + } else { + scrollTop = pos.top - h * 0.5; + } + editor.session.setScrollTop(scrollTop); + }, + selectRectangularRegion: function(editor) { + editor.multiSelect.toggleBlockSelection(); + }, + setMark: { + exec: function(editor, args) { + + if (args && args.count) { + if (editor.inMultiSelectMode) editor.forEachSelection(moveToMark); + else moveToMark(); + moveToMark(); + return; + } + + var mark = editor.emacsMark(), + ranges = editor.selection.getAllRanges(), + rangePositions = ranges.map(function(r) { return {row: r.start.row, column: r.start.column}; }), + transientMarkModeActive = true, + hasNoSelection = ranges.every(function(range) { return range.isEmpty(); }); + if (transientMarkModeActive && (mark || !hasNoSelection)) { + if (editor.inMultiSelectMode) editor.forEachSelection({exec: editor.clearSelection.bind(editor)}); + else editor.clearSelection(); + if (mark) editor.pushEmacsMark(null); + return; + } + + if (!mark) { + rangePositions.forEach(function(pos) { editor.pushEmacsMark(pos); }); + editor.setEmacsMark(rangePositions[rangePositions.length-1]); + return; + } + + function moveToMark() { + var mark = editor.popEmacsMark(); + mark && editor.moveCursorToPosition(mark); + } + + }, + readOnly: true, + handlesCount: true + }, + exchangePointAndMark: { + exec: function exchangePointAndMark$exec(editor, args) { + var sel = editor.selection; + if (!args.count && !sel.isEmpty()) { // just invert selection + sel.setSelectionRange(sel.getRange(), !sel.isBackwards()); + return; + } + + if (args.count) { // replace mark and point + var pos = {row: sel.lead.row, column: sel.lead.column}; + sel.clearSelection(); + sel.moveCursorToPosition(editor.emacsMarkForSelection(pos)); + } else { // create selection to last mark + sel.selectToPosition(editor.emacsMarkForSelection()); + } + }, + readOnly: true, + handlesCount: true, + multiSelectAction: "forEach" + }, + killWord: { + exec: function(editor, dir) { + editor.clearSelection(); + if (dir == "left") + editor.selection.selectWordLeft(); + else + editor.selection.selectWordRight(); + + var range = editor.getSelectionRange(); + var text = editor.session.getTextRange(range); + exports.killRing.add(text); + + editor.session.remove(range); + editor.clearSelection(); + }, + multiSelectAction: "forEach" + }, + killLine: function(editor) { + editor.pushEmacsMark(null); + editor.clearSelection(); + var range = editor.getSelectionRange(); + var line = editor.session.getLine(range.start.row); + range.end.column = line.length; + line = line.substr(range.start.column) + + var foldLine = editor.session.getFoldLine(range.start.row); + if (foldLine && range.end.row != foldLine.end.row) { + range.end.row = foldLine.end.row; + line = "x"; + } + if (/^\s*$/.test(line)) { + range.end.row++; + line = editor.session.getLine(range.end.row); + range.end.column = /^\s*$/.test(line) ? line.length : 0; + } + var text = editor.session.getTextRange(range); + if (editor.prevOp.command == this) + exports.killRing.append(text); + else + exports.killRing.add(text); + + editor.session.remove(range); + editor.clearSelection(); + }, + yank: function(editor) { + editor.onPaste(exports.killRing.get() || ''); + editor.keyBinding.$data.lastCommand = "yank"; + }, + yankRotate: function(editor) { + if (editor.keyBinding.$data.lastCommand != "yank") + return; + editor.undo(); + editor.session.$emacsMarkRing.pop(); // also undo recording mark + editor.onPaste(exports.killRing.rotate()); + editor.keyBinding.$data.lastCommand = "yank"; + }, + killRegion: { + exec: function(editor) { + exports.killRing.add(editor.getCopyText()); + editor.commands.byName.cut.exec(editor); + editor.setEmacsMark(null); + }, + readOnly: true, + multiSelectAction: "forEach" + }, + killRingSave: { + exec: function(editor) { + + editor.$handlesEmacsOnCopy = true; + var marks = editor.session.$emacsMarkRing.slice(), + deselectedMarks = []; + exports.killRing.add(editor.getCopyText()); + + setTimeout(function() { + function deselect() { + var sel = editor.selection, range = sel.getRange(), + pos = sel.isBackwards() ? range.end : range.start; + deselectedMarks.push({row: pos.row, column: pos.column}); + sel.clearSelection(); + } + editor.$handlesEmacsOnCopy = false; + if (editor.inMultiSelectMode) editor.forEachSelection({exec: deselect}); + else deselect(); + editor.session.$emacsMarkRing = marks.concat(deselectedMarks.reverse()); + }, 0); + }, + readOnly: true + }, + keyboardQuit: function(editor) { + editor.selection.clearSelection(); + editor.setEmacsMark(null); + editor.keyBinding.$data.count = null; + }, + focusCommandLine: function(editor, arg) { + if (editor.showCommandLine) + editor.showCommandLine(arg); + } +}); + +exports.handler.addCommands(iSearchCommandModule.iSearchStartCommands); + +var commands = exports.handler.commands; +commands.yank.isYank = true; +commands.yankRotate.isYank = true; + +exports.killRing = { + $data: [], + add: function(str) { + str && this.$data.push(str); + if (this.$data.length > 30) + this.$data.shift(); + }, + append: function(str) { + var idx = this.$data.length - 1; + var text = this.$data[idx] || ""; + if (str) text += str; + if (text) this.$data[idx] = text; + }, + get: function(n) { + n = n || 1; + return this.$data.slice(this.$data.length-n, this.$data.length).reverse().join('\n'); + }, + pop: function() { + if (this.$data.length > 1) + this.$data.pop(); + return this.get(); + }, + rotate: function() { + this.$data.unshift(this.$data.pop()); + return this.get(); + } +}; + +}); diff --git a/htdocs/includes/ace/keybinding-vim.js b/htdocs/includes/ace/keybinding-vim.js new file mode 100644 index 00000000000..5b0f378e6cd --- /dev/null +++ b/htdocs/includes/ace/keybinding-vim.js @@ -0,0 +1,5598 @@ +ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/dom","ace/lib/oop","ace/lib/keys","ace/lib/event","ace/search","ace/lib/useragent","ace/search_highlight","ace/commands/multi_select_commands","ace/mode/text","ace/multi_select"], function(require, exports, module) { + 'use strict'; + + function log() { + var d = ""; + function format(p) { + if (typeof p != "object") + return p + ""; + if ("line" in p) { + return p.line + ":" + p.ch; + } + if ("anchor" in p) { + return format(p.anchor) + "->" + format(p.head); + } + if (Array.isArray(p)) + return "[" + p.map(function(x) { + return format(x); + }) + "]"; + return JSON.stringify(p); + } + for (var i = 0; i < arguments.length; i++) { + var p = arguments[i]; + var f = format(p); + d += f + " "; + } + console.log(d); + } + var Range = require("../range").Range; + var EventEmitter = require("../lib/event_emitter").EventEmitter; + var dom = require("../lib/dom"); + var oop = require("../lib/oop"); + var KEYS = require("../lib/keys"); + var event = require("../lib/event"); + var Search = require("../search").Search; + var useragent = require("../lib/useragent"); + var SearchHighlight = require("../search_highlight").SearchHighlight; + var multiSelectCommands = require("../commands/multi_select_commands"); + var TextModeTokenRe = require("../mode/text").Mode.prototype.tokenRe; + require("../multi_select"); + + var CodeMirror = function(ace) { + this.ace = ace; + this.state = {}; + this.marks = {}; + this.$uid = 0; + this.onChange = this.onChange.bind(this); + this.onSelectionChange = this.onSelectionChange.bind(this); + this.onBeforeEndOperation = this.onBeforeEndOperation.bind(this); + this.ace.on('change', this.onChange); + this.ace.on('changeSelection', this.onSelectionChange); + this.ace.on('beforeEndOperation', this.onBeforeEndOperation); + }; + CodeMirror.Pos = function(line, ch) { + if (!(this instanceof Pos)) return new Pos(line, ch); + this.line = line; this.ch = ch; + }; + CodeMirror.defineOption = function(name, val, setter) {}; + CodeMirror.commands = { + redo: function(cm) { cm.ace.redo(); }, + undo: function(cm) { cm.ace.undo(); }, + newlineAndIndent: function(cm) { cm.ace.insert("\n"); } + }; + CodeMirror.keyMap = {}; + CodeMirror.addClass = CodeMirror.rmClass = + CodeMirror.e_stop = function() {}; + CodeMirror.keyName = function(e) { + if (e.key) return e.key; + var key = (KEYS[e.keyCode] || ""); + if (key.length == 1) key = key.toUpperCase(); + key = event.getModifierString(e).replace(/(^|-)\w/g, function(m) { + return m.toUpperCase(); + }) + key; + return key; + }; + CodeMirror.keyMap['default'] = function(key) { + return function(cm) { + var cmd = cm.ace.commands.commandKeyBinding[key.toLowerCase()]; + return cmd && cm.ace.execCommand(cmd) !== false; + }; + }; + CodeMirror.lookupKey = function lookupKey(key, map, handle) { + if (typeof map == "string") + map = CodeMirror.keyMap[map]; + var found = typeof map == "function" ? map(key) : map[key]; + if (found === false) return "nothing"; + if (found === "...") return "multi"; + if (found != null && handle(found)) return "handled"; + + if (map.fallthrough) { + if (!Array.isArray(map.fallthrough)) + return lookupKey(key, map.fallthrough, handle); + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle); + if (result) return result; + } + } + }; + + CodeMirror.signal = function(o, name, e) { return o._signal(name, e) }; + CodeMirror.on = event.addListener; + CodeMirror.off = event.removeListener; + CodeMirror.isWordChar = function(ch) { + if (ch < "\x7f") return /^\w$/.test(ch); + TextModeTokenRe.lastIndex = 0; + return TextModeTokenRe.test(ch); + }; + +(function() { + oop.implement(CodeMirror.prototype, EventEmitter); + + this.destroy = function() { + this.ace.off('change', this.onChange); + this.ace.off('changeSelection', this.onSelectionChange); + this.ace.off('beforeEndOperation', this.onBeforeEndOperation); + this.removeOverlay(); + }; + this.virtualSelectionMode = function() { + return this.ace.inVirtualSelectionMode && this.ace.selection.index; + }; + this.onChange = function(delta) { + var change = { text: delta.action[0] == 'i' ? delta.lines : [] }; + var curOp = this.curOp = this.curOp || {}; + if (!curOp.changeHandlers) + curOp.changeHandlers = this._eventRegistry["change"] && this._eventRegistry["change"].slice(); + if (this.virtualSelectionMode()) return; + if (!curOp.lastChange) { + curOp.lastChange = curOp.change = change; + } else { + curOp.lastChange.next = curOp.lastChange = change; + } + this.$updateMarkers(delta); + }; + this.onSelectionChange = function() { + var curOp = this.curOp = this.curOp || {}; + if (!curOp.cursorActivityHandlers) + curOp.cursorActivityHandlers = this._eventRegistry["cursorActivity"] && this._eventRegistry["cursorActivity"].slice(); + this.curOp.cursorActivity = true; + if (this.ace.inMultiSelectMode) { + this.ace.keyBinding.removeKeyboardHandler(multiSelectCommands.keyboardHandler); + } + }; + this.operation = function(fn, force) { + if (!force && this.curOp || force && this.curOp && this.curOp.force) { + return fn(); + } + if (force || !this.ace.curOp) { + if (this.curOp) + this.onBeforeEndOperation(); + } + if (!this.ace.curOp) { + var prevOp = this.ace.prevOp; + this.ace.startOperation({ + command: { name: "vim", scrollIntoView: "cursor" } + }); + } + var curOp = this.curOp = this.curOp || {}; + this.curOp.force = force; + var result = fn(); + if (this.ace.curOp && this.ace.curOp.command.name == "vim") { + this.ace.endOperation(); + if (!curOp.cursorActivity && !curOp.lastChange && prevOp) + this.ace.prevOp = prevOp; + } + if (force || !this.ace.curOp) { + if (this.curOp) + this.onBeforeEndOperation(); + } + return result; + }; + this.onBeforeEndOperation = function() { + var op = this.curOp; + if (op) { + if (op.change) { this.signal("change", op.change, op); } + if (op && op.cursorActivity) { this.signal("cursorActivity", null, op); } + this.curOp = null; + } + }; + + this.signal = function(eventName, e, handlers) { + var listeners = handlers ? handlers[eventName + "Handlers"] + : (this._eventRegistry || {})[eventName]; + if (!listeners) + return; + listeners = listeners.slice(); + for (var i=0; i 0) { + point.row += rowShift; + point.column += point.row == end.row ? colShift : 0; + continue; + } + if (!isInsert && cmp2 <= 0) { + point.row = start.row; + point.column = start.column; + if (cmp2 === 0) + point.bias = 1; + } + } + }; + var Marker = function(cm, id, row, column) { + this.cm = cm; + this.id = id; + this.row = row; + this.column = column; + cm.marks[this.id] = this; + }; + Marker.prototype.clear = function() { delete this.cm.marks[this.id] }; + Marker.prototype.find = function() { return toCmPos(this) }; + this.setBookmark = function(cursor, options) { + var bm = new Marker(this, this.$uid++, cursor.line, cursor.ch); + if (!options || !options.insertLeft) + bm.$insertRight = true; + this.marks[bm.id] = bm; + return bm; + }; + this.moveH = function(increment, unit) { + if (unit == 'char') { + var sel = this.ace.selection; + sel.clearSelection(); + sel.moveCursorBy(0, increment); + } + }; + this.findPosV = function(start, amount, unit, goalColumn) { + if (unit == 'page') { + var renderer = this.ace.renderer; + var config = renderer.layerConfig; + amount = amount * Math.floor(config.height / config.lineHeight); + unit = 'line'; + } + if (unit == 'line') { + var screenPos = this.ace.session.documentToScreenPosition(start.line, start.ch); + if (goalColumn != null) + screenPos.column = goalColumn; + screenPos.row += amount; + screenPos.row = Math.min(Math.max(0, screenPos.row), this.ace.session.getScreenLength() - 1); + var pos = this.ace.session.screenToDocumentPosition(screenPos.row, screenPos.column); + return toCmPos(pos); + } else { + debugger; + } + }; + this.charCoords = function(pos, mode) { + if (mode == 'div' || !mode) { + var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch); + return {left: sc.column, top: sc.row}; + }if (mode == 'local') { + var renderer = this.ace.renderer; + var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch); + var lh = renderer.layerConfig.lineHeight; + var cw = renderer.layerConfig.characterWidth; + var top = lh * sc.row; + return {left: sc.column * cw, top: top, bottom: top + lh}; + } + }; + this.coordsChar = function(pos, mode) { + var renderer = this.ace.renderer; + if (mode == 'local') { + var row = Math.max(0, Math.floor(pos.top / renderer.lineHeight)); + var col = Math.max(0, Math.floor(pos.left / renderer.characterWidth)); + var ch = renderer.session.screenToDocumentPosition(row, col); + return toCmPos(ch); + } else if (mode == 'div') { + throw "not implemented"; + } + }; + this.getSearchCursor = function(query, pos, caseFold) { + var caseSensitive = false; + var isRegexp = false; + if (query instanceof RegExp && !query.global) { + caseSensitive = !query.ignoreCase; + query = query.source; + isRegexp = true; + } + var search = new Search(); + if (pos.ch == undefined) pos.ch = Number.MAX_VALUE; + var acePos = {row: pos.line, column: pos.ch}; + var cm = this; + var last = null; + return { + findNext: function() { return this.find(false) }, + findPrevious: function() {return this.find(true) }, + find: function(back) { + search.setOptions({ + needle: query, + caseSensitive: caseSensitive, + wrap: false, + backwards: back, + regExp: isRegexp, + start: last || acePos + }); + var range = search.find(cm.ace.session); + if (range && range.isEmpty()) { + if (cm.getLine(range.start.row).length == range.start.column) { + search.$options.start = range; + range = search.find(cm.ace.session); + } + } + last = range; + return last; + }, + from: function() { return last && toCmPos(last.start) }, + to: function() { return last && toCmPos(last.end) }, + replace: function(text) { + if (last) { + last.end = cm.ace.session.doc.replace(last, text); + } + } + }; + }; + this.scrollTo = function(x, y) { + var renderer = this.ace.renderer; + var config = renderer.layerConfig; + var maxHeight = config.maxHeight; + maxHeight -= (renderer.$size.scrollerHeight - renderer.lineHeight) * renderer.$scrollPastEnd; + if (y != null) this.ace.session.setScrollTop(Math.max(0, Math.min(y, maxHeight))); + if (x != null) this.ace.session.setScrollLeft(Math.max(0, Math.min(x, config.width))); + }; + this.scrollInfo = function() { return 0; }; + this.scrollIntoView = function(pos, margin) { + if (pos) { + var renderer = this.ace.renderer; + var viewMargin = { "top": 0, "bottom": margin }; + renderer.scrollCursorIntoView(toAcePos(pos), + (renderer.lineHeight * 2) / renderer.$size.scrollerHeight, viewMargin); + } + }; + this.getLine = function(row) { return this.ace.session.getLine(row) }; + this.getRange = function(s, e) { + return this.ace.session.getTextRange(new Range(s.line, s.ch, e.line, e.ch)); + }; + this.replaceRange = function(text, s, e) { + if (!e) e = s; + return this.ace.session.replace(new Range(s.line, s.ch, e.line, e.ch), text); + }; + this.replaceSelections = function(p) { + var sel = this.ace.selection; + if (this.ace.inVirtualSelectionMode) { + this.ace.session.replace(sel.getRange(), p[0] || ""); + return; + } + sel.inVirtualSelectionMode = true; + var ranges = sel.rangeList.ranges; + if (!ranges.length) ranges = [this.ace.multiSelect.getRange()]; + for (var i = ranges.length; i--;) + this.ace.session.replace(ranges[i], p[i] || ""); + sel.inVirtualSelectionMode = false; + }; + this.getSelection = function() { + return this.ace.getSelectedText(); + }; + this.getSelections = function() { + return this.listSelections().map(function(x) { + return this.getRange(x.anchor, x.head); + }, this); + }; + this.getInputField = function() { + return this.ace.textInput.getElement(); + }; + this.getWrapperElement = function() { + return this.ace.containter; + }; + var optMap = { + indentWithTabs: "useSoftTabs", + indentUnit: "tabSize", + tabSize: "tabSize", + firstLineNumber: "firstLineNumber", + readOnly: "readOnly" + }; + this.setOption = function(name, val) { + this.state[name] = val; + switch (name) { + case 'indentWithTabs': + name = optMap[name]; + val = !val; + break; + default: + name = optMap[name]; + } + if (name) + this.ace.setOption(name, val); + }; + this.getOption = function(name, val) { + var aceOpt = optMap[name]; + if (aceOpt) + val = this.ace.getOption(aceOpt); + switch (name) { + case 'indentWithTabs': + name = optMap[name]; + return !val; + } + return aceOpt ? val : this.state[name]; + }; + this.toggleOverwrite = function(on) { + this.state.overwrite = on; + return this.ace.setOverwrite(on); + }; + this.addOverlay = function(o) { + if (!this.$searchHighlight || !this.$searchHighlight.session) { + var highlight = new SearchHighlight(null, "ace_highlight-marker", "text"); + var marker = this.ace.session.addDynamicMarker(highlight); + highlight.id = marker.id; + highlight.session = this.ace.session; + highlight.destroy = function(o) { + highlight.session.off("change", highlight.updateOnChange); + highlight.session.off("changeEditor", highlight.destroy); + highlight.session.removeMarker(highlight.id); + highlight.session = null; + }; + highlight.updateOnChange = function(delta) { + var row = delta.start.row; + if (row == delta.end.row) highlight.cache[row] = undefined; + else highlight.cache.splice(row, highlight.cache.length); + }; + highlight.session.on("changeEditor", highlight.destroy); + highlight.session.on("change", highlight.updateOnChange); + } + var re = new RegExp(o.query.source, "gmi"); + this.$searchHighlight = o.highlight = highlight; + this.$searchHighlight.setRegexp(re); + this.ace.renderer.updateBackMarkers(); + }; + this.removeOverlay = function(o) { + if (this.$searchHighlight && this.$searchHighlight.session) { + this.$searchHighlight.destroy(); + } + }; + this.getScrollInfo = function() { + var renderer = this.ace.renderer; + var config = renderer.layerConfig; + return { + left: renderer.scrollLeft, + top: renderer.scrollTop, + height: config.maxHeight, + width: config.width, + clientHeight: config.height, + clientWidth: config.width + }; + }; + this.getValue = function() { + return this.ace.getValue(); + }; + this.setValue = function(v) { + return this.ace.setValue(v); + }; + this.getTokenTypeAt = function(pos) { + var token = this.ace.session.getTokenAt(pos.line, pos.ch); + return token && /comment|string/.test(token.type) ? "string" : ""; + }; + this.findMatchingBracket = function(pos) { + var m = this.ace.session.findMatchingBracket(toAcePos(pos)); + return {to: m && toCmPos(m)}; + }; + this.indentLine = function(line, method) { + if (method === true) + this.ace.session.indentRows(line, line, "\t"); + else if (method === false) + this.ace.session.outdentRows(new Range(line, 0, line, 0)); + }; + this.indexFromPos = function(pos) { + return this.ace.session.doc.positionToIndex(toAcePos(pos)); + }; + this.posFromIndex = function(index) { + return toCmPos(this.ace.session.doc.indexToPosition(index)); + }; + this.focus = function(index) { + return this.ace.focus(); + }; + this.blur = function(index) { + return this.ace.blur(); + }; + this.defaultTextHeight = function(index) { + return this.ace.renderer.layerConfig.lineHeight; + }; + this.scanForBracket = function(pos, dir, _, options) { + var re = options.bracketRegex.source; + if (dir == 1) { + var m = this.ace.session.$findClosingBracket(re.slice(1, 2), toAcePos(pos), /paren|text/); + } else { + var m = this.ace.session.$findOpeningBracket(re.slice(-2, -1), {row: pos.line, column: pos.ch + 1}, /paren|text/); + } + return m && {pos: toCmPos(m)}; + }; + this.refresh = function() { + return this.ace.resize(true); + }; + this.getMode = function() { + return { name : this.getOption("mode") }; + } +}).call(CodeMirror.prototype); + function toAcePos(cmPos) { + return {row: cmPos.line, column: cmPos.ch}; + } + function toCmPos(acePos) { + return new Pos(acePos.row, acePos.column); + } + + var StringStream = CodeMirror.StringStream = function(string, tabSize) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + }; + + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == this.lineStart;}, + 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() { + throw "not implemented"; + }, + indentation: function() { + throw "not implemented"; + }, + 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);}, + hideFirstChars: function(n, inner) { + this.lineStart += n; + try { return inner(); } + finally { this.lineStart -= n; } + } + }; +CodeMirror.defineExtension = function(name, fn) { + CodeMirror.prototype[name] = fn; +}; +dom.importCssString(".normal-mode .ace_cursor{\ + border: 1px solid red;\ + background-color: red;\ + opacity: 0.5;\ +}\ +.normal-mode .ace_hidden-cursors .ace_cursor{\ + background-color: transparent;\ +}\ +.ace_dialog {\ + position: absolute;\ + left: 0; right: 0;\ + background: white;\ + z-index: 15;\ + padding: .1em .8em;\ + overflow: hidden;\ + color: #333;\ +}\ +.ace_dialog-top {\ + border-bottom: 1px solid #eee;\ + top: 0;\ +}\ +.ace_dialog-bottom {\ + border-top: 1px solid #eee;\ + bottom: 0;\ +}\ +.ace_dialog input {\ + border: none;\ + outline: none;\ + background: transparent;\ + width: 20em;\ + color: inherit;\ + font-family: monospace;\ +}", "vimMode"); +(function() { + function dialogDiv(cm, template, bottom) { + var wrap = cm.ace.container; + var dialog; + dialog = wrap.appendChild(document.createElement("div")); + if (bottom) + dialog.className = "ace_dialog ace_dialog-bottom"; + else + dialog.className = "ace_dialog ace_dialog-top"; + + if (typeof template == "string") { + dialog.innerHTML = template; + } else { // Assuming it's a detached DOM element. + dialog.appendChild(template); + } + return dialog; + } + + function closeNotification(cm, newVal) { + if (cm.state.currentNotificationClose) + cm.state.currentNotificationClose(); + cm.state.currentNotificationClose = newVal; + } + + CodeMirror.defineExtension("openDialog", function(template, callback, options) { + if (this.virtualSelectionMode()) return; + if (!options) options = {}; + + closeNotification(this, null); + + var dialog = dialogDiv(this, template, options.bottom); + var closed = false, me = this; + function close(newVal) { + if (typeof newVal == 'string') { + inp.value = newVal; + } else { + if (closed) return; + closed = true; + dialog.parentNode.removeChild(dialog); + me.focus(); + + if (options.onClose) options.onClose(dialog); + } + } + + var inp = dialog.getElementsByTagName("input")[0], button; + if (inp) { + if (options.value) { + inp.value = options.value; + if (options.select !== false) inp.select(); + } + + if (options.onInput) + CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);}); + if (options.onKeyUp) + CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);}); + + CodeMirror.on(inp, "keydown", function(e) { + if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; } + if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) { + inp.blur(); + CodeMirror.e_stop(e); + close(); + } + if (e.keyCode == 13) callback(inp.value); + }); + + if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close); + + inp.focus(); + } else if (button = dialog.getElementsByTagName("button")[0]) { + CodeMirror.on(button, "click", function() { + close(); + me.focus(); + }); + + if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close); + + button.focus(); + } + return close; + }); + + CodeMirror.defineExtension("openNotification", function(template, options) { + if (this.virtualSelectionMode()) return; + closeNotification(this, close); + var dialog = dialogDiv(this, template, options && options.bottom); + var closed = false, doneTimer; + var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000; + + function close() { + if (closed) return; + closed = true; + clearTimeout(doneTimer); + dialog.parentNode.removeChild(dialog); + } + + CodeMirror.on(dialog, 'click', function(e) { + CodeMirror.e_preventDefault(e); + close(); + }); + + if (duration) + doneTimer = setTimeout(close, duration); + + return close; + }); +})(); + + + var defaultKeymap = [ + { 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', context: 'normal'}, + { keys: '', type: 'keyToKey', toKeys: 'W' }, + { keys: '', type: 'keyToKey', toKeys: 'B', context: 'normal' }, + { keys: '', type: 'keyToKey', toKeys: 'w' }, + { keys: '', type: 'keyToKey', toKeys: 'b', context: 'normal' }, + { keys: '', type: 'keyToKey', toKeys: 'j' }, + { keys: '', type: 'keyToKey', toKeys: 'k' }, + { keys: '', type: 'keyToKey', toKeys: '' }, + { keys: '', type: 'keyToKey', toKeys: '' }, + { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, + { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, + { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' }, + { keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'}, + { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' }, + { keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' }, + { keys: '', type: 'keyToKey', toKeys: '0' }, + { keys: '', type: 'keyToKey', toKeys: '$' }, + { keys: '', type: 'keyToKey', toKeys: '' }, + { keys: '', type: 'keyToKey', toKeys: '' }, + { keys: '', type: 'keyToKey', toKeys: 'j^', context: 'normal' }, + { 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: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true }}, + { keys: 'gk', 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: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true }}, + { keys: 'gE', 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: 'gg', 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', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true , inclusive: true }}, + { keys: 'F', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false }}, + { keys: 't', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true }}, + { keys: 'T', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false }}, + { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true }}, + { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false }}, + { keys: '\'', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true, linewise: true}}, + { keys: '`', 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: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true}}, + { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true}}, + { keys: ']', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true}}, + { keys: '[', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true}}, + { keys: '|', type: 'motion', motion: 'moveToColumn'}, + { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context:'visual'}, + { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: {sameLine: true}, context:'visual'}, + { keys: 'd', type: 'operator', operator: 'delete' }, + { keys: 'y', type: 'operator', operator: 'yank' }, + { keys: 'c', type: 'operator', operator: 'change' }, + { keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true }}, + { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }}, + { keys: 'g~', type: 'operator', operator: 'changeCase' }, + { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, isEdit: true }, + { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true }, + { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }}, + { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }}, + { 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 }, context: 'normal'}, + { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'}, + { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, + { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'}, + { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, + { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'}, + { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'}, + { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'}, + { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' }, + { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }}, + { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }}, + { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }}, + { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true }}, + { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' }, + { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' }, + { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' }, + { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' }, + { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' }, + { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' }, + { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' }, + { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' }, + { keys: 'v', type: 'action', action: 'toggleVisualMode' }, + { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }}, + { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, + { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, + { keys: 'gv', type: 'action', action: 'reselectLastSelection' }, + { 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', type: 'action', action: 'replace', isEdit: true }, + { keys: '@', type: 'action', action: 'replayMacro' }, + { keys: 'q', type: 'action', action: 'enterMacroRecordMode' }, + { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }}, + { keys: 'u', type: 'action', action: 'undo', context: 'normal' }, + { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true }, + { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true }, + { keys: '', type: 'action', action: 'redo' }, + { keys: 'm', type: 'action', action: 'setMark' }, + { keys: '"', type: 'action', action: 'setRegister' }, + { keys: 'zz', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }}, + { keys: 'z.', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, + { keys: 'zt', 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: 'zb', 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}}, + { keys: 'a', type: 'motion', motion: 'textObjectManipulation' }, + { keys: 'i', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true }}, + { 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', wholeWordOnly: true, toJumplist: true }}, + { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, + { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }}, + { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }}, + { keys: ':', type: 'ex' } + ]; + var defaultExCommandMap = [ + { name: 'colorscheme', shortName: 'colo' }, + { name: 'map' }, + { name: 'imap', shortName: 'im' }, + { name: 'nmap', shortName: 'nm' }, + { name: 'vmap', shortName: 'vm' }, + { name: 'unmap' }, + { name: 'write', shortName: 'w' }, + { name: 'undo', shortName: 'u' }, + { name: 'redo', shortName: 'red' }, + { name: 'set', shortName: 'se' }, + { name: 'set', shortName: 'se' }, + { name: 'setlocal', shortName: 'setl' }, + { name: 'setglobal', shortName: 'setg' }, + { name: 'sort', shortName: 'sor' }, + { name: 'substitute', shortName: 's', possiblyAsync: true }, + { name: 'nohlsearch', shortName: 'noh' }, + { name: 'delmarks', shortName: 'delm' }, + { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, + { name: 'global', shortName: 'g' } + ]; + + var Pos = CodeMirror.Pos; + + var Vim = function() { return vimApi; } //{ + function enterVimMode(cm) { + cm.setOption('disableInput', true); + cm.setOption('showCursorWhenSelecting', false); + CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); + cm.on('cursorActivity', onCursorActivity); + maybeInitVimState(cm); + CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm)); + } + + function leaveVimMode(cm) { + cm.setOption('disableInput', false); + cm.off('cursorActivity', onCursorActivity); + CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm)); + cm.state.vim = null; + } + + function detachVimMap(cm, next) { + if (this == CodeMirror.keyMap.vim) + CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor"); + + if (!next || next.attach != attachVimMap) + leaveVimMode(cm, false); + } + function attachVimMap(cm, prev) { + if (this == CodeMirror.keyMap.vim) + CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor"); + + if (!prev || prev.attach != attachVimMap) + enterVimMode(cm); + } + CodeMirror.defineOption('vimMode', false, function(cm, val, prev) { + if (val && cm.getOption("keyMap") != "vim") + cm.setOption("keyMap", "vim"); + else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap"))) + cm.setOption("keyMap", "default"); + }); + + function cmKey(key, cm) { + if (!cm) { return undefined; } + var vimKey = cmKeyToVimKey(key); + if (!vimKey) { + return false; + } + var cmd = CodeMirror.Vim.findKey(cm, vimKey); + if (typeof cmd == 'function') { + CodeMirror.signal(cm, 'vim-keypress', vimKey); + } + return cmd; + } + + var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'}; + var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del'}; + function cmKeyToVimKey(key) { + if (key.charAt(0) == '\'') { + return key.charAt(1); + } + var pieces = key.split(/-(?!$)/); + var lastPiece = pieces[pieces.length - 1]; + if (pieces.length == 1 && pieces[0].length == 1) { + return false; + } else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) { + return false; + } + var hasCharacter = false; + for (var i = 0; i < pieces.length; i++) { + var piece = pieces[i]; + if (piece in modifiers) { pieces[i] = modifiers[piece]; } + else { hasCharacter = true; } + if (piece in specialKeys) { pieces[i] = specialKeys[piece]; } + } + if (!hasCharacter) { + return false; + } + if (isUpperCase(lastPiece)) { + pieces[pieces.length - 1] = lastPiece.toLowerCase(); + } + return '<' + pieces.join('-') + '>'; + } + + function getOnPasteFn(cm) { + var vim = cm.state.vim; + if (!vim.onPasteFn) { + vim.onPasteFn = function() { + if (!vim.insertMode) { + cm.setCursor(offsetCursor(cm.getCursor(), 0, 1)); + actions.enterInsertMode(cm, {}, vim); + } + }; + } + return vim.onPasteFn; + } + + var numberRegex = /[\d]/; + var wordCharTest = [CodeMirror.isWordChar, function(ch) { + return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch); + }], bigWordCharTest = [function(ch) { + return /\S/.test(ch); + }]; + 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 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 options = {}; + function defineOption(name, defaultValue, type, aliases, callback) { + if (defaultValue === undefined && !callback) { + throw Error('defaultValue is required unless callback is provided'); + } + if (!type) { type = 'string'; } + options[name] = { + type: type, + defaultValue: defaultValue, + callback: callback + }; + if (aliases) { + for (var i = 0; i < aliases.length; i++) { + options[aliases[i]] = options[name]; + } + } + if (defaultValue) { + setOption(name, defaultValue); + } + } + + function setOption(name, value, cm, cfg) { + var option = options[name]; + cfg = cfg || {}; + var scope = cfg.scope; + if (!option) { + throw Error('Unknown option: ' + name); + } + if (option.type == 'boolean') { + if (value && value !== true) { + throw Error('Invalid argument: ' + name + '=' + value); + } else if (value !== false) { + value = true; + } + } + if (option.callback) { + if (scope !== 'local') { + option.callback(value, undefined); + } + if (scope !== 'global' && cm) { + option.callback(value, cm); + } + } else { + if (scope !== 'local') { + option.value = option.type == 'boolean' ? !!value : value; + } + if (scope !== 'global' && cm) { + cm.state.vim.options[name] = {value: value}; + } + } + } + + function getOption(name, cm, cfg) { + var option = options[name]; + cfg = cfg || {}; + var scope = cfg.scope; + if (!option) { + throw Error('Unknown option: ' + name); + } + if (option.callback) { + var local = cm && option.callback(undefined, cm); + if (scope !== 'global' && local !== undefined) { + return local; + } + if (scope !== 'local') { + return option.callback(); + } + return; + } else { + var local = (scope !== 'global') && (cm && cm.state.vim.options[name]); + return (local || (scope !== 'local') && option || {}).value; + } + } + + defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) { + if (cm === undefined) { + return; + } + if (name === undefined) { + var mode = cm.getOption('mode'); + return mode == 'null' ? '' : mode; + } else { + var mode = name == '' ? 'null' : name; + cm.setOption('mode', mode); + } + }); + + 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(); + 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]; + if (mark && !mark.find()) { + var inc = offset > 0 ? 1 : -1; + var newCur; + var oldCur = cm.getCursor(); + do { + pointer += inc; + mark = buffer[(size + pointer) % size]; + 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 createInsertModeChanges = function(c) { + if (c) { + return { + changes: c.changes, + expectCursorActivityForChange: c.expectCursorActivityForChange + }; + } + return { + changes: [], + expectCursorActivityForChange: false + }; + }; + + function MacroModeState() { + this.latestRegister = undefined; + this.isPlaying = false; + this.isRecording = false; + this.replaySearchQueries = []; + this.onRecordingDone = undefined; + this.lastInsertModeChanges = createInsertModeChanges(); + } + MacroModeState.prototype = { + exitMacroRecordMode: function() { + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.onRecordingDone) { + macroModeState.onRecordingDone(); // close dialog + } + macroModeState.onRecordingDone = undefined; + macroModeState.isRecording = false; + }, + enterMacroRecordMode: function(cm, registerName) { + var register = + vimGlobalState.registerController.getRegister(registerName); + if (register) { + register.clear(); + this.latestRegister = registerName; + if (cm.openDialog) { + this.onRecordingDone = cm.openDialog( + '(recording)['+registerName+']', null, {bottom:true}); + } + this.isRecording = true; + } + } + }; + + function maybeInitVimState(cm) { + if (!cm.state.vim) { + cm.state.vim = { + inputState: new InputState(), + lastEditInputState: undefined, + lastEditActionCommand: undefined, + lastHPos: -1, + lastHSPos: -1, + lastMotion: null, + marks: {}, + fakeCursor: null, + insertMode: false, + insertModeRepeat: undefined, + visualMode: false, + visualLine: false, + visualBlock: false, + lastSelection: null, + lastPastedText: null, + sel: {}, + options: {} + }; + } + return cm.state.vim; + } + var vimGlobalState; + function resetVimGlobalState() { + vimGlobalState = { + searchQuery: null, + searchIsReversed: false, + lastSubstituteReplacePart: undefined, + jumpList: createCircularJumpList(), + macroModeState: new MacroModeState, + lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''}, + registerController: new RegisterController({}), + searchHistoryController: new HistoryController({}), + exCommandHistoryController : new HistoryController({}) + }; + for (var optionName in options) { + var option = options[optionName]; + option.value = option.defaultValue; + } + } + + var lastInsertModeKeyTimer; + var vimApi= { + buildKeyMap: function() { + }, + getRegisterController: function() { + return vimGlobalState.registerController; + }, + resetVimGlobalState_: resetVimGlobalState, + getVimGlobalState_: function() { + return vimGlobalState; + }, + maybeInitVimState_: maybeInitVimState, + + suppressErrorLogging: false, + + InsertModeKey: InsertModeKey, + map: function(lhs, rhs, ctx) { + exCommandDispatcher.map(lhs, rhs, ctx); + }, + unmap: function(lhs, ctx) { + exCommandDispatcher.unmap(lhs, ctx); + }, + setOption: setOption, + getOption: getOption, + defineOption: defineOption, + defineEx: function(name, prefix, func){ + if (!prefix) { + prefix = name; + } else 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'}; + }, + handleKey: function (cm, key, origin) { + var command = this.findKey(cm, key, origin); + if (typeof command === 'function') { + return command(); + } + }, + findKey: function(cm, key, origin) { + var vim = maybeInitVimState(cm); + function handleMacroRecording() { + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isRecording) { + if (key == 'q') { + macroModeState.exitMacroRecordMode(); + clearInputState(cm); + return true; + } + if (origin != 'mapping') { + logKey(macroModeState, key); + } + } + } + function handleEsc() { + if (key == '') { + clearInputState(cm); + if (vim.visualMode) { + exitVisualMode(cm); + } else if (vim.insertMode) { + exitInsertMode(cm); + } + return true; + } + } + function doKeyToKey(keys) { + var match; + while (keys) { + match = (/<\w+-.+?>|<\w+>|./).exec(keys); + key = match[0]; + keys = keys.substring(match.index + key.length); + CodeMirror.Vim.handleKey(cm, key, 'mapping'); + } + } + + function handleKeyInsertMode() { + if (handleEsc()) { return true; } + var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; + var keysAreChars = key.length == 1; + var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); + while (keys.length > 1 && match.type != 'full') { + var keys = vim.inputState.keyBuffer = keys.slice(1); + var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); + if (thisMatch.type != 'none') { match = thisMatch; } + } + if (match.type == 'none') { clearInputState(cm); return false; } + else if (match.type == 'partial') { + if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } + lastInsertModeKeyTimer = window.setTimeout( + function() { if (vim.insertMode && vim.inputState.keyBuffer) { clearInputState(cm); } }, + getOption('insertModeEscKeysTimeout')); + return !keysAreChars; + } + + if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } + if (keysAreChars) { + var selections = cm.listSelections(); + for (var i = 0; i < selections.length; i++) { + var here = selections[i].head; + cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input'); + } + vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop(); + } + clearInputState(cm); + return match.command; + } + + function handleKeyNonInsertMode() { + if (handleMacroRecording() || handleEsc()) { return true; } + + var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; + if (/^[1-9]\d*$/.test(keys)) { return true; } + + var keysMatcher = /^(\d*)(.*)$/.exec(keys); + if (!keysMatcher) { clearInputState(cm); return false; } + var context = vim.visualMode ? 'visual' : + 'normal'; + var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context); + if (match.type == 'none') { clearInputState(cm); return false; } + else if (match.type == 'partial') { return true; } + + vim.inputState.keyBuffer = ''; + var keysMatcher = /^(\d*)(.*)$/.exec(keys); + if (keysMatcher[1] && keysMatcher[1] != '0') { + vim.inputState.pushRepeatDigit(keysMatcher[1]); + } + return match.command; + } + + var command; + if (vim.insertMode) { command = handleKeyInsertMode(); } + else { command = handleKeyNonInsertMode(); } + if (command === false) { + return undefined; + } else if (command === true) { + return function() { return true; }; + } else { + return function() { + if ((command.operator || command.isEdit) && cm.getOption('readOnly')) + return; // ace_patch + return cm.operation(function() { + cm.curOp.isVimOp = true; + try { + if (command.type == 'keyToKey') { + doKeyToKey(command.toKeys); + } else { + commandDispatcher.processCommand(cm, vim, command); + } + } catch (e) { + cm.state.vim = undefined; + maybeInitVimState(cm); + if (!CodeMirror.Vim.suppressErrorLogging) { + console['log'](e); + } + throw e; + } + return true; + }); + }; + } + }, + handleEx: function(cm, input) { + exCommandDispatcher.processCommand(cm, input); + }, + + defineMotion: defineMotion, + defineAction: defineAction, + defineOperator: defineOperator, + mapCommand: mapCommand, + _mapCommand: _mapCommand, + + defineRegister: defineRegister, + + exitVisualMode: exitVisualMode, + exitInsertMode: exitInsertMode + }; + 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 unnamed 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; + }; + + function clearInputState(cm, reason) { + cm.state.vim.inputState = new InputState(); + CodeMirror.signal(cm, 'vim-command-done', reason); + } + function Register(text, linewise, blockwise) { + this.clear(); + this.keyBuffer = [text || '']; + this.insertModeChanges = []; + this.searchQueries = []; + this.linewise = !!linewise; + this.blockwise = !!blockwise; + } + Register.prototype = { + setText: function(text, linewise, blockwise) { + this.keyBuffer = [text || '']; + this.linewise = !!linewise; + this.blockwise = !!blockwise; + }, + pushText: function(text, linewise) { + if (linewise) { + if (!this.linewise) { + this.keyBuffer.push('\n'); + } + this.linewise = true; + } + this.keyBuffer.push(text); + }, + pushInsertModeChanges: function(changes) { + this.insertModeChanges.push(createInsertModeChanges(changes)); + }, + pushSearchQuery: function(query) { + this.searchQueries.push(query); + }, + clear: function() { + this.keyBuffer = []; + this.insertModeChanges = []; + this.searchQueries = []; + this.linewise = false; + }, + toString: function() { + return this.keyBuffer.join(''); + } + }; + function defineRegister(name, register) { + var registers = vimGlobalState.registerController.registers[name]; + if (!name || name.length != 1) { + throw Error('Register name must be 1 character'); + } + registers[name] = register; + validRegisters.push(name); + } + function RegisterController(registers) { + this.registers = registers; + this.unnamedRegister = registers['"'] = new Register(); + registers['.'] = new Register(); + registers[':'] = new Register(); + registers['/'] = new Register(); + } + RegisterController.prototype = { + pushText: function(registerName, operator, text, linewise, blockwise) { + if (linewise && text.charAt(0) == '\n') { + text = text.slice(1) + '\n'; + } + if (linewise && text.charAt(text.length - 1) !== '\n'){ + text += '\n'; + } + var register = this.isValidRegister(registerName) ? + this.getRegister(registerName) : null; + if (!register) { + switch (operator) { + case 'yank': + this.registers['0'] = new Register(text, linewise, blockwise); + break; + case 'delete': + case 'change': + if (text.indexOf('\n') == -1) { + this.registers['-'] = new Register(text, linewise); + } else { + this.shiftNumericRegisters_(); + this.registers['1'] = new Register(text, linewise); + } + break; + } + this.unnamedRegister.setText(text, linewise, blockwise); + return; + } + var append = isUpperCase(registerName); + if (append) { + register.pushText(text, linewise); + } else { + register.setText(text, linewise, blockwise); + } + this.unnamedRegister.setText(register.toString(), linewise); + }, + getRegister: function(name) { + if (!this.isValidRegister(name)) { + return this.unnamedRegister; + } + 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)); + } + } + }; + function HistoryController() { + this.historyBuffer = []; + this.iterator; + this.initialPrefix = null; + } + HistoryController.prototype = { + nextMatch: function (input, up) { + var historyBuffer = this.historyBuffer; + var dir = up ? -1 : 1; + if (this.initialPrefix === null) this.initialPrefix = input; + for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i+= dir) { + var element = historyBuffer[i]; + for (var j = 0; j <= element.length; j++) { + if (this.initialPrefix == element.substring(0, j)) { + this.iterator = i; + return element; + } + } + } + if (i >= historyBuffer.length) { + this.iterator = historyBuffer.length; + return this.initialPrefix; + } + if (i < 0 ) return input; + }, + pushInput: function(input) { + var index = this.historyBuffer.indexOf(input); + if (index > -1) this.historyBuffer.splice(index, 1); + if (input.length) this.historyBuffer.push(input); + }, + reset: function() { + this.initialPrefix = null; + this.iterator = this.historyBuffer.length; + } + }; + var commandDispatcher = { + matchCommand: function(keys, keyMap, inputState, context) { + var matches = commandMatches(keys, keyMap, context, inputState); + if (!matches.full && !matches.partial) { + return {type: 'none'}; + } else if (!matches.full && matches.partial) { + return {type: 'partial'}; + } + + var bestMatch; + for (var i = 0; i < matches.full.length; i++) { + var match = matches.full[i]; + if (!bestMatch) { + bestMatch = match; + } + } + if (bestMatch.keys.slice(-11) == '') { + var character = lastChar(keys); + if (//.test(character)) return {type: 'none'}; + inputState.selectedCharacter = character; + } + return {type: 'full', command: bestMatch}; + }, + 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) { + inputState.motion = 'expandToLine'; + inputState.motionArgs = { linewise: true }; + this.evalInput(cm, vim); + return; + } else { + clearInputState(cm); + } + } + inputState.operator = command.operator; + inputState.operatorArgs = copyArgs(command.operatorArgs); + if (vim.visualMode) { + this.evalInput(cm, vim); + } + }, + processOperatorMotion: function(cm, vim, command) { + var visualMode = vim.visualMode; + var operatorMotionArgs = copyArgs(command.operatorMotionArgs); + if (operatorMotionArgs) { + 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; + } + 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; + clearInputState(cm); + 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) { + return; + } + var forward = command.searchArgs.forward; + var wholeWordOnly = command.searchArgs.wholeWordOnly; + getSearchState(cm).setReversed(!forward); + var promptPrefix = (forward) ? '/' : '?'; + var originalQuery = getSearchState(cm).getQuery(); + var originalScrollPos = cm.getScrollInfo(); + function handleQuery(query, ignoreCase, smartCase) { + vimGlobalState.searchHistoryController.pushInput(query); + vimGlobalState.searchHistoryController.reset(); + try { + updateSearchQuery(cm, query, ignoreCase, smartCase); + } catch (e) { + showConfirm(cm, 'Invalid regex: ' + query); + clearInputState(cm); + 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 */); + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isRecording) { + logSearchQuery(macroModeState, query); + } + } + function onPromptKeyUp(e, query, close) { + var keyName = CodeMirror.keyName(e), up; + if (keyName == 'Up' || keyName == 'Down') { + up = keyName == 'Up' ? true : false; + query = vimGlobalState.searchHistoryController.nextMatch(query, up) || ''; + close(query); + } else { + if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') + vimGlobalState.searchHistoryController.reset(); + } + var parsedQuery; + try { + parsedQuery = updateSearchQuery(cm, query, + true /** ignoreCase */, true /** smartCase */); + } catch (e) { + } + 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-[' || + (keyName == 'Backspace' && query == '')) { + vimGlobalState.searchHistoryController.pushInput(query); + vimGlobalState.searchHistoryController.reset(); + updateSearchQuery(cm, originalQuery); + clearSearchHighlight(cm); + cm.scrollTo(originalScrollPos.left, originalScrollPos.top); + CodeMirror.e_stop(e); + clearInputState(cm); + close(); + cm.focus(); + } else if (keyName == 'Ctrl-U') { + CodeMirror.e_stop(e); + close(''); + } + } + switch (command.searchArgs.querySrc) { + case 'prompt': + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isPlaying) { + var query = macroModeState.replaySearchQueries.shift(); + handleQuery(query, true /** ignoreCase */, false /** smartCase */); + } else { + 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 && wholeWordOnly) { + query = '\\b' + query + '\\b'; + } else { + query = escapeRegex(query); + } + vimGlobalState.jumpList.cachedCursor = cm.getCursor(); + cm.setCursor(word.start); + + handleQuery(query, true /** ignoreCase */, false /** smartCase */); + break; + } + }, + processEx: function(cm, vim, command) { + function onPromptClose(input) { + vimGlobalState.exCommandHistoryController.pushInput(input); + vimGlobalState.exCommandHistoryController.reset(); + exCommandDispatcher.processCommand(cm, input); + } + function onPromptKeyDown(e, input, close) { + var keyName = CodeMirror.keyName(e), up; + if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || + (keyName == 'Backspace' && input == '')) { + vimGlobalState.exCommandHistoryController.pushInput(input); + vimGlobalState.exCommandHistoryController.reset(); + CodeMirror.e_stop(e); + clearInputState(cm); + close(); + cm.focus(); + } + if (keyName == 'Up' || keyName == 'Down') { + up = keyName == 'Up' ? true : false; + input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; + close(input); + } else if (keyName == 'Ctrl-U') { + CodeMirror.e_stop(e); + close(''); + } else { + if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') + vimGlobalState.exCommandHistoryController.reset(); + } + } + if (command.type == 'keyToEx') { + 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) { + 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 sel = vim.sel; + var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head')); + var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor')); + var oldHead = copyCursor(origHead); + var oldAnchor = copyCursor(origAnchor); + var newHead, newAnchor; + var repeat; + if (operator) { + this.recordLastEdit(vim, inputState); + } + if (inputState.repeatOverride !== undefined) { + 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) { + motionArgs.selectedCharacter = operatorArgs.selectedCharacter = + inputState.selectedCharacter; + } + motionArgs.repeat = repeat; + clearInputState(cm); + if (motion) { + var motionResult = motions[motion](cm, origHead, motionArgs, vim); + vim.lastMotion = motions[motion]; + if (!motionResult) { + return; + } + if (motionArgs.toJumplist) { + if (!operator && cm.ace.curOp != null) + cm.ace.curOp.command.scrollIntoView = "center-animate"; // ace_patch + var jumpList = vimGlobalState.jumpList; + var cachedCursor = jumpList.cachedCursor; + if (cachedCursor) { + recordJumpPosition(cm, cachedCursor, motionResult); + delete jumpList.cachedCursor; + } else { + recordJumpPosition(cm, origHead, motionResult); + } + } + if (motionResult instanceof Array) { + newAnchor = motionResult[0]; + newHead = motionResult[1]; + } else { + newHead = motionResult; + } + if (!newHead) { + newHead = copyCursor(origHead); + } + if (vim.visualMode) { + if (!(vim.visualBlock && newHead.ch === Infinity)) { + newHead = clipCursorToContent(cm, newHead, vim.visualBlock); + } + if (newAnchor) { + newAnchor = clipCursorToContent(cm, newAnchor, true); + } + newAnchor = newAnchor || oldAnchor; + sel.anchor = newAnchor; + sel.head = newHead; + updateCmSelection(cm); + updateMark(cm, vim, '<', + cursorIsBefore(newAnchor, newHead) ? newAnchor + : newHead); + updateMark(cm, vim, '>', + cursorIsBefore(newAnchor, newHead) ? newHead + : newAnchor); + } else if (!operator) { + newHead = clipCursorToContent(cm, newHead); + cm.setCursor(newHead.line, newHead.ch); + } + } + if (operator) { + if (operatorArgs.lastSel) { + newAnchor = oldAnchor; + var lastSel = operatorArgs.lastSel; + var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line); + var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch); + if (lastSel.visualLine) { + newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); + } else if (lastSel.visualBlock) { + newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset); + } else if (lastSel.head.line == lastSel.anchor.line) { + newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset); + } else { + newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); + } + vim.visualMode = true; + vim.visualLine = lastSel.visualLine; + vim.visualBlock = lastSel.visualBlock; + sel = vim.sel = { + anchor: newAnchor, + head: newHead + }; + updateCmSelection(cm); + } else if (vim.visualMode) { + operatorArgs.lastSel = { + anchor: copyCursor(sel.anchor), + head: copyCursor(sel.head), + visualBlock: vim.visualBlock, + visualLine: vim.visualLine + }; + } + var curStart, curEnd, linewise, mode; + var cmSel; + if (vim.visualMode) { + curStart = cursorMin(sel.head, sel.anchor); + curEnd = cursorMax(sel.head, sel.anchor); + linewise = vim.visualLine || operatorArgs.linewise; + mode = vim.visualBlock ? 'block' : + linewise ? 'line' : + 'char'; + cmSel = makeCmSelection(cm, { + anchor: curStart, + head: curEnd + }, mode); + if (linewise) { + var ranges = cmSel.ranges; + if (mode == 'block') { + for (var i = 0; i < ranges.length; i++) { + ranges[i].head.ch = lineLength(cm, ranges[i].head.line); + } + } else if (mode == 'line') { + ranges[0].head = Pos(ranges[0].head.line + 1, 0); + } + } + } else { + curStart = copyCursor(newAnchor || oldAnchor); + curEnd = copyCursor(newHead || oldHead); + if (cursorIsBefore(curEnd, curStart)) { + var tmp = curStart; + curStart = curEnd; + curEnd = tmp; + } + linewise = motionArgs.linewise || operatorArgs.linewise; + if (linewise) { + expandSelectionToLine(cm, curStart, curEnd); + } else if (motionArgs.forward) { + clipToLine(cm, curStart, curEnd); + } + mode = 'char'; + var exclusive = !motionArgs.inclusive || linewise; + cmSel = makeCmSelection(cm, { + anchor: curStart, + head: curEnd + }, mode, exclusive); + } + cm.setSelections(cmSel.ranges, cmSel.primary); + vim.lastMotion = null; + operatorArgs.repeat = repeat; // For indent in visual mode. + operatorArgs.registerName = registerName; + operatorArgs.linewise = linewise; + var operatorMoveTo = operators[operator]( + cm, operatorArgs, cmSel.ranges, oldAnchor, newHead); + if (vim.visualMode) { + exitVisualMode(cm, operatorMoveTo != null); + } + if (operatorMoveTo) { + cm.setCursor(operatorMoveTo); + } + } + }, + recordLastEdit: function(vim, inputState, actionCommand) { + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isPlaying) { return; } + vim.lastEditInputState = inputState; + vim.lastEditActionCommand = actionCommand; + macroModeState.lastInsertModeChanges.changes = []; + macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false; + } + }; + var motions = { + moveToTopLine: function(cm, _head, motionArgs) { + var line = getUserVisibleLines(cm).top + motionArgs.repeat -1; + return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); + }, + moveToMiddleLine: function(cm) { + var range = getUserVisibleLines(cm); + var line = Math.floor((range.top + range.bottom) * 0.5); + return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); + }, + moveToBottomLine: function(cm, _head, motionArgs) { + var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1; + return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); + }, + expandToLine: function(_cm, head, motionArgs) { + var cur = head; + return Pos(cur.line + motionArgs.repeat - 1, Infinity); + }, + findNext: function(cm, _head, motionArgs) { + var state = getSearchState(cm); + var query = state.getQuery(); + if (!query) { + return; + } + var prev = !motionArgs.forward; + prev = (state.isReversed()) ? !prev : prev; + highlightSearchMatches(cm, query); + return findNext(cm, prev/** prev */, query, motionArgs.repeat); + }, + goToMark: function(cm, _head, motionArgs, vim) { + var mark = vim.marks[motionArgs.selectedCharacter]; + if (mark) { + var pos = mark.find(); + return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos; + } + return null; + }, + moveToOtherHighlightedEnd: function(cm, _head, motionArgs, vim) { + if (vim.visualBlock && motionArgs.sameLine) { + var sel = vim.sel; + return [ + clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)), + clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch)) + ]; + } else { + return ([vim.sel.head, vim.sel.anchor]); + } + }, + jumpToMark: function(cm, head, motionArgs, vim) { + var best = head; + 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) ? + cursorIsBetween(cursor, mark, best) : + cursorIsBetween(best, mark, cursor); + + if (equal || between) { + best = mark; + } + } + } + + if (motionArgs.linewise) { + best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line))); + } + return best; + }, + moveByCharacters: function(_cm, head, motionArgs) { + var cur = head; + var repeat = motionArgs.repeat; + var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat; + return Pos(cur.line, ch); + }, + moveByLines: function(cm, head, motionArgs, vim) { + var cur = head; + var endCh = cur.ch; + 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; + var first = cm.firstLine(); + var last = cm.lastLine(); + if ((line < first && cur.line == first) || + (line > last && cur.line == last)) { + return; + } + var fold = cm.ace.session.getFoldLine(line); + if (fold) { + if (motionArgs.forward) { + if (line > fold.start.row) + line = fold.end.row + 1; + } else { + line = fold.start.row; + } + } + if (motionArgs.toFirstChar){ + endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); + vim.lastHPos = endCh; + } + vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left; + return Pos(line, endCh); + }, + moveByDisplayLines: function(cm, head, motionArgs, vim) { + var cur = head; + 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(Pos(cm.firstLine(), 0), 'div'); + resCoords.left = vim.lastHSPos; + res = cm.coordsChar(resCoords, 'div'); + } + } + vim.lastHPos = res.ch; + return res; + }, + moveByPage: function(cm, head, motionArgs) { + var curStart = head; + var repeat = motionArgs.repeat; + return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page'); + }, + moveByParagraph: function(cm, head, motionArgs) { + var dir = motionArgs.forward ? 1 : -1; + return findParagraph(cm, head, motionArgs.repeat, dir); + }, + moveByScroll: function(cm, head, 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(head, 'local'); + motionArgs.repeat = repeat; + var curEnd = motions.moveByDisplayLines(cm, head, 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, head, motionArgs) { + return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward, + !!motionArgs.wordEnd, !!motionArgs.bigWord); + }, + moveTillCharacter: function(cm, _head, 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 null; + curEnd.ch += increment; + return curEnd; + }, + moveToCharacter: function(cm, head, motionArgs) { + var repeat = motionArgs.repeat; + recordLastCharacterSearch(0, motionArgs); + return moveToCharacter(cm, repeat, motionArgs.forward, + motionArgs.selectedCharacter) || head; + }, + moveToSymbol: function(cm, head, motionArgs) { + var repeat = motionArgs.repeat; + return findSymbol(cm, repeat, motionArgs.forward, + motionArgs.selectedCharacter) || head; + }, + moveToColumn: function(cm, head, motionArgs, vim) { + var repeat = motionArgs.repeat; + vim.lastHPos = repeat - 1; + vim.lastHSPos = cm.charCoords(head,'div').left; + return moveToColumn(cm, repeat); + }, + moveToEol: function(cm, head, motionArgs, vim) { + var cur = head; + vim.lastHPos = Infinity; + var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity); + var end=cm.clipPos(retval); + end.ch--; + vim.lastHSPos = cm.charCoords(end,'div').left; + return retval; + }, + moveToFirstNonWhiteSpaceCharacter: function(cm, head) { + var cursor = head; + return Pos(cursor.line, + findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line))); + }, + moveToMatchedSymbol: function(cm, head) { + var cursor = head; + var line = cursor.line; + var ch = cursor.ch; + var lineText = cm.getLine(line); + var symbol; + do { + symbol = lineText.charAt(ch++); + if (symbol && isMatchableSymbol(symbol)) { + var style = cm.getTokenTypeAt(Pos(line, ch)); + if (style !== "string" && style !== "comment") { + break; + } + } + } while (symbol); + if (symbol) { + var matched = cm.findMatchingBracket(Pos(line, ch)); + return matched.to; + } else { + return cursor; + } + }, + moveToStartOfLine: function(_cm, head) { + return Pos(head.line, 0); + }, + moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) { + var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine(); + if (motionArgs.repeatIsExplicit) { + lineNum = motionArgs.repeat - cm.getOption('firstLineNumber'); + } + return Pos(lineNum, + findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum))); + }, + textObjectManipulation: function(cm, head, motionArgs, vim) { + var mirroredPairs = {'(': ')', ')': '(', + '{': '}', '}': '{', + '[': ']', ']': '['}; + var selfPaired = {'\'': true, '"': true}; + + var character = motionArgs.selectedCharacter; + if (character == 'b') { + character = '('; + } else if (character == 'B') { + character = '{'; + } + var inclusive = !motionArgs.textObjectInner; + + var tmp; + if (mirroredPairs[character]) { + tmp = selectCompanionObject(cm, head, character, inclusive); + } else if (selfPaired[character]) { + tmp = findBeginningAndEnd(cm, head, character, inclusive); + } else if (character === 'W') { + tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, + true /** bigWord */); + } else if (character === 'w') { + tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, + false /** bigWord */); + } else if (character === 'p') { + tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive); + motionArgs.linewise = true; + if (vim.visualMode) { + if (!vim.visualLine) { vim.visualLine = true; } + } else { + var operatorArgs = vim.inputState.operatorArgs; + if (operatorArgs) { operatorArgs.linewise = true; } + tmp.end.line--; + } + } else { + return null; + } + + if (!cm.state.vim.visualMode) { + return [tmp.start, tmp.end]; + } else { + return expandSelection(cm, tmp.start, tmp.end); + } + }, + + repeatLastCharacterSearch: function(cm, head, motionArgs) { + var lastSearch = vimGlobalState.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 head; + } + curEnd.ch += increment; + return curEnd; + } + }; + + function defineMotion(name, fn) { + motions[name] = fn; + } + + function fillArray(val, times) { + var arr = []; + for (var i = 0; i < times; i++) { + arr.push(val); + } + return arr; + } + var operators = { + change: function(cm, args, ranges) { + var finalHead, text; + var vim = cm.state.vim; + vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock; + if (!vim.visualMode) { + var anchor = ranges[0].anchor, + head = ranges[0].head; + text = cm.getRange(anchor, head); + var lastState = vim.lastEditInputState || {}; + if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) { + var match = (/\s+$/).exec(text); + if (match && lastState.motionArgs && lastState.motionArgs.forward) { + head = offsetCursor(head, 0, - match[0].length); + text = text.slice(0, - match[0].length); + } + } + var prevLineEnd = new Pos(anchor.line - 1, Number.MAX_VALUE); + var wasLastLine = cm.firstLine() == cm.lastLine(); + if (head.line > cm.lastLine() && args.linewise && !wasLastLine) { + cm.replaceRange('', prevLineEnd, head); + } else { + cm.replaceRange('', anchor, head); + } + if (args.linewise) { + if (!wasLastLine) { + cm.setCursor(prevLineEnd); + CodeMirror.commands.newlineAndIndent(cm); + } + anchor.ch = Number.MAX_VALUE; + } + finalHead = anchor; + } else { + text = cm.getSelection(); + var replacement = fillArray('', ranges.length); + cm.replaceSelections(replacement); + finalHead = cursorMin(ranges[0].head, ranges[0].anchor); + } + vimGlobalState.registerController.pushText( + args.registerName, 'change', text, + args.linewise, ranges.length > 1); + actions.enterInsertMode(cm, {head: finalHead}, cm.state.vim); + }, + 'delete': function(cm, args, ranges) { + var finalHead, text; + var vim = cm.state.vim; + if (!vim.visualBlock) { + var anchor = ranges[0].anchor, + head = ranges[0].head; + if (args.linewise && + head.line != cm.firstLine() && + anchor.line == cm.lastLine() && + anchor.line == head.line - 1) { + if (anchor.line == cm.firstLine()) { + anchor.ch = 0; + } else { + anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1)); + } + } + text = cm.getRange(anchor, head); + cm.replaceRange('', anchor, head); + finalHead = anchor; + if (args.linewise) { + finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor); + } + } else { + text = cm.getSelection(); + var replacement = fillArray('', ranges.length); + cm.replaceSelections(replacement); + finalHead = ranges[0].anchor; + } + vimGlobalState.registerController.pushText( + args.registerName, 'delete', text, + args.linewise, vim.visualBlock); + return clipCursorToContent(cm, finalHead); + }, + indent: function(cm, args, ranges) { + var vim = cm.state.vim; + var startLine = ranges[0].anchor.line; + var endLine = vim.visualBlock ? + ranges[ranges.length - 1].anchor.line : + ranges[0].head.line; + var repeat = (vim.visualMode) ? args.repeat : 1; + if (args.linewise) { + endLine--; + } + for (var i = startLine; i <= endLine; i++) { + for (var j = 0; j < repeat; j++) { + cm.indentLine(i, args.indentRight); + } + } + return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor); + }, + changeCase: function(cm, args, ranges, oldAnchor, newHead) { + var selections = cm.getSelections(); + var swapped = []; + var toLower = args.toLower; + for (var j = 0; j < selections.length; j++) { + var toSwap = selections[j]; + var text = ''; + if (toLower === true) { + text = toSwap.toLowerCase(); + } else if (toLower === false) { + text = toSwap.toUpperCase(); + } else { + for (var i = 0; i < toSwap.length; i++) { + var character = toSwap.charAt(i); + text += isUpperCase(character) ? character.toLowerCase() : + character.toUpperCase(); + } + } + swapped.push(text); + } + cm.replaceSelections(swapped); + if (args.shouldMoveCursor){ + return newHead; + } else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) { + return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor); + } else if (args.linewise){ + return oldAnchor; + } else { + return cursorMin(ranges[0].anchor, ranges[0].head); + } + }, + yank: function(cm, args, ranges, oldAnchor) { + var vim = cm.state.vim; + var text = cm.getSelection(); + var endPos = vim.visualMode + ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor) + : oldAnchor; + vimGlobalState.registerController.pushText( + args.registerName, 'yank', + text, args.linewise, vim.visualBlock); + return endPos; + } + }; + + function defineOperator(name, fn) { + operators[name] = fn; + } + + var actions = { + jumpListWalk: function(cm, actionArgs, vim) { + if (vim.visualMode) { + return; + } + var repeat = actionArgs.repeat; + var forward = actionArgs.forward; + var jumpList = vimGlobalState.jumpList; + + var mark = jumpList.move(cm, forward ? repeat : -repeat); + var markPos = mark ? mark.find() : undefined; + markPos = markPos ? markPos : cm.getCursor(); + cm.setCursor(markPos); + cm.ace.curOp.command.scrollIntoView = "center-animate"; // ace_patch + }, + scroll: function(cm, actionArgs, vim) { + if (vim.visualMode) { + return; + } + var repeat = actionArgs.repeat || 1; + var lineHeight = cm.defaultTextHeight(); + var top = cm.getScrollInfo().top; + var delta = lineHeight * repeat; + var newPos = actionArgs.forward ? top + delta : top - delta; + var cursor = copyCursor(cm.getCursor()); + var cursorCoords = cm.charCoords(cursor, 'local'); + if (actionArgs.forward) { + if (newPos > cursorCoords.top) { + cursor.line += (newPos - cursorCoords.top) / lineHeight; + cursor.line = Math.ceil(cursor.line); + cm.setCursor(cursor); + cursorCoords = cm.charCoords(cursor, 'local'); + cm.scrollTo(null, cursorCoords.top); + } else { + cm.scrollTo(null, newPos); + } + } else { + var newBottom = newPos + cm.getScrollInfo().clientHeight; + if (newBottom < cursorCoords.bottom) { + cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight; + cursor.line = Math.floor(cursor.line); + cm.setCursor(cursor); + cursorCoords = cm.charCoords(cursor, 'local'); + cm.scrollTo( + null, cursorCoords.bottom - cm.getScrollInfo().clientHeight); + } else { + cm.scrollTo(null, newPos); + } + } + }, + scrollToCursor: function(cm, actionArgs) { + var lineNum = cm.getCursor().line; + var charCoords = cm.charCoords(Pos(lineNum, 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, vim) { + var registerName = actionArgs.selectedCharacter; + var repeat = actionArgs.repeat; + var macroModeState = vimGlobalState.macroModeState; + if (registerName == '@') { + registerName = macroModeState.latestRegister; + } + while(repeat--){ + executeMacroRegister(cm, vim, macroModeState, registerName); + } + }, + enterMacroRecordMode: function(cm, actionArgs) { + var macroModeState = vimGlobalState.macroModeState; + var registerName = actionArgs.selectedCharacter; + macroModeState.enterMacroRecordMode(cm, registerName); + }, + enterInsertMode: function(cm, actionArgs, vim) { + if (cm.getOption('readOnly')) { return; } + vim.insertMode = true; + vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1; + var insertAt = (actionArgs) ? actionArgs.insertAt : null; + var sel = vim.sel; + var head = actionArgs.head || cm.getCursor('head'); + var height = cm.listSelections().length; + if (insertAt == 'eol') { + head = Pos(head.line, lineLength(cm, head.line)); + } else if (insertAt == 'charAfter') { + head = offsetCursor(head, 0, 1); + } else if (insertAt == 'firstNonBlank') { + head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head); + } else if (insertAt == 'startOfSelectedArea') { + if (!vim.visualBlock) { + if (sel.head.line < sel.anchor.line) { + head = sel.head; + } else { + head = Pos(sel.anchor.line, 0); + } + } else { + head = Pos( + Math.min(sel.head.line, sel.anchor.line), + Math.min(sel.head.ch, sel.anchor.ch)); + height = Math.abs(sel.head.line - sel.anchor.line) + 1; + } + } else if (insertAt == 'endOfSelectedArea') { + if (!vim.visualBlock) { + if (sel.head.line >= sel.anchor.line) { + head = offsetCursor(sel.head, 0, 1); + } else { + head = Pos(sel.anchor.line, 0); + } + } else { + head = Pos( + Math.min(sel.head.line, sel.anchor.line), + Math.max(sel.head.ch + 1, sel.anchor.ch)); + height = Math.abs(sel.head.line - sel.anchor.line) + 1; + } + } else if (insertAt == 'inplace') { + if (vim.visualMode){ + return; + } + } + cm.setOption('keyMap', 'vim-insert'); + cm.setOption('disableInput', false); + if (actionArgs && actionArgs.replace) { + cm.toggleOverwrite(true); + cm.setOption('keyMap', 'vim-replace'); + CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"}); + } else { + cm.setOption('keyMap', 'vim-insert'); + CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"}); + } + if (!vimGlobalState.macroModeState.isPlaying) { + cm.on('change', onChange); + CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); + } + if (vim.visualMode) { + exitVisualMode(cm); + } + selectForInsert(cm, head, height); + }, + toggleVisualMode: function(cm, actionArgs, vim) { + var repeat = actionArgs.repeat; + var anchor = cm.getCursor(); + var head; + if (!vim.visualMode) { + vim.visualMode = true; + vim.visualLine = !!actionArgs.linewise; + vim.visualBlock = !!actionArgs.blockwise; + head = clipCursorToContent( + cm, Pos(anchor.line, anchor.ch + repeat - 1), + true /** includeLineBreak */); + vim.sel = { + anchor: anchor, + head: head + }; + CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); + updateCmSelection(cm); + updateMark(cm, vim, '<', cursorMin(anchor, head)); + updateMark(cm, vim, '>', cursorMax(anchor, head)); + } else if (vim.visualLine ^ actionArgs.linewise || + vim.visualBlock ^ actionArgs.blockwise) { + vim.visualLine = !!actionArgs.linewise; + vim.visualBlock = !!actionArgs.blockwise; + CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); + updateCmSelection(cm); + } else { + exitVisualMode(cm); + } + }, + reselectLastSelection: function(cm, _actionArgs, vim) { + var lastSelection = vim.lastSelection; + if (vim.visualMode) { + updateLastSelection(cm, vim); + } + if (lastSelection) { + var anchor = lastSelection.anchorMark.find(); + var head = lastSelection.headMark.find(); + if (!anchor || !head) { + return; + } + vim.sel = { + anchor: anchor, + head: head + }; + vim.visualMode = true; + vim.visualLine = lastSelection.visualLine; + vim.visualBlock = lastSelection.visualBlock; + updateCmSelection(cm); + updateMark(cm, vim, '<', cursorMin(anchor, head)); + updateMark(cm, vim, '>', cursorMax(anchor, head)); + CodeMirror.signal(cm, 'vim-mode-change', { + mode: 'visual', + subMode: vim.visualLine ? 'linewise' : + vim.visualBlock ? 'blockwise' : ''}); + } + }, + joinLines: function(cm, actionArgs, vim) { + var curStart, curEnd; + if (vim.visualMode) { + curStart = cm.getCursor('anchor'); + curEnd = cm.getCursor('head'); + if (cursorIsBefore(curEnd, curStart)) { + var tmp = curEnd; + curEnd = curStart; + curStart = tmp; + } + curEnd.ch = lineLength(cm, curEnd.line) - 1; + } else { + var repeat = Math.max(actionArgs.repeat, 2); + curStart = cm.getCursor(); + curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1, + Infinity)); + } + var finalCh = 0; + for (var i = curStart.line; i < curEnd.line; i++) { + finalCh = lineLength(cm, curStart.line); + var tmp = Pos(curStart.line + 1, + lineLength(cm, curStart.line + 1)); + var text = cm.getRange(curStart, tmp); + text = text.replace(/\n\s*/g, ' '); + cm.replaceRange(text, curStart, tmp); + } + var curFinalPos = Pos(curStart.line, finalCh); + if (vim.visualMode) { + exitVisualMode(cm, false); + } + cm.setCursor(curFinalPos); + }, + newLineAndEnterInsertMode: function(cm, actionArgs, vim) { + vim.insertMode = true; + var insertAt = copyCursor(cm.getCursor()); + if (insertAt.line === cm.firstLine() && !actionArgs.after) { + cm.replaceRange('\n', Pos(cm.firstLine(), 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, vim) { + var cur = copyCursor(cm.getCursor()); + var register = vimGlobalState.registerController.getRegister( + actionArgs.registerName); + var text = register.toString(); + if (!text) { + return; + } + if (actionArgs.matchIndent) { + var tabSize = cm.getOption("tabSize"); + var whitespaceLength = function(str) { + var tabs = (str.split("\t").length - 1); + var spaces = (str.split(" ").length - 1); + return tabs * tabSize + spaces * 1; + }; + var currentLine = cm.getLine(cm.getCursor().line); + var indent = whitespaceLength(currentLine.match(/^\s*/)[0]); + var chompedText = text.replace(/\n$/, ''); + var wasChomped = text !== chompedText; + var firstIndent = whitespaceLength(text.match(/^\s*/)[0]); + var text = chompedText.replace(/^\s*/gm, function(wspace) { + var newIndent = indent + (whitespaceLength(wspace) - firstIndent); + if (newIndent < 0) { + return ""; + } + else if (cm.getOption("indentWithTabs")) { + var quotient = Math.floor(newIndent / tabSize); + return Array(quotient + 1).join('\t'); + } + else { + return Array(newIndent + 1).join(' '); + } + }); + text += wasChomped ? "\n" : ""; + } + if (actionArgs.repeat > 1) { + var text = Array(actionArgs.repeat + 1).join(text); + } + var linewise = register.linewise; + var blockwise = register.blockwise; + if (linewise && !blockwise) { + if(vim.visualMode) { + text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n'; + } else if (actionArgs.after) { + text = '\n' + text.slice(0, text.length - 1); + cur.ch = lineLength(cm, cur.line); + } else { + cur.ch = 0; + } + } else { + if (blockwise) { + text = text.split('\n'); + for (var i = 0; i < text.length; i++) { + text[i] = (text[i] == '') ? ' ' : text[i]; + } + } + cur.ch += actionArgs.after ? 1 : 0; + } + var curPosFinal; + var idx; + if (vim.visualMode) { + vim.lastPastedText = text; + var lastSelectionCurEnd; + var selectedArea = getSelectedAreaRange(cm, vim); + var selectionStart = selectedArea[0]; + var selectionEnd = selectedArea[1]; + var selectedText = cm.getSelection(); + var selections = cm.listSelections(); + var emptyStrings = new Array(selections.length).join('1').split('1'); + if (vim.lastSelection) { + lastSelectionCurEnd = vim.lastSelection.headMark.find(); + } + vimGlobalState.registerController.unnamedRegister.setText(selectedText); + if (blockwise) { + cm.replaceSelections(emptyStrings); + selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch); + cm.setCursor(selectionStart); + selectBlock(cm, selectionEnd); + cm.replaceSelections(text); + curPosFinal = selectionStart; + } else if (vim.visualBlock) { + cm.replaceSelections(emptyStrings); + cm.setCursor(selectionStart); + cm.replaceRange(text, selectionStart, selectionStart); + curPosFinal = selectionStart; + } else { + cm.replaceRange(text, selectionStart, selectionEnd); + curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1); + } + if(lastSelectionCurEnd) { + vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd); + } + if (linewise) { + curPosFinal.ch=0; + } + } else { + if (blockwise) { + cm.setCursor(cur); + for (var i = 0; i < text.length; i++) { + var line = cur.line+i; + if (line > cm.lastLine()) { + cm.replaceRange('\n', Pos(line, 0)); + } + var lastCh = lineLength(cm, line); + if (lastCh < cur.ch) { + extendLineToColumn(cm, line, cur.ch); + } + } + cm.setCursor(cur); + selectBlock(cm, Pos(cur.line + text.length-1, cur.ch)); + cm.replaceSelections(text); + curPosFinal = cur; + } else { + cm.replaceRange(text, cur); + if (linewise && actionArgs.after) { + curPosFinal = Pos( + cur.line + 1, + findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1))); + } else if (linewise && !actionArgs.after) { + curPosFinal = Pos( + cur.line, + 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); + } + } + } + if (vim.visualMode) { + exitVisualMode(cm, false); + } + 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; + var selections = cm.listSelections(); + if (vim.visualMode) { + curStart = cm.getCursor('start'); + curEnd = cm.getCursor('end'); + } else { + var line = cm.getLine(curStart.line); + replaceTo = curStart.ch + actionArgs.repeat; + if (replaceTo > line.length) { + replaceTo=line.length; + } + curEnd = Pos(curStart.line, replaceTo); + } + if (replaceWith=='\n') { + if (!vim.visualMode) cm.replaceRange('', curStart, curEnd); + (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm); + } else { + var replaceWithStr = cm.getRange(curStart, curEnd); + replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith); + if (vim.visualBlock) { + var spaces = new Array(cm.getOption("tabSize")+1).join(' '); + replaceWithStr = cm.getSelection(); + replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n'); + cm.replaceSelections(replaceWithStr); + } else { + cm.replaceRange(replaceWithStr, curStart, curEnd); + } + if (vim.visualMode) { + curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ? + selections[0].anchor : selections[0].head; + cm.setCursor(curStart); + exitVisualMode(cm, false); + } 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 = Pos(cur.line, start); + var to = Pos(cur.line, end); + numberStr = number.toString(); + cm.replaceRange(numberStr, from, to); + } else { + return; + } + cm.setCursor(Pos(cur.line, 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 */); + }, + exitInsertMode: exitInsertMode + }; + + function defineAction(name, fn) { + actions[name] = fn; + } + 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 Pos(line, 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) { + if (typeof offsetLine === 'object') { + offsetCh = offsetLine.ch; + offsetLine = offsetLine.line; + } + return Pos(cur.line + offsetLine, cur.ch + offsetCh); + } + function getOffset(anchor, head) { + return { + line: head.line - anchor.line, + ch: head.line - anchor.line + }; + } + function commandMatches(keys, keyMap, context, inputState) { + var match, partial = [], full = []; + for (var i = 0; i < keyMap.length; i++) { + var command = keyMap[i]; + if (context == 'insert' && command.context != 'insert' || + command.context && command.context != context || + inputState.operator && command.type == 'action' || + !(match = commandMatch(keys, command.keys))) { continue; } + if (match == 'partial') { partial.push(command); } + if (match == 'full') { full.push(command); } + } + return { + partial: partial.length && partial, + full: full.length && full + }; + } + function commandMatch(pressed, mapped) { + if (mapped.slice(-11) == '') { + var prefixLen = mapped.length - 11; + var pressedPrefix = pressed.slice(0, prefixLen); + var mappedPrefix = mapped.slice(0, prefixLen); + return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' : + mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false; + } else { + return pressed == mapped ? 'full' : + mapped.indexOf(pressed) == 0 ? 'partial' : false; + } + } + function lastChar(keys) { + var match = /^.*(<[\w\-]+>)$/.exec(keys); + var selectedCharacter = match ? match[1] : keys.slice(-1); + if (selectedCharacter.length > 1){ + switch(selectedCharacter){ + case '': + selectedCharacter='\n'; + break; + case '': + selectedCharacter=' '; + break; + default: + break; + } + } + return selectedCharacter; + } + function repeatFn(cm, fn, repeat) { + return function() { + for (var i = 0; i < repeat; i++) { + fn(cm); + } + }; + } + function copyCursor(cur) { + return Pos(cur.line, 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 cursorMin(cur1, cur2) { + if (arguments.length > 2) { + cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1)); + } + return cursorIsBefore(cur1, cur2) ? cur1 : cur2; + } + function cursorMax(cur1, cur2) { + if (arguments.length > 2) { + cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1)); + } + return cursorIsBefore(cur1, cur2) ? cur2 : cur1; + } + function cursorIsBetween(cur1, cur2, cur3) { + var cur1before2 = cursorIsBefore(cur1, cur2); + var cur2before3 = cursorIsBefore(cur2, cur3); + return cur1before2 && cur2before3; + } + function lineLength(cm, lineNum) { + return cm.getLine(lineNum).length; + } + function trim(s) { + if (s.trim) { + return s.trim(); + } + return s.replace(/^\s+|\s+$/g, ''); + } + function escapeRegex(s) { + return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1'); + } + function extendLineToColumn(cm, lineNum, column) { + var endCh = lineLength(cm, lineNum); + var spaces = new Array(column-endCh+1).join(' '); + cm.setCursor(Pos(lineNum, endCh)); + cm.replaceRange(spaces, cm.getCursor()); + } + function selectBlock(cm, selectionEnd) { + var selections = [], ranges = cm.listSelections(); + var head = copyCursor(cm.clipPos(selectionEnd)); + var isClipped = !cursorEqual(selectionEnd, head); + var curHead = cm.getCursor('head'); + var primIndex = getIndex(ranges, curHead); + var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor); + var max = ranges.length - 1; + var index = max - primIndex > primIndex ? max : 0; + var base = ranges[index].anchor; + + var firstLine = Math.min(base.line, head.line); + var lastLine = Math.max(base.line, head.line); + var baseCh = base.ch, headCh = head.ch; + + var dir = ranges[index].head.ch - baseCh; + var newDir = headCh - baseCh; + if (dir > 0 && newDir <= 0) { + baseCh++; + if (!isClipped) { headCh--; } + } else if (dir < 0 && newDir >= 0) { + baseCh--; + if (!wasClipped) { headCh++; } + } else if (dir < 0 && newDir == -1) { + baseCh--; + headCh++; + } + for (var line = firstLine; line <= lastLine; line++) { + var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)}; + selections.push(range); + } + primIndex = head.line == lastLine ? selections.length - 1 : 0; + cm.setSelections(selections); + selectionEnd.ch = headCh; + base.ch = baseCh; + return base; + } + function selectForInsert(cm, head, height) { + var sel = []; + for (var i = 0; i < height; i++) { + var lineHead = offsetCursor(head, i, 0); + sel.push({anchor: lineHead, head: lineHead}); + } + cm.setSelections(sel, 0); + } + function getIndex(ranges, cursor, end) { + for (var i = 0; i < ranges.length; i++) { + var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor); + var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor); + if (atAnchor || atHead) { + return i; + } + } + return -1; + } + function getSelectedAreaRange(cm, vim) { + var lastSelection = vim.lastSelection; + var getCurrentSelectedAreaRange = function() { + var selections = cm.listSelections(); + var start = selections[0]; + var end = selections[selections.length-1]; + var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head; + var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor; + return [selectionStart, selectionEnd]; + }; + var getLastSelectedAreaRange = function() { + var selectionStart = cm.getCursor(); + var selectionEnd = cm.getCursor(); + var block = lastSelection.visualBlock; + if (block) { + var width = block.width; + var height = block.height; + selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width); + var selections = []; + for (var i = selectionStart.line; i < selectionEnd.line; i++) { + var anchor = Pos(i, selectionStart.ch); + var head = Pos(i, selectionEnd.ch); + var range = {anchor: anchor, head: head}; + selections.push(range); + } + cm.setSelections(selections); + } else { + var start = lastSelection.anchorMark.find(); + var end = lastSelection.headMark.find(); + var line = end.line - start.line; + var ch = end.ch - start.ch; + selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch}; + if (lastSelection.visualLine) { + selectionStart = Pos(selectionStart.line, 0); + selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line)); + } + cm.setSelection(selectionStart, selectionEnd); + } + return [selectionStart, selectionEnd]; + }; + if (!vim.visualMode) { + return getLastSelectedAreaRange(); + } else { + return getCurrentSelectedAreaRange(); + } + } + function updateLastSelection(cm, vim) { + var anchor = vim.sel.anchor; + var head = vim.sel.head; + if (vim.lastPastedText) { + head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length); + vim.lastPastedText = null; + } + vim.lastSelection = {'anchorMark': cm.setBookmark(anchor), + 'headMark': cm.setBookmark(head), + 'anchor': copyCursor(anchor), + 'head': copyCursor(head), + 'visualMode': vim.visualMode, + 'visualLine': vim.visualLine, + 'visualBlock': vim.visualBlock}; + } + function expandSelection(cm, start, end) { + var sel = cm.state.vim.sel; + var head = sel.head; + var anchor = sel.anchor; + var tmp; + if (cursorIsBefore(end, start)) { + tmp = end; + end = start; + start = tmp; + } + if (cursorIsBefore(head, anchor)) { + head = cursorMin(start, head); + anchor = cursorMax(anchor, end); + } else { + anchor = cursorMin(start, anchor); + head = cursorMax(head, end); + head = offsetCursor(head, 0, -1); + if (head.ch == -1 && head.line != cm.firstLine()) { + head = Pos(head.line - 1, lineLength(cm, head.line - 1)); + } + } + return [anchor, head]; + } + function updateCmSelection(cm, sel, mode) { + var vim = cm.state.vim; + sel = sel || vim.sel; + var mode = mode || + vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char'; + var cmSel = makeCmSelection(cm, sel, mode); + cm.setSelections(cmSel.ranges, cmSel.primary); + updateFakeCursor(cm); + } + function makeCmSelection(cm, sel, mode, exclusive) { + var head = copyCursor(sel.head); + var anchor = copyCursor(sel.anchor); + if (mode == 'char') { + var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; + var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; + head = offsetCursor(sel.head, 0, headOffset); + anchor = offsetCursor(sel.anchor, 0, anchorOffset); + return { + ranges: [{anchor: anchor, head: head}], + primary: 0 + }; + } else if (mode == 'line') { + if (!cursorIsBefore(sel.head, sel.anchor)) { + anchor.ch = 0; + + var lastLine = cm.lastLine(); + if (head.line > lastLine) { + head.line = lastLine; + } + head.ch = lineLength(cm, head.line); + } else { + head.ch = 0; + anchor.ch = lineLength(cm, anchor.line); + } + return { + ranges: [{anchor: anchor, head: head}], + primary: 0 + }; + } else if (mode == 'block') { + var top = Math.min(anchor.line, head.line), + left = Math.min(anchor.ch, head.ch), + bottom = Math.max(anchor.line, head.line), + right = Math.max(anchor.ch, head.ch) + 1; + var height = bottom - top + 1; + var primary = head.line == top ? 0 : height - 1; + var ranges = []; + for (var i = 0; i < height; i++) { + ranges.push({ + anchor: Pos(top + i, left), + head: Pos(top + i, right) + }); + } + return { + ranges: ranges, + primary: primary + }; + } + } + function getHead(cm) { + var cur = cm.getCursor('head'); + if (cm.getSelection().length == 1) { + cur = cursorMin(cur, cm.getCursor('anchor')); + } + return cur; + } + function exitVisualMode(cm, moveHead) { + var vim = cm.state.vim; + if (moveHead !== false) { + cm.setCursor(clipCursorToContent(cm, vim.sel.head)); + } + updateLastSelection(cm, vim); + vim.visualMode = false; + vim.visualLine = false; + vim.visualBlock = false; + CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); + if (vim.fakeCursor) { + vim.fakeCursor.clear(); + } + } + function clipToLine(cm, curStart, curEnd) { + var selection = cm.getRange(curStart, curEnd); + if (/\n\s*$/.test(selection)) { + var lines = selection.split('\n'); + lines.pop(); + var line; + for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) { + curEnd.line--; + curEnd.ch = 0; + } + if (line) { + curEnd.line--; + curEnd.ch = lineLength(cm, curEnd.line); + } else { + curEnd.ch = 0; + } + } + } + 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 = getHead(cm); + var line = cm.getLine(cur.line); + var idx = cur.ch; + var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0]; + while (!test(line.charAt(idx))) { + idx++; + if (idx >= line.length) { return null; } + } + + if (bigWord) { + test = bigWordCharTest[0]; + } else { + test = wordCharTest[0]; + if (!test(line.charAt(idx))) { + test = wordCharTest[1]; + } + } + + var end = idx, start = idx; + while (test(line.charAt(end)) && end < line.length) { end++; } + while (test(line.charAt(start)) && start >= 0) { start--; } + start++; + + if (inclusive) { + var wordEnd = end; + while (/\s/.test(line.charAt(end)) && end < line.length) { end++; } + if (wordEnd == end) { + var wordStart = start; + while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; } + if (!start) { start = wordStart; } + } + } + return { start: Pos(cur.line, start), end: Pos(cur.line, end) }; + } + + function recordJumpPosition(cm, oldCur, newCur) { + if (!cursorEqual(oldCur, newCur)) { + vimGlobalState.jumpList.add(cm, oldCur, newCur); + } + } + + function recordLastCharacterSearch(increment, args) { + 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; + } + }, + 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 = copyCursor(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 Pos(line, state.index); + } + return cur; + } + 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 charTests = bigWord ? bigWordCharTest: wordCharTest; + + 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; + while (pos != stop) { + var foundWord = false; + for (var i = 0; i < charTests.length && !foundWord; ++i) { + if (charTests[i](line.charAt(pos))) { + wordStart = pos; + while (pos != stop && charTests[i](line.charAt(pos))) { + pos += dir; + } + wordEnd = pos; + foundWord = wordStart != wordEnd; + if (wordStart == cur.ch && lineNum == cur.line && + wordEnd == wordStart + dir) { + continue; + } else { + return { + from: Math.min(wordStart, wordEnd + 1), + to: Math.max(wordStart, wordEnd), + line: lineNum }; + } + } + } + if (!foundWord) { + pos += dir; + } + } + lineNum += dir; + if (!isLine(cm, lineNum)) { + return null; + } + line = cm.getLine(lineNum); + pos = (dir > 0) ? 0 : line.length; + } + throw new Error('The impossible happened.'); + } + function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) { + var curStart = copyCursor(cur); + var words = []; + if (forward && !wordEnd || !forward && wordEnd) { + repeat++; + } + 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 = Pos(word.line, forward ? (word.to - 1) : word.from); + } + var shortCircuit = words.length != repeat; + var firstWord = words[0]; + var lastWord = words.pop(); + if (forward && !wordEnd) { + if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) { + lastWord = words.pop(); + } + return Pos(lastWord.line, lastWord.from); + } else if (forward && wordEnd) { + return Pos(lastWord.line, lastWord.to - 1); + } else if (!forward && wordEnd) { + if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) { + lastWord = words.pop(); + } + return Pos(lastWord.line, lastWord.to); + } else { + return Pos(lastWord.line, 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 Pos(cm.getCursor().line, idx); + } + + function moveToColumn(cm, repeat) { + var line = cm.getCursor().line; + return clipCursorToContent(cm, Pos(line, 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) { + 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 findParagraph(cm, head, repeat, dir, inclusive) { + var line = head.line; + var min = cm.firstLine(); + var max = cm.lastLine(); + var start, end, i = line; + function isEmpty(i) { return !/\S/.test(cm.getLine(i)); } // ace_patch + function isBoundary(i, dir, any) { + if (any) { return isEmpty(i) != isEmpty(i + dir); } + return !isEmpty(i) && isEmpty(i + dir); + } + function skipFold(i) { + dir = dir > 0 ? 1 : -1; + var foldLine = cm.ace.session.getFoldLine(i); + if (foldLine) { + if (i + dir > foldLine.start.row && i + dir < foldLine.end.row) + dir = (dir > 0 ? foldLine.end.row : foldLine.start.row) - i; + } + } + if (dir) { + while (min <= i && i <= max && repeat > 0) { + skipFold(i); + if (isBoundary(i, dir)) { repeat--; } + i += dir; + } + return new Pos(i, 0); + } + + var vim = cm.state.vim; + if (vim.visualLine && isBoundary(line, 1, true)) { + var anchor = vim.sel.anchor; + if (isBoundary(anchor.line, -1, true)) { + if (!inclusive || anchor.line != line) { + line += 1; + } + } + } + var startState = isEmpty(line); + for (i = line; i <= max && repeat; i++) { + if (isBoundary(i, 1, true)) { + if (!inclusive || isEmpty(i) != startState) { + repeat--; + } + } + } + end = new Pos(i, 0); + if (i > max && !startState) { startState = true; } + else { inclusive = false; } + for (i = line; i > min; i--) { + if (!inclusive || isEmpty(i) == startState || i == line) { + if (isBoundary(i, -1, true)) { break; } + } + } + start = new Pos(i, 0); + return { start: start, end: end }; + } + function selectCompanionObject(cm, head, symb, inclusive) { + var cur = head, start, end; + + var bracketRegexp = ({ + '(': /[()]/, ')': /[()]/, + '[': /[[\]]/, ']': /[[\]]/, + '{': /[{}]/, '}': /[{}]/})[symb]; + var openSym = ({ + '(': '(', ')': '(', + '[': '[', ']': '[', + '{': '{', '}': '{'})[symb]; + var curChar = cm.getLine(cur.line).charAt(cur.ch); + var offset = curChar === openSym ? 1 : 0; + + start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, null, {'bracketRegex': bracketRegexp}); + end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, null, {'bracketRegex': bracketRegexp}); + + if (!start || !end) { + return { start: cur, end: cur }; + } + + start = start.pos; + end = end.pos; + + if ((start.line == end.line && start.ch > end.ch) + || (start.line > end.line)) { + var tmp = start; + start = end; + end = tmp; + } + + if (inclusive) { + end.ch += 1; + } else { + start.ch += 1; + } + + return { start: start, end: end }; + } + function findBeginningAndEnd(cm, head, symb, inclusive) { + var cur = copyCursor(head); + var line = cm.getLine(cur.line); + var chars = line.split(''); + var start, end, i, len; + var firstIndex = chars.indexOf(symb); + if (cur.ch < firstIndex) { + cur.ch = firstIndex; + } + 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 (chars[cur.ch] == symb && !end) { + start = cur.ch + 1; // assign start to ahead of the cursor + } else { + for (i = cur.ch; i > -1 && !start; i--) { + if (chars[i] == symb) { + start = i + 1; + } + } + } + if (start && !end) { + for (i = start, len = chars.length; i < len && !end; i++) { + if (chars[i] == symb) { + end = i; + } + } + } + if (!start || !end) { + return { start: cur, end: cur }; + } + if (inclusive) { + --start; ++end; + } + + return { + start: Pos(cur.line, start), + end: Pos(cur.line, end) + }; + } + defineOption('pcre', true, 'boolean'); + function SearchState() {} + SearchState.prototype = { + getQuery: function() { + return vimGlobalState.query; + }, + setQuery: function(query) { + vimGlobalState.query = query; + }, + getOverlay: function() { + return this.searchOverlay; + }, + setOverlay: function(overlay) { + this.searchOverlay = overlay; + }, + isReversed: function() { + return vimGlobalState.isReversed; + }, + setReversed: function(reversed) { + vimGlobalState.isReversed = reversed; + }, + getScrollbarAnnotate: function() { + return this.annotate; + }, + setScrollbarAnnotate: function(annotate) { + this.annotate = annotate; + } + }; + function getSearchState(cm) { + var vim = cm.state.vim; + 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, + selectValueOnOpen: false}); + } + else { + onClose(prompt(shortText, '')); + } + } + function splitBySlash(argString) { + var slashes = findUnescapedSlashes(argString) || []; + if (!slashes.length) return []; + var tokens = []; + if (slashes[0] !== 0) return; + for (var i = 0; i < slashes.length; i++) { + if (typeof slashes[i] == 'number') + tokens.push(argString.substring(slashes[i] + 1, slashes[i+1])); + } + return tokens; + } + + 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 = !escapeNextChar && (c == '\\'); + } + return slashes; + } + function translateRegex(str) { + var specials = '|(){'; + var unescape = '}'; + var escapeNextChar = false; + var out = []; + for (var i = -1; i < str.length; i++) { + var c = str.charAt(i) || ''; + var n = str.charAt(i+1) || ''; + var specialComesNext = (n && specials.indexOf(n) != -1); + if (escapeNextChar) { + if (c !== '\\' || !specialComesNext) { + out.push(c); + } + escapeNextChar = false; + } else { + if (c === '\\') { + escapeNextChar = true; + if (n && unescape.indexOf(n) != -1) { + specialComesNext = true; + } + if (!specialComesNext || n === '\\') { + out.push(c); + } + } else { + out.push(c); + if (specialComesNext && n !== '\\') { + out.push('\\'); + } + } + } + } + return out.join(''); + } + var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'}; + function translateRegexReplace(str) { + var escapeNextChar = false; + var out = []; + for (var i = -1; i < str.length; i++) { + var c = str.charAt(i) || ''; + var n = str.charAt(i+1) || ''; + if (charUnescapes[c + n]) { + out.push(charUnescapes[c+n]); + i++; + } else if (escapeNextChar) { + out.push(c); + escapeNextChar = false; + } else { + if (c === '\\') { + escapeNextChar = true; + if ((isNumber(n) || n === '$')) { + out.push('$'); + } else if (n !== '/' && n !== '\\') { + out.push('\\'); + } + } else { + if (c === '$') { + out.push('$'); + } + out.push(c); + if (n === '/') { + out.push('\\'); + } + } + } + } + return out.join(''); + } + var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'}; + function unescapeRegexReplace(str) { + var stream = new CodeMirror.StringStream(str); + var output = []; + while (!stream.eol()) { + while (stream.peek() && stream.peek() != '\\') { + output.push(stream.next()); + } + var matched = false; + for (var matcher in unescapes) { + if (stream.match(matcher, true)) { + matched = true; + output.push(unescapes[matcher]); + break; + } + } + if (!matched) { + output.push(stream.next()); + } + } + return output.join(''); + } + function parseQuery(query, ignoreCase, smartCase) { + var lastSearchRegister = vimGlobalState.registerController.getRegister('/'); + lastSearchRegister.setText(query); + if (query instanceof RegExp) { return query; } + var slashes = findUnescapedSlashes(query); + var regexPart; + var forceIgnoreCase; + if (!slashes.length) { + regexPart = query; + } else { + regexPart = query.substring(0, slashes[0]); + var flagsPart = query.substring(slashes[0]); + forceIgnoreCase = (flagsPart.indexOf('i') != -1); + } + if (!regexPart) { + return null; + } + if (!getOption('pcre')) { + regexPart = translateRegex(regexPart); + } + if (smartCase) { + ignoreCase = (/^[^A-Z]*$/).test(regexPart); + } + var regexp = new RegExp(regexPart, + (ignoreCase || forceIgnoreCase) ? 'i' : undefined); + return regexp; + } + function showConfirm(cm, text) { + if (cm.openNotification) { + cm.openNotification('' + text + '', + {bottom: true, duration: 5000}); + } 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; + } + 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) { + stream.next(); + return 'searching'; + } + if (!stream.sol()) { + 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 searchState = getSearchState(cm); + var overlay = searchState.getOverlay(); + if (!overlay || query != overlay.query) { + if (overlay) { + cm.removeOverlay(overlay); + } + overlay = searchOverlay(query); + cm.addOverlay(overlay); + if (cm.showMatchesOnScrollbar) { + if (searchState.getScrollbarAnnotate()) { + searchState.getScrollbarAnnotate().clear(); + } + searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query)); + } + searchState.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) { + cursor = cm.getSearchCursor(query, + (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) ); + if (!cursor.find(prev)) { + return; + } + } + } + return cursor.from(); + }); + } + function clearSearchHighlight(cm) { + var state = getSearchState(cm); + cm.removeOverlay(getSearchState(cm).getOverlay()); + state.setOverlay(null); + if (state.getScrollbarAnnotate()) { + state.getScrollbarAnnotate().clear(); + state.setScrollbarAnnotate(null); + } + } + function isInRange(pos, start, end) { + if (typeof pos != '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 renderer = cm.ace.renderer; + return { + top: renderer.getFirstFullyVisibleRow(), + bottom: renderer.getLastFullyVisibleRow() + } + } + + var ExCommandDispatcher = function() { + this.buildCommandMap_(); + }; + ExCommandDispatcher.prototype = { + processCommand: function(cm, input, opt_params) { + var that = this; + cm.operation(function () { + cm.curOp.isVimOp = true; + that._processCommand(cm, input, opt_params); + }); + }, + _processCommand: function(cm, input, opt_params) { + var vim = cm.state.vim; + var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); + var previousCommand = commandHistoryRegister.toString(); + if (vim.visualMode) { + exitVisualMode(cm); + } + var inputStream = new CodeMirror.StringStream(input); + commandHistoryRegister.setText(input); + var params = opt_params || {}; + params.input = input; + try { + this.parseInput_(cm, inputStream, params); + } catch(e) { + showConfirm(cm, e); + throw e; + } + var command; + var commandName; + if (!params.commandName) { + if (params.line !== undefined) { + commandName = 'move'; + } + } else { + command = this.matchCommand_(params.commandName); + if (command) { + commandName = command.name; + if (command.excludeFromCommandHistory) { + commandHistoryRegister.setText(previousCommand); + } + this.parseCommandArgs_(inputStream, params, command); + if (command.type == 'exToKey') { + for (var i = 0; i < command.toKeys.length; i++) { + CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping'); + } + return; + } else if (command.type == 'exToEx') { + this.processCommand(cm, command.toInput); + return; + } + } + } + if (!commandName) { + showConfirm(cm, 'Not an editor command ":' + input + '"'); + return; + } + try { + exCommands[commandName](cm, params); + if ((!command || !command.possiblyAsync) && params.callback) { + params.callback(); + } + } catch(e) { + showConfirm(cm, e); + throw e; + } + }, + parseInput_: function(cm, inputStream, result) { + inputStream.eatWhile(':'); + 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); + } + } + 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 = cm.state.vim.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]; + var delim = command.argDelimiter || /\s+/; + var args = trim(params.argString).split(delim); + if (args.length && args[0]) { + params.args = args; + } + }, + matchCommand_: function(commandName) { + 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, ctx) { + if (lhs != ':' && lhs.charAt(0) == ':') { + if (ctx) { throw Error('Mode not supported for ex mappings'); } + var commandName = lhs.substring(1); + if (rhs != ':' && rhs.charAt(0) == ':') { + this.commandMap_[commandName] = { + name: commandName, + type: 'exToEx', + toInput: rhs.substring(1), + user: true + }; + } else { + this.commandMap_[commandName] = { + name: commandName, + type: 'exToKey', + toKeys: rhs, + user: true + }; + } + } else { + if (rhs != ':' && rhs.charAt(0) == ':') { + var mapping = { + keys: lhs, + type: 'keyToEx', + exArgs: { input: rhs.substring(1) }, + user: true}; + if (ctx) { mapping.context = ctx; } + defaultKeymap.unshift(mapping); + } else { + var mapping = { + keys: lhs, + type: 'keyToKey', + toKeys: rhs, + user: true + }; + if (ctx) { mapping.context = ctx; } + defaultKeymap.unshift(mapping); + } + } + }, + unmap: function(lhs, ctx) { + if (lhs != ':' && lhs.charAt(0) == ':') { + if (ctx) { throw Error('Mode not supported for ex mappings'); } + var commandName = lhs.substring(1); + if (this.commandMap_[commandName] && this.commandMap_[commandName].user) { + delete this.commandMap_[commandName]; + return; + } + } else { + var keys = lhs; + for (var i = 0; i < defaultKeymap.length; i++) { + if (keys == defaultKeymap[i].keys + && defaultKeymap[i].context === ctx + && defaultKeymap[i].user) { + defaultKeymap.splice(i, 1); + return; + } + } + } + } + }; + + var exCommands = { + colorscheme: function(cm, params) { + if (!params.args || params.args.length < 1) { + showConfirm(cm, cm.getOption('theme')); + return; + } + cm.setOption('theme', params.args[0]); + }, + map: function(cm, params, ctx) { + var mapArgs = params.args; + if (!mapArgs || mapArgs.length < 2) { + if (cm) { + showConfirm(cm, 'Invalid mapping: ' + params.input); + } + return; + } + exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx); + }, + imap: function(cm, params) { this.map(cm, params, 'insert'); }, + nmap: function(cm, params) { this.map(cm, params, 'normal'); }, + vmap: function(cm, params) { this.map(cm, params, 'visual'); }, + unmap: function(cm, params, ctx) { + var mapArgs = params.args; + if (!mapArgs || mapArgs.length < 1) { + if (cm) { + showConfirm(cm, 'No such mapping: ' + params.input); + } + return; + } + exCommandDispatcher.unmap(mapArgs[0], ctx); + }, + move: function(cm, params) { + commandDispatcher.processCommand(cm, cm.state.vim, { + type: 'motion', + motion: 'moveToLineOrEdgeOfDocument', + motionArgs: { forward: false, explicitRepeat: true, + linewise: true }, + repeatOverride: params.line+1}); + }, + set: function(cm, params) { + var setArgs = params.args; + var setCfg = params.setCfg || {}; + if (!setArgs || setArgs.length < 1) { + if (cm) { + showConfirm(cm, 'Invalid mapping: ' + params.input); + } + return; + } + var expr = setArgs[0].split('='); + var optionName = expr[0]; + var value = expr[1]; + var forceGet = false; + + if (optionName.charAt(optionName.length - 1) == '?') { + if (value) { throw Error('Trailing characters: ' + params.argString); } + optionName = optionName.substring(0, optionName.length - 1); + forceGet = true; + } + if (value === undefined && optionName.substring(0, 2) == 'no') { + optionName = optionName.substring(2); + value = false; + } + + var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; + if (optionIsBoolean && value == undefined) { + value = true; + } + if (!optionIsBoolean && value === undefined || forceGet) { + var oldValue = getOption(optionName, cm, setCfg); + if (oldValue === true || oldValue === false) { + showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); + } else { + showConfirm(cm, ' ' + optionName + '=' + oldValue); + } + } else { + setOption(optionName, value, cm, setCfg); + } + }, + setlocal: function (cm, params) { + params.setCfg = {scope: 'local'}; + this.set(cm, params); + }, + setglobal: function (cm, params) { + params.setCfg = {scope: 'global'}; + this.set(cm, params); + }, + registers: function(cm, params) { + var regArgs = params.args; + var registers = vimGlobalState.registerController.registers; + var regInfo = '----------Registers----------

        '; + if (!regArgs) { + for (var registerName in registers) { + var text = registers[registerName].toString(); + if (text.length) { + regInfo += '"' + registerName + ' ' + text + '
        '; + } + } + } else { + var registerName; + regArgs = regArgs.join(''); + for (var i = 0; i < regArgs.length; i++) { + registerName = regArgs.charAt(i); + if (!vimGlobalState.registerController.isValidRegister(registerName)) { + continue; + } + var register = registers[registerName] || new Register(); + regInfo += '"' + registerName + ' ' + register.toString() + '
        '; + } + } + showConfirm(cm, regInfo); + }, + 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()) { return 'Invalid arguments'; } + 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) { return 'Invalid arguments'; } + number = decimal && 'decimal' || hex && 'hex' || octal && 'octal'; + } + if (args.match(/\/.*\//)) { return 'patterns not supported'; } + } + } + var err = parseArgs(); + if (err) { + showConfirm(cm, err + ': ' + params.argString); + return; + } + var lineStart = params.line || cm.firstLine(); + var lineEnd = params.lineEnd || params.line || cm.lastLine(); + if (lineStart == lineEnd) { return; } + var curStart = Pos(lineStart, 0); + var curEnd = Pos(lineEnd, 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); + }, + global: function(cm, params) { + var argString = params.argString; + if (!argString) { + showConfirm(cm, 'Regular Expression missing from global'); + return; + } + var lineStart = (params.line !== undefined) ? params.line : cm.firstLine(); + var lineEnd = params.lineEnd || params.line || cm.lastLine(); + var tokens = splitBySlash(argString); + var regexPart = argString, cmd; + if (tokens.length) { + regexPart = tokens[0]; + cmd = tokens.slice(1, tokens.length).join('/'); + } + if (regexPart) { + try { + updateSearchQuery(cm, regexPart, true /** ignoreCase */, + true /** smartCase */); + } catch (e) { + showConfirm(cm, 'Invalid regex: ' + regexPart); + return; + } + } + var query = getSearchState(cm).getQuery(); + var matchedLines = [], content = ''; + for (var i = lineStart; i <= lineEnd; i++) { + var matched = query.test(cm.getLine(i)); + if (matched) { + matchedLines.push(i+1); + content+= cm.getLine(i) + '
        '; + } + } + if (!cmd) { + showConfirm(cm, content); + return; + } + var index = 0; + var nextCommand = function() { + if (index < matchedLines.length) { + var command = matchedLines[index] + cmd; + exCommandDispatcher.processCommand(cm, command, { + callback: nextCommand + }); + } + index++; + }; + nextCommand(); + }, + 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 tokens = argString ? splitBySlash(argString) : []; + var regexPart, replacePart = '', trailing, flagsPart, count; + var confirm = false; // Whether to confirm each replace. + var global = false; // True to replace all instances on a line, false to replace only 1. + if (tokens.length) { + regexPart = tokens[0]; + replacePart = tokens[1]; + if (replacePart !== undefined) { + if (getOption('pcre')) { + replacePart = unescapeRegexReplace(replacePart); + } else { + replacePart = translateRegexReplace(replacePart); + } + vimGlobalState.lastSubstituteReplacePart = replacePart; + } + trailing = tokens[2] ? tokens[2].split(' ') : []; + } else { + if (argString && argString.length) { + showConfirm(cm, 'Substitutions should be of the form ' + + ':s/pattern/replace/'); + return; + } + } + if (trailing) { + flagsPart = trailing[0]; + count = parseInt(trailing[1]); + if (flagsPart) { + if (flagsPart.indexOf('c') != -1) { + confirm = true; + flagsPart.replace('c', ''); + } + if (flagsPart.indexOf('g') != -1) { + global = true; + flagsPart.replace('g', ''); + } + regexPart = regexPart + '/' + flagsPart; + } + } + if (regexPart) { + try { + updateSearchQuery(cm, regexPart, true /** ignoreCase */, + true /** smartCase */); + } catch (e) { + showConfirm(cm, 'Invalid regex: ' + regexPart); + return; + } + } + replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart; + if (replacePart === undefined) { + showConfirm(cm, 'No previous substitute regular expression'); + 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 (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) { + lineEnd = Infinity; + } + if (count) { + lineStart = lineEnd; + lineEnd = lineStart + count - 1; + } + var startPos = clipCursorToContent(cm, Pos(lineStart, 0)); + var cursor = cm.getSearchCursor(query, startPos); + doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback); + }, + redo: CodeMirror.commands.redo, + undo: CodeMirror.commands.undo, + write: function(cm) { + if (CodeMirror.commands.save) { + CodeMirror.commands.save(cm); + } else { + cm.save(); + } + }, + nohlsearch: function(cm) { + clearSearchHighlight(cm); + }, + delmarks: function(cm, params) { + if (!params.argString || !trim(params.argString)) { + showConfirm(cm, 'Argument required'); + return; + } + + var state = cm.state.vim; + var stream = new CodeMirror.StringStream(trim(params.argString)); + while (!stream.eol()) { + stream.eatSpace(); + var count = stream.pos; + + if (!stream.match(/[a-zA-Z]/, false)) { + showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); + return; + } + + var sym = stream.next(); + if (stream.match('-', true)) { + if (!stream.match(/[a-zA-Z]/, false)) { + showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); + return; + } + + var startMark = sym; + var finishMark = stream.next(); + 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; + } + 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 { + delete state.marks[sym]; + } + } + } + }; + + var exCommandDispatcher = new ExCommandDispatcher(); + function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, + replaceWith, callback) { + cm.state.vim.exMode = true; + 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() { + while(searchCursor.findNext() && + isInRange(searchCursor.from(), lineStart, lineEnd)) { + if (!global && lastPos && searchCursor.from().line == lastPos.line) { + continue; + } + cm.scrollIntoView(searchCursor.from(), 30); + cm.setSelection(searchCursor.from(), searchCursor.to()); + lastPos = searchCursor.from(); + done = false; + return; + } + done = true; + } + function stop(close) { + if (close) { close(); } + cm.focus(); + if (lastPos) { + cm.setCursor(lastPos); + var vim = cm.state.vim; + vim.exMode = false; + vim.lastHPos = vim.lastHSPos = lastPos.ch; + } + if (callback) { callback(); } + } + function onPromptKeyDown(e, _value, close) { + CodeMirror.e_stop(e); + var keyName = CodeMirror.keyName(e); + switch (keyName) { + case 'Y': + replace(); next(); break; + case 'N': + next(); break; + case 'A': + var savedCallback = callback; + callback = undefined; + cm.operation(replaceAll); + callback = savedCallback; + break; + case 'L': + replace(); + case 'Q': + case 'Esc': + case 'Ctrl-C': + case 'Ctrl-[': + stop(close); + break; + } + if (done) { stop(close); } + return true; + } + next(); + if (done) { + showConfirm(cm, 'No matches for ' + query.source); + return; + } + if (!confirm) { + replaceAll(); + if (callback) { callback(); } + return; + } + showPrompt(cm, { + prefix: 'replace with ' + replaceWith + ' (y/n/a/q/l)', + onKeyDown: onPromptKeyDown + }); + } + + CodeMirror.keyMap.vim = { + attach: attachVimMap, + detach: detachVimMap, + call: cmKey + }; + + function exitInsertMode(cm) { + var vim = cm.state.vim; + var macroModeState = vimGlobalState.macroModeState; + var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.'); + var isPlaying = macroModeState.isPlaying; + var lastChange = macroModeState.lastInsertModeChanges; + var text = []; + if (!isPlaying) { + var selLength = lastChange.inVisualBlock ? vim.lastSelection.visualBlock.height : 1; + var changes = lastChange.changes; + var text = []; + var i = 0; + while (i < changes.length) { + text.push(changes[i]); + if (changes[i] instanceof InsertModeKey) { + i++; + } else { + i+= selLength; + } + } + lastChange.changes = text; + cm.off('change', onChange); + CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); + } + if (!isPlaying && vim.insertModeRepeat > 1) { + repeatLastEdit(cm, vim, vim.insertModeRepeat - 1, + true /** repeatForInsert */); + vim.lastEditInputState.repeatOverride = vim.insertModeRepeat; + } + delete vim.insertModeRepeat; + vim.insertMode = false; + cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1); + cm.setOption('keyMap', 'vim'); + cm.setOption('disableInput', true); + + lastChange.overwrite = cm.state.overwrite; + cm.toggleOverwrite(false); // exit replace mode if we were in it. + insertModeChangeRegister.setText(lastChange.changes.join('')); + CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); + if (macroModeState.isRecording) { + logInsertModeChange(macroModeState); + } + } + + function _mapCommand(command) { + defaultKeymap.unshift(command); + } + + function mapCommand(keys, type, name, args, extra) { + var command = {keys: keys, type: type}; + command[type] = name; + command[type + "Args"] = args; + for (var key in extra) + command[key] = extra[key]; + _mapCommand(command); + } + defineOption('insertModeEscKeysTimeout', 200, 'number'); + + CodeMirror.keyMap['vim-insert'] = { + 'Ctrl-N': 'autocomplete', + 'Ctrl-P': 'autocomplete', + 'Enter': function(cm) { + var fn = CodeMirror.commands.newlineAndIndentContinueComment || + CodeMirror.commands.newlineAndIndent; + fn(cm); + }, + fallthrough: ['default'], + attach: attachVimMap, + detach: detachVimMap, + call: cmKey + }; + + CodeMirror.keyMap['vim-replace'] = { + 'Backspace': 'goCharLeft', + fallthrough: ['vim-insert'], + attach: attachVimMap, + detach: detachVimMap, + call: cmKey + }; + + function executeMacroRegister(cm, vim, macroModeState, registerName) { + var register = vimGlobalState.registerController.getRegister(registerName); + if (registerName == ':') { + if (register.keyBuffer[0]) { + exCommandDispatcher.processCommand(cm, register.keyBuffer[0]); + } + macroModeState.isPlaying = false; + return; + } + var keyBuffer = register.keyBuffer; + var imc = 0; + macroModeState.isPlaying = true; + macroModeState.replaySearchQueries = register.searchQueries.slice(0); + for (var i = 0; i < keyBuffer.length; i++) { + var text = keyBuffer[i]; + var match, key; + while (text) { + match = (/<\w+-.+?>|<\w+>|./).exec(text); + key = match[0]; + text = text.substring(match.index + key.length); + CodeMirror.Vim.handleKey(cm, key, 'macro'); + if (vim.insertMode) { + var changes = register.insertModeChanges[imc++].changes; + vimGlobalState.macroModeState.lastInsertModeChanges.changes = + changes; + repeatInsertModeChanges(cm, changes, 1); + exitInsertMode(cm); + } + } + } + macroModeState.isPlaying = false; + } + + function logKey(macroModeState, key) { + if (macroModeState.isPlaying) { return; } + var registerName = macroModeState.latestRegister; + var register = vimGlobalState.registerController.getRegister(registerName); + if (register) { + register.pushText(key); + } + } + + function logInsertModeChange(macroModeState) { + if (macroModeState.isPlaying) { return; } + var registerName = macroModeState.latestRegister; + var register = vimGlobalState.registerController.getRegister(registerName); + if (register && register.pushInsertModeChanges) { + register.pushInsertModeChanges(macroModeState.lastInsertModeChanges); + } + } + + function logSearchQuery(macroModeState, query) { + if (macroModeState.isPlaying) { return; } + var registerName = macroModeState.latestRegister; + var register = vimGlobalState.registerController.getRegister(registerName); + if (register && register.pushSearchQuery) { + register.pushSearchQuery(query); + } + } + function onChange(_cm, changeObj) { + var macroModeState = vimGlobalState.macroModeState; + var lastChange = macroModeState.lastInsertModeChanges; + if (!macroModeState.isPlaying) { + while(changeObj) { + lastChange.expectCursorActivityForChange = true; + if (changeObj.origin == '+input' || changeObj.origin == 'paste' + || changeObj.origin === undefined /* only in testing */) { + var text = changeObj.text.join('\n'); + if (lastChange.maybeReset) { + lastChange.changes = []; + lastChange.maybeReset = false; + } + lastChange.changes.push(text); + } + changeObj = changeObj.next; + } + } + } + function onCursorActivity(cm) { + var vim = cm.state.vim; + if (vim.insertMode) { + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isPlaying) { return; } + var lastChange = macroModeState.lastInsertModeChanges; + if (lastChange.expectCursorActivityForChange) { + lastChange.expectCursorActivityForChange = false; + } else { + lastChange.maybeReset = true; + } + } else if (!cm.curOp.isVimOp) { + handleExternalSelection(cm, vim); + } + if (vim.visualMode) { + updateFakeCursor(cm); + } + } + function updateFakeCursor(cm) { + var vim = cm.state.vim; + var from = clipCursorToContent(cm, copyCursor(vim.sel.head)); + var to = offsetCursor(from, 0, 1); + if (vim.fakeCursor) { + vim.fakeCursor.clear(); + } + vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'}); + } + function handleExternalSelection(cm, vim) { + var anchor = cm.getCursor('anchor'); + var head = cm.getCursor('head'); + if (vim.visualMode && !cm.somethingSelected()) { + exitVisualMode(cm, false); + } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { + vim.visualMode = true; + vim.visualLine = false; + CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"}); + } + if (vim.visualMode) { + var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; + var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; + head = offsetCursor(head, 0, headOffset); + anchor = offsetCursor(anchor, 0, anchorOffset); + vim.sel = { + anchor: anchor, + head: head + }; + updateMark(cm, vim, '<', cursorMin(head, anchor)); + updateMark(cm, vim, '>', cursorMax(head, anchor)); + } else if (!vim.insertMode) { + vim.lastHPos = cm.getCursor().ch; + } + } + function InsertModeKey(keyName) { + this.keyName = keyName; + } + function onKeyEventTargetKeyDown(e) { + var macroModeState = vimGlobalState.macroModeState; + var lastChange = macroModeState.lastInsertModeChanges; + var keyName = CodeMirror.keyName(e); + if (!keyName) { return; } + function onKeyFound() { + if (lastChange.maybeReset) { + lastChange.changes = []; + lastChange.maybeReset = false; + } + lastChange.changes.push(new InsertModeKey(keyName)); + return true; + } + if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) { + CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound); + } + } + function repeatLastEdit(cm, vim, repeat, repeatForInsert) { + var macroModeState = vimGlobalState.macroModeState; + macroModeState.isPlaying = 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) { + repeat = !vim.lastEditActionCommand ? 1 : repeat; + var changeObject = macroModeState.lastInsertModeChanges; + repeatInsertModeChanges(cm, changeObject.changes, repeat, changeObject.overwrite); + } + } + vim.inputState = vim.lastEditInputState; + if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) { + for (var i = 0; i < repeat; i++) { + repeatCommand(); + repeatInsert(1); + } + } else { + if (!repeatForInsert) { + repeatCommand(); + } + repeatInsert(repeat); + } + vim.inputState = cachedInputState; + if (vim.insertMode && !repeatForInsert) { + exitInsertMode(cm); + } + macroModeState.isPlaying = false; + } + + function repeatInsertModeChanges(cm, changes, repeat, overwrite) { + function keyHandler(binding) { + if (typeof binding == 'string') { + CodeMirror.commands[binding](cm); + } else { + binding(cm); + } + return true; + } + var head = cm.getCursor('head'); + var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock; + if (inVisualBlock) { + var vim = cm.state.vim; + var lastSel = vim.lastSelection; + var offset = getOffset(lastSel.anchor, lastSel.head); + selectForInsert(cm, head, offset.line + 1); + repeat = cm.listSelections().length; + cm.setCursor(head); + } + for (var i = 0; i < repeat; i++) { + if (inVisualBlock) { + cm.setCursor(offsetCursor(head, i, 0)); + } + for (var j = 0; j < changes.length; j++) { + var change = changes[j]; + if (change instanceof InsertModeKey) { + CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler); + } else { + var cur = cm.getCursor(); + var end = cur; + if (overwrite && !/\n/.test(change)) { + end = offsetCursor(cur, 0, change.length); + } + cm.replaceRange(change, cur, end); + } + } + } + if (inVisualBlock) { + cm.setCursor(offsetCursor(head, 0, 1)); + } + } + + resetVimGlobalState(); + CodeMirror.Vim = Vim(); + + Vim = CodeMirror.Vim; + + var specialKey = {'return':'CR',backspace:'BS','delete':'Del',esc:'Esc', + left:'Left',right:'Right',up:'Up',down:'Down',space: 'Space', + home:'Home',end:'End',pageup:'PageUp',pagedown:'PageDown', enter: 'CR' + }; + function lookupKey(hashId, key, e) { + if (key.length > 1 && key[0] == "n") { + key = key.replace("numpad", ""); + } + key = specialKey[key] || key; + var name = ''; + if (e.ctrlKey) { name += 'C-'; } + if (e.altKey) { name += 'A-'; } + if (e.shiftKey) { name += 'S-'; } + + name += key; + if (name.length > 1) { name = '<' + name + '>'; } + return name; + } + var handleKey = Vim.handleKey.bind(Vim); + Vim.handleKey = function(cm, key, origin) { + return cm.operation(function() { + return handleKey(cm, key, origin); + }, true); + } + function cloneVimState(state) { + var n = new state.constructor(); + Object.keys(state).forEach(function(key) { + var o = state[key]; + if (Array.isArray(o)) + o = o.slice(); + else if (o && typeof o == "object" && o.constructor != Object) + o = cloneVimState(o); + n[key] = o; + }); + if (state.sel) { + n.sel = { + head: state.sel.head && copyCursor(state.sel.head), + anchor: state.sel.anchor && copyCursor(state.sel.anchor) + }; + } + return n; + } + function multiSelectHandleKey(cm, key, origin) { + var isHandled = false; + var vim = Vim.maybeInitVimState_(cm); + var visualBlock = vim.visualBlock || vim.wasInVisualBlock; + if (vim.wasInVisualBlock && !cm.ace.inMultiSelectMode) { + vim.wasInVisualBlock = false; + } else if (cm.ace.inMultiSelectMode && vim.visualBlock) { + vim.wasInVisualBlock = true; + } + + if (key == '' && !vim.insertMode && !vim.visualMode && cm.ace.inMultiSelectMode) { + cm.ace.exitMultiSelectMode(); + } else if (visualBlock || !cm.ace.inMultiSelectMode || cm.ace.inVirtualSelectionMode) { + isHandled = Vim.handleKey(cm, key, origin); + } else { + var old = cloneVimState(vim); + cm.operation(function() { + cm.ace.forEachSelection(function() { + var sel = cm.ace.selection; + cm.state.vim.lastHPos = sel.$desiredColumn == null ? sel.lead.column : sel.$desiredColumn; + var head = cm.getCursor("head"); + var anchor = cm.getCursor("anchor"); + var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; + var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; + head = offsetCursor(head, 0, headOffset); + anchor = offsetCursor(anchor, 0, anchorOffset); + cm.state.vim.sel.head = head; + cm.state.vim.sel.anchor = anchor; + + isHandled = handleKey(cm, key, origin); + sel.$desiredColumn = cm.state.vim.lastHPos == -1 ? null : cm.state.vim.lastHPos; + if (cm.virtualSelectionMode()) { + cm.state.vim = cloneVimState(old); + } + }); + if (cm.curOp.cursorActivity && !isHandled) + cm.curOp.cursorActivity = false; + }, true); + } + return isHandled; + } + exports.CodeMirror = CodeMirror; + var getVim = Vim.maybeInitVimState_; + exports.handler = { + $id: "ace/keyboard/vim", + drawCursor: function(style, pixelPos, config, sel, session) { + var vim = this.state.vim || {}; + var w = config.characterWidth; + var h = config.lineHeight; + var top = pixelPos.top; + var left = pixelPos.left; + if (!vim.insertMode) { + var isbackwards = !sel.cursor + ? session.selection.isBackwards() || session.selection.isEmpty() + : Range.comparePoints(sel.cursor, sel.start) <= 0; + if (!isbackwards && left > w) + left -= w; + } + if (!vim.insertMode && vim.status) { + h = h / 2; + top += h; + } + style.left = left + "px"; + style.top = top + "px"; + style.width = w + "px"; + style.height = h + "px"; + }, + handleKeyboard: function(data, hashId, key, keyCode, e) { + var editor = data.editor; + var cm = editor.state.cm; + var vim = getVim(cm); + if (keyCode == -1) return; + + if (key == "c" && hashId == 1) { // key == "ctrl-c" + if (!useragent.isMac && editor.getCopyText()) { + editor.once("copy", function() { + editor.selection.clearSelection(); + }); + return {command: "null", passEvent: true}; + } + } else if (!vim.insertMode) { + if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) { + hashId = -1; + key = data.inputChar; + } + } + + if (hashId == -1 || hashId & 1 || hashId === 0 && key.length > 1) { + var insertMode = vim.insertMode; + var name = lookupKey(hashId, key, e || {}); + if (vim.status == null) + vim.status = ""; + var isHandled = multiSelectHandleKey(cm, name, 'user'); + vim = getVim(cm); // may be changed by multiSelectHandleKey + if (isHandled && vim.status != null) + vim.status += name; + else if (vim.status == null) + vim.status = ""; + cm._signal("changeStatus"); + if (!isHandled && (hashId != -1 || insertMode)) + return; + return {command: "null", passEvent: !isHandled}; + } + }, + attach: function(editor) { + if (!editor.state) editor.state = {}; + var cm = new CodeMirror(editor); + editor.state.cm = cm; + editor.$vimModeHandler = this; + CodeMirror.keyMap.vim.attach(cm); + getVim(cm).status = null; + cm.on('vim-command-done', function() { + if (cm.virtualSelectionMode()) return; + getVim(cm).status = null; + cm.ace._signal("changeStatus"); + cm.ace.session.markUndoGroup(); + }); + cm.on("changeStatus", function() { + cm.ace.renderer.updateCursor(); + cm.ace._signal("changeStatus"); + }); + cm.on("vim-mode-change", function() { + if (cm.virtualSelectionMode()) return; + cm.ace.renderer.setStyle("normal-mode", !getVim(cm).insertMode); + cm._signal("changeStatus"); + }); + cm.ace.renderer.setStyle("normal-mode", !getVim(cm).insertMode); + editor.renderer.$cursorLayer.drawCursor = this.drawCursor.bind(cm); + this.updateMacCompositionHandlers(editor, true); + }, + detach: function(editor) { + var cm = editor.state.cm; + CodeMirror.keyMap.vim.detach(cm); + cm.destroy(); + editor.state.cm = null; + editor.$vimModeHandler = null; + editor.renderer.$cursorLayer.drawCursor = null; + editor.renderer.setStyle("normal-mode", false); + this.updateMacCompositionHandlers(editor, false); + }, + getStatusText: function(editor) { + var cm = editor.state.cm; + var vim = getVim(cm); + if (vim.insertMode) + return "INSERT"; + var status = ""; + if (vim.visualMode) { + status += "VISUAL"; + if (vim.visualLine) + status += " LINE"; + if (vim.visualBlock) + status += " BLOCK"; + } + if (vim.status) + status += (status ? " " : "") + vim.status; + return status; + }, + handleMacRepeat: function(data, hashId, key) { + if (hashId == -1) { + data.inputChar = key; + data.lastEvent = "input"; + } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) { + if (data.lastEvent == "input") { + data.lastEvent = "input1"; + } else if (data.lastEvent == "input1") { + return true; + } + } else { + data.$lastHash = hashId; + data.$lastKey = key; + data.lastEvent = "keypress"; + } + }, + updateMacCompositionHandlers: function(editor, enable) { + var onCompositionUpdateOverride = function(text) { + var cm = editor.state.cm; + var vim = getVim(cm); + if (!vim.insertMode) { + var el = this.textInput.getElement(); + el.blur(); + el.focus(); + el.value = text; + } else { + this.onCompositionUpdateOrig(text); + } + }; + var onCompositionStartOverride = function(text) { + var cm = editor.state.cm; + var vim = getVim(cm); + if (!vim.insertMode) { + this.onCompositionStartOrig(text); + } + }; + if (enable) { + if (!editor.onCompositionUpdateOrig) { + editor.onCompositionUpdateOrig = editor.onCompositionUpdate; + editor.onCompositionUpdate = onCompositionUpdateOverride; + editor.onCompositionStartOrig = editor.onCompositionStart; + editor.onCompositionStart = onCompositionStartOverride; + } + } else { + if (editor.onCompositionUpdateOrig) { + editor.onCompositionUpdate = editor.onCompositionUpdateOrig; + editor.onCompositionUpdateOrig = null; + editor.onCompositionStart = editor.onCompositionStartOrig; + editor.onCompositionStartOrig = null; + } + } + } + }; + var renderVirtualNumbers = { + getText: function(session, row) { + return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + ""; + }, + getWidth: function(session, lastLineNumber, config) { + return session.getLength().toString().length * config.characterWidth; + }, + update: function(e, editor) { + editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER); + }, + attach: function(editor) { + editor.renderer.$gutterLayer.$renderer = this; + editor.on("changeSelection", this.update); + }, + detach: function(editor) { + editor.renderer.$gutterLayer.$renderer = null; + editor.off("changeSelection", this.update); + } + }; + Vim.defineOption({ + name: "wrap", + set: function(value, cm) { + if (cm) {cm.ace.setOption("wrap", value)} + }, + type: "boolean" + }, false); + Vim.defineEx('write', 'w', function() { + console.log(':write is not implemented') + }); + defaultKeymap.push( + { keys: 'zc', type: 'action', action: 'fold', actionArgs: { open: false } }, + { keys: 'zC', type: 'action', action: 'fold', actionArgs: { open: false, all: true } }, + { keys: 'zo', type: 'action', action: 'fold', actionArgs: { open: true } }, + { keys: 'zO', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, + { keys: 'za', type: 'action', action: 'fold', actionArgs: { toggle: true } }, + { keys: 'zA', type: 'action', action: 'fold', actionArgs: { toggle: true, all: true } }, + { keys: 'zf', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, + { keys: 'zd', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, + + { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAbove" } }, + { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelow" } }, + { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAboveSkipCurrent" } }, + { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelowSkipCurrent" } }, + { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreBefore" } }, + { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreAfter" } }, + { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextBefore" } }, + { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextAfter" } } + ); + actions.aceCommand = function(cm, actionArgs, vim) { + cm.vimCmd = actionArgs; + if (cm.ace.inVirtualSelectionMode) + cm.ace.on("beforeEndOperation", delayedExecAceCommand); + else + delayedExecAceCommand(null, cm.ace); + }; + function delayedExecAceCommand(op, ace) { + ace.off("beforeEndOperation", delayedExecAceCommand); + var cmd = ace.state.cm.vimCmd; + if (cmd) { + ace.execCommand(cmd.exec ? cmd : cmd.name, cmd.args); + } + ace.curOp = ace.prevOp; + } + actions.fold = function(cm, actionArgs, vim) { + cm.ace.execCommand(['toggleFoldWidget', 'toggleFoldWidget', 'foldOther', 'unfoldall' + ][(actionArgs.all ? 2 : 0) + (actionArgs.open ? 1 : 0)]); + }; + + exports.handler.defaultKeymap = defaultKeymap; + exports.handler.actions = actions; + exports.Vim = Vim; + + Vim.map("Y", "yy", "normal"); +}); diff --git a/htdocs/includes/ace/mode-abap.js b/htdocs/includes/ace/mode-abap.js new file mode 100644 index 00000000000..343481fe8f7 --- /dev/null +++ b/htdocs/includes/ace/mode-abap.js @@ -0,0 +1,214 @@ +ace.define("ace/mode/abap_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var AbapHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": + "ADD ALIAS ALIASES ASCENDING ASSERT ASSIGN ASSIGNING AT BACK" + + " CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" + + " DATA DEFINE DEFINITION DEFERRED DELETE DESCENDING DESCRIBE DETAIL DIVIDE DO" + + " ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" + + " FETCH FIELDS FORM FORMAT FREE FROM FUNCTION" + + " GENERATE GET" + + " HIDE" + + " IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION" + + " LEAVE LIKE LINE LOAD LOCAL LOOP" + + " MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY" + + " ON OVERLAY OPTIONAL OTHERS" + + " PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT" + + " RAISE RANGES READ RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURN RETURNING ROLLBACK" + + " SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS" + + " TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES" + + " UNASSIGN ULINE UNPACK UPDATE" + + " WHEN WHILE WINDOW WRITE" + + " OCCURS STRUCTURE OBJECT PROPERTY" + + " CASTING APPEND RAISING VALUE COLOR" + + " CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT" + + " ID NUMBER FOR TITLE OUTPUT" + + " WITH EXIT USING" + + " INTO WHERE GROUP BY HAVING ORDER BY SINGLE" + + " APPENDING CORRESPONDING FIELDS OF TABLE" + + " LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" + + " EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN", + "constant.language": + "TRUE FALSE NULL SPACE", + "support.type": + "c n i p f d t x string xstring decfloat16 decfloat34", + "keyword.operator": + "abs sign ceil floor trunc frac acos asin atan cos sin tan" + + " abapOperator cosh sinh tanh exp log log10 sqrt" + + " strlen xstrlen charlen numofchar dbmaxlen lines" + }, "text", true, " "); + + var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|"+ + "EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|"+ + "END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|"+ + "RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|"+ + "WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|"+ + "(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)"+ + "(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|"+ + "LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|"+ + "CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|"+ + "FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|"+ + "NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|"+ + "START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|"+ + "TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|"+ + "IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)"; + + this.$rules = { + "start" : [ + {token : "string", regex : "`", next : "string"}, + {token : "string", regex : "'", next : "qstring"}, + {token : "doc.comment", regex : /^\*.+/}, + {token : "comment", regex : /".+$/}, + {token : "invalid", regex: "\\.{2,}"}, + {token : "keyword.operator", regex: /\W[\-+%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/}, + {token : "paren.lparen", regex : "[\\[({]"}, + {token : "paren.rparen", regex : "[\\])}]"}, + {token : "constant.numeric", regex: "[+-]?\\d+\\b"}, + {token : "variable.parameter", regex : /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/}, + {token : "keyword", regex : compoundKeywords}, + {token : "variable.parameter", regex : /\w+-\w+(?:-\w+)*/}, + {token : keywordMapper, regex : "\\b\\w+\\b"}, + {caseInsensitive: true} + ], + "qstring" : [ + {token : "constant.language.escape", regex : "''"}, + {token : "string", regex : "'", next : "start"}, + {defaultToken : "string"} + ], + "string" : [ + {token : "constant.language.escape", regex : "``"}, + {token : "string", regex : "`", next : "start"}, + {defaultToken : "string"} + ] + }; +}; +oop.inherits(AbapHighlightRules, TextHighlightRules); + +exports.AbapHighlightRules = AbapHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/abap",["require","exports","module","ace/mode/abap_highlight_rules","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/lib/oop"], function(require, exports, module) { +"use strict"; + +var Rules = require("./abap_highlight_rules").AbapHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; +var Range = require("../range").Range; +var TextMode = require("./text").Mode; +var oop = require("../lib/oop"); + +function Mode() { + this.HighlightRules = Rules; + this.foldingRules = new FoldMode(); +} + +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = '"' + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + return indent; + }; + + this.$id = "ace/mode/abap"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-abc.js b/htdocs/includes/ace/mode-abc.js new file mode 100644 index 00000000000..c03859dbaab --- /dev/null +++ b/htdocs/includes/ace/mode-abc.js @@ -0,0 +1,261 @@ +ace.define("ace/mode/abc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function (require, exports, module) { + "use strict"; + + var oop = require("../lib/oop"); + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + + var ABCHighlightRules = function () { + + this.$rules = { + start: [ + { + token: ['zupfnoter.information.comment.line.percentage', 'information.keyword', 'in formation.keyword.embedded'], + regex: '(%%%%)(hn\\.[a-z]*)(.*)', + comment: 'Instruction Comment' + }, + { + token: ['information.comment.line.percentage', 'information.keyword.embedded'], + regex: '(%%)(.*)', + comment: 'Instruction Comment' + }, + + { + token: 'comment.line.percentage', + regex: '%.*', + comment: 'Comments' + }, + + { + token: 'barline.keyword.operator', + regex: '[\\[:]*[|:][|\\]:]*(?:\\[?[0-9]+)?|\\[[0-9]+', + comment: 'Bar lines' + }, + { + token: ['information.keyword.embedded', 'information.argument.string.unquoted'], + regex: '(\\[[A-Za-z]:)([^\\]]*\\])', + comment: 'embedded Header lines' + }, + { + token: ['information.keyword', 'information.argument.string.unquoted'], + regex: '^([A-Za-z]:)([^%\\\\]*)', + comment: 'Header lines' + }, + { + token: ['text', 'entity.name.function', 'string.unquoted', 'text'], + regex: '(\\[)([A-Z]:)(.*?)(\\])', + comment: 'Inline fields' + }, + { + token: ['accent.constant.language', 'pitch.constant.numeric', 'duration.constant.numeric'], + regex: '([\\^=_]*)([A-Ga-gz][,\']*)([0-9]*/*[><0-9]*)', + comment: 'Notes' + }, + { + token: 'zupfnoter.jumptarget.string.quoted', + regex: '[\\"!]\\^\\:.*?[\\"!]', + comment: 'Zupfnoter jumptarget' + }, { + token: 'zupfnoter.goto.string.quoted', + regex: '[\\"!]\\^\\@.*?[\\"!]', + comment: 'Zupfnoter goto' + }, + { + token: 'zupfnoter.annotation.string.quoted', + regex: '[\\"!]\\^\\!.*?[\\"!]', + comment: 'Zupfnoter annoation' + }, + { + token: 'zupfnoter.annotationref.string.quoted', + regex: '[\\"!]\\^\\#.*?[\\"!]', + comment: 'Zupfnoter annotation reference' + }, + { + token: 'chordname.string.quoted', + regex: '[\\"!]\\^.*?[\\"!]', + comment: 'abc chord' + }, + { + token: 'string.quoted', + regex: '[\\"!].*?[\\"!]', + comment: 'abc annotation' + } + + ] + }; + + this.normalizeRules(); + }; + + ABCHighlightRules.metaData = { + fileTypes: ['abc'], + name: 'ABC', + scopeName: 'text.abcnotation' + }; + + + oop.inherits(ABCHighlightRules, TextHighlightRules); + + exports.ABCHighlightRules = ABCHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/abc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/abc_highlight_rules","ace/mode/folding/cstyle"], function (require, exports, module) { + "use strict"; + + var oop = require("../lib/oop"); + var TextMode = require("./text").Mode; + var ABCHighlightRules = require("./abc_highlight_rules").ABCHighlightRules; + var FoldMode = require("./folding/cstyle").FoldMode; + + var Mode = function () { + this.HighlightRules = ABCHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; + }; + oop.inherits(Mode, TextMode); + + (function () { + this.$id = "ace/mode/abc" + }).call(Mode.prototype); + + exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-actionscript.js b/htdocs/includes/ace/mode-actionscript.js new file mode 100644 index 00000000000..c1af16370ae --- /dev/null +++ b/htdocs/includes/ace/mode-actionscript.js @@ -0,0 +1,267 @@ +ace.define("ace/mode/actionscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ActionScriptHighlightRules = function() { + + this.$rules = { start: + [ { token: 'support.class.actionscript.2', + regex: '\\b(?:R(?:ecordset|DBMSResolver|adioButton(?:Group)?)|X(?:ML(?:Socket|Node|Connector)?|UpdateResolverDataHolder)|M(?:M(?:Save|Execute)|icrophoneMicrophone|o(?:use|vieClip(?:Loader)?)|e(?:nu(?:Bar)?|dia(?:Controller|Display|Playback))|ath)|B(?:yName|inding|utton)|S(?:haredObject|ystem|crollPane|t(?:yleSheet|age|ream)|ound|e(?:ndEvent|rviceObject)|OAPCall|lide)|N(?:umericStepper|et(?:stream|S(?:tream|ervices)|Connection|Debug(?:Config)?))|C(?:heckBox|o(?:ntextMenu(?:Item)?|okie|lor|m(?:ponentMixins|boBox))|ustomActions|lient|amera)|T(?:ypedValue|ext(?:Snapshot|Input|F(?:ield|ormat)|Area)|ree|AB)|Object|D(?:ownload|elta(?:Item|Packet)?|at(?:e(?:Chooser|Field)?|a(?:G(?:lue|rid)|Set|Type)))|U(?:RL|TC|IScrollBar)|P(?:opUpManager|endingCall|r(?:intJob|o(?:duct|gressBar)))|E(?:ndPoint|rror)|Video|Key|F(?:RadioButton|GridColumn|MessageBox|BarChart|S(?:croll(?:Bar|Pane)|tyleFormat|plitView)|orm|C(?:heckbox|omboBox|alendar)|unction|T(?:icker|ooltip(?:Lite)?|ree(?:Node)?)|IconButton|D(?:ataGrid|raggablePane)|P(?:ieChart|ushButton|ro(?:gressBar|mptBox))|L(?:i(?:stBox|neChart)|oadingBox)|AdvancedMessageBox)|W(?:indow|SDLURL|ebService(?:Connector)?)|L(?:ist|o(?:calConnection|ad(?:er|Vars)|g)|a(?:unch|bel))|A(?:sBroadcaster|cc(?:ordion|essibility)|S(?:Set(?:Native|PropFlags)|N(?:ew|ative)|C(?:onstructor|lamp(?:2)?)|InstanceOf)|pplication|lert|rray))\\b' }, + { token: 'support.function.actionscript.2', + regex: '\\b(?:s(?:h(?:ift|ow(?:GridLines|Menu|Border|Settings|Headers|ColumnHeaders|Today|Preferences)?|ad(?:ow|ePane))|c(?:hema|ale(?:X|Mode|Y|Content)|r(?:oll(?:Track|Drag)?|een(?:Resolution|Color|DPI)))|t(?:yleSheet|op(?:Drag|A(?:nimation|llSounds|gent))?|epSize|a(?:tus|rt(?:Drag|A(?:nimation|gent))?))|i(?:n|ze|lence(?:TimeOut|Level))|o(?:ngname|urce|rt(?:Items(?:By)?|On(?:HeaderRelease)?|able(?:Columns)?)?)|u(?:ppressInvalidCalls|bstr(?:ing)?)|p(?:li(?:ce|t)|aceCol(?:umnsEqually|lumnsEqually))|e(?:nd(?:DefaultPushButtonEvent|AndLoad)?|curity|t(?:R(?:GB|o(?:otNode|w(?:Height|Count))|esizable(?:Columns)?|a(?:nge|te))|G(?:ain|roupName)|X(?:AxisTitle)?|M(?:i(?:n(?:imum|utes)|lliseconds)|o(?:nth(?:Names)?|tionLevel|de)|ultilineMode|e(?:ssage|nu(?:ItemEnabled(?:At)?|EnabledAt)|dia)|a(?:sk|ximum))|B(?:u(?:tton(?:s|Width)|fferTime)|a(?:seTabIndex|ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Target|P(?:osition|roperties)|barState|Location)|t(?:yle(?:Property)?|opOnFocus|at(?:us|e))|i(?:ze|lenceLevel)|ort(?:able(?:Columns)?|Function)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)?|Style|Color|ed(?:Node(?:s)?|Cell|I(?:nd(?:ices|ex)|tem(?:s)?))?|able))|kin|m(?:oothness|allScroll))|H(?:ighlight(?:s|Color)|Scroll|o(?:urs|rizontal)|eader(?:Symbol|Height|Text|Property|Format|Width|Location)?|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:ode(?:Properties|ExpansionHandler)|ewTextFormat)|C(?:h(?:ildNodes|a(?:ngeHandler|rt(?:Title|EventHandler)))|o(?:ntent(?:Size)?|okie|lumns)|ell(?:Symbol|Data)|l(?:i(?:ckHandler|pboard)|oseHandler)|redentials)|T(?:ype(?:dVaule)?|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:out(?:Handler)?)?)|oggle|extFormat|ransform)|I(?:s(?:Branch|Open)|n(?:terval|putProperty)|con(?:SymbolName)?|te(?:rator|m(?:ByKey|Symbol)))|Orientation|D(?:i(?:splay(?:Range|Graphics|Mode|Clip|Text|edMonth)|rection)|uration|e(?:pth(?:Below|To|Above)|fault(?:GatewayURL|Mappings|NodeIconSymbolName)|l(?:iveryMode|ay)|bug(?:ID)?)|a(?:yOfWeekNames|t(?:e(?:Filter)?|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Provider|All(?:Height|Property|Format|Width))?))|ra(?:wConnectors|gContent))|U(?:se(?:Shadow|HandCursor|EchoSuppression|rInput|Fade)|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear))|P(?:osition|ercentComplete|an(?:e(?:M(?:inimumSize|aximumSize)|Size|Title))?|ro(?:pert(?:y(?:Data)?|iesAt)|gress))|E(?:nabled|dit(?:Handler|able)|xpand(?:NodeTrigger|erSymbolName))|V(?:Scroll|olume|alue(?:Source)?)|KeyFrameInterval|Quality|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|ocus|ullYear|ps|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:opback|adTarget)|a(?:rgeScroll|bel(?:Source|Placement)?))|A(?:s(?:Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:e(?:State(?:Handler)?|Handler)|ateHandler)|utoH(?:ideScrollBar|eight)))?|paratorBefore|ek|lect(?:ion(?:Disabled|Unfocused)?|ed(?:Node(?:s)?|Child|I(?:nd(?:ices|ex)|tem(?:s)?)|Dat(?:e|a))?|able(?:Ranges)?)|rver(?:String)?)|kip|qrt|wapDepths|lice|aveToSharedObj|moothing)|h(?:scroll(?:Policy)?|tml(?:Text)?|i(?:t(?:Test(?:TextNearPos)?|Area)|de(?:BuiltInItems|Child)?|ghlight(?:2D|3D)?)|orizontal|e(?:ight|ader(?:Re(?:nderer|lease)|Height|Text))|P(?:osition|ageScrollSize)|a(?:s(?:childNodes|MP3|S(?:creen(?:Broadcast|Playback)|treaming(?:Video|Audio)|ort)|Next|OwnProperty|Pr(?:inting|evious)|EmbeddedVideo|VideoEncoder|A(?:ccesibility|udio(?:Encoder)?))|ndlerName)|LineScrollSize)|ye(?:sLabel|ar)|n(?:o(?:t|de(?:Name|Close|Type|Open|Value)|Label)|u(?:llValue|mChild(?:S(?:creens|lides)|ren|Forms))|e(?:w(?:Item|line|Value|LocationDialog)|xt(?:S(?:cene|ibling|lide)|TabIndex|Value|Frame)?)?|ame(?:s)?)|c(?:h(?:ildNodes|eck|a(?:nge(?:sPending)?|r(?:CodeAt|At))|r)|o(?:s|n(?:st(?:ant|ructor)|nect|c(?:urrency|at)|t(?:ent(?:Type|Path)?|ains|rol(?:Placement|lerPolicy))|denseWhite|version)|py|l(?:or|umn(?:Stretch|Name(?:s)?|Count))|m(?:p(?:onent|lete)|ment))|u(?:stomItems|ePoint(?:s)?|r(?:veTo|Value|rent(?:Slide|ChildSlide|Item|F(?:ocused(?:S(?:creen|lide)|Form)|ps))))|e(?:il|ll(?:Renderer|Press|Edit|Focus(?:In|Out)))|l(?:i(?:ck|ents)|o(?:se(?:Button|Pane)?|ne(?:Node)?)|ear(?:S(?:haredObjects|treams)|Timeout|Interval)?)|a(?:ncelLabel|tch|p(?:tion|abilities)|l(?:cFields|l(?:e(?:e|r))?))|reate(?:GatewayConnection|Menu|Se(?:rver|gment)|C(?:hild(?:AtDepth)?|l(?:ient|ass(?:ChildAtDepth|Object(?:AtDepth)?))|all)|Text(?:Node|Field)|Item|Object(?:AtDepth)?|PopUp|E(?:lement|mptyMovieClip)))|t(?:h(?:is|row)|ype(?:of|Name)?|i(?:tle(?:StyleDeclaration)?|me(?:out)?)|o(?:talTime|String|olTipText|p|UpperCase|ggle(?:HighQuality)?|Lo(?:caleString|werCase))|e(?:st|llTarget|xt(?:RightMargin|Bold|S(?:ize|elected)|Height|Color|I(?:ndent|talic)|Disabled|Underline|F(?:ield|ont)|Width|LeftMargin|Align)?)|a(?:n|rget(?:Path)?|b(?:Stops|Children|Index|Enabled|leName))|r(?:y|igger|ac(?:e|k(?:AsMenu)?)))|i(?:s(?:Running|Branch|NaN|Con(?:soleOpen|nected)|Toggled|Installed|Open|D(?:own|ebugger)|P(?:urchased|ro(?:totypeOf|pertyEnumerable))|Empty|F(?:inite|ullyPopulated)|Local|Active)|n(?:s(?:tall|ertBefore)|cludeDeltaPacketInfo|t|it(?:ialize|Component|Pod|A(?:pplication|gent))?|de(?:nt|terminate|x(?:InParent(?:Slide|Form)?|Of)?)|put|validate|finity|LocalInternetCache)?|con(?:F(?:ield|unction))?|t(?:e(?:ratorScrolled|m(?:s|RollO(?:ut|ver)|ClassName))|alic)|d3|p|fFrameLoaded|gnore(?:Case|White))|o(?:s|n(?:R(?:ollO(?:ut|ver)|e(?:s(?:ize|ult)|l(?:ease(?:Outside)?|aseOutside)))|XML|Mouse(?:Move|Down|Up|Wheel)|S(?:ync|croller|tatus|oundComplete|e(?:tFocus|lect(?:edItem)?))|N(?:oticeEvent|etworkChange)|C(?:hanged|onnect|l(?:ipEvent|ose))|ID3|D(?:isconnect|eactivate|ata|ragO(?:ut|ver))|Un(?:install|load)|P(?:aymentResult|ress)|EnterFrame|K(?:illFocus|ey(?:Down|Up))|Fault|Lo(?:ad|g)|A(?:ctiv(?:ity|ate)|ppSt(?:op|art)))?|pe(?:n|ration)|verLayChildren|kLabel|ldValue|r(?:d)?)|d(?:i(?:s(?:connect|play(?:Normal|ed(?:Month|Year)|Full)|able(?:Shader|d(?:Ranges|Days)|CloseBox|Events))|rection)|o(?:cTypeDecl|tall|Decoding|main|LazyDecoding)|u(?:plicateMovieClip|ration)|e(?:stroy(?:ChildAt|Object)|code|fault(?:PushButton(?:Enabled)?|KeydownHandler)?|l(?:ta(?:Packet(?:Changed)?)?|ete(?:PopUp|All)?)|blocking)|a(?:shBoardSave|yNames|ta(?:Provider)?|rkshadow)|r(?:opdown(?:Width)?|a(?:w|gO(?:ut|ver))))|u(?:se(?:Sort|HandCursor|Codepage|EchoSuppression)|n(?:shift|install|derline|escape|format|watch|lo(?:ck|ad(?:Movie(?:Num)?)?))|pdate(?:Results|Mode|I(?:nputProperties|tem(?:ByIndex)?)|P(?:acket|roperties)|View|AfterEvent)|rl)|join|p(?:ixelAspectRatio|o(?:sition|p|w)|u(?:sh|rge|blish)|ercen(?:tComplete|Loaded)|lay(?:head(?:Change|Time)|ing|Hidden|erType)?|a(?:ssword|use|r(?:se(?:XML|CSS|Int|Float)|ent(?:Node|Is(?:S(?:creen|lide)|Form))|ams))|r(?:int(?:Num|AsBitmap(?:Num)?)?|o(?:to(?:type)?|pert(?:y|ies)|gress)|e(?:ss|v(?:ious(?:S(?:ibling|lide)|Value)?|Scene|Frame)|ferred(?:Height|Width))))|e(?:scape|n(?:code(?:r)?|ter(?:Frame)?|dFill|able(?:Shader|d|CloseBox|Events))|dit(?:able|Field|LocationDialog)|v(?:ent|al(?:uate)?)|q|x(?:tended|p|ec(?:ute)?|actSettings)|m(?:phasized(?:StyleDeclaration)?|bedFonts))|v(?:i(?:sible|ewPod)|ScrollPolicy|o(?:id|lume)|ersion|P(?:osition|ageScrollSize)|a(?:l(?:idat(?:ionError|e(?:Property|ActivationKey)?)|ue(?:Of)?)|riable)|LineScrollSize)|k(?:ind|ey(?:Down|Up|Press|FrameInterval))|q(?:sort|uality)|f(?:scommand|i(?:n(?:d(?:Text|First|Last)?|ally)|eldInfo|lter(?:ed|Func)?|rst(?:Slide|Child|DayOfWeek|VisibleNode)?)|o(?:nt|cus(?:In|edCell|Out|Enabled)|r(?:egroundDisabled|mat(?:ter)?))|unctionName|ps|l(?:oor|ush)|ace|romCharCode)|w(?:i(?:th|dth)|ordWrap|atch|riteAccess)|l(?:t|i(?:st(?:Owner)?|ne(?:Style|To))|o(?:c(?:k|a(?:t(?:ion|eByld)|l(?:ToGlobal|FileReadDisable)))|opback|ad(?:Movie(?:Num)?|S(?:crollContent|ound)|ed|Variables(?:Num)?|Application)?|g(?:Changes)?)|e(?:ngth|ft(?:Margin)?|ading)?|a(?:st(?:Slide|Child|Index(?:Of)?)?|nguage|b(?:el(?:Placement|F(?:ield|unction))?|leField)))|a(?:s(?:scociate(?:Controller|Display)|in|pectRatio|function)|nd|c(?:ceptConnection|tiv(?:ityLevel|ePlayControl)|os)|t(?:t(?:ach(?:Movie|Sound|Video|Audio)|ributes)|an(?:2)?)|dd(?:header|RequestHeader|Menu(?:Item(?:At)?|At)?|Sort|Header|No(?:tice|de(?:At)?)|C(?:olumn(?:At)?|uePoint)|T(?:oLocalInternetCache|reeNode(?:At)?)|I(?:con|tem(?:s(?:At)?|At)?)|DeltaItem|P(?:od|age|roperty)|EventListener|View|FieldInfo|Listener|Animation)?|uto(?:Size|Play|KeyNav|Load)|pp(?:endChild|ly(?:Changes|Updates)?)|vHardwareDisable|fterLoaded|l(?:ternateRowColors|ign|l(?:ow(?:InsecureDomain|Domain)|Transitions(?:InDone|OutDone))|bum)|r(?:tist|row|g(?:uments|List))|gent|bs)|r(?:ight(?:Margin)?|o(?:ot(?:S(?:creen|lide)|Form)|und|w(?:Height|Count)|llO(?:ut|ver))|e(?:s(?:yncDepth|t(?:orePane|artAnimation|rict)|iz(?:e|able(?:Columns)?)|olveDelta|ult(?:s)?|ponse)|c(?:o(?:ncile(?:Results|Updates)|rd)|eive(?:Video|Audio))|draw|jectConnection|place(?:Sel|ItemAt|AllItems)?|ve(?:al(?:Child)?|rse)|quest(?:SizeChange|Payment)?|f(?:errer|resh(?:ScrollContent|Destinations|Pane|FromSources)?)|lease(?:Outside)?|ad(?:Only|Access)|gister(?:SkinElement|C(?:olor(?:Style|Name)|lass)|InheritingStyle|Proxy)|move(?:Range|M(?:ovieClip|enu(?:Item(?:At)?|At))|Background|Sort|No(?:tice|de(?:sAt|At)?)|C(?:olum(?:nAt|At)|uePoints)|T(?:extField|reeNode(?:At)?)|Item(?:At)?|Pod|EventListener|FromLocalInternetCache|Listener|All(?:C(?:olumns|uePoints)|Items)?))|a(?:ndom|te|dioDot))|g(?:t|oto(?:Slide|NextSlide|PreviousSlide|FirstSlide|LastSlide|And(?:Stop|Play))|e(?:nre|t(?:R(?:GB|o(?:otNode|wCount)|e(?:sizable|mote))|X(?:AxisTitle)?|M(?:i(?:n(?:imum(?:Size)?|utes)|lliseconds)|onth(?:Names)?|ultilineMode|e(?:ssage|nu(?:ItemAt|EnabledAt|At))|aximum(?:Size)?)|B(?:ytes(?:Total|Loaded)|ounds|utton(?:s|Width)|eginIndex|a(?:ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Position|barState|Location)|t(?:yle(?:Names)?|opOnFocus|ate)|ize|o(?:urce|rtState)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)|Style|ed(?:Node(?:s)?|Cell|Text|I(?:nd(?:ices|ex)|tem(?:s)?))?)|rvice)|moothness|WFVersion)|H(?:ighlight(?:s|Color)|ours|e(?:ight|ader(?:Height|Text|Property|Format|Width|Location)?)|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:o(?:tices|de(?:DisplayedAt|At))|um(?:Children|berAvailable)|e(?:wTextFormat|xtHighestDepth))|C(?:h(?:ild(?:S(?:creen|lide)|Nodes|Form|At)|artTitle)|o(?:n(?:tent|figInfo)|okie|de|unt|lumn(?:Names|Count|Index|At))|uePoint|ellIndex|loseHandler|a(?:ll|retIndex))|T(?:ypedValue|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:stamp|zoneOffset|out(?:State|Handler)|r)?)|oggle|ext(?:Extent|Format)?|r(?:ee(?:NodeAt|Length)|ans(?:form|actionId)))|I(?:s(?:Branch|Open)|n(?:stanceAtDepth|d(?:icesByKey|exByKey))|con(?:SymbolName)?|te(?:rator|m(?:sByKey|By(?:Name|Key)|id|ID|At))|d)|O(?:utput(?:Parameter(?:s|ByName)?|Value(?:s)?)|peration|ri(?:entation|ginalCellData))|D(?:i(?:s(?:play(?:Range|Mode|Clip|Index|edMonth)|kUsage)|rection)|uration|e(?:pth|faultNodeIconSymbolName|l(?:taPacket|ay)|bug(?:Config|ID)?)|a(?:y(?:OfWeekNames)?|t(?:e|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Label|All(?:Height|Property|Format|Width))?))|rawConnectors)|U(?:se(?:Shadow|HandCursor|rInput|Fade)|RL|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear))|P(?:o(?:sition|ds)|ercentComplete|a(?:n(?:e(?:M(?:inimums|aximums)|Height|Title|Width))?|rentNode)|r(?:operty(?:Name|Data)?|efer(?:ences|red(?:Height|Width))))|E(?:n(?:dIndex|abled)|ditingData|x(?:panderSymbolName|andNodeTrigger))|V(?:iewed(?:Pods|Applications)|olume|ersion|alue(?:Source)?)|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|o(?:ntList|cus)|ullYear|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:cal|adTarget)|ength|a(?:stTabIndex|bel(?:Source)?))|A(?:s(?:cii|Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:eState(?:Handler)?|ateHandler)|utoH(?:ideScrollBar|eight)|llItems|gent))?)?|lobal(?:StyleFormat|ToLocal)?|ain|roupName)|x(?:updatePackety|mlDecl)?|m(?:y(?:MethodName|Call)|in(?:imum)?|o(?:nthNames|tion(?:TimeOut|Level)|de(?:lChanged)?|use(?:Move|O(?:ut|ver)|Down(?:Somewhere|Outside)?|Up(?:Somewhere)?|WheelEnabled)|ve(?:To)?)|u(?:ted|lti(?:pleS(?:imultaneousAllowed|elections)|line))|e(?:ssage|nu(?:Show|Hide)?|th(?:od)?|diaType)|a(?:nufacturer|tch|x(?:scroll|hscroll|imum|HPosition|Chars|VPosition)?)|b(?:substring|chr|ord|length))|b(?:ytes(?:Total|Loaded)|indFormat(?:Strings|Function)|o(?:ttom(?:Scroll)?|ld|rder(?:Color)?)|u(?:tton(?:Height|Width)|iltInItems|ffer(?:Time|Length)|llet)|e(?:foreApplyUpdates|gin(?:GradientFill|Fill))|lockIndent|a(?:ndwidth|ckground(?:Style|Color|Disabled)?)|roadcastMessage)|onHTTPStatus)\\b' }, + { token: 'support.constant.actionscript.2', + regex: '\\b(?:__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\\b' }, + { token: 'keyword.control.actionscript.2', + regex: '\\b(?:dynamic|extends|import|implements|interface|public|private|new|static|super|var|for|in|break|continue|while|do|return|if|else|case|switch)\\b' }, + { token: 'storage.type.actionscript.2', + regex: '\\b(?:Boolean|Number|String|Void)\\b' }, + { token: 'constant.language.actionscript.2', + regex: '\\b(?:null|undefined|true|false)\\b' }, + { token: 'constant.numeric.actionscript.2', + regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' }, + { token: 'punctuation.definition.string.begin.actionscript.2', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.actionscript.2', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.actionscript.2', + regex: '\\\\.' }, + { defaultToken: 'string.quoted.double.actionscript.2' } ] }, + { token: 'punctuation.definition.string.begin.actionscript.2', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.actionscript.2', + regex: '\'', + next: 'pop' }, + { token: 'constant.character.escape.actionscript.2', + regex: '\\\\.' }, + { defaultToken: 'string.quoted.single.actionscript.2' } ] }, + { token: 'support.constant.actionscript.2', + regex: '\\b(?:BACKSPACE|CAPSLOCK|CONTROL|DELETEKEY|DOWN|END|ENTER|HOME|INSERT|LEFT|LN10|LN2|LOG10E|LOG2E|MAX_VALUE|MIN_VALUE|NEGATIVE_INFINITY|NaN|PGDN|PGUP|PI|POSITIVE_INFINITY|RIGHT|SPACE|SQRT1_2|SQRT2|UP)\\b' }, + { token: 'punctuation.definition.comment.actionscript.2', + regex: '/\\*', + push: + [ { token: 'punctuation.definition.comment.actionscript.2', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.actionscript.2' } ] }, + { token: 'punctuation.definition.comment.actionscript.2', + regex: '//.*$', + push_: + [ { token: 'comment.line.double-slash.actionscript.2', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.double-slash.actionscript.2' } ] }, + { token: 'keyword.operator.actionscript.2', + regex: '\\binstanceof\\b' }, + { token: 'keyword.operator.symbolic.actionscript.2', + regex: '[-!%&*+=/?:]' }, + { token: + [ 'meta.preprocessor.actionscript.2', + 'punctuation.definition.preprocessor.actionscript.2', + 'meta.preprocessor.actionscript.2' ], + regex: '^([ \\t]*)(#)([a-zA-Z]+)' }, + { token: + [ 'storage.type.function.actionscript.2', + 'meta.function.actionscript.2', + 'entity.name.function.actionscript.2', + 'meta.function.actionscript.2', + 'punctuation.definition.parameters.begin.actionscript.2' ], + regex: '\\b(function)(\\s+)([a-zA-Z_]\\w*)(\\s*)(\\()', + push: + [ { token: 'punctuation.definition.parameters.end.actionscript.2', + regex: '\\)', + next: 'pop' }, + { token: 'variable.parameter.function.actionscript.2', + regex: '[^,)$]+' }, + { defaultToken: 'meta.function.actionscript.2' } ] }, + { token: + [ 'storage.type.class.actionscript.2', + 'meta.class.actionscript.2', + 'entity.name.type.class.actionscript.2', + 'meta.class.actionscript.2', + 'storage.modifier.extends.actionscript.2', + 'meta.class.actionscript.2', + 'entity.other.inherited-class.actionscript.2' ], + regex: '\\b(class)(\\s+)([a-zA-Z_](?:\\w|\\.)*)(?:(\\s+)(extends)(\\s+)([a-zA-Z_](?:\\w|\\.)*))?' } ] } + + this.normalizeRules(); +}; + +ActionScriptHighlightRules.metaData = { fileTypes: [ 'as' ], + keyEquivalent: '^~A', + name: 'ActionScript', + scopeName: 'source.actionscript.2' } + + +oop.inherits(ActionScriptHighlightRules, TextHighlightRules); + +exports.ActionScriptHighlightRules = ActionScriptHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/actionscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/actionscript_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ActionScriptHighlightRules = require("./actionscript_highlight_rules").ActionScriptHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = ActionScriptHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/actionscript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-ada.js b/htdocs/includes/ace/mode-ada.js new file mode 100644 index 00000000000..da059886539 --- /dev/null +++ b/htdocs/includes/ace/mode-ada.js @@ -0,0 +1,87 @@ +ace.define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var AdaHighlightRules = function() { +var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" + +"access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" + +"array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" + +"body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" + +"|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor"; + + var builtinConstants = ( + "true|false|null" + ); + + var builtinFunctions = ( + "count|min|max|avg|sum|rank|now|coalesce|main" + ); + + var keywordMapper = this.createKeywordMapper({ + "support.function": builtinFunctions, + "keyword": keywords, + "constant.language": builtinConstants + }, "identifier", true); + + this.$rules = { + "start" : [ { + token : "comment", + regex : "--.*$" + }, { + token : "string", // " string + regex : '".*?"' + }, { + token : "string", // ' string + regex : "'.*?'" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\(]" + }, { + token : "paren.rparen", + regex : "[\\)]" + }, { + token : "text", + regex : "\\s+" + } ] + }; +}; + +oop.inherits(AdaHighlightRules, TextHighlightRules); + +exports.AdaHighlightRules = AdaHighlightRules; +}); + +ace.define("ace/mode/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules; + +var Mode = function() { + this.HighlightRules = AdaHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "--"; + + this.$id = "ace/mode/ada"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-apache_conf.js b/htdocs/includes/ace/mode-apache_conf.js new file mode 100644 index 00000000000..bb6566a9f83 --- /dev/null +++ b/htdocs/includes/ace/mode-apache_conf.js @@ -0,0 +1,356 @@ +ace.define("ace/mode/apache_conf_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ApacheConfHighlightRules = function() { + + this.$rules = { start: + [ { token: + [ 'punctuation.definition.comment.apacheconf', + 'comment.line.hash.ini', + 'comment.line.hash.ini' ], + regex: '^((?:\\s)*)(#)(.*$)' }, + { token: + [ 'punctuation.definition.tag.apacheconf', + 'entity.tag.apacheconf', + 'text', + 'string.value.apacheconf', + 'punctuation.definition.tag.apacheconf' ], + regex: '(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(?:(\\s)(.+?))?(>)' }, + { token: + [ 'punctuation.definition.tag.apacheconf', + 'entity.tag.apacheconf', + 'punctuation.definition.tag.apacheconf' ], + regex: '()' }, + { token: + [ 'keyword.alias.apacheconf', 'text', + 'string.regexp.apacheconf', 'text', + 'string.replacement.apacheconf', 'text' ], + regex: '(Rewrite(?:Rule|Cond))(\\s+)(.+?)(\\s+)(.+?)($|\\s)' }, + { token: + [ 'keyword.alias.apacheconf', 'text', + 'entity.status.apacheconf', 'text', + 'string.regexp.apacheconf', 'text', + 'string.path.apacheconf', 'text' ], + regex: '(RedirectMatch)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, + { token: + [ 'keyword.alias.apacheconf', 'text', + 'entity.status.apacheconf', 'text', + 'string.path.apacheconf', 'text', + 'string.path.apacheconf', 'text' ], + regex: '(Redirect)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, + { token: + [ 'keyword.alias.apacheconf', 'text', + 'string.regexp.apacheconf', 'text', + 'string.path.apacheconf', 'text' ], + regex: '(ScriptAliasMatch|AliasMatch)(\\s+)(.+?)(\\s+)(?:(.+?)(\\s))?' }, + { token: + [ 'keyword.alias.apacheconf', 'text', + 'string.path.apacheconf', 'text', + 'string.path.apacheconf', 'text' ], + regex: '(RedirectPermanent|RedirectTemp|ScriptAlias|Alias)(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, + { token: 'keyword.core.apacheconf', + regex: '\\b(?:AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|TimeOut|TraceEnable|UseCanonicalName)\\b' }, + { token: 'keyword.mpm.apacheconf', + regex: '\\b(?:AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b' }, + { token: 'keyword.access.apacheconf', + regex: '\\b(?:Allow|Deny|Order)\\b' }, + { token: 'keyword.actions.apacheconf', + regex: '\\b(?:Action|Script)\\b' }, + { token: 'keyword.alias.apacheconf', + regex: '\\b(?:Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b' }, + { token: 'keyword.auth.apacheconf', + regex: '\\b(?:AuthAuthoritative|AuthGroupFile|AuthUserFile)\\b' }, + { token: 'keyword.auth_anon.apacheconf', + regex: '\\b(?:Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b' }, + { token: 'keyword.auth_dbm.apacheconf', + regex: '\\b(?:AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b' }, + { token: 'keyword.auth_digest.apacheconf', + regex: '\\b(?:AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)\\b' }, + { token: 'keyword.auth_ldap.apacheconf', + regex: '\\b(?:AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b' }, + { token: 'keyword.autoindex.apacheconf', + regex: '\\b(?:AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b' }, + { token: 'keyword.cache.apacheconf', + regex: '\\b(?:CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b' }, + { token: 'keyword.cern_meta.apacheconf', + regex: '\\b(?:MetaDir|MetaFiles|MetaSuffix)\\b' }, + { token: 'keyword.cgi.apacheconf', + regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b' }, + { token: 'keyword.cgid.apacheconf', + regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b' }, + { token: 'keyword.charset_lite.apacheconf', + regex: '\\b(?:CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b' }, + { token: 'keyword.dav.apacheconf', + regex: '\\b(?:Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b' }, + { token: 'keyword.deflate.apacheconf', + regex: '\\b(?:DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b' }, + { token: 'keyword.dir.apacheconf', + regex: '\\b(?:DirectoryIndex|DirectorySlash)\\b' }, + { token: 'keyword.disk_cache.apacheconf', + regex: '\\b(?:CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b' }, + { token: 'keyword.dumpio.apacheconf', + regex: '\\b(?:DumpIOInput|DumpIOOutput)\\b' }, + { token: 'keyword.env.apacheconf', + regex: '\\b(?:PassEnv|SetEnv|UnsetEnv)\\b' }, + { token: 'keyword.expires.apacheconf', + regex: '\\b(?:ExpiresActive|ExpiresByType|ExpiresDefault)\\b' }, + { token: 'keyword.ext_filter.apacheconf', + regex: '\\b(?:ExtFilterDefine|ExtFilterOptions)\\b' }, + { token: 'keyword.file_cache.apacheconf', + regex: '\\b(?:CacheFile|MMapFile)\\b' }, + { token: 'keyword.headers.apacheconf', + regex: '\\b(?:Header|RequestHeader)\\b' }, + { token: 'keyword.imap.apacheconf', + regex: '\\b(?:ImapBase|ImapDefault|ImapMenu)\\b' }, + { token: 'keyword.include.apacheconf', + regex: '\\b(?:SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b' }, + { token: 'keyword.isapi.apacheconf', + regex: '\\b(?:ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b' }, + { token: 'keyword.ldap.apacheconf', + regex: '\\b(?:LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b' }, + { token: 'keyword.log.apacheconf', + regex: '\\b(?:BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b' }, + { token: 'keyword.mem_cache.apacheconf', + regex: '\\b(?:MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b' }, + { token: 'keyword.mime.apacheconf', + regex: '\\b(?:AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b' }, + { token: 'keyword.misc.apacheconf', + regex: '\\b(?:ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b' }, + { token: 'keyword.negotiation.apacheconf', + regex: '\\b(?:CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b' }, + { token: 'keyword.nw_ssl.apacheconf', + regex: '\\b(?:NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b' }, + { token: 'keyword.proxy.apacheconf', + regex: '\\b(?:AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b' }, + { token: 'keyword.rewrite.apacheconf', + regex: '\\b(?:RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b' }, + { token: 'keyword.setenvif.apacheconf', + regex: '\\b(?:BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b' }, + { token: 'keyword.so.apacheconf', + regex: '\\b(?:LoadFile|LoadModule)\\b' }, + { token: 'keyword.ssl.apacheconf', + regex: '\\b(?:SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth)\\b' }, + { token: 'keyword.usertrack.apacheconf', + regex: '\\b(?:CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b' }, + { token: 'keyword.vhost_alias.apacheconf', + regex: '\\b(?:VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b' }, + { token: + [ 'keyword.php.apacheconf', + 'text', + 'entity.property.apacheconf', + 'text', + 'string.value.apacheconf', + 'text' ], + regex: '\\b(php_value|php_flag)\\b(?:(\\s+)(.+?)(?:(\\s+)(.+?))?)?(\\s)' }, + { token: + [ 'punctuation.variable.apacheconf', + 'variable.env.apacheconf', + 'variable.misc.apacheconf', + 'punctuation.variable.apacheconf' ], + regex: '(%\\{)(?:(HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})' }, + { token: [ 'entity.mime-type.apacheconf', 'text' ], + regex: '\\b((?:text|image|application|video|audio)/.+?)(\\s)' }, + { token: 'entity.helper.apacheconf', + regex: '\\b(?:from|unset|set|on|off)\\b', + caseInsensitive: true }, + { token: 'constant.integer.apacheconf', regex: '\\b\\d+\\b' }, + { token: + [ 'text', + 'punctuation.definition.flag.apacheconf', + 'string.flag.apacheconf', + 'punctuation.definition.flag.apacheconf', + 'text' ], + regex: '(\\s)(\\[)(.*?)(\\])(\\s)' } ] } + + this.normalizeRules(); +}; + +ApacheConfHighlightRules.metaData = { fileTypes: + [ 'conf', + 'CONF', + 'htaccess', + 'HTACCESS', + 'htgroups', + 'HTGROUPS', + 'htpasswd', + 'HTPASSWD', + '.htaccess', + '.HTACCESS', + '.htgroups', + '.HTGROUPS', + '.htpasswd', + '.HTPASSWD' ], + name: 'Apache Conf', + scopeName: 'source.apacheconf' } + + +oop.inherits(ApacheConfHighlightRules, TextHighlightRules); + +exports.ApacheConfHighlightRules = ApacheConfHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/apache_conf",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/apache_conf_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ApacheConfHighlightRules = require("./apache_conf_highlight_rules").ApacheConfHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = ApacheConfHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "#"; + this.$id = "ace/mode/apache_conf"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-applescript.js b/htdocs/includes/ace/mode-applescript.js new file mode 100644 index 00000000000..936ce2f7bc4 --- /dev/null +++ b/htdocs/includes/ace/mode-applescript.js @@ -0,0 +1,271 @@ +ace.define("ace/mode/applescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var AppleScriptHighlightRules = function() { + var keywords = ( + "about|above|after|against|and|around|as|at|back|before|beginning|" + + "behind|below|beneath|beside|between|but|by|considering|" + + "contain|contains|continue|copy|div|does|eighth|else|end|equal|" + + "equals|error|every|exit|fifth|first|for|fourth|from|front|" + + "get|given|global|if|ignoring|in|into|is|it|its|last|local|me|" + + "middle|mod|my|ninth|not|of|on|onto|or|over|prop|property|put|ref|" + + "reference|repeat|returning|script|second|set|seventh|since|" + + "sixth|some|tell|tenth|that|the|then|third|through|thru|" + + "timeout|times|to|transaction|try|until|where|while|whose|with|without" + ); + + var builtinConstants = ( + "AppleScript|false|linefeed|return|pi|quote|result|space|tab|true" + ); + + var builtinFunctions = ( + "activate|beep|count|delay|launch|log|offset|read|round|run|say|" + + "summarize|write" + ); + + var builtinTypes = ( + "alias|application|boolean|class|constant|date|file|integer|list|" + + "number|real|record|string|text|character|characters|contents|day|" + + "frontmost|id|item|length|month|name|paragraph|paragraphs|rest|" + + "reverse|running|time|version|weekday|word|words|year" + ); + + var keywordMapper = this.createKeywordMapper({ + "support.function": builtinFunctions, + "constant.language": builtinConstants, + "support.type": builtinTypes, + "keyword": keywords + }, "identifier"); + + this.$rules = { + "start": [ + { + token: "comment", + regex: "--.*$" + }, + { + token : "comment", // multi line comment + regex : "\\(\\*", + next : "comment" + }, + { + token: "string", // " string + regex: '".*?"' + }, + { + token: "support.type", + regex: '\\b(POSIX file|POSIX path|(date|time) string|quoted form)\\b' + }, + { + token: "support.function", + regex: '\\b(clipboard info|the clipboard|info for|list (disks|folder)|' + + 'mount volume|path to|(close|open for) access|(get|set) eof|' + + 'current date|do shell script|get volume settings|random number|' + + 'set volume|system attribute|system info|time to GMT|' + + '(load|run|store) script|scripting components|' + + 'ASCII (character|number)|localized string|' + + 'choose (application|color|file|file name|' + + 'folder|from list|remote application|URL)|' + + 'display (alert|dialog))\\b|^\\s*return\\b' + }, + { + token: "constant.language", + regex: '\\b(text item delimiters|current application|missing value)\\b' + }, + { + token: "keyword", + regex: '\\b(apart from|aside from|instead of|out of|greater than|' + + "isn't|(doesn't|does not) (equal|come before|come after|contain)|" + + '(greater|less) than( or equal)?|(starts?|ends|begins?) with|' + + 'contained by|comes (before|after)|a (ref|reference))\\b' + }, + { + token: keywordMapper, + regex: "[a-zA-Z][a-zA-Z0-9_]*\\b" + } + ], + "comment": [ + { + token: "comment", // closing comment + regex: "\\*\\)", + next: "start" + }, { + defaultToken: "comment" + } + ] + } + + this.normalizeRules(); +}; + +oop.inherits(AppleScriptHighlightRules, TextHighlightRules); + +exports.AppleScriptHighlightRules = AppleScriptHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/applescript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/applescript_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var AppleScriptHighlightRules = require("./applescript_highlight_rules").AppleScriptHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = AppleScriptHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = {start: "(*", end: "*)"}; + this.$id = "ace/mode/applescript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-asciidoc.js b/htdocs/includes/ace/mode-asciidoc.js new file mode 100644 index 00000000000..f112cec398c --- /dev/null +++ b/htdocs/includes/ace/mode-asciidoc.js @@ -0,0 +1,342 @@ +ace.define("ace/mode/asciidoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var AsciidocHighlightRules = function() { + var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b"; + + this.$rules = { + "start": [ + {token: "empty", regex: /$/}, + {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, + {token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock"}, + {token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock"}, + {token: "keyword", regex: /^={4,}\s*$/}, + {token: "text", regex: /^\s*$/}, + {token: "empty", regex: "", next: "dissallowDelimitedBlock"} + ], + + "dissallowDelimitedBlock": [ + {include: "paragraphEnd"}, + {token: "comment", regex: '^//.+$'}, + {token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):"}, + + {include: "listStart"}, + {token: "literal", regex: /^\s+.+$/, next: "indentedBlock"}, + {token: "empty", regex: "", next: "text"} + ], + + "paragraphEnd": [ + {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock"}, + {token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock"}, + {token: "keyword", regex: /^(?:--|''')\s*$/, next: "start"}, + {token: "option", regex: /^\[.*\]\s*$/, next: "start"}, + {token: "pageBreak", regex: /^>{3,}$/, next: "start"}, + {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, + {token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start"}, + {token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start"}, + + {token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start"}, + {token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start"} + ], + + "listStart": [ + {token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText"}, + {token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText"}, + {token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text"}, + {token: "keyword", regex: /^\+\s*$/, next: "start"} + ], + + "text": [ + {token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/}, + {token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/}, + {token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/}, + {include: "macros"}, + {include: "paragraphEnd"}, + {token: "literal", regex:/\+{3,}/, next:"smallPassthrough"}, + {token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/}, + {token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/}, + {token: "keyword", regex: /\s\+$/}, + {token: "text", regex: identifierRe}, + {token: ["keyword", "string", "keyword"], + regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/}, + {token: "keyword", regex: /<<[\w\d\-$]+,?|>>/}, + {token: "constant.character", regex: /\({2,3}.*?\){2,3}/}, + {token: "keyword", regex: /\[\[.+?\]\]/}, + {token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/}, + + {include: "quotes"}, + {token: "empty", regex: /^\s*$/, next: "start"} + ], + + "listText": [ + {include: "listStart"}, + {include: "text"} + ], + + "indentedBlock": [ + {token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock"}, + {token: "literal", regex: "", next: "start"} + ], + + "listingBlock": [ + {token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"}, + {token: "constant.numeric", regex: '<\\d+>'}, + {token: "literal", regex: '[^<]+'}, + {token: "literal", regex: '<'} + ], + "literalBlock": [ + {token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"}, + {token: "constant.numeric", regex: '<\\d+>'}, + {token: "literal", regex: '[^<]+'}, + {token: "literal", regex: '<'} + ], + "passthroughBlock": [ + {token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"}, + {token: "literal", regex: identifierRe + "|\\d+"}, + {include: "macros"}, + {token: "literal", regex: "."} + ], + + "smallPassthrough": [ + {token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"}, + {token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"}, + {token: "literal", regex: identifierRe + "|\\d+"}, + {include: "macros"} + ], + + "commentBlock": [ + {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock"}, + {token: "doc.comment", regex: '^.*$'} + ], + "tableBlock": [ + {token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock"}, + {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock"}, + {token: "tableBlock", regex: /\|/}, + {include: "text", noEscape: true} + ], + "innerTableBlock": [ + {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock"}, + {token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock"}, + {token: "tableBlock", regex: /!/} + ], + "macros": [ + {token: "macro", regex: /{[\w\-$]+}/}, + {token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/}, + {token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/}, + {token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/}, + {token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/}, + {token: "keyword", regex: /^:.+?:(?= |$)/} + ], + + "quotes": [ + {token: "string.italic", regex: /__[^_\s].*?__/}, + {token: "string.italic", regex: quoteRule("_")}, + + {token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/}, + {token: "keyword.bold", regex: quoteRule("\\*")}, + + {token: "literal", regex: quoteRule("\\+")}, + {token: "literal", regex: /\+\+[^+\s].*?\+\+/}, + {token: "literal", regex: /\$\$.+?\$\$/}, + {token: "literal", regex: quoteRule("`")}, + + {token: "keyword", regex: quoteRule("^")}, + {token: "keyword", regex: quoteRule("~")}, + {token: "keyword", regex: /##?/}, + {token: "keyword", regex: /(?:\B|^)``|\b''/} + ] + + }; + + function quoteRule(ch) { + var prefix = /\w/.test(ch) ? "\\b" : "(?:\\B|^)"; + return prefix + ch + "[^" + ch + "].*?" + ch + "(?![\\w*])"; + } + + var tokenMap = { + macro: "constant.character", + tableBlock: "doc.comment", + titleUnderline: "markup.heading", + singleLineTitle: "markup.heading", + pageBreak: "string", + option: "string.regexp", + otherBlock: "markup.list", + literal: "support.function", + optionalTitle: "constant.numeric", + escape: "constant.language.escape", + link: "markup.underline.list" + }; + + for (var state in this.$rules) { + var stateRules = this.$rules[state]; + for (var i = stateRules.length; i--; ) { + var rule = stateRules[i]; + if (rule.include || typeof rule == "string") { + var args = [i, 1].concat(this.$rules[rule.include || rule]); + if (rule.noEscape) { + args = args.filter(function(x) { + return !x.next; + }); + } + stateRules.splice.apply(stateRules, args); + } else if (rule.token in tokenMap) { + rule.token = tokenMap[rule.token]; + } + } + } +}; +oop.inherits(AsciidocHighlightRules, TextHighlightRules); + +exports.AsciidocHighlightRules = AsciidocHighlightRules; +}); + +ace.define("ace/mode/folding/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + this.foldingStartMarker = /^(?:\|={10,}|[\.\/=\-~^+]{4,}\s*$|={1,5} )/; + this.singleLineHeadingRe = /^={1,5}(?=\s+\S)/; + + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + if (!this.foldingStartMarker.test(line)) + return "" + + if (line[0] == "=") { + if (this.singleLineHeadingRe.test(line)) + return "start"; + if (session.getLine(row - 1).length != session.getLine(row).length) + return ""; + return "start"; + } + if (session.bgTokenizer.getState(row) == "dissallowDelimitedBlock") + return "end"; + return "start"; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + if (!line.match(this.foldingStartMarker)) + return; + + var token; + function getTokenType(row) { + token = session.getTokens(row)[0]; + return token && token.type; + } + + var levels = ["=","-","~","^","+"]; + var heading = "markup.heading"; + var singleLineHeadingRe = this.singleLineHeadingRe; + function getLevel() { + var match = token.value.match(singleLineHeadingRe); + if (match) + return match[0].length; + var level = levels.indexOf(token.value[0]) + 1; + if (level == 1) { + if (session.getLine(row - 1).length != session.getLine(row).length) + return Infinity; + } + return level; + } + + if (getTokenType(row) == heading) { + var startHeadingLevel = getLevel(); + while (++row < maxRow) { + if (getTokenType(row) != heading) + continue; + var level = getLevel(); + if (level <= startHeadingLevel) + break; + } + + var isSingleLineHeading = token && token.value.match(this.singleLineHeadingRe); + endRow = isSingleLineHeading ? row - 1 : row - 2; + + if (endRow > startRow) { + while (endRow > startRow && (!getTokenType(endRow) || token.value[0] == "[")) + endRow--; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + } else { + var state = session.bgTokenizer.getState(row); + if (state == "dissallowDelimitedBlock") { + while (row -- > 0) { + if (session.bgTokenizer.getState(row).lastIndexOf("Block") == -1) + break; + } + endRow = row + 1; + if (endRow < startRow) { + var endColumn = session.getLine(row).length; + return new Range(endRow, 5, startRow, startColumn - 5); + } + } else { + while (++row < maxRow) { + if (session.bgTokenizer.getState(row) == "dissallowDelimitedBlock") + break; + } + endRow = row; + if (endRow > startRow) { + var endColumn = session.getLine(row).length; + return new Range(startRow, 5, endRow, endColumn - 5); + } + } + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asciidoc_highlight_rules","ace/mode/folding/asciidoc"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules; +var AsciidocFoldMode = require("./folding/asciidoc").FoldMode; + +var Mode = function() { + this.HighlightRules = AsciidocHighlightRules; + + this.foldingRules = new AsciidocFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.type = "text"; + this.getNextLineIndent = function(state, line, tab) { + if (state == "listblock") { + var match = /^((?:.+)?)([-+*][ ]+)/.exec(line); + if (match) { + return new Array(match[1].length + 1).join(" ") + match[2]; + } else { + return ""; + } + } else { + return this.$getIndent(line); + } + }; + this.$id = "ace/mode/asciidoc"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-assembly_x86.js b/htdocs/includes/ace/mode-assembly_x86.js new file mode 100644 index 00000000000..f6a56f1be07 --- /dev/null +++ b/htdocs/includes/ace/mode-assembly_x86.js @@ -0,0 +1,186 @@ +ace.define("ace/mode/assembly_x86_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var AssemblyX86HighlightRules = function() { + + this.$rules = { start: + [ { token: 'keyword.control.assembly', + regex: '\\b(?:aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswbpaddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vtestps|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(?:n?e|n?z)?|call|j(?:mp|n?e|ge?|ae?|le?|be?|n?o|n?z))\\b', + caseInsensitive: true }, + { token: 'variable.parameter.register.assembly', + regex: '\\b(?:CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RCX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R8-15|(?:Y|X)MM(?:[0-9]|10|11|12|13|14|15)|(?:A|B|C|D)(?:X|H|L)|CR(?:[0-4]|DR(?:[0-7]|TR6|TR7|EFER)))\\b', + caseInsensitive: true }, + { token: 'constant.character.decimal.assembly', + regex: '\\b[0-9]+\\b' }, + { token: 'constant.character.hexadecimal.assembly', + regex: '\\b0x[A-F0-9]+\\b', + caseInsensitive: true }, + { token: 'constant.character.hexadecimal.assembly', + regex: '\\b[A-F0-9]+h\\b', + caseInsensitive: true }, + { token: 'string.assembly', regex: /'([^\\']|\\.)*'/ }, + { token: 'string.assembly', regex: /"([^\\"]|\\.)*"/ }, + { token: 'support.function.directive.assembly', + regex: '^\\[', + push: + [ { token: 'support.function.directive.assembly', + regex: '\\]$', + next: 'pop' }, + { defaultToken: 'support.function.directive.assembly' } ] }, + { token: + [ 'support.function.directive.assembly', + 'support.function.directive.assembly', + 'entity.name.function.assembly' ], + regex: '(^struc)( )([_a-zA-Z][_a-zA-Z0-9]*)' }, + { token: 'support.function.directive.assembly', + regex: '^endstruc\\b' }, + { token: + [ 'support.function.directive.assembly', + 'entity.name.function.assembly', + 'support.function.directive.assembly', + 'constant.character.assembly' ], + regex: '^(%macro )([_a-zA-Z][_a-zA-Z0-9]*)( )([0-9]+)' }, + { token: 'support.function.directive.assembly', + regex: '^%endmacro' }, + { token: + [ 'text', + 'support.function.directive.assembly', + 'text', + 'entity.name.function.assembly' ], + regex: '(\\s*)(%define|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\\$\\$|\\$|%unmacro|%if|%elif|%else|%endif|%(?:el)?ifdef|%(?:el)?ifmacro|%(?:el)?ifctx|%(?:el)?ifidn|%(?:el)?ifidni|%(?:el)?ifid|%(?:el)?ifnum|%(?:el)?ifstr|%(?:el)?iftoken|%(?:el)?ifempty|%(?:el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\\b( ?)((?:[_a-zA-Z][_a-zA-Z0-9]*)?)', + caseInsensitive: true }, + { token: 'support.function.directive.assembly', + regex: '\\b(?:d[bwdqtoy]|res[bwdqto]|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin)\\b', + caseInsensitive: true }, + { token: 'entity.name.function.assembly', regex: '^\\s*%%[\\w.]+?:$' }, + { token: 'entity.name.function.assembly', regex: '^\\s*%\\$[\\w.]+?:$' }, + { token: 'entity.name.function.assembly', regex: '^[\\w.]+?:' }, + { token: 'entity.name.function.assembly', regex: '^[\\w.]+?\\b' }, + { token: 'comment.assembly', regex: ';.*$' } ] + } + + this.normalizeRules(); +}; + +AssemblyX86HighlightRules.metaData = { fileTypes: [ 'asm' ], + name: 'Assembly x86', + scopeName: 'source.assembly' } + + +oop.inherits(AssemblyX86HighlightRules, TextHighlightRules); + +exports.AssemblyX86HighlightRules = AssemblyX86HighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/assembly_x86",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/assembly_x86_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var AssemblyX86HighlightRules = require("./assembly_x86_highlight_rules").AssemblyX86HighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = AssemblyX86HighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = ";"; + this.$id = "ace/mode/assembly_x86"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-autohotkey.js b/htdocs/includes/ace/mode-autohotkey.js new file mode 100644 index 00000000000..538e6fd7864 --- /dev/null +++ b/htdocs/includes/ace/mode-autohotkey.js @@ -0,0 +1,235 @@ +ace.define("ace/mode/autohotkey_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var AutoHotKeyHighlightRules = function() { + var autoItKeywords = 'And|ByRef|Case|Const|ContinueCase|ContinueLoop|Default|Dim|Do|Else|ElseIf|EndFunc|EndIf|EndSelect|EndSwitch|EndWith|Enum|Exit|ExitLoop|False|For|Func|Global|If|In|Local|Next|Not|Or|ReDim|Return|Select|Step|Switch|Then|To|True|Until|WEnd|While|With|' + + 'Abs|ACos|AdlibDisable|AdlibEnable|Asc|AscW|ASin|Assign|ATan|AutoItSetOption|AutoItWinGetTitle|AutoItWinSetTitle|Beep|Binary|BinaryLen|BinaryMid|BinaryToString|BitAND|BitNOT|BitOR|BitRotate|BitShift|BitXOR|BlockInput|Break|Call|CDTray|Ceiling|Chr|ChrW|ClipGet|ClipPut|ConsoleRead|ConsoleWrite|ConsoleWriteError|ControlClick|ControlCommand|ControlDisable|ControlEnable|ControlFocus|ControlGetFocus|ControlGetHandle|ControlGetPos|ControlGetText|ControlHide|ControlListView|ControlMove|ControlSend|ControlSetText|ControlShow|ControlTreeView|Cos|Dec|DirCopy|DirCreate|DirGetSize|DirMove|DirRemove|DllCall|DllCallbackFree|DllCallbackGetPtr|DllCallbackRegister|DllClose|DllOpen|DllStructCreate|DllStructGetData|DllStructGetPtr|DllStructGetSize|DllStructSetData|DriveGetDrive|DriveGetFileSystem|DriveGetLabel|DriveGetSerial|DriveGetType|DriveMapAdd|DriveMapDel|DriveMapGet|DriveSetLabel|DriveSpaceFree|DriveSpaceTotal|DriveStatus|EnvGet|EnvSet|EnvUpdate|Eval|Execute|Exp|FileChangeDir|FileClose|FileCopy|FileCreateNTFSLink|FileCreateShortcut|FileDelete|FileExists|FileFindFirstFile|FileFindNextFile|FileGetAttrib|FileGetLongName|FileGetShortcut|FileGetShortName|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileOpen|FileOpenDialog|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileSaveDialog|FileSelectFolder|FileSetAttrib|FileSetTime|FileWrite|FileWriteLine|Floor|FtpSetProxy|GUICreate|GUICtrlCreateAvi|GUICtrlCreateButton|GUICtrlCreateCheckbox|GUICtrlCreateCombo|GUICtrlCreateContextMenu|GUICtrlCreateDate|GUICtrlCreateDummy|GUICtrlCreateEdit|GUICtrlCreateGraphic|GUICtrlCreateGroup|GUICtrlCreateIcon|GUICtrlCreateInput|GUICtrlCreateLabel|GUICtrlCreateList|GUICtrlCreateListView|GUICtrlCreateListViewItem|GUICtrlCreateMenu|GUICtrlCreateMenuItem|GUICtrlCreateMonthCal|GUICtrlCreateObj|GUICtrlCreatePic|GUICtrlCreateProgress|GUICtrlCreateRadio|GUICtrlCreateSlider|GUICtrlCreateTab|GUICtrlCreateTabItem|GUICtrlCreateTreeView|GUICtrlCreateTreeViewItem|GUICtrlCreateUpdown|GUICtrlDelete|GUICtrlGetHandle|GUICtrlGetState|GUICtrlRead|GUICtrlRecvMsg|GUICtrlRegisterListViewSort|GUICtrlSendMsg|GUICtrlSendToDummy|GUICtrlSetBkColor|GUICtrlSetColor|GUICtrlSetCursor|GUICtrlSetData|GUICtrlSetFont|GUICtrlSetDefColor|GUICtrlSetDefBkColor|GUICtrlSetGraphic|GUICtrlSetImage|GUICtrlSetLimit|GUICtrlSetOnEvent|GUICtrlSetPos|GUICtrlSetResizing|GUICtrlSetState|GUICtrlSetStyle|GUICtrlSetTip|GUIDelete|GUIGetCursorInfo|GUIGetMsg|GUIGetStyle|GUIRegisterMsg|GUISetAccelerators()|GUISetBkColor|GUISetCoord|GUISetCursor|GUISetFont|GUISetHelp|GUISetIcon|GUISetOnEvent|GUISetState|GUISetStyle|GUIStartGroup|GUISwitch|Hex|HotKeySet|HttpSetProxy|HWnd|InetGet|InetGetSize|IniDelete|IniRead|IniReadSection|IniReadSectionNames|IniRenameSection|IniWrite|IniWriteSection|InputBox|Int|IsAdmin|IsArray|IsBinary|IsBool|IsDeclared|IsDllStruct|IsFloat|IsHWnd|IsInt|IsKeyword|IsNumber|IsObj|IsPtr|IsString|Log|MemGetStats|Mod|MouseClick|MouseClickDrag|MouseDown|MouseGetCursor|MouseGetPos|MouseMove|MouseUp|MouseWheel|MsgBox|Number|ObjCreate|ObjEvent|ObjGet|ObjName|Opt|Ping|PixelChecksum|PixelGetColor|PixelSearch|PluginClose|PluginOpen|ProcessClose|ProcessExists|ProcessGetStats|ProcessList|ProcessSetPriority|ProcessWait|ProcessWaitClose|ProgressOff|ProgressOn|ProgressSet|Ptr|Random|RegDelete|RegEnumKey|RegEnumVal|RegRead|RegWrite|Round|Run|RunAs|RunAsWait|RunWait|Send|SendKeepActive|SetError|SetExtended|ShellExecute|ShellExecuteWait|Shutdown|Sin|Sleep|SoundPlay|SoundSetWaveVolume|SplashImageOn|SplashOff|SplashTextOn|Sqrt|SRandom|StatusbarGetText|StderrRead|StdinWrite|StdioClose|StdoutRead|String|StringAddCR|StringCompare|StringFormat|StringInStr|StringIsAlNum|StringIsAlpha|StringIsASCII|StringIsDigit|StringIsFloat|StringIsInt|StringIsLower|StringIsSpace|StringIsUpper|StringIsXDigit|StringLeft|StringLen|StringLower|StringMid|StringRegExp|StringRegExpReplace|StringReplace|StringRight|StringSplit|StringStripCR|StringStripWS|StringToBinary|StringTrimLeft|StringTrimRight|StringUpper|Tan|TCPAccept|TCPCloseSocket|TCPConnect|TCPListen|TCPNameToIP|TCPRecv|TCPSend|TCPShutdown|TCPStartup|TimerDiff|TimerInit|ToolTip|TrayCreateItem|TrayCreateMenu|TrayGetMsg|TrayItemDelete|TrayItemGetHandle|TrayItemGetState|TrayItemGetText|TrayItemSetOnEvent|TrayItemSetState|TrayItemSetText|TraySetClick|TraySetIcon|TraySetOnEvent|TraySetPauseIcon|TraySetState|TraySetToolTip|TrayTip|UBound|UDPBind|UDPCloseSocket|UDPOpen|UDPRecv|UDPSend|UDPShutdown|UDPStartup|VarGetType|WinActivate|WinActive|WinClose|WinExists|WinFlash|WinGetCaretPos|WinGetClassList|WinGetClientSize|WinGetHandle|WinGetPos|WinGetProcess|WinGetState|WinGetText|WinGetTitle|WinKill|WinList|WinMenuSelectItem|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinSetOnTop|WinSetState|WinSetTitle|WinSetTrans|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive|' + + 'ArrayAdd|ArrayBinarySearch|ArrayConcatenate|ArrayDelete|ArrayDisplay|ArrayFindAll|ArrayInsert|ArrayMax|ArrayMaxIndex|ArrayMin|ArrayMinIndex|ArrayPop|ArrayPush|ArrayReverse|ArraySearch|ArraySort|ArraySwap|ArrayToClip|ArrayToString|ArrayTrim|ChooseColor|ChooseFont|ClipBoard_ChangeChain|ClipBoard_Close|ClipBoard_CountFormats|ClipBoard_Empty|ClipBoard_EnumFormats|ClipBoard_FormatStr|ClipBoard_GetData|ClipBoard_GetDataEx|ClipBoard_GetFormatName|ClipBoard_GetOpenWindow|ClipBoard_GetOwner|ClipBoard_GetPriorityFormat|ClipBoard_GetSequenceNumber|ClipBoard_GetViewer|ClipBoard_IsFormatAvailable|ClipBoard_Open|ClipBoard_RegisterFormat|ClipBoard_SetData|ClipBoard_SetDataEx|ClipBoard_SetViewer|ClipPutFile|ColorConvertHSLtoRGB|ColorConvertRGBtoHSL|ColorGetBlue|ColorGetGreen|ColorGetRed|Date_Time_CompareFileTime|Date_Time_DOSDateTimeToArray|Date_Time_DOSDateTimeToFileTime|Date_Time_DOSDateTimeToStr|Date_Time_DOSDateToArray|Date_Time_DOSDateToStr|Date_Time_DOSTimeToArray|Date_Time_DOSTimeToStr|Date_Time_EncodeFileTime|Date_Time_EncodeSystemTime|Date_Time_FileTimeToArray|Date_Time_FileTimeToDOSDateTime|Date_Time_FileTimeToLocalFileTime|Date_Time_FileTimeToStr|Date_Time_FileTimeToSystemTime|Date_Time_GetFileTime|Date_Time_GetLocalTime|Date_Time_GetSystemTime|Date_Time_GetSystemTimeAdjustment|Date_Time_GetSystemTimeAsFileTime|Date_Time_GetSystemTimes|Date_Time_GetTickCount|Date_Time_GetTimeZoneInformation|Date_Time_LocalFileTimeToFileTime|Date_Time_SetFileTime|Date_Time_SetLocalTime|Date_Time_SetSystemTime|Date_Time_SetSystemTimeAdjustment|Date_Time_SetTimeZoneInformation|Date_Time_SystemTimeToArray|Date_Time_SystemTimeToDateStr|Date_Time_SystemTimeToDateTimeStr|Date_Time_SystemTimeToFileTime|Date_Time_SystemTimeToTimeStr|Date_Time_SystemTimeToTzSpecificLocalTime|Date_Time_TzSpecificLocalTimeToSystemTime|DateAdd|DateDayOfWeek|DateDaysInMonth|DateDiff|DateIsLeapYear|DateIsValid|DateTimeFormat|DateTimeSplit|DateToDayOfWeek|DateToDayOfWeekISO|DateToDayValue|DateToMonth|DayValueToDate|DebugBugReportEnv|DebugOut|DebugSetup|Degree|EventLog__Backup|EventLog__Clear|EventLog__Close|EventLog__Count|EventLog__DeregisterSource|EventLog__Full|EventLog__Notify|EventLog__Oldest|EventLog__Open|EventLog__OpenBackup|EventLog__Read|EventLog__RegisterSource|EventLog__Report|FileCountLines|FileCreate|FileListToArray|FilePrint|FileReadToArray|FileWriteFromArray|FileWriteLog|FileWriteToLine|GDIPlus_ArrowCapCreate|GDIPlus_ArrowCapDispose|GDIPlus_ArrowCapGetFillState|GDIPlus_ArrowCapGetHeight|GDIPlus_ArrowCapGetMiddleInset|GDIPlus_ArrowCapGetWidth|GDIPlus_ArrowCapSetFillState|GDIPlus_ArrowCapSetHeight|GDIPlus_ArrowCapSetMiddleInset|GDIPlus_ArrowCapSetWidth|GDIPlus_BitmapCloneArea|GDIPlus_BitmapCreateFromFile|GDIPlus_BitmapCreateFromGraphics|GDIPlus_BitmapCreateFromHBITMAP|GDIPlus_BitmapCreateHBITMAPFromBitmap|GDIPlus_BitmapDispose|GDIPlus_BitmapLockBits|GDIPlus_BitmapUnlockBits|GDIPlus_BrushClone|GDIPlus_BrushCreateSolid|GDIPlus_BrushDispose|GDIPlus_BrushGetType|GDIPlus_CustomLineCapDispose|GDIPlus_Decoders|GDIPlus_DecodersGetCount|GDIPlus_DecodersGetSize|GDIPlus_Encoders|GDIPlus_EncodersGetCLSID|GDIPlus_EncodersGetCount|GDIPlus_EncodersGetParamList|GDIPlus_EncodersGetParamListSize|GDIPlus_EncodersGetSize|GDIPlus_FontCreate|GDIPlus_FontDispose|GDIPlus_FontFamilyCreate|GDIPlus_FontFamilyDispose|GDIPlus_GraphicsClear|GDIPlus_GraphicsCreateFromHDC|GDIPlus_GraphicsCreateFromHWND|GDIPlus_GraphicsDispose|GDIPlus_GraphicsDrawArc|GDIPlus_GraphicsDrawBezier|GDIPlus_GraphicsDrawClosedCurve|GDIPlus_GraphicsDrawCurve|GDIPlus_GraphicsDrawEllipse|GDIPlus_GraphicsDrawImage|GDIPlus_GraphicsDrawImageRect|GDIPlus_GraphicsDrawImageRectRect|GDIPlus_GraphicsDrawLine|GDIPlus_GraphicsDrawPie|GDIPlus_GraphicsDrawPolygon|GDIPlus_GraphicsDrawRect|GDIPlus_GraphicsDrawString|GDIPlus_GraphicsDrawStringEx|GDIPlus_GraphicsFillClosedCurve|GDIPlus_GraphicsFillEllipse|GDIPlus_GraphicsFillPie|GDIPlus_GraphicsFillRect|GDIPlus_GraphicsGetDC|GDIPlus_GraphicsGetSmoothingMode|GDIPlus_GraphicsMeasureString|GDIPlus_GraphicsReleaseDC|GDIPlus_GraphicsSetSmoothingMode|GDIPlus_GraphicsSetTransform|GDIPlus_ImageDispose|GDIPlus_ImageGetGraphicsContext|GDIPlus_ImageGetHeight|GDIPlus_ImageGetWidth|GDIPlus_ImageLoadFromFile|GDIPlus_ImageSaveToFile|GDIPlus_ImageSaveToFileEx|GDIPlus_MatrixCreate|GDIPlus_MatrixDispose|GDIPlus_MatrixRotate|GDIPlus_ParamAdd|GDIPlus_ParamInit|GDIPlus_PenCreate|GDIPlus_PenDispose|GDIPlus_PenGetAlignment|GDIPlus_PenGetColor|GDIPlus_PenGetCustomEndCap|GDIPlus_PenGetDashCap|GDIPlus_PenGetDashStyle|GDIPlus_PenGetEndCap|GDIPlus_PenGetWidth|GDIPlus_PenSetAlignment|GDIPlus_PenSetColor|GDIPlus_PenSetCustomEndCap|GDIPlus_PenSetDashCap|GDIPlus_PenSetDashStyle|GDIPlus_PenSetEndCap|GDIPlus_PenSetWidth|GDIPlus_RectFCreate|GDIPlus_Shutdown|GDIPlus_Startup|GDIPlus_StringFormatCreate|GDIPlus_StringFormatDispose|GetIP|GUICtrlAVI_Close|GUICtrlAVI_Create|GUICtrlAVI_Destroy|GUICtrlAVI_Open|GUICtrlAVI_OpenEx|GUICtrlAVI_Play|GUICtrlAVI_Seek|GUICtrlAVI_Show|GUICtrlAVI_Stop|GUICtrlButton_Click|GUICtrlButton_Create|GUICtrlButton_Destroy|GUICtrlButton_Enable|GUICtrlButton_GetCheck|GUICtrlButton_GetFocus|GUICtrlButton_GetIdealSize|GUICtrlButton_GetImage|GUICtrlButton_GetImageList|GUICtrlButton_GetState|GUICtrlButton_GetText|GUICtrlButton_GetTextMargin|GUICtrlButton_SetCheck|GUICtrlButton_SetFocus|GUICtrlButton_SetImage|GUICtrlButton_SetImageList|GUICtrlButton_SetSize|GUICtrlButton_SetState|GUICtrlButton_SetStyle|GUICtrlButton_SetText|GUICtrlButton_SetTextMargin|GUICtrlButton_Show|GUICtrlComboBox_AddDir|GUICtrlComboBox_AddString|GUICtrlComboBox_AutoComplete|GUICtrlComboBox_BeginUpdate|GUICtrlComboBox_Create|GUICtrlComboBox_DeleteString|GUICtrlComboBox_Destroy|GUICtrlComboBox_EndUpdate|GUICtrlComboBox_FindString|GUICtrlComboBox_FindStringExact|GUICtrlComboBox_GetComboBoxInfo|GUICtrlComboBox_GetCount|GUICtrlComboBox_GetCurSel|GUICtrlComboBox_GetDroppedControlRect|GUICtrlComboBox_GetDroppedControlRectEx|GUICtrlComboBox_GetDroppedState|GUICtrlComboBox_GetDroppedWidth|GUICtrlComboBox_GetEditSel|GUICtrlComboBox_GetEditText|GUICtrlComboBox_GetExtendedUI|GUICtrlComboBox_GetHorizontalExtent|GUICtrlComboBox_GetItemHeight|GUICtrlComboBox_GetLBText|GUICtrlComboBox_GetLBTextLen|GUICtrlComboBox_GetList|GUICtrlComboBox_GetListArray|GUICtrlComboBox_GetLocale|GUICtrlComboBox_GetLocaleCountry|GUICtrlComboBox_GetLocaleLang|GUICtrlComboBox_GetLocalePrimLang|GUICtrlComboBox_GetLocaleSubLang|GUICtrlComboBox_GetMinVisible|GUICtrlComboBox_GetTopIndex|GUICtrlComboBox_InitStorage|GUICtrlComboBox_InsertString|GUICtrlComboBox_LimitText|GUICtrlComboBox_ReplaceEditSel|GUICtrlComboBox_ResetContent|GUICtrlComboBox_SelectString|GUICtrlComboBox_SetCurSel|GUICtrlComboBox_SetDroppedWidth|GUICtrlComboBox_SetEditSel|GUICtrlComboBox_SetEditText|GUICtrlComboBox_SetExtendedUI|GUICtrlComboBox_SetHorizontalExtent|GUICtrlComboBox_SetItemHeight|GUICtrlComboBox_SetMinVisible|GUICtrlComboBox_SetTopIndex|GUICtrlComboBox_ShowDropDown|GUICtrlComboBoxEx_AddDir|GUICtrlComboBoxEx_AddString|GUICtrlComboBoxEx_BeginUpdate|GUICtrlComboBoxEx_Create|GUICtrlComboBoxEx_CreateSolidBitMap|GUICtrlComboBoxEx_DeleteString|GUICtrlComboBoxEx_Destroy|GUICtrlComboBoxEx_EndUpdate|GUICtrlComboBoxEx_FindStringExact|GUICtrlComboBoxEx_GetComboBoxInfo|GUICtrlComboBoxEx_GetComboControl|GUICtrlComboBoxEx_GetCount|GUICtrlComboBoxEx_GetCurSel|GUICtrlComboBoxEx_GetDroppedControlRect|GUICtrlComboBoxEx_GetDroppedControlRectEx|GUICtrlComboBoxEx_GetDroppedState|GUICtrlComboBoxEx_GetDroppedWidth|GUICtrlComboBoxEx_GetEditControl|GUICtrlComboBoxEx_GetEditSel|GUICtrlComboBoxEx_GetEditText|GUICtrlComboBoxEx_GetExtendedStyle|GUICtrlComboBoxEx_GetExtendedUI|GUICtrlComboBoxEx_GetImageList|GUICtrlComboBoxEx_GetItem|GUICtrlComboBoxEx_GetItemEx|GUICtrlComboBoxEx_GetItemHeight|GUICtrlComboBoxEx_GetItemImage|GUICtrlComboBoxEx_GetItemIndent|GUICtrlComboBoxEx_GetItemOverlayImage|GUICtrlComboBoxEx_GetItemParam|GUICtrlComboBoxEx_GetItemSelectedImage|GUICtrlComboBoxEx_GetItemText|GUICtrlComboBoxEx_GetItemTextLen|GUICtrlComboBoxEx_GetList|GUICtrlComboBoxEx_GetListArray|GUICtrlComboBoxEx_GetLocale|GUICtrlComboBoxEx_GetLocaleCountry|GUICtrlComboBoxEx_GetLocaleLang|GUICtrlComboBoxEx_GetLocalePrimLang|GUICtrlComboBoxEx_GetLocaleSubLang|GUICtrlComboBoxEx_GetMinVisible|GUICtrlComboBoxEx_GetTopIndex|GUICtrlComboBoxEx_InitStorage|GUICtrlComboBoxEx_InsertString|GUICtrlComboBoxEx_LimitText|GUICtrlComboBoxEx_ReplaceEditSel|GUICtrlComboBoxEx_ResetContent|GUICtrlComboBoxEx_SetCurSel|GUICtrlComboBoxEx_SetDroppedWidth|GUICtrlComboBoxEx_SetEditSel|GUICtrlComboBoxEx_SetEditText|GUICtrlComboBoxEx_SetExtendedStyle|GUICtrlComboBoxEx_SetExtendedUI|GUICtrlComboBoxEx_SetImageList|GUICtrlComboBoxEx_SetItem|GUICtrlComboBoxEx_SetItemEx|GUICtrlComboBoxEx_SetItemHeight|GUICtrlComboBoxEx_SetItemImage|GUICtrlComboBoxEx_SetItemIndent|GUICtrlComboBoxEx_SetItemOverlayImage|GUICtrlComboBoxEx_SetItemParam|GUICtrlComboBoxEx_SetItemSelectedImage|GUICtrlComboBoxEx_SetMinVisible|GUICtrlComboBoxEx_SetTopIndex|GUICtrlComboBoxEx_ShowDropDown|GUICtrlDTP_Create|GUICtrlDTP_Destroy|GUICtrlDTP_GetMCColor|GUICtrlDTP_GetMCFont|GUICtrlDTP_GetMonthCal|GUICtrlDTP_GetRange|GUICtrlDTP_GetRangeEx|GUICtrlDTP_GetSystemTime|GUICtrlDTP_GetSystemTimeEx|GUICtrlDTP_SetFormat|GUICtrlDTP_SetMCColor|GUICtrlDTP_SetMCFont|GUICtrlDTP_SetRange|GUICtrlDTP_SetRangeEx|GUICtrlDTP_SetSystemTime|GUICtrlDTP_SetSystemTimeEx|GUICtrlEdit_AppendText|GUICtrlEdit_BeginUpdate|GUICtrlEdit_CanUndo|GUICtrlEdit_CharFromPos|GUICtrlEdit_Create|GUICtrlEdit_Destroy|GUICtrlEdit_EmptyUndoBuffer|GUICtrlEdit_EndUpdate|GUICtrlEdit_Find|GUICtrlEdit_FmtLines|GUICtrlEdit_GetFirstVisibleLine|GUICtrlEdit_GetLimitText|GUICtrlEdit_GetLine|GUICtrlEdit_GetLineCount|GUICtrlEdit_GetMargins|GUICtrlEdit_GetModify|GUICtrlEdit_GetPasswordChar|GUICtrlEdit_GetRECT|GUICtrlEdit_GetRECTEx|GUICtrlEdit_GetSel|GUICtrlEdit_GetText|GUICtrlEdit_GetTextLen|GUICtrlEdit_HideBalloonTip|GUICtrlEdit_InsertText|GUICtrlEdit_LineFromChar|GUICtrlEdit_LineIndex|GUICtrlEdit_LineLength|GUICtrlEdit_LineScroll|GUICtrlEdit_PosFromChar|GUICtrlEdit_ReplaceSel|GUICtrlEdit_Scroll|GUICtrlEdit_SetLimitText|GUICtrlEdit_SetMargins|GUICtrlEdit_SetModify|GUICtrlEdit_SetPasswordChar|GUICtrlEdit_SetReadOnly|GUICtrlEdit_SetRECT|GUICtrlEdit_SetRECTEx|GUICtrlEdit_SetRECTNP|GUICtrlEdit_SetRectNPEx|GUICtrlEdit_SetSel|GUICtrlEdit_SetTabStops|GUICtrlEdit_SetText|GUICtrlEdit_ShowBalloonTip|GUICtrlEdit_Undo|GUICtrlHeader_AddItem|GUICtrlHeader_ClearFilter|GUICtrlHeader_ClearFilterAll|GUICtrlHeader_Create|GUICtrlHeader_CreateDragImage|GUICtrlHeader_DeleteItem|GUICtrlHeader_Destroy|GUICtrlHeader_EditFilter|GUICtrlHeader_GetBitmapMargin|GUICtrlHeader_GetImageList|GUICtrlHeader_GetItem|GUICtrlHeader_GetItemAlign|GUICtrlHeader_GetItemBitmap|GUICtrlHeader_GetItemCount|GUICtrlHeader_GetItemDisplay|GUICtrlHeader_GetItemFlags|GUICtrlHeader_GetItemFormat|GUICtrlHeader_GetItemImage|GUICtrlHeader_GetItemOrder|GUICtrlHeader_GetItemParam|GUICtrlHeader_GetItemRect|GUICtrlHeader_GetItemRectEx|GUICtrlHeader_GetItemText|GUICtrlHeader_GetItemWidth|GUICtrlHeader_GetOrderArray|GUICtrlHeader_GetUnicodeFormat|GUICtrlHeader_HitTest|GUICtrlHeader_InsertItem|GUICtrlHeader_Layout|GUICtrlHeader_OrderToIndex|GUICtrlHeader_SetBitmapMargin|GUICtrlHeader_SetFilterChangeTimeout|GUICtrlHeader_SetHotDivider|GUICtrlHeader_SetImageList|GUICtrlHeader_SetItem|GUICtrlHeader_SetItemAlign|GUICtrlHeader_SetItemBitmap|GUICtrlHeader_SetItemDisplay|GUICtrlHeader_SetItemFlags|GUICtrlHeader_SetItemFormat|GUICtrlHeader_SetItemImage|GUICtrlHeader_SetItemOrder|GUICtrlHeader_SetItemParam|GUICtrlHeader_SetItemText|GUICtrlHeader_SetItemWidth|GUICtrlHeader_SetOrderArray|GUICtrlHeader_SetUnicodeFormat|GUICtrlIpAddress_ClearAddress|GUICtrlIpAddress_Create|GUICtrlIpAddress_Destroy|GUICtrlIpAddress_Get|GUICtrlIpAddress_GetArray|GUICtrlIpAddress_GetEx|GUICtrlIpAddress_IsBlank|GUICtrlIpAddress_Set|GUICtrlIpAddress_SetArray|GUICtrlIpAddress_SetEx|GUICtrlIpAddress_SetFocus|GUICtrlIpAddress_SetFont|GUICtrlIpAddress_SetRange|GUICtrlIpAddress_ShowHide|GUICtrlListBox_AddFile|GUICtrlListBox_AddString|GUICtrlListBox_BeginUpdate|GUICtrlListBox_Create|GUICtrlListBox_DeleteString|GUICtrlListBox_Destroy|GUICtrlListBox_Dir|GUICtrlListBox_EndUpdate|GUICtrlListBox_FindInText|GUICtrlListBox_FindString|GUICtrlListBox_GetAnchorIndex|GUICtrlListBox_GetCaretIndex|GUICtrlListBox_GetCount|GUICtrlListBox_GetCurSel|GUICtrlListBox_GetHorizontalExtent|GUICtrlListBox_GetItemData|GUICtrlListBox_GetItemHeight|GUICtrlListBox_GetItemRect|GUICtrlListBox_GetItemRectEx|GUICtrlListBox_GetListBoxInfo|GUICtrlListBox_GetLocale|GUICtrlListBox_GetLocaleCountry|GUICtrlListBox_GetLocaleLang|GUICtrlListBox_GetLocalePrimLang|GUICtrlListBox_GetLocaleSubLang|GUICtrlListBox_GetSel|GUICtrlListBox_GetSelCount|GUICtrlListBox_GetSelItems|GUICtrlListBox_GetSelItemsText|GUICtrlListBox_GetText|GUICtrlListBox_GetTextLen|GUICtrlListBox_GetTopIndex|GUICtrlListBox_InitStorage|GUICtrlListBox_InsertString|GUICtrlListBox_ItemFromPoint|GUICtrlListBox_ReplaceString|GUICtrlListBox_ResetContent|GUICtrlListBox_SelectString|GUICtrlListBox_SelItemRange|GUICtrlListBox_SelItemRangeEx|GUICtrlListBox_SetAnchorIndex|GUICtrlListBox_SetCaretIndex|GUICtrlListBox_SetColumnWidth|GUICtrlListBox_SetCurSel|GUICtrlListBox_SetHorizontalExtent|GUICtrlListBox_SetItemData|GUICtrlListBox_SetItemHeight|GUICtrlListBox_SetLocale|GUICtrlListBox_SetSel|GUICtrlListBox_SetTabStops|GUICtrlListBox_SetTopIndex|GUICtrlListBox_Sort|GUICtrlListBox_SwapString|GUICtrlListBox_UpdateHScroll|GUICtrlListView_AddArray|GUICtrlListView_AddColumn|GUICtrlListView_AddItem|GUICtrlListView_AddSubItem|GUICtrlListView_ApproximateViewHeight|GUICtrlListView_ApproximateViewRect|GUICtrlListView_ApproximateViewWidth|GUICtrlListView_Arrange|GUICtrlListView_BeginUpdate|GUICtrlListView_CancelEditLabel|GUICtrlListView_ClickItem|GUICtrlListView_CopyItems|GUICtrlListView_Create|GUICtrlListView_CreateDragImage|GUICtrlListView_CreateSolidBitMap|GUICtrlListView_DeleteAllItems|GUICtrlListView_DeleteColumn|GUICtrlListView_DeleteItem|GUICtrlListView_DeleteItemsSelected|GUICtrlListView_Destroy|GUICtrlListView_DrawDragImage|GUICtrlListView_EditLabel|GUICtrlListView_EnableGroupView|GUICtrlListView_EndUpdate|GUICtrlListView_EnsureVisible|GUICtrlListView_FindInText|GUICtrlListView_FindItem|GUICtrlListView_FindNearest|GUICtrlListView_FindParam|GUICtrlListView_FindText|GUICtrlListView_GetBkColor|GUICtrlListView_GetBkImage|GUICtrlListView_GetCallbackMask|GUICtrlListView_GetColumn|GUICtrlListView_GetColumnCount|GUICtrlListView_GetColumnOrder|GUICtrlListView_GetColumnOrderArray|GUICtrlListView_GetColumnWidth|GUICtrlListView_GetCounterPage|GUICtrlListView_GetEditControl|GUICtrlListView_GetExtendedListViewStyle|GUICtrlListView_GetGroupInfo|GUICtrlListView_GetGroupViewEnabled|GUICtrlListView_GetHeader|GUICtrlListView_GetHotCursor|GUICtrlListView_GetHotItem|GUICtrlListView_GetHoverTime|GUICtrlListView_GetImageList|GUICtrlListView_GetISearchString|GUICtrlListView_GetItem|GUICtrlListView_GetItemChecked|GUICtrlListView_GetItemCount|GUICtrlListView_GetItemCut|GUICtrlListView_GetItemDropHilited|GUICtrlListView_GetItemEx|GUICtrlListView_GetItemFocused|GUICtrlListView_GetItemGroupID|GUICtrlListView_GetItemImage|GUICtrlListView_GetItemIndent|GUICtrlListView_GetItemParam|GUICtrlListView_GetItemPosition|GUICtrlListView_GetItemPositionX|GUICtrlListView_GetItemPositionY|GUICtrlListView_GetItemRect|GUICtrlListView_GetItemRectEx|GUICtrlListView_GetItemSelected|GUICtrlListView_GetItemSpacing|GUICtrlListView_GetItemSpacingX|GUICtrlListView_GetItemSpacingY|GUICtrlListView_GetItemState|GUICtrlListView_GetItemStateImage|GUICtrlListView_GetItemText|GUICtrlListView_GetItemTextArray|GUICtrlListView_GetItemTextString|GUICtrlListView_GetNextItem|GUICtrlListView_GetNumberOfWorkAreas|GUICtrlListView_GetOrigin|GUICtrlListView_GetOriginX|GUICtrlListView_GetOriginY|GUICtrlListView_GetOutlineColor|GUICtrlListView_GetSelectedColumn|GUICtrlListView_GetSelectedCount|GUICtrlListView_GetSelectedIndices|GUICtrlListView_GetSelectionMark|GUICtrlListView_GetStringWidth|GUICtrlListView_GetSubItemRect|GUICtrlListView_GetTextBkColor|GUICtrlListView_GetTextColor|GUICtrlListView_GetToolTips|GUICtrlListView_GetTopIndex|GUICtrlListView_GetUnicodeFormat|GUICtrlListView_GetView|GUICtrlListView_GetViewDetails|GUICtrlListView_GetViewLarge|GUICtrlListView_GetViewList|GUICtrlListView_GetViewRect|GUICtrlListView_GetViewSmall|GUICtrlListView_GetViewTile|GUICtrlListView_HideColumn|GUICtrlListView_HitTest|GUICtrlListView_InsertColumn|GUICtrlListView_InsertGroup|GUICtrlListView_InsertItem|GUICtrlListView_JustifyColumn|GUICtrlListView_MapIDToIndex|GUICtrlListView_MapIndexToID|GUICtrlListView_RedrawItems|GUICtrlListView_RegisterSortCallBack|GUICtrlListView_RemoveAllGroups|GUICtrlListView_RemoveGroup|GUICtrlListView_Scroll|GUICtrlListView_SetBkColor|GUICtrlListView_SetBkImage|GUICtrlListView_SetCallBackMask|GUICtrlListView_SetColumn|GUICtrlListView_SetColumnOrder|GUICtrlListView_SetColumnOrderArray|GUICtrlListView_SetColumnWidth|GUICtrlListView_SetExtendedListViewStyle|GUICtrlListView_SetGroupInfo|GUICtrlListView_SetHotItem|GUICtrlListView_SetHoverTime|GUICtrlListView_SetIconSpacing|GUICtrlListView_SetImageList|GUICtrlListView_SetItem|GUICtrlListView_SetItemChecked|GUICtrlListView_SetItemCount|GUICtrlListView_SetItemCut|GUICtrlListView_SetItemDropHilited|GUICtrlListView_SetItemEx|GUICtrlListView_SetItemFocused|GUICtrlListView_SetItemGroupID|GUICtrlListView_SetItemImage|GUICtrlListView_SetItemIndent|GUICtrlListView_SetItemParam|GUICtrlListView_SetItemPosition|GUICtrlListView_SetItemPosition32|GUICtrlListView_SetItemSelected|GUICtrlListView_SetItemState|GUICtrlListView_SetItemStateImage|GUICtrlListView_SetItemText|GUICtrlListView_SetOutlineColor|GUICtrlListView_SetSelectedColumn|GUICtrlListView_SetSelectionMark|GUICtrlListView_SetTextBkColor|GUICtrlListView_SetTextColor|GUICtrlListView_SetToolTips|GUICtrlListView_SetUnicodeFormat|GUICtrlListView_SetView|GUICtrlListView_SetWorkAreas|GUICtrlListView_SimpleSort|GUICtrlListView_SortItems|GUICtrlListView_SubItemHitTest|GUICtrlListView_UnRegisterSortCallBack|GUICtrlMenu_AddMenuItem|GUICtrlMenu_AppendMenu|GUICtrlMenu_CheckMenuItem|GUICtrlMenu_CheckRadioItem|GUICtrlMenu_CreateMenu|GUICtrlMenu_CreatePopup|GUICtrlMenu_DeleteMenu|GUICtrlMenu_DestroyMenu|GUICtrlMenu_DrawMenuBar|GUICtrlMenu_EnableMenuItem|GUICtrlMenu_FindItem|GUICtrlMenu_FindParent|GUICtrlMenu_GetItemBmp|GUICtrlMenu_GetItemBmpChecked|GUICtrlMenu_GetItemBmpUnchecked|GUICtrlMenu_GetItemChecked|GUICtrlMenu_GetItemCount|GUICtrlMenu_GetItemData|GUICtrlMenu_GetItemDefault|GUICtrlMenu_GetItemDisabled|GUICtrlMenu_GetItemEnabled|GUICtrlMenu_GetItemGrayed|GUICtrlMenu_GetItemHighlighted|GUICtrlMenu_GetItemID|GUICtrlMenu_GetItemInfo|GUICtrlMenu_GetItemRect|GUICtrlMenu_GetItemRectEx|GUICtrlMenu_GetItemState|GUICtrlMenu_GetItemStateEx|GUICtrlMenu_GetItemSubMenu|GUICtrlMenu_GetItemText|GUICtrlMenu_GetItemType|GUICtrlMenu_GetMenu|GUICtrlMenu_GetMenuBackground|GUICtrlMenu_GetMenuBarInfo|GUICtrlMenu_GetMenuContextHelpID|GUICtrlMenu_GetMenuData|GUICtrlMenu_GetMenuDefaultItem|GUICtrlMenu_GetMenuHeight|GUICtrlMenu_GetMenuInfo|GUICtrlMenu_GetMenuStyle|GUICtrlMenu_GetSystemMenu|GUICtrlMenu_InsertMenuItem|GUICtrlMenu_InsertMenuItemEx|GUICtrlMenu_IsMenu|GUICtrlMenu_LoadMenu|GUICtrlMenu_MapAccelerator|GUICtrlMenu_MenuItemFromPoint|GUICtrlMenu_RemoveMenu|GUICtrlMenu_SetItemBitmaps|GUICtrlMenu_SetItemBmp|GUICtrlMenu_SetItemBmpChecked|GUICtrlMenu_SetItemBmpUnchecked|GUICtrlMenu_SetItemChecked|GUICtrlMenu_SetItemData|GUICtrlMenu_SetItemDefault|GUICtrlMenu_SetItemDisabled|GUICtrlMenu_SetItemEnabled|GUICtrlMenu_SetItemGrayed|GUICtrlMenu_SetItemHighlighted|GUICtrlMenu_SetItemID|GUICtrlMenu_SetItemInfo|GUICtrlMenu_SetItemState|GUICtrlMenu_SetItemSubMenu|GUICtrlMenu_SetItemText|GUICtrlMenu_SetItemType|GUICtrlMenu_SetMenu|GUICtrlMenu_SetMenuBackground|GUICtrlMenu_SetMenuContextHelpID|GUICtrlMenu_SetMenuData|GUICtrlMenu_SetMenuDefaultItem|GUICtrlMenu_SetMenuHeight|GUICtrlMenu_SetMenuInfo|GUICtrlMenu_SetMenuStyle|GUICtrlMenu_TrackPopupMenu|GUICtrlMonthCal_Create|GUICtrlMonthCal_Destroy|GUICtrlMonthCal_GetColor|GUICtrlMonthCal_GetColorArray|GUICtrlMonthCal_GetCurSel|GUICtrlMonthCal_GetCurSelStr|GUICtrlMonthCal_GetFirstDOW|GUICtrlMonthCal_GetFirstDOWStr|GUICtrlMonthCal_GetMaxSelCount|GUICtrlMonthCal_GetMaxTodayWidth|GUICtrlMonthCal_GetMinReqHeight|GUICtrlMonthCal_GetMinReqRect|GUICtrlMonthCal_GetMinReqRectArray|GUICtrlMonthCal_GetMinReqWidth|GUICtrlMonthCal_GetMonthDelta|GUICtrlMonthCal_GetMonthRange|GUICtrlMonthCal_GetMonthRangeMax|GUICtrlMonthCal_GetMonthRangeMaxStr|GUICtrlMonthCal_GetMonthRangeMin|GUICtrlMonthCal_GetMonthRangeMinStr|GUICtrlMonthCal_GetMonthRangeSpan|GUICtrlMonthCal_GetRange|GUICtrlMonthCal_GetRangeMax|GUICtrlMonthCal_GetRangeMaxStr|GUICtrlMonthCal_GetRangeMin|GUICtrlMonthCal_GetRangeMinStr|GUICtrlMonthCal_GetSelRange|GUICtrlMonthCal_GetSelRangeMax|GUICtrlMonthCal_GetSelRangeMaxStr|GUICtrlMonthCal_GetSelRangeMin|GUICtrlMonthCal_GetSelRangeMinStr|GUICtrlMonthCal_GetToday|GUICtrlMonthCal_GetTodayStr|GUICtrlMonthCal_GetUnicodeFormat|GUICtrlMonthCal_HitTest|GUICtrlMonthCal_SetColor|GUICtrlMonthCal_SetCurSel|GUICtrlMonthCal_SetDayState|GUICtrlMonthCal_SetFirstDOW|GUICtrlMonthCal_SetMaxSelCount|GUICtrlMonthCal_SetMonthDelta|GUICtrlMonthCal_SetRange|GUICtrlMonthCal_SetSelRange|GUICtrlMonthCal_SetToday|GUICtrlMonthCal_SetUnicodeFormat|GUICtrlRebar_AddBand|GUICtrlRebar_AddToolBarBand|GUICtrlRebar_BeginDrag|GUICtrlRebar_Create|GUICtrlRebar_DeleteBand|GUICtrlRebar_Destroy|GUICtrlRebar_DragMove|GUICtrlRebar_EndDrag|GUICtrlRebar_GetBandBackColor|GUICtrlRebar_GetBandBorders|GUICtrlRebar_GetBandBordersEx|GUICtrlRebar_GetBandChildHandle|GUICtrlRebar_GetBandChildSize|GUICtrlRebar_GetBandCount|GUICtrlRebar_GetBandForeColor|GUICtrlRebar_GetBandHeaderSize|GUICtrlRebar_GetBandID|GUICtrlRebar_GetBandIdealSize|GUICtrlRebar_GetBandLength|GUICtrlRebar_GetBandLParam|GUICtrlRebar_GetBandMargins|GUICtrlRebar_GetBandMarginsEx|GUICtrlRebar_GetBandRect|GUICtrlRebar_GetBandRectEx|GUICtrlRebar_GetBandStyle|GUICtrlRebar_GetBandStyleBreak|GUICtrlRebar_GetBandStyleChildEdge|GUICtrlRebar_GetBandStyleFixedBMP|GUICtrlRebar_GetBandStyleFixedSize|GUICtrlRebar_GetBandStyleGripperAlways|GUICtrlRebar_GetBandStyleHidden|GUICtrlRebar_GetBandStyleHideTitle|GUICtrlRebar_GetBandStyleNoGripper|GUICtrlRebar_GetBandStyleTopAlign|GUICtrlRebar_GetBandStyleUseChevron|GUICtrlRebar_GetBandStyleVariableHeight|GUICtrlRebar_GetBandText|GUICtrlRebar_GetBarHeight|GUICtrlRebar_GetBKColor|GUICtrlRebar_GetColorScheme|GUICtrlRebar_GetRowCount|GUICtrlRebar_GetRowHeight|GUICtrlRebar_GetTextColor|GUICtrlRebar_GetToolTips|GUICtrlRebar_GetUnicodeFormat|GUICtrlRebar_HitTest|GUICtrlRebar_IDToIndex|GUICtrlRebar_MaximizeBand|GUICtrlRebar_MinimizeBand|GUICtrlRebar_MoveBand|GUICtrlRebar_SetBandBackColor|GUICtrlRebar_SetBandForeColor|GUICtrlRebar_SetBandHeaderSize|GUICtrlRebar_SetBandID|GUICtrlRebar_SetBandIdealSize|GUICtrlRebar_SetBandLength|GUICtrlRebar_SetBandLParam|GUICtrlRebar_SetBandStyle|GUICtrlRebar_SetBandStyleBreak|GUICtrlRebar_SetBandStyleChildEdge|GUICtrlRebar_SetBandStyleFixedBMP|GUICtrlRebar_SetBandStyleFixedSize|GUICtrlRebar_SetBandStyleGripperAlways|GUICtrlRebar_SetBandStyleHidden|GUICtrlRebar_SetBandStyleHideTitle|GUICtrlRebar_SetBandStyleNoGripper|GUICtrlRebar_SetBandStyleTopAlign|GUICtrlRebar_SetBandStyleUseChevron|GUICtrlRebar_SetBandStyleVariableHeight|GUICtrlRebar_SetBandText|GUICtrlRebar_SetBKColor|GUICtrlRebar_SetColorScheme|GUICtrlRebar_SetTextColor|GUICtrlRebar_SetToolTips|GUICtrlRebar_SetUnicodeFormat|GUICtrlRebar_ShowBand|GUICtrlSlider_ClearSel|GUICtrlSlider_ClearTics|GUICtrlSlider_Create|GUICtrlSlider_Destroy|GUICtrlSlider_GetBuddy|GUICtrlSlider_GetChannelRect|GUICtrlSlider_GetLineSize|GUICtrlSlider_GetNumTics|GUICtrlSlider_GetPageSize|GUICtrlSlider_GetPos|GUICtrlSlider_GetPTics|GUICtrlSlider_GetRange|GUICtrlSlider_GetRangeMax|GUICtrlSlider_GetRangeMin|GUICtrlSlider_GetSel|GUICtrlSlider_GetSelEnd|GUICtrlSlider_GetSelStart|GUICtrlSlider_GetThumbLength|GUICtrlSlider_GetThumbRect|GUICtrlSlider_GetThumbRectEx|GUICtrlSlider_GetTic|GUICtrlSlider_GetTicPos|GUICtrlSlider_GetToolTips|GUICtrlSlider_GetUnicodeFormat|GUICtrlSlider_SetBuddy|GUICtrlSlider_SetLineSize|GUICtrlSlider_SetPageSize|GUICtrlSlider_SetPos|GUICtrlSlider_SetRange|GUICtrlSlider_SetRangeMax|GUICtrlSlider_SetRangeMin|GUICtrlSlider_SetSel|GUICtrlSlider_SetSelEnd|GUICtrlSlider_SetSelStart|GUICtrlSlider_SetThumbLength|GUICtrlSlider_SetTic|GUICtrlSlider_SetTicFreq|GUICtrlSlider_SetTipSide|GUICtrlSlider_SetToolTips|GUICtrlSlider_SetUnicodeFormat|GUICtrlStatusBar_Create|GUICtrlStatusBar_Destroy|GUICtrlStatusBar_EmbedControl|GUICtrlStatusBar_GetBorders|GUICtrlStatusBar_GetBordersHorz|GUICtrlStatusBar_GetBordersRect|GUICtrlStatusBar_GetBordersVert|GUICtrlStatusBar_GetCount|GUICtrlStatusBar_GetHeight|GUICtrlStatusBar_GetIcon|GUICtrlStatusBar_GetParts|GUICtrlStatusBar_GetRect|GUICtrlStatusBar_GetRectEx|GUICtrlStatusBar_GetText|GUICtrlStatusBar_GetTextFlags|GUICtrlStatusBar_GetTextLength|GUICtrlStatusBar_GetTextLengthEx|GUICtrlStatusBar_GetTipText|GUICtrlStatusBar_GetUnicodeFormat|GUICtrlStatusBar_GetWidth|GUICtrlStatusBar_IsSimple|GUICtrlStatusBar_Resize|GUICtrlStatusBar_SetBkColor|GUICtrlStatusBar_SetIcon|GUICtrlStatusBar_SetMinHeight|GUICtrlStatusBar_SetParts|GUICtrlStatusBar_SetSimple|GUICtrlStatusBar_SetText|GUICtrlStatusBar_SetTipText|GUICtrlStatusBar_SetUnicodeFormat|GUICtrlStatusBar_ShowHide|GUICtrlTab_Create|GUICtrlTab_DeleteAllItems|GUICtrlTab_DeleteItem|GUICtrlTab_DeselectAll|GUICtrlTab_Destroy|GUICtrlTab_FindTab|GUICtrlTab_GetCurFocus|GUICtrlTab_GetCurSel|GUICtrlTab_GetDisplayRect|GUICtrlTab_GetDisplayRectEx|GUICtrlTab_GetExtendedStyle|GUICtrlTab_GetImageList|GUICtrlTab_GetItem|GUICtrlTab_GetItemCount|GUICtrlTab_GetItemImage|GUICtrlTab_GetItemParam|GUICtrlTab_GetItemRect|GUICtrlTab_GetItemRectEx|GUICtrlTab_GetItemState|GUICtrlTab_GetItemText|GUICtrlTab_GetRowCount|GUICtrlTab_GetToolTips|GUICtrlTab_GetUnicodeFormat|GUICtrlTab_HighlightItem|GUICtrlTab_HitTest|GUICtrlTab_InsertItem|GUICtrlTab_RemoveImage|GUICtrlTab_SetCurFocus|GUICtrlTab_SetCurSel|GUICtrlTab_SetExtendedStyle|GUICtrlTab_SetImageList|GUICtrlTab_SetItem|GUICtrlTab_SetItemImage|GUICtrlTab_SetItemParam|GUICtrlTab_SetItemSize|GUICtrlTab_SetItemState|GUICtrlTab_SetItemText|GUICtrlTab_SetMinTabWidth|GUICtrlTab_SetPadding|GUICtrlTab_SetToolTips|GUICtrlTab_SetUnicodeFormat|GUICtrlToolbar_AddBitmap|GUICtrlToolbar_AddButton|GUICtrlToolbar_AddButtonSep|GUICtrlToolbar_AddString|GUICtrlToolbar_ButtonCount|GUICtrlToolbar_CheckButton|GUICtrlToolbar_ClickAccel|GUICtrlToolbar_ClickButton|GUICtrlToolbar_ClickIndex|GUICtrlToolbar_CommandToIndex|GUICtrlToolbar_Create|GUICtrlToolbar_Customize|GUICtrlToolbar_DeleteButton|GUICtrlToolbar_Destroy|GUICtrlToolbar_EnableButton|GUICtrlToolbar_FindToolbar|GUICtrlToolbar_GetAnchorHighlight|GUICtrlToolbar_GetBitmapFlags|GUICtrlToolbar_GetButtonBitmap|GUICtrlToolbar_GetButtonInfo|GUICtrlToolbar_GetButtonInfoEx|GUICtrlToolbar_GetButtonParam|GUICtrlToolbar_GetButtonRect|GUICtrlToolbar_GetButtonRectEx|GUICtrlToolbar_GetButtonSize|GUICtrlToolbar_GetButtonState|GUICtrlToolbar_GetButtonStyle|GUICtrlToolbar_GetButtonText|GUICtrlToolbar_GetColorScheme|GUICtrlToolbar_GetDisabledImageList|GUICtrlToolbar_GetExtendedStyle|GUICtrlToolbar_GetHotImageList|GUICtrlToolbar_GetHotItem|GUICtrlToolbar_GetImageList|GUICtrlToolbar_GetInsertMark|GUICtrlToolbar_GetInsertMarkColor|GUICtrlToolbar_GetMaxSize|GUICtrlToolbar_GetMetrics|GUICtrlToolbar_GetPadding|GUICtrlToolbar_GetRows|GUICtrlToolbar_GetString|GUICtrlToolbar_GetStyle|GUICtrlToolbar_GetStyleAltDrag|GUICtrlToolbar_GetStyleCustomErase|GUICtrlToolbar_GetStyleFlat|GUICtrlToolbar_GetStyleList|GUICtrlToolbar_GetStyleRegisterDrop|GUICtrlToolbar_GetStyleToolTips|GUICtrlToolbar_GetStyleTransparent|GUICtrlToolbar_GetStyleWrapable|GUICtrlToolbar_GetTextRows|GUICtrlToolbar_GetToolTips|GUICtrlToolbar_GetUnicodeFormat|GUICtrlToolbar_HideButton|GUICtrlToolbar_HighlightButton|GUICtrlToolbar_HitTest|GUICtrlToolbar_IndexToCommand|GUICtrlToolbar_InsertButton|GUICtrlToolbar_InsertMarkHitTest|GUICtrlToolbar_IsButtonChecked|GUICtrlToolbar_IsButtonEnabled|GUICtrlToolbar_IsButtonHidden|GUICtrlToolbar_IsButtonHighlighted|GUICtrlToolbar_IsButtonIndeterminate|GUICtrlToolbar_IsButtonPressed|GUICtrlToolbar_LoadBitmap|GUICtrlToolbar_LoadImages|GUICtrlToolbar_MapAccelerator|GUICtrlToolbar_MoveButton|GUICtrlToolbar_PressButton|GUICtrlToolbar_SetAnchorHighlight|GUICtrlToolbar_SetBitmapSize|GUICtrlToolbar_SetButtonBitMap|GUICtrlToolbar_SetButtonInfo|GUICtrlToolbar_SetButtonInfoEx|GUICtrlToolbar_SetButtonParam|GUICtrlToolbar_SetButtonSize|GUICtrlToolbar_SetButtonState|GUICtrlToolbar_SetButtonStyle|GUICtrlToolbar_SetButtonText|GUICtrlToolbar_SetButtonWidth|GUICtrlToolbar_SetCmdID|GUICtrlToolbar_SetColorScheme|GUICtrlToolbar_SetDisabledImageList|GUICtrlToolbar_SetDrawTextFlags|GUICtrlToolbar_SetExtendedStyle|GUICtrlToolbar_SetHotImageList|GUICtrlToolbar_SetHotItem|GUICtrlToolbar_SetImageList|GUICtrlToolbar_SetIndent|GUICtrlToolbar_SetIndeterminate|GUICtrlToolbar_SetInsertMark|GUICtrlToolbar_SetInsertMarkColor|GUICtrlToolbar_SetMaxTextRows|GUICtrlToolbar_SetMetrics|GUICtrlToolbar_SetPadding|GUICtrlToolbar_SetParent|GUICtrlToolbar_SetRows|GUICtrlToolbar_SetStyle|GUICtrlToolbar_SetStyleAltDrag|GUICtrlToolbar_SetStyleCustomErase|GUICtrlToolbar_SetStyleFlat|GUICtrlToolbar_SetStyleList|GUICtrlToolbar_SetStyleRegisterDrop|GUICtrlToolbar_SetStyleToolTips|GUICtrlToolbar_SetStyleTransparent|GUICtrlToolbar_SetStyleWrapable|GUICtrlToolbar_SetToolTips|GUICtrlToolbar_SetUnicodeFormat|GUICtrlToolbar_SetWindowTheme|GUICtrlTreeView_Add|GUICtrlTreeView_AddChild|GUICtrlTreeView_AddChildFirst|GUICtrlTreeView_AddFirst|GUICtrlTreeView_BeginUpdate|GUICtrlTreeView_ClickItem|GUICtrlTreeView_Create|GUICtrlTreeView_CreateDragImage|GUICtrlTreeView_CreateSolidBitMap|GUICtrlTreeView_Delete|GUICtrlTreeView_DeleteAll|GUICtrlTreeView_DeleteChildren|GUICtrlTreeView_Destroy|GUICtrlTreeView_DisplayRect|GUICtrlTreeView_DisplayRectEx|GUICtrlTreeView_EditText|GUICtrlTreeView_EndEdit|GUICtrlTreeView_EndUpdate|GUICtrlTreeView_EnsureVisible|GUICtrlTreeView_Expand|GUICtrlTreeView_ExpandedOnce|GUICtrlTreeView_FindItem|GUICtrlTreeView_FindItemEx|GUICtrlTreeView_GetBkColor|GUICtrlTreeView_GetBold|GUICtrlTreeView_GetChecked|GUICtrlTreeView_GetChildCount|GUICtrlTreeView_GetChildren|GUICtrlTreeView_GetCount|GUICtrlTreeView_GetCut|GUICtrlTreeView_GetDropTarget|GUICtrlTreeView_GetEditControl|GUICtrlTreeView_GetExpanded|GUICtrlTreeView_GetFirstChild|GUICtrlTreeView_GetFirstItem|GUICtrlTreeView_GetFirstVisible|GUICtrlTreeView_GetFocused|GUICtrlTreeView_GetHeight|GUICtrlTreeView_GetImageIndex|GUICtrlTreeView_GetImageListIconHandle|GUICtrlTreeView_GetIndent|GUICtrlTreeView_GetInsertMarkColor|GUICtrlTreeView_GetISearchString|GUICtrlTreeView_GetItemByIndex|GUICtrlTreeView_GetItemHandle|GUICtrlTreeView_GetItemParam|GUICtrlTreeView_GetLastChild|GUICtrlTreeView_GetLineColor|GUICtrlTreeView_GetNext|GUICtrlTreeView_GetNextChild|GUICtrlTreeView_GetNextSibling|GUICtrlTreeView_GetNextVisible|GUICtrlTreeView_GetNormalImageList|GUICtrlTreeView_GetParentHandle|GUICtrlTreeView_GetParentParam|GUICtrlTreeView_GetPrev|GUICtrlTreeView_GetPrevChild|GUICtrlTreeView_GetPrevSibling|GUICtrlTreeView_GetPrevVisible|GUICtrlTreeView_GetScrollTime|GUICtrlTreeView_GetSelected|GUICtrlTreeView_GetSelectedImageIndex|GUICtrlTreeView_GetSelection|GUICtrlTreeView_GetSiblingCount|GUICtrlTreeView_GetState|GUICtrlTreeView_GetStateImageIndex|GUICtrlTreeView_GetStateImageList|GUICtrlTreeView_GetText|GUICtrlTreeView_GetTextColor|GUICtrlTreeView_GetToolTips|GUICtrlTreeView_GetTree|GUICtrlTreeView_GetUnicodeFormat|GUICtrlTreeView_GetVisible|GUICtrlTreeView_GetVisibleCount|GUICtrlTreeView_HitTest|GUICtrlTreeView_HitTestEx|GUICtrlTreeView_HitTestItem|GUICtrlTreeView_Index|GUICtrlTreeView_InsertItem|GUICtrlTreeView_IsFirstItem|GUICtrlTreeView_IsParent|GUICtrlTreeView_Level|GUICtrlTreeView_SelectItem|GUICtrlTreeView_SelectItemByIndex|GUICtrlTreeView_SetBkColor|GUICtrlTreeView_SetBold|GUICtrlTreeView_SetChecked|GUICtrlTreeView_SetCheckedByIndex|GUICtrlTreeView_SetChildren|GUICtrlTreeView_SetCut|GUICtrlTreeView_SetDropTarget|GUICtrlTreeView_SetFocused|GUICtrlTreeView_SetHeight|GUICtrlTreeView_SetIcon|GUICtrlTreeView_SetImageIndex|GUICtrlTreeView_SetIndent|GUICtrlTreeView_SetInsertMark|GUICtrlTreeView_SetInsertMarkColor|GUICtrlTreeView_SetItemHeight|GUICtrlTreeView_SetItemParam|GUICtrlTreeView_SetLineColor|GUICtrlTreeView_SetNormalImageList|GUICtrlTreeView_SetScrollTime|GUICtrlTreeView_SetSelected|GUICtrlTreeView_SetSelectedImageIndex|GUICtrlTreeView_SetState|GUICtrlTreeView_SetStateImageIndex|GUICtrlTreeView_SetStateImageList|GUICtrlTreeView_SetText|GUICtrlTreeView_SetTextColor|GUICtrlTreeView_SetToolTips|GUICtrlTreeView_SetUnicodeFormat|GUICtrlTreeView_Sort|GUIImageList_Add|GUIImageList_AddBitmap|GUIImageList_AddIcon|GUIImageList_AddMasked|GUIImageList_BeginDrag|GUIImageList_Copy|GUIImageList_Create|GUIImageList_Destroy|GUIImageList_DestroyIcon|GUIImageList_DragEnter|GUIImageList_DragLeave|GUIImageList_DragMove|GUIImageList_Draw|GUIImageList_DrawEx|GUIImageList_Duplicate|GUIImageList_EndDrag|GUIImageList_GetBkColor|GUIImageList_GetIcon|GUIImageList_GetIconHeight|GUIImageList_GetIconSize|GUIImageList_GetIconSizeEx|GUIImageList_GetIconWidth|GUIImageList_GetImageCount|GUIImageList_GetImageInfoEx|GUIImageList_Remove|GUIImageList_ReplaceIcon|GUIImageList_SetBkColor|GUIImageList_SetIconSize|GUIImageList_SetImageCount|GUIImageList_Swap|GUIScrollBars_EnableScrollBar|GUIScrollBars_GetScrollBarInfoEx|GUIScrollBars_GetScrollBarRect|GUIScrollBars_GetScrollBarRGState|GUIScrollBars_GetScrollBarXYLineButton|GUIScrollBars_GetScrollBarXYThumbBottom|GUIScrollBars_GetScrollBarXYThumbTop|GUIScrollBars_GetScrollInfo|GUIScrollBars_GetScrollInfoEx|GUIScrollBars_GetScrollInfoMax|GUIScrollBars_GetScrollInfoMin|GUIScrollBars_GetScrollInfoPage|GUIScrollBars_GetScrollInfoPos|GUIScrollBars_GetScrollInfoTrackPos|GUIScrollBars_GetScrollPos|GUIScrollBars_GetScrollRange|GUIScrollBars_Init|GUIScrollBars_ScrollWindow|GUIScrollBars_SetScrollInfo|GUIScrollBars_SetScrollInfoMax|GUIScrollBars_SetScrollInfoMin|GUIScrollBars_SetScrollInfoPage|GUIScrollBars_SetScrollInfoPos|GUIScrollBars_SetScrollRange|GUIScrollBars_ShowScrollBar|GUIToolTip_Activate|GUIToolTip_AddTool|GUIToolTip_AdjustRect|GUIToolTip_BitsToTTF|GUIToolTip_Create|GUIToolTip_DelTool|GUIToolTip_Destroy|GUIToolTip_EnumTools|GUIToolTip_GetBubbleHeight|GUIToolTip_GetBubbleSize|GUIToolTip_GetBubbleWidth|GUIToolTip_GetCurrentTool|GUIToolTip_GetDelayTime|GUIToolTip_GetMargin|GUIToolTip_GetMarginEx|GUIToolTip_GetMaxTipWidth|GUIToolTip_GetText|GUIToolTip_GetTipBkColor|GUIToolTip_GetTipTextColor|GUIToolTip_GetTitleBitMap|GUIToolTip_GetTitleText|GUIToolTip_GetToolCount|GUIToolTip_GetToolInfo|GUIToolTip_HitTest|GUIToolTip_NewToolRect|GUIToolTip_Pop|GUIToolTip_PopUp|GUIToolTip_SetDelayTime|GUIToolTip_SetMargin|GUIToolTip_SetMaxTipWidth|GUIToolTip_SetTipBkColor|GUIToolTip_SetTipTextColor|GUIToolTip_SetTitle|GUIToolTip_SetToolInfo|GUIToolTip_SetWindowTheme|GUIToolTip_ToolExists|GUIToolTip_ToolToArray|GUIToolTip_TrackActivate|GUIToolTip_TrackPosition|GUIToolTip_TTFToBits|GUIToolTip_Update|GUIToolTip_UpdateTipText|HexToString|IE_Example|IE_Introduction|IE_VersionInfo|IEAction|IEAttach|IEBodyReadHTML|IEBodyReadText|IEBodyWriteHTML|IECreate|IECreateEmbedded|IEDocGetObj|IEDocInsertHTML|IEDocInsertText|IEDocReadHTML|IEDocWriteHTML|IEErrorHandlerDeRegister|IEErrorHandlerRegister|IEErrorNotify|IEFormElementCheckBoxSelect|IEFormElementGetCollection|IEFormElementGetObjByName|IEFormElementGetValue|IEFormElementOptionSelect|IEFormElementRadioSelect|IEFormElementSetValue|IEFormGetCollection|IEFormGetObjByName|IEFormImageClick|IEFormReset|IEFormSubmit|IEFrameGetCollection|IEFrameGetObjByName|IEGetObjById|IEGetObjByName|IEHeadInsertEventScript|IEImgClick|IEImgGetCollection|IEIsFrameSet|IELinkClickByIndex|IELinkClickByText|IELinkGetCollection|IELoadWait|IELoadWaitTimeout|IENavigate|IEPropertyGet|IEPropertySet|IEQuit|IETableGetCollection|IETableWriteToArray|IETagNameAllGetCollection|IETagNameGetCollection|Iif|INetExplorerCapable|INetGetSource|INetMail|INetSmtpMail|IsPressed|MathCheckDiv|Max|MemGlobalAlloc|MemGlobalFree|MemGlobalLock|MemGlobalSize|MemGlobalUnlock|MemMoveMemory|MemMsgBox|MemShowError|MemVirtualAlloc|MemVirtualAllocEx|MemVirtualFree|MemVirtualFreeEx|Min|MouseTrap|NamedPipes_CallNamedPipe|NamedPipes_ConnectNamedPipe|NamedPipes_CreateNamedPipe|NamedPipes_CreatePipe|NamedPipes_DisconnectNamedPipe|NamedPipes_GetNamedPipeHandleState|NamedPipes_GetNamedPipeInfo|NamedPipes_PeekNamedPipe|NamedPipes_SetNamedPipeHandleState|NamedPipes_TransactNamedPipe|NamedPipes_WaitNamedPipe|Net_Share_ConnectionEnum|Net_Share_FileClose|Net_Share_FileEnum|Net_Share_FileGetInfo|Net_Share_PermStr|Net_Share_ResourceStr|Net_Share_SessionDel|Net_Share_SessionEnum|Net_Share_SessionGetInfo|Net_Share_ShareAdd|Net_Share_ShareCheck|Net_Share_ShareDel|Net_Share_ShareEnum|Net_Share_ShareGetInfo|Net_Share_ShareSetInfo|Net_Share_StatisticsGetSvr|Net_Share_StatisticsGetWrk|Now|NowCalc|NowCalcDate|NowDate|NowTime|PathFull|PathMake|PathSplit|ProcessGetName|ProcessGetPriority|Radian|ReplaceStringInFile|RunDOS|ScreenCapture_Capture|ScreenCapture_CaptureWnd|ScreenCapture_SaveImage|ScreenCapture_SetBMPFormat|ScreenCapture_SetJPGQuality|ScreenCapture_SetTIFColorDepth|ScreenCapture_SetTIFCompression|Security__AdjustTokenPrivileges|Security__GetAccountSid|Security__GetLengthSid|Security__GetTokenInformation|Security__ImpersonateSelf|Security__IsValidSid|Security__LookupAccountName|Security__LookupAccountSid|Security__LookupPrivilegeValue|Security__OpenProcessToken|Security__OpenThreadToken|Security__OpenThreadTokenEx|Security__SetPrivilege|Security__SidToStringSid|Security__SidTypeStr|Security__StringSidToSid|SendMessage|SendMessageA|SetDate|SetTime|Singleton|SoundClose|SoundLength|SoundOpen|SoundPause|SoundPlay|SoundPos|SoundResume|SoundSeek|SoundStatus|SoundStop|SQLite_Changes|SQLite_Close|SQLite_Display2DResult|SQLite_Encode|SQLite_ErrCode|SQLite_ErrMsg|SQLite_Escape|SQLite_Exec|SQLite_FetchData|SQLite_FetchNames|SQLite_GetTable|SQLite_GetTable2d|SQLite_LastInsertRowID|SQLite_LibVersion|SQLite_Open|SQLite_Query|SQLite_QueryFinalize|SQLite_QueryReset|SQLite_QuerySingleRow|SQLite_SaveMode|SQLite_SetTimeout|SQLite_Shutdown|SQLite_SQLiteExe|SQLite_Startup|SQLite_TotalChanges|StringAddComma|StringBetween|StringEncrypt|StringInsert|StringProper|StringRepeat|StringReverse|StringSplit|StringToHex|TCPIpToName|TempFile|TicksToTime|Timer_Diff|Timer_GetTimerID|Timer_Init|Timer_KillAllTimers|Timer_KillTimer|Timer_SetTimer|TimeToTicks|VersionCompare|viClose|viExecCommand|viFindGpib|viGpibBusReset|viGTL|viOpen|viSetAttribute|viSetTimeout|WeekNumberISO|WinAPI_AttachConsole|WinAPI_AttachThreadInput|WinAPI_Beep|WinAPI_BitBlt|WinAPI_CallNextHookEx|WinAPI_Check|WinAPI_ClientToScreen|WinAPI_CloseHandle|WinAPI_CommDlgExtendedError|WinAPI_CopyIcon|WinAPI_CreateBitmap|WinAPI_CreateCompatibleBitmap|WinAPI_CreateCompatibleDC|WinAPI_CreateEvent|WinAPI_CreateFile|WinAPI_CreateFont|WinAPI_CreateFontIndirect|WinAPI_CreateProcess|WinAPI_CreateSolidBitmap|WinAPI_CreateSolidBrush|WinAPI_CreateWindowEx|WinAPI_DefWindowProc|WinAPI_DeleteDC|WinAPI_DeleteObject|WinAPI_DestroyIcon|WinAPI_DestroyWindow|WinAPI_DrawEdge|WinAPI_DrawFrameControl|WinAPI_DrawIcon|WinAPI_DrawIconEx|WinAPI_DrawText|WinAPI_EnableWindow|WinAPI_EnumDisplayDevices|WinAPI_EnumWindows|WinAPI_EnumWindowsPopup|WinAPI_EnumWindowsTop|WinAPI_ExpandEnvironmentStrings|WinAPI_ExtractIconEx|WinAPI_FatalAppExit|WinAPI_FillRect|WinAPI_FindExecutable|WinAPI_FindWindow|WinAPI_FlashWindow|WinAPI_FlashWindowEx|WinAPI_FloatToInt|WinAPI_FlushFileBuffers|WinAPI_FormatMessage|WinAPI_FrameRect|WinAPI_FreeLibrary|WinAPI_GetAncestor|WinAPI_GetAsyncKeyState|WinAPI_GetClassName|WinAPI_GetClientHeight|WinAPI_GetClientRect|WinAPI_GetClientWidth|WinAPI_GetCurrentProcess|WinAPI_GetCurrentProcessID|WinAPI_GetCurrentThread|WinAPI_GetCurrentThreadId|WinAPI_GetCursorInfo|WinAPI_GetDC|WinAPI_GetDesktopWindow|WinAPI_GetDeviceCaps|WinAPI_GetDIBits|WinAPI_GetDlgCtrlID|WinAPI_GetDlgItem|WinAPI_GetFileSizeEx|WinAPI_GetFocus|WinAPI_GetForegroundWindow|WinAPI_GetIconInfo|WinAPI_GetLastError|WinAPI_GetLastErrorMessage|WinAPI_GetModuleHandle|WinAPI_GetMousePos|WinAPI_GetMousePosX|WinAPI_GetMousePosY|WinAPI_GetObject|WinAPI_GetOpenFileName|WinAPI_GetOverlappedResult|WinAPI_GetParent|WinAPI_GetProcessAffinityMask|WinAPI_GetSaveFileName|WinAPI_GetStdHandle|WinAPI_GetStockObject|WinAPI_GetSysColor|WinAPI_GetSysColorBrush|WinAPI_GetSystemMetrics|WinAPI_GetTextExtentPoint32|WinAPI_GetWindow|WinAPI_GetWindowDC|WinAPI_GetWindowHeight|WinAPI_GetWindowLong|WinAPI_GetWindowRect|WinAPI_GetWindowText|WinAPI_GetWindowThreadProcessId|WinAPI_GetWindowWidth|WinAPI_GetXYFromPoint|WinAPI_GlobalMemStatus|WinAPI_GUIDFromString|WinAPI_GUIDFromStringEx|WinAPI_HiWord|WinAPI_InProcess|WinAPI_IntToFloat|WinAPI_InvalidateRect|WinAPI_IsClassName|WinAPI_IsWindow|WinAPI_IsWindowVisible|WinAPI_LoadBitmap|WinAPI_LoadImage|WinAPI_LoadLibrary|WinAPI_LoadLibraryEx|WinAPI_LoadShell32Icon|WinAPI_LoadString|WinAPI_LocalFree|WinAPI_LoWord|WinAPI_MakeDWord|WinAPI_MAKELANGID|WinAPI_MAKELCID|WinAPI_MakeLong|WinAPI_MessageBeep|WinAPI_Mouse_Event|WinAPI_MoveWindow|WinAPI_MsgBox|WinAPI_MulDiv|WinAPI_MultiByteToWideChar|WinAPI_MultiByteToWideCharEx|WinAPI_OpenProcess|WinAPI_PointFromRect|WinAPI_PostMessage|WinAPI_PrimaryLangId|WinAPI_PtInRect|WinAPI_ReadFile|WinAPI_ReadProcessMemory|WinAPI_RectIsEmpty|WinAPI_RedrawWindow|WinAPI_RegisterWindowMessage|WinAPI_ReleaseCapture|WinAPI_ReleaseDC|WinAPI_ScreenToClient|WinAPI_SelectObject|WinAPI_SetBkColor|WinAPI_SetCapture|WinAPI_SetCursor|WinAPI_SetDefaultPrinter|WinAPI_SetDIBits|WinAPI_SetEvent|WinAPI_SetFocus|WinAPI_SetFont|WinAPI_SetHandleInformation|WinAPI_SetLastError|WinAPI_SetParent|WinAPI_SetProcessAffinityMask|WinAPI_SetSysColors|WinAPI_SetTextColor|WinAPI_SetWindowLong|WinAPI_SetWindowPos|WinAPI_SetWindowsHookEx|WinAPI_SetWindowText|WinAPI_ShowCursor|WinAPI_ShowError|WinAPI_ShowMsg|WinAPI_ShowWindow|WinAPI_StringFromGUID|WinAPI_SubLangId|WinAPI_SystemParametersInfo|WinAPI_TwipsPerPixelX|WinAPI_TwipsPerPixelY|WinAPI_UnhookWindowsHookEx|WinAPI_UpdateLayeredWindow|WinAPI_UpdateWindow|WinAPI_ValidateClassName|WinAPI_WaitForInputIdle|WinAPI_WaitForMultipleObjects|WinAPI_WaitForSingleObject|WinAPI_WideCharToMultiByte|WinAPI_WindowFromPoint|WinAPI_WriteConsole|WinAPI_WriteFile|WinAPI_WriteProcessMemory|WinNet_AddConnection|WinNet_AddConnection2|WinNet_AddConnection3|WinNet_CancelConnection|WinNet_CancelConnection2|WinNet_CloseEnum|WinNet_ConnectionDialog|WinNet_ConnectionDialog1|WinNet_DisconnectDialog|WinNet_DisconnectDialog1|WinNet_EnumResource|WinNet_GetConnection|WinNet_GetConnectionPerformance|WinNet_GetLastError|WinNet_GetNetworkInformation|WinNet_GetProviderName|WinNet_GetResourceInformation|WinNet_GetResourceParent|WinNet_GetUniversalName|WinNet_GetUser|WinNet_OpenEnum|WinNet_RestoreConnection|WinNet_UseConnection|Word_VersionInfo|WordAttach|WordCreate|WordDocAdd|WordDocAddLink|WordDocAddPicture|WordDocClose|WordDocFindReplace|WordDocGetCollection|WordDocLinkGetCollection|WordDocOpen|WordDocPrint|WordDocPropertyGet|WordDocPropertySet|WordDocSave|WordDocSaveAs|WordErrorHandlerDeRegister|WordErrorHandlerRegister|WordErrorNotify|WordMacroRun|WordPropertyGet|WordPropertySet|WordQuit|' + + 'ce|comments-end|comments-start|cs|include|include-once|NoTrayIcon|RequireAdmin|' + + 'AutoIt3Wrapper_Au3Check_Parameters|AutoIt3Wrapper_Au3Check_Stop_OnWarning|AutoIt3Wrapper_Change2CUI|AutoIt3Wrapper_Compression|AutoIt3Wrapper_cvsWrapper_Parameters|AutoIt3Wrapper_Icon|AutoIt3Wrapper_Outfile|AutoIt3Wrapper_Outfile_Type|AutoIt3Wrapper_Plugin_Funcs|AutoIt3Wrapper_Res_Comment|AutoIt3Wrapper_Res_Description|AutoIt3Wrapper_Res_Field|AutoIt3Wrapper_Res_File_Add|AutoIt3Wrapper_Res_Fileversion|AutoIt3Wrapper_Res_FileVersion_AutoIncrement|AutoIt3Wrapper_Res_Icon_Add|AutoIt3Wrapper_Res_Language|AutoIt3Wrapper_Res_LegalCopyright|AutoIt3Wrapper_res_requestedExecutionLevel|AutoIt3Wrapper_Res_SaveSource|AutoIt3Wrapper_Run_After|AutoIt3Wrapper_Run_Au3check|AutoIt3Wrapper_Run_Before|AutoIt3Wrapper_Run_cvsWrapper|AutoIt3Wrapper_Run_Debug_Mode|AutoIt3Wrapper_Run_Obfuscator|AutoIt3Wrapper_Run_Tidy|AutoIt3Wrapper_Tidy_Stop_OnError|AutoIt3Wrapper_UseAnsi|AutoIt3Wrapper_UseUpx|AutoIt3Wrapper_UseX64|AutoIt3Wrapper_Version|EndRegion|forceref|Obfuscator_Ignore_Funcs|Obfuscator_Ignore_Variables|Obfuscator_Parameters|Region|Tidy_Parameters' + var atKeywords = 'AppDataCommonDir|AppDataDir|AutoItExe|AutoItPID|AutoItUnicode|AutoItVersion|AutoItX64|COM_EventObj|CommonFilesDir|Compiled|ComputerName|ComSpec|CR|CRLF|DesktopCommonDir|DesktopDepth|DesktopDir|DesktopHeight|DesktopRefresh|DesktopWidth|DocumentsCommonDir|error|exitCode|exitMethod|extended|FavoritesCommonDir|FavoritesDir|GUI_CtrlHandle|GUI_CtrlId|GUI_DragFile|GUI_DragId|GUI_DropId|GUI_WinHandle|HomeDrive|HomePath|HomeShare|HotKeyPressed|HOUR|InetGetActive|InetGetBytesRead|IPAddress1|IPAddress2|IPAddress3|IPAddress4|KBLayout|LF|LogonDNSDomain|LogonDomain|LogonServer|MDAY|MIN|MON|MyDocumentsDir|NumParams|OSBuild|OSLang|OSServicePack|OSTYPE|OSVersion|ProcessorArch|ProgramFilesDir|ProgramsCommonDir|ProgramsDir|ScriptDir|ScriptFullPath|ScriptLineNumber|ScriptName|SEC|StartMenuCommonDir|StartMenuDir|StartupCommonDir|StartupDir|SW_DISABLE|SW_ENABLE|SW_HIDE|SW_LOCK|SW_MAXIMIZE|SW_MINIMIZE|SW_RESTORE|SW_SHOW|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWMINNOACTIVE|SW_SHOWNA|SW_SHOWNOACTIVATE|SW_SHOWNORMAL|SW_UNLOCK|SystemDir|TAB|TempDir|TRAY_ID|TrayIconFlashing|TrayIconVisible|UserName|UserProfileDir|WDAY|WindowsDir|WorkingDir|YDAY|YEAR' + + this.$rules = { start: + [ { token: 'comment.line.ahk', regex: '(?:^| );.*$' }, + { token: 'comment.block.ahk', + regex: '/\\*', push: + [ { token: 'comment.block.ahk', regex: '\\*/', next: 'pop' }, + { defaultToken: 'comment.block.ahk' } ] }, + { token: 'doc.comment.ahk', + regex: '#cs', push: + [ { token: 'doc.comment.ahk', regex: '#ce', next: 'pop' }, + { defaultToken: 'doc.comment.ahk' } ] }, + { token: 'keyword.command.ahk', + regex: '(?:\\b|^)(?:allowsamelinecomments|clipboardtimeout|commentflag|errorstdout|escapechar|hotkeyinterval|hotkeymodifiertimeout|hotstring|include|includeagain|installkeybdhook|installmousehook|keyhistory|ltrim|maxhotkeysperinterval|maxmem|maxthreads|maxthreadsbuffer|maxthreadsperhotkey|noenv|notrayicon|persistent|singleinstance|usehook|winactivateforce|autotrim|blockinput|click|clipwait|continue|control|controlclick|controlfocus|controlget|controlgetfocus|controlgetpos|controlgettext|controlmove|controlsend|controlsendraw|controlsettext|coordmode|critical|detecthiddentext|detecthiddenwindows|drive|driveget|drivespacefree|edit|endrepeat|envadd|envdiv|envget|envmult|envset|envsub|envupdate|exit|exitapp|fileappend|filecopy|filecopydir|filecreatedir|filecreateshortcut|filedelete|filegetattrib|filegetshortcut|filegetsize|filegettime|filegetversion|fileinstall|filemove|filemovedir|fileread|filereadline|filerecycle|filerecycleempty|fileremovedir|fileselectfile|fileselectfolder|filesetattrib|filesettime|formattime|getkeystate|gosub|goto|groupactivate|groupadd|groupclose|groupdeactivate|gui|guicontrol|guicontrolget|hideautoitwin|hotkey|ifequal|ifexist|ifgreater|ifgreaterorequal|ifinstring|ifless|iflessorequal|ifmsgbox|ifnotequal|ifnotexist|ifnotinstring|ifwinactive|ifwinexist|ifwinnotactive|ifwinnotexist|imagesearch|inidelete|iniread|iniwrite|input|inputbox|keyhistory|keywait|listhotkeys|listlines|listvars|menu|mouseclick|mouseclickdrag|mousegetpos|mousemove|msgbox|onexit|outputdebug|pause|pixelgetcolor|pixelsearch|postmessage|process|progress|random|regdelete|regread|regwrite|reload|repeat|run|runas|runwait|send|sendevent|sendinput|sendmode|sendplay|sendmessage|sendraw|setbatchlines|setcapslockstate|setcontroldelay|setdefaultmousespeed|setenv|setformat|setkeydelay|setmousedelay|setnumlockstate|setscrolllockstate|setstorecapslockmode|settimer|settitlematchmode|setwindelay|setworkingdir|shutdown|sleep|sort|soundbeep|soundget|soundgetwavevolume|soundplay|soundset|soundsetwavevolume|splashimage|splashtextoff|splashtexton|splitpath|statusbargettext|statusbarwait|stringcasesense|stringgetpos|stringleft|stringlen|stringlower|stringmid|stringreplace|stringright|stringsplit|stringtrimleft|stringtrimright|stringupper|suspend|sysget|thread|tooltip|transform|traytip|urldownloadtofile|while|winactivate|winactivatebottom|winclose|winget|wingetactivestats|wingetactivetitle|wingetclass|wingetpos|wingettext|wingettitle|winhide|winkill|winmaximize|winmenuselectitem|winminimize|winminimizeall|winminimizeallundo|winmove|winrestore|winset|winsettitle|winshow|winwait|winwaitactive|winwaitclose|winwaitnotactive)\\b', + caseInsensitive: true }, + { token: 'keyword.control.ahk', + regex: '(?:\\b|^)(?:if|else|return|loop|break|for|while|global|local|byref)\\b', + caseInsensitive: true }, + { token: 'support.function.ahk', + regex: '(?:\\b|^)(?:abs|acos|asc|asin|atan|ceil|chr|cos|dllcall|exp|fileexist|floor|getkeystate|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist)\\b', + caseInsensitive: true }, + { token: 'variable.predefined.ahk', + regex: '(?:\\b|^)(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\\b', + caseInsensitive: true }, + { token: 'support.constant.ahk', + regex: '(?:\\b|^)(?:shift|lshift|rshift|alt|lalt|ralt|control|lcontrol|rcontrol|ctrl|lctrl|rctrl|lwin|rwin|appskey|altdown|altup|shiftdown|shiftup|ctrldown|ctrlup|lwindown|lwinup|rwindown|rwinup|lbutton|rbutton|mbutton|wheelup|wheelleft|wheelright|wheeldown|xbutton1|xbutton2|joy1|joy2|joy3|joy4|joy5|joy6|joy7|joy8|joy9|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy30|joy31|joy32|joyx|joyy|joyz|joyr|joyu|joyv|joypov|joyname|joybuttons|joyaxes|joyinfo|space|tab|enter|escape|esc|backspace|bs|delete|del|insert|ins|pgup|pgdn|home|end|up|down|left|right|printscreen|ctrlbreak|pause|scrolllock|capslock|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadmult|numpadadd|numpadsub|numpaddiv|numpaddot|numpaddel|numpadins|numpadclear|numpadup|numpaddown|numpadleft|numpadright|numpadhome|numpadend|numpadpgup|numpadpgdn|numpadenter|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|browser_back|browser_forward|browser_refresh|browser_stop|browser_search|browser_favorites|browser_home|volume_mute|volume_down|volume_up|media_next|media_prev|media_stop|media_play_pause|launch_mail|launch_media|launch_app1|launch_app2)\\b', + caseInsensitive: true }, + { token: 'variable.parameter', + regex: '(?:\\b|^)(?:pixel|mouse|screen|relative|rgb|ltrim|rtrim|join|low|belownormal|normal|abovenormal|high|realtime|ahk_id|ahk_pid|ahk_class|ahk_group|between|contains|in|is|integer|float|integerfast|floatfast|number|digit|xdigit|alpha|upper|lower|alnum|time|date|not|or|and|alwaysontop|topmost|top|bottom|transparent|transcolor|redraw|region|id|idlast|processname|minmax|controllist|count|list|capacity|statuscd|eject|lock|unlock|label|filesystem|label|setlabel|serial|type|status|static|seconds|minutes|hours|days|read|parse|logoff|close|error|single|tray|add|rename|check|uncheck|togglecheck|enable|disable|toggleenable|default|nodefault|standard|nostandard|color|delete|deleteall|icon|noicon|tip|click|show|mainwindow|nomainwindow|useerrorlevel|text|picture|pic|groupbox|button|checkbox|radio|dropdownlist|ddl|combobox|listbox|listview|datetime|monthcal|updown|slider|tab|tab2|statusbar|treeview|iconsmall|tile|report|sortdesc|nosort|nosorthdr|grid|hdr|autosize|range|xm|ym|ys|xs|xp|yp|font|resize|owner|submit|nohide|minimize|maximize|restore|noactivate|na|cancel|destroy|center|margin|maxsize|minsize|owndialogs|guiescape|guiclose|guisize|guicontextmenu|guidropfiles|tabstop|section|altsubmit|wrap|hscroll|vscroll|border|top|bottom|buttons|expand|first|imagelist|lines|wantctrla|wantf2|vis|visfirst|number|uppercase|lowercase|limit|password|multi|wantreturn|group|background|bold|italic|strike|underline|norm|backgroundtrans|theme|caption|delimiter|minimizebox|maximizebox|sysmenu|toolwindow|flash|style|exstyle|check3|checked|checkedgray|readonly|password|hidden|left|right|center|notab|section|move|focus|hide|choose|choosestring|text|pos|enabled|disabled|visible|lastfound|lastfoundexist|alttab|shiftalttab|alttabmenu|alttabandmenu|alttabmenudismiss|notimers|interrupt|priority|waitclose|blind|raw|unicode|deref|pow|bitnot|bitand|bitor|bitxor|bitshiftleft|bitshiftright|yes|no|ok|cancel|abort|retry|ignore|tryagain|on|off|all|hkey_local_machine|hkey_users|hkey_current_user|hkey_classes_root|hkey_current_config|hklm|hku|hkcu|hkcr|hkcc|reg_sz|reg_expand_sz|reg_multi_sz|reg_dword|reg_qword|reg_binary|reg_link|reg_resource_list|reg_full_resource_descriptor|reg_resource_requirements_list|reg_dword_big_endian)\\b', + caseInsensitive: true }, + { keywordMap: {"constant.language": autoItKeywords}, regex: '\\w+\\b'}, + { keywordMap: {"variable.function": atKeywords}, regex: '@\\w+\\b'}, + { token : "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, + { token: 'keyword.operator.ahk', + regex: '=|==|<>|:=|<|>|\\*|\\/|\\+|:|\\?|\\-' }, + { token: 'punctuation.ahk', + regex: '#|`|::|,|\\{|\\}|\\(|\\)|\\%' }, + { token: + [ 'punctuation.quote.double', + 'string.quoted.ahk', + 'punctuation.quote.double' ], + regex: '(")((?:[^"]|"")*)(")' }, + { token: [ 'label.ahk', 'punctuation.definition.label.ahk' ], + regex: '^([^: ]+)(:)(?!:)' } ] } + + this.normalizeRules(); +}; + +AutoHotKeyHighlightRules.metaData = { name: 'AutoHotKey', + scopeName: 'source.ahk', + fileTypes: [ 'ahk' ], + foldingStartMarker: '^\\s*/\\*|^(?![^{]*?;|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|;|/\\*(?!.*?\\*/.*\\S))', + foldingStopMarker: '^\\s*\\*/|^\\s*\\}' } + + +oop.inherits(AutoHotKeyHighlightRules, TextHighlightRules); + +exports.AutoHotKeyHighlightRules = AutoHotKeyHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/autohotkey",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/autohotkey_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var AutoHotKeyHighlightRules = require("./autohotkey_highlight_rules").AutoHotKeyHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = AutoHotKeyHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = ";"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/autohotkey"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-batchfile.js b/htdocs/includes/ace/mode-batchfile.js new file mode 100644 index 00000000000..3f31ce121fc --- /dev/null +++ b/htdocs/includes/ace/mode-batchfile.js @@ -0,0 +1,223 @@ +ace.define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var BatchFileHighlightRules = function() { + + this.$rules = { start: + [ { token: 'keyword.command.dosbatch', + regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b', + caseInsensitive: true }, + { token: 'keyword.control.statement.dosbatch', + regex: '\\b(?:goto|call|exit)\\b', + caseInsensitive: true }, + { token: 'keyword.control.conditional.if.dosbatch', + regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b', + caseInsensitive: true }, + { token: 'keyword.control.conditional.dosbatch', + regex: '\\b(?:if|else)\\b', + caseInsensitive: true }, + { token: 'keyword.control.repeat.dosbatch', + regex: '\\bfor\\b', + caseInsensitive: true }, + { token: 'keyword.operator.dosbatch', + regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' }, + { token: ['doc.comment', 'comment'], + regex: '(?:^|\\b)(rem)($|\\s.*$)', + caseInsensitive: true }, + { token: 'comment.line.colons.dosbatch', + regex: '::.*$' }, + { include: 'variable' }, + { token: 'punctuation.definition.string.begin.shell', + regex: '"', + push: [ + { token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' }, + { include: 'variable' }, + { defaultToken: 'string.quoted.double.dosbatch' } ] }, + { token: 'keyword.operator.pipe.dosbatch', regex: '[|]' }, + { token: 'keyword.operator.redirect.shell', + regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' } ], + variable: [ + { token: 'constant.numeric', regex: '%%\\w+|%[*\\d]|%\\w+%'}, + { token: 'constant.numeric', regex: '%~\\d+'}, + { token: ['markup.list', 'constant.other', 'markup.list'], + regex: '(%)(\\w+)(%?)' }]} + + this.normalizeRules(); +}; + +BatchFileHighlightRules.metaData = { name: 'Batch File', + scopeName: 'source.dosbatch', + fileTypes: [ 'bat' ] } + + +oop.inherits(BatchFileHighlightRules, TextHighlightRules); + +exports.BatchFileHighlightRules = BatchFileHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = BatchFileHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "::"; + this.blockComment = ""; + this.$id = "ace/mode/batchfile"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-bro.js b/htdocs/includes/ace/mode-bro.js new file mode 100644 index 00000000000..dd259ebee88 --- /dev/null +++ b/htdocs/includes/ace/mode-bro.js @@ -0,0 +1,327 @@ +ace.define("ace/mode/bro_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var BroHighlightRules = function() { + + this.$rules = { + start: [{ + token: "punctuation.definition.comment.bro", + regex: /#/, + push: [{ + token: "comment.line.number-sign.bro", + regex: /$/, + next: "pop" + }, { + defaultToken: "comment.line.number-sign.bro" + }] + }, { + token: "keyword.control.bro", + regex: /\b(?:break|case|continue|else|for|if|return|switch|next|when|timeout|schedule)\b/ + }, { + token: [ + "meta.function.bro", + "meta.function.bro", + "storage.type.bro", + "meta.function.bro", + "entity.name.function.bro", + "meta.function.bro" + ], + regex: /^(\s*)(?:function|hook|event)(\s*)(.*)(\s*\()(.*)(\).*$)/ + }, { + token: "storage.type.bro", + regex: /\b(?:bool|enum|double|int|count|port|addr|subnet|any|file|interval|time|string|table|vector|set|record|pattern|hook)\b/ + }, { + token: "storage.modifier.bro", + regex: /\b(?:global|const|redef|local|&(?:optional|rotate_interval|rotate_size|add_func|del_func|expire_func|expire_create|expire_read|expire_write|persistent|synchronized|encrypt|mergeable|priority|group|type_column|log|error_handler))\b/ + }, { + token: "keyword.operator.bro", + regex: /\s*(?:\||&&|(?:>|<|!)=?|==)\s*|\b!?in\b/ + }, { + token: "constant.language.bro", + regex: /\b(?:T|F)\b/ + }, { + token: "constant.numeric.bro", + regex: /\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\.?[0-9]*|\.[0-9]+)(?:(?:e|E)(?:\+|-)?[0-9]+)?)(?:\/(?:tcp|udp|icmp)|\s*(?:u?sec|min|hr|day)s?)?\b/ + }, { + token: "punctuation.definition.string.begin.bro", + regex: /"/, + push: [{ + token: "punctuation.definition.string.end.bro", + regex: /"/, + next: "pop" + }, { + include: "#string_escaped_char" + }, { + include: "#string_placeholder" + }, { + defaultToken: "string.quoted.double.bro" + }] + }, { + token: "punctuation.definition.string.begin.bro", + regex: /\//, + push: [{ + token: "punctuation.definition.string.end.bro", + regex: /\//, + next: "pop" + }, { + include: "#string_escaped_char" + }, { + include: "#string_placeholder" + }, { + defaultToken: "string.quoted.regex.bro" + }] + }, { + token: [ + "meta.preprocessor.bro.load", + "keyword.other.special-method.bro" + ], + regex: /^(\s*)(\@load(?:-sigs)?)\b/, + push: [{ + token: [], + regex: /(?=\#)|$/, + next: "pop" + }, { + defaultToken: "meta.preprocessor.bro.load" + }] + }, { + token: [ + "meta.preprocessor.bro.if", + "keyword.other.special-method.bro", + "meta.preprocessor.bro.if" + ], + regex: /^(\s*)(\@endif|\@if(?:n?def)?)(.*$)/, + push: [{ + token: [], + regex: /$/, + next: "pop" + }, { + defaultToken: "meta.preprocessor.bro.if" + }] + }], + "#disabled": [{ + token: "text", + regex: /^\s*\@if(?:n?def)?\b.*$/, + push: [{ + token: "text", + regex: /^\s*\@endif\b.*$/, + next: "pop" + }, { + include: "#disabled" + }, { + include: "#pragma-mark" + }], + comment: "eat nested preprocessor ifdefs" + }], + "#preprocessor-rule-other": [{ + token: [ + "text", + "meta.preprocessor.bro", + "meta.preprocessor.bro", + "text" + ], + regex: /^(\s*)(@if)((?:n?def)?)\b(.*?)(?:(?=)|$)/, + push: [{ + token: ["text", "meta.preprocessor.bro", "text"], + regex: /^(\s*)(@endif)\b(.*$)/, + next: "pop" + }, { + include: "$base" + }] + }], + "#string_escaped_char": [{ + token: "constant.character.escape.bro", + regex: /\\(?:\\|[abefnprtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-fA-F0-9]{,2})/ + }, { + token: "invalid.illegal.unknown-escape.bro", + regex: /\\./ + }], + "#string_placeholder": [{ + token: "constant.other.placeholder.bro", + regex: /%(?:\d+\$)?[#0\- +']*[,;:_]?(?:-?\d+|\*(?:-?\d+\$)?)?(?:\.(?:-?\d+|\*(?:-?\d+\$)?)?)?(?:hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?[diouxXDOUeEfFgGaACcSspn%]/ + }, { + token: "invalid.illegal.placeholder.bro", + regex: /%/ + }] + } + + this.normalizeRules(); +}; + +BroHighlightRules.metaData = { + fileTypes: ["bro"], + foldingStartMarker: "^(\\@if(n?def)?)", + foldingStopMarker: "^\\@endif", + keyEquivalent: "@B", + name: "Bro", + scopeName: "source.bro" +} + + +oop.inherits(BroHighlightRules, TextHighlightRules); + +exports.BroHighlightRules = BroHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/bro",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/bro_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var BroHighlightRules = require("./bro_highlight_rules").BroHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = BroHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/bro" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-c9search.js b/htdocs/includes/ace/mode-c9search.js new file mode 100644 index 00000000000..aad3dc1963b --- /dev/null +++ b/htdocs/includes/ace/mode-c9search.js @@ -0,0 +1,287 @@ +ace.define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +function safeCreateRegexp(source, flag) { + try { + return new RegExp(source, flag); + } catch(e) {} +} + +var C9SearchHighlightRules = function() { + this.$rules = { + "start" : [ + { + tokenNames : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"], + regex : /(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/, + onMatch : function(val, state, stack) { + var values = this.splitRegex.exec(val); + var types = this.tokenNames; + var tokens = [{ + type: types[0], + value: values[1] + }, { + type: types[1], + value: values[2] + }]; + + if (values[3]) { + if (values[3] == " ") + tokens[1] = { type: types[1], value: values[2] + " " }; + else + tokens.push({ type: types[1], value: values[3] }); + } + var regex = stack[1]; + var str = values[4]; + + var m; + var last = 0; + if (regex && regex.exec) { + regex.lastIndex = 0; + while (m = regex.exec(str)) { + var skipped = str.substring(last, m.index); + last = regex.lastIndex; + if (skipped) + tokens.push({type: types[2], value: skipped}); + if (m[0]) + tokens.push({type: types[3], value: m[0]}); + else if (!skipped) + break; + } + } + if (last < str.length) + tokens.push({type: types[2], value: str.substr(last)}); + return tokens; + } + }, + { + regex : "^Searching for [^\\r\\n]*$", + onMatch: function(val, state, stack) { + var parts = val.split("\x01"); + if (parts.length < 3) + return "text"; + + var options, search, replace; + + var i = 0; + var tokens = [{ + value: parts[i++] + "'", + type: "text" + }, { + value: search = parts[i++], + type: "text" // "c9searchresults.keyword" + }, { + value: "'" + parts[i++], + type: "text" + }]; + if (parts[2] !== " in") { + replace = parts[i]; + tokens.push({ + value: "'" + parts[i++] + "'", + type: "text" + }, { + value: parts[i++], + type: "text" + }); + } + tokens.push({ + value: " " + parts[i++] + " ", + type: "text" + }); + if (parts[i+1]) { + options = parts[i+1]; + tokens.push({ + value: "(" + parts[i+1] + ")", + type: "text" + }); + i += 1; + } else { + i -= 1; + } + while (i++ < parts.length) { + parts[i] && tokens.push({ + value: parts[i], + type: "text" + }); + } + + if (search) { + if (!/regex/.test(options)) + search = lang.escapeRegExp(search); + if (/whole/.test(options)) + search = "\\b" + search + "\\b"; + } + + var regex = search && safeCreateRegexp( + "(" + search + ")", + / sensitive/.test(options) ? "g" : "ig" + ); + if (regex) { + stack[0] = state; + stack[1] = regex; + } + + return tokens; + } + }, + { + regex : "^(?=Found \\d+ matches)", + token : "text", + next : "numbers" + }, + { + token : "string", // single line + regex : "^\\S:?[^:]+", + next : "numbers" + } + ], + numbers:[{ + regex : "\\d+", + token : "constant.numeric" + }, { + regex : "$", + token : "text", + next : "start" + }] + }; + this.normalizeRules(); +}; + +oop.inherits(C9SearchHighlightRules, TextHighlightRules); + +exports.C9SearchHighlightRules = C9SearchHighlightRules; + +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /^(\S.*:|Searching for.*)$/; + this.foldingStopMarker = /^(\s+|Found.*)$/; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var lines = session.doc.getAllLines(row); + var line = lines[row]; + var level1 = /^(Found.*|Searching for.*)$/; + var level2 = /^(\S.*:|\s*)$/; + var re = level1.test(line) ? level1 : level2; + + var startRow = row; + var endRow = row; + + if (this.foldingStartMarker.test(line)) { + for (var i = row + 1, l = session.getLength(); i < l; i++) { + if (re.test(lines[i])) + break; + } + endRow = i; + } + else if (this.foldingStopMarker.test(line)) { + for (var i = row - 1; i >= 0; i--) { + line = lines[i]; + if (re.test(line)) + break; + } + startRow = i; + } + if (startRow != endRow) { + var col = line.length; + if (re === level1) + col = line.search(/\(Found[^)]+\)$|$/); + return new Range(startRow, col, endRow, 0); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var C9StyleFoldMode = require("./folding/c9search").FoldMode; + +var Mode = function() { + this.HighlightRules = C9SearchHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new C9StyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/c9search"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-c_cpp.js b/htdocs/includes/ace/mode-c_cpp.js new file mode 100644 index 00000000000..ea6d2229329 --- /dev/null +++ b/htdocs/includes/ace/mode-c_cpp.js @@ -0,0 +1,487 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" + +var c_cppHighlightRules = function() { + + var keywordControls = ( + "break|case|continue|default|do|else|for|goto|if|_Pragma|" + + "return|switch|while|catch|operator|try|throw|using" + ); + + var storageType = ( + "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + + "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + + "class|wchar_t|template|char16_t|char32_t" + ); + + var storageModifiers = ( + "const|extern|register|restrict|static|volatile|inline|private|" + + "protected|public|friend|explicit|virtual|export|mutable|typename|" + + "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" + ); + + var keywordOperators = ( + "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + + "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" + ); + + var builtinConstants = ( + "NULL|true|false|TRUE|FALSE|nullptr" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword.control" : keywordControls, + "storage.type" : storageType, + "storage.modifier" : storageModifiers, + "keyword.operator" : keywordOperators, + "variable.language": "this", + "constant.language": builtinConstants + }, "identifier"); + + var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "//$", + next : "start" + }, { + token : "comment", + regex : "//", + next : "singleLineComment" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // character + regex : "'(?:" + escapeRe + "|.)?'" + }, { + token : "string.start", + regex : '"', + stateName: "qqstring", + next: [ + { token: "string", regex: /\\\s*$/, next: "qqstring" }, + { token: "constant.language.escape", regex: escapeRe }, + { token: "constant.language.escape", regex: /%[^'"\\]/ }, + { token: "string.end", regex: '"|$', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "string.start", + regex : 'R"\\(', + stateName: "rawString", + next: [ + { token: "string.end", regex: '\\)"', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "keyword", // pre-compiler directives + regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", + next : "directive" + }, { + token : "keyword", // special case pre-compiler directive + regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" + }, { + token : "support.function.C99.c", + regex : cFunctions + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" + }, { + token : "keyword.operator", + regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/ + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "singleLineComment" : [ + { + token : "comment", + regex : /\\$/, + next : "singleLineComment" + }, { + token : "comment", + regex : /$/, + next : "start" + }, { + defaultToken: "comment" + } + ], + "directive" : [ + { + token : "constant.other.multiline", + regex : /\\/ + }, + { + token : "constant.other.multiline", + regex : /.*\\/ + }, + { + token : "constant.other", + regex : "\\s*<.+?>", + next : "start" + }, + { + token : "constant.other", // single line + regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', + next : "start" + }, + { + token : "constant.other", // single line + regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", + next : "start" + }, + { + token : "constant.other", + regex : /[^\\\/]+/, + next : "start" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(c_cppHighlightRules, TextHighlightRules); + +exports.c_cppHighlightRules = c_cppHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = c_cppHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/c_cpp"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-cirru.js b/htdocs/includes/ace/mode-cirru.js new file mode 100644 index 00000000000..9d3bab85983 --- /dev/null +++ b/htdocs/includes/ace/mode-cirru.js @@ -0,0 +1,203 @@ +ace.define("ace/mode/cirru_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var CirruHighlightRules = function() { + this.$rules = { + start: [{ + token: 'constant.numeric', + regex: /[\d\.]+/ + }, { + token: 'comment.line.double-dash', + regex: /--/, + next: 'comment' + }, { + token: 'storage.modifier', + regex: /\(/ + }, { + token: 'storage.modifier', + regex: /,/, + next: 'line' + }, { + token: 'support.function', + regex: /[^\(\)"\s]+/, + next: 'line' + }, { + token: 'string.quoted.double', + regex: /"/, + next: 'string' + }, { + token: 'storage.modifier', + regex: /\)/ + }], + comment: [{ + token: 'comment.line.double-dash', + regex: / +[^\n]+/, + next: 'start' + }], + string: [{ + token: 'string.quoted.double', + regex: /"/, + next: 'line' + }, { + token: 'constant.character.escape', + regex: /\\/, + next: 'escape' + }, { + token: 'string.quoted.double', + regex: /[^\\"]+/ + }], + escape: [{ + token: 'constant.character.escape', + regex: /./, + next: 'string' + }], + line: [{ + token: 'constant.numeric', + regex: /[\d\.]+/ + }, { + token: 'markup.raw', + regex: /^\s*/, + next: 'start' + }, { + token: 'storage.modifier', + regex: /\$/, + next: 'start' + }, { + token: 'variable.parameter', + regex: /[^\(\)"\s]+/ + }, { + token: 'storage.modifier', + regex: /\(/, + next: 'start' + }, { + token: 'storage.modifier', + regex: /\)/ + }, { + token: 'markup.raw', + regex: /^ */, + next: 'start' + }, { + token: 'string.quoted.double', + regex: /"/, + next: 'string' + }] + } + +}; + +oop.inherits(CirruHighlightRules, TextHighlightRules); + +exports.CirruHighlightRules = CirruHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/cirru",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cirru_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CirruHighlightRules = require("./cirru_highlight_rules").CirruHighlightRules; +var CoffeeFoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = CirruHighlightRules; + this.foldingRules = new CoffeeFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.$id = "ace/mode/cirru"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-clojure.js b/htdocs/includes/ace/mode-clojure.js new file mode 100644 index 00000000000..c8f7a0d5036 --- /dev/null +++ b/htdocs/includes/ace/mode-clojure.js @@ -0,0 +1,307 @@ +ace.define("ace/mode/clojure_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + + + +var ClojureHighlightRules = function() { + + var builtinFunctions = ( + '* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' + + '*command-line-args* *compile-files* *compile-path* *e *err* *file* ' + + '*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' + + '*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' + + '*read-eval* *source-path* *use-context-classloader* ' + + '*warn-on-reflection* + - -> ->> .. / < <= = ' + + '== > > >= >= accessor aclone ' + + 'add-classpath add-watch agent 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 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* butlast byte byte-array bytes 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 decimal? declare definline ' + + 'defmacro defmethod defmulti defn defn- defonce defstruct delay delay? ' + + 'deliver deref derive descendants destructure disj disj! dissoc dissoc! ' + + 'distinct distinct? doall doc dorun doseq dosync dotimes doto double ' + + 'double-array doubles drop drop-last drop-while empty empty? ensure ' + + 'enumeration-seq eval even? every? false? ffirst file-seq filter find ' + + 'find-doc find-ns find-var first float float-array float? floats flush ' + + 'fn fn? fnext for force format 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 ' + + 'hash hash-map hash-set identical? identity if-let if-not ifn? import ' + + 'in-ns inc init-proxy instance? int int-array integer? interleave intern ' + + 'interpose into into-array ints io! isa? iterate iterator-seq juxt 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? mapcat max max-key memfn memoize merge ' + + 'merge-with meta method-sig methods min min-key mod name namespace 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 num number? odd? ' + + 'or parents partial partition pcalls peek persistent! pmap pop pop! ' + + 'pop-thread-bindings pos? pr pr-str prefer-method prefers ' + + 'primitives-classnames print print-ctor print-doc print-dup print-method ' + + 'print-namespace-doc print-simple print-special-doc 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 range ratio? rational? rationalize re-find re-groups ' + + 're-matcher re-matches re-pattern re-seq read read-line read-string ' + + 'reduce ref ref-history-count ref-max-history ref-min-history ref-set ' + + 'refer refer-clojure release-pending-sends rem remove remove-method ' + + 'remove-ns remove-watch repeat repeatedly replace replicate require ' + + 'reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq ' + + 'rsubseq second select-keys send send-off seq seq? seque sequence ' + + 'sequential? set set-validator! set? short short-array shorts ' + + 'shutdown-agents slurp some sort sort-by sorted-map sorted-map-by ' + + 'sorted-set sorted-set-by sorted? special-form-anchor special-symbol? ' + + 'split-at split-with str stream? string? struct struct-map subs subseq ' + + 'subvec supers swap! symbol symbol? sync syntax-symbol-anchor take ' + + 'take-last take-nth take-while test the-ns time to-array to-array-2d ' + + 'trampoline transient tree-seq true? type unchecked-add unchecked-dec ' + + 'unchecked-divide unchecked-inc unchecked-multiply unchecked-negate ' + + 'unchecked-remainder unchecked-subtract underive unquote ' + + 'unquote-splicing update-in update-proxy use val vals var-get var-set ' + + 'var? vary-meta vec vector 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 xml-seq ' + + 'zero? zipmap' + ); + + var keywords = ('throw try var ' + + 'def do fn if let loop monitor-enter monitor-exit new quote recur set!' + ); + + var buildinConstants = ("true false nil"); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": buildinConstants, + "support.function": builtinFunctions + }, "identifier", false, " "); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : ";.*$" + }, { + token : "keyword", //parens + regex : "[\\(|\\)]" + }, { + token : "keyword", //lists + regex : "[\\'\\(]" + }, { + token : "keyword", //vectors + regex : "[\\[|\\]]" + }, { + token : "keyword", //sets and maps + regex : "[\\{|\\}|\\#\\{|\\#\\}]" + }, { + token : "keyword", // ampersands + regex : '[\\&]' + }, { + token : "keyword", // metadata + regex : '[\\#\\^\\{]' + }, { + token : "keyword", // anonymous fn syntactic sugar + regex : '[\\%]' + }, { + token : "keyword", // deref reader macro + regex : '[@]' + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language", + regex : '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]' + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b" + }, { + token : "string", // single line + regex : '"', + next: "string" + }, { + token : "constant", // symbol + regex : /:[^()\[\]{}'"\^%`,;\s]+/ + }, { + token : "string.regexp", //Regular Expressions + regex : '/#"(?:\\.|(?:\\")|[^""\n])*"/g' + } + + ], + "string" : [ + { + token : "constant.language.escape", + regex : "\\\\.|\\\\$" + }, { + token : "string", + regex : '[^"\\\\]+' + }, { + token : "string", + regex : '"', + next : "start" + } + ] + }; +}; + +oop.inherits(ClojureHighlightRules, TextHighlightRules); + +exports.ClojureHighlightRules = ClojureHighlightRules; +}); + +ace.define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingParensOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\)/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\))/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + var match = line.match(/^(\s+)/); + if (match) { + return match[1]; + } + + return ""; + }; + +}).call(MatchingParensOutdent.prototype); + +exports.MatchingParensOutdent = MatchingParensOutdent; +}); + +ace.define("ace/mode/clojure",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/clojure_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ClojureHighlightRules = require("./clojure_highlight_rules").ClojureHighlightRules; +var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent; + +var Mode = function() { + this.HighlightRules = ClojureHighlightRules; + this.$outdent = new MatchingParensOutdent(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = ";"; + this.minorIndentFunctions = ["defn", "defn-", "defmacro", "def", "deftest", "testing"]; + + this.$toIndent = function(str) { + return str.split('').map(function(ch) { + if (/\s/.exec(ch)) { + return ch; + } else { + return ' '; + } + }).join(''); + }; + + this.$calculateIndent = function(line, tab) { + var baseIndent = this.$getIndent(line); + var delta = 0; + var isParen, ch; + for (var i = line.length - 1; i >= 0; i--) { + ch = line[i]; + if (ch === '(') { + delta--; + isParen = true; + } else if (ch === '(' || ch === '[' || ch === '{') { + delta--; + isParen = false; + } else if (ch === ')' || ch === ']' || ch === '}') { + delta++; + } + if (delta < 0) { + break; + } + } + if (delta < 0 && isParen) { + i += 1; + var iBefore = i; + var fn = ''; + while (true) { + ch = line[i]; + if (ch === ' ' || ch === '\t') { + if(this.minorIndentFunctions.indexOf(fn) !== -1) { + return this.$toIndent(line.substring(0, iBefore - 1) + tab); + } else { + return this.$toIndent(line.substring(0, i + 1)); + } + } else if (ch === undefined) { + return this.$toIndent(line.substring(0, iBefore - 1) + tab); + } + fn += line[i]; + i++; + } + } else if(delta < 0 && !isParen) { + return this.$toIndent(line.substring(0, i+1)); + } else if(delta > 0) { + baseIndent = baseIndent.substring(0, baseIndent.length - tab.length); + return baseIndent; + } else { + return baseIndent; + } + }; + + this.getNextLineIndent = function(state, line, tab) { + return this.$calculateIndent(line, tab); + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/clojure"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-cobol.js b/htdocs/includes/ace/mode-cobol.js new file mode 100644 index 00000000000..89367e00563 --- /dev/null +++ b/htdocs/includes/ace/mode-cobol.js @@ -0,0 +1,94 @@ +ace.define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var CobolHighlightRules = function() { +var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" + +"AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" + +"ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" + +"TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" + +"UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" + +"PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" + +"CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" + +"COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" + +"RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" + +"DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" + +"ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" + +"EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT"; + + var builtinConstants = ( + "true|false|null" + ); + + var builtinFunctions = ( + "count|min|max|avg|sum|rank|now|coalesce|main" + ); + + var keywordMapper = this.createKeywordMapper({ + "support.function": builtinFunctions, + "keyword": keywords, + "constant.language": builtinConstants + }, "identifier", true); + + this.$rules = { + "start" : [ { + token : "comment", + regex : "\\*.*$" + }, { + token : "string", // " string + regex : '".*?"' + }, { + token : "string", // ' string + regex : "'.*?'" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\(]" + }, { + token : "paren.rparen", + regex : "[\\)]" + }, { + token : "text", + regex : "\\s+" + } ] + }; +}; + +oop.inherits(CobolHighlightRules, TextHighlightRules); + +exports.CobolHighlightRules = CobolHighlightRules; +}); + +ace.define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cobol_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules; + +var Mode = function() { + this.HighlightRules = CobolHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "*"; + + this.$id = "ace/mode/cobol"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-coffee.js b/htdocs/includes/ace/mode-coffee.js new file mode 100644 index 00000000000..5ba85894f10 --- /dev/null +++ b/htdocs/includes/ace/mode-coffee.js @@ -0,0 +1,392 @@ +ace.define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + + var oop = require("../lib/oop"); + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + + oop.inherits(CoffeeHighlightRules, TextHighlightRules); + + function CoffeeHighlightRules() { + var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; + + var keywords = ( + "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + + "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + + "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + + "or|on|unless|until|and|yes" + ); + + var langConstant = ( + "true|false|null|undefined|NaN|Infinity" + ); + + var illegal = ( + "case|const|default|function|var|void|with|enum|export|implements|" + + "interface|let|package|private|protected|public|static|yield" + ); + + var supportClass = ( + "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + + "SyntaxError|TypeError|URIError|" + + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" + ); + + var supportFunction = ( + "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + + "encodeURIComponent|decodeURI|decodeURIComponent|String|" + ); + + var variableLanguage = ( + "window|arguments|prototype|document" + ); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": langConstant, + "invalid.illegal": illegal, + "language.support.class": supportClass, + "language.support.function": supportFunction, + "variable.language": variableLanguage + }, "identifier"); + + var functionRule = { + token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], + regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()"'\/])*?)(\))(\s*))?([\-=]>)/.source + }; + + var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; + + this.$rules = { + start : [ + { + token : "constant.numeric", + regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" + }, { + stateName: "qdoc", + token : "string", regex : "'''", next : [ + {token : "string", regex : "'''", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + stateName: "qqdoc", + token : "string", + regex : '"""', + next : [ + {token : "string", regex : '"""', next : "start"}, + {token : "paren.string", regex : '#{', push : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + stateName: "qstring", + token : "string", regex : "'", next : [ + {token : "string", regex : "'", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + stateName: "qqstring", + token : "string.start", regex : '"', next : [ + {token : "string.end", regex : '"', next : "start"}, + {token : "paren.string", regex : '#{', push : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + stateName: "js", + token : "string", regex : "`", next : [ + {token : "string", regex : "`", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + return "paren"; + } + if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift() || ""; + if (this.next.indexOf("string") != -1) + return "paren.string"; + } + return "paren"; + } + }, { + token : "string.regex", + regex : "///", + next : "heregex" + }, { + token : "string.regex", + regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ + }, { + token : "comment", + regex : "###(?!#)", + next : "comment" + }, { + token : "comment", + regex : "#.*" + }, { + token : ["punctuation.operator", "text", "identifier"], + regex : "(\\.)(\\s*)(" + illegal + ")" + }, { + token : "punctuation.operator", + regex : "\\.{1,3}" + }, { + token : ["keyword", "text", "language.support.class", + "text", "keyword", "text", "language.support.class"], + regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" + }, { + token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), + regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex + }, + functionRule, + { + token : "variable", + regex : "@(?:" + identifier + ")?" + }, { + token: keywordMapper, + regex : identifier + }, { + token : "punctuation.operator", + regex : "\\,|\\." + }, { + token : "storage.type", + regex : "[\\-=]>" + }, { + token : "keyword.operator", + regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" + }, { + token : "paren.lparen", + regex : "[({[]" + }, { + token : "paren.rparen", + regex : "[\\]})]" + }, { + token : "text", + regex : "\\s+" + }], + + + heregex : [{ + token : "string.regex", + regex : '.*?///[imgy]{0,4}', + next : "start" + }, { + token : "comment.regex", + regex : "\\s+(?:#.*)?" + }, { + token : "string.regex", + regex : "\\S+" + }], + + comment : [{ + token : "comment", + regex : '###', + next : "start" + }, { + defaultToken : "comment" + }] + }; + this.normalizeRules(); + } + + exports.CoffeeHighlightRules = CoffeeHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/coffee",["require","exports","module","ace/mode/coffee_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/worker/worker_client","ace/lib/oop"], function(require, exports, module) { +"use strict"; + +var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules; +var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var FoldMode = require("./folding/coffee").FoldMode; +var Range = require("../range").Range; +var TextMode = require("./text").Mode; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var oop = require("../lib/oop"); + +function Mode() { + this.HighlightRules = Rules; + this.$outdent = new Outdent(); + this.foldingRules = new FoldMode(); +} + +oop.inherits(Mode, TextMode); + +(function() { + var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/; + + this.lineCommentStart = "#"; + this.blockComment = {start: "###", end: "###"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + + if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && + state === 'start' && indenter.test(line)) + indent += tab; + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/coffee"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-coldfusion.js b/htdocs/includes/ace/mode-coldfusion.js new file mode 100644 index 00000000000..edbdb5b49c6 --- /dev/null +++ b/htdocs/includes/ace/mode-coldfusion.js @@ -0,0 +1,2567 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/coldfusion_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + +var ColdfusionHighlightRules = function() { + HtmlHighlightRules.call(this); + this.$rules.tag[2].token = function (start, tag) { + var group = tag.slice(0,2) == "cf" ? "keyword" : "meta.tag"; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + group + ".tag-name.xml"]; + } + + var jsAndCss = Object.keys(this.$rules).filter(function(x) { + return /^(js|css)-/.test(x); + }); + this.embedRules({ + cfmlComment: [ + { regex: "", token: "comment.end", next: "pop"}, + { defaultToken: "comment"} + ] + }, "", [ + { regex: "", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/curly_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + + +var CurlyHighlightRules = function() { + HtmlHighlightRules.call(this); + + this.$rules["start"].unshift({ + token: "variable", + regex: "{{", + push: "curly-start" + }); + + this.$rules["curly-start"] = [{ + token: "variable", + regex: "}}", + next: "pop" + }]; + + this.normalizeRules(); +}; + +oop.inherits(CurlyHighlightRules, HtmlHighlightRules); + +exports.CurlyHighlightRules = CurlyHighlightRules; + +}); + +ace.define("ace/mode/curly",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/matching_brace_outdent","ace/mode/folding/html","ace/mode/curly_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var HtmlFoldMode = require("./folding/html").FoldMode; +var CurlyHighlightRules = require("./curly_highlight_rules").CurlyHighlightRules; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = CurlyHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new HtmlFoldMode(); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + this.$id = "ace/mode/curly"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-d.js b/htdocs/includes/ace/mode-d.js new file mode 100644 index 00000000000..672411a0ccb --- /dev/null +++ b/htdocs/includes/ace/mode-d.js @@ -0,0 +1,513 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/d_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DHighlightRules = function() { + + var keywords = ( + "this|super|import|module|body|mixin|__traits|invariant|alias|asm|delete|"+ + "typeof|typeid|sizeof|cast|new|in|is|typedef|__vector|__parameters" + ); + + var keywordControls = ( + "break|case|continue|default|do|else|for|foreach|foreach_reverse|goto|if|" + + "return|switch|while|catch|try|throw|finally|version|assert|unittest|with" + ); + + var types = ( + "auto|bool|char|dchar|wchar|byte|ubyte|float|double|real|" + + "cfloat|creal|cdouble|cent|ifloat|ireal|idouble|" + + "int|long|short|void|uint|ulong|ushort|ucent|" + + "function|delegate|string|wstring|dstring|size_t|ptrdiff_t|hash_t|Object" + ); + + var modifiers = ( + "abstract|align|debug|deprecated|export|extern|const|final|in|inout|out|" + + "ref|immutable|lazy|nothrow|override|package|pragma|private|protected|" + + "public|pure|scope|shared|__gshared|synchronized|static|volatile" + ); + + var storages = ( + "class|struct|union|template|interface|enum|macro" + ); + + var stringEscapesSeq = { + token: "constant.language.escape", + regex: "\\\\(?:(?:x[0-9A-F]{2})|(?:[0-7]{1,3})|(?:['\"\\?0abfnrtv\\\\])|" + + "(?:u[0-9a-fA-F]{4})|(?:U[0-9a-fA-F]{8}))" + }; + + var builtinConstants = ( + "null|true|false|"+ + "__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__|"+ + "__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__" + ); + + var operators = ( + "/|/\\=|&|&\\=|&&|\\|\\|\\=|\\|\\||\\-|\\-\\=|\\-\\-|\\+|" + + "\\+\\=|\\+\\+|\\<|\\<\\=|\\<\\<|\\<\\<\\=|\\<\\>|\\<\\>\\=|\\>|\\>\\=|\\>\\>\\=|" + + "\\>\\>\\>\\=|\\>\\>|\\>\\>\\>|\\!|\\!\\=|\\!\\<\\>|\\!\\<\\>\\=|\\!\\<|\\!\\<\\=|" + + "\\!\\>|\\!\\>\\=|\\?|\\$|\\=|\\=\\=|\\*|\\*\\=|%|%\\=|" + + "\\^|\\^\\=|\\^\\^|\\^\\^\\=|~|~\\=|\\=\\>|#" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword.modifier" : modifiers, + "keyword.control" : keywordControls, + "keyword.type" : types, + "keyword": keywords, + "keyword.storage": storages, + "punctation": "\\.|\\,|;|\\.\\.|\\.\\.\\.", + "keyword.operator" : operators, + "constant.language": builtinConstants + }, "identifier"); + + var identifierRe = "[a-zA-Z_\u00a1-\uffff][a-zA-Z\\d_\u00a1-\uffff]*\\b"; + + this.$rules = { + "start" : [ + { //-------------------------------------------------------- COMMENTS + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "star-comment" + }, { + token: "comment.shebang", + regex: "^\\s*#!.*" + }, { + token : "comment", + regex : "\\/\\+", + next: "plus-comment" + }, { //-------------------------------------------------------- STRINGS + onMatch: function(value, currentState, state) { + state.unshift(this.next, value.substr(2)); + return "string"; + }, + regex: 'q"(?:[\\[\\(\\{\\<]+)', + next: 'operator-heredoc-string' + }, { + onMatch: function(value, currentState, state) { + state.unshift(this.next, value.substr(2)); + return "string"; + }, + regex: 'q"(?:[a-zA-Z_]+)$', + next: 'identifier-heredoc-string' + }, { + token : "string", // multi line string start + regex : '[xr]?"', + next : "quote-string" + }, { + token : "string", // multi line string start + regex : '[xr]?`', + next : "backtick-string" + }, { + token : "string", // single line + regex : "[xr]?['](?:(?:\\\\.)|(?:[^'\\\\]))*?['][cdw]?" + }, { //-------------------------------------------------------- RULES + token: ["keyword", "text", "paren.lparen"], + regex: /(asm)(\s*)({)/, + next: "d-asm" + }, { + token: ["keyword", "text", "paren.lparen", "constant.language"], + regex: "(__traits)(\\s*)(\\()("+identifierRe+")" + }, { // import|module abc + token: ["keyword", "text", "variable.module"], + regex: "(import|module)(\\s+)((?:"+identifierRe+"\\.?)*)" + }, { // storage Name + token: ["keyword.storage", "text", "entity.name.type"], + regex: "("+storages+")(\\s*)("+identifierRe+")" + }, { // alias|typedef foo bar; + token: ["keyword", "text", "variable.storage", "text"], + regex: "(alias|typedef)(\\s*)("+identifierRe+")(\\s*)" + }, { //-------------------------------------------------------- OTHERS + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F_]+(l|ul|u|f|F|L|U|UL)?\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d[\\d_]*(?:(?:\\.[\\d_]*)?(?:[eE][+-]?[\\d_]+)?)?(l|ul|u|f|F|L|U|UL)?\\b" + }, { + token: "entity.other.attribute-name", + regex: "@"+identifierRe + }, { + token : keywordMapper, + regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b" + }, { + token : "keyword.operator", + regex : operators + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\.|\\:" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "star-comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken: 'comment' + } + ], + "plus-comment" : [ + { + token : "comment", // closing comment + regex : "\\+\\/", + next : "start" + }, { + defaultToken: 'comment' + } + ], + + "quote-string" : [ + stringEscapesSeq, + { + token : "string", + regex : '"[cdw]?', + next : "start" + }, { + defaultToken: 'string' + } + ], + + "backtick-string" : [ + stringEscapesSeq, + { + token : "string", + regex : '`[cdw]?', + next : "start" + }, { + defaultToken: 'string' + } + ], + + "operator-heredoc-string": [ + { + onMatch: function(value, currentState, state) { + value = value.substring(value.length-2, value.length-1); + var map = {'>':'<',']':'[',')':'(','}':'{'}; + if(Object.keys(map).indexOf(value) != -1) + value = map[value]; + if(value != state[1]) return "string"; + state.shift(); + state.shift(); + + return "string"; + }, + regex: '(?:[\\]\\)}>]+)"', + next: 'start' + }, { + token: 'string', + regex: '[^\\]\\)}>]+' + } + ], + + "identifier-heredoc-string": [ + { + onMatch: function(value, currentState, state) { + value = value.substring(0, value.length-1); + if(value != state[1]) return "string"; + state.shift(); + state.shift(); + + return "string"; + }, + regex: '^(?:[A-Za-z_][a-zA-Z0-9]+)"', + next: 'start' + }, { + token: 'string', + regex: '[^\\]\\)}>]+' + } + ], + + "d-asm": [ + { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: 'keyword.instruction', + regex: '[a-zA-Z]+', + next: 'd-asm-instruction' + }, { + token: "text", + regex: "\\s+" + } + ], + 'd-asm-instruction': [ + { + token: 'constant.language', + regex: /AL|AH|AX|EAX|BL|BH|BX|EBX|CL|CH|CX|ECX|DL|DH|DX|EDX|BP|EBP|SP|ESP|DI|EDI|SI|ESI/i + }, { + token: 'identifier', + regex: '[a-zA-Z]+' + }, { + token: 'string', + regex: '".*"' + }, { + token: 'comment', + regex: '//.*$' + }, { + token: 'constant.numeric', + regex: '[0-9.xA-F]+' + }, { + token: 'punctuation.operator', + regex: '\\,' + }, { + token: 'punctuation.operator', + regex: ';', + next: 'd-asm' + }, { + token: 'text', + regex: '\\s+' + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +DHighlightRules.metaData = { + comment: 'D language', + fileTypes: [ 'd', 'di' ], + firstLineMatch: '^#!.*\\b[glr]?dmd\\b.', + foldingStartMarker: '(?x)/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))', + foldingStopMarker: '(? indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/d",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/d_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var DHighlightRules = require("./d_highlight_rules").DHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = DHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/d"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-dart.js b/htdocs/includes/ace/mode-dart.js new file mode 100644 index 00000000000..c70423428ec --- /dev/null +++ b/htdocs/includes/ace/mode-dart.js @@ -0,0 +1,689 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" + +var c_cppHighlightRules = function() { + + var keywordControls = ( + "break|case|continue|default|do|else|for|goto|if|_Pragma|" + + "return|switch|while|catch|operator|try|throw|using" + ); + + var storageType = ( + "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + + "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + + "class|wchar_t|template|char16_t|char32_t" + ); + + var storageModifiers = ( + "const|extern|register|restrict|static|volatile|inline|private|" + + "protected|public|friend|explicit|virtual|export|mutable|typename|" + + "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" + ); + + var keywordOperators = ( + "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + + "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" + ); + + var builtinConstants = ( + "NULL|true|false|TRUE|FALSE|nullptr" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword.control" : keywordControls, + "storage.type" : storageType, + "storage.modifier" : storageModifiers, + "keyword.operator" : keywordOperators, + "variable.language": "this", + "constant.language": builtinConstants + }, "identifier"); + + var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "//$", + next : "start" + }, { + token : "comment", + regex : "//", + next : "singleLineComment" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // character + regex : "'(?:" + escapeRe + "|.)?'" + }, { + token : "string.start", + regex : '"', + stateName: "qqstring", + next: [ + { token: "string", regex: /\\\s*$/, next: "qqstring" }, + { token: "constant.language.escape", regex: escapeRe }, + { token: "constant.language.escape", regex: /%[^'"\\]/ }, + { token: "string.end", regex: '"|$', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "string.start", + regex : 'R"\\(', + stateName: "rawString", + next: [ + { token: "string.end", regex: '\\)"', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "keyword", // pre-compiler directives + regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", + next : "directive" + }, { + token : "keyword", // special case pre-compiler directive + regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" + }, { + token : "support.function.C99.c", + regex : cFunctions + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" + }, { + token : "keyword.operator", + regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/ + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "singleLineComment" : [ + { + token : "comment", + regex : /\\$/, + next : "singleLineComment" + }, { + token : "comment", + regex : /$/, + next : "start" + }, { + defaultToken: "comment" + } + ], + "directive" : [ + { + token : "constant.other.multiline", + regex : /\\/ + }, + { + token : "constant.other.multiline", + regex : /.*\\/ + }, + { + token : "constant.other", + regex : "\\s*<.+?>", + next : "start" + }, + { + token : "constant.other", // single line + regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', + next : "start" + }, + { + token : "constant.other", // single line + regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", + next : "start" + }, + { + token : "constant.other", + regex : /[^\\\/]+/, + next : "start" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(c_cppHighlightRules, TextHighlightRules); + +exports.c_cppHighlightRules = c_cppHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = c_cppHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/c_cpp"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/dart_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DartHighlightRules = function() { + + var constantLanguage = "true|false|null"; + var variableLanguage = "this|super"; + var keywordControl = "try|catch|finally|throw|rethrow|assert|break|case|continue|default|do|else|for|if|in|return|switch|while|new|deferred|async|await"; + var keywordDeclaration = "abstract|class|extends|external|factory|implements|get|native|operator|set|typedef|with|enum"; + var storageModifier = "static|final|const"; + var storageType = "void|bool|num|int|double|dynamic|var|String"; + + var keywordMapper = this.createKeywordMapper({ + "constant.language.dart": constantLanguage, + "variable.language.dart": variableLanguage, + "keyword.control.dart": keywordControl, + "keyword.declaration.dart": keywordDeclaration, + "storage.modifier.dart": storageModifier, + "storage.type.primitive.dart": storageType + }, "identifier"); + + var stringfill = { + defaultToken : "string" + }; + + this.$rules = + { + "start": [ + { + token : "comment", + regex : /\/\/.*$/ + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : /\/\*/, + next : "comment" + }, + { + token: ["meta.preprocessor.script.dart"], + regex: "^(#!.*)$" + }, + { + token: "keyword.other.import.dart", + regex: "(?:\\b)(?:library|import|export|part|of|show|hide)(?:\\b)" + }, + { + token : ["keyword.other.import.dart", "text"], + regex : "(?:\\b)(prefix)(\\s*:)" + }, + { + regex: "\\bas\\b", + token: "keyword.cast.dart" + }, + { + regex: "\\?|:", + token: "keyword.control.ternary.dart" + }, + { + regex: "(?:\\b)(is\\!?)(?:\\b)", + token: ["keyword.operator.dart"] + }, + { + regex: "(<<|>>>?|~|\\^|\\||&)", + token: ["keyword.operator.bitwise.dart"] + }, + { + regex: "((?:&|\\^|\\||<<|>>>?)=)", + token: ["keyword.operator.assignment.bitwise.dart"] + }, + { + regex: "(===?|!==?|<=?|>=?)", + token: ["keyword.operator.comparison.dart"] + }, + { + regex: "((?:[+*/%-]|\\~)=)", + token: ["keyword.operator.assignment.arithmetic.dart"] + }, + { + regex: "=", + token: "keyword.operator.assignment.dart" + }, + { + token : "string", + regex : "'''", + next : "qdoc" + }, + { + token : "string", + regex : '"""', + next : "qqdoc" + }, + { + token : "string", + regex : "'", + next : "qstring" + }, + { + token : "string", + regex : '"', + next : "qqstring" + }, + { + regex: "(\\-\\-|\\+\\+)", + token: ["keyword.operator.increment-decrement.dart"] + }, + { + regex: "(\\-|\\+|\\*|\\/|\\~\\/|%)", + token: ["keyword.operator.arithmetic.dart"] + }, + { + regex: "(!|&&|\\|\\|)", + token: ["keyword.operator.logical.dart"] + }, + { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, + { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, + { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qdoc" : [ + { + token : "string", + regex : ".*?'''", + next : "start" + }, stringfill], + + "qqdoc" : [ + { + token : "string", + regex : '.*?"""', + next : "start" + }, stringfill], + + "qstring" : [ + { + token : "string", + regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", + next : "start" + }, stringfill], + + "qqstring" : [ + { + token : "string", + regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', + next : "start" + }, stringfill] +} + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(DartHighlightRules, TextHighlightRules); + +exports.DartHighlightRules = DartHighlightRules; +}); + +ace.define("ace/mode/dart",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/dart_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var CMode = require("./c_cpp").Mode; +var DartHighlightRules = require("./dart_highlight_rules").DartHighlightRules; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + CMode.call(this); + this.HighlightRules = DartHighlightRules; + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, CMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/dart"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-diff.js b/htdocs/includes/ace/mode-diff.js new file mode 100644 index 00000000000..ae878dbe26f --- /dev/null +++ b/htdocs/includes/ace/mode-diff.js @@ -0,0 +1,139 @@ +ace.define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DiffHighlightRules = function() { + + this.$rules = { + "start" : [{ + regex: "^(?:\\*{15}|={67}|-{3}|\\+{3})$", + token: "punctuation.definition.separator.diff", + "name": "keyword" + }, { //diff.range.unified + regex: "^(@@)(\\s*.+?\\s*)(@@)(.*)$", + token: [ + "constant", + "constant.numeric", + "constant", + "comment.doc.tag" + ] + }, { //diff.range.normal + regex: "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$", + token: [ + "constant.numeric", + "punctuation.definition.range.diff", + "constant.function", + "constant.numeric", + "punctuation.definition.range.diff", + "invalid" + ], + "name": "meta." + }, { + regex: "^(\\-{3}|\\+{3}|\\*{3})( .+)$", + token: [ + "constant.numeric", + "meta.tag" + ] + }, { // added + regex: "^([!+>])(.*?)(\\s*)$", + token: [ + "support.constant", + "text", + "invalid" + ] + }, { // removed + regex: "^([<\\-])(.*?)(\\s*)$", + token: [ + "support.function", + "string", + "invalid" + ] + }, { + regex: "^(diff)(\\s+--\\w+)?(.+?)( .+)?$", + token: ["variable", "variable", "keyword", "variable"] + }, { + regex: "^Index.+$", + token: "variable" + }, { + regex: "^\\s+$", + token: "text" + }, { + regex: "\\s*$", + token: "invalid" + }, { + defaultToken: "invisible", + caseInsensitive: true + } + ] + }; +}; + +oop.inherits(DiffHighlightRules, TextHighlightRules); + +exports.DiffHighlightRules = DiffHighlightRules; +}); + +ace.define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function(levels, flag) { + this.regExpList = levels; + this.flag = flag; + this.foldingStartMarker = RegExp("^(" + levels.join("|") + ")", this.flag); +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var start = {row: row, column: line.length}; + + var regList = this.regExpList; + for (var i = 1; i <= regList.length; i++) { + var re = RegExp("^(" + regList.slice(0, i).join("|") + ")", this.flag); + if (re.test(line)) + break; + } + + for (var l = session.getLength(); ++row < l; ) { + line = session.getLine(row); + if (re.test(line)) + break; + } + if (row == start.row + 1) + return; + return Range.fromPoints(start, {row: row - 1, column: line.length}); + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/diff_highlight_rules","ace/mode/folding/diff"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules; +var FoldMode = require("./folding/diff").FoldMode; + +var Mode = function() { + this.HighlightRules = HighlightRules; + this.foldingRules = new FoldMode(["diff", "index", "\\+{3}", "@@|\\*{5}"], "i"); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.$id = "ace/mode/diff"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-django.js b/htdocs/includes/ace/mode-django.js new file mode 100644 index 00000000000..b681d992f54 --- /dev/null +++ b/htdocs/includes/ace/mode-django.js @@ -0,0 +1,2565 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/django",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DjangoHighlightRules = function(){ + this.$rules = { + 'start': [{ + token: "string", + regex: '".*?"' + }, { + token: "string", + regex: "'.*?'" + }, { + token: "constant", + regex: '[0-9]+' + }, { + token: "variable", + regex: "[-_a-zA-Z0-9:]+" + }], + 'tag': [{ + token: "entity.name.function", + regex: "[a-zA-Z][_a-zA-Z0-9]*", + next: "start" + }] + }; +}; + +oop.inherits(DjangoHighlightRules, TextHighlightRules) + +var DjangoHtmlHighlightRules = function() { + this.$rules = new HtmlHighlightRules().getRules(); + + for (var i in this.$rules) { + this.$rules[i].unshift({ + token: "comment.line", + regex: "\\{#.*?#\\}" + }, { + token: "comment.block", + regex: "\\{\\%\\s*comment\\s*\\%\\}", + merge: true, + next: "django-comment" + }, { + token: "constant.language", + regex: "\\{\\{", + next: "django-start" + }, { + token: "constant.language", + regex: "\\{\\%", + next: "django-tag" + }); + this.embedRules(DjangoHighlightRules, "django-", [{ + token: "comment.block", + regex: "\\{\\%\\s*endcomment\\s*\\%\\}", + merge: true, + next: "start" + }, { + token: "constant.language", + regex: "\\%\\}", + next: "start" + }, { + token: "constant.language", + regex: "\\}\\}", + next: "start" + }]); + } +}; + +oop.inherits(DjangoHtmlHighlightRules, HtmlHighlightRules); + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = DjangoHtmlHighlightRules; +}; +oop.inherits(Mode, HtmlMode); + +(function() { + this.$id = "ace/mode/django"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-dockerfile.js b/htdocs/includes/ace/mode-dockerfile.js new file mode 100644 index 00000000000..d030b9c35b4 --- /dev/null +++ b/htdocs/includes/ace/mode-dockerfile.js @@ -0,0 +1,492 @@ +ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var reservedKeywords = exports.reservedKeywords = ( + '!|{|}|case|do|done|elif|else|'+ + 'esac|fi|for|if|in|then|until|while|'+ + '&|;|export|local|read|typeset|unset|'+ + 'elif|select|set|function|declare|readonly' + ); + +var languageConstructs = exports.languageConstructs = ( + '[|]|alias|bg|bind|break|builtin|'+ + 'cd|command|compgen|complete|continue|'+ + 'dirs|disown|echo|enable|eval|exec|'+ + 'exit|fc|fg|getopts|hash|help|history|'+ + 'jobs|kill|let|logout|popd|printf|pushd|'+ + 'pwd|return|set|shift|shopt|source|'+ + 'suspend|test|times|trap|type|ulimit|'+ + 'umask|unalias|wait' +); + +var ShHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "keyword": reservedKeywords, + "support.function.builtin": languageConstructs, + "invalid.deprecated": "debugger" + }, "identifier"); + + var integer = "(?:(?:[1-9]\\d*)|(?:0))"; + + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + var fileDescriptor = "(?:&" + intPart + ")"; + + var variableName = "[a-zA-Z_][a-zA-Z0-9_]*"; + var variable = "(?:" + variableName + "=)"; + + var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))"; + + var func = "(?:" + variableName + "\\s*\\(\\))"; + + this.$rules = { + "start" : [{ + token : "constant", + regex : /\\./ + }, { + token : ["text", "comment"], + regex : /(^|\s)(#.*)$/ + }, { + token : "string.start", + regex : '"', + push : [{ + token : "constant.language.escape", + regex : /\\(?:[$`"\\]|$)/ + }, { + include : "variables" + }, { + token : "keyword.operator", + regex : /`/ // TODO highlight ` + }, { + token : "string.end", + regex : '"', + next: "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string", + regex : "\\$'", + push : [{ + token : "constant.language.escape", + regex : /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/ + }, { + token : "string", + regex : "'", + next: "pop" + }, { + defaultToken: "string" + }] + }, { + regex : "<<<", + token : "keyword.operator" + }, { + stateName: "heredoc", + regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)", + onMatch : function(value, currentState, stack) { + var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; + var tokens = value.split(this.splitRegex); + stack.push(next, tokens[4]); + return [ + {type:"constant", value: tokens[1]}, + {type:"text", value: tokens[2]}, + {type:"string", value: tokens[3]}, + {type:"support.class", value: tokens[4]}, + {type:"string", value: tokens[5]} + ]; + }, + rules: { + heredoc: [{ + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^\t+" + }, { + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }] + } + }, { + regex : "$", + token : "empty", + next : function(currentState, stack) { + if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") + return stack[0]; + return currentState; + } + }, { + token : ["keyword", "text", "text", "text", "variable"], + regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/ + }, { + token : "variable.language", + regex : builtinVariable + }, { + token : "variable", + regex : variable + }, { + include : "variables" + }, { + token : "support.function", + regex : func + }, { + token : "support.function", + regex : fileDescriptor + }, { + token : "string", // ' string + start : "'", end : "'" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]" + }, { + token : "punctuation.operator", + regex : ";" + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]]" + }, { + token : "paren.rparen", + regex : "[\\)\\}]", + next : "pop" + }], + variables: [{ + token : "variable", + regex : /(\$)(\w+)/ + }, { + token : ["variable", "paren.lparen"], + regex : /(\$)(\()/, + push : "start" + }, { + token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"], + regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/, + push : "start" + }, { + token : "variable", + regex : /\$[*@#?\-$!0_]/ + }, { + token : ["variable", "paren.lparen"], + regex : /(\$)(\{)/, + push : "start" + }] + }; + + this.normalizeRules(); +}; + +oop.inherits(ShHighlightRules, TextHighlightRules); + +exports.ShHighlightRules = ShHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules; +var Range = require("../range").Range; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; + +var Mode = function() { + this.HighlightRules = ShHighlightRules; + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = new CstyleBehaviour(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + var outdents = { + "pass": 1, + "return": 1, + "raise": 1, + "break": 1, + "continue": 1 + }; + + this.checkOutdent = function(state, line, input) { + if (input !== "\r\n" && input !== "\r" && input !== "\n") + return false; + + var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + + if (!tokens) + return false; + do { + var last = tokens.pop(); + } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); + + if (!last) + return false; + + return (last.type == "keyword" && outdents[last.value]); + }; + + this.autoOutdent = function(state, doc, row) { + + row += 1; + var indent = this.$getIndent(doc.getLine(row)); + var tab = doc.getTabString(); + if (indent.slice(-tab.length) == tab) + doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); + }; + + this.$id = "ace/mode/sh"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/dockerfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/sh_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules; + +var DockerfileHighlightRules = function() { + ShHighlightRules.call(this); + + var startRules = this.$rules.start; + for (var i = 0; i < startRules.length; i++) { + if (startRules[i].token == "variable.language") { + startRules.splice(i, 0, { + token: "constant.language", + regex: "(?:^(?:FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD|COPY|LABEL)\\b)", + caseInsensitive: true + }); + break; + } + } + +}; + +oop.inherits(DockerfileHighlightRules, ShHighlightRules); + +exports.DockerfileHighlightRules = DockerfileHighlightRules; +}); + +ace.define("ace/mode/dockerfile",["require","exports","module","ace/lib/oop","ace/mode/sh","ace/mode/dockerfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var ShMode = require("./sh").Mode; +var DockerfileHighlightRules = require("./dockerfile_highlight_rules").DockerfileHighlightRules; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + ShMode.call(this); + + this.HighlightRules = DockerfileHighlightRules; + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, ShMode); + +(function() { + this.$id = "ace/mode/dockerfile"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-dot.js b/htdocs/includes/ace/mode-dot.js new file mode 100644 index 00000000000..72914768f89 --- /dev/null +++ b/htdocs/includes/ace/mode-dot.js @@ -0,0 +1,410 @@ +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/dot_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; + +var DotHighlightRules = function() { + + var keywords = lang.arrayToMap( + ("strict|node|edge|graph|digraph|subgraph").split("|") + ); + + var attributes = lang.arrayToMap( + ("damping|k|url|area|arrowhead|arrowsize|arrowtail|aspect|bb|bgcolor|center|charset|clusterrank|color|colorscheme|comment|compound|concentrate|constraint|decorate|defaultdist|dim|dimen|dir|diredgeconstraints|distortion|dpi|edgeurl|edgehref|edgetarget|edgetooltip|epsilon|esep|fillcolor|fixedsize|fontcolor|fontname|fontnames|fontpath|fontsize|forcelabels|gradientangle|group|headurl|head_lp|headclip|headhref|headlabel|headport|headtarget|headtooltip|height|href|id|image|imagepath|imagescale|label|labelurl|label_scheme|labelangle|labeldistance|labelfloat|labelfontcolor|labelfontname|labelfontsize|labelhref|labeljust|labelloc|labeltarget|labeltooltip|landscape|layer|layerlistsep|layers|layerselect|layersep|layout|len|levels|levelsgap|lhead|lheight|lp|ltail|lwidth|margin|maxiter|mclimit|mindist|minlen|mode|model|mosek|nodesep|nojustify|normalize|nslimit|nslimit1|ordering|orientation|outputorder|overlap|overlap_scaling|pack|packmode|pad|page|pagedir|pencolor|penwidth|peripheries|pin|pos|quadtree|quantum|rank|rankdir|ranksep|ratio|rects|regular|remincross|repulsiveforce|resolution|root|rotate|rotation|samehead|sametail|samplepoints|scale|searchsize|sep|shape|shapefile|showboxes|sides|size|skew|smoothing|sortv|splines|start|style|stylesheet|tailurl|tail_lp|tailclip|tailhref|taillabel|tailport|tailtarget|tailtooltip|target|tooltip|truecolor|vertices|viewport|voro_margin|weight|width|xlabel|xlp|z").split("|") + ); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : /\/\/.*$/ + }, { + token : "comment", + regex : /#.*$/ + }, { + token : "comment", // multi line comment + merge : true, + regex : /\/\*/, + next : "comment" + }, { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", + regex : /[+\-]?\d+(?:(?:\.\d*)?(?:[eE][+\-]?\d+)?)?\b/ + }, { + token : "keyword.operator", + regex : /\+|=|\->/ + }, { + token : "punctuation.operator", + regex : /,|;/ + }, { + token : "paren.lparen", + regex : /[\[{]/ + }, { + token : "paren.rparen", + regex : /[\]}]/ + }, { + token: "comment", + regex: /^#!.*$/ + }, { + token: function(value) { + if (keywords.hasOwnProperty(value.toLowerCase())) { + return "keyword"; + } + else if (attributes.hasOwnProperty(value.toLowerCase())) { + return "variable"; + } + else { + return "text"; + } + }, + regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qqstring" : [ + { + token : "string", + regex : '[^"\\\\]+', + merge : true + }, { + token : "string", + regex : "\\\\$", + next : "qqstring", + merge : true + }, { + token : "string", + regex : '"|$', + next : "start", + merge : true + } + ], + "qstring" : [ + { + token : "string", + regex : "[^'\\\\]+", + merge : true + }, { + token : "string", + regex : "\\\\$", + next : "qstring", + merge : true + }, { + token : "string", + regex : "'|$", + next : "start", + merge : true + } + ] + }; +}; + +oop.inherits(DotHighlightRules, TextHighlightRules); + +exports.DotHighlightRules = DotHighlightRules; + +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/dot",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/matching_brace_outdent","ace/mode/dot_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var DotHighlightRules = require("./dot_highlight_rules").DotHighlightRules; +var DotFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = DotHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new DotFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = ["//", "#"]; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/dot"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-drools.js b/htdocs/includes/ace/mode-drools.js new file mode 100644 index 00000000000..5863afe030f --- /dev/null +++ b/htdocs/includes/ace/mode-drools.js @@ -0,0 +1,457 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JavaHighlightRules = function() { + var keywords = ( + "abstract|continue|for|new|switch|" + + "assert|default|goto|package|synchronized|" + + "boolean|do|if|private|this|" + + "break|double|implements|protected|throw|" + + "byte|else|import|public|throws|" + + "case|enum|instanceof|return|transient|" + + "catch|extends|int|short|try|" + + "char|final|interface|static|void|" + + "class|finally|long|strictfp|volatile|" + + "const|float|native|super|while" + ); + + var buildinConstants = ("null|Infinity|NaN|undefined"); + + + var langClasses = ( + "AbstractMethodError|AssertionError|ClassCircularityError|"+ + "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ + "ExceptionInInitializerError|IllegalAccessError|"+ + "IllegalThreadStateException|InstantiationError|InternalError|"+ + "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ + "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ + "SuppressWarnings|TypeNotPresentException|UnknownError|"+ + "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ + "InstantiationException|IndexOutOfBoundsException|"+ + "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ + "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ + "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ + "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ + "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ + "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ + "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ + "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ + "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ + "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ + "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ + "ArrayStoreException|ClassCastException|LinkageError|"+ + "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ + "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ + "Cloneable|Class|CharSequence|Comparable|String|Object" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "constant.language": buildinConstants, + "support.function": langClasses + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/ + }, { + token : "constant.numeric", // float + regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/ + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(JavaHighlightRules, TextHighlightRules); + +exports.JavaHighlightRules = JavaHighlightRules; +}); + +ace.define("ace/mode/drools_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/java_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules; +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; + +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; +var packageIdentifierRe = "[a-zA-Z\\$_\u00a1-\uffff][\\.a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var DroolsHighlightRules = function() { + + var keywords = ("date|effective|expires|lock|on|active|no|loop|auto|focus" + + "|activation|group|agenda|ruleflow|duration|timer|calendars|refract|direct" + + "|dialect|salience|enabled|attributes|extends|template" + + "|function|contains|matches|eval|excludes|soundslike" + + "|memberof|not|in|or|and|exists|forall|over|from|entry|point|accumulate|acc|collect" + + "|action|reverse|result|end|init|instanceof|extends|super|boolean|char|byte|short" + + "|int|long|float|double|this|void|class|new|case|final|if|else|for|while|do" + + "|default|try|catch|finally|switch|synchronized|return|throw|break|continue|assert" + + "|modify|static|public|protected|private|abstract|native|transient|volatile" + + "|strictfp|throws|interface|enum|implements|type|window|trait|no-loop|str" + ); + + var langClasses = ( + "AbstractMethodError|AssertionError|ClassCircularityError|"+ + "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ + "ExceptionInInitializerError|IllegalAccessError|"+ + "IllegalThreadStateException|InstantiationError|InternalError|"+ + "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ + "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ + "SuppressWarnings|TypeNotPresentException|UnknownError|"+ + "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ + "InstantiationException|IndexOutOfBoundsException|"+ + "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ + "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ + "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ + "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ + "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ + "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ + "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ + "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ + "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ + "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ + "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ + "ArrayStoreException|ClassCastException|LinkageError|"+ + "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ + "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ + "Cloneable|Class|CharSequence|Comparable|String|Object" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "constant.language": "null", + "support.class" : langClasses, + "support.function" : "retract|update|modify|insert" + }, "identifier"); + + var stringRules = function() { + return [{ + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }]; + }; + + + var basicPreRules = function(blockCommentRules) { + return [{ + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : blockCommentRules + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }]; + }; + + var blockCommentRules = function(returnRule) { + return [ + { + token : "comment.block", // closing comment + regex : "\\*\\/", + next : returnRule + }, { + defaultToken : "comment.block" + } + ]; + } + + var basicPostRules = function() { + return [{ + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + }]; + }; + + + this.$rules = { + "start" : [].concat(basicPreRules("block.comment"), [ + { + token : "entity.name.type", + regex : "@[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : ["keyword","text","entity.name.type"], + regex : "(package)(\\s+)(" + packageIdentifierRe +")" + }, { + token : ["keyword","text","keyword","text","entity.name.type"], + regex : "(import)(\\s+)(function)(\\s+)(" + packageIdentifierRe +")" + }, { + token : ["keyword","text","entity.name.type"], + regex : "(import)(\\s+)(" + packageIdentifierRe +")" + }, { + token : ["keyword","text","entity.name.type","text","variable"], + regex : "(global)(\\s+)(" + packageIdentifierRe +")(\\s+)(" + identifierRe +")" + }, { + token : ["keyword","text","keyword","text","entity.name.type"], + regex : "(declare)(\\s+)(trait)(\\s+)(" + identifierRe +")" + }, { + token : ["keyword","text","entity.name.type"], + regex : "(declare)(\\s+)(" + identifierRe +")" + }, { + token : ["keyword","text","entity.name.type"], + regex : "(extends)(\\s+)(" + packageIdentifierRe +")" + }, { + token : ["keyword","text"], + regex : "(rule)(\\s+)", + next : "asset.name" + }], + stringRules(), + [{ + token : ["variable.other","text","text"], + regex : "(" + identifierRe + ")(\\s*)(:)" + }, { + token : ["keyword","text"], + regex : "(query)(\\s+)", + next : "asset.name" + }, { + token : ["keyword","text"], + regex : "(when)(\\s*)" + }, { + token : ["keyword","text"], + regex : "(then)(\\s*)", + next : "java-start" + }, { + token : "paren.lparen", + regex : /[\[({]/ + }, { + token : "paren.rparen", + regex : /[\])}]/ + }], basicPostRules()), + "block.comment" : blockCommentRules("start"), + "asset.name" : [ + { + token : "entity.name", + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "entity.name", + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "entity.name", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "start" + }] + }; + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + + this.embedRules(JavaHighlightRules, "java-", [ + { + token : "support.function", + regex: "\\b(insert|modify|retract|update)\\b" + }, { + token : "keyword", + regex: "\\bend\\b", + next : "start" + }]); + +}; + +oop.inherits(DroolsHighlightRules, TextHighlightRules); + +exports.DroolsHighlightRules = DroolsHighlightRules; +}); + +ace.define("ace/mode/folding/drools",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + this.foldingStartMarker = /\b(rule|declare|query|when|then)\b/; + this.foldingStopMarker = /\bend\b/; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) { + var position = {row: row, column: line.length}; + var iterator = new TokenIterator(session, position.row, position.column); + var seek = "end"; + var token = iterator.getCurrentToken(); + if (token.value == "when") { + seek = "then"; + } + while (token) { + if (token.value == seek) { + return Range.fromPoints(position ,{ + row: iterator.getCurrentTokenRow(), + column: iterator.getCurrentTokenColumn() + }); + } + token = iterator.stepForward(); + } + } + + } + } + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/drools",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/drools_highlight_rules","ace/mode/folding/drools"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var DroolsHighlightRules = require("./drools_highlight_rules").DroolsHighlightRules; +var DroolsFoldMode = require("./folding/drools").FoldMode; + +var Mode = function() { + this.HighlightRules = DroolsHighlightRules; + this.foldingRules = new DroolsFoldMode(); + this.$behaviour = this.$defaultBehaviour; + +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.$id = "ace/mode/drools"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-eiffel.js b/htdocs/includes/ace/mode-eiffel.js new file mode 100644 index 00000000000..decf61d1b28 --- /dev/null +++ b/htdocs/includes/ace/mode-eiffel.js @@ -0,0 +1,128 @@ +ace.define("ace/mode/eiffel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var EiffelHighlightRules = function() { + var keywords = "across|agent|alias|all|attached|as|assign|attribute|check|" + + "class|convert|create|debug|deferred|detachable|do|else|elseif|end|" + + "ensure|expanded|export|external|feature|from|frozen|if|inherit|" + + "inspect|invariant|like|local|loop|not|note|obsolete|old|once|" + + "Precursor|redefine|rename|require|rescue|retry|select|separate|" + + "some|then|undefine|until|variant|when"; + + var operatorKeywords = "and|implies|or|xor"; + + var languageConstants = "Void"; + + var booleanConstants = "True|False"; + + var languageVariables = "Current|Result"; + + var keywordMapper = this.createKeywordMapper({ + "constant.language": languageConstants, + "constant.language.boolean": booleanConstants, + "variable.language": languageVariables, + "keyword.operator": operatorKeywords, + "keyword": keywords + }, "identifier", true); + + var simpleString = /(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)+?/; + + this.$rules = { + "start": [{ + token : "string.quoted.other", // Aligned-verbatim-strings (verbatim option not supported) + regex : /"\[/, + next: "aligned_verbatim_string" + }, { + token : "string.quoted.other", // Non-aligned-verbatim-strings (verbatim option not supported) + regex : /"\{/, + next: "non-aligned_verbatim_string" + }, { + token : "string.quoted.double", + regex : /"(?:[^%\b\f\n\r\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)*?"/ + }, { + token : "comment.line.double-dash", + regex : /--.*/ + }, { + token : "constant.character", + regex : /'(?:[^%\b\f\n\r\t\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)'/ + }, { + token : "constant.numeric", // hexa | octal | bin + regex : /\b0(?:[xX][\da-fA-F](?:_*[\da-fA-F])*|[cC][0-7](?:_*[0-7])*|[bB][01](?:_*[01])*)\b/ + }, { + token : "constant.numeric", + regex : /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/ + }, { + token : "paren.lparen", + regex : /[\[({]|<<|\|\(/ + }, { + token : "paren.rparen", + regex : /[\])}]|>>|\|\)/ + }, { + token : "keyword.operator", // punctuation + regex : /:=|->|\.(?=\w)|[;,:?]/ + }, { + token : "keyword.operator", + regex : /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/ + }, { + token : function (v) { + var result = keywordMapper(v); + if (result === "identifier" && v === v.toUpperCase()) { + result = "entity.name.type"; + } + return result; + }, + regex : /[a-zA-Z][a-zA-Z\d_]*\b/ + }, { + token : "text", + regex : /\s+/ + } + ], + "aligned_verbatim_string" : [{ + token : "string", + regex : /]"/, + next : "start" + }, { + token : "string", + regex : simpleString + } + ], + "non-aligned_verbatim_string" : [{ + token : "string.quoted.other", + regex : /}"/, + next : "start" + }, { + token : "string.quoted.other", + regex : simpleString + } + ]}; +}; + +oop.inherits(EiffelHighlightRules, TextHighlightRules); + +exports.EiffelHighlightRules = EiffelHighlightRules; +}); + +ace.define("ace/mode/eiffel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/eiffel_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var EiffelHighlightRules = require("./eiffel_highlight_rules").EiffelHighlightRules; + +var Mode = function() { + this.HighlightRules = EiffelHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.$id = "ace/mode/eiffel"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-ejs.js b/htdocs/includes/ace/mode-ejs.js new file mode 100644 index 00000000000..4309c8b8f58 --- /dev/null +++ b/htdocs/includes/ace/mode-ejs.js @@ -0,0 +1,2999 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var constantOtherSymbol = exports.constantOtherSymbol = { + token : "constant.other.symbol.ruby", // symbol + regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" +}; + +var qString = exports.qString = { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" +}; + +var qqString = exports.qqString = { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' +}; + +var tString = exports.tString = { + token : "string", // backtick string + regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" +}; + +var constantNumericHex = exports.constantNumericHex = { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" +}; + +var constantNumericFloat = exports.constantNumericFloat = { + token : "constant.numeric", // float + regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" +}; + +var instanceVariable = exports.instanceVariable = { + token : "variable.instance", // instance variable + regex : "@{1,2}[a-zA-Z_\\d]+" +}; + +var RubyHighlightRules = function() { + + var builtinFunctions = ( + "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + + "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + + "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + + "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + + "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + + "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + + "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + + "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + + "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + + "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + + "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + + "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + + "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + + "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + + "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + + "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + + "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + + "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + + "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + + "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + + "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + + "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + + "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + + "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + + "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + + "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + + "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + + "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + + "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + + "has_many|has_one|belongs_to|has_and_belongs_to_many" + ); + + var keywords = ( + "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + + "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + + "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" + ); + + var buildinConstants = ( + "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + + "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" + ); + + var builtinVariables = ( + "$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" + + "$!|root_url|flash|session|cookies|params|request|response|logger|self" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": buildinConstants, + "variable.language": builtinVariables, + "support.function": builtinFunctions, + "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "#.*$" + }, { + token : "comment", // multi line comment + regex : "^=begin(?:$|\\s.*$)", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, + + [{ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + return "paren.lparen"; + } + if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1) + return "paren.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.start", + regex : /"/, + push : [{ + token : "constant.language.escape", + regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/ + }, { + token : "paren.start", + regex : /#{/, + push : "start" + }, { + token : "string.end", + regex : /"/, + next : "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/ + }, { + token : "paren.start", + regex : /#{/, + push : "start" + }, { + token : "string.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : /'/, + push : [{ + token : "constant.language.escape", + regex : /\\['\\]/ + }, { + token : "string.end", + regex : /'/, + next : "pop" + }, { + defaultToken: "string" + }] + }], + + { + token : "text", // namespaces aren't symbols + regex : "::" + }, { + token : "variable.instance", // instance variable + regex : "@{1,2}[a-zA-Z_\\d]+" + }, { + token : "support.class", // class name + regex : "[A-Z][a-zA-Z_\\d]+" + }, + + constantOtherSymbol, + constantNumericHex, + constantNumericFloat, + + { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "punctuation.separator.key-value", + regex : "=>" + }, { + stateName: "heredoc", + onMatch : function(value, currentState, stack) { + var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; + var tokens = value.split(this.splitRegex); + stack.push(next, tokens[3]); + return [ + {type:"constant", value: tokens[1]}, + {type:"string", value: tokens[2]}, + {type:"support.class", value: tokens[3]}, + {type:"string", value: tokens[4]} + ]; + }, + regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", + rules: { + heredoc: [{ + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^ +" + }, { + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }] + } + }, { + regex : "$", + token : "empty", + next : function(currentState, stack) { + if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") + return stack[0]; + return currentState; + } + }, { + token : "string.character", + regex : "\\B\\?." + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "^=end(?:$|\\s.*$)", + next : "start" + }, { + token : "comment", // comment spanning whole line + regex : ".+" + } + ] + }; + + this.normalizeRules(); +}; + +oop.inherits(RubyHighlightRules, TextHighlightRules); + +exports.RubyHighlightRules = RubyHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = RubyHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/); + var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/); + var startingConditional = line.match(/^\s*(if|else|when)\s*/) + if (match || startingClassOrMethod || startingDoBlock || startingConditional) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return /^\s+(end|else)$/.test(line + input) || this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, session, row) { + var line = session.getLine(row); + if (/}/.test(line)) + return this.$outdent.autoOutdent(session, row); + var indent = this.$getIndent(line); + var prevLine = session.getLine(row - 1); + var prevIndent = this.$getIndent(prevLine); + var tab = session.getTabString(); + if (prevIndent.length <= indent.length) { + if (indent.slice(-tab.length) == tab) + session.remove(new Range(row, indent.length-tab.length, row, indent.length)); + } + }; + + this.$id = "ace/mode/ruby"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/ejs",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/javascript_highlight_rules","ace/lib/oop","ace/mode/html","ace/mode/javascript","ace/mode/css","ace/mode/ruby"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; + +var EjsHighlightRules = function(start, end) { + HtmlHighlightRules.call(this); + + if (!start) + start = "(?:<%|<\\?|{{)"; + if (!end) + end = "(?:%>|\\?>|}})"; + + for (var i in this.$rules) { + this.$rules[i].unshift({ + token : "markup.list.meta.tag", + regex : start + "(?![>}])[-=]?", + push : "ejs-start" + }); + } + + this.embedRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "ejs-", [{ + token : "markup.list.meta.tag", + regex : "-?" + end, + next : "pop" + }, { + token: "comment", + regex: "//.*?" + end, + next: "pop" + }]); + + this.normalizeRules(); +}; + + +oop.inherits(EjsHighlightRules, HtmlHighlightRules); + +exports.EjsHighlightRules = EjsHighlightRules; + + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var RubyMode = require("./ruby").Mode; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = EjsHighlightRules; + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode, + "ejs-": JavaScriptMode + }); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + + this.$id = "ace/mode/ejs"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-elixir.js b/htdocs/includes/ace/mode-elixir.js new file mode 100644 index 00000000000..d8931b98bd6 --- /dev/null +++ b/htdocs/includes/ace/mode-elixir.js @@ -0,0 +1,494 @@ +ace.define("ace/mode/elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ElixirHighlightRules = function() { + + this.$rules = { start: + [ { token: + [ 'meta.module.elixir', + 'keyword.control.module.elixir', + 'meta.module.elixir', + 'entity.name.type.module.elixir' ], + regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' }, + { token: 'comment.documentation.heredoc', + regex: '@(?:module|type)?doc (?:~[a-z])?"""', + push: + [ { token: 'comment.documentation.heredoc', + regex: '\\s*"""', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'comment.documentation.heredoc' } ], + comment: '@doc with heredocs is treated as documentation' }, + { token: 'comment.documentation.heredoc', + regex: '@(?:module|type)?doc ~[A-Z]"""', + push: + [ { token: 'comment.documentation.heredoc', + regex: '\\s*"""', + next: 'pop' }, + { defaultToken: 'comment.documentation.heredoc' } ], + comment: '@doc with heredocs is treated as documentation' }, + { token: 'comment.documentation.heredoc', + regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'', + push: + [ { token: 'comment.documentation.heredoc', + regex: '\\s*\'\'\'', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'comment.documentation.heredoc' } ], + comment: '@doc with heredocs is treated as documentation' }, + { token: 'comment.documentation.heredoc', + regex: '@(?:module|type)?doc ~[A-Z]\'\'\'', + push: + [ { token: 'comment.documentation.heredoc', + regex: '\\s*\'\'\'', + next: 'pop' }, + { defaultToken: 'comment.documentation.heredoc' } ], + comment: '@doc with heredocs is treated as documentation' }, + { token: 'comment.documentation.false', + regex: '@(?:module|type)?doc false', + comment: '@doc false is treated as documentation' }, + { token: 'comment.documentation.string', + regex: '@(?:module|type)?doc "', + push: + [ { token: 'comment.documentation.string', + regex: '"', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'comment.documentation.string' } ], + comment: '@doc with string is treated as documentation' }, + { token: 'keyword.control.elixir', + regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' }, + { token: 'punctuation.definition.constant.elixir', + regex: ':\'', + push: + [ { token: 'punctuation.definition.constant.elixir', + regex: '\'', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'constant.other.symbol.single-quoted.elixir' } ] }, + { token: 'punctuation.definition.constant.elixir', + regex: ':"', + push: + [ { token: 'punctuation.definition.constant.elixir', + regex: '"', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'constant.other.symbol.double-quoted.elixir' } ] }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '(?:\'\'\')', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?>\'\'\')', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '^\\s*\'\'\'', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' } ], + comment: 'Single-quoted heredocs' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\'', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'support.function.variable.quoted.single.elixir' } ], + comment: 'single quoted string (allows for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '(?:""")', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?>""")', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '^\\s*"""', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.quoted.double.heredoc.elixir' } ], + comment: 'Double-quoted heredocs' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '"', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.quoted.double.elixir' } ], + comment: 'double quoted string (allows for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z](?:""")', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '~[a-z](?>""")', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '^\\s*"""', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.quoted.double.heredoc.elixir' } ], + comment: 'Double-quoted heredocs sigils' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z]\\{', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\}[a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z]\\[', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\][a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z]\\<', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\>[a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z]\\(', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\)[a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z][^\\w]', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '[^\\w][a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z](?:""")', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '~[A-Z](?>""")', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '^\\s*"""', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'Double-quoted heredocs sigils' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z]\\{', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\}[a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z]\\[', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\][a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z]\\<', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\>[a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z]\\(', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\)[a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z][^\\w]', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '[^\\w][a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'], + regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)', + comment: 'symbols' }, + { token: 'punctuation.definition.constant.elixir', + regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)', + comment: 'symbols' }, + { token: + [ 'punctuation.definition.comment.elixir', + 'comment.line.number-sign.elixir' ], + regex: '(#)(.*)' }, + { token: 'constant.numeric.elixir', + regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?=?' }, + { token: 'keyword.operator.bitwise.elixir', + regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' }, + { token: 'keyword.operator.logical.elixir', + regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b', + originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' }, + { token: 'keyword.operator.arithmetic.elixir', + regex: '\\*|\\+|\\-|/' }, + { token: 'keyword.operator.other.elixir', + regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' }, + { token: 'keyword.operator.assignment.elixir', regex: '=' }, + { token: 'punctuation.separator.other.elixir', regex: ':' }, + { token: 'punctuation.separator.statement.elixir', + regex: '\\;' }, + { token: 'punctuation.separator.object.elixir', regex: ',' }, + { token: 'punctuation.separator.method.elixir', regex: '\\.' }, + { token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' }, + { token: 'punctuation.section.array.elixir', regex: '\\[|\\]' }, + { token: 'punctuation.section.function.elixir', + regex: '\\(|\\)' } ], + '#escaped_char': + [ { token: 'constant.character.escape.elixir', + regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' } ], + '#interpolated_elixir': + [ { token: + [ 'source.elixir.embedded.source', + 'source.elixir.embedded.source.empty' ], + regex: '(#\\{)(\\})' }, + { todo: + { token: 'punctuation.section.embedded.elixir', + regex: '#\\{', + push: + [ { token: 'punctuation.section.embedded.elixir', + regex: '\\}', + next: 'pop' }, + { include: '#nest_curly_and_self' }, + { include: '$self' }, + { defaultToken: 'source.elixir.embedded.source' } ] } } ], + '#nest_curly_and_self': + [ { token: 'punctuation.section.scope.elixir', + regex: '\\{', + push: + [ { token: 'punctuation.section.scope.elixir', + regex: '\\}', + next: 'pop' }, + { include: '#nest_curly_and_self' } ] }, + { include: '$self' } ], + '#regex_sub': + [ { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { token: + [ 'punctuation.definition.arbitrary-repitition.elixir', + 'string.regexp.arbitrary-repitition.elixir', + 'string.regexp.arbitrary-repitition.elixir', + 'punctuation.definition.arbitrary-repitition.elixir' ], + regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' }, + { token: 'punctuation.definition.character-class.elixir', + regex: '\\[(?:\\^?\\])?', + push: + [ { token: 'punctuation.definition.character-class.elixir', + regex: '\\]', + next: 'pop' }, + { include: '#escaped_char' }, + { defaultToken: 'string.regexp.character-class.elixir' } ] }, + { token: 'punctuation.definition.group.elixir', + regex: '\\(', + push: + [ { token: 'punctuation.definition.group.elixir', + regex: '\\)', + next: 'pop' }, + { include: '#regex_sub' }, + { defaultToken: 'string.regexp.group.elixir' } ] }, + { token: + [ 'punctuation.definition.comment.elixir', + 'comment.line.number-sign.elixir' ], + regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)', + originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$', + comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' } ] } + + this.normalizeRules(); +}; + +ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.', + fileTypes: [ 'ex', 'exs' ], + firstLineMatch: '^#!/.*\\belixir', + foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$', + foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)', + keyEquivalent: '^~E', + name: 'Elixir', + scopeName: 'source.elixir' } + + +oop.inherits(ElixirHighlightRules, TextHighlightRules); + +exports.ElixirHighlightRules = ElixirHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/elixir",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elixir_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = ElixirHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "#"; + this.$id = "ace/mode/elixir" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-elm.js b/htdocs/includes/ace/mode-elm.js new file mode 100644 index 00000000000..24406af9158 --- /dev/null +++ b/htdocs/includes/ace/mode-elm.js @@ -0,0 +1,299 @@ +ace.define("ace/mode/elm_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ElmHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "keyword": "as|case|class|data|default|deriving|do|else|export|foreign|" + + "hiding|jsevent|if|import|in|infix|infixl|infixr|instance|let|" + + "module|newtype|of|open|then|type|where|_|port|\u03BB" + }, "identifier"); + + var escapeRe = /\\(\d+|['"\\&trnbvf])/; + + var smallRe = /[a-z_]/.source; + var largeRe = /[A-Z]/.source; + var idRe = /[a-z_A-Z0-9']/.source; + + this.$rules = { + start: [{ + token: "string.start", + regex: '"', + next: "string" + }, { + token: "string.character", + regex: "'(?:" + escapeRe.source + "|.)'?" + }, { + regex: /0(?:[xX][0-9A-Fa-f]+|[oO][0-7]+)|\d+(\.\d+)?([eE][-+]?\d*)?/, + token: "constant.numeric" + }, { + token: "comment", + regex: "--.*" + }, { + token : "keyword", + regex : /\.\.|\||:|=|\\|"|->|<-|\u2192/ + }, { + token : "keyword.operator", + regex : /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]+/ + }, { + token : "operator.punctuation", + regex : /[,;`]/ + }, { + regex : largeRe + idRe + "+\\.?", + token : function(value) { + if (value[value.length - 1] == ".") + return "entity.name.function"; + return "constant.language"; + } + }, { + regex : "^" + smallRe + idRe + "+", + token : function(value) { + return "constant.language"; + } + }, { + token : keywordMapper, + regex : "[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b" + }, { + regex: "{-#?", + token: "comment.start", + onMatch: function(value, currentState, stack) { + this.next = value.length == 2 ? "blockComment" : "docComment"; + return this.token; + } + }, { + token: "variable.language", + regex: /\[markdown\|/, + next: "markdown" + }, { + token: "paren.lparen", + regex: /[\[({]/ + }, { + token: "paren.rparen", + regex: /[\])}]/ + } ], + markdown: [{ + regex: /\|\]/, + next: "start" + }, { + defaultToken : "string" + }], + blockComment: [{ + regex: "{-", + token: "comment.start", + push: "blockComment" + }, { + regex: "-}", + token: "comment.end", + next: "pop" + }, { + defaultToken: "comment" + }], + docComment: [{ + regex: "{-", + token: "comment.start", + push: "docComment" + }, { + regex: "-}", + token: "comment.end", + next: "pop" + }, { + defaultToken: "doc.comment" + }], + string: [{ + token: "constant.language.escape", + regex: escapeRe + }, { + token: "text", + regex: /\\(\s|$)/, + next: "stringGap" + }, { + token: "string.end", + regex: '"', + next: "start" + }, { + defaultToken: "string" + }], + stringGap: [{ + token: "text", + regex: /\\/, + next: "string" + }, { + token: "error", + regex: "", + next: "start" + }] + }; + + this.normalizeRules(); +}; + +oop.inherits(ElmHighlightRules, TextHighlightRules); + +exports.ElmHighlightRules = ElmHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/elm",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elm_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HighlightRules = require("./elm_highlight_rules").ElmHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = HighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = {start: "{-", end: "-}", nestable: true}; + this.$id = "ace/mode/elm"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-erlang.js b/htdocs/includes/ace/mode-erlang.js new file mode 100644 index 00000000000..3554bf7e3ae --- /dev/null +++ b/htdocs/includes/ace/mode-erlang.js @@ -0,0 +1,1002 @@ +ace.define("ace/mode/erlang_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ErlangHighlightRules = function() { + + this.$rules = { start: + [ { include: '#module-directive' }, + { include: '#import-export-directive' }, + { include: '#behaviour-directive' }, + { include: '#record-directive' }, + { include: '#define-directive' }, + { include: '#macro-directive' }, + { include: '#directive' }, + { include: '#function' }, + { include: '#everything-else' } ], + '#atom': + [ { token: 'punctuation.definition.symbol.begin.erlang', + regex: '\'', + push: + [ { token: 'punctuation.definition.symbol.end.erlang', + regex: '\'', + next: 'pop' }, + { token: + [ 'punctuation.definition.escape.erlang', + 'constant.other.symbol.escape.erlang', + 'punctuation.definition.escape.erlang', + 'constant.other.symbol.escape.erlang', + 'constant.other.symbol.escape.erlang' ], + regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, + { token: 'invalid.illegal.atom.erlang', regex: '\\\\\\^?.?' }, + { defaultToken: 'constant.other.symbol.quoted.single.erlang' } ] }, + { token: 'constant.other.symbol.unquoted.erlang', + regex: '[a-z][a-zA-Z\\d@_]*' } ], + '#behaviour-directive': + [ { token: + [ 'meta.directive.behaviour.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.behaviour.erlang', + 'keyword.control.directive.behaviour.erlang', + 'meta.directive.behaviour.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.behaviour.erlang', + 'entity.name.type.class.behaviour.definition.erlang', + 'meta.directive.behaviour.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.behaviour.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(behaviour)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' } ], + '#binary': + [ { token: 'punctuation.definition.binary.begin.erlang', + regex: '<<', + push: + [ { token: 'punctuation.definition.binary.end.erlang', + regex: '>>', + next: 'pop' }, + { token: + [ 'punctuation.separator.binary.erlang', + 'punctuation.separator.value-size.erlang' ], + regex: '(,)|(:)' }, + { include: '#internal-type-specifiers' }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.binary.erlang' } ] } ], + '#character': + [ { token: + [ 'punctuation.definition.character.erlang', + 'punctuation.definition.escape.erlang', + 'constant.character.escape.erlang', + 'punctuation.definition.escape.erlang', + 'constant.character.escape.erlang', + 'constant.character.escape.erlang' ], + regex: '(\\$)(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, + { token: 'invalid.illegal.character.erlang', + regex: '\\$\\\\\\^?.?' }, + { token: + [ 'punctuation.definition.character.erlang', + 'constant.character.erlang' ], + regex: '(\\$)(\\S)' }, + { token: 'invalid.illegal.character.erlang', regex: '\\$.?' } ], + '#comment': + [ { token: 'punctuation.definition.comment.erlang', + regex: '%.*$', + push_: + [ { token: 'comment.line.percentage.erlang', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.percentage.erlang' } ] } ], + '#define-directive': + [ { token: + [ 'meta.directive.define.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.define.erlang', + 'keyword.control.directive.define.erlang', + 'meta.directive.define.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.define.erlang', + 'entity.name.function.macro.definition.erlang', + 'meta.directive.define.erlang', + 'punctuation.separator.parameters.erlang' ], + regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(,)', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.define.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\))(\\s*)(\\.)', + next: 'pop' }, + { include: '#everything-else' }, + { defaultToken: 'meta.directive.define.erlang' } ] }, + { token: 'meta.directive.define.erlang', + regex: '(?=^\\s*-\\s*define\\s*\\(\\s*[a-zA-Z\\d@_]+\\s*\\()', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.define.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\))(\\s*)(\\.)', + next: 'pop' }, + { token: + [ 'text', + 'punctuation.section.directive.begin.erlang', + 'text', + 'keyword.control.directive.define.erlang', + 'text', + 'punctuation.definition.parameters.begin.erlang', + 'text', + 'entity.name.function.macro.definition.erlang', + 'text', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\()', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'text', + 'punctuation.separator.parameters.erlang' ], + regex: '(\\))(\\s*)(,)', + next: 'pop' }, + { token: 'punctuation.separator.parameters.erlang', regex: ',' }, + { include: '#everything-else' } ] }, + { token: 'punctuation.separator.define.erlang', + regex: '\\|\\||\\||:|;|,|\\.|->' }, + { include: '#everything-else' }, + { defaultToken: 'meta.directive.define.erlang' } ] } ], + '#directive': + [ { token: + [ 'meta.directive.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.erlang', + 'keyword.control.directive.erlang', + 'meta.directive.erlang', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\(?)', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\)?)(\\s*)(\\.)', + next: 'pop' }, + { include: '#everything-else' }, + { defaultToken: 'meta.directive.erlang' } ] }, + { token: + [ 'meta.directive.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.erlang', + 'keyword.control.directive.erlang', + 'meta.directive.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\.)' } ], + '#everything-else': + [ { include: '#comment' }, + { include: '#record-usage' }, + { include: '#macro-usage' }, + { include: '#expression' }, + { include: '#keyword' }, + { include: '#textual-operator' }, + { include: '#function-call' }, + { include: '#tuple' }, + { include: '#list' }, + { include: '#binary' }, + { include: '#parenthesized-expression' }, + { include: '#character' }, + { include: '#number' }, + { include: '#atom' }, + { include: '#string' }, + { include: '#symbolic-operator' }, + { include: '#variable' } ], + '#expression': + [ { token: 'keyword.control.if.erlang', + regex: '\\bif\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.if.erlang' } ] }, + { token: 'keyword.control.case.erlang', + regex: '\\bcase\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.case.erlang' } ] }, + { token: 'keyword.control.receive.erlang', + regex: '\\breceive\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.receive.erlang' } ] }, + { token: + [ 'keyword.control.fun.erlang', + 'text', + 'entity.name.type.class.module.erlang', + 'text', + 'punctuation.separator.module-function.erlang', + 'text', + 'entity.name.function.erlang', + 'text', + 'punctuation.separator.function-arity.erlang' ], + regex: '\\b(fun)(\\s*)(?:([a-z][a-zA-Z\\d@_]*)(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*)(\\s*)(/)' }, + { token: 'keyword.control.fun.erlang', + regex: '\\bfun\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { token: 'text', + regex: '(?=\\()', + push: + [ { token: 'punctuation.separator.clauses.erlang', + regex: ';|(?=\\bend\\b)', + next: 'pop' }, + { include: '#internal-function-parts' } ] }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.fun.erlang' } ] }, + { token: 'keyword.control.try.erlang', + regex: '\\btry\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.try.erlang' } ] }, + { token: 'keyword.control.begin.erlang', + regex: '\\bbegin\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#internal-expression-punctuation' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.begin.erlang' } ] }, + { token: 'keyword.control.query.erlang', + regex: '\\bquery\\b', + push: + [ { token: 'keyword.control.end.erlang', + regex: '\\bend\\b', + next: 'pop' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.query.erlang' } ] } ], + '#function': + [ { token: + [ 'meta.function.erlang', + 'entity.name.function.definition.erlang', + 'meta.function.erlang' ], + regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()', + push: + [ { token: 'punctuation.terminator.function.erlang', + regex: '\\.', + next: 'pop' }, + { token: [ 'text', 'entity.name.function.erlang', 'text' ], + regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()' }, + { token: 'text', + regex: '(?=\\()', + push: + [ { token: 'punctuation.separator.clauses.erlang', + regex: ';|(?=\\.)', + next: 'pop' }, + { include: '#parenthesized-expression' }, + { include: '#internal-function-parts' } ] }, + { include: '#everything-else' }, + { defaultToken: 'meta.function.erlang' } ] } ], + '#function-call': + [ { token: 'meta.function-call.erlang', + regex: '(?=(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*(?:\\(|:\\s*(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*\\())', + push: + [ { token: 'punctuation.definition.parameters.end.erlang', + regex: '\\)', + next: 'pop' }, + { token: + [ 'entity.name.type.class.module.erlang', + 'text', + 'punctuation.separator.module-function.erlang', + 'text', + 'entity.name.function.guard.erlang', + 'text', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '(?:(erlang)(\\s*)(:)(\\s*))?(is_atom|is_binary|is_constant|is_float|is_function|is_integer|is_list|is_number|is_pid|is_port|is_reference|is_tuple|is_record|abs|element|hd|length|node|round|self|size|tl|trunc)(\\s*)(\\()', + push: + [ { token: 'text', regex: '(?=\\))', next: 'pop' }, + { token: 'punctuation.separator.parameters.erlang', regex: ',' }, + { include: '#everything-else' } ] }, + { token: + [ 'entity.name.type.class.module.erlang', + 'text', + 'punctuation.separator.module-function.erlang', + 'text', + 'entity.name.function.erlang', + 'text', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\()', + push: + [ { token: 'text', regex: '(?=\\))', next: 'pop' }, + { token: 'punctuation.separator.parameters.erlang', regex: ',' }, + { include: '#everything-else' } ] }, + { defaultToken: 'meta.function-call.erlang' } ] } ], + '#import-export-directive': + [ { token: + [ 'meta.directive.import.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.import.erlang', + 'keyword.control.directive.import.erlang', + 'meta.directive.import.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.import.erlang', + 'entity.name.type.class.module.erlang', + 'meta.directive.import.erlang', + 'punctuation.separator.parameters.erlang' ], + regex: '^(\\s*)(-)(\\s*)(import)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.import.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\))(\\s*)(\\.)', + next: 'pop' }, + { include: '#internal-function-list' }, + { defaultToken: 'meta.directive.import.erlang' } ] }, + { token: + [ 'meta.directive.export.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.export.erlang', + 'keyword.control.directive.export.erlang', + 'meta.directive.export.erlang', + 'punctuation.definition.parameters.begin.erlang' ], + regex: '^(\\s*)(-)(\\s*)(export)(\\s*)(\\()', + push: + [ { token: + [ 'punctuation.definition.parameters.end.erlang', + 'meta.directive.export.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\))(\\s*)(\\.)', + next: 'pop' }, + { include: '#internal-function-list' }, + { defaultToken: 'meta.directive.export.erlang' } ] } ], + '#internal-expression-punctuation': + [ { token: + [ 'punctuation.separator.clause-head-body.erlang', + 'punctuation.separator.clauses.erlang', + 'punctuation.separator.expressions.erlang' ], + regex: '(->)|(;)|(,)' } ], + '#internal-function-list': + [ { token: 'punctuation.definition.list.begin.erlang', + regex: '\\[', + push: + [ { token: 'punctuation.definition.list.end.erlang', + regex: '\\]', + next: 'pop' }, + { token: + [ 'entity.name.function.erlang', + 'text', + 'punctuation.separator.function-arity.erlang' ], + regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(/)', + push: + [ { token: 'punctuation.separator.list.erlang', + regex: ',|(?=\\])', + next: 'pop' }, + { include: '#everything-else' } ] }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.list.function.erlang' } ] } ], + '#internal-function-parts': + [ { token: 'text', + regex: '(?=\\()', + push: + [ { token: 'punctuation.separator.clause-head-body.erlang', + regex: '->', + next: 'pop' }, + { token: 'punctuation.definition.parameters.begin.erlang', + regex: '\\(', + push: + [ { token: 'punctuation.definition.parameters.end.erlang', + regex: '\\)', + next: 'pop' }, + { token: 'punctuation.separator.parameters.erlang', regex: ',' }, + { include: '#everything-else' } ] }, + { token: 'punctuation.separator.guards.erlang', regex: ',|;' }, + { include: '#everything-else' } ] }, + { token: 'punctuation.separator.expressions.erlang', + regex: ',' }, + { include: '#everything-else' } ], + '#internal-record-body': + [ { token: 'punctuation.definition.class.record.begin.erlang', + regex: '\\{', + push: + [ { token: 'meta.structure.record.erlang', + regex: '(?=\\})', + next: 'pop' }, + { token: + [ 'variable.other.field.erlang', + 'variable.language.omitted.field.erlang', + 'text', + 'keyword.operator.assignment.erlang' ], + regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')|(_))(\\s*)(=|::)', + push: + [ { token: 'punctuation.separator.class.record.erlang', + regex: ',|(?=\\})', + next: 'pop' }, + { include: '#everything-else' } ] }, + { token: + [ 'variable.other.field.erlang', + 'text', + 'punctuation.separator.class.record.erlang' ], + regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)((?:,)?)' }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.record.erlang' } ] } ], + '#internal-type-specifiers': + [ { token: 'punctuation.separator.value-type.erlang', + regex: '/', + push: + [ { token: 'text', regex: '(?=,|:|>>)', next: 'pop' }, + { token: + [ 'storage.type.erlang', + 'storage.modifier.signedness.erlang', + 'storage.modifier.endianness.erlang', + 'storage.modifier.unit.erlang', + 'punctuation.separator.type-specifiers.erlang' ], + regex: '(integer|float|binary|bytes|bitstring|bits)|(signed|unsigned)|(big|little|native)|(unit)|(-)' } ] } ], + '#keyword': + [ { token: 'keyword.control.erlang', + regex: '\\b(?:after|begin|case|catch|cond|end|fun|if|let|of|query|try|receive|when)\\b' } ], + '#list': + [ { token: 'punctuation.definition.list.begin.erlang', + regex: '\\[', + push: + [ { token: 'punctuation.definition.list.end.erlang', + regex: '\\]', + next: 'pop' }, + { token: 'punctuation.separator.list.erlang', + regex: '\\||\\|\\||,' }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.list.erlang' } ] } ], + '#macro-directive': + [ { token: + [ 'meta.directive.ifdef.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.ifdef.erlang', + 'keyword.control.directive.ifdef.erlang', + 'meta.directive.ifdef.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.ifdef.erlang', + 'entity.name.function.macro.erlang', + 'meta.directive.ifdef.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.ifdef.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(ifdef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }, + { token: + [ 'meta.directive.ifndef.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.ifndef.erlang', + 'keyword.control.directive.ifndef.erlang', + 'meta.directive.ifndef.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.ifndef.erlang', + 'entity.name.function.macro.erlang', + 'meta.directive.ifndef.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.ifndef.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(ifndef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }, + { token: + [ 'meta.directive.undef.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.undef.erlang', + 'keyword.control.directive.undef.erlang', + 'meta.directive.undef.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.undef.erlang', + 'entity.name.function.macro.erlang', + 'meta.directive.undef.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.undef.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(undef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' } ], + '#macro-usage': + [ { token: + [ 'keyword.operator.macro.erlang', + 'meta.macro-usage.erlang', + 'entity.name.function.macro.erlang' ], + regex: '(\\?\\??)(\\s*)([a-zA-Z\\d@_]+)' } ], + '#module-directive': + [ { token: + [ 'meta.directive.module.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.module.erlang', + 'keyword.control.directive.module.erlang', + 'meta.directive.module.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.module.erlang', + 'entity.name.type.class.module.definition.erlang', + 'meta.directive.module.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.module.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '^(\\s*)(-)(\\s*)(module)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' } ], + '#number': + [ { token: 'text', + regex: '(?=\\d)', + push: + [ { token: 'text', regex: '(?!\\d)', next: 'pop' }, + { token: + [ 'constant.numeric.float.erlang', + 'punctuation.separator.integer-float.erlang', + 'constant.numeric.float.erlang', + 'punctuation.separator.float-exponent.erlang' ], + regex: '(\\d+)(\\.)(\\d+)((?:[eE][\\+\\-]?\\d+)?)' }, + { token: + [ 'constant.numeric.integer.binary.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.binary.erlang' ], + regex: '(2)(#)([0-1]+)' }, + { token: + [ 'constant.numeric.integer.base-3.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-3.erlang' ], + regex: '(3)(#)([0-2]+)' }, + { token: + [ 'constant.numeric.integer.base-4.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-4.erlang' ], + regex: '(4)(#)([0-3]+)' }, + { token: + [ 'constant.numeric.integer.base-5.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-5.erlang' ], + regex: '(5)(#)([0-4]+)' }, + { token: + [ 'constant.numeric.integer.base-6.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-6.erlang' ], + regex: '(6)(#)([0-5]+)' }, + { token: + [ 'constant.numeric.integer.base-7.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-7.erlang' ], + regex: '(7)(#)([0-6]+)' }, + { token: + [ 'constant.numeric.integer.octal.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.octal.erlang' ], + regex: '(8)(#)([0-7]+)' }, + { token: + [ 'constant.numeric.integer.base-9.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-9.erlang' ], + regex: '(9)(#)([0-8]+)' }, + { token: + [ 'constant.numeric.integer.decimal.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.decimal.erlang' ], + regex: '(10)(#)(\\d+)' }, + { token: + [ 'constant.numeric.integer.base-11.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-11.erlang' ], + regex: '(11)(#)([\\daA]+)' }, + { token: + [ 'constant.numeric.integer.base-12.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-12.erlang' ], + regex: '(12)(#)([\\da-bA-B]+)' }, + { token: + [ 'constant.numeric.integer.base-13.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-13.erlang' ], + regex: '(13)(#)([\\da-cA-C]+)' }, + { token: + [ 'constant.numeric.integer.base-14.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-14.erlang' ], + regex: '(14)(#)([\\da-dA-D]+)' }, + { token: + [ 'constant.numeric.integer.base-15.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-15.erlang' ], + regex: '(15)(#)([\\da-eA-E]+)' }, + { token: + [ 'constant.numeric.integer.hexadecimal.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.hexadecimal.erlang' ], + regex: '(16)(#)([\\da-fA-F]+)' }, + { token: + [ 'constant.numeric.integer.base-17.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-17.erlang' ], + regex: '(17)(#)([\\da-gA-G]+)' }, + { token: + [ 'constant.numeric.integer.base-18.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-18.erlang' ], + regex: '(18)(#)([\\da-hA-H]+)' }, + { token: + [ 'constant.numeric.integer.base-19.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-19.erlang' ], + regex: '(19)(#)([\\da-iA-I]+)' }, + { token: + [ 'constant.numeric.integer.base-20.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-20.erlang' ], + regex: '(20)(#)([\\da-jA-J]+)' }, + { token: + [ 'constant.numeric.integer.base-21.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-21.erlang' ], + regex: '(21)(#)([\\da-kA-K]+)' }, + { token: + [ 'constant.numeric.integer.base-22.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-22.erlang' ], + regex: '(22)(#)([\\da-lA-L]+)' }, + { token: + [ 'constant.numeric.integer.base-23.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-23.erlang' ], + regex: '(23)(#)([\\da-mA-M]+)' }, + { token: + [ 'constant.numeric.integer.base-24.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-24.erlang' ], + regex: '(24)(#)([\\da-nA-N]+)' }, + { token: + [ 'constant.numeric.integer.base-25.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-25.erlang' ], + regex: '(25)(#)([\\da-oA-O]+)' }, + { token: + [ 'constant.numeric.integer.base-26.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-26.erlang' ], + regex: '(26)(#)([\\da-pA-P]+)' }, + { token: + [ 'constant.numeric.integer.base-27.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-27.erlang' ], + regex: '(27)(#)([\\da-qA-Q]+)' }, + { token: + [ 'constant.numeric.integer.base-28.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-28.erlang' ], + regex: '(28)(#)([\\da-rA-R]+)' }, + { token: + [ 'constant.numeric.integer.base-29.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-29.erlang' ], + regex: '(29)(#)([\\da-sA-S]+)' }, + { token: + [ 'constant.numeric.integer.base-30.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-30.erlang' ], + regex: '(30)(#)([\\da-tA-T]+)' }, + { token: + [ 'constant.numeric.integer.base-31.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-31.erlang' ], + regex: '(31)(#)([\\da-uA-U]+)' }, + { token: + [ 'constant.numeric.integer.base-32.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-32.erlang' ], + regex: '(32)(#)([\\da-vA-V]+)' }, + { token: + [ 'constant.numeric.integer.base-33.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-33.erlang' ], + regex: '(33)(#)([\\da-wA-W]+)' }, + { token: + [ 'constant.numeric.integer.base-34.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-34.erlang' ], + regex: '(34)(#)([\\da-xA-X]+)' }, + { token: + [ 'constant.numeric.integer.base-35.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-35.erlang' ], + regex: '(35)(#)([\\da-yA-Y]+)' }, + { token: + [ 'constant.numeric.integer.base-36.erlang', + 'punctuation.separator.base-integer.erlang', + 'constant.numeric.integer.base-36.erlang' ], + regex: '(36)(#)([\\da-zA-Z]+)' }, + { token: 'invalid.illegal.integer.erlang', + regex: '\\d+#[\\da-zA-Z]+' }, + { token: 'constant.numeric.integer.decimal.erlang', + regex: '\\d+' } ] } ], + '#parenthesized-expression': + [ { token: 'punctuation.section.expression.begin.erlang', + regex: '\\(', + push: + [ { token: 'punctuation.section.expression.end.erlang', + regex: '\\)', + next: 'pop' }, + { include: '#everything-else' }, + { defaultToken: 'meta.expression.parenthesized' } ] } ], + '#record-directive': + [ { token: + [ 'meta.directive.record.erlang', + 'punctuation.section.directive.begin.erlang', + 'meta.directive.record.erlang', + 'keyword.control.directive.import.erlang', + 'meta.directive.record.erlang', + 'punctuation.definition.parameters.begin.erlang', + 'meta.directive.record.erlang', + 'entity.name.type.class.record.definition.erlang', + 'meta.directive.record.erlang', + 'punctuation.separator.parameters.erlang' ], + regex: '^(\\s*)(-)(\\s*)(record)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)', + push: + [ { token: + [ 'punctuation.definition.class.record.end.erlang', + 'meta.directive.record.erlang', + 'punctuation.definition.parameters.end.erlang', + 'meta.directive.record.erlang', + 'punctuation.section.directive.end.erlang' ], + regex: '(\\})(\\s*)(\\))(\\s*)(\\.)', + next: 'pop' }, + { include: '#internal-record-body' }, + { defaultToken: 'meta.directive.record.erlang' } ] } ], + '#record-usage': + [ { token: + [ 'keyword.operator.record.erlang', + 'meta.record-usage.erlang', + 'entity.name.type.class.record.erlang', + 'meta.record-usage.erlang', + 'punctuation.separator.record-field.erlang', + 'meta.record-usage.erlang', + 'variable.other.field.erlang' ], + regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\.)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')' }, + { token: + [ 'keyword.operator.record.erlang', + 'meta.record-usage.erlang', + 'entity.name.type.class.record.erlang' ], + regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')', + push: + [ { token: 'punctuation.definition.class.record.end.erlang', + regex: '\\}', + next: 'pop' }, + { include: '#internal-record-body' }, + { defaultToken: 'meta.record-usage.erlang' } ] } ], + '#string': + [ { token: 'punctuation.definition.string.begin.erlang', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.erlang', + regex: '"', + next: 'pop' }, + { token: + [ 'punctuation.definition.escape.erlang', + 'constant.character.escape.erlang', + 'punctuation.definition.escape.erlang', + 'constant.character.escape.erlang', + 'constant.character.escape.erlang' ], + regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, + { token: 'invalid.illegal.string.erlang', regex: '\\\\\\^?.?' }, + { token: + [ 'punctuation.definition.placeholder.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'constant.other.placeholder.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'constant.other.placeholder.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'constant.other.placeholder.erlang', + 'constant.other.placeholder.erlang' ], + regex: '(~)(?:((?:\\-)?)(\\d+)|(\\*))?(?:(\\.)(?:(\\d+)|(\\*)))?(?:(\\.)(?:(\\*)|(.)))?([~cfegswpWPBX#bx\\+ni])' }, + { token: + [ 'punctuation.definition.placeholder.erlang', + 'punctuation.separator.placeholder-parts.erlang', + 'constant.other.placeholder.erlang', + 'constant.other.placeholder.erlang' ], + regex: '(~)((?:\\*)?)((?:\\d+)?)([~du\\-#fsacl])' }, + { token: 'invalid.illegal.string.erlang', regex: '~.?' }, + { defaultToken: 'string.quoted.double.erlang' } ] } ], + '#symbolic-operator': + [ { token: 'keyword.operator.symbolic.erlang', + regex: '\\+\\+|\\+|--|-|\\*|/=|/|=/=|=:=|==|=<|=|<-|<|>=|>|!|::' } ], + '#textual-operator': + [ { token: 'keyword.operator.textual.erlang', + regex: '\\b(?:andalso|band|and|bxor|xor|bor|orelse|or|bnot|not|bsl|bsr|div|rem)\\b' } ], + '#tuple': + [ { token: 'punctuation.definition.tuple.begin.erlang', + regex: '\\{', + push: + [ { token: 'punctuation.definition.tuple.end.erlang', + regex: '\\}', + next: 'pop' }, + { token: 'punctuation.separator.tuple.erlang', regex: ',' }, + { include: '#everything-else' }, + { defaultToken: 'meta.structure.tuple.erlang' } ] } ], + '#variable': + [ { token: [ 'variable.other.erlang', 'variable.language.omitted.erlang' ], + regex: '(_[a-zA-Z\\d@_]+|[A-Z][a-zA-Z\\d@_]*)|(_)' } ] } + + this.normalizeRules(); +}; + +ErlangHighlightRules.metaData = { comment: 'The recognition of function definitions and compiler directives (such as module, record and macro definitions) requires that each of the aforementioned constructs must be the first string inside a line (except for whitespace). Also, the function/module/record/macro names must be given unquoted. -- desp', + fileTypes: [ 'erl', 'hrl' ], + keyEquivalent: '^~E', + name: 'Erlang', + scopeName: 'source.erlang' } + + +oop.inherits(ErlangHighlightRules, TextHighlightRules); + +exports.ErlangHighlightRules = ErlangHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/erlang",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/erlang_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ErlangHighlightRules = require("./erlang_highlight_rules").ErlangHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = ErlangHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "%"; + this.blockComment = null; + this.$id = "ace/mode/erlang"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-forth.js b/htdocs/includes/ace/mode-forth.js new file mode 100644 index 00000000000..f960fd6af08 --- /dev/null +++ b/htdocs/includes/ace/mode-forth.js @@ -0,0 +1,290 @@ +ace.define("ace/mode/forth_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ForthHighlightRules = function() { + + this.$rules = { start: [ { include: '#forth' } ], + '#comment': + [ { token: 'comment.line.double-dash.forth', + regex: '(?:^|\\s)--\\s.*$', + comment: 'line comments for iForth' }, + { token: 'comment.line.backslash.forth', + regex: '(?:^|\\s)\\\\[\\s\\S]*$', + comment: 'ANSI line comment' }, + { token: 'comment.line.backslash-g.forth', + regex: '(?:^|\\s)\\\\[Gg] .*$', + comment: 'gForth line comment' }, + { token: 'comment.block.forth', + regex: '(?:^|\\s)\\(\\*(?=\\s|$)', + push: + [ { token: 'comment.block.forth', + regex: '(?:^|\\s)\\*\\)(?=\\s|$)', + next: 'pop' }, + { defaultToken: 'comment.block.forth' } ], + comment: 'multiline comments for iForth' }, + { token: 'comment.block.documentation.forth', + regex: '\\bDOC\\b', + caseInsensitive: true, + push: + [ { token: 'comment.block.documentation.forth', + regex: '\\bENDDOC\\b', + caseInsensitive: true, + next: 'pop' }, + { defaultToken: 'comment.block.documentation.forth' } ], + comment: 'documentation comments for iForth' }, + { token: 'comment.line.parentheses.forth', + regex: '(?:^|\\s)\\.?\\( [^)]*\\)', + comment: 'ANSI line comment' } ], + '#constant': + [ { token: 'constant.language.forth', + regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)', + caseInsensitive: true}, + { token: 'constant.numeric.forth', + regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)'}, + { token: 'constant.character.forth', + regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)'}], + '#forth': + [ { include: '#constant' }, + { include: '#comment' }, + { include: '#string' }, + { include: '#word' }, + { include: '#variable' }, + { include: '#storage' }, + { include: '#word-def' } ], + '#storage': + [ { token: 'storage.type.forth', + regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)', + caseInsensitive: true}], + '#string': + [ { token: 'string.quoted.double.forth', + regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")', + caseInsensitive: true}, + { token: 'string.unquoted.forth', + regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)', + caseInsensitive: true}], + '#variable': + [ { token: 'variable.language.forth', + regex: '\\b(?:I|J)\\b', + caseInsensitive: true } ], + '#word': + [ { token: 'keyword.control.immediate.forth', + regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)', + caseInsensitive: true}, + { token: 'keyword.other.immediate.forth', + regex: '(?:^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s|$)', + caseInsensitive: true}, + { token: 'keyword.control.compile-only.forth', + regex: '(?:^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s|$)', + caseInsensitive: true}, + { token: 'keyword.other.compile-only.forth', + regex: '(?:^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s|$)', + caseInsensitive: true}, + { token: 'keyword.other.non-immediate.forth', + regex: '(?:^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s|$)', + caseInsensitive: true}, + { token: 'keyword.other.warning.forth', + regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)', + caseInsensitive: true}], + '#word-def': + [ { token: + [ 'keyword.other.compile-only.forth', + 'keyword.other.compile-only.forth', + 'meta.block.forth', + 'entity.name.function.forth' ], + regex: '(:NONAME)|(^:|\\s:)(\\s)(\\S+)(?=\\s|$)', + caseInsensitive: true, + push: + [ { token: 'keyword.other.compile-only.forth', + regex: ';(?:CODE)?', + caseInsensitive: true, + next: 'pop' }, + { include: '#constant' }, + { include: '#comment' }, + { include: '#string' }, + { include: '#word' }, + { include: '#variable' }, + { include: '#storage' }, + { defaultToken: 'meta.block.forth' } ] } ] } + + this.normalizeRules(); +}; + +ForthHighlightRules.metaData = { fileTypes: [ 'frt', 'fs', 'ldr', 'fth', '4th' ], + foldingStartMarker: '/\\*\\*|\\{\\s*$', + foldingStopMarker: '\\*\\*/|^\\s*\\}', + keyEquivalent: '^~F', + name: 'Forth', + scopeName: 'source.forth' } + + +oop.inherits(ForthHighlightRules, TextHighlightRules); + +exports.ForthHighlightRules = ForthHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/forth",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/forth_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ForthHighlightRules = require("./forth_highlight_rules").ForthHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = ForthHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = null; + this.$id = "ace/mode/forth"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-fortran.js b/htdocs/includes/ace/mode-fortran.js new file mode 100644 index 00000000000..3f2c5bdb407 --- /dev/null +++ b/htdocs/includes/ace/mode-fortran.js @@ -0,0 +1,423 @@ +ace.define("ace/mode/fortran_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var FortranHighlightRules = function() { + + var keywords = ( + "call|case|contains|continue|cycle|do|else|elseif|end|enddo|endif|function|"+ + "if|implicit|in|include|inout|intent|module|none|only|out|print|program|return|"+ + "select|status|stop|subroutine|" + + "return|then|use|while|write|"+ + "CALL|CASE|CONTAINS|CONTINUE|CYCLE|DO|ELSE|ELSEIF|END|ENDDO|ENDIF|FUNCTION|"+ + "IF|IMPLICIT|IN|INCLUDE|INOUT|INTENT|MODULE|NONE|ONLY|OUT|PRINT|PROGRAM|RETURN|"+ + "SELECT|STATUS|STOP|SUBROUTINE|" + + "RETURN|THEN|USE|WHILE|WRITE" + ); + + var keywordOperators = ( + "and|or|not|eq|ne|gt|ge|lt|le|" + + "AND|OR|NOT|EQ|NE|GT|GE|LT|LE" + ); + + var builtinConstants = ( + "true|false|TRUE|FALSE" + ); + + var builtinFunctions = ( + "abs|achar|acos|acosh|adjustl|adjustr|aimag|aint|all|allocate|"+ + "anint|any|asin|asinh|associated|atan|atan2|atanh|"+ + "bessel_j0|bessel_j1|bessel_jn|bessel_y0|bessel_y1|bessel_yn|"+ + "bge|bgt|bit_size|ble|blt|btest|ceiling|char|cmplx|conjg|cos|cosh|"+ + "count|cpu_time|cshift|date_and_time|dble|deallocate|digits|dim|dot_product|dprod|"+ + "dshiftl|dshiftr|dsqrt|eoshift|epsilon|erf|erfc|erfc_scaled|exp|float|floor|"+ + "format|fraction|gamma|input|len|lge|lgt|lle|llt|log|log10|maskl|maskr|matmul|max|maxloc|maxval|"+ + "merge|min|minloc|minval|mod|modulo|nint|not|norm2|null|nullify|pack|parity|popcnt|poppar|"+ + "precision|present|product|radix|random_number|random_seed|range|repeat|reshape|round|"+ + "rrspacing|same_type_as|scale|scan|selected_char_kind|selected_int_kind|selected_real_kind|"+ + "set_exponent|shape|shifta|shiftl|shiftr|sign|sin|sinh|size|sngl|spacing|spread|"+ + "sqrt|sum|system_clock|tan|tanh|tiny|trailz|transfer|transpose|trim|ubound|unpack|verify|" + + "ABS|ACHAR|ACOS|ACOSH|ADJUSTL|ADJUSTR|AIMAG|AINT|ALL|ALLOCATE|"+ + "ANINT|ANY|ASIN|ASINH|ASSOCIATED|ATAN|ATAN2|ATANH|"+ + "BESSEL_J0|BESSEL_J1|BESSEL_JN|BESSEL_Y0|BESSEL_Y1|BESSEL_YN|"+ + "BGE|BGT|BIT_SIZE|BLE|BLT|BTEST|CEILING|CHAR|CMPLX|CONJG|COS|COSH|"+ + "COUNT|CPU_TIME|CSHIFT|DATE_AND_TIME|DBLE|DEALLOCATE|DIGITS|DIM|DOT_PRODUCT|DPROD|"+ + "DSHIFTL|DSHIFTR|DSQRT|EOSHIFT|EPSILON|ERF|ERFC|ERFC_SCALED|EXP|FLOAT|FLOOR|"+ + "FORMAT|FRACTION|GAMMA|INPUT|LEN|LGE|LGT|LLE|LLT|LOG|LOG10|MASKL|MASKR|MATMUL|MAX|MAXLOC|MAXVAL|"+ + "MERGE|MIN|MINLOC|MINVAL|MOD|MODULO|NINT|NOT|NORM2|NULL|NULLIFY|PACK|PARITY|POPCNT|POPPAR|"+ + "PRECISION|PRESENT|PRODUCT|RADIX|RANDOM_NUMBER|RANDOM_SEED|RANGE|REPEAT|RESHAPE|ROUND|"+ + "RRSPACING|SAME_TYPE_AS|SCALE|SCAN|SELECTED_CHAR_KIND|SELECTED_INT_KIND|SELECTED_REAL_KIND|"+ + "SET_EXPONENT|SHAPE|SHIFTA|SHIFTL|SHIFTR|SIGN|SIN|SINH|SIZE|SNGL|SPACING|SPREAD|"+ + "SQRT|SUM|SYSTEM_CLOCK|TAN|TANH|TINY|TRAILZ|TRANSFER|TRANSPOSE|TRIM|UBOUND|UNPACK|VERIFY" + ); + + var storageType = ( + "logical|character|integer|real|type|" + + "LOGICAL|CHARACTER|INTEGER|REAL|TYPE" + ); + + var storageModifiers = ( + "allocatable|dimension|intent|parameter|pointer|target|private|public|" + + "ALLOCATABLE|DIMENSION|INTENT|PARAMETER|POINTER|TARGET|PRIVATE|PUBLIC" + ); + + var keywordMapper = this.createKeywordMapper({ + "invalid.deprecated": "debugger", + "support.function": builtinFunctions, + "constant.language": builtinConstants, + "keyword": keywords, + "keyword.operator": keywordOperators, + "storage.type": storageType, + "storage.modifier" : storageModifiers + }, "identifier"); + + var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; + + var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; + var octInteger = "(?:0[oO]?[0-7]+)"; + var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; + var binInteger = "(?:0[bB][01]+)"; + var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; + + var exponent = "(?:[eE][+-]?\\d+)"; + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + + var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; + + this.$rules = { + "start" : [ { + token : "comment", + regex : "!.*$" + }, { + token : "string", // multi line """ string start + regex : strPre + '"{3}', + next : "qqstring3" + }, { + token : "string", // " string + regex : strPre + '"(?=.)', + next : "qqstring" + }, { + token : "string", // multi line ''' string start + regex : strPre + "'{3}", + next : "qstring3" + }, { + token : "string", // ' string + regex : strPre + "'(?=.)", + next : "qstring" + }, { + token : "constant.numeric", // imaginary + regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // long integer + regex : integer + "[lL]\\b" + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : "keyword", // pre-compiler directives + regex : "#\\s*(?:include|import|define|undef|INCLUDE|IMPORT|DEFINE|UNDEF)\\b" + }, { + token : "keyword", // special case pre-compiler directive + regex : "#\\s*(?:endif|ifdef|else|elseif|ifndef|ENDIF|IFDEF|ELSE|ELSEIF|IFNDEF)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]\\)\\}]" + }, { + token : "text", + regex : "\\s+" + } ], + "qqstring3" : [ { + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", // multi line """ string end + regex : '"{3}', + next : "start" + }, { + defaultToken : "string" + } ], + "qstring3" : [ { + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", // multi line """ string end + regex : '"{3}', + next : "start" + }, { + defaultToken : "string" + } ], + "qqstring" : [{ + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "start" + }, { + defaultToken: "string" + }], + "qstring" : [{ + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", + regex : "\\\\$", + next : "qstring" + }, { + token : "string", + regex : "'|$", + next : "start" + }, { + defaultToken: "string" + }] + }; +}; + +oop.inherits(FortranHighlightRules, TextHighlightRules); + +exports.FortranHighlightRules = FortranHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/fortran",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fortran_highlight_rules","ace/mode/folding/cstyle","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var FortranHighlightRules = require("./fortran_highlight_rules").FortranHighlightRules; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = FortranHighlightRules; + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "!"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + var outdents = { + "return": 1, + "break": 1, + "continue": 1, + "RETURN": 1, + "BREAK": 1, + "CONTINUE": 1 + }; + + this.checkOutdent = function(state, line, input) { + if (input !== "\r\n" && input !== "\r" && input !== "\n") + return false; + + var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + + if (!tokens) + return false; + do { + var last = tokens.pop(); + } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); + + if (!last) + return false; + + return (last.type == "keyword" && outdents[last.value]); + }; + + this.autoOutdent = function(state, doc, row) { + + row += 1; + var indent = this.$getIndent(doc.getLine(row)); + var tab = doc.getTabString(); + if (indent.slice(-tab.length) == tab) + doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); + }; + + this.$id = "ace/mode/fortran"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-ftl.js b/htdocs/includes/ace/mode-ftl.js new file mode 100644 index 00000000000..dbca4fd1928 --- /dev/null +++ b/htdocs/includes/ace/mode-ftl.js @@ -0,0 +1,1182 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/ftl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var FtlLangHighlightRules = function () { + + var stringBuiltIns = "\\?|substring|cap_first|uncap_first|capitalize|chop_linebreak|date|time|datetime|" + + "ends_with|html|groups|index_of|j_string|js_string|json_string|last_index_of|length|lower_case|" + + "left_pad|right_pad|contains|matches|number|replace|rtf|url|split|starts_with|string|trim|" + + "upper_case|word_list|xhtml|xml"; + var numberBuiltIns = "c|round|floor|ceiling"; + var dateBuiltIns = "iso_[a-z_]+"; + var seqBuiltIns = "first|last|seq_contains|seq_index_of|seq_last_index_of|reverse|size|sort|sort_by|chunk"; + var hashBuiltIns = "keys|values"; + var xmlBuiltIns = "children|parent|root|ancestors|node_name|node_type|node_namespace"; + var expertBuiltIns = "byte|double|float|int|long|short|number_to_date|number_to_time|number_to_datetime|" + + "eval|has_content|interpret|is_[a-z_]+|namespacenew"; + var allBuiltIns = stringBuiltIns + numberBuiltIns + dateBuiltIns + seqBuiltIns + hashBuiltIns + + xmlBuiltIns + expertBuiltIns; + + var deprecatedBuiltIns = "default|exists|if_exists|web_safe"; + + var variables = "data_model|error|globals|lang|locale|locals|main|namespace|node|current_node|" + + "now|output_encoding|template_name|url_escaping_charset|vars|version"; + + var operators = "gt|gte|lt|lte|as|in|using"; + + var reserved = "true|false"; + + var attributes = "encoding|parse|locale|number_format|date_format|time_format|datetime_format|time_zone|" + + "url_escaping_charset|classic_compatible|strip_whitespace|strip_text|strict_syntax|ns_prefixes|" + + "attributes"; + + this.$rules = { + "start" : [{ + token : "constant.character.entity", + regex : /&[^;]+;/ + }, { + token : "support.function", + regex : "\\?("+allBuiltIns+")" + }, { + token : "support.function.deprecated", + regex : "\\?("+deprecatedBuiltIns+")" + }, { + token : "language.variable", + regex : "\\.(?:"+variables+")" + }, { + token : "constant.language", + regex : "\\b("+reserved+")\\b" + }, { + token : "keyword.operator", + regex : "\\b(?:"+operators+")\\b" + }, { + token : "entity.other.attribute-name", + regex : attributes + }, { + token : "string", // + regex : /['"]/, + next : "qstring" + }, { + token : function(value) { + if (value.match("^[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?$")) { + return "constant.numeric"; + } else { + return "variable"; + } + }, + regex : /[\w.+\-]+/ + }, { + token : "keyword.operator", + regex : "!|\\.|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + }], + + "qstring" : [{ + token : "constant.character.escape", + regex : '\\\\[nrtvef\\\\"$]' + }, { + token : "string", + regex : /['"]/, + next : "start" + }, { + defaultToken : "string" + }] + }; +}; + +oop.inherits(FtlLangHighlightRules, TextHighlightRules); + +var FtlHighlightRules = function() { + HtmlHighlightRules.call(this); + + var directives = "assign|attempt|break|case|compress|default|elseif|else|escape|fallback|function|flush|" + + "ftl|global|if|import|include|list|local|lt|macro|nested|noescape|noparse|nt|recover|recurse|return|rt|" + + "setting|stop|switch|t|visit"; + + var startRules = [ + { + token : "comment", + regex : "<#--", + next : "ftl-dcomment" + }, { + token : "string.interpolated", + regex : "\\${", + push : "ftl-start" + }, { + token : "keyword.function", + regex : "", + next : "pop" + }, { + token : "string.interpolated", + regex : "}", + next : "pop" + } + ]; + + for (var key in this.$rules) + this.$rules[key].unshift.apply(this.$rules[key], startRules); + + this.embedRules(FtlLangHighlightRules, "ftl-", endRules, ["start"]); + + this.addRules({ + "ftl-dcomment" : [{ + token : "comment", + regex : "-->", + next : "pop" + }, { + defaultToken : "comment" + }] + }); + + this.normalizeRules(); +}; + +oop.inherits(FtlHighlightRules, HtmlHighlightRules); + +exports.FtlHighlightRules = FtlHighlightRules; +}); + +ace.define("ace/mode/ftl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ftl_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var FtlHighlightRules = require("./ftl_highlight_rules").FtlHighlightRules; + +var Mode = function() { + this.HighlightRules = FtlHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.$id = "ace/mode/ftl"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-gcode.js b/htdocs/includes/ace/mode-gcode.js new file mode 100644 index 00000000000..a648426c9ba --- /dev/null +++ b/htdocs/includes/ace/mode-gcode.js @@ -0,0 +1,86 @@ +ace.define("ace/mode/gcode_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { + "use strict"; + + var oop = require("../lib/oop"); + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + + var GcodeHighlightRules = function() { + + var keywords = ( + "IF|DO|WHILE|ENDWHILE|CALL|ENDIF|SUB|ENDSUB|GOTO|REPEAT|ENDREPEAT|CALL" + ); + + var builtinConstants = ( + "PI" + ); + + var builtinFunctions = ( + "ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN" + ); + var keywordMapper = this.createKeywordMapper({ + "support.function": builtinFunctions, + "keyword": keywords, + "constant.language": builtinConstants + }, "identifier", true); + + this.$rules = { + "start" : [ { + token : "comment", + regex : "\\(.*\\)" + }, { + token : "comment", // block number + regex : "([N])([0-9]+)" + }, { + token : "string", // " string + regex : "([G])([0-9]+\\.?[0-9]?)" + }, { + token : "string", // ' string + regex : "([M])([0-9]+\\.?[0-9]?)" + }, { + token : "constant.numeric", // float + regex : "([-+]?([0-9]*\\.?[0-9]+\\.?))|(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)" + }, { + token : keywordMapper, + regex : "[A-Z]" + }, { + token : "keyword.operator", + regex : "EQ|LT|GT|NE|GE|LE|OR|XOR" + }, { + token : "paren.lparen", + regex : "[\\[]" + }, { + token : "paren.rparen", + regex : "[\\]]" + }, { + token : "text", + regex : "\\s+" + } ] + }; + }; + + oop.inherits(GcodeHighlightRules, TextHighlightRules); + + exports.GcodeHighlightRules = GcodeHighlightRules; +}); + +ace.define("ace/mode/gcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gcode_highlight_rules","ace/range"], function(require, exports, module) { + "use strict"; + + var oop = require("../lib/oop"); + var TextMode = require("./text").Mode; + var GcodeHighlightRules = require("./gcode_highlight_rules").GcodeHighlightRules; + var Range = require("../range").Range; + + var Mode = function() { + this.HighlightRules = GcodeHighlightRules; + this.$behaviour = this.$defaultBehaviour; + }; + oop.inherits(Mode, TextMode); + + (function() { + this.$id = "ace/mode/gcode"; + }).call(Mode.prototype); + + exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-gherkin.js b/htdocs/includes/ace/mode-gherkin.js new file mode 100644 index 00000000000..322dbe40058 --- /dev/null +++ b/htdocs/includes/ace/mode-gherkin.js @@ -0,0 +1,163 @@ +ace.define("ace/mode/gherkin_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; + +var GherkinHighlightRules = function() { + var languages = [{ + name: "en", + labels: "Feature|Background|Scenario(?: Outline)?|Examples", + keywords: "Given|When|Then|And|But" + }]; + + var labels = languages.map(function(l) { + return l.labels; + }).join("|"); + var keywords = languages.map(function(l) { + return l.keywords; + }).join("|"); + this.$rules = { + start : [{ + token: "constant.numeric", + regex: "(?:(?:[1-9]\\d*)|(?:0))" + }, { + token : "comment", + regex : "#.*$" + }, { + token : "keyword", + regex : "(?:" + labels + "):|(?:" + keywords + ")\\b" + }, { + token : "keyword", + regex : "\\*" + }, { + token : "string", // multi line """ string start + regex : '"{3}', + next : "qqstring3" + }, { + token : "string", // " string + regex : '"', + next : "qqstring" + }, { + token : "text", + regex : "^\\s*(?=@[\\w])", + next : [{ + token : "text", + regex : "\\s+" + }, { + token : "variable.parameter", + regex : "@[\\w]+" + }, { + token : "empty", + regex : "", + next : "start" + }] + }, { + token : "comment", + regex : "<[^>]+>" + }, { + token : "comment", + regex : "\\|(?=.)", + next : "table-item" + }, { + token : "comment", + regex : "\\|$", + next : "start" + }], + "qqstring3" : [ { + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", // multi line """ string end + regex : '"{3}', + next : "start" + }, { + defaultToken : "string" + }], + "qqstring" : [{ + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "start" + }, { + defaultToken: "string" + }], + "table-item" : [{ + token : "comment", + regex : /$/, + next : "start" + }, { + token : "comment", + regex : /\|/ + }, { + token : "string", + regex : /\\./ + }, { + defaultToken : "string" + }] + }; + this.normalizeRules(); +} + +oop.inherits(GherkinHighlightRules, TextHighlightRules); + +exports.GherkinHighlightRules = GherkinHighlightRules; +}); + +ace.define("ace/mode/gherkin",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gherkin_highlight_rules"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var GherkinHighlightRules = require("./gherkin_highlight_rules").GherkinHighlightRules; + +var Mode = function() { + this.HighlightRules = GherkinHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "#"; + this.$id = "ace/mode/gherkin"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var space2 = " "; + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + console.log(state) + + if(line.match("[ ]*\\|")) { + indent += "| "; + } + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + + if (state == "start") { + if (line.match("Scenario:|Feature:|Scenario Outline:|Background:")) { + indent += space2; + } else if(line.match("(Given|Then).+(:)$|Examples:")) { + indent += space2; + } else if(line.match("\\*.+")) { + indent += "* "; + } + } + + + return indent; + }; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-gitignore.js b/htdocs/includes/ace/mode-gitignore.js new file mode 100644 index 00000000000..c3eac55939e --- /dev/null +++ b/htdocs/includes/ace/mode-gitignore.js @@ -0,0 +1,52 @@ +ace.define("ace/mode/gitignore_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var GitignoreHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "comment", + regex : /^\s*#.*$/ + }, { + token : "keyword", // negated patterns + regex : /^\s*!.*$/ + } + ] + }; + + this.normalizeRules(); +}; + +GitignoreHighlightRules.metaData = { + fileTypes: ['gitignore'], + name: 'Gitignore' +}; + +oop.inherits(GitignoreHighlightRules, TextHighlightRules); + +exports.GitignoreHighlightRules = GitignoreHighlightRules; +}); + +ace.define("ace/mode/gitignore",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gitignore_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var GitignoreHighlightRules = require("./gitignore_highlight_rules").GitignoreHighlightRules; + +var Mode = function() { + this.HighlightRules = GitignoreHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "#"; + this.$id = "ace/mode/gitignore"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-glsl.js b/htdocs/includes/ace/mode-glsl.js new file mode 100644 index 00000000000..ee95feea441 --- /dev/null +++ b/htdocs/includes/ace/mode-glsl.js @@ -0,0 +1,564 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" + +var c_cppHighlightRules = function() { + + var keywordControls = ( + "break|case|continue|default|do|else|for|goto|if|_Pragma|" + + "return|switch|while|catch|operator|try|throw|using" + ); + + var storageType = ( + "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + + "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + + "class|wchar_t|template|char16_t|char32_t" + ); + + var storageModifiers = ( + "const|extern|register|restrict|static|volatile|inline|private|" + + "protected|public|friend|explicit|virtual|export|mutable|typename|" + + "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" + ); + + var keywordOperators = ( + "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + + "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" + ); + + var builtinConstants = ( + "NULL|true|false|TRUE|FALSE|nullptr" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword.control" : keywordControls, + "storage.type" : storageType, + "storage.modifier" : storageModifiers, + "keyword.operator" : keywordOperators, + "variable.language": "this", + "constant.language": builtinConstants + }, "identifier"); + + var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "//$", + next : "start" + }, { + token : "comment", + regex : "//", + next : "singleLineComment" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // character + regex : "'(?:" + escapeRe + "|.)?'" + }, { + token : "string.start", + regex : '"', + stateName: "qqstring", + next: [ + { token: "string", regex: /\\\s*$/, next: "qqstring" }, + { token: "constant.language.escape", regex: escapeRe }, + { token: "constant.language.escape", regex: /%[^'"\\]/ }, + { token: "string.end", regex: '"|$', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "string.start", + regex : 'R"\\(', + stateName: "rawString", + next: [ + { token: "string.end", regex: '\\)"', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "keyword", // pre-compiler directives + regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", + next : "directive" + }, { + token : "keyword", // special case pre-compiler directive + regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" + }, { + token : "support.function.C99.c", + regex : cFunctions + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" + }, { + token : "keyword.operator", + regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/ + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "singleLineComment" : [ + { + token : "comment", + regex : /\\$/, + next : "singleLineComment" + }, { + token : "comment", + regex : /$/, + next : "start" + }, { + defaultToken: "comment" + } + ], + "directive" : [ + { + token : "constant.other.multiline", + regex : /\\/ + }, + { + token : "constant.other.multiline", + regex : /.*\\/ + }, + { + token : "constant.other", + regex : "\\s*<.+?>", + next : "start" + }, + { + token : "constant.other", // single line + regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', + next : "start" + }, + { + token : "constant.other", // single line + regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", + next : "start" + }, + { + token : "constant.other", + regex : /[^\\\/]+/, + next : "start" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(c_cppHighlightRules, TextHighlightRules); + +exports.c_cppHighlightRules = c_cppHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = c_cppHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/c_cpp"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; + +var glslHighlightRules = function() { + + var keywords = ( + "attribute|const|uniform|varying|break|continue|do|for|while|" + + "if|else|in|out|inout|float|int|void|bool|true|false|" + + "lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|" + + "mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|" + + "samplerCube|struct" + ); + + var buildinConstants = ( + "radians|degrees|sin|cos|tan|asin|acos|atan|pow|" + + "exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|" + + "min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|" + + "normalize|faceforward|reflect|refract|matrixCompMult|lessThan|" + + "lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|" + + "not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|" + + "texture2DProjLod|textureCube|textureCubeLod|" + + "gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|" + + "gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|" + + "gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|" + + "gl_DepthRangeParameters|gl_DepthRange|" + + "gl_Position|gl_PointSize|" + + "gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "constant.language": buildinConstants + }, "identifier"); + + this.$rules = new c_cppHighlightRules().$rules; + this.$rules.start.forEach(function(rule) { + if (typeof rule.token == "function") + rule.token = keywordMapper; + }) +}; + +oop.inherits(glslHighlightRules, c_cppHighlightRules); + +exports.glslHighlightRules = glslHighlightRules; +}); + +ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var CMode = require("./c_cpp").Mode; +var glslHighlightRules = require("./glsl_highlight_rules").glslHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = glslHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, CMode); + +(function() { + this.$id = "ace/mode/glsl"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-gobstones.js b/htdocs/includes/ace/mode-gobstones.js new file mode 100644 index 00000000000..746b341357c --- /dev/null +++ b/htdocs/includes/ace/mode-gobstones.js @@ -0,0 +1,922 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/gobstones_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var GobstonesHighlightRules = function() { + + var keywords = ( + "program|procedure|function|interactive|if|then|else|switch|repeat|while|foreach|in|not|div|mod|Skip|return" + ); + + var buildinConstants = ( + "False|True" + ); + + + var langClasses = ( + "Poner|Sacar|Mover|IrAlBorde|VaciarTablero|" + + "nroBolitas|hayBolitas|puedeMover|siguiente|previo|opuesto|minBool|maxBool|" + + "minDir|maxDir|minColor|maxColor" + ); + + var supportType = ( + "Verde|Rojo|Azul|Negro|Norte|Sur|Este|Oeste" + ); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": buildinConstants, + "support.function": langClasses, + "support.type": supportType + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + { + token : "comment", + regex : "\\-\\-.*$" + }, + { + token : "comment", + regex : "#.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/ + }, { + token : "constant.numeric", // float + regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/ + }, { + token : "constant.language.boolean", + regex : "(?:True|False)\\b" + }, { + token : "keyword.operator", + regex : ":=|\\.\\.|,|;|\\|\\||\\/\\/|\\+|\\-|\\^|\\*|>|<|>=|=>|==|&&" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(GobstonesHighlightRules, TextHighlightRules); + +exports.GobstonesHighlightRules = GobstonesHighlightRules; +}); + +ace.define("ace/mode/gobstones",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/gobstones_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptMode = require("./javascript").Mode; +var GobstonesHighlightRules = require("./gobstones_highlight_rules").GobstonesHighlightRules; + +var Mode = function() { + JavaScriptMode.call(this); + this.HighlightRules = GobstonesHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, JavaScriptMode); + +(function() { + + this.createWorker = function(session) { + return null; + }; + + this.$id = "ace/mode/gobstones"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-golang.js b/htdocs/includes/ace/mode-golang.js new file mode 100644 index 00000000000..cb81eafa48f --- /dev/null +++ b/htdocs/includes/ace/mode-golang.js @@ -0,0 +1,406 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/golang_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { + var oop = require("../lib/oop"); + var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + + var GolangHighlightRules = function() { + var keywords = ( + "else|break|case|return|goto|if|const|select|" + + "continue|struct|default|switch|for|range|" + + "func|import|package|chan|defer|fallthrough|go|interface|map|range|" + + "select|type|var" + ); + var builtinTypes = ( + "string|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|" + + "float64|complex64|complex128|byte|rune|uint|int|uintptr|bool|error" + ); + var builtinFunctions = ( + "new|close|cap|copy|panic|panicln|print|println|len|make|delete|real|recover|imag|append" + ); + var builtinConstants = ("nil|true|false|iota"); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": builtinConstants, + "support.function": builtinFunctions, + "support.type": builtinTypes + }, ""); + + var stringEscapeRe = "\\\\(?:[0-7]{3}|x\\h{2}|u{4}|U\\h{6}|[abfnrtv'\"\\\\])".replace(/\\h/g, "[a-fA-F\\d]"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment.start", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : /"(?:[^"\\]|\\.)*?"/ + }, { + token : "string", // raw + regex : '`', + next : "bqstring" + }, { + token : "constant.numeric", // rune + regex : "'(?:[^\\'\uD800-\uDBFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|" + stringEscapeRe.replace('"', '') + ")'" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : ["keyword", "text", "entity.name.function"], + regex : "(func)(\\s+)([a-zA-Z_$][a-zA-Z0-9_$]*)\\b" + }, { + token : function(val) { + if (val[val.length - 1] == "(") { + return [{ + type: keywordMapper(val.slice(0, -1)) || "support.function", + value: val.slice(0, -1) + }, { + type: "paren.lparen", + value: val.slice(-1) + }]; + } + + return keywordMapper(val) || "identifier"; + }, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b\\(?" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=" + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment.end", + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "bqstring" : [ + { + token : "string", + regex : '`', + next : "start" + }, { + defaultToken : "string" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + }; + oop.inherits(GolangHighlightRules, TextHighlightRules); + + exports.GolangHighlightRules = GolangHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/golang",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/golang_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = GolangHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = new CstyleBehaviour(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + };//end getNextLineIndent + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/golang"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-graphqlschema.js b/htdocs/includes/ace/mode-graphqlschema.js new file mode 100644 index 00000000000..9d2833dd9cc --- /dev/null +++ b/htdocs/includes/ace/mode-graphqlschema.js @@ -0,0 +1,206 @@ +ace.define("ace/mode/graphqlschema_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var GraphQLSchemaHighlightRules = function() { + + var keywords = ( + "type|interface|union|enum|schema|input|implements|extends|scalar" + ); + + var dataTypes = ( + "Int|Float|String|ID|Boolean" + ); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "storage.type": dataTypes + }, "identifier"); + + this.$rules = { + "start" : [ { + token : "comment", + regex : "#.*$" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + } ] + }; + this.normalizeRules(); +}; + +oop.inherits(GraphQLSchemaHighlightRules, TextHighlightRules); + +exports.GraphQLSchemaHighlightRules = GraphQLSchemaHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/graphqlschema",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/graphqlschema_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var GraphQLSchemaHighlightRules = require("./graphqlschema_highlight_rules").GraphQLSchemaHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = GraphQLSchemaHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "#"; + this.$id = "ace/mode/graphqlschema"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-groovy.js b/htdocs/includes/ace/mode-groovy.js new file mode 100644 index 00000000000..b04ffd9b23a --- /dev/null +++ b/htdocs/includes/ace/mode-groovy.js @@ -0,0 +1,980 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/groovy_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var GroovyHighlightRules = function() { + + var keywords = ( + "assert|with|abstract|continue|for|new|switch|" + + "assert|default|goto|package|synchronized|" + + "boolean|do|if|private|this|" + + "break|double|implements|protected|throw|" + + "byte|else|import|public|throws|" + + "case|enum|instanceof|return|transient|" + + "catch|extends|int|short|try|" + + "char|final|interface|static|void|" + + "class|finally|long|strictfp|volatile|" + + "def|float|native|super|while" + ); + + var buildinConstants = ( + "null|Infinity|NaN|undefined" + ); + + var langClasses = ( + "AbstractMethodError|AssertionError|ClassCircularityError|"+ + "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ + "ExceptionInInitializerError|IllegalAccessError|"+ + "IllegalThreadStateException|InstantiationError|InternalError|"+ + "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ + "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ + "SuppressWarnings|TypeNotPresentException|UnknownError|"+ + "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ + "InstantiationException|IndexOutOfBoundsException|"+ + "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ + "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ + "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ + "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ + "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ + "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ + "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ + "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ + "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ + "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ + "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ + "ArrayStoreException|ClassCastException|LinkageError|"+ + "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ + "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ + "Cloneable|Class|CharSequence|Comparable|String|Object" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "support.function": langClasses, + "constant.language": buildinConstants + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, { + token : "string", + regex : '"""', + next : "qqstring" + }, { + token : "string", + regex : "'''", + next : "qstring" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\?:|\\?\\.|\\*\\.|<=>|=~|==~|\\.@|\\*\\.@|\\.&|as|in|is|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/ + }, { + token : "constant.language.escape", + regex : /\$[\w\d]+/ + }, { + token : "constant.language.escape", + regex : /\$\{[^"\}]+\}?/ + }, { + token : "string", + regex : '"{3,5}', + next : "start" + }, { + token : "string", + regex : '.+?' + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/ + }, { + token : "string", + regex : "'{3,5}", + next : "start" + }, { + token : "string", + regex : ".+?" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(GroovyHighlightRules, TextHighlightRules); + +exports.GroovyHighlightRules = GroovyHighlightRules; +}); + +ace.define("ace/mode/groovy",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/groovy_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptMode = require("./javascript").Mode; +var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRules; + +var Mode = function() { + JavaScriptMode.call(this); + this.HighlightRules = GroovyHighlightRules; +}; +oop.inherits(Mode, JavaScriptMode); + +(function() { + + this.createWorker = function(session) { + return null; + }; + + this.$id = "ace/mode/groovy"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-haml.js b/htdocs/includes/ace/mode-haml.js new file mode 100644 index 00000000000..c4255c54e0b --- /dev/null +++ b/htdocs/includes/ace/mode-haml.js @@ -0,0 +1,1547 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var constantOtherSymbol = exports.constantOtherSymbol = { + token : "constant.other.symbol.ruby", // symbol + regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" +}; + +var qString = exports.qString = { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" +}; + +var qqString = exports.qqString = { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' +}; + +var tString = exports.tString = { + token : "string", // backtick string + regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" +}; + +var constantNumericHex = exports.constantNumericHex = { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" +}; + +var constantNumericFloat = exports.constantNumericFloat = { + token : "constant.numeric", // float + regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" +}; + +var instanceVariable = exports.instanceVariable = { + token : "variable.instance", // instance variable + regex : "@{1,2}[a-zA-Z_\\d]+" +}; + +var RubyHighlightRules = function() { + + var builtinFunctions = ( + "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + + "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + + "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + + "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + + "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + + "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + + "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + + "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + + "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + + "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + + "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + + "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + + "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + + "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + + "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + + "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + + "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + + "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + + "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + + "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + + "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + + "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + + "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + + "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + + "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + + "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + + "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + + "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + + "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + + "has_many|has_one|belongs_to|has_and_belongs_to_many" + ); + + var keywords = ( + "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + + "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + + "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" + ); + + var buildinConstants = ( + "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + + "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" + ); + + var builtinVariables = ( + "$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" + + "$!|root_url|flash|session|cookies|params|request|response|logger|self" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": buildinConstants, + "variable.language": builtinVariables, + "support.function": builtinFunctions, + "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "#.*$" + }, { + token : "comment", // multi line comment + regex : "^=begin(?:$|\\s.*$)", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, + + [{ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + return "paren.lparen"; + } + if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1) + return "paren.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.start", + regex : /"/, + push : [{ + token : "constant.language.escape", + regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/ + }, { + token : "paren.start", + regex : /#{/, + push : "start" + }, { + token : "string.end", + regex : /"/, + next : "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/ + }, { + token : "paren.start", + regex : /#{/, + push : "start" + }, { + token : "string.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : /'/, + push : [{ + token : "constant.language.escape", + regex : /\\['\\]/ + }, { + token : "string.end", + regex : /'/, + next : "pop" + }, { + defaultToken: "string" + }] + }], + + { + token : "text", // namespaces aren't symbols + regex : "::" + }, { + token : "variable.instance", // instance variable + regex : "@{1,2}[a-zA-Z_\\d]+" + }, { + token : "support.class", // class name + regex : "[A-Z][a-zA-Z_\\d]+" + }, + + constantOtherSymbol, + constantNumericHex, + constantNumericFloat, + + { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "punctuation.separator.key-value", + regex : "=>" + }, { + stateName: "heredoc", + onMatch : function(value, currentState, stack) { + var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; + var tokens = value.split(this.splitRegex); + stack.push(next, tokens[3]); + return [ + {type:"constant", value: tokens[1]}, + {type:"string", value: tokens[2]}, + {type:"support.class", value: tokens[3]}, + {type:"string", value: tokens[4]} + ]; + }, + regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", + rules: { + heredoc: [{ + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^ +" + }, { + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }] + } + }, { + regex : "$", + token : "empty", + next : function(currentState, stack) { + if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") + return stack[0]; + return currentState; + } + }, { + token : "string.character", + regex : "\\B\\?." + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "^=end(?:$|\\s.*$)", + next : "start" + }, { + token : "comment", // comment spanning whole line + regex : ".+" + } + ] + }; + + this.normalizeRules(); +}; + +oop.inherits(RubyHighlightRules, TextHighlightRules); + +exports.RubyHighlightRules = RubyHighlightRules; +}); + +ace.define("ace/mode/haml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/ruby_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var RubyExports = require("./ruby_highlight_rules"); +var RubyHighlightRules = RubyExports.RubyHighlightRules; + +var HamlHighlightRules = function() { + HtmlHighlightRules.call(this); + + this.$rules = { + "start": [ + { + token: "comment.block", // multiline HTML comment + regex: /^\/$/, + next: "comment" + }, + { + token: "comment.block", // multiline HAML comment + regex: /^\-#$/, + next: "comment" + }, + { + token: "comment.line", // HTML comment + regex: /\/\s*.*/ + }, + { + token: "comment.line", // HAML comment + regex: /-#\s*.*/ + }, + { + token: "keyword.other.doctype", + regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" + }, + RubyExports.qString, + RubyExports.qqString, + RubyExports.tString, + { + token: "meta.tag.haml", + regex: /(%[\w:\-]+)/ + }, + { + token: "keyword.attribute-name.class.haml", + regex: /\.[\w-]+/ + }, + { + token: "keyword.attribute-name.id.haml", + regex: /#[\w-]+/, + next: "element_class" + }, + RubyExports.constantNumericHex, + RubyExports.constantNumericFloat, + RubyExports.constantOtherSymbol, + { + token: "text", + regex: /=|-|~/, + next: "embedded_ruby" + } + ], + "element_class": [ + { + token: "keyword.attribute-name.class.haml", + regex: /\.[\w-]+/ + }, + { + token: "punctuation.section", + regex: /\{/, + next: "element_attributes" + }, + RubyExports.constantOtherSymbol, + { + token: "empty", + regex: "$|(?!\\.|#|\\{|\\[|=|-|~|\\/])", + next: "start" + } + ], + "element_attributes": [ + RubyExports.constantOtherSymbol, + RubyExports.qString, + RubyExports.qqString, + RubyExports.tString, + RubyExports.constantNumericHex, + RubyExports.constantNumericFloat, + { + token: "punctuation.section", + regex: /$|\}/, + next: "start" + } + ], + "embedded_ruby": [ + RubyExports.constantNumericHex, + RubyExports.constantNumericFloat, + RubyExports.instanceVariable, + RubyExports.qString, + RubyExports.qqString, + RubyExports.tString, + { + token : "support.class", // class name + regex : "[A-Z][a-zA-Z_\\d]+" + }, + { + token : new RubyHighlightRules().getKeywords(), + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, + { + token : ["keyword", "text", "text"], + regex : "(?:do|\\{)(?: \\|[^|]+\\|)?$", + next : "start" + }, + { + token : ["text"], + regex : "^$", + next : "start" + }, + { + token : ["text"], + regex : "^(?!.*\\|\\s*$)", + next : "start" + } + ], + "comment": [ + { + token: "comment.block", + regex: /^$/, + next: "start" + }, + { + token: "comment.block", // comment spanning the whole line + regex: /\s+.*/ + } + ] + + }; + + this.normalizeRules(); +}; + +oop.inherits(HamlHighlightRules, HtmlHighlightRules); + +exports.HamlHighlightRules = HamlHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/haml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haml_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HamlHighlightRules = require("./haml_highlight_rules").HamlHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = HamlHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + + this.$id = "ace/mode/haml"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-handlebars.js b/htdocs/includes/ace/mode-handlebars.js new file mode 100644 index 00000000000..c970820e5b2 --- /dev/null +++ b/htdocs/includes/ace/mode-handlebars.js @@ -0,0 +1,2593 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/handlebars_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + +function pop2(currentState, stack) { + stack.splice(0, 3); + return stack.shift() || "start"; +} +var HandlebarsHighlightRules = function() { + HtmlHighlightRules.call(this); + var hbs = { + regex : "(?={{)", + push : "handlebars" + }; + for (var key in this.$rules) { + this.$rules[key].unshift(hbs); + } + this.$rules.handlebars = [{ + token : "comment.start", + regex : "{{!--", + push : [{ + token : "comment.end", + regex : "--}}", + next : pop2 + }, { + defaultToken : "comment" + }] + }, { + token : "comment.start", + regex : "{{!", + push : [{ + token : "comment.end", + regex : "}}", + next : pop2 + }, { + defaultToken : "comment" + }] + }, { + token : "support.function", // unescaped variable + regex : "{{{", + push : [{ + token : "support.function", + regex : "}}}", + next : pop2 + }, { + token : "variable.parameter", + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" + }] + }, { + token : "storage.type.start", // begin section + regex : "{{[#\\^/&]?", + push : [{ + token : "storage.type.end", + regex : "}}", + next : pop2 + }, { + token : "variable.parameter", + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" + }] + }]; + + this.normalizeRules(); +}; + +oop.inherits(HandlebarsHighlightRules, HtmlHighlightRules); + +exports.HandlebarsHighlightRules = HandlebarsHighlightRules; +}); + +ace.define("ace/mode/behaviour/html",["require","exports","module","ace/lib/oop","ace/mode/behaviour/xml"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; + +var HtmlBehaviour = function () { + + XmlBehaviour.call(this); + +}; + +oop.inherits(HtmlBehaviour, XmlBehaviour); + +exports.HtmlBehaviour = HtmlBehaviour; +}); + +ace.define("ace/mode/handlebars",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/handlebars_highlight_rules","ace/mode/behaviour/html","ace/mode/folding/html"], function(require, exports, module) { + "use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var HandlebarsHighlightRules = require("./handlebars_highlight_rules").HandlebarsHighlightRules; +var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = HandlebarsHighlightRules; + this.$behaviour = new HtmlBehaviour(); +}; + +oop.inherits(Mode, HtmlMode); + +(function() { + this.blockComment = {start: "{{!--", end: "--}}"}; + this.$id = "ace/mode/handlebars"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-haskell.js b/htdocs/includes/ace/mode-haskell.js new file mode 100644 index 00000000000..51a54454728 --- /dev/null +++ b/htdocs/includes/ace/mode-haskell.js @@ -0,0 +1,372 @@ +ace.define("ace/mode/haskell_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var HaskellHighlightRules = function() { + + this.$rules = { start: + [ { token: + [ 'punctuation.definition.entity.haskell', + 'keyword.operator.function.infix.haskell', + 'punctuation.definition.entity.haskell' ], + regex: '(`)([a-zA-Z_\']*?)(`)', + comment: 'In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).' }, + { token: 'constant.language.unit.haskell', regex: '\\(\\)' }, + { token: 'constant.language.empty-list.haskell', + regex: '\\[\\]' }, + { token: 'keyword.other.haskell', + regex: '\\bmodule\\b', + push: + [ { token: 'keyword.other.haskell', regex: '\\bwhere\\b', next: 'pop' }, + { include: '#module_name' }, + { include: '#module_exports' }, + { token: 'invalid', regex: '[a-z]+' }, + { defaultToken: 'meta.declaration.module.haskell' } ] }, + { token: 'keyword.other.haskell', + regex: '\\bclass\\b', + push: + [ { token: 'keyword.other.haskell', + regex: '\\bwhere\\b', + next: 'pop' }, + { token: 'support.class.prelude.haskell', + regex: '\\b(?:Monad|Functor|Eq|Ord|Read|Show|Num|(?:Frac|Ra)tional|Enum|Bounded|Real(?:Frac|Float)?|Integral|Floating)\\b' }, + { token: 'entity.other.inherited-class.haskell', + regex: '[A-Z][A-Za-z_\']*' }, + { token: 'variable.other.generic-type.haskell', + regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' }, + { defaultToken: 'meta.declaration.class.haskell' } ] }, + { token: 'keyword.other.haskell', + regex: '\\binstance\\b', + push: + [ { token: 'keyword.other.haskell', + regex: '\\bwhere\\b|$', + next: 'pop' }, + { include: '#type_signature' }, + { defaultToken: 'meta.declaration.instance.haskell' } ] }, + { token: 'keyword.other.haskell', + regex: 'import', + push: + [ { token: 'meta.import.haskell', regex: '$|;|^', next: 'pop' }, + { token: 'keyword.other.haskell', regex: 'qualified|as|hiding' }, + { include: '#module_name' }, + { include: '#module_exports' }, + { defaultToken: 'meta.import.haskell' } ] }, + { token: [ 'keyword.other.haskell', 'meta.deriving.haskell' ], + regex: '(deriving)(\\s*\\()', + push: + [ { token: 'meta.deriving.haskell', regex: '\\)', next: 'pop' }, + { token: 'entity.other.inherited-class.haskell', + regex: '\\b[A-Z][a-zA-Z_\']*' }, + { defaultToken: 'meta.deriving.haskell' } ] }, + { token: 'keyword.other.haskell', + regex: '\\b(?:deriving|where|data|type|case|of|let|in|newtype|default)\\b' }, + { token: 'keyword.operator.haskell', regex: '\\binfix[lr]?\\b' }, + { token: 'keyword.control.haskell', + regex: '\\b(?:do|if|then|else)\\b' }, + { token: 'constant.numeric.float.haskell', + regex: '\\b(?:[0-9]+\\.[0-9]+(?:[eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b', + comment: 'Floats are always decimal' }, + { token: 'constant.numeric.haskell', + regex: '\\b(?:[0-9]+|0(?:[xX][0-9a-fA-F]+|[oO][0-7]+))\\b' }, + { token: + [ 'meta.preprocessor.c', + 'punctuation.definition.preprocessor.c', + 'meta.preprocessor.c' ], + regex: '^(\\s*)(#)(\\s*\\w+)', + comment: 'In addition to Haskell\'s "native" syntax, GHC permits the C preprocessor to be run on a source file.' }, + { include: '#pragma' }, + { token: 'punctuation.definition.string.begin.haskell', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.haskell', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.haskell', + regex: '\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&])' }, + { token: 'constant.character.escape.octal.haskell', + regex: '\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+' }, + { token: 'constant.character.escape.control.haskell', + regex: '\\^[A-Z@\\[\\]\\\\\\^_]' }, + { defaultToken: 'string.quoted.double.haskell' } ] }, + { token: + [ 'punctuation.definition.string.begin.haskell', + 'string.quoted.single.haskell', + 'constant.character.escape.haskell', + 'constant.character.escape.octal.haskell', + 'constant.character.escape.hexadecimal.haskell', + 'constant.character.escape.control.haskell', + 'punctuation.definition.string.end.haskell' ], + regex: '(\')(?:([\\ -\\[\\]-~])|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))(\')' }, + { token: + [ 'meta.function.type-declaration.haskell', + 'entity.name.function.haskell', + 'meta.function.type-declaration.haskell', + 'keyword.other.double-colon.haskell' ], + regex: '^(\\s*)([a-z_][a-zA-Z0-9_\']*|\\([|!%$+\\-.,=]+\\))(\\s*)(::)', + push: + [ { token: 'meta.function.type-declaration.haskell', + regex: '$', + next: 'pop' }, + { include: '#type_signature' }, + { defaultToken: 'meta.function.type-declaration.haskell' } ] }, + { token: 'support.constant.haskell', + regex: '\\b(?:Just|Nothing|Left|Right|True|False|LT|EQ|GT|\\(\\)|\\[\\])\\b' }, + { token: 'constant.other.haskell', regex: '\\b[A-Z]\\w*\\b' }, + { include: '#comments' }, + { token: 'support.function.prelude.haskell', + regex: '\\b(?:abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|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)\\b' }, + { include: '#infix_op' }, + { token: 'keyword.operator.haskell', + regex: '[|!%$?~+:\\-.=\\\\]+', + comment: 'In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.' }, + { token: 'punctuation.separator.comma.haskell', regex: ',' } ], + '#block_comment': + [ { token: 'punctuation.definition.comment.haskell', + regex: '\\{-(?!#)', + push: + [ { include: '#block_comment' }, + { token: 'punctuation.definition.comment.haskell', + regex: '-\\}', + next: 'pop' }, + { defaultToken: 'comment.block.haskell' } ] } ], + '#comments': + [ { token: 'punctuation.definition.comment.haskell', + regex: '--.*', + push_: + [ { token: 'comment.line.double-dash.haskell', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.double-dash.haskell' } ] }, + { include: '#block_comment' } ], + '#infix_op': + [ { token: 'entity.name.function.infix.haskell', + regex: '\\([|!%$+:\\-.=]+\\)|\\(,+\\)' } ], + '#module_exports': + [ { token: 'meta.declaration.exports.haskell', + regex: '\\(', + push: + [ { token: 'meta.declaration.exports.haskell.end', + regex: '\\)', + next: 'pop' }, + { token: 'entity.name.function.haskell', + regex: '\\b[a-z][a-zA-Z_\']*' }, + { token: 'storage.type.haskell', regex: '\\b[A-Z][A-Za-z_\']*' }, + { token: 'punctuation.separator.comma.haskell', regex: ',' }, + { include: '#infix_op' }, + { token: 'meta.other.unknown.haskell', + regex: '\\(.*?\\)', + comment: 'So named because I don\'t know what to call this.' }, + { defaultToken: 'meta.declaration.exports.haskell.end' } ] } ], + '#module_name': + [ { token: 'support.other.module.haskell', + regex: '[A-Z][A-Za-z._\']*' } ], + '#pragma': + [ { token: 'meta.preprocessor.haskell', + regex: '\\{-#', + push: + [ { token: 'meta.preprocessor.haskell', + regex: '#-\\}', + next: 'pop' }, + { token: 'keyword.other.preprocessor.haskell', + regex: '\\b(?:LANGUAGE|UNPACK|INLINE)\\b' }, + { defaultToken: 'meta.preprocessor.haskell' } ] } ], + '#type_signature': + [ { token: + [ 'meta.class-constraint.haskell', + 'entity.other.inherited-class.haskell', + 'meta.class-constraint.haskell', + 'variable.other.generic-type.haskell', + 'meta.class-constraint.haskell', + 'keyword.other.big-arrow.haskell' ], + regex: '(\\(\\s*)([A-Z][A-Za-z]*)(\\s+)([a-z][A-Za-z_\']*)(\\)\\s*)(=>)' }, + { include: '#pragma' }, + { token: 'keyword.other.arrow.haskell', regex: '->' }, + { token: 'keyword.other.big-arrow.haskell', regex: '=>' }, + { token: 'support.type.prelude.haskell', + regex: '\\b(?:Int(?:eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(?:Error)?)\\b' }, + { token: 'variable.other.generic-type.haskell', + regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' }, + { token: 'storage.type.haskell', + regex: '\\b[A-Z][a-zA-Z0-9_\']*\\b' }, + { token: 'support.constant.unit.haskell', regex: '\\(\\)' }, + { include: '#comments' } ] } + + this.normalizeRules(); +}; + +HaskellHighlightRules.metaData = { fileTypes: [ 'hs' ], + keyEquivalent: '^~H', + name: 'Haskell', + scopeName: 'source.haskell' } + + +oop.inherits(HaskellHighlightRules, TextHighlightRules); + +exports.HaskellHighlightRules = HaskellHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/haskell",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haskell_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HaskellHighlightRules = require("./haskell_highlight_rules").HaskellHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = HaskellHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = null; + this.$id = "ace/mode/haskell"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-haskell_cabal.js b/htdocs/includes/ace/mode-haskell_cabal.js new file mode 100644 index 00000000000..5b69e04cbf1 --- /dev/null +++ b/htdocs/includes/ace/mode-haskell_cabal.js @@ -0,0 +1,134 @@ +ace.define("ace/mode/haskell_cabal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var CabalHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "comment", + regex : "^\\s*--.*$" + }, { + token: ["keyword"], + regex: /^(\s*\w.*?)(:(?:\s+|$))/ + }, { + token : "constant.numeric", // float + regex : /[\d_]+(?:(?:[\.\d_]*)?)/ + }, { + token : "constant.language.boolean", + regex : "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b" + }, { + token : "markup.heading", + regex : /^(\w.*)$/ + } + ]}; + +}; + +oop.inherits(CabalHighlightRules, TextHighlightRules); + +exports.CabalHighlightRules = CabalHighlightRules; +}); + +ace.define("ace/mode/folding/haskell_cabal",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + this.isHeading = function (session,row) { + var heading = "markup.heading"; + var token = session.getTokens(row)[0]; + return row==0 || (token && token.type.lastIndexOf(heading, 0) === 0); + }; + + this.getFoldWidget = function(session, foldStyle, row) { + if (this.isHeading(session,row)){ + return "start"; + } else if (foldStyle === "markbeginend" && !(/^\s*$/.test(session.getLine(row)))){ + var maxRow = session.getLength(); + while (++row < maxRow) { + if (!(/^\s*$/.test(session.getLine(row)))){ + break; + } + } + if (row==maxRow || this.isHeading(session,row)){ + return "end"; + } + } + return ""; + }; + + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + if (this.isHeading(session,row)) { + while (++row < maxRow) { + if (this.isHeading(session,row)){ + row--; + break; + } + } + + endRow = row; + if (endRow > startRow) { + while (endRow > startRow && /^\s*$/.test(session.getLine(endRow))) + endRow--; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + } else if (this.getFoldWidget(session, foldStyle, row)==="end"){ + var endRow = row; + var endColumn = session.getLine(endRow).length; + while (--row>=0){ + if (this.isHeading(session,row)){ + break; + } + } + var line = session.getLine(row); + var startColumn = line.length; + return new Range(row, startColumn, endRow, endColumn); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/haskell_cabal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haskell_cabal_highlight_rules","ace/mode/folding/haskell_cabal"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CabalHighlightRules = require("./haskell_cabal_highlight_rules").CabalHighlightRules; +var FoldMode = require("./folding/haskell_cabal").FoldMode; + +var Mode = function() { + this.HighlightRules = CabalHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = null; + this.$id = "ace/mode/haskell_cabal"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-haxe.js b/htdocs/includes/ace/mode-haxe.js new file mode 100644 index 00000000000..694b9b80ef3 --- /dev/null +++ b/htdocs/includes/ace/mode-haxe.js @@ -0,0 +1,379 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/haxe_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); + +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var HaxeHighlightRules = function() { + + var keywords = ( + "break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std" + ); + + var buildinConstants = ( + "null|true|false" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "constant.language": buildinConstants + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({<]" + }, { + token : "paren.rparen", + regex : "[\\])}>]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(HaxeHighlightRules, TextHighlightRules); + +exports.HaxeHighlightRules = HaxeHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/haxe",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haxe_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = HaxeHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/haxe"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-hjson.js b/htdocs/includes/ace/mode-hjson.js new file mode 100644 index 00000000000..857587650b2 --- /dev/null +++ b/htdocs/includes/ace/mode-hjson.js @@ -0,0 +1,346 @@ +ace.define("ace/mode/hjson_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var HjsonHighlightRules = function() { + + this.$rules = { + start: [{ + include: "#comments" + }, { + include: "#rootObject" + }, { + include: "#value" + }], + "#array": [{ + token: "paren.lparen", + regex: /\[/, + push: [{ + token: "paren.rparen", + regex: /\]/, + next: "pop" + }, { + include: "#value" + }, { + include: "#comments" + }, { + token: "text", + regex: /,|$/ + }, { + token: "invalid.illegal", + regex: /[^\s\]]/ + }, { + defaultToken: "array" + }] + }], + "#comments": [{ + token: [ + "comment.punctuation", + "comment.line" + ], + regex: /(#)(.*$)/ + }, { + token: "comment.punctuation", + regex: /\/\*/, + push: [{ + token: "comment.punctuation", + regex: /\*\//, + next: "pop" + }, { + defaultToken: "comment.block" + }] + }, { + token: [ + "comment.punctuation", + "comment.line" + ], + regex: /(\/\/)(.*$)/ + }], + "#constant": [{ + token: "constant", + regex: /\b(?:true|false|null)\b/ + }], + "#keyname": [{ + token: "keyword", + regex: /(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*(?=:)/ + }], + "#mstring": [{ + token: "string", + regex: /'''/, + push: [{ + token: "string", + regex: /'''/, + next: "pop" + }, { + defaultToken: "string" + }] + }], + "#number": [{ + token: "constant.numeric", + regex: /-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/, + comment: "handles integer and decimal numbers" + }], + "#object": [{ + token: "paren.lparen", + regex: /\{/, + push: [{ + token: "paren.rparen", + regex: /\}/, + next: "pop" + }, { + include: "#keyname" + }, { + include: "#value" + }, { + token: "text", + regex: /:/ + }, { + token: "text", + regex: /,/ + }, { + defaultToken: "paren" + }] + }], + "#rootObject": [{ + token: "paren", + regex: /(?=\s*(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*:)/, + push: [{ + token: "paren.rparen", + regex: /---none---/, + next: "pop" + }, { + include: "#keyname" + }, { + include: "#value" + }, { + token: "text", + regex: /:/ + }, { + token: "text", + regex: /,/ + }, { + defaultToken: "paren" + }] + }], + "#string": [{ + token: "string", + regex: /"/, + push: [{ + token: "string", + regex: /"/, + next: "pop" + }, { + token: "constant.language.escape", + regex: /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/ + }, { + token: "invalid.illegal", + regex: /\\./ + }, { + defaultToken: "string" + }] + }], + "#ustring": [{ + token: "string", + regex: /\b[^:,0-9\-\{\[\}\]\s].*$/ + }], + "#value": [{ + include: "#constant" + }, { + include: "#number" + }, { + include: "#string" + }, { + include: "#array" + }, { + include: "#object" + }, { + include: "#comments" + }, { + include: "#mstring" + }, { + include: "#ustring" + }] + } + + this.normalizeRules(); +}; + +HjsonHighlightRules.metaData = { + fileTypes: ["hjson"], + foldingStartMarker: "(?x: # turn on extended mode\n ^ # a line beginning with\n \\s* # some optional space\n [{\\[] # the start of an object or array\n (?! # but not followed by\n .* # whatever\n [}\\]] # and the close of an object or array\n ,? # an optional comma\n \\s* # some optional space\n $ # at the end of the line\n )\n | # ...or...\n [{\\[] # the start of an object or array\n \\s* # some optional space\n $ # at the end of the line\n )", + foldingStopMarker: "(?x: # turn on extended mode\n ^ # a line beginning with\n \\s* # some optional space\n [}\\]] # and the close of an object or array\n )", + keyEquivalent: "^~J", + name: "Hjson", + scopeName: "source.hjson" +} + + +oop.inherits(HjsonHighlightRules, TextHighlightRules); + +exports.HjsonHighlightRules = HjsonHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/hjson",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/hjson_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HjsonHighlightRules = require("./hjson_highlight_rules").HjsonHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = HjsonHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = { start: "/*", end: "*/" }; + this.$id = "ace/mode/hjson" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-html.js b/htdocs/includes/ace/mode-html.js new file mode 100644 index 00000000000..35aa2cc3f26 --- /dev/null +++ b/htdocs/includes/ace/mode-html.js @@ -0,0 +1,2480 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-html_elixir.js b/htdocs/includes/ace/mode-html_elixir.js new file mode 100644 index 00000000000..207e4899c8c --- /dev/null +++ b/htdocs/includes/ace/mode-html_elixir.js @@ -0,0 +1,3059 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ElixirHighlightRules = function() { + + this.$rules = { start: + [ { token: + [ 'meta.module.elixir', + 'keyword.control.module.elixir', + 'meta.module.elixir', + 'entity.name.type.module.elixir' ], + regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' }, + { token: 'comment.documentation.heredoc', + regex: '@(?:module|type)?doc (?:~[a-z])?"""', + push: + [ { token: 'comment.documentation.heredoc', + regex: '\\s*"""', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'comment.documentation.heredoc' } ], + comment: '@doc with heredocs is treated as documentation' }, + { token: 'comment.documentation.heredoc', + regex: '@(?:module|type)?doc ~[A-Z]"""', + push: + [ { token: 'comment.documentation.heredoc', + regex: '\\s*"""', + next: 'pop' }, + { defaultToken: 'comment.documentation.heredoc' } ], + comment: '@doc with heredocs is treated as documentation' }, + { token: 'comment.documentation.heredoc', + regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'', + push: + [ { token: 'comment.documentation.heredoc', + regex: '\\s*\'\'\'', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'comment.documentation.heredoc' } ], + comment: '@doc with heredocs is treated as documentation' }, + { token: 'comment.documentation.heredoc', + regex: '@(?:module|type)?doc ~[A-Z]\'\'\'', + push: + [ { token: 'comment.documentation.heredoc', + regex: '\\s*\'\'\'', + next: 'pop' }, + { defaultToken: 'comment.documentation.heredoc' } ], + comment: '@doc with heredocs is treated as documentation' }, + { token: 'comment.documentation.false', + regex: '@(?:module|type)?doc false', + comment: '@doc false is treated as documentation' }, + { token: 'comment.documentation.string', + regex: '@(?:module|type)?doc "', + push: + [ { token: 'comment.documentation.string', + regex: '"', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'comment.documentation.string' } ], + comment: '@doc with string is treated as documentation' }, + { token: 'keyword.control.elixir', + regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' }, + { token: 'punctuation.definition.constant.elixir', + regex: ':\'', + push: + [ { token: 'punctuation.definition.constant.elixir', + regex: '\'', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'constant.other.symbol.single-quoted.elixir' } ] }, + { token: 'punctuation.definition.constant.elixir', + regex: ':"', + push: + [ { token: 'punctuation.definition.constant.elixir', + regex: '"', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'constant.other.symbol.double-quoted.elixir' } ] }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '(?:\'\'\')', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?>\'\'\')', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '^\\s*\'\'\'', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' } ], + comment: 'Single-quoted heredocs' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\'', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'support.function.variable.quoted.single.elixir' } ], + comment: 'single quoted string (allows for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '(?:""")', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?>""")', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '^\\s*"""', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.quoted.double.heredoc.elixir' } ], + comment: 'Double-quoted heredocs' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '"', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.quoted.double.elixir' } ], + comment: 'double quoted string (allows for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z](?:""")', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '~[a-z](?>""")', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '^\\s*"""', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.quoted.double.heredoc.elixir' } ], + comment: 'Double-quoted heredocs sigils' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z]\\{', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\}[a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z]\\[', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\][a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z]\\<', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\>[a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z]\\(', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\)[a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[a-z][^\\w]', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '[^\\w][a-z]*', + next: 'pop' }, + { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { include: '#escaped_char' }, + { defaultToken: 'string.interpolated.elixir' } ], + comment: 'sigil (allow for interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z](?:""")', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '~[A-Z](?>""")', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '^\\s*"""', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'Double-quoted heredocs sigils' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z]\\{', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\}[a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z]\\[', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\][a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z]\\<', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\>[a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z]\\(', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '\\)[a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: 'punctuation.definition.string.begin.elixir', + regex: '~[A-Z][^\\w]', + push: + [ { token: 'punctuation.definition.string.end.elixir', + regex: '[^\\w][a-z]*', + next: 'pop' }, + { defaultToken: 'string.quoted.other.literal.upper.elixir' } ], + comment: 'sigil (without interpolation)' }, + { token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'], + regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)', + comment: 'symbols' }, + { token: 'punctuation.definition.constant.elixir', + regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)', + comment: 'symbols' }, + { token: + [ 'punctuation.definition.comment.elixir', + 'comment.line.number-sign.elixir' ], + regex: '(#)(.*)' }, + { token: 'constant.numeric.elixir', + regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?=?' }, + { token: 'keyword.operator.bitwise.elixir', + regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' }, + { token: 'keyword.operator.logical.elixir', + regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b', + originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' }, + { token: 'keyword.operator.arithmetic.elixir', + regex: '\\*|\\+|\\-|/' }, + { token: 'keyword.operator.other.elixir', + regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' }, + { token: 'keyword.operator.assignment.elixir', regex: '=' }, + { token: 'punctuation.separator.other.elixir', regex: ':' }, + { token: 'punctuation.separator.statement.elixir', + regex: '\\;' }, + { token: 'punctuation.separator.object.elixir', regex: ',' }, + { token: 'punctuation.separator.method.elixir', regex: '\\.' }, + { token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' }, + { token: 'punctuation.section.array.elixir', regex: '\\[|\\]' }, + { token: 'punctuation.section.function.elixir', + regex: '\\(|\\)' } ], + '#escaped_char': + [ { token: 'constant.character.escape.elixir', + regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' } ], + '#interpolated_elixir': + [ { token: + [ 'source.elixir.embedded.source', + 'source.elixir.embedded.source.empty' ], + regex: '(#\\{)(\\})' }, + { todo: + { token: 'punctuation.section.embedded.elixir', + regex: '#\\{', + push: + [ { token: 'punctuation.section.embedded.elixir', + regex: '\\}', + next: 'pop' }, + { include: '#nest_curly_and_self' }, + { include: '$self' }, + { defaultToken: 'source.elixir.embedded.source' } ] } } ], + '#nest_curly_and_self': + [ { token: 'punctuation.section.scope.elixir', + regex: '\\{', + push: + [ { token: 'punctuation.section.scope.elixir', + regex: '\\}', + next: 'pop' }, + { include: '#nest_curly_and_self' } ] }, + { include: '$self' } ], + '#regex_sub': + [ { include: '#interpolated_elixir' }, + { include: '#escaped_char' }, + { token: + [ 'punctuation.definition.arbitrary-repitition.elixir', + 'string.regexp.arbitrary-repitition.elixir', + 'string.regexp.arbitrary-repitition.elixir', + 'punctuation.definition.arbitrary-repitition.elixir' ], + regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' }, + { token: 'punctuation.definition.character-class.elixir', + regex: '\\[(?:\\^?\\])?', + push: + [ { token: 'punctuation.definition.character-class.elixir', + regex: '\\]', + next: 'pop' }, + { include: '#escaped_char' }, + { defaultToken: 'string.regexp.character-class.elixir' } ] }, + { token: 'punctuation.definition.group.elixir', + regex: '\\(', + push: + [ { token: 'punctuation.definition.group.elixir', + regex: '\\)', + next: 'pop' }, + { include: '#regex_sub' }, + { defaultToken: 'string.regexp.group.elixir' } ] }, + { token: + [ 'punctuation.definition.comment.elixir', + 'comment.line.number-sign.elixir' ], + regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)', + originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$', + comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' } ] } + + this.normalizeRules(); +}; + +ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.', + fileTypes: [ 'ex', 'exs' ], + firstLineMatch: '^#!/.*\\belixir', + foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$', + foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)', + keyEquivalent: '^~E', + name: 'Elixir', + scopeName: 'source.elixir' } + + +oop.inherits(ElixirHighlightRules, TextHighlightRules); + +exports.ElixirHighlightRules = ElixirHighlightRules; +}); + +ace.define("ace/mode/html_elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/elixir_highlight_rules"], function(require, exports, module) { + "use strict"; + + var oop = require("../lib/oop"); + var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules; + + var HtmlElixirHighlightRules = function() { + HtmlHighlightRules.call(this); + + var startRules = [ + { + regex: "<%%|%%>", + token: "constant.language.escape" + }, { + token : "comment.start.eex", + regex : "<%#", + push : [{ + token : "comment.end.eex", + regex: "%>", + next: "pop", + defaultToken:"comment" + }] + }, { + token : "support.elixir_tag", + regex : "<%+(?!>)[-=]?", + push : "elixir-start" + } + ]; + + var endRules = [ + { + token : "support.elixir_tag", + regex : "%>", + next : "pop" + }, { + token: "comment", + regex: "#(?:[^%]|%[^>])*" + } + ]; + + for (var key in this.$rules) + this.$rules[key].unshift.apply(this.$rules[key], startRules); + + this.embedRules(ElixirHighlightRules, "elixir-", endRules, ["start"]); + + this.normalizeRules(); + }; + + + oop.inherits(HtmlElixirHighlightRules, HtmlHighlightRules); + + exports.HtmlElixirHighlightRules = HtmlElixirHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/elixir",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elixir_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = ElixirHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "#"; + this.$id = "ace/mode/elixir" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/html_elixir",["require","exports","module","ace/lib/oop","ace/mode/html_elixir_highlight_rules","ace/mode/html","ace/mode/javascript","ace/mode/css","ace/mode/elixir"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlElixirHighlightRules = require("./html_elixir_highlight_rules").HtmlElixirHighlightRules; +var HtmlMode = require("./html").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var ElixirMode = require("./elixir").Mode; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = HtmlElixirHighlightRules; + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode, + "elixir-": ElixirMode + }); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + + this.$id = "ace/mode/html_elixir"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-html_ruby.js b/htdocs/includes/ace/mode-html_ruby.js new file mode 100644 index 00000000000..593e9552220 --- /dev/null +++ b/htdocs/includes/ace/mode-html_ruby.js @@ -0,0 +1,3016 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var constantOtherSymbol = exports.constantOtherSymbol = { + token : "constant.other.symbol.ruby", // symbol + regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" +}; + +var qString = exports.qString = { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" +}; + +var qqString = exports.qqString = { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' +}; + +var tString = exports.tString = { + token : "string", // backtick string + regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" +}; + +var constantNumericHex = exports.constantNumericHex = { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" +}; + +var constantNumericFloat = exports.constantNumericFloat = { + token : "constant.numeric", // float + regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" +}; + +var instanceVariable = exports.instanceVariable = { + token : "variable.instance", // instance variable + regex : "@{1,2}[a-zA-Z_\\d]+" +}; + +var RubyHighlightRules = function() { + + var builtinFunctions = ( + "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + + "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + + "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + + "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + + "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + + "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + + "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + + "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + + "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + + "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + + "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + + "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + + "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + + "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + + "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + + "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + + "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + + "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + + "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + + "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + + "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + + "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + + "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + + "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + + "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + + "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + + "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + + "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + + "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + + "has_many|has_one|belongs_to|has_and_belongs_to_many" + ); + + var keywords = ( + "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + + "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + + "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" + ); + + var buildinConstants = ( + "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + + "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" + ); + + var builtinVariables = ( + "$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" + + "$!|root_url|flash|session|cookies|params|request|response|logger|self" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": buildinConstants, + "variable.language": builtinVariables, + "support.function": builtinFunctions, + "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "#.*$" + }, { + token : "comment", // multi line comment + regex : "^=begin(?:$|\\s.*$)", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, + + [{ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + return "paren.lparen"; + } + if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1) + return "paren.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.start", + regex : /"/, + push : [{ + token : "constant.language.escape", + regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/ + }, { + token : "paren.start", + regex : /#{/, + push : "start" + }, { + token : "string.end", + regex : /"/, + next : "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/ + }, { + token : "paren.start", + regex : /#{/, + push : "start" + }, { + token : "string.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : /'/, + push : [{ + token : "constant.language.escape", + regex : /\\['\\]/ + }, { + token : "string.end", + regex : /'/, + next : "pop" + }, { + defaultToken: "string" + }] + }], + + { + token : "text", // namespaces aren't symbols + regex : "::" + }, { + token : "variable.instance", // instance variable + regex : "@{1,2}[a-zA-Z_\\d]+" + }, { + token : "support.class", // class name + regex : "[A-Z][a-zA-Z_\\d]+" + }, + + constantOtherSymbol, + constantNumericHex, + constantNumericFloat, + + { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "punctuation.separator.key-value", + regex : "=>" + }, { + stateName: "heredoc", + onMatch : function(value, currentState, stack) { + var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; + var tokens = value.split(this.splitRegex); + stack.push(next, tokens[3]); + return [ + {type:"constant", value: tokens[1]}, + {type:"string", value: tokens[2]}, + {type:"support.class", value: tokens[3]}, + {type:"string", value: tokens[4]} + ]; + }, + regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", + rules: { + heredoc: [{ + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^ +" + }, { + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }] + } + }, { + regex : "$", + token : "empty", + next : function(currentState, stack) { + if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") + return stack[0]; + return currentState; + } + }, { + token : "string.character", + regex : "\\B\\?." + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "^=end(?:$|\\s.*$)", + next : "start" + }, { + token : "comment", // comment spanning whole line + regex : ".+" + } + ] + }; + + this.normalizeRules(); +}; + +oop.inherits(RubyHighlightRules, TextHighlightRules); + +exports.RubyHighlightRules = RubyHighlightRules; +}); + +ace.define("ace/mode/html_ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/ruby_highlight_rules"], function(require, exports, module) { + "use strict"; + + var oop = require("../lib/oop"); + var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; + + var HtmlRubyHighlightRules = function() { + HtmlHighlightRules.call(this); + + var startRules = [ + { + regex: "<%%|%%>", + token: "constant.language.escape" + }, { + token : "comment.start.erb", + regex : "<%#", + push : [{ + token : "comment.end.erb", + regex: "%>", + next: "pop", + defaultToken:"comment" + }] + }, { + token : "support.ruby_tag", + regex : "<%+(?!>)[-=]?", + push : "ruby-start" + } + ]; + + var endRules = [ + { + token : "support.ruby_tag", + regex : "%>", + next : "pop" + }, { + token: "comment", + regex: "#(?:[^%]|%[^>])*" + } + ]; + + for (var key in this.$rules) + this.$rules[key].unshift.apply(this.$rules[key], startRules); + + this.embedRules(RubyHighlightRules, "ruby-", endRules, ["start"]); + + this.normalizeRules(); + }; + + + oop.inherits(HtmlRubyHighlightRules, HtmlHighlightRules); + + exports.HtmlRubyHighlightRules = HtmlRubyHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = RubyHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/); + var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/); + var startingConditional = line.match(/^\s*(if|else|when)\s*/) + if (match || startingClassOrMethod || startingDoBlock || startingConditional) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return /^\s+(end|else)$/.test(line + input) || this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, session, row) { + var line = session.getLine(row); + if (/}/.test(line)) + return this.$outdent.autoOutdent(session, row); + var indent = this.$getIndent(line); + var prevLine = session.getLine(row - 1); + var prevIndent = this.$getIndent(prevLine); + var tab = session.getTabString(); + if (prevIndent.length <= indent.length) { + if (indent.slice(-tab.length) == tab) + session.remove(new Range(row, indent.length-tab.length, row, indent.length)); + } + }; + + this.$id = "ace/mode/ruby"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/html_ruby",["require","exports","module","ace/lib/oop","ace/mode/html_ruby_highlight_rules","ace/mode/html","ace/mode/javascript","ace/mode/css","ace/mode/ruby"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlRubyHighlightRules = require("./html_ruby_highlight_rules").HtmlRubyHighlightRules; +var HtmlMode = require("./html").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var RubyMode = require("./ruby").Mode; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = HtmlRubyHighlightRules; + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode, + "ruby-": RubyMode + }); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + + this.$id = "ace/mode/html_ruby"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-ini.js b/htdocs/includes/ace/mode-ini.js new file mode 100644 index 00000000000..f53e87f7daf --- /dev/null +++ b/htdocs/includes/ace/mode-ini.js @@ -0,0 +1,155 @@ +ace.define("ace/mode/ini_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var escapeRe = "\\\\(?:[\\\\0abtrn;#=:]|x[a-fA-F\\d]{4})"; + +var IniHighlightRules = function() { + this.$rules = { + start: [{ + token: 'punctuation.definition.comment.ini', + regex: '#.*', + push_: [{ + token: 'comment.line.number-sign.ini', + regex: '$|^', + next: 'pop' + }, { + defaultToken: 'comment.line.number-sign.ini' + }] + }, { + token: 'punctuation.definition.comment.ini', + regex: ';.*', + push_: [{ + token: 'comment.line.semicolon.ini', + regex: '$|^', + next: 'pop' + }, { + defaultToken: 'comment.line.semicolon.ini' + }] + }, { + token: ['keyword.other.definition.ini', 'text', 'punctuation.separator.key-value.ini'], + regex: '\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)' + }, { + token: ['punctuation.definition.entity.ini', 'constant.section.group-title.ini', 'punctuation.definition.entity.ini'], + regex: '^(\\[)(.*?)(\\])' + }, { + token: 'punctuation.definition.string.begin.ini', + regex: "'", + push: [{ + token: 'punctuation.definition.string.end.ini', + regex: "'", + next: 'pop' + }, { + token: "constant.language.escape", + regex: escapeRe + }, { + defaultToken: 'string.quoted.single.ini' + }] + }, { + token: 'punctuation.definition.string.begin.ini', + regex: '"', + push: [{ + token: "constant.language.escape", + regex: escapeRe + }, { + token: 'punctuation.definition.string.end.ini', + regex: '"', + next: 'pop' + }, { + defaultToken: 'string.quoted.double.ini' + }] + }] + }; + + this.normalizeRules(); +}; + +IniHighlightRules.metaData = { + fileTypes: ['ini', 'conf'], + keyEquivalent: '^~I', + name: 'Ini', + scopeName: 'source.ini' +}; + + +oop.inherits(IniHighlightRules, TextHighlightRules); + +exports.IniHighlightRules = IniHighlightRules; +}); + +ace.define("ace/mode/folding/ini",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function() { +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /^\s*\[([^\])]*)]\s*(?:$|[;#])/; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var re = this.foldingStartMarker; + var line = session.getLine(row); + + var m = line.match(re); + + if (!m) return; + + var startName = m[1] + "."; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + if (/^\s*$/.test(line)) + continue; + m = line.match(re); + if (m && m[1].lastIndexOf(startName, 0) !== 0) + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/ini",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ini_highlight_rules","ace/mode/folding/ini"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var IniHighlightRules = require("./ini_highlight_rules").IniHighlightRules; +var FoldMode = require("./folding/ini").FoldMode; + +var Mode = function() { + this.HighlightRules = IniHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = ";"; + this.blockComment = null; + this.$id = "ace/mode/ini"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-io.js b/htdocs/includes/ace/mode-io.js new file mode 100644 index 00000000000..93d53e2c4e1 --- /dev/null +++ b/htdocs/includes/ace/mode-io.js @@ -0,0 +1,246 @@ +ace.define("ace/mode/io_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var IoHighlightRules = function() { + + this.$rules = { start: + [ { token: [ 'text', 'meta.empty-parenthesis.io' ], + regex: '(\\()(\\))', + comment: 'we match this to overload return inside () --Allan; scoping rules for what gets the scope have changed, so we now group the ) instead of the ( -- Rob' }, + { token: [ 'text', 'meta.comma-parenthesis.io' ], + regex: '(\\,)(\\))', + comment: 'We want to do the same for ,) -- Seckar; same as above -- Rob' }, + { token: 'keyword.control.io', + regex: '\\b(?:if|ifTrue|ifFalse|ifTrueIfFalse|for|loop|reverseForeach|foreach|map|continue|break|while|do|return)\\b' }, + { token: 'punctuation.definition.comment.io', + regex: '/\\*', + push: + [ { token: 'punctuation.definition.comment.io', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.io' } ] }, + { token: 'punctuation.definition.comment.io', + regex: '//', + push: + [ { token: 'comment.line.double-slash.io', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.double-slash.io' } ] }, + { token: 'punctuation.definition.comment.io', + regex: '#', + push: + [ { token: 'comment.line.number-sign.io', regex: '$', next: 'pop' }, + { defaultToken: 'comment.line.number-sign.io' } ] }, + { token: 'variable.language.io', + regex: '\\b(?:self|sender|target|proto|protos|parent)\\b', + comment: 'I wonder if some of this isn\'t variable.other.language? --Allan; scoping this as variable.language to match Objective-C\'s handling of \'self\', which is inconsistent with C++\'s handling of \'this\' but perhaps intentionally so -- Rob' }, + { token: 'keyword.operator.io', + regex: '<=|>=|=|:=|\\*|\\||\\|\\||\\+|-|/|&|&&|>|<|\\?|@|@@|\\b(?:and|or)\\b' }, + { token: 'constant.other.io', regex: '\\bGL[\\w_]+\\b' }, + { token: 'support.class.io', regex: '\\b[A-Z](?:\\w+)?\\b' }, + { token: 'support.function.io', + regex: '\\b(?:clone|call|init|method|list|vector|block|\\w+(?=\\s*\\())\\b' }, + { token: 'support.function.open-gl.io', + regex: '\\bgl(?:u|ut)?[A-Z]\\w+\\b' }, + { token: 'punctuation.definition.string.begin.io', + regex: '"""', + push: + [ { token: 'punctuation.definition.string.end.io', + regex: '"""', + next: 'pop' }, + { token: 'constant.character.escape.io', regex: '\\\\.' }, + { defaultToken: 'string.quoted.triple.io' } ] }, + { token: 'punctuation.definition.string.begin.io', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.io', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.io', regex: '\\\\.' }, + { defaultToken: 'string.quoted.double.io' } ] }, + { token: 'constant.numeric.io', + regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' }, + { token: 'variable.other.global.io', regex: 'Lobby\\b' }, + { token: 'constant.language.io', + regex: '\\b(?:TRUE|true|FALSE|false|NULL|null|Null|Nil|nil|YES|NO)\\b' } ] } + + this.normalizeRules(); +}; + +IoHighlightRules.metaData = { fileTypes: [ 'io' ], + keyEquivalent: '^~I', + name: 'Io', + scopeName: 'source.io' } + + +oop.inherits(IoHighlightRules, TextHighlightRules); + +exports.IoHighlightRules = IoHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/io",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/io_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var IoHighlightRules = require("./io_highlight_rules").IoHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = IoHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/io"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-jack.js b/htdocs/includes/ace/mode-jack.js new file mode 100644 index 00000000000..ceaf1351a9a --- /dev/null +++ b/htdocs/includes/ace/mode-jack.js @@ -0,0 +1,339 @@ +ace.define("ace/mode/jack_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JackHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "string", + regex : '"', + next : "string2" + }, { + token : "string", + regex : "'", + next : "string1" + }, { + token : "constant.numeric", // hex + regex: "-?0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "(?:0|[-+]?[1-9][0-9]*)\\b" + }, { + token : "constant.binary", + regex : "<[0-9A-Fa-f][0-9A-Fa-f](\\s+[0-9A-Fa-f][0-9A-Fa-f])*>" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : "constant.language.null", + regex : "null\\b" + }, { + token : "storage.type", + regex: "(?:Integer|Boolean|Null|String|Buffer|Tuple|List|Object|Function|Coroutine|Form)\\b" + }, { + token : "keyword", + regex : "(?:return|abort|vars|for|delete|in|is|escape|exec|split|and|if|elif|else|while)\\b" + }, { + token : "language.builtin", + regex : "(?:lines|source|parse|read-stream|interval|substr|parseint|write|print|range|rand|inspect|bind|i-values|i-pairs|i-map|i-filter|i-chunk|i-all\\?|i-any\\?|i-collect|i-zip|i-merge|i-each)\\b" + }, { + token : "comment", + regex : "--.*$" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "storage.form", + regex : "@[a-z]+" + }, { + token : "constant.other.symbol", + regex : ':+[a-zA-Z_]([-]?[a-zA-Z0-9_])*[?!]?' + }, { + token : "variable", + regex : '[a-zA-Z_]([-]?[a-zA-Z0-9_])*[?!]?' + }, { + token : "keyword.operator", + regex : "\\|\\||\\^\\^|&&|!=|==|<=|<|>=|>|\\+|-|\\*|\\/|\\^|\\%|\\#|\\!" + }, { + token : "text", + regex : "\\s+" + } + ], + "string1" : [ + { + token : "constant.language.escape", + regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|['"\\\/bfnrt])/ + }, { + token : "string", + regex : "[^'\\\\]+" + }, { + token : "string", + regex : "'", + next : "start" + }, { + token : "string", + regex : "", + next : "start" + } + ], + "string2" : [ + { + token : "constant.language.escape", + regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|['"\\\/bfnrt])/ + }, { + token : "string", + regex : '[^"\\\\]+' + }, { + token : "string", + regex : '"', + next : "start" + }, { + token : "string", + regex : "", + next : "start" + } + ] + }; + +}; + +oop.inherits(JackHighlightRules, TextHighlightRules); + +exports.JackHighlightRules = JackHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/jack",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jack_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HighlightRules = require("./jack_highlight_rules").JackHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = HighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "--"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + + this.$id = "ace/mode/jack"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-jade.js b/htdocs/includes/ace/mode-jade.js new file mode 100644 index 00000000000..bfbe9c883f5 --- /dev/null +++ b/htdocs/includes/ace/mode-jade.js @@ -0,0 +1,2129 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; + +var escaped = function(ch) { + return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*"; +} + +function github_embed(tag, prefix) { + return { // Github style block + token : "support.function", + regex : "^\\s*```" + tag + "\\s*$", + push : prefix + "start" + }; +} + +var MarkdownHighlightRules = function() { + HtmlHighlightRules.call(this); + + this.$rules["start"].unshift({ + token : "empty_line", + regex : '^$', + next: "allowBlock" + }, { // h1 + token: "markup.heading.1", + regex: "^=+(?=\\s*$)" + }, { // h2 + token: "markup.heading.2", + regex: "^\\-+(?=\\s*$)" + }, { + token : function(value) { + return "markup.heading." + value.length; + }, + regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/, + next : "header" + }, + github_embed("(?:javascript|js)", "jscode-"), + github_embed("xml", "xmlcode-"), + github_embed("html", "htmlcode-"), + github_embed("css", "csscode-"), + { // Github style block + token : "support.function", + regex : "^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$", + next : "githubblock" + }, { // block quote + token : "string.blockquote", + regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", + next : "blockquote" + }, { // HR * - _ + token : "constant", + regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$", + next: "allowBlock" + }, { // list + token : "markup.list", + regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", + next : "listblock-start" + }, { + include : "basic" + }); + + this.addRules({ + "basic" : [{ + token : "constant.language.escape", + regex : /\\[\\`*_{}\[\]()#+\-.!]/ + }, { // code span ` + token : "support.function", + regex : "(`+)(.*?[^`])(\\1)" + }, { // reference + token : ["text", "constant", "text", "url", "string", "text"], + regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" + }, { // link by reference + token : ["text", "string", "text", "constant", "text"], + regex : "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)("+ escaped("]") + ")(\\])" + }, { // link by url + token : ["text", "string", "text", "markup.underline", "string", "text"], + regex : "(\\[)(" + // [ + escaped("]") + // link text + ")(\\]\\()"+ // ]( + '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href + '(\\s*"' + escaped('"') + '"\\s*)?' + // "title" + "(\\))" // ) + }, { // strong ** __ + token : "string.strong", + regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" + }, { // emphasis * _ + token : "string.emphasis", + regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" + }, { // + token : ["text", "url", "text"], + regex : "(<)("+ + "(?:https?|ftp|dict):[^'\">\\s]+"+ + "|"+ + "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+ + ")(>)" + }], + "allowBlock": [ + {token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, + {token : "empty_line", regex : '^$', next: "allowBlock"}, + {token : "empty", regex : "", next : "start"} + ], + + "header" : [{ + regex: "$", + next : "start" + }, { + include: "basic" + }, { + defaultToken : "heading" + } ], + + "listblock-start" : [{ + token : "support.variable", + regex : /(?:\[[ x]\])?/, + next : "listblock" + }], + + "listblock" : [ { // Lists only escape on completely blank lines. + token : "empty_line", + regex : "^$", + next : "start" + }, { // list + token : "markup.list", + regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", + next : "listblock-start" + }, { + include : "basic", noEscape: true + }, { // Github style block + token : "support.function", + regex : "^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$", + next : "githubblock" + }, { + defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly + } ], + + "blockquote" : [ { // Blockquotes only escape on blank lines. + token : "empty_line", + regex : "^\\s*$", + next : "start" + }, { // block quote + token : "string.blockquote", + regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", + next : "blockquote" + }, { + include : "basic", noEscape: true + }, { + defaultToken : "string.blockquote" + } ], + + "githubblock" : [ { + token : "support.function", + regex : "^\\s*```", + next : "start" + }, { + defaultToken : "support.function" + } ] + }); + + this.embedRules(JavaScriptHighlightRules, "jscode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(HtmlHighlightRules, "htmlcode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(CssHighlightRules, "csscode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(XmlHighlightRules, "xmlcode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.normalizeRules(); +}; +oop.inherits(MarkdownHighlightRules, TextHighlightRules); + +exports.MarkdownHighlightRules = MarkdownHighlightRules; +}); + +ace.define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ScssHighlightRules = function() { + + var properties = lang.arrayToMap( (function () { + + var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); + + var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + + "background-size|binding|border-bottom-colors|border-left-colors|" + + "border-right-colors|border-top-colors|border-end|border-end-color|" + + "border-end-style|border-end-width|border-image|border-start|" + + "border-start-color|border-start-style|border-start-width|box-align|" + + "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + + "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + + "column-rule-width|column-rule-style|column-rule-color|float-edge|" + + "font-feature-settings|font-language-override|force-broken-image-icon|" + + "image-region|margin-end|margin-start|opacity|outline|outline-color|" + + "outline-offset|outline-radius|outline-radius-bottomleft|" + + "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + + "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + + "tab-size|text-blink|text-decoration-color|text-decoration-line|" + + "text-decoration-style|transform|transform-origin|transition|" + + "transition-delay|transition-duration|transition-property|" + + "transition-timing-function|user-focus|user-input|user-modify|user-select|" + + "window-shadow|border-radius").split("|"); + + var properties = ("azimuth|background-attachment|background-color|background-image|" + + "background-position|background-repeat|background|border-bottom-color|" + + "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + + "border-color|border-left-color|border-left-style|border-left-width|" + + "border-left|border-right-color|border-right-style|border-right-width|" + + "border-right|border-spacing|border-style|border-top-color|" + + "border-top-style|border-top-width|border-top|border-width|border|bottom|" + + "box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + + "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + + "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + + "font-stretch|font-style|font-variant|font-weight|font|height|left|" + + "letter-spacing|line-height|list-style-image|list-style-position|" + + "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + + "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + + "min-width|opacity|orphans|outline-color|" + + "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + + "padding-left|padding-right|padding-top|padding|page-break-after|" + + "page-break-before|page-break-inside|page|pause-after|pause-before|" + + "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + + "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + + "stress|table-layout|text-align|text-decoration|text-indent|" + + "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + + "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + + "z-index").split("|"); + var ret = []; + for (var i=0, ln=browserPrefix.length; i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + }, { + caseInsensitive: true + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + regex : '.+' + } + ] + }; +}; + +oop.inherits(ScssHighlightRules, TextHighlightRules); + +exports.ScssHighlightRules = ScssHighlightRules; + +}); + +ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var CssHighlightRules = require('./css_highlight_rules'); + +var LessHighlightRules = function() { + + + var keywordList = "@import|@media|@font-face|@keyframes|@-webkit-keyframes|@supports|" + + "@charset|@plugin|@namespace|@document|@page|@viewport|@-ms-viewport|" + + "or|and|when|not"; + + var keywords = keywordList.split('|'); + + var properties = CssHighlightRules.supportType.split('|'); + + var keywordMapper = this.createKeywordMapper({ + "support.constant": CssHighlightRules.supportConstant, + "keyword": keywordList, + "support.constant.color": CssHighlightRules.supportConstantColor, + "support.constant.fonts": CssHighlightRules.supportConstantFonts + }, "identifier", true); + + var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : ["support.function", "paren.lparen", "string", "paren.rparen"], + regex : "(url)(\\()(.*)(\\))" + }, { + token : ["support.function", "paren.lparen"], + regex : "(:extend|[a-z0-9_\\-]+)(\\()" + }, { + token : function(value) { + if (keywords.indexOf(value.toLowerCase()) > -1) + return "keyword"; + else + return "variable"; + }, + regex : "[@\\$][a-z0-9_\\-@\\$]*\\b" + }, { + token : "variable", + regex : "[@\\$]\\{[a-z0-9_\\-@\\$]*\\}" + }, { + token : function(first, second) { + if(properties.indexOf(first.toLowerCase()) > -1) { + return ["support.type.property", "text"]; + } + else { + return ["support.type.unknownProperty", "text"]; + } + }, + regex : "([a-z0-9-_]+)(\\s*:)" + }, { + token : "keyword", + regex : "&" // special case - always treat as keyword + }, { + token : keywordMapper, + regex : "\\-?[@a-z_][@a-z0-9_\\-]*" + }, { + token: "variable.language", + regex: "#[a-z0-9-_]+" + }, { + token: "variable.language", + regex: "\\.[a-z0-9-_]+" + }, { + token: "variable.language", + regex: ":[a-z_][a-z0-9-_]*" + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + token : "keyword.operator", + regex : "<|>|<=|>=|=|!=|-|%|\\+|\\*" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + }, { + caseInsensitive: true + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + this.normalizeRules(); +}; + +oop.inherits(LessHighlightRules, TextHighlightRules); + +exports.LessHighlightRules = LessHighlightRules; + +}); + +ace.define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + + var oop = require("../lib/oop"); + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + + oop.inherits(CoffeeHighlightRules, TextHighlightRules); + + function CoffeeHighlightRules() { + var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; + + var keywords = ( + "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + + "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + + "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + + "or|on|unless|until|and|yes" + ); + + var langConstant = ( + "true|false|null|undefined|NaN|Infinity" + ); + + var illegal = ( + "case|const|default|function|var|void|with|enum|export|implements|" + + "interface|let|package|private|protected|public|static|yield" + ); + + var supportClass = ( + "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + + "SyntaxError|TypeError|URIError|" + + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" + ); + + var supportFunction = ( + "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + + "encodeURIComponent|decodeURI|decodeURIComponent|String|" + ); + + var variableLanguage = ( + "window|arguments|prototype|document" + ); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": langConstant, + "invalid.illegal": illegal, + "language.support.class": supportClass, + "language.support.function": supportFunction, + "variable.language": variableLanguage + }, "identifier"); + + var functionRule = { + token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], + regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()"'\/])*?)(\))(\s*))?([\-=]>)/.source + }; + + var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; + + this.$rules = { + start : [ + { + token : "constant.numeric", + regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" + }, { + stateName: "qdoc", + token : "string", regex : "'''", next : [ + {token : "string", regex : "'''", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + stateName: "qqdoc", + token : "string", + regex : '"""', + next : [ + {token : "string", regex : '"""', next : "start"}, + {token : "paren.string", regex : '#{', push : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + stateName: "qstring", + token : "string", regex : "'", next : [ + {token : "string", regex : "'", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + stateName: "qqstring", + token : "string.start", regex : '"', next : [ + {token : "string.end", regex : '"', next : "start"}, + {token : "paren.string", regex : '#{', push : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + stateName: "js", + token : "string", regex : "`", next : [ + {token : "string", regex : "`", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] + }, { + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + return "paren"; + } + if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift() || ""; + if (this.next.indexOf("string") != -1) + return "paren.string"; + } + return "paren"; + } + }, { + token : "string.regex", + regex : "///", + next : "heregex" + }, { + token : "string.regex", + regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ + }, { + token : "comment", + regex : "###(?!#)", + next : "comment" + }, { + token : "comment", + regex : "#.*" + }, { + token : ["punctuation.operator", "text", "identifier"], + regex : "(\\.)(\\s*)(" + illegal + ")" + }, { + token : "punctuation.operator", + regex : "\\.{1,3}" + }, { + token : ["keyword", "text", "language.support.class", + "text", "keyword", "text", "language.support.class"], + regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" + }, { + token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), + regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex + }, + functionRule, + { + token : "variable", + regex : "@(?:" + identifier + ")?" + }, { + token: keywordMapper, + regex : identifier + }, { + token : "punctuation.operator", + regex : "\\,|\\." + }, { + token : "storage.type", + regex : "[\\-=]>" + }, { + token : "keyword.operator", + regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" + }, { + token : "paren.lparen", + regex : "[({[]" + }, { + token : "paren.rparen", + regex : "[\\]})]" + }, { + token : "text", + regex : "\\s+" + }], + + + heregex : [{ + token : "string.regex", + regex : '.*?///[imgy]{0,4}', + next : "start" + }, { + token : "comment.regex", + regex : "\\s+(?:#.*)?" + }, { + token : "string.regex", + regex : "\\S+" + }], + + comment : [{ + token : "comment", + regex : '###', + next : "start" + }, { + defaultToken : "comment" + }] + }; + this.normalizeRules(); + } + + exports.CoffeeHighlightRules = CoffeeHighlightRules; +}); + +ace.define("ace/mode/jade_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/markdown_highlight_rules","ace/mode/scss_highlight_rules","ace/mode/less_highlight_rules","ace/mode/coffee_highlight_rules","ace/mode/javascript_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules; +var SassHighlightRules = require("./scss_highlight_rules").ScssHighlightRules; +var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules; +var CoffeeHighlightRules = require("./coffee_highlight_rules").CoffeeHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; + +function mixin_embed(tag, prefix) { + return { + token : "entity.name.function.jade", + regex : "^\\s*\\:" + tag, + next : prefix + "start" + }; +} + +var JadeHighlightRules = function() { + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-6][0-7]?|" + // oct + "37[0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = + { + "start": [ + { + token: "keyword.control.import.include.jade", + regex: "\\s*\\binclude\\b" + }, + { + token: "keyword.other.doctype.jade", + regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" + }, + { + onMatch: function(value, currentState, stack) { + stack.unshift(this.next, value.length - 2, currentState); + return "comment"; + }, + regex: /^\s*\/\//, + next: "comment_block" + }, + mixin_embed("markdown", "markdown-"), + mixin_embed("sass", "sass-"), + mixin_embed("less", "less-"), + mixin_embed("coffee", "coffee-"), + { + token: [ "storage.type.function.jade", + "entity.name.function.jade", + "punctuation.definition.parameters.begin.jade", + "variable.parameter.function.jade", + "punctuation.definition.parameters.end.jade" + ], + regex: "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))" + }, + { + token: [ "storage.type.function.jade", "entity.name.function.jade"], + regex: "^(\\s*mixin)( [\\w\\-]+)" + }, + { + token: "source.js.embedded.jade", + regex: "^\\s*(?:-|=|!=)", + next: "js-start" + }, + { + token: "string.interpolated.jade", + regex: "[#!]\\{[^\\}]+\\}" + }, + { + token: "meta.tag.any.jade", + regex: /^\s*(?!\w+:)(?:[\w-]+|(?=\.|#)])/, + next: "tag_single" + }, + { + token: "suport.type.attribute.id.jade", + regex: "#\\w+" + }, + { + token: "suport.type.attribute.class.jade", + regex: "\\.\\w+" + }, + { + token: "punctuation", + regex: "\\s*(?:\\()", + next: "tag_attributes" + } + ], + "comment_block": [ + {regex: /^\s*(?:\/\/)?/, onMatch: function(value, currentState, stack) { + if (value.length <= stack[1]) { + if (value.slice(-1) == "/") { + stack[1] = value.length - 2; + this.next = ""; + return "comment"; + } + stack.shift(); + stack.shift(); + this.next = stack.shift(); + return "text"; + } else { + this.next = ""; + return "comment"; + } + }, next: "start"}, + {defaultToken: "comment"} + ], + "tag_single": [ + { + token: "entity.other.attribute-name.class.jade", + regex: "\\.[\\w-]+" + }, + { + token: "entity.other.attribute-name.id.jade", + regex: "#[\\w-]+" + }, + { + token: ["text", "punctuation"], + regex: "($)|((?!\\.|#|=|-))", + next: "start" + } + ], + "tag_attributes": [ + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, + { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, + { + token: ["entity.other.attribute-name.jade", "punctuation"], + regex: "([a-zA-Z:\\.-]+)(=)?", + next: "attribute_strings" + }, + { + token: "punctuation", + regex: "\\)", + next: "start" + } + ], + "attribute_strings": [ + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, + { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, + { + token : "string", + regex : '(?=\\S)', + next : "tag_attributes" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : '[^"\\\\]+' + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "tag_attributes" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "[^'\\\\]+" + }, { + token : "string", + regex : "\\\\$", + next : "qstring" + }, { + token : "string", + regex : "'|$", + next : "tag_attributes" + } + ] +}; + + this.embedRules(JavaScriptHighlightRules, "js-", [{ + token: "text", + regex: ".$", + next: "start" + }]); +}; + +oop.inherits(JadeHighlightRules, TextHighlightRules); + +exports.JadeHighlightRules = JadeHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/jade",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jade_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = JadeHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.$id = "ace/mode/jade"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-java.js b/htdocs/includes/ace/mode-java.js new file mode 100644 index 00000000000..8fac1ebd73d --- /dev/null +++ b/htdocs/includes/ace/mode-java.js @@ -0,0 +1,935 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JavaHighlightRules = function() { + var keywords = ( + "abstract|continue|for|new|switch|" + + "assert|default|goto|package|synchronized|" + + "boolean|do|if|private|this|" + + "break|double|implements|protected|throw|" + + "byte|else|import|public|throws|" + + "case|enum|instanceof|return|transient|" + + "catch|extends|int|short|try|" + + "char|final|interface|static|void|" + + "class|finally|long|strictfp|volatile|" + + "const|float|native|super|while" + ); + + var buildinConstants = ("null|Infinity|NaN|undefined"); + + + var langClasses = ( + "AbstractMethodError|AssertionError|ClassCircularityError|"+ + "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ + "ExceptionInInitializerError|IllegalAccessError|"+ + "IllegalThreadStateException|InstantiationError|InternalError|"+ + "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ + "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ + "SuppressWarnings|TypeNotPresentException|UnknownError|"+ + "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ + "InstantiationException|IndexOutOfBoundsException|"+ + "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ + "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ + "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ + "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ + "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ + "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ + "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ + "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ + "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ + "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ + "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ + "ArrayStoreException|ClassCastException|LinkageError|"+ + "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ + "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ + "Cloneable|Class|CharSequence|Comparable|String|Object" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "constant.language": buildinConstants, + "support.function": langClasses + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/ + }, { + token : "constant.numeric", // float + regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/ + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(JavaHighlightRules, TextHighlightRules); + +exports.JavaHighlightRules = JavaHighlightRules; +}); + +ace.define("ace/mode/java",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/java_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptMode = require("./javascript").Mode; +var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules; + +var Mode = function() { + JavaScriptMode.call(this); + this.HighlightRules = JavaHighlightRules; +}; +oop.inherits(Mode, JavaScriptMode); + +(function() { + + this.createWorker = function(session) { + return null; + }; + + this.$id = "ace/mode/java"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-javascript.js b/htdocs/includes/ace/mode-javascript.js new file mode 100644 index 00000000000..0e4a81ac673 --- /dev/null +++ b/htdocs/includes/ace/mode-javascript.js @@ -0,0 +1,789 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-json.js b/htdocs/includes/ace/mode-json.js new file mode 100644 index 00000000000..6be2035eb97 --- /dev/null +++ b/htdocs/includes/ace/mode-json.js @@ -0,0 +1,319 @@ +ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JsonHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "variable", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' + }, { + token : "string", // single line + regex : '"', + next : "string" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : "text", // single quoted strings are not allowed + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "comment", // comments are not allowed, but who cares? + regex : "\\/\\/.*$" + }, { + token : "comment.start", // comments are not allowed, but who cares? + regex : "\\/\\*", + next : "comment" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "string" : [ + { + token : "constant.language.escape", + regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ + }, { + token : "string", + regex : '"|$', + next : "start" + }, { + defaultToken : "string" + } + ], + "comment" : [ + { + token : "comment.end", // comments are not allowed, but who cares? + regex : "\\*\\/", + next : "start" + }, { + defaultToken: "comment" + } + ] + }; + +}; + +oop.inherits(JsonHighlightRules, TextHighlightRules); + +exports.JsonHighlightRules = JsonHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HighlightRules = require("./json_highlight_rules").JsonHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var WorkerClient = require("../worker/worker_client").WorkerClient; + +var Mode = function() { + this.HighlightRules = HighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + + this.$id = "ace/mode/json"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-jsoniq.js b/htdocs/includes/ace/mode-jsoniq.js new file mode 100644 index 00000000000..c533c91644e --- /dev/null +++ b/htdocs/includes/ace/mode-jsoniq.js @@ -0,0 +1,2619 @@ +ace.define("ace/mode/xquery/jsoniq_lexer",["require","exports","module"], function(require, exports, module) { +module.exports = (function outer (modules, cache, entry) { + var previousRequire = typeof require == "function" && require; + function newRequire(name, jumped){ + if(!cache[name]) { + if(!modules[name]) { + var currentRequire = typeof require == "function" && require; + if (!jumped && currentRequire) return currentRequire(name, true); + if (previousRequire) return previousRequire(name, true); + var err = new Error('Cannot find module \'' + name + '\''); + err.code = 'MODULE_NOT_FOUND'; + throw err; + } + var m = cache[name] = {exports:{}}; + modules[name][0].call(m.exports, function(x){ + var id = modules[name][1][x]; + return newRequire(id ? id : x); + },m,m.exports,outer,modules,cache,entry); + } + return cache[name].exports; + } + for(var i=0;i= 0 ? JSONiqTokenizer.TOKEN[o] : null; + }; + + this.getExpectedTokenSet = function(e) + { + var expected; + if (e.getExpected() < 0) + { + expected = JSONiqTokenizer.getTokenSet(- e.getState()); + } + else + { + expected = [JSONiqTokenizer.TOKEN[e.getExpected()]]; + } + return expected; + }; + + this.getErrorMessage = function(e) + { + var tokenSet = this.getExpectedTokenSet(e); + var found = this.getOffendingToken(e); + var prefix = input.substring(0, e.getBegin()); + var lines = prefix.split("\n"); + var line = lines.length; + var column = lines[line - 1].length + 1; + var size = e.getEnd() - e.getBegin(); + return e.getMessage() + + (found == null ? "" : ", found " + found) + + "\nwhile expecting " + + (tokenSet.length == 1 ? tokenSet[0] : ("[" + tokenSet.join(", ") + "]")) + + "\n" + + (size == 0 || found != null ? "" : "after successfully scanning " + size + " characters beginning ") + + "at line " + line + ", column " + column + ":\n..." + + input.substring(e.getBegin(), Math.min(input.length, e.getBegin() + 64)) + + "..."; + }; + + this.parse_start = function() + { + eventHandler.startNonterminal("start", e0); + lookahead1W(14); // ModuleDecl | Annotation | OptionDecl | Operator | Variable | Tag | AttrTest | + switch (l1) + { + case 58: // '' | '=' | '>' + switch (l1) + { + case 61: // '>' + shift(61); // '>' + break; + case 53: // '/>' + shift(53); // '/>' + break; + case 29: // QName + shift(29); // QName + break; + case 60: // '=' + shift(60); // '=' + break; + case 37: // '"' + shift(37); // '"' + break; + case 41: // "'" + shift(41); // "'" + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("StartTag", e0); + }; + + this.parse_TagContent = function() + { + eventHandler.startNonterminal("TagContent", e0); + lookahead1(11); // Tag | EndTag | PredefinedEntityRef | ElementContentChar | CharRef | EOF | + switch (l1) + { + case 25: // ElementContentChar + shift(25); // ElementContentChar + break; + case 9: // Tag + shift(9); // Tag + break; + case 10: // EndTag + shift(10); // EndTag + break; + case 58: // '' + switch (l1) + { + case 14: // CDataSectionContents + shift(14); // CDataSectionContents + break; + case 67: // ']]>' + shift(67); // ']]>' + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("CData", e0); + }; + + this.parse_XMLComment = function() + { + eventHandler.startNonterminal("XMLComment", e0); + lookahead1(0); // DirCommentContents | EOF | '-->' + switch (l1) + { + case 12: // DirCommentContents + shift(12); // DirCommentContents + break; + case 50: // '-->' + shift(50); // '-->' + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("XMLComment", e0); + }; + + this.parse_PI = function() + { + eventHandler.startNonterminal("PI", e0); + lookahead1(3); // DirPIContents | EOF | '?' | '?>' + switch (l1) + { + case 13: // DirPIContents + shift(13); // DirPIContents + break; + case 62: // '?' + shift(62); // '?' + break; + case 63: // '?>' + shift(63); // '?>' + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("PI", e0); + }; + + this.parse_Pragma = function() + { + eventHandler.startNonterminal("Pragma", e0); + lookahead1(2); // PragmaContents | EOF | '#' | '#)' + switch (l1) + { + case 11: // PragmaContents + shift(11); // PragmaContents + break; + case 38: // '#' + shift(38); // '#' + break; + case 39: // '#)' + shift(39); // '#)' + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("Pragma", e0); + }; + + this.parse_Comment = function() + { + eventHandler.startNonterminal("Comment", e0); + lookahead1(4); // CommentContents | EOF | '(:' | ':)' + switch (l1) + { + case 55: // ':)' + shift(55); // ':)' + break; + case 44: // '(:' + shift(44); // '(:' + break; + case 32: // CommentContents + shift(32); // CommentContents + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("Comment", e0); + }; + + this.parse_CommentDoc = function() + { + eventHandler.startNonterminal("CommentDoc", e0); + lookahead1(6); // DocTag | DocCommentContents | EOF | '(:' | ':)' + switch (l1) + { + case 33: // DocTag + shift(33); // DocTag + break; + case 34: // DocCommentContents + shift(34); // DocCommentContents + break; + case 55: // ':)' + shift(55); // ':)' + break; + case 44: // '(:' + shift(44); // '(:' + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("CommentDoc", e0); + }; + + this.parse_QuotString = function() + { + eventHandler.startNonterminal("QuotString", e0); + lookahead1(5); // JSONChar | JSONCharRef | JSONPredefinedCharRef | EOF | '"' + switch (l1) + { + case 3: // JSONPredefinedCharRef + shift(3); // JSONPredefinedCharRef + break; + case 2: // JSONCharRef + shift(2); // JSONCharRef + break; + case 1: // JSONChar + shift(1); // JSONChar + break; + case 37: // '"' + shift(37); // '"' + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("QuotString", e0); + }; + + this.parse_AposString = function() + { + eventHandler.startNonterminal("AposString", e0); + lookahead1(7); // PredefinedEntityRef | EscapeApos | AposChar | CharRef | EOF | "'" + switch (l1) + { + case 21: // PredefinedEntityRef + shift(21); // PredefinedEntityRef + break; + case 31: // CharRef + shift(31); // CharRef + break; + case 23: // EscapeApos + shift(23); // EscapeApos + break; + case 24: // AposChar + shift(24); // AposChar + break; + case 41: // "'" + shift(41); // "'" + break; + default: + shift(35); // EOF + } + eventHandler.endNonterminal("AposString", e0); + }; + + this.parse_Prefix = function() + { + eventHandler.startNonterminal("Prefix", e0); + lookahead1W(13); // NCName^Token | S^WS | 'after' | 'allowing' | 'ancestor' | 'ancestor-or-self' | + whitespace(); + parse_NCName(); + eventHandler.endNonterminal("Prefix", e0); + }; + + this.parse__EQName = function() + { + eventHandler.startNonterminal("_EQName", e0); + lookahead1W(12); // EQName^Token | S^WS | 'after' | 'allowing' | 'ancestor' | 'ancestor-or-self' | + whitespace(); + parse_EQName(); + eventHandler.endNonterminal("_EQName", e0); + }; + + function parse_EQName() + { + eventHandler.startNonterminal("EQName", e0); + switch (l1) + { + case 80: // 'attribute' + shift(80); // 'attribute' + break; + case 94: // 'comment' + shift(94); // 'comment' + break; + case 118: // 'document-node' + shift(118); // 'document-node' + break; + case 119: // 'element' + shift(119); // 'element' + break; + case 122: // 'empty-sequence' + shift(122); // 'empty-sequence' + break; + case 143: // 'function' + shift(143); // 'function' + break; + case 150: // 'if' + shift(150); // 'if' + break; + case 163: // 'item' + shift(163); // 'item' + break; + case 183: // 'namespace-node' + shift(183); // 'namespace-node' + break; + case 189: // 'node' + shift(189); // 'node' + break; + case 214: // 'processing-instruction' + shift(214); // 'processing-instruction' + break; + case 224: // 'schema-attribute' + shift(224); // 'schema-attribute' + break; + case 225: // 'schema-element' + shift(225); // 'schema-element' + break; + case 241: // 'switch' + shift(241); // 'switch' + break; + case 242: // 'text' + shift(242); // 'text' + break; + case 251: // 'typeswitch' + shift(251); // 'typeswitch' + break; + default: + parse_FunctionName(); + } + eventHandler.endNonterminal("EQName", e0); + } + + function parse_FunctionName() + { + eventHandler.startNonterminal("FunctionName", e0); + switch (l1) + { + case 17: // EQName^Token + shift(17); // EQName^Token + break; + case 68: // 'after' + shift(68); // 'after' + break; + case 71: // 'ancestor' + shift(71); // 'ancestor' + break; + case 72: // 'ancestor-or-self' + shift(72); // 'ancestor-or-self' + break; + case 73: // 'and' + shift(73); // 'and' + break; + case 77: // 'as' + shift(77); // 'as' + break; + case 78: // 'ascending' + shift(78); // 'ascending' + break; + case 82: // 'before' + shift(82); // 'before' + break; + case 86: // 'case' + shift(86); // 'case' + break; + case 87: // 'cast' + shift(87); // 'cast' + break; + case 88: // 'castable' + shift(88); // 'castable' + break; + case 91: // 'child' + shift(91); // 'child' + break; + case 92: // 'collation' + shift(92); // 'collation' + break; + case 101: // 'copy' + shift(101); // 'copy' + break; + case 103: // 'count' + shift(103); // 'count' + break; + case 106: // 'declare' + shift(106); // 'declare' + break; + case 107: // 'default' + shift(107); // 'default' + break; + case 108: // 'delete' + shift(108); // 'delete' + break; + case 109: // 'descendant' + shift(109); // 'descendant' + break; + case 110: // 'descendant-or-self' + shift(110); // 'descendant-or-self' + break; + case 111: // 'descending' + shift(111); // 'descending' + break; + case 116: // 'div' + shift(116); // 'div' + break; + case 117: // 'document' + shift(117); // 'document' + break; + case 120: // 'else' + shift(120); // 'else' + break; + case 121: // 'empty' + shift(121); // 'empty' + break; + case 124: // 'end' + shift(124); // 'end' + break; + case 126: // 'eq' + shift(126); // 'eq' + break; + case 127: // 'every' + shift(127); // 'every' + break; + case 129: // 'except' + shift(129); // 'except' + break; + case 132: // 'first' + shift(132); // 'first' + break; + case 133: // 'following' + shift(133); // 'following' + break; + case 134: // 'following-sibling' + shift(134); // 'following-sibling' + break; + case 135: // 'for' + shift(135); // 'for' + break; + case 144: // 'ge' + shift(144); // 'ge' + break; + case 146: // 'group' + shift(146); // 'group' + break; + case 148: // 'gt' + shift(148); // 'gt' + break; + case 149: // 'idiv' + shift(149); // 'idiv' + break; + case 151: // 'import' + shift(151); // 'import' + break; + case 157: // 'insert' + shift(157); // 'insert' + break; + case 158: // 'instance' + shift(158); // 'instance' + break; + case 160: // 'intersect' + shift(160); // 'intersect' + break; + case 161: // 'into' + shift(161); // 'into' + break; + case 162: // 'is' + shift(162); // 'is' + break; + case 168: // 'last' + shift(168); // 'last' + break; + case 170: // 'le' + shift(170); // 'le' + break; + case 172: // 'let' + shift(172); // 'let' + break; + case 176: // 'lt' + shift(176); // 'lt' + break; + case 178: // 'mod' + shift(178); // 'mod' + break; + case 179: // 'modify' + shift(179); // 'modify' + break; + case 180: // 'module' + shift(180); // 'module' + break; + case 182: // 'namespace' + shift(182); // 'namespace' + break; + case 184: // 'ne' + shift(184); // 'ne' + break; + case 196: // 'only' + shift(196); // 'only' + break; + case 198: // 'or' + shift(198); // 'or' + break; + case 199: // 'order' + shift(199); // 'order' + break; + case 200: // 'ordered' + shift(200); // 'ordered' + break; + case 204: // 'parent' + shift(204); // 'parent' + break; + case 210: // 'preceding' + shift(210); // 'preceding' + break; + case 211: // 'preceding-sibling' + shift(211); // 'preceding-sibling' + break; + case 216: // 'rename' + shift(216); // 'rename' + break; + case 217: // 'replace' + shift(217); // 'replace' + break; + case 218: // 'return' + shift(218); // 'return' + break; + case 222: // 'satisfies' + shift(222); // 'satisfies' + break; + case 227: // 'self' + shift(227); // 'self' + break; + case 233: // 'some' + shift(233); // 'some' + break; + case 234: // 'stable' + shift(234); // 'stable' + break; + case 235: // 'start' + shift(235); // 'start' + break; + case 246: // 'to' + shift(246); // 'to' + break; + case 247: // 'treat' + shift(247); // 'treat' + break; + case 248: // 'try' + shift(248); // 'try' + break; + case 252: // 'union' + shift(252); // 'union' + break; + case 254: // 'unordered' + shift(254); // 'unordered' + break; + case 258: // 'validate' + shift(258); // 'validate' + break; + case 264: // 'where' + shift(264); // 'where' + break; + case 268: // 'with' + shift(268); // 'with' + break; + case 272: // 'xquery' + shift(272); // 'xquery' + break; + case 70: // 'allowing' + shift(70); // 'allowing' + break; + case 79: // 'at' + shift(79); // 'at' + break; + case 81: // 'base-uri' + shift(81); // 'base-uri' + break; + case 83: // 'boundary-space' + shift(83); // 'boundary-space' + break; + case 84: // 'break' + shift(84); // 'break' + break; + case 89: // 'catch' + shift(89); // 'catch' + break; + case 96: // 'construction' + shift(96); // 'construction' + break; + case 99: // 'context' + shift(99); // 'context' + break; + case 100: // 'continue' + shift(100); // 'continue' + break; + case 102: // 'copy-namespaces' + shift(102); // 'copy-namespaces' + break; + case 104: // 'decimal-format' + shift(104); // 'decimal-format' + break; + case 123: // 'encoding' + shift(123); // 'encoding' + break; + case 130: // 'exit' + shift(130); // 'exit' + break; + case 131: // 'external' + shift(131); // 'external' + break; + case 139: // 'ft-option' + shift(139); // 'ft-option' + break; + case 152: // 'in' + shift(152); // 'in' + break; + case 153: // 'index' + shift(153); // 'index' + break; + case 159: // 'integrity' + shift(159); // 'integrity' + break; + case 169: // 'lax' + shift(169); // 'lax' + break; + case 190: // 'nodes' + shift(190); // 'nodes' + break; + case 197: // 'option' + shift(197); // 'option' + break; + case 201: // 'ordering' + shift(201); // 'ordering' + break; + case 220: // 'revalidation' + shift(220); // 'revalidation' + break; + case 223: // 'schema' + shift(223); // 'schema' + break; + case 226: // 'score' + shift(226); // 'score' + break; + case 232: // 'sliding' + shift(232); // 'sliding' + break; + case 238: // 'strict' + shift(238); // 'strict' + break; + case 249: // 'tumbling' + shift(249); // 'tumbling' + break; + case 250: // 'type' + shift(250); // 'type' + break; + case 255: // 'updating' + shift(255); // 'updating' + break; + case 259: // 'value' + shift(259); // 'value' + break; + case 260: // 'variable' + shift(260); // 'variable' + break; + case 261: // 'version' + shift(261); // 'version' + break; + case 265: // 'while' + shift(265); // 'while' + break; + case 95: // 'constraint' + shift(95); // 'constraint' + break; + case 174: // 'loop' + shift(174); // 'loop' + break; + default: + shift(219); // 'returning' + } + eventHandler.endNonterminal("FunctionName", e0); + } + + function parse_NCName() + { + eventHandler.startNonterminal("NCName", e0); + switch (l1) + { + case 28: // NCName^Token + shift(28); // NCName^Token + break; + case 68: // 'after' + shift(68); // 'after' + break; + case 73: // 'and' + shift(73); // 'and' + break; + case 77: // 'as' + shift(77); // 'as' + break; + case 78: // 'ascending' + shift(78); // 'ascending' + break; + case 82: // 'before' + shift(82); // 'before' + break; + case 86: // 'case' + shift(86); // 'case' + break; + case 87: // 'cast' + shift(87); // 'cast' + break; + case 88: // 'castable' + shift(88); // 'castable' + break; + case 92: // 'collation' + shift(92); // 'collation' + break; + case 103: // 'count' + shift(103); // 'count' + break; + case 107: // 'default' + shift(107); // 'default' + break; + case 111: // 'descending' + shift(111); // 'descending' + break; + case 116: // 'div' + shift(116); // 'div' + break; + case 120: // 'else' + shift(120); // 'else' + break; + case 121: // 'empty' + shift(121); // 'empty' + break; + case 124: // 'end' + shift(124); // 'end' + break; + case 126: // 'eq' + shift(126); // 'eq' + break; + case 129: // 'except' + shift(129); // 'except' + break; + case 135: // 'for' + shift(135); // 'for' + break; + case 144: // 'ge' + shift(144); // 'ge' + break; + case 146: // 'group' + shift(146); // 'group' + break; + case 148: // 'gt' + shift(148); // 'gt' + break; + case 149: // 'idiv' + shift(149); // 'idiv' + break; + case 158: // 'instance' + shift(158); // 'instance' + break; + case 160: // 'intersect' + shift(160); // 'intersect' + break; + case 161: // 'into' + shift(161); // 'into' + break; + case 162: // 'is' + shift(162); // 'is' + break; + case 170: // 'le' + shift(170); // 'le' + break; + case 172: // 'let' + shift(172); // 'let' + break; + case 176: // 'lt' + shift(176); // 'lt' + break; + case 178: // 'mod' + shift(178); // 'mod' + break; + case 179: // 'modify' + shift(179); // 'modify' + break; + case 184: // 'ne' + shift(184); // 'ne' + break; + case 196: // 'only' + shift(196); // 'only' + break; + case 198: // 'or' + shift(198); // 'or' + break; + case 199: // 'order' + shift(199); // 'order' + break; + case 218: // 'return' + shift(218); // 'return' + break; + case 222: // 'satisfies' + shift(222); // 'satisfies' + break; + case 234: // 'stable' + shift(234); // 'stable' + break; + case 235: // 'start' + shift(235); // 'start' + break; + case 246: // 'to' + shift(246); // 'to' + break; + case 247: // 'treat' + shift(247); // 'treat' + break; + case 252: // 'union' + shift(252); // 'union' + break; + case 264: // 'where' + shift(264); // 'where' + break; + case 268: // 'with' + shift(268); // 'with' + break; + case 71: // 'ancestor' + shift(71); // 'ancestor' + break; + case 72: // 'ancestor-or-self' + shift(72); // 'ancestor-or-self' + break; + case 80: // 'attribute' + shift(80); // 'attribute' + break; + case 91: // 'child' + shift(91); // 'child' + break; + case 94: // 'comment' + shift(94); // 'comment' + break; + case 101: // 'copy' + shift(101); // 'copy' + break; + case 106: // 'declare' + shift(106); // 'declare' + break; + case 108: // 'delete' + shift(108); // 'delete' + break; + case 109: // 'descendant' + shift(109); // 'descendant' + break; + case 110: // 'descendant-or-self' + shift(110); // 'descendant-or-self' + break; + case 117: // 'document' + shift(117); // 'document' + break; + case 118: // 'document-node' + shift(118); // 'document-node' + break; + case 119: // 'element' + shift(119); // 'element' + break; + case 122: // 'empty-sequence' + shift(122); // 'empty-sequence' + break; + case 127: // 'every' + shift(127); // 'every' + break; + case 132: // 'first' + shift(132); // 'first' + break; + case 133: // 'following' + shift(133); // 'following' + break; + case 134: // 'following-sibling' + shift(134); // 'following-sibling' + break; + case 143: // 'function' + shift(143); // 'function' + break; + case 150: // 'if' + shift(150); // 'if' + break; + case 151: // 'import' + shift(151); // 'import' + break; + case 157: // 'insert' + shift(157); // 'insert' + break; + case 163: // 'item' + shift(163); // 'item' + break; + case 168: // 'last' + shift(168); // 'last' + break; + case 180: // 'module' + shift(180); // 'module' + break; + case 182: // 'namespace' + shift(182); // 'namespace' + break; + case 183: // 'namespace-node' + shift(183); // 'namespace-node' + break; + case 189: // 'node' + shift(189); // 'node' + break; + case 200: // 'ordered' + shift(200); // 'ordered' + break; + case 204: // 'parent' + shift(204); // 'parent' + break; + case 210: // 'preceding' + shift(210); // 'preceding' + break; + case 211: // 'preceding-sibling' + shift(211); // 'preceding-sibling' + break; + case 214: // 'processing-instruction' + shift(214); // 'processing-instruction' + break; + case 216: // 'rename' + shift(216); // 'rename' + break; + case 217: // 'replace' + shift(217); // 'replace' + break; + case 224: // 'schema-attribute' + shift(224); // 'schema-attribute' + break; + case 225: // 'schema-element' + shift(225); // 'schema-element' + break; + case 227: // 'self' + shift(227); // 'self' + break; + case 233: // 'some' + shift(233); // 'some' + break; + case 241: // 'switch' + shift(241); // 'switch' + break; + case 242: // 'text' + shift(242); // 'text' + break; + case 248: // 'try' + shift(248); // 'try' + break; + case 251: // 'typeswitch' + shift(251); // 'typeswitch' + break; + case 254: // 'unordered' + shift(254); // 'unordered' + break; + case 258: // 'validate' + shift(258); // 'validate' + break; + case 260: // 'variable' + shift(260); // 'variable' + break; + case 272: // 'xquery' + shift(272); // 'xquery' + break; + case 70: // 'allowing' + shift(70); // 'allowing' + break; + case 79: // 'at' + shift(79); // 'at' + break; + case 81: // 'base-uri' + shift(81); // 'base-uri' + break; + case 83: // 'boundary-space' + shift(83); // 'boundary-space' + break; + case 84: // 'break' + shift(84); // 'break' + break; + case 89: // 'catch' + shift(89); // 'catch' + break; + case 96: // 'construction' + shift(96); // 'construction' + break; + case 99: // 'context' + shift(99); // 'context' + break; + case 100: // 'continue' + shift(100); // 'continue' + break; + case 102: // 'copy-namespaces' + shift(102); // 'copy-namespaces' + break; + case 104: // 'decimal-format' + shift(104); // 'decimal-format' + break; + case 123: // 'encoding' + shift(123); // 'encoding' + break; + case 130: // 'exit' + shift(130); // 'exit' + break; + case 131: // 'external' + shift(131); // 'external' + break; + case 139: // 'ft-option' + shift(139); // 'ft-option' + break; + case 152: // 'in' + shift(152); // 'in' + break; + case 153: // 'index' + shift(153); // 'index' + break; + case 159: // 'integrity' + shift(159); // 'integrity' + break; + case 169: // 'lax' + shift(169); // 'lax' + break; + case 190: // 'nodes' + shift(190); // 'nodes' + break; + case 197: // 'option' + shift(197); // 'option' + break; + case 201: // 'ordering' + shift(201); // 'ordering' + break; + case 220: // 'revalidation' + shift(220); // 'revalidation' + break; + case 223: // 'schema' + shift(223); // 'schema' + break; + case 226: // 'score' + shift(226); // 'score' + break; + case 232: // 'sliding' + shift(232); // 'sliding' + break; + case 238: // 'strict' + shift(238); // 'strict' + break; + case 249: // 'tumbling' + shift(249); // 'tumbling' + break; + case 250: // 'type' + shift(250); // 'type' + break; + case 255: // 'updating' + shift(255); // 'updating' + break; + case 259: // 'value' + shift(259); // 'value' + break; + case 261: // 'version' + shift(261); // 'version' + break; + case 265: // 'while' + shift(265); // 'while' + break; + case 95: // 'constraint' + shift(95); // 'constraint' + break; + case 174: // 'loop' + shift(174); // 'loop' + break; + default: + shift(219); // 'returning' + } + eventHandler.endNonterminal("NCName", e0); + } + + function shift(t) + { + if (l1 == t) + { + whitespace(); + eventHandler.terminal(JSONiqTokenizer.TOKEN[l1], b1, e1 > size ? size : e1); + b0 = b1; e0 = e1; l1 = 0; + } + else + { + error(b1, e1, 0, l1, t); + } + } + + function whitespace() + { + if (e0 != b1) + { + b0 = e0; + e0 = b1; + eventHandler.whitespace(b0, e0); + } + } + + function matchW(set) + { + var code; + for (;;) + { + code = match(set); + if (code != 30) // S^WS + { + break; + } + } + return code; + } + + function lookahead1W(set) + { + if (l1 == 0) + { + l1 = matchW(set); + b1 = begin; + e1 = end; + } + } + + function lookahead1(set) + { + if (l1 == 0) + { + l1 = match(set); + b1 = begin; + e1 = end; + } + } + + function error(b, e, s, l, t) + { + throw new self.ParseException(b, e, s, l, t); + } + + var lk, b0, e0; + var l1, b1, e1; + var eventHandler; + + var input; + var size; + var begin; + var end; + + function match(tokenSetId) + { + var nonbmp = false; + begin = end; + var current = end; + var result = JSONiqTokenizer.INITIAL[tokenSetId]; + var state = 0; + + for (var code = result & 4095; code != 0; ) + { + var charclass; + var c0 = current < size ? input.charCodeAt(current) : 0; + ++current; + if (c0 < 0x80) + { + charclass = JSONiqTokenizer.MAP0[c0]; + } + else if (c0 < 0xd800) + { + var c1 = c0 >> 4; + charclass = JSONiqTokenizer.MAP1[(c0 & 15) + JSONiqTokenizer.MAP1[(c1 & 31) + JSONiqTokenizer.MAP1[c1 >> 5]]]; + } + else + { + if (c0 < 0xdc00) + { + var c1 = current < size ? input.charCodeAt(current) : 0; + if (c1 >= 0xdc00 && c1 < 0xe000) + { + ++current; + c0 = ((c0 & 0x3ff) << 10) + (c1 & 0x3ff) + 0x10000; + nonbmp = true; + } + } + var lo = 0, hi = 5; + for (var m = 3; ; m = (hi + lo) >> 1) + { + if (JSONiqTokenizer.MAP2[m] > c0) hi = m - 1; + else if (JSONiqTokenizer.MAP2[6 + m] < c0) lo = m + 1; + else {charclass = JSONiqTokenizer.MAP2[12 + m]; break;} + if (lo > hi) {charclass = 0; break;} + } + } + + state = code; + var i0 = (charclass << 12) + code - 1; + code = JSONiqTokenizer.TRANSITION[(i0 & 15) + JSONiqTokenizer.TRANSITION[i0 >> 4]]; + + if (code > 4095) + { + result = code; + code &= 4095; + end = current; + } + } + + result >>= 12; + if (result == 0) + { + end = current - 1; + var c1 = end < size ? input.charCodeAt(end) : 0; + if (c1 >= 0xdc00 && c1 < 0xe000) --end; + return error(begin, end, state, -1, -1); + } + + if (nonbmp) + { + for (var i = result >> 9; i > 0; --i) + { + --end; + var c1 = end < size ? input.charCodeAt(end) : 0; + if (c1 >= 0xdc00 && c1 < 0xe000) --end; + } + } + else + { + end -= result >> 9; + } + + return (result & 511) - 1; + } +} + +JSONiqTokenizer.getTokenSet = function(tokenSetId) +{ + var set = []; + var s = tokenSetId < 0 ? - tokenSetId : INITIAL[tokenSetId] & 4095; + for (var i = 0; i < 279; i += 32) + { + var j = i; + var i0 = (i >> 5) * 2066 + s - 1; + var i1 = i0 >> 2; + var i2 = i1 >> 2; + var f = JSONiqTokenizer.EXPECTED[(i0 & 3) + JSONiqTokenizer.EXPECTED[(i1 & 3) + JSONiqTokenizer.EXPECTED[(i2 & 3) + JSONiqTokenizer.EXPECTED[i2 >> 2]]]]; + for ( ; f != 0; f >>>= 1, ++j) + { + if ((f & 1) != 0) + { + set.push(JSONiqTokenizer.TOKEN[j]); + } + } + } + return set; +}; + +JSONiqTokenizer.MAP0 = +[ 67, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, 33, 31, 31, 31, 31, 31, 31, 34, 35, 36, 37, 31, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 31, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 31, 62, 63, 64, 65, 37 +]; + +JSONiqTokenizer.MAP1 = +[ 108, 124, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 156, 181, 181, 181, 181, 181, 214, 215, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 247, 261, 277, 293, 309, 347, 363, 379, 416, 416, 416, 408, 331, 323, 331, 323, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 433, 433, 433, 433, 433, 433, 433, 316, 331, 331, 331, 331, 331, 331, 331, 331, 394, 416, 416, 417, 415, 416, 416, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 330, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 416, 67, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 37, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, 33, 31, 31, 31, 31, 31, 31, 34, 35, 36, 37, 31, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 31, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 31, 62, 63, 64, 65, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 31, 31, 37, 37, 37, 37, 37, 37, 37, 66, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66 +]; + +JSONiqTokenizer.MAP2 = +[ 57344, 63744, 64976, 65008, 65536, 983040, 63743, 64975, 65007, 65533, 983039, 1114111, 37, 31, 37, 31, 31, 37 +]; + +JSONiqTokenizer.INITIAL = +[ 1, 2, 49155, 57348, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 +]; + +JSONiqTokenizer.TRANSITION = +[ 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 17408, 19288, 17439, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 22126, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17672, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 19469, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 36919, 18234, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18419, 18432, 18304, 18448, 18485, 18523, 18553, 18583, 18599, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 18825, 18841, 18871, 18906, 18944, 18960, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19074, 36169, 17439, 36866, 17466, 36890, 36866, 22314, 19105, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 22126, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17672, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 19469, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 36919, 18234, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18419, 18432, 18304, 18448, 18485, 18523, 18553, 18583, 18599, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 18825, 18841, 18871, 18906, 18944, 18960, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22182, 19288, 19121, 36866, 17466, 18345, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19273, 19552, 19304, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19332, 17423, 19363, 36866, 17466, 17537, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 18614, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 19391, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 19427, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36154, 19288, 19457, 36866, 17466, 17740, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22780, 19288, 19457, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22375, 22197, 18469, 36866, 17466, 36890, 36866, 21991, 24018, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 21331, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 19485, 19501, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19537, 22390, 19568, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19596, 19611, 19457, 36866, 17466, 36890, 36866, 18246, 19627, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22242, 20553, 19457, 36866, 17466, 36890, 36866, 18648, 30477, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36472, 19288, 19457, 36866, 17466, 17809, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 21770, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 19643, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 19672, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 20538, 19288, 19457, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 17975, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22345, 19288, 19457, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19726, 19742, 21529, 24035, 23112, 26225, 23511, 27749, 27397, 24035, 34360, 24035, 24036, 23114, 35166, 23114, 23114, 19758, 23511, 35247, 23511, 23511, 28447, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 24254, 19821, 23511, 23511, 23511, 23511, 23512, 19441, 36539, 24035, 24035, 24035, 24035, 19846, 19869, 23114, 23114, 23114, 28618, 32187, 19892, 23511, 23511, 23511, 34585, 20402, 36647, 24035, 24035, 24036, 23114, 33757, 23114, 23114, 23029, 20271, 23511, 27070, 23511, 23511, 30562, 24035, 24035, 29274, 26576, 23114, 23114, 31118, 23036, 29695, 23511, 23511, 32431, 23634, 30821, 24035, 23110, 19913, 23114, 23467, 31261, 23261, 34299, 19932, 24035, 32609, 19965, 35389, 19984, 27689, 19830, 29391, 29337, 20041, 22643, 35619, 33728, 20062, 20121, 20166, 35100, 26145, 20211, 23008, 19876, 20208, 20227, 25670, 20132, 26578, 27685, 20141, 20243, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36094, 19288, 19457, 36866, 17466, 21724, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22735, 19552, 20287, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22750, 19288, 21529, 24035, 23112, 28056, 23511, 29483, 28756, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 20327, 23511, 23511, 23511, 23511, 31156, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 24254, 20371, 23511, 23511, 23511, 23511, 27443, 20395, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 29457, 29700, 23511, 23511, 23511, 23511, 33444, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 28350, 20421, 23511, 23511, 23511, 23511, 25645, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 20447, 20475, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 20523, 22257, 20569, 20783, 21715, 17603, 20699, 20837, 20614, 20630, 21149, 20670, 21405, 17486, 17509, 17525, 18373, 19179, 20695, 20716, 20732, 20755, 19194, 18042, 21641, 20592, 20779, 20598, 21412, 17470, 17591, 20896, 17468, 17619, 20799, 20700, 21031, 20744, 20699, 20828, 18075, 21259, 20581, 20853, 18048, 20868, 20884, 17756, 17784, 17800, 17825, 17854, 21171, 21200, 20931, 20947, 21378, 20955, 20971, 18086, 20645, 21002, 20986, 18178, 17960, 18012, 18381, 18064, 29176, 21044, 21438, 21018, 21122, 21393, 21060, 21844, 21094, 20654, 17493, 18150, 18166, 18214, 25967, 20763, 21799, 21110, 21830, 21138, 21246, 21301, 18336, 18361, 21165, 21187, 20812, 21216, 21232, 21287, 21317, 18553, 21347, 21363, 21428, 21454, 21271, 21483, 21499, 21515, 21575, 21467, 18712, 21591, 21633, 21078, 18189, 18198, 20679, 21657, 21701, 21074, 21687, 21740, 21756, 21786, 21815, 21860, 21876, 21892, 21946, 21962, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36457, 19288, 19457, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 36813, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 21981, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 22151, 22007, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 27898, 17884, 18890, 17906, 17928, 22042, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 22070, 22112, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 22142, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36109, 19288, 18469, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22167, 19288, 19457, 36866, 17466, 17768, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22227, 36487, 22273, 36866, 17466, 36890, 36866, 19316, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18749, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 22304, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 19580, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22330, 19089, 19457, 36866, 17466, 18721, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22765, 19347, 19457, 36866, 17466, 36890, 36866, 18114, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 24035, 23112, 32618, 23511, 29483, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 29116, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 27443, 22493, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34541, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 22839, 23511, 23511, 23511, 23511, 25645, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 32683, 22516, 23511, 23511, 23511, 22540, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 24035, 23112, 32618, 23511, 29483, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 29116, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 27443, 22493, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34564, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 22839, 23511, 23511, 23511, 23511, 25645, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 32683, 22516, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 24035, 23112, 32618, 23511, 29483, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 29908, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 27443, 22493, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34564, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 22839, 23511, 23511, 23511, 23511, 25645, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 32683, 22516, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 24035, 23112, 32618, 23511, 29483, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 29116, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 27443, 22561, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34564, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 22839, 23511, 23511, 23511, 23511, 25645, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 32683, 22516, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 24035, 23112, 23837, 23511, 29483, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22584, 23511, 23511, 23511, 23511, 29116, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 27443, 22493, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34564, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 22839, 23511, 23511, 23511, 23511, 25645, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 32683, 22516, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 24035, 23112, 32618, 23511, 31507, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 28306, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 23512, 24694, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 20271, 23511, 23511, 23511, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36442, 19288, 21605, 24035, 23112, 28137, 23511, 31507, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 28306, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 23512, 24694, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 20271, 23511, 23511, 23511, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 24035, 23112, 32618, 23511, 31507, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 28306, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 23512, 24694, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 20271, 23511, 23511, 23511, 23511, 31568, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22690, 19288, 19457, 36866, 17466, 36890, 36866, 21991, 27584, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 22659, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22360, 19552, 19457, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22675, 22811, 19457, 36866, 17466, 36890, 36866, 19133, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 22827, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36139, 19288, 19457, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36064, 19288, 22865, 22881, 32031, 22897, 22913, 22956, 29939, 24035, 24035, 24035, 23003, 23114, 23114, 23114, 23024, 22420, 23511, 23511, 23511, 23052, 29116, 23073, 29268, 24035, 25563, 26915, 23106, 23131, 23114, 23114, 23159, 23181, 23197, 23248, 23511, 23511, 23282, 23305, 22493, 32364, 24035, 33472, 30138, 26325, 31770, 33508, 27345, 33667, 23114, 23321, 23473, 23351, 35793, 36576, 23511, 23375, 22500, 24145, 24035, 29197, 20192, 24533, 23440, 23114, 19017, 23459, 22839, 23489, 23510, 23511, 33563, 23528, 32076, 25389, 24035, 26576, 23561, 23583, 23114, 32683, 22516, 23622, 23655, 23511, 23634, 35456, 37144, 23110, 23683, 34153, 20499, 32513, 25824, 23705, 24035, 24035, 23111, 23114, 19874, 27078, 33263, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 20507, 32241, 20150, 31862, 27464, 35108, 23727, 23007, 35895, 34953, 26578, 27685, 20141, 24569, 31691, 19787, 33967, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36427, 19552, 21605, 24035, 23112, 32618, 23511, 29483, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 29116, 19803, 24035, 24035, 24035, 27027, 26576, 23114, 23114, 23114, 31471, 23756, 22468, 23511, 23511, 23511, 34687, 23772, 22493, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34564, 23788, 24035, 24035, 24035, 21559, 23828, 23114, 23114, 23114, 25086, 22839, 23853, 23511, 23511, 23511, 23876, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 32683, 22516, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 31761, 23909, 23953, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36049, 19288, 21605, 30825, 23112, 23987, 23511, 24003, 31001, 27617, 24034, 24035, 24036, 24052, 24089, 23114, 23114, 22420, 24109, 24168, 23511, 23511, 29116, 24188, 27609, 20017, 29516, 24035, 26576, 24222, 19968, 23114, 24252, 33811, 22468, 24270, 33587, 23511, 24320, 27443, 22493, 24035, 24035, 24035, 24035, 24339, 23113, 23114, 23114, 23114, 28128, 28618, 29700, 23511, 23511, 23511, 28276, 34564, 20402, 24035, 24035, 32929, 24036, 23114, 23114, 23114, 24357, 23029, 22839, 23511, 23511, 23511, 24377, 25645, 24035, 34112, 24035, 26576, 23114, 26643, 23114, 32683, 22516, 23511, 25638, 23511, 23711, 24035, 24395, 27809, 23114, 24414, 20499, 24432, 30917, 23628, 24035, 30680, 23111, 23114, 30233, 27078, 25748, 24452, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 24475, 19829, 26577, 26597, 26154, 24519, 24556, 24596, 23007, 20046, 20132, 26578, 24634, 20141, 24569, 31691, 24679, 24727, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36412, 19288, 21605, 19943, 34861, 32618, 26027, 29483, 32016, 32050, 36233, 24776, 35574, 24801, 24819, 32671, 31289, 22420, 24868, 24886, 20087, 26849, 29116, 19803, 24035, 24035, 24035, 36228, 26576, 23114, 23114, 23114, 24981, 33811, 22468, 23511, 23511, 23511, 29028, 27443, 22493, 24923, 27965, 24035, 24035, 32797, 24946, 23443, 23114, 23114, 29636, 24997, 22849, 28252, 23511, 23511, 23511, 25042, 25110, 24035, 24035, 34085, 24036, 25133, 23114, 23114, 25152, 23029, 22839, 25169, 23511, 36764, 23511, 25645, 30403, 24035, 25186, 26576, 31806, 24093, 25212, 32683, 22516, 32713, 26245, 34293, 23634, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 24035, 32406, 23111, 23114, 28676, 30944, 27689, 25234, 24035, 23112, 19872, 37063, 23266, 24036, 23114, 30243, 20379, 26100, 29218, 20211, 30105, 25257, 25284, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 24834, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36034, 19288, 21671, 25314, 25072, 25330, 25346, 25362, 29939, 29951, 35288, 29984, 23812, 27216, 25405, 25424, 30456, 22584, 26292, 25461, 25480, 31592, 29116, 25516, 34963, 25545, 27007, 25579, 33937, 25614, 25661, 25686, 34872, 25702, 25718, 25734, 25769, 25795, 25811, 25840, 22493, 26533, 25856, 24035, 25876, 30763, 27481, 25909, 23114, 28987, 25936, 25954, 29700, 25983, 23511, 31412, 26043, 26063, 22568, 29241, 29592, 26116, 31216, 35383, 26170, 34783, 26194, 26221, 22839, 26241, 26261, 22477, 26283, 26308, 27306, 31035, 24655, 26576, 29854, 33386, 26341, 32683, 22516, 32153, 30926, 26361, 19996, 26381, 35463, 26397, 26424, 34646, 26478, 35605, 31386, 26494, 35567, 31964, 22940, 23689, 25218, 30309, 32289, 19830, 33605, 23112, 32109, 27733, 27084, 24496, 35886, 35221, 26525, 36602, 26549, 26558, 26574, 26594, 26613, 26629, 26666, 26700, 26578, 27685, 23740, 24285, 31691, 26733, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36397, 19552, 18991, 25887, 28117, 32618, 26776, 29483, 29939, 26802, 24035, 24035, 24036, 28664, 23114, 23114, 23114, 22420, 30297, 23511, 23511, 23511, 29116, 19803, 24035, 24035, 24035, 25559, 26576, 23114, 23114, 23114, 30525, 33811, 22468, 23511, 23511, 23511, 28725, 27443, 22493, 24035, 24035, 27249, 24035, 24035, 23113, 23114, 23114, 26827, 23114, 28618, 29700, 23511, 23511, 26845, 23511, 34564, 20402, 24035, 24035, 26979, 24036, 23114, 23114, 23114, 24974, 23029, 22839, 23511, 23511, 23511, 26865, 25645, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 32683, 22516, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 20499, 23511, 23261, 23628, 33305, 24035, 25598, 23114, 19874, 34253, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 26886, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 26931, 24569, 26439, 26947, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36019, 19288, 26995, 24035, 23112, 32618, 23511, 31507, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 28306, 27043, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 27061, 23511, 23511, 23511, 23511, 23512, 24694, 24035, 24035, 29978, 24035, 24035, 23113, 23114, 33114, 23114, 23114, 30010, 29700, 23511, 35913, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 20271, 23511, 23511, 23511, 23511, 30562, 24035, 24035, 27155, 26576, 23114, 23114, 30447, 23036, 29695, 23511, 23511, 30935, 20099, 24152, 25529, 27100, 34461, 27121, 22625, 29156, 26009, 27137, 30422, 31903, 31655, 28870, 27171, 32439, 31731, 19830, 27232, 22612, 27265, 26786, 25494, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 20342, 27288, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 27322, 27339, 28020, 27361, 27382, 29939, 24035, 24035, 32581, 24036, 23114, 23114, 23114, 27425, 22420, 23511, 23511, 23511, 27442, 28306, 19803, 24035, 24035, 24035, 24035, 26710, 23114, 23114, 23114, 23114, 32261, 22468, 23511, 23511, 23511, 23511, 35719, 24694, 29510, 24035, 24035, 24035, 24035, 26717, 23114, 23114, 23114, 23114, 28618, 32217, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 27459, 23114, 23114, 23114, 36252, 23029, 20271, 23511, 23511, 23511, 28840, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 27480, 34483, 28401, 29761, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36382, 19288, 21605, 27497, 27517, 28504, 28898, 27569, 29939, 29401, 27600, 27323, 27633, 19025, 27662, 23114, 27705, 22420, 20483, 27721, 23511, 27765, 28306, 19803, 23540, 24035, 24610, 27781, 27805, 26650, 23114, 28573, 32990, 25920, 22468, 26870, 23511, 26684, 34262, 34737, 25057, 34622, 24035, 24035, 23971, 24206, 27825, 27847, 23114, 23114, 27865, 27885, 35766, 27914, 23511, 23511, 32766, 32844, 27934, 28795, 26909, 27955, 26092, 27988, 25445, 28005, 28036, 28052, 21965, 23511, 32196, 19897, 28072, 28102, 36534, 21541, 23801, 28153, 28180, 28197, 28221, 23036, 32695, 28251, 28268, 28292, 23667, 34825, 23930, 24580, 28322, 28344, 31627, 28366, 25996, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 35625, 33477, 33359, 27674, 28393, 33992, 24036, 23114, 30243, 19829, 28417, 28433, 28463, 23008, 19876, 20208, 23007, 20046, 20132, 28489, 28520, 20141, 24569, 31691, 19787, 28550, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 24035, 23112, 32618, 23511, 31507, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 28306, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 23512, 24694, 28589, 24035, 24035, 24035, 24035, 28608, 23114, 23114, 23114, 23114, 28618, 20431, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 20271, 23511, 23511, 23511, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36004, 19288, 28634, 31951, 28565, 28702, 28718, 28741, 32544, 20175, 28792, 32086, 20105, 28811, 29059, 29862, 28856, 22420, 28886, 30354, 23359, 28922, 28306, 28952, 23888, 26320, 36506, 24035, 29331, 28968, 36609, 23114, 29003, 31661, 27061, 30649, 27366, 23511, 29023, 27918, 24694, 24035, 24035, 23893, 33094, 30867, 23113, 23114, 23114, 29044, 34184, 30010, 29700, 23511, 23511, 29081, 29102, 34585, 20402, 27789, 24035, 24035, 24036, 23114, 29132, 23114, 23114, 23029, 20271, 23511, 29153, 23511, 23511, 30562, 30174, 24035, 24035, 27409, 25438, 23114, 23114, 29172, 36668, 31332, 23511, 23511, 29192, 30144, 24035, 23110, 30203, 23114, 23467, 31544, 23261, 23628, 24035, 22545, 23111, 23114, 29213, 27078, 27689, 29234, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 29257, 23008, 19876, 20208, 28768, 29290, 29320, 34776, 29353, 20141, 22435, 29378, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36367, 19288, 21605, 34616, 19006, 32618, 31497, 31507, 36216, 20184, 24035, 34393, 29424, 34668, 23114, 34900, 29447, 22420, 30360, 23511, 37089, 29473, 28306, 19803, 29499, 24398, 24035, 24035, 26576, 31799, 29532, 29550, 23114, 33811, 22468, 32298, 29571, 31184, 23511, 23512, 37127, 36628, 29589, 24035, 24135, 24035, 23113, 29608, 23114, 27831, 29634, 28618, 29652, 30037, 23511, 24172, 29671, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 29555, 29690, 23511, 23511, 23511, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 29719, 24035, 23110, 29738, 23114, 23467, 34035, 29756, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 29777, 34364, 28181, 30243, 29799, 31920, 27272, 27185, 23008, 31126, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29828, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 35989, 19552, 19687, 35139, 28649, 29878, 29894, 29924, 29939, 23224, 23085, 31969, 24036, 35173, 24752, 24803, 23114, 22420, 31190, 30318, 24870, 23511, 28306, 29967, 23967, 24035, 24035, 24035, 26576, 30000, 23114, 23114, 23114, 33811, 22468, 30026, 23511, 23511, 23511, 23512, 26078, 24035, 24035, 24035, 30053, 37137, 30071, 23114, 23114, 33368, 25136, 28618, 30723, 23511, 23511, 37096, 31356, 34585, 20402, 30092, 30127, 30160, 24036, 35740, 30219, 24960, 30259, 23029, 20271, 34042, 30285, 30342, 30376, 23289, 30055, 30400, 30419, 30438, 32640, 33532, 33514, 30472, 18792, 26267, 24323, 23057, 30493, 23639, 20008, 30196, 33188, 30517, 20075, 23511, 30541, 23628, 30578, 33928, 28776, 30594, 19874, 30610, 30637, 19830, 30677, 27646, 19872, 25779, 23266, 23232, 35016, 30243, 30696, 29812, 30712, 30746, 27206, 30779, 30807, 23007, 33395, 20132, 26578, 27685, 31703, 22928, 31691, 19787, 31079, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36352, 19288, 23335, 30841, 26131, 30888, 30904, 30986, 29939, 24035, 24704, 31017, 20025, 23114, 26178, 31051, 31095, 22420, 23511, 22524, 31142, 31172, 28534, 31206, 35497, 25196, 24035, 28592, 24503, 23114, 31239, 31285, 23114, 31305, 31321, 31355, 31372, 31407, 23511, 30556, 24694, 24035, 27501, 19805, 24035, 24035, 23113, 23114, 31428, 24066, 23114, 28618, 29700, 23511, 31837, 18809, 23511, 34585, 31448, 24035, 24035, 24035, 23090, 23114, 23114, 23114, 23114, 31619, 35038, 23511, 23511, 23511, 23511, 33714, 24035, 33085, 24035, 29431, 23114, 31467, 23114, 23143, 31487, 23511, 31523, 23511, 35195, 36783, 24035, 30111, 23567, 23114, 23467, 31543, 31560, 23628, 24035, 24035, 23111, 23114, 19874, 30953, 31584, 34508, 24035, 31608, 26345, 37055, 23266, 31643, 31677, 31719, 31747, 31786, 31822, 26898, 23008, 19876, 31859, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 31878, 31936, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 35974, 19288, 21605, 27972, 35663, 31985, 29655, 32001, 36715, 24785, 25893, 23545, 31912, 19853, 19916, 25938, 24540, 22420, 31843, 29674, 29573, 32735, 28936, 19803, 24035, 24035, 32047, 24035, 26576, 23114, 23114, 27544, 23114, 33811, 22468, 23511, 23511, 32161, 23511, 23512, 32066, 24035, 33313, 24035, 24035, 24035, 23113, 27426, 32102, 23114, 23114, 28618, 32125, 23511, 32144, 23511, 23511, 33569, 20402, 24035, 27045, 24035, 24036, 23114, 23114, 28328, 23114, 30076, 32177, 23511, 23511, 30384, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23595, 32212, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 22635, 25753, 32233, 32257, 32277, 19829, 26577, 26597, 20211, 23008, 19876, 32322, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 32352, 35285, 32380, 34196, 33016, 30661, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 28306, 32404, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 32422, 23511, 23511, 23511, 23511, 23512, 24694, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 30269, 29700, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 20271, 23511, 23511, 23511, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 19949, 24035, 23111, 32455, 19874, 31269, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36337, 19552, 19209, 21617, 26509, 32475, 32491, 32529, 29939, 24035, 32578, 25241, 32597, 23114, 32634, 29007, 32656, 22420, 23511, 32729, 26365, 32751, 28306, 32788, 32882, 24035, 24035, 32813, 36727, 23114, 33182, 23114, 27553, 33235, 32829, 23511, 32706, 23511, 28906, 28377, 26962, 32881, 32904, 32898, 32920, 24035, 32953, 23114, 32977, 26408, 23114, 28164, 33006, 23511, 33039, 35774, 23511, 32306, 20402, 33076, 30872, 24035, 24036, 25408, 33110, 28979, 23114, 23029, 20271, 35835, 33130, 33054, 23511, 30562, 33148, 24035, 24035, 33167, 23114, 23114, 33775, 23036, 20459, 23511, 23511, 25464, 24646, 24035, 24035, 22446, 23114, 23114, 25627, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 31391, 33204, 33220, 33251, 33287, 26577, 26597, 20211, 33329, 19876, 33345, 23007, 20046, 20132, 26578, 27685, 28473, 22599, 31691, 33411, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 35959, 19288, 21907, 27243, 29843, 32618, 33427, 31507, 29939, 33460, 34090, 24035, 24036, 33493, 24416, 33530, 23114, 22420, 33548, 24379, 33585, 23511, 28306, 19803, 33603, 24202, 24035, 24035, 25593, 33749, 28205, 23114, 23114, 32388, 22468, 33853, 33060, 23511, 23511, 31339, 33621, 24035, 24035, 34397, 24618, 30757, 33663, 23114, 23114, 33683, 35684, 28618, 26678, 23511, 23511, 32506, 33699, 34585, 20402, 24035, 32562, 26973, 24036, 23114, 23114, 33377, 33773, 23029, 20271, 23511, 23511, 30621, 23511, 23860, 24035, 33791, 21553, 26576, 36558, 23114, 33809, 23036, 32857, 26047, 23511, 33827, 23634, 24035, 24035, 23110, 23114, 23114, 31252, 23511, 33845, 23628, 24035, 24459, 23111, 23114, 33869, 27078, 30791, 29783, 24035, 24742, 19872, 33895, 23266, 26462, 19710, 33879, 33919, 26577, 26597, 24123, 24930, 21930, 20208, 30501, 33953, 25268, 20252, 33983, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36322, 19552, 23390, 33634, 35154, 34008, 34024, 34058, 35544, 34106, 34128, 26811, 33151, 34144, 34169, 34212, 23114, 34228, 34244, 34278, 34315, 23511, 34331, 34347, 34380, 34413, 24035, 24663, 26576, 34429, 34453, 34477, 29534, 33811, 22468, 34499, 34524, 34557, 25170, 34580, 35436, 23937, 34601, 24035, 24341, 26453, 23113, 34638, 34662, 23114, 24236, 28618, 34684, 34703, 34729, 23511, 35352, 34753, 34799, 24035, 34815, 32558, 34848, 34888, 35814, 34923, 23165, 29137, 23606, 30326, 30730, 34939, 33023, 30562, 36848, 34979, 24035, 24847, 34996, 23114, 23114, 35032, 29695, 35054, 23511, 23511, 35091, 33296, 35124, 24296, 28235, 24361, 36276, 32772, 35067, 35189, 27301, 30855, 24852, 22452, 35211, 35237, 35316, 25500, 35270, 23405, 24304, 35304, 29362, 24036, 23114, 35332, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 35368, 28823, 23920, 32336, 35405, 20141, 24569, 31691, 35421, 35479, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 35944, 22795, 21605, 33647, 35877, 35513, 30962, 35529, 34073, 35557, 24035, 24035, 20405, 31107, 23114, 23114, 23114, 35590, 34713, 23511, 23511, 23511, 35641, 19803, 29408, 32937, 25298, 24035, 35657, 23115, 27849, 24760, 35679, 26205, 22468, 23511, 35700, 24907, 24901, 35075, 31893, 34980, 24035, 24035, 24035, 24035, 23113, 35009, 23114, 23114, 23114, 28618, 35716, 30970, 23511, 23511, 23511, 34585, 23215, 24035, 24035, 24035, 24036, 35735, 23114, 23114, 23114, 27105, 35756, 35790, 23511, 23511, 23511, 35254, 35446, 24035, 24035, 31223, 35809, 23114, 23114, 23036, 36825, 35830, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 31031, 20355, 19872, 33903, 23266, 24036, 23114, 28686, 19829, 26577, 26597, 20211, 23008, 23424, 20208, 24711, 31065, 24486, 26578, 27685, 20141, 19773, 35851, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36307, 19288, 21605, 35494, 19702, 32618, 33437, 31507, 29939, 25117, 24035, 27939, 24036, 27869, 23114, 26829, 23114, 22420, 23494, 23511, 33132, 23511, 28306, 19803, 24035, 34832, 24035, 24035, 26576, 23114, 25153, 23114, 23114, 33811, 22468, 23511, 23511, 35911, 23511, 23512, 24694, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 20271, 23511, 23511, 23511, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 35929, 19288, 21605, 25860, 23112, 36185, 23511, 36201, 29939, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 22420, 23511, 23511, 23511, 23511, 28306, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 23512, 26748, 24035, 24035, 24035, 24035, 24035, 36249, 23114, 23114, 23114, 23114, 28618, 28835, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 27151, 24035, 26760, 23114, 27989, 23114, 23114, 36268, 20271, 23511, 24436, 23511, 29703, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36292, 19288, 21605, 36503, 21922, 32618, 34534, 31507, 36522, 24035, 33793, 24035, 35864, 23114, 23114, 36555, 23417, 22420, 23511, 23511, 36574, 26020, 28306, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 33811, 22468, 23511, 23511, 23511, 23511, 23512, 36592, 24035, 24035, 36625, 24035, 24035, 23113, 23114, 32961, 23114, 23114, 29618, 29700, 23511, 29086, 23511, 23511, 34585, 20402, 36644, 24035, 24035, 24036, 29740, 23114, 23114, 23114, 29065, 36663, 31527, 23511, 23511, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36079, 19288, 21605, 31451, 23112, 36684, 23511, 36700, 29939, 24035, 24035, 24035, 30185, 23114, 23114, 23114, 27526, 22420, 23511, 23511, 23511, 32865, 28306, 19803, 36743, 24035, 27017, 24035, 26576, 27535, 23114, 31432, 23114, 33811, 22468, 33271, 23511, 32128, 23511, 23512, 24694, 24035, 27196, 24035, 24035, 24035, 23113, 32459, 23114, 23114, 23114, 28618, 29700, 33829, 36762, 23511, 23511, 34585, 20402, 24035, 36746, 24035, 29722, 23114, 23114, 34437, 23114, 34907, 20271, 23511, 23511, 18801, 23511, 23206, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 36837, 24035, 24035, 33739, 23114, 23114, 25094, 23511, 23261, 23628, 24035, 36780, 23111, 24073, 19874, 27078, 35344, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22720, 19288, 36799, 36866, 17466, 36890, 36864, 21991, 22211, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 17631, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 36883, 36906, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 22705, 19288, 19457, 36866, 17466, 36890, 36866, 19375, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18855, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36124, 19288, 36951, 36866, 17466, 36890, 36866, 21991, 22404, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18567, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 36979, 36995, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36139, 19288, 19457, 36866, 17466, 36890, 36866, 21991, 22971, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18027, 22984, 17553, 17572, 22285, 18462, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 17619, 22083, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 36139, 19288, 21529, 24035, 23112, 23033, 23511, 31507, 25377, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 37040, 23511, 23511, 23511, 23511, 28086, 19803, 24035, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23114, 24254, 37079, 23511, 23511, 23511, 23511, 23512, 34766, 24035, 24035, 24035, 24035, 24035, 23113, 23114, 23114, 23114, 23114, 28618, 29700, 23511, 23511, 23511, 23511, 34585, 20402, 24035, 24035, 24035, 24036, 23114, 23114, 23114, 23114, 23029, 20271, 23511, 23511, 23511, 23511, 30562, 24035, 24035, 24035, 26576, 23114, 23114, 23114, 23036, 29695, 23511, 23511, 23511, 23634, 24035, 24035, 23110, 23114, 23114, 23467, 23511, 23261, 23628, 24035, 24035, 23111, 23114, 19874, 27078, 27689, 19830, 24035, 23112, 19872, 27741, 23266, 24036, 23114, 30243, 19829, 26577, 26597, 20211, 23008, 19876, 20208, 23007, 20046, 20132, 26578, 27685, 20141, 24569, 31691, 19787, 29304, 20268, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 37112, 37160, 18469, 36866, 17466, 36890, 36866, 17656, 37174, 22987, 17556, 17575, 22288, 17486, 17509, 17525, 18373, 18537, 22984, 17553, 17572, 22285, 18780, 17990, 18622, 19411, 20306, 17996, 17689, 17470, 17591, 20896, 17468, 36883, 36906, 36867, 19404, 20299, 36866, 17647, 17862, 18921, 19514, 17705, 20311, 37017, 17728, 17756, 17784, 17800, 17825, 17854, 18403, 18928, 19521, 17712, 37008, 37024, 17878, 18884, 17900, 17922, 17944, 18178, 17960, 18012, 18381, 18064, 18218, 17884, 18890, 17906, 17928, 18102, 25022, 18130, 36931, 36963, 17493, 18150, 18166, 18214, 25010, 25026, 18134, 36935, 18262, 18278, 18294, 18320, 18336, 18361, 18397, 18274, 22096, 18304, 18448, 18485, 18523, 18553, 18583, 19149, 18638, 18497, 19656, 18664, 18680, 18507, 18696, 19164, 18712, 18737, 17681, 22026, 20906, 20915, 22054, 17838, 17450, 22022, 18765, 19225, 18841, 18871, 18906, 19241, 19257, 18976, 19041, 19056, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 19058, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 127011, 110630, 114730, 106539, 127011, 127011, 127011, 53264, 18, 18, 0, 0, 57366, 0, 24, 24, 24, 0, 28, 28, 28, 28, 102432, 0, 0, 127011, 0, 2220032, 110630, 0, 0, 0, 114730, 106539, 0, 2170880, 2170880, 2170880, 2170880, 0, 0, 0, 2170880, 2170880, 2170880, 3002368, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2576384, 2215936, 2215936, 2215936, 2416640, 2424832, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2543616, 2215936, 2215936, 2215936, 2215936, 2215936, 2629632, 2215936, 2617344, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2691072, 2215936, 2707456, 2215936, 2715648, 2215936, 2723840, 2764800, 2215936, 2215936, 2797568, 2215936, 2822144, 2215936, 2215936, 2854912, 2215936, 2215936, 2215936, 2912256, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 0, 0, 180224, 0, 0, 2174976, 0, 0, 2170880, 2617344, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2691072, 2170880, 2707456, 2170880, 2715648, 2170880, 2723840, 2764800, 2170880, 2170880, 2797568, 2170880, 2170880, 2797568, 2170880, 2822144, 2170880, 2170880, 2854912, 2170880, 2170880, 2170880, 2912256, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2215936, 2215936, 2215936, 2215936, 2609152, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2654208, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 0, 0, 184599, 280, 0, 2174976, 0, 0, 2215936, 3117056, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 544, 0, 546, 0, 0, 2179072, 0, 0, 0, 552, 0, 0, 2170880, 2170880, 2170880, 3117056, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 0, 0, 2158592, 2158592, 2232320, 2232320, 0, 2240512, 2240512, 0, 0, 0, 644, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3129344, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2215936, 2215936, 2215936, 2400256, 2215936, 2215936, 2215936, 2215936, 2711552, 2170880, 2170880, 2170880, 2170880, 2170880, 2760704, 2768896, 2789376, 2813952, 2170880, 2170880, 2170880, 2875392, 2904064, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2453504, 2457600, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 167936, 0, 0, 0, 0, 2174976, 0, 0, 2215936, 2215936, 2514944, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2592768, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 32768, 0, 0, 0, 0, 0, 2174976, 32768, 0, 2633728, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2711552, 2215936, 2215936, 2215936, 2215936, 2215936, 2760704, 2768896, 2789376, 2813952, 2215936, 2215936, 2215936, 2875392, 2904064, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2174976, 0, 65819, 2215936, 2215936, 3031040, 2215936, 3055616, 2215936, 2215936, 2215936, 2215936, 3092480, 2215936, 2215936, 3125248, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 3002368, 2215936, 2215936, 2170880, 2170880, 2494464, 2170880, 2170880, 0, 0, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 3198976, 2215936, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 0, 0, 2379776, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2445312, 2170880, 2465792, 2473984, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2523136, 2170880, 2170880, 2641920, 2170880, 2170880, 2170880, 2699264, 2170880, 2727936, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2879488, 2170880, 2916352, 2170880, 2170880, 2170880, 2879488, 2170880, 2916352, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3026944, 2170880, 2170880, 3063808, 2170880, 2170880, 3112960, 2170880, 2170880, 3133440, 2170880, 2170880, 3112960, 2170880, 2170880, 3133440, 2170880, 2170880, 2170880, 3162112, 2170880, 2170880, 3182592, 3186688, 2170880, 2379776, 2215936, 2523136, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2596864, 2215936, 2621440, 2215936, 2215936, 2641920, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2179072, 548, 0, 0, 0, 0, 287, 2170880, 0, 2170880, 2170880, 2170880, 2400256, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3117056, 2170880, 2170880, 2170880, 2170880, 2215936, 2215936, 2699264, 2215936, 2727936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2879488, 2215936, 2916352, 2215936, 2215936, 0, 0, 0, 0, 188416, 0, 2179072, 0, 0, 0, 0, 0, 287, 2170880, 0, 2171019, 2171019, 2171019, 2400395, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 3031179, 2171019, 3055755, 2171019, 2171019, 2215936, 3133440, 2215936, 2215936, 2215936, 3162112, 2215936, 2215936, 3182592, 3186688, 2215936, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2523275, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2597003, 2171019, 2621579, 2170880, 2170880, 2170880, 3162112, 2170880, 2170880, 3182592, 3186688, 2170880, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 53264, 0, 18, 18, 24, 24, 0, 4337664, 28, 2170880, 2170880, 2170880, 2629632, 2170880, 2170880, 2170880, 2170880, 2719744, 2744320, 2170880, 2170880, 2170880, 2834432, 2838528, 2170880, 2908160, 2170880, 2170880, 2936832, 2215936, 2215936, 2215936, 2215936, 2719744, 2744320, 2215936, 2215936, 2215936, 2834432, 2838528, 2215936, 2908160, 2215936, 2215936, 2936832, 2215936, 2215936, 2985984, 2215936, 2994176, 2215936, 2215936, 3014656, 2215936, 3059712, 3076096, 3088384, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2445312, 2215936, 2465792, 2473984, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2171166, 2171166, 2171166, 2171166, 2171166, 0, 0, 0, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171019, 2171019, 2494603, 2171019, 2171019, 2215936, 2215936, 2215936, 3215360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2379776, 2170880, 2170880, 2170880, 2170880, 2985984, 2170880, 2994176, 2170880, 2170880, 3016168, 2170880, 3059712, 3076096, 3088384, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 53264, 0, 18, 18, 124, 124, 0, 128, 128, 2170880, 2170880, 2170880, 3215360, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2486272, 2170880, 2170880, 2506752, 2170880, 2170880, 2170880, 2535424, 2539520, 2170880, 2170880, 2588672, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2920448, 2170880, 2170880, 2170880, 2990080, 2170880, 2170880, 2170880, 2170880, 3051520, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3170304, 0, 2387968, 2392064, 2170880, 2170880, 2433024, 2170880, 2170880, 2170880, 3170304, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2486272, 2215936, 2215936, 2506752, 2215936, 2215936, 2215936, 2535424, 2539520, 2215936, 2215936, 2588672, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2174976, 136, 0, 2215936, 2215936, 2920448, 2215936, 2215936, 2215936, 2990080, 2215936, 2215936, 2215936, 2215936, 3051520, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 3108864, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 3026944, 2215936, 2215936, 3063808, 2215936, 2215936, 3112960, 2215936, 2215936, 2215936, 3170304, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2453504, 2457600, 2170880, 2170880, 2170880, 2486272, 2170880, 2170880, 2506752, 2170880, 2170880, 2170880, 2537049, 2539520, 2170880, 2170880, 2588672, 2170880, 2170880, 2170880, 1508, 2170880, 2170880, 2170880, 1512, 2170880, 2920448, 2170880, 2170880, 2170880, 2990080, 2170880, 2170880, 2170880, 2461696, 2170880, 2170880, 2170880, 2510848, 2170880, 2170880, 2170880, 2170880, 2580480, 2170880, 2605056, 2637824, 2170880, 2170880, 18, 0, 0, 0, 0, 0, 0, 0, 0, 2220032, 0, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2686976, 2748416, 2170880, 2170880, 2170880, 2924544, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3121152, 2170880, 2170880, 3145728, 3158016, 3166208, 2170880, 2420736, 2428928, 2170880, 2478080, 2170880, 2170880, 2170880, 2170880, 0, 0, 2170880, 2170880, 2170880, 2170880, 2646016, 2670592, 0, 0, 3145728, 3158016, 3166208, 2387968, 2392064, 2215936, 2215936, 2433024, 2215936, 2461696, 2215936, 2215936, 2215936, 2510848, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2179072, 0, 0, 0, 0, 0, 0, 2170880, 2215936, 2215936, 2580480, 2215936, 2605056, 2637824, 2215936, 2215936, 2686976, 2748416, 2215936, 2215936, 2215936, 2924544, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2179072, 0, 0, 0, 0, 0, 286, 2170880, 2215936, 2215936, 2215936, 2215936, 2215936, 3121152, 2215936, 2215936, 3145728, 3158016, 3166208, 2387968, 2392064, 2170880, 2170880, 2433024, 2170880, 2461696, 2170880, 2170880, 2170880, 2510848, 2170880, 2170880, 1625, 2170880, 2170880, 2580480, 2170880, 2605056, 2637824, 2170880, 647, 2170880, 2170880, 2170880, 2400256, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2576384, 2170880, 2170880, 2170880, 2170880, 2170880, 2609152, 2170880, 2170880, 2686976, 0, 0, 2748416, 2170880, 2170880, 0, 2170880, 2924544, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 53264, 0, 18, 18, 24, 0, 0, 28, 28, 2170880, 3141632, 2215936, 2420736, 2428928, 2215936, 2478080, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2646016, 2670592, 2752512, 2756608, 2846720, 2961408, 2215936, 2998272, 2215936, 3010560, 2215936, 2215936, 2215936, 3141632, 2170880, 2420736, 2428928, 2752512, 2756608, 0, 2846720, 2961408, 2170880, 2998272, 2170880, 3010560, 2170880, 2170880, 2170880, 3141632, 2170880, 2170880, 2490368, 2215936, 2490368, 2215936, 2215936, 2215936, 2547712, 2555904, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2174976, 245760, 0, 3129344, 2170880, 2170880, 2490368, 2170880, 2170880, 2170880, 0, 0, 2547712, 2555904, 2170880, 2170880, 2170880, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2220032, 0, 0, 45056, 0, 2584576, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2170880, 2170880, 2170880, 2170880, 0, 0, 0, 2170880, 2170880, 2158592, 0, 0, 0, 0, 0, 0, 0, 0, 2220032, 0, 0, 0, 0, 0, 0, 0, 0, 1482, 97, 97, 97, 97, 97, 97, 97, 1354, 97, 97, 97, 97, 97, 97, 97, 97, 1148, 97, 97, 97, 97, 97, 97, 97, 2584576, 2170880, 2170880, 1512, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2441216, 2170880, 2527232, 2170880, 2600960, 2170880, 2850816, 2170880, 2170880, 2170880, 3022848, 2215936, 2441216, 2215936, 2527232, 2215936, 2600960, 2215936, 2850816, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2179072, 0, 0, 0, 0, 0, 287, 2170880, 2215936, 3022848, 2170880, 2441216, 2170880, 2527232, 0, 0, 2170880, 2600960, 2170880, 0, 2850816, 2170880, 2170880, 2170880, 2170880, 2170880, 2523136, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2596864, 2170880, 2621440, 2170880, 2170880, 2641920, 2170880, 2170880, 2170880, 3022848, 2170880, 2519040, 2170880, 2170880, 2170880, 2170880, 2170880, 2215936, 2519040, 2215936, 2215936, 2215936, 2215936, 2215936, 2170880, 2170880, 2170880, 2453504, 2457600, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2514944, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2592768, 2170880, 2170880, 2519040, 0, 2024, 2170880, 2170880, 0, 2170880, 2170880, 2170880, 2396160, 2170880, 2170880, 2170880, 2170880, 3018752, 2396160, 2215936, 2215936, 2215936, 2215936, 3018752, 2396160, 0, 2024, 2170880, 2170880, 2170880, 2170880, 3018752, 2170880, 2650112, 2965504, 2170880, 2215936, 2650112, 2965504, 2215936, 0, 0, 2170880, 2650112, 2965504, 2170880, 2551808, 2170880, 2551808, 2215936, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 141, 45, 45, 67, 67, 67, 67, 67, 224, 67, 67, 238, 67, 67, 67, 67, 67, 67, 67, 1288, 67, 67, 67, 67, 67, 67, 67, 67, 67, 469, 67, 67, 67, 67, 67, 67, 0, 2551808, 2170880, 2170880, 2215936, 0, 2170880, 2170880, 2215936, 0, 2170880, 2170880, 2215936, 0, 2170880, 2977792, 2977792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53264, 18, 49172, 57366, 24, 8192, 29, 102432, 127011, 110630, 114730, 106539, 127011, 127011, 127011, 53264, 18, 18, 49172, 0, 0, 0, 24, 24, 24, 0, 28, 28, 28, 28, 102432, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 2170880, 2170880, 2170880, 2416640, 0, 0, 0, 0, 2220032, 110630, 0, 0, 0, 114730, 106539, 136, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 53264, 0, 4256099, 4256099, 24, 24, 0, 28, 28, 2170880, 2461696, 2170880, 2170880, 2170880, 2510848, 2170880, 2170880, 0, 2170880, 2170880, 2580480, 2170880, 2605056, 2637824, 2170880, 2170880, 2170880, 2547712, 2555904, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3129344, 2215936, 2215936, 543, 543, 545, 545, 0, 0, 2179072, 0, 550, 551, 551, 0, 287, 2171166, 2171166, 18, 0, 0, 0, 0, 0, 0, 0, 0, 2220032, 0, 0, 645, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 45, 149, 2584576, 2170880, 2170880, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2441216, 2170880, 2527232, 2170880, 2600960, 2519040, 0, 0, 2170880, 2170880, 0, 2170880, 2170880, 2170880, 2396160, 2170880, 2170880, 2170880, 2170880, 3018752, 2396160, 2215936, 2215936, 2215936, 2215936, 3018752, 2396160, 0, 0, 2170880, 2170880, 2170880, 2170880, 3018752, 2170880, 2650112, 2965504, 53264, 18, 49172, 57366, 24, 155648, 28, 102432, 155648, 155687, 114730, 106539, 0, 0, 155648, 53264, 18, 18, 49172, 0, 57366, 0, 24, 24, 24, 0, 28, 28, 28, 28, 102432, 0, 0, 0, 0, 2220032, 0, 94208, 0, 0, 114730, 106539, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 53264, 208896, 18, 278528, 24, 24, 0, 28, 28, 53264, 18, 159765, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 0, 53264, 18, 18, 49172, 0, 57366, 0, 24, 24, 24, 0, 28, 139394, 28, 28, 102432, 131, 0, 0, 0, 2220032, 110630, 0, 0, 0, 114730, 106539, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 32768, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 0, 546, 0, 0, 2183168, 0, 0, 552, 832, 2170880, 2170880, 2170880, 2400256, 2170880, 2170880, 2170880, 2170880, 2170880, 2609152, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2654208, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 3198976, 2215936, 0, 1084, 0, 1088, 0, 1092, 0, 0, 0, 0, 0, 41606, 0, 0, 0, 0, 45, 45, 45, 45, 45, 937, 0, 0, 0, 0, 2220032, 110630, 0, 0, 0, 114730, 106539, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3198976, 2170880, 0, 0, 644, 0, 0, 0, 2215936, 3117056, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 826, 0, 828, 0, 0, 2183168, 0, 0, 830, 0, 2170880, 2170880, 2170880, 2400256, 2170880, 2170880, 2170880, 2170880, 2592768, 2170880, 2170880, 2170880, 2170880, 2633728, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2711552, 2170880, 2170880, 2170880, 2170880, 2170880, 2760704, 53264, 18, 49172, 57366, 24, 8192, 28, 172066, 172032, 110630, 172066, 106539, 0, 0, 172032, 53264, 18, 18, 49172, 0, 57366, 0, 24, 24, 24, 16384, 28, 28, 28, 28, 102432, 0, 98304, 0, 0, 2220032, 110630, 0, 0, 0, 0, 106539, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3198976, 2170880, 0, 0, 45056, 0, 0, 0, 53264, 18, 49172, 57366, 25, 8192, 30, 102432, 0, 110630, 114730, 106539, 0, 0, 176219, 53264, 18, 18, 49172, 0, 57366, 0, 124, 124, 124, 0, 128, 128, 128, 128, 102432, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 2170880, 2170880, 2170880, 2416640, 0, 546, 0, 0, 2183168, 0, 65536, 552, 0, 2170880, 2170880, 2170880, 2400256, 2170880, 2170880, 2170880, 2170880, 2646016, 2670592, 2752512, 2756608, 2846720, 2961408, 2170880, 2998272, 2170880, 3010560, 2170880, 2170880, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 3198976, 2215936, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 143, 45, 45, 67, 67, 67, 67, 67, 227, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1824, 67, 1826, 67, 67, 67, 67, 17, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 32768, 120, 121, 18, 18, 49172, 0, 57366, 0, 24, 24, 24, 0, 28, 28, 28, 28, 102432, 67, 67, 37139, 37139, 24853, 24853, 0, 0, 2179072, 548, 0, 65820, 65820, 0, 287, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 2033, 45, 67, 67, 67, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 369, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 978, 0, 546, 70179, 0, 2183168, 0, 0, 552, 0, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1013, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 473, 67, 67, 67, 67, 483, 67, 67, 1025, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 1119, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1359, 97, 97, 97, 67, 67, 1584, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 497, 67, 67, 1659, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1667, 45, 45, 45, 45, 45, 169, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1668, 45, 45, 45, 45, 67, 67, 1694, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 774, 67, 67, 1713, 97, 97, 97, 97, 97, 97, 97, 0, 97, 97, 1723, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 1538, 45, 45, 45, 45, 45, 1559, 45, 45, 1561, 45, 45, 45, 45, 45, 45, 45, 687, 45, 45, 45, 45, 45, 45, 45, 45, 448, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1771, 1772, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 0, 97, 67, 67, 67, 67, 67, 1821, 67, 67, 67, 67, 67, 67, 1827, 67, 67, 67, 0, 0, 0, 0, 0, 0, 97, 97, 1614, 97, 97, 97, 97, 97, 603, 97, 97, 605, 97, 97, 608, 97, 97, 97, 97, 0, 1532, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 450, 45, 45, 45, 45, 67, 67, 97, 97, 97, 97, 97, 97, 0, 0, 1839, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 97, 1883, 97, 1885, 97, 0, 1888, 0, 97, 97, 0, 97, 97, 1848, 97, 97, 97, 97, 1852, 45, 45, 45, 45, 45, 45, 45, 384, 391, 45, 45, 45, 45, 45, 45, 45, 385, 45, 45, 45, 45, 45, 45, 45, 45, 1237, 45, 45, 45, 45, 45, 45, 67, 0, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 1951, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1963, 97, 2023, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 1994, 67, 1995, 67, 67, 67, 67, 67, 67, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 0, 0, 0, 0, 2220032, 110630, 0, 0, 0, 114730, 106539, 137, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2793472, 2805760, 2170880, 2830336, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3031040, 2170880, 3055616, 2170880, 2170880, 67, 67, 37139, 37139, 24853, 24853, 0, 0, 281, 549, 0, 65820, 65820, 0, 287, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 2031, 2032, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1769, 67, 0, 546, 70179, 549, 549, 0, 0, 552, 0, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1858, 45, 641, 0, 0, 0, 0, 41606, 926, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 456, 67, 0, 0, 0, 1313, 0, 0, 0, 1096, 1319, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1110, 97, 97, 97, 97, 67, 67, 67, 67, 1301, 1476, 0, 0, 0, 0, 1307, 1478, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 1486, 97, 1487, 97, 1313, 1480, 0, 0, 0, 0, 1319, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 566, 97, 97, 97, 97, 97, 97, 67, 67, 67, 1476, 0, 1478, 0, 1480, 0, 97, 97, 97, 97, 97, 97, 97, 45, 1853, 45, 1855, 45, 45, 45, 45, 53264, 18, 49172, 57366, 26, 8192, 31, 102432, 0, 110630, 114730, 106539, 0, 0, 225368, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 32768, 53264, 18, 18, 49172, 163840, 57366, 0, 24, 24, 229376, 0, 28, 28, 28, 229376, 102432, 0, 0, 0, 0, 2220167, 110630, 0, 0, 0, 114730, 106539, 0, 2171019, 2171019, 2171019, 2171019, 2592907, 2171019, 2171019, 2171019, 2171019, 2633867, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2654347, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 3117195, 2171019, 2171019, 2171019, 2171019, 2240641, 0, 0, 0, 0, 0, 0, 0, 0, 368, 0, 140, 2171019, 2171019, 2171019, 2416779, 2424971, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2617483, 2171019, 2171019, 2642059, 2171019, 2171019, 2171019, 2699403, 2171019, 2728075, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 3215499, 2215936, 2215936, 2215936, 2215936, 2215936, 2437120, 2215936, 2215936, 2171019, 2822283, 2171019, 2171019, 2855051, 2171019, 2171019, 2171019, 2912395, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 3002507, 2171019, 2171019, 2215936, 2215936, 2494464, 2215936, 2215936, 2215936, 2171166, 2171166, 2416926, 2425118, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2576670, 2171166, 2617630, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2691358, 2171166, 2707742, 2171166, 2715934, 2171166, 2724126, 2765086, 2171166, 2171166, 2797854, 2171166, 2822430, 2171166, 2171166, 2855198, 2171166, 2171166, 2171166, 2912542, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2793758, 2806046, 2171166, 2830622, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 3109150, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2543902, 2171166, 2171166, 2171166, 2171166, 2171166, 2629918, 2793611, 2805899, 2171019, 2830475, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 0, 546, 0, 0, 2183168, 0, 0, 552, 0, 2171166, 2171166, 2171166, 2400542, 2171166, 2171166, 2171166, 0, 2171166, 2171166, 2171166, 0, 2171166, 2920734, 2171166, 2171166, 2171166, 2990366, 2171166, 2171166, 2171166, 2171166, 3117342, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 0, 53264, 0, 18, 18, 4329472, 2232445, 0, 2240641, 4337664, 2711691, 2171019, 2171019, 2171019, 2171019, 2171019, 2760843, 2769035, 2789515, 2814091, 2171019, 2171019, 2171019, 2875531, 2904203, 2171019, 2171019, 3092619, 2171019, 2171019, 3125387, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 3199115, 2171019, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2453504, 2457600, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2793472, 2805760, 2215936, 2830336, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2494464, 2170880, 2170880, 2171166, 2171166, 2634014, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2711838, 2171166, 2171166, 2171166, 2171166, 2171166, 2760990, 2769182, 2789662, 2814238, 2171166, 2171166, 2171166, 2875678, 2904350, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 3199262, 2171166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2379915, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2445451, 2171019, 2465931, 2474123, 2171019, 2171019, 3113099, 2171019, 2171019, 3133579, 2171019, 2171019, 2171019, 3162251, 2171019, 2171019, 3182731, 3186827, 2171019, 2379776, 2879627, 2171019, 2916491, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 3027083, 2171019, 2171019, 3063947, 2699550, 2171166, 2728222, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2879774, 2171166, 2916638, 2171166, 2171166, 2171166, 2171166, 2171166, 2609438, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2654494, 2171166, 2171166, 2171166, 2171166, 2171166, 2445598, 2171166, 2466078, 2474270, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2523422, 2171019, 2437259, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2543755, 2171019, 2171019, 2171019, 2584715, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2908299, 2171019, 2171019, 2936971, 2171019, 2171019, 2986123, 2171019, 2994315, 2171019, 2171019, 3014795, 2171019, 3059851, 3076235, 3088523, 2171166, 2171166, 2986270, 2171166, 2994462, 2171166, 2171166, 3014942, 2171166, 3059998, 3076382, 3088670, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 3027230, 2171166, 2171166, 3064094, 2171166, 2171166, 3113246, 2171166, 2171166, 3133726, 2506891, 2171019, 2171019, 2171019, 2535563, 2539659, 2171019, 2171019, 2588811, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2691211, 2171019, 2707595, 2171019, 2715787, 2171019, 2723979, 2764939, 2171019, 2171019, 2797707, 2215936, 2215936, 3170304, 0, 0, 0, 0, 0, 0, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2453790, 2457886, 2171166, 2171166, 2171166, 2486558, 2171166, 2171166, 2507038, 2171166, 2171166, 2171166, 2535710, 2539806, 2171166, 2171166, 2588958, 2171166, 2171166, 2171166, 2171166, 2515230, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2593054, 2171166, 2171166, 2171166, 2171166, 3051806, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 3170590, 0, 2388107, 2392203, 2171019, 2171019, 2433163, 2171019, 2461835, 2171019, 2171019, 2171019, 2510987, 2171019, 2171019, 2171019, 2171019, 2580619, 2171019, 2605195, 2637963, 2171019, 2171019, 2171019, 2920587, 2171019, 2171019, 2171019, 2990219, 2171019, 2171019, 2171019, 2171019, 3051659, 2171019, 2171019, 2171019, 2453643, 2457739, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2515083, 2171019, 2171019, 2171019, 2171019, 2646155, 2670731, 2752651, 2756747, 2846859, 2961547, 2171019, 2998411, 2171019, 3010699, 2171019, 2171019, 2687115, 2748555, 2171019, 2171019, 2171019, 2924683, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 3121291, 2171019, 2171019, 2171019, 3170443, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2486272, 2215936, 2215936, 2506752, 3145867, 3158155, 3166347, 2387968, 2392064, 2215936, 2215936, 2433024, 2215936, 2461696, 2215936, 2215936, 2215936, 2510848, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2179072, 0, 0, 0, 0, 0, 553, 2170880, 2215936, 2215936, 2215936, 2215936, 2215936, 3121152, 2215936, 2215936, 3145728, 3158016, 3166208, 2388254, 2392350, 2171166, 2171166, 2433310, 2171166, 2461982, 2171166, 2171166, 2171166, 2511134, 2171166, 2171166, 0, 2171166, 2171166, 2580766, 2171166, 2605342, 2638110, 2171166, 2171166, 2171166, 2171166, 3031326, 2171166, 3055902, 2171166, 2171166, 2171166, 2171166, 3092766, 2171166, 2171166, 3125534, 2171166, 2171166, 2171166, 3162398, 2171166, 2171166, 3182878, 3186974, 2171166, 0, 0, 0, 2171019, 2171019, 2171019, 2171019, 3109003, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2215936, 2215936, 2215936, 2400256, 2215936, 2215936, 2215936, 2215936, 2171166, 2687262, 0, 0, 2748702, 2171166, 2171166, 0, 2171166, 2924830, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 2597150, 2171166, 2621726, 2171166, 2171166, 2642206, 2171166, 2171166, 2171166, 2171166, 3121438, 2171166, 2171166, 3146014, 3158302, 3166494, 2171019, 2420875, 2429067, 2171019, 2478219, 2171019, 2171019, 2171019, 2171019, 2547851, 2556043, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 3129483, 2215936, 2171019, 3141771, 2215936, 2420736, 2428928, 2215936, 2478080, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2646016, 2670592, 2752512, 2756608, 2846720, 2961408, 2215936, 2998272, 2215936, 3010560, 2215936, 2215936, 2215936, 3141632, 2171166, 2421022, 2429214, 2171166, 2478366, 2171166, 2171166, 2171166, 2171166, 0, 0, 2171166, 2171166, 2171166, 2171166, 2646302, 2670878, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 0, 45, 45, 45, 45, 45, 1405, 1406, 45, 45, 45, 45, 1409, 45, 45, 45, 45, 45, 1415, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1238, 45, 45, 45, 45, 67, 2752798, 2756894, 0, 2847006, 2961694, 2171166, 2998558, 2171166, 3010846, 2171166, 2171166, 2171166, 3141918, 2171019, 2171019, 2490507, 3129344, 2171166, 2171166, 2490654, 2171166, 2171166, 2171166, 0, 0, 2547998, 2556190, 2171166, 2171166, 2171166, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 45, 45, 167, 45, 45, 45, 45, 185, 187, 45, 45, 198, 45, 45, 0, 2171166, 2171166, 2171166, 2171166, 2171166, 2171166, 3129630, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2576523, 2171019, 2171019, 2171019, 2171019, 2171019, 2609291, 2171019, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 3002368, 2215936, 2215936, 2171166, 2171166, 2494750, 2171166, 2171166, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 45, 147, 2584576, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2171166, 2171166, 2171166, 2171166, 0, 0, 0, 2171166, 2171166, 2171166, 2171166, 0, 0, 0, 2171166, 2171166, 2171166, 3002654, 2171166, 2171166, 2171019, 2171019, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2175257, 0, 0, 2584862, 2171166, 2171166, 0, 0, 2171166, 2171166, 2171166, 2171166, 2171166, 2171019, 2441355, 2171019, 2527371, 2171019, 2601099, 2171019, 2850955, 2171019, 2171019, 2171019, 3022987, 2215936, 2441216, 2215936, 2527232, 2215936, 2600960, 2215936, 2850816, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2179072, 0, 0, 0, 0, 69632, 287, 2170880, 2215936, 3022848, 2171166, 2441502, 2171166, 2527518, 0, 0, 2171166, 2601246, 2171166, 0, 2851102, 2171166, 2171166, 2171166, 2171166, 2720030, 2744606, 2171166, 2171166, 2171166, 2834718, 2838814, 2171166, 2908446, 2171166, 2171166, 2937118, 3023134, 2171019, 2519179, 2171019, 2171019, 2171019, 2171019, 2171019, 2215936, 2519040, 2215936, 2215936, 2215936, 2215936, 2215936, 2171166, 2171166, 2171166, 3215646, 0, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2171019, 2486411, 2171019, 2171019, 2171019, 2629771, 2171019, 2171019, 2171019, 2171019, 2719883, 2744459, 2171019, 2171019, 2171019, 2834571, 2838667, 2171019, 2519326, 0, 0, 2171166, 2171166, 0, 2171166, 2171166, 2171166, 2396299, 2171019, 2171019, 2171019, 2171019, 3018891, 2396160, 2215936, 2215936, 2215936, 2215936, 3018752, 2396446, 0, 0, 2171166, 2171166, 2171166, 2171166, 3019038, 2171019, 2650251, 2965643, 2171019, 2215936, 2650112, 2965504, 2215936, 0, 0, 2171166, 2650398, 2965790, 2171166, 2551947, 2171019, 2551808, 2215936, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 144, 45, 45, 67, 67, 67, 67, 67, 228, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1929, 97, 97, 97, 97, 0, 0, 0, 2552094, 2171166, 2171019, 2215936, 0, 2171166, 2171019, 2215936, 0, 2171166, 2171019, 2215936, 0, 2171166, 2977931, 2977792, 2978078, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 1321, 97, 131072, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 0, 140, 0, 2379776, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2445312, 2170880, 2465792, 2473984, 2170880, 2170880, 2170880, 2584576, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2170880, 2170880, 2170880, 3162112, 2170880, 2170880, 3182592, 3186688, 2170880, 0, 140, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3002368, 2170880, 2170880, 2215936, 2215936, 2494464, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 3215360, 544, 0, 0, 0, 544, 0, 546, 0, 0, 0, 546, 0, 0, 2183168, 0, 0, 552, 0, 2170880, 2170880, 2170880, 2400256, 2170880, 2170880, 2170880, 0, 2170880, 2170880, 2170880, 0, 2170880, 2920448, 2170880, 2170880, 2170880, 2990080, 2170880, 2170880, 552, 0, 0, 0, 552, 0, 287, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2437120, 2170880, 2170880, 18, 0, 0, 0, 0, 0, 0, 0, 0, 2220032, 0, 0, 644, 0, 2215936, 2215936, 3170304, 544, 0, 546, 0, 552, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3198976, 2170880, 0, 0, 0, 140, 0, 0, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 249856, 110630, 114730, 106539, 0, 0, 32768, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 151640, 53264, 18, 18, 49172, 0, 57366, 0, 24, 24, 24, 0, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2416640, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 253952, 110630, 114730, 106539, 0, 0, 32856, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 192512, 53264, 18, 18, 49172, 0, 57366, 0, 2232445, 184320, 2232445, 0, 2240641, 2240641, 184320, 2240641, 102432, 0, 0, 0, 221184, 2220032, 110630, 0, 0, 0, 114730, 106539, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3108864, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2215936, 0, 0, 0, 45056, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 0, 53264, 0, 18, 18, 24, 24, 0, 127, 127, 53264, 18, 49172, 258071, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 32768, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 204800, 53264, 18, 49172, 57366, 24, 27, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 0, 53264, 18, 49172, 57366, 24, 8192, 28, 33, 0, 33, 33, 33, 0, 0, 0, 53264, 18, 18, 49172, 0, 57366, 0, 24, 24, 24, 16384, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 2170880, 2170880, 2170880, 2416640, 67, 67, 37139, 37139, 24853, 24853, 0, 70179, 0, 0, 0, 65820, 65820, 369, 287, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 2030, 45, 45, 45, 45, 67, 1573, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1699, 67, 67, 67, 67, 25403, 546, 70179, 0, 0, 66365, 66365, 552, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1355, 97, 97, 97, 1358, 97, 97, 97, 641, 0, 0, 0, 925, 41606, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 1187, 45, 45, 45, 45, 45, 0, 1480, 0, 0, 0, 0, 1319, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 592, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1531, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1680, 45, 45, 45, 641, 0, 924, 0, 925, 41606, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 1186, 45, 45, 45, 45, 45, 45, 67, 67, 37139, 37139, 24853, 24853, 0, 70179, 282, 0, 0, 65820, 65820, 369, 287, 97, 0, 0, 97, 97, 0, 97, 2028, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1767, 67, 67, 67, 0, 0, 0, 0, 0, 0, 1612, 97, 97, 97, 97, 97, 97, 0, 1785, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 1790, 97, 0, 0, 2170880, 2170880, 3051520, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3170304, 241664, 2387968, 2392064, 2170880, 2170880, 2433024, 53264, 19, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 274432, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 270336, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 1134711, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 1126440, 1126440, 1126440, 0, 0, 1126400, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 36, 110630, 114730, 106539, 0, 0, 217088, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 94, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 96, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 24666, 53264, 18, 18, 49172, 0, 57366, 0, 24, 24, 24, 126, 28, 28, 28, 28, 102432, 53264, 122, 123, 49172, 0, 57366, 0, 24, 24, 24, 0, 28, 28, 28, 28, 102432, 2170880, 2170880, 4256099, 0, 0, 0, 0, 0, 0, 0, 0, 2220032, 0, 0, 0, 0, 0, 0, 0, 0, 1319, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1109, 97, 97, 97, 97, 1113, 132, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 45, 146, 150, 45, 45, 45, 45, 45, 175, 45, 180, 45, 186, 45, 189, 45, 45, 203, 67, 256, 67, 67, 270, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 97, 97, 293, 297, 97, 97, 97, 97, 97, 322, 97, 327, 97, 333, 97, 0, 0, 97, 2026, 0, 2027, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 1685, 67, 67, 67, 67, 67, 67, 67, 1690, 67, 336, 97, 97, 350, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 356, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 2170880, 2170880, 2170880, 2416640, 2424832, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2617344, 2170880, 45, 439, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 525, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 622, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1524, 97, 97, 1527, 369, 648, 45, 45, 45, 45, 45, 45, 45, 45, 45, 659, 45, 45, 45, 45, 408, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1239, 45, 45, 45, 67, 729, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 762, 67, 746, 67, 67, 67, 67, 67, 67, 67, 67, 67, 759, 67, 67, 67, 67, 0, 0, 0, 1477, 0, 1086, 0, 0, 0, 1479, 0, 1090, 67, 67, 796, 67, 67, 799, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1291, 67, 67, 67, 811, 67, 67, 67, 67, 67, 816, 67, 67, 67, 67, 67, 67, 67, 37689, 544, 25403, 546, 70179, 0, 0, 66365, 66365, 552, 833, 97, 97, 97, 97, 97, 97, 97, 97, 1380, 0, 0, 0, 45, 45, 45, 45, 45, 1185, 45, 45, 45, 45, 45, 45, 45, 386, 45, 45, 45, 45, 45, 45, 45, 45, 1810, 45, 45, 45, 45, 45, 45, 67, 97, 97, 844, 97, 97, 97, 97, 97, 97, 97, 97, 97, 857, 97, 97, 97, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 97, 97, 97, 894, 97, 97, 897, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 1382, 45, 45, 45, 97, 909, 97, 97, 97, 97, 97, 914, 97, 97, 97, 97, 97, 97, 97, 923, 67, 67, 1079, 67, 67, 67, 67, 67, 37689, 1085, 25403, 1089, 66365, 1093, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 45, 148, 1114, 97, 97, 97, 97, 97, 97, 1122, 97, 97, 97, 97, 97, 97, 97, 97, 97, 606, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1173, 97, 97, 97, 97, 97, 12288, 0, 925, 0, 1179, 0, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 145, 45, 45, 67, 67, 67, 67, 67, 1762, 67, 67, 67, 1766, 67, 67, 67, 67, 67, 67, 528, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 1934, 67, 67, 1255, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1035, 67, 67, 67, 67, 67, 67, 1297, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1111, 97, 97, 97, 97, 97, 97, 1327, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 33344, 97, 97, 97, 1335, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 97, 97, 1377, 97, 97, 97, 97, 97, 97, 0, 1179, 0, 45, 45, 45, 45, 670, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 430, 45, 45, 45, 45, 67, 67, 1438, 67, 67, 1442, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1592, 67, 67, 67, 1451, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1458, 67, 67, 67, 67, 0, 0, 1305, 0, 0, 0, 0, 0, 1311, 0, 0, 0, 1317, 0, 0, 0, 0, 0, 0, 0, 97, 97, 1322, 97, 97, 1491, 97, 97, 1495, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1551, 45, 1553, 45, 1504, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1513, 97, 97, 97, 97, 0, 45, 45, 45, 45, 1536, 45, 45, 45, 45, 1540, 45, 67, 67, 67, 67, 67, 1585, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1700, 67, 67, 67, 97, 1648, 97, 97, 97, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1541, 0, 97, 97, 97, 97, 0, 1940, 0, 97, 97, 97, 97, 97, 97, 45, 45, 2011, 45, 45, 45, 2015, 67, 67, 2017, 67, 67, 67, 2021, 97, 67, 67, 812, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 37689, 544, 97, 97, 97, 910, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 923, 0, 0, 0, 45, 45, 45, 45, 1184, 45, 45, 45, 45, 1188, 45, 45, 45, 45, 1414, 45, 45, 45, 1417, 45, 1419, 45, 45, 45, 45, 45, 443, 45, 45, 45, 45, 45, 45, 453, 45, 45, 67, 67, 67, 67, 1244, 67, 67, 67, 67, 1248, 67, 67, 67, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 282, 41098, 65820, 97, 1324, 97, 97, 97, 97, 1328, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 930, 45, 45, 45, 45, 97, 97, 97, 97, 1378, 97, 97, 97, 97, 0, 1179, 0, 45, 45, 45, 45, 671, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 975, 45, 45, 45, 45, 67, 67, 1923, 67, 1925, 67, 67, 1927, 67, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 1985, 45, 45, 45, 45, 45, 45, 1560, 45, 45, 45, 45, 45, 45, 45, 45, 45, 946, 45, 45, 950, 45, 45, 45, 0, 97, 97, 97, 1939, 0, 0, 0, 97, 1943, 97, 97, 1945, 97, 45, 45, 45, 669, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 990, 45, 45, 45, 67, 257, 67, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 337, 97, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 356, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 370, 2170880, 2170880, 2170880, 2416640, 401, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 459, 461, 67, 67, 67, 67, 67, 67, 67, 67, 475, 67, 480, 67, 67, 67, 67, 67, 67, 1054, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1698, 67, 67, 67, 67, 67, 484, 67, 67, 487, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1459, 67, 67, 97, 556, 558, 97, 97, 97, 97, 97, 97, 97, 97, 572, 97, 577, 97, 97, 0, 0, 1896, 97, 97, 97, 97, 97, 97, 1903, 45, 45, 45, 45, 983, 45, 45, 45, 45, 988, 45, 45, 45, 45, 45, 45, 1195, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1549, 45, 45, 45, 45, 45, 581, 97, 97, 584, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1153, 97, 97, 369, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 662, 45, 45, 45, 684, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1004, 45, 45, 45, 67, 67, 67, 749, 67, 67, 67, 67, 67, 67, 67, 67, 67, 761, 67, 67, 67, 67, 67, 67, 1068, 67, 67, 67, 1071, 67, 67, 67, 67, 1076, 794, 795, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 544, 97, 97, 97, 97, 847, 97, 97, 97, 97, 97, 97, 97, 97, 97, 859, 97, 0, 0, 2025, 97, 20480, 97, 97, 2029, 45, 45, 45, 45, 45, 45, 67, 67, 67, 1575, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1775, 67, 67, 67, 97, 97, 97, 97, 892, 893, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1515, 97, 993, 994, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 992, 67, 67, 67, 1284, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1607, 67, 67, 97, 1364, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 596, 97, 45, 1556, 1557, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 696, 45, 1596, 1597, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 499, 67, 97, 97, 97, 1621, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1346, 97, 97, 97, 97, 1740, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1678, 45, 45, 45, 45, 45, 67, 97, 97, 97, 97, 97, 97, 1836, 0, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 1984, 97, 45, 45, 45, 45, 45, 45, 1808, 45, 45, 45, 45, 45, 45, 45, 45, 67, 739, 67, 67, 67, 67, 67, 744, 45, 45, 1909, 45, 45, 45, 45, 45, 45, 45, 67, 1917, 67, 1918, 67, 67, 67, 67, 67, 67, 1247, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 532, 67, 67, 67, 67, 67, 67, 1922, 67, 67, 67, 67, 67, 67, 67, 97, 1930, 97, 1931, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1576, 67, 67, 67, 67, 1580, 67, 67, 0, 97, 97, 1938, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 699, 45, 45, 45, 704, 45, 45, 45, 45, 45, 45, 45, 45, 987, 45, 45, 45, 45, 45, 45, 45, 67, 67, 97, 97, 97, 97, 0, 0, 97, 97, 97, 2006, 97, 97, 97, 97, 0, 45, 1533, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1416, 45, 45, 45, 45, 45, 45, 45, 45, 722, 723, 45, 45, 45, 45, 45, 45, 2045, 67, 67, 67, 2047, 0, 0, 97, 97, 97, 2051, 45, 45, 67, 67, 0, 0, 0, 0, 925, 41606, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 409, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1957, 45, 67, 67, 67, 67, 67, 1836, 97, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 45, 67, 67, 67, 1761, 67, 67, 67, 1764, 67, 67, 67, 67, 67, 67, 67, 494, 67, 67, 67, 67, 67, 67, 67, 67, 67, 787, 67, 67, 67, 67, 67, 67, 45, 45, 420, 45, 45, 422, 45, 45, 425, 45, 45, 45, 45, 45, 45, 45, 387, 45, 45, 45, 45, 397, 45, 45, 45, 67, 460, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 515, 67, 485, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 498, 67, 67, 67, 67, 67, 97, 0, 2039, 97, 97, 97, 97, 97, 45, 45, 45, 45, 1426, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1689, 67, 67, 67, 97, 557, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 612, 97, 582, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 595, 97, 97, 97, 97, 97, 896, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 885, 97, 97, 97, 97, 97, 45, 939, 45, 45, 45, 45, 943, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1916, 67, 67, 67, 67, 67, 45, 67, 67, 67, 67, 67, 67, 67, 1015, 67, 67, 67, 67, 1019, 67, 67, 67, 67, 67, 67, 1271, 67, 67, 67, 67, 67, 67, 1277, 67, 67, 67, 67, 67, 67, 1287, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 804, 67, 67, 67, 67, 67, 1077, 67, 67, 67, 67, 67, 67, 67, 37689, 0, 25403, 0, 66365, 0, 0, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2437120, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2543616, 2170880, 2170880, 2170880, 2170880, 2170880, 2629632, 1169, 97, 1171, 97, 97, 97, 97, 97, 97, 97, 12288, 0, 925, 0, 1179, 0, 0, 0, 0, 925, 41606, 0, 0, 0, 0, 45, 45, 45, 45, 936, 45, 45, 67, 67, 214, 67, 220, 67, 67, 233, 67, 243, 67, 248, 67, 67, 67, 67, 67, 67, 1298, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 1617, 97, 0, 0, 0, 45, 45, 45, 1183, 45, 45, 45, 45, 45, 45, 45, 45, 45, 393, 45, 45, 45, 45, 45, 45, 67, 67, 1243, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1074, 67, 67, 1281, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 776, 1323, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 907, 45, 1412, 45, 45, 45, 45, 45, 45, 45, 1418, 45, 45, 45, 45, 45, 45, 686, 45, 45, 45, 690, 45, 45, 695, 45, 45, 67, 67, 67, 67, 67, 1465, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1712, 97, 97, 97, 97, 1741, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 426, 45, 45, 45, 45, 45, 45, 67, 67, 67, 1924, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 97, 97, 1983, 97, 97, 45, 45, 1987, 45, 1988, 45, 0, 97, 97, 97, 97, 0, 0, 0, 1942, 97, 97, 97, 97, 97, 45, 45, 45, 700, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 711, 45, 45, 153, 45, 45, 166, 45, 176, 45, 181, 45, 45, 188, 191, 196, 45, 204, 255, 258, 263, 67, 271, 67, 67, 0, 37139, 24853, 0, 0, 0, 282, 41098, 65820, 97, 97, 97, 294, 97, 300, 97, 97, 313, 97, 323, 97, 328, 97, 97, 335, 338, 343, 97, 351, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 356, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 41098, 0, 140, 45, 45, 45, 45, 1404, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1411, 67, 67, 486, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1251, 67, 67, 501, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 513, 67, 67, 67, 67, 67, 67, 1443, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1263, 67, 67, 67, 67, 67, 97, 97, 583, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1526, 97, 598, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 610, 97, 97, 0, 97, 97, 1796, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 1744, 45, 45, 45, 369, 0, 651, 45, 653, 45, 654, 45, 656, 45, 45, 45, 660, 45, 45, 45, 45, 1558, 45, 45, 45, 45, 45, 45, 45, 45, 1566, 45, 45, 681, 45, 683, 45, 45, 45, 45, 45, 45, 45, 45, 691, 692, 694, 45, 45, 45, 716, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 709, 45, 45, 712, 45, 714, 45, 45, 45, 718, 45, 45, 45, 45, 45, 45, 45, 726, 45, 45, 45, 733, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1691, 67, 67, 747, 67, 67, 67, 67, 67, 67, 67, 67, 67, 760, 67, 67, 67, 0, 0, 0, 0, 0, 0, 97, 1613, 97, 97, 97, 97, 97, 97, 1509, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 1179, 0, 45, 45, 45, 45, 67, 764, 67, 67, 67, 67, 768, 67, 770, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 0, 1977, 67, 778, 779, 781, 67, 67, 67, 67, 67, 67, 788, 789, 67, 67, 792, 793, 67, 67, 67, 813, 67, 67, 67, 67, 67, 67, 67, 67, 67, 824, 37689, 544, 25403, 546, 70179, 0, 0, 66365, 66365, 552, 0, 836, 97, 838, 97, 839, 97, 841, 97, 97, 97, 845, 97, 97, 97, 97, 97, 97, 97, 97, 97, 858, 97, 97, 0, 1728, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 1802, 45, 97, 97, 862, 97, 97, 97, 97, 866, 97, 868, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 1788, 97, 97, 97, 0, 0, 97, 97, 876, 877, 879, 97, 97, 97, 97, 97, 97, 886, 887, 97, 97, 890, 891, 97, 97, 97, 97, 97, 97, 97, 899, 97, 97, 97, 903, 97, 97, 97, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 1646, 97, 97, 97, 97, 911, 97, 97, 97, 97, 97, 97, 97, 97, 97, 922, 923, 45, 955, 45, 957, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 195, 45, 45, 45, 45, 45, 981, 982, 45, 45, 45, 45, 45, 45, 989, 45, 45, 45, 45, 45, 170, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 411, 45, 45, 45, 45, 45, 67, 1023, 67, 67, 67, 67, 67, 67, 1031, 67, 1033, 67, 67, 67, 67, 67, 67, 67, 817, 819, 67, 67, 67, 67, 67, 37689, 544, 67, 1065, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 516, 67, 67, 1078, 67, 67, 1081, 1082, 67, 67, 37689, 0, 25403, 0, 66365, 0, 0, 0, 0, 0, 0, 0, 0, 2171166, 2171166, 2171166, 2171166, 2171166, 2437406, 2171166, 2171166, 97, 1115, 97, 1117, 97, 97, 97, 97, 97, 97, 1125, 97, 1127, 97, 97, 97, 0, 97, 97, 97, 0, 97, 97, 97, 97, 1644, 97, 97, 97, 0, 97, 97, 97, 0, 97, 97, 1642, 97, 97, 97, 97, 97, 97, 625, 97, 97, 97, 97, 97, 97, 97, 97, 97, 316, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1159, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1502, 97, 97, 97, 97, 97, 1172, 97, 97, 1175, 1176, 97, 97, 12288, 0, 925, 0, 1179, 0, 0, 0, 0, 925, 41606, 0, 0, 0, 0, 45, 45, 45, 935, 45, 45, 45, 1233, 45, 45, 45, 1236, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1873, 67, 67, 45, 45, 1218, 45, 45, 45, 1223, 45, 45, 45, 45, 45, 45, 45, 1230, 45, 45, 67, 67, 215, 219, 222, 67, 230, 67, 67, 244, 246, 249, 67, 67, 67, 67, 67, 67, 1882, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 1904, 45, 1905, 45, 67, 67, 67, 67, 67, 1258, 67, 1260, 67, 67, 67, 67, 67, 67, 67, 67, 67, 495, 67, 67, 67, 67, 67, 67, 67, 67, 1283, 67, 67, 67, 67, 67, 67, 67, 1290, 67, 67, 67, 67, 67, 67, 67, 818, 67, 67, 67, 67, 67, 67, 37689, 544, 67, 67, 1295, 67, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 2174976, 0, 0, 97, 97, 97, 1326, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1514, 97, 97, 97, 97, 97, 1338, 97, 1340, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1500, 97, 97, 1503, 97, 1363, 97, 97, 97, 97, 97, 97, 97, 1370, 97, 97, 97, 97, 97, 97, 97, 563, 97, 97, 97, 97, 97, 97, 578, 97, 1375, 97, 97, 97, 97, 97, 97, 97, 97, 0, 1179, 0, 45, 45, 45, 45, 685, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1003, 45, 45, 45, 45, 67, 67, 67, 1463, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1778, 97, 97, 97, 97, 97, 1518, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 609, 97, 97, 97, 45, 1542, 45, 45, 45, 45, 45, 45, 45, 1548, 45, 45, 45, 45, 45, 1554, 45, 1570, 1571, 45, 67, 67, 67, 67, 67, 67, 1578, 67, 67, 67, 67, 67, 67, 67, 1055, 67, 67, 67, 67, 67, 1061, 67, 67, 1582, 67, 67, 67, 67, 67, 67, 67, 1588, 67, 67, 67, 67, 67, 1594, 67, 67, 67, 67, 67, 97, 2038, 0, 97, 97, 97, 97, 97, 2044, 45, 45, 45, 995, 45, 45, 45, 45, 1000, 45, 45, 45, 45, 45, 45, 45, 1809, 45, 1811, 45, 45, 45, 45, 45, 67, 1610, 1611, 67, 1476, 0, 1478, 0, 1480, 0, 97, 97, 97, 97, 97, 97, 1618, 1647, 1649, 97, 97, 97, 1652, 97, 1654, 1655, 97, 0, 45, 45, 45, 1658, 45, 45, 67, 67, 216, 67, 67, 67, 67, 234, 67, 67, 67, 67, 252, 254, 1845, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 945, 45, 947, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1881, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 1902, 45, 45, 45, 45, 45, 45, 1908, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1921, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 0, 97, 1937, 97, 97, 1940, 0, 0, 97, 97, 97, 97, 97, 97, 1947, 1948, 1949, 45, 45, 45, 1952, 45, 1954, 45, 45, 45, 45, 1959, 1960, 1961, 67, 67, 67, 67, 67, 67, 1455, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 757, 67, 67, 67, 67, 67, 67, 1964, 67, 1966, 67, 67, 67, 67, 1971, 1972, 1973, 97, 0, 0, 0, 97, 97, 1104, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 884, 97, 97, 97, 889, 97, 97, 1978, 97, 0, 0, 1981, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 736, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1018, 67, 67, 67, 45, 67, 67, 67, 67, 0, 2049, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 0, 0, 925, 41606, 0, 0, 0, 0, 45, 933, 45, 45, 45, 45, 1234, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 97, 97, 288, 97, 97, 97, 97, 97, 97, 317, 97, 97, 97, 97, 97, 97, 0, 0, 97, 1787, 97, 97, 97, 97, 0, 0, 45, 45, 378, 45, 45, 45, 45, 45, 390, 45, 45, 45, 45, 45, 45, 45, 424, 45, 45, 45, 431, 433, 45, 45, 45, 67, 1050, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 518, 67, 97, 97, 97, 1144, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 632, 97, 97, 97, 97, 97, 97, 97, 1367, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 855, 97, 97, 97, 97, 67, 97, 97, 97, 97, 97, 97, 1837, 0, 97, 97, 97, 97, 97, 0, 0, 0, 1897, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 1208, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 724, 45, 45, 45, 45, 45, 97, 2010, 45, 45, 45, 45, 45, 45, 2016, 67, 67, 67, 67, 67, 67, 2022, 45, 2046, 67, 67, 67, 0, 0, 2050, 97, 97, 97, 45, 45, 67, 67, 0, 0, 0, 0, 925, 41606, 0, 0, 0, 0, 932, 45, 45, 45, 45, 45, 1222, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1227, 45, 45, 45, 45, 45, 133, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 45, 45, 701, 702, 45, 45, 705, 706, 45, 45, 45, 45, 45, 45, 703, 45, 45, 45, 45, 45, 45, 45, 45, 45, 719, 45, 45, 45, 45, 45, 725, 45, 45, 45, 369, 649, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1216, 25403, 546, 70179, 0, 0, 66365, 66365, 552, 834, 97, 97, 97, 97, 97, 97, 97, 1342, 97, 97, 97, 97, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 1799, 97, 97, 45, 45, 45, 1569, 45, 45, 45, 1572, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 1306, 0, 67, 67, 67, 1598, 67, 67, 67, 67, 67, 67, 67, 67, 1606, 67, 67, 1609, 97, 97, 97, 1650, 97, 97, 1653, 97, 97, 97, 0, 45, 45, 1657, 45, 45, 45, 1206, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1421, 45, 45, 45, 1703, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 1711, 97, 97, 0, 1895, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 958, 45, 960, 45, 45, 45, 45, 45, 45, 45, 45, 1913, 45, 45, 1915, 67, 67, 67, 67, 67, 67, 67, 466, 67, 67, 67, 67, 67, 67, 481, 67, 45, 1749, 45, 45, 45, 45, 45, 45, 45, 45, 1755, 45, 45, 45, 45, 45, 173, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 974, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1773, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1886, 0, 0, 0, 97, 97, 67, 2035, 2036, 67, 67, 97, 0, 0, 97, 2041, 2042, 97, 97, 45, 45, 45, 45, 1662, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1397, 45, 45, 45, 45, 151, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 437, 205, 45, 67, 67, 67, 218, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1047, 67, 67, 67, 67, 97, 97, 97, 97, 298, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 870, 97, 97, 97, 97, 97, 97, 97, 97, 352, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 0, 0, 0, 0, 0, 0, 365, 0, 41098, 0, 140, 45, 45, 45, 45, 45, 1427, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1435, 520, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1037, 617, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 923, 45, 1232, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1919, 67, 1759, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1021, 45, 154, 45, 162, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 964, 45, 45, 45, 206, 45, 67, 67, 67, 67, 221, 67, 229, 67, 67, 67, 67, 67, 67, 67, 67, 530, 67, 67, 67, 67, 67, 67, 67, 67, 755, 67, 67, 67, 67, 67, 67, 67, 67, 785, 67, 67, 67, 67, 67, 67, 67, 67, 802, 67, 67, 67, 807, 67, 67, 67, 97, 97, 97, 97, 353, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 0, 0, 0, 0, 0, 0, 366, 0, 0, 0, 140, 2170880, 2170880, 2170880, 2416640, 402, 45, 45, 45, 45, 45, 45, 45, 410, 45, 45, 45, 45, 45, 45, 45, 674, 45, 45, 45, 45, 45, 45, 45, 45, 389, 45, 394, 45, 45, 398, 45, 45, 45, 45, 441, 45, 45, 45, 45, 45, 447, 45, 45, 45, 454, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1768, 67, 67, 67, 67, 67, 488, 67, 67, 67, 67, 67, 67, 67, 496, 67, 67, 67, 67, 67, 67, 67, 1774, 67, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 67, 67, 523, 67, 67, 527, 67, 67, 67, 67, 67, 533, 67, 67, 67, 540, 97, 97, 97, 585, 97, 97, 97, 97, 97, 97, 97, 593, 97, 97, 97, 97, 97, 97, 1784, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 0, 18, 18, 24, 24, 0, 28, 28, 97, 97, 620, 97, 97, 624, 97, 97, 97, 97, 97, 630, 97, 97, 97, 637, 713, 45, 45, 45, 45, 45, 45, 721, 45, 45, 45, 45, 45, 45, 45, 45, 1197, 45, 45, 45, 45, 45, 45, 45, 45, 730, 732, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1581, 67, 45, 67, 67, 67, 67, 1012, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1059, 67, 67, 67, 67, 67, 1024, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 775, 67, 67, 67, 67, 1066, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 479, 67, 67, 67, 67, 67, 67, 1080, 67, 67, 67, 67, 37689, 0, 25403, 0, 66365, 0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 287, 0, 2379776, 2170880, 2170880, 97, 97, 97, 1118, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 920, 97, 97, 0, 0, 0, 0, 45, 1181, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 432, 45, 45, 45, 45, 45, 45, 1219, 45, 45, 45, 45, 45, 45, 1226, 45, 45, 45, 45, 45, 45, 959, 45, 45, 45, 45, 45, 45, 45, 45, 45, 184, 45, 45, 45, 45, 202, 45, 1241, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1266, 67, 1268, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1279, 67, 67, 67, 67, 67, 272, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 67, 67, 67, 67, 67, 1286, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1293, 67, 67, 67, 1296, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 281, 94, 0, 0, 97, 97, 97, 1366, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1373, 97, 97, 18, 0, 139621, 0, 0, 0, 0, 0, 0, 364, 0, 0, 367, 0, 97, 1376, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 1384, 45, 45, 67, 208, 67, 67, 67, 67, 67, 67, 237, 67, 67, 67, 67, 67, 67, 67, 1069, 1070, 67, 67, 67, 67, 67, 67, 67, 0, 37140, 24854, 0, 0, 0, 0, 41098, 65821, 45, 1423, 45, 45, 45, 45, 45, 45, 67, 67, 1431, 67, 67, 67, 67, 67, 67, 67, 1083, 37689, 0, 25403, 0, 66365, 0, 0, 0, 1436, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1830, 67, 1452, 1453, 67, 67, 67, 67, 1456, 67, 67, 67, 67, 67, 67, 67, 67, 67, 771, 67, 67, 67, 67, 67, 67, 1461, 67, 67, 67, 1464, 67, 1466, 67, 67, 67, 67, 67, 67, 1470, 67, 67, 67, 67, 67, 67, 1587, 67, 67, 67, 67, 67, 67, 67, 67, 1595, 1489, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1129, 97, 1505, 1506, 97, 97, 97, 97, 1510, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1163, 1164, 97, 97, 97, 97, 97, 1516, 97, 97, 97, 1519, 97, 1521, 97, 97, 97, 97, 97, 97, 1525, 97, 97, 18, 0, 139621, 0, 0, 0, 0, 0, 0, 364, 0, 0, 367, 41606, 67, 67, 67, 67, 67, 1586, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1276, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1600, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1301, 0, 0, 0, 1307, 97, 97, 1620, 97, 97, 97, 97, 97, 97, 97, 1627, 97, 97, 97, 97, 97, 97, 913, 97, 97, 97, 97, 919, 97, 97, 97, 0, 97, 97, 97, 1781, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 1792, 1860, 45, 1862, 1863, 45, 1865, 45, 67, 67, 67, 67, 67, 67, 67, 67, 1875, 67, 1877, 1878, 67, 1880, 67, 97, 97, 97, 97, 97, 1887, 0, 1889, 97, 97, 18, 0, 139621, 0, 0, 0, 0, 0, 0, 364, 237568, 0, 367, 0, 97, 1893, 0, 0, 0, 97, 1898, 1899, 97, 1901, 97, 45, 45, 45, 45, 45, 2014, 45, 67, 67, 67, 67, 67, 2020, 67, 97, 1989, 45, 1990, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1996, 67, 1997, 67, 67, 67, 67, 67, 273, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 67, 67, 97, 97, 97, 97, 0, 0, 97, 97, 2005, 0, 97, 2007, 97, 97, 18, 0, 139621, 0, 0, 0, 642, 0, 133, 364, 0, 0, 367, 41606, 0, 97, 97, 2056, 2057, 0, 2059, 45, 67, 0, 97, 45, 67, 0, 97, 45, 45, 67, 209, 67, 67, 67, 223, 67, 67, 67, 67, 67, 67, 67, 67, 67, 786, 67, 67, 67, 791, 67, 67, 45, 45, 940, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 727, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 1016, 67, 67, 67, 67, 67, 67, 67, 67, 37689, 0, 25403, 0, 66365, 0, 0, 0, 133, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 142, 45, 45, 67, 210, 67, 67, 67, 225, 67, 67, 239, 67, 67, 67, 250, 67, 67, 67, 67, 67, 464, 67, 67, 67, 67, 67, 476, 67, 67, 67, 67, 67, 67, 67, 1709, 67, 67, 67, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 1843, 0, 67, 259, 67, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 97, 289, 97, 97, 97, 303, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 901, 97, 97, 97, 97, 97, 339, 97, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 0, 358, 0, 0, 0, 0, 0, 0, 41098, 0, 140, 45, 45, 45, 45, 45, 1953, 45, 1955, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1687, 1688, 67, 67, 67, 67, 45, 45, 405, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1203, 45, 458, 67, 67, 67, 67, 67, 67, 67, 67, 67, 470, 477, 67, 67, 67, 67, 67, 67, 67, 1970, 97, 97, 97, 1974, 0, 0, 0, 97, 1103, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1372, 97, 97, 97, 97, 67, 522, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 536, 67, 67, 67, 67, 67, 67, 1696, 67, 67, 67, 67, 67, 67, 67, 1701, 67, 555, 97, 97, 97, 97, 97, 97, 97, 97, 97, 567, 574, 97, 97, 97, 97, 97, 301, 97, 309, 97, 97, 97, 97, 97, 97, 97, 97, 97, 900, 97, 97, 97, 905, 97, 97, 97, 619, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 633, 97, 97, 18, 0, 139621, 0, 0, 362, 0, 0, 0, 364, 0, 0, 367, 41606, 369, 649, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 663, 664, 67, 67, 67, 67, 750, 751, 67, 67, 67, 67, 758, 67, 67, 67, 67, 67, 67, 67, 1272, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1057, 1058, 67, 67, 67, 67, 67, 67, 67, 67, 797, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 512, 67, 67, 67, 97, 97, 97, 97, 895, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 902, 97, 97, 97, 97, 67, 67, 1051, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1062, 67, 67, 67, 67, 67, 491, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1302, 0, 0, 0, 1308, 97, 97, 97, 97, 1145, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1139, 97, 97, 97, 97, 1156, 97, 97, 97, 97, 97, 97, 1161, 97, 97, 97, 97, 97, 1166, 97, 97, 18, 640, 139621, 0, 641, 0, 0, 0, 0, 364, 0, 0, 367, 41606, 67, 67, 67, 67, 1257, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 0, 1305, 0, 0, 97, 97, 1337, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1630, 97, 67, 1474, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2380062, 2171166, 2171166, 97, 1529, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1228, 45, 45, 45, 45, 67, 67, 67, 67, 1707, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 1891, 1739, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1198, 45, 1200, 45, 45, 45, 45, 97, 97, 1894, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 672, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1420, 45, 45, 45, 45, 67, 67, 1965, 67, 1967, 67, 67, 67, 97, 97, 97, 97, 0, 1976, 0, 97, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 97, 97, 1979, 0, 0, 97, 1982, 97, 97, 97, 1986, 45, 45, 45, 45, 45, 735, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1770, 67, 67, 2000, 97, 97, 97, 2002, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1798, 97, 97, 97, 45, 45, 45, 2034, 67, 67, 67, 67, 97, 0, 0, 2040, 97, 97, 97, 97, 45, 45, 45, 45, 1752, 45, 45, 45, 1753, 1754, 45, 45, 45, 45, 45, 45, 383, 45, 45, 45, 45, 45, 45, 45, 45, 45, 675, 45, 45, 45, 45, 45, 45, 438, 45, 45, 45, 45, 45, 445, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1430, 67, 67, 67, 67, 67, 67, 67, 67, 67, 524, 67, 67, 67, 67, 67, 531, 67, 67, 67, 67, 67, 67, 67, 67, 37689, 0, 25403, 0, 66365, 0, 0, 1096, 97, 97, 97, 621, 97, 97, 97, 97, 97, 628, 97, 97, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 356, 28, 28, 665, 45, 45, 45, 45, 45, 45, 45, 45, 45, 676, 45, 45, 45, 45, 45, 942, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 707, 708, 45, 45, 45, 45, 763, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 809, 810, 67, 67, 67, 67, 783, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 1303, 0, 0, 0, 97, 861, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 613, 97, 45, 45, 956, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1215, 45, 67, 67, 67, 67, 1027, 67, 67, 67, 67, 1032, 67, 67, 67, 67, 67, 67, 67, 67, 37689, 0, 25403, 0, 66365, 0, 0, 1097, 1064, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1075, 67, 1098, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 331, 97, 97, 97, 97, 1158, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 594, 97, 97, 1309, 0, 0, 0, 1315, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1374, 97, 45, 45, 1543, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1240, 67, 67, 1583, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1252, 67, 97, 97, 97, 1635, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1800, 97, 45, 45, 45, 97, 97, 1793, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 1743, 45, 45, 45, 1746, 45, 0, 97, 97, 97, 97, 97, 1851, 97, 45, 45, 45, 45, 1856, 45, 45, 45, 45, 1864, 45, 45, 67, 67, 1869, 67, 67, 67, 67, 1874, 67, 0, 97, 97, 45, 67, 2058, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 45, 67, 211, 67, 67, 67, 67, 67, 67, 240, 67, 67, 67, 67, 67, 67, 67, 1444, 67, 67, 67, 67, 67, 67, 67, 67, 67, 509, 67, 67, 67, 67, 67, 67, 67, 67, 67, 268, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 97, 290, 97, 97, 97, 305, 97, 97, 319, 97, 97, 97, 330, 97, 97, 18, 640, 139621, 0, 641, 0, 0, 0, 0, 364, 0, 643, 367, 41606, 97, 97, 348, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 139621, 0, 0, 0, 0, 364, 0, 367, 41098, 369, 140, 45, 45, 45, 45, 380, 45, 45, 45, 45, 45, 45, 395, 45, 45, 45, 400, 369, 0, 45, 45, 45, 45, 45, 45, 45, 45, 658, 45, 45, 45, 45, 45, 972, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 427, 45, 45, 45, 45, 45, 745, 67, 67, 67, 67, 67, 67, 67, 67, 756, 67, 67, 67, 67, 67, 67, 67, 67, 37689, 1086, 25403, 1090, 66365, 1094, 0, 0, 97, 843, 97, 97, 97, 97, 97, 97, 97, 97, 854, 97, 97, 97, 97, 97, 97, 1121, 97, 97, 97, 97, 1126, 97, 97, 97, 97, 45, 980, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1400, 45, 67, 67, 67, 1011, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 1304, 0, 0, 0, 1190, 45, 45, 1193, 1194, 45, 45, 45, 45, 45, 1199, 45, 1201, 45, 45, 45, 45, 1911, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1579, 67, 67, 67, 67, 45, 1205, 45, 45, 45, 45, 45, 45, 45, 45, 1211, 45, 45, 45, 45, 45, 984, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1550, 45, 45, 45, 45, 45, 1217, 45, 45, 45, 45, 45, 45, 1225, 45, 45, 45, 45, 1229, 45, 45, 45, 1388, 45, 45, 45, 45, 45, 45, 1396, 45, 45, 45, 45, 45, 444, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1574, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1590, 67, 67, 67, 67, 67, 1254, 67, 67, 67, 67, 67, 1259, 67, 1261, 67, 67, 67, 67, 1265, 67, 67, 67, 67, 67, 67, 1708, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 67, 67, 67, 67, 1285, 67, 67, 67, 67, 1289, 67, 67, 67, 67, 67, 67, 67, 67, 37689, 1087, 25403, 1091, 66365, 1095, 0, 0, 97, 97, 97, 97, 1339, 97, 1341, 97, 97, 97, 97, 1345, 97, 97, 97, 97, 97, 561, 97, 97, 97, 97, 97, 573, 97, 97, 97, 97, 97, 97, 1717, 97, 0, 97, 97, 97, 97, 97, 97, 97, 591, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1329, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1351, 97, 97, 97, 97, 97, 97, 1357, 97, 97, 97, 97, 97, 588, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 568, 97, 97, 97, 97, 97, 97, 97, 1365, 97, 97, 97, 97, 1369, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1356, 97, 97, 97, 97, 97, 97, 45, 45, 1403, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1399, 45, 45, 45, 1413, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1669, 45, 1422, 45, 45, 1425, 45, 45, 1428, 45, 1429, 67, 67, 67, 67, 67, 67, 67, 67, 1468, 67, 67, 67, 67, 67, 67, 67, 67, 529, 67, 67, 67, 67, 67, 67, 539, 67, 67, 1475, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 2170880, 2170880, 2170880, 2416640, 97, 97, 1530, 97, 0, 45, 45, 1534, 45, 45, 45, 45, 45, 45, 45, 45, 1956, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1599, 67, 67, 1601, 67, 67, 67, 67, 67, 67, 67, 67, 67, 803, 67, 67, 67, 67, 67, 67, 1632, 97, 1634, 0, 97, 97, 97, 1640, 97, 97, 97, 1643, 97, 97, 1645, 97, 97, 97, 97, 97, 912, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 45, 45, 1660, 1661, 45, 45, 45, 45, 1665, 1666, 45, 45, 45, 45, 45, 1670, 1692, 1693, 67, 67, 67, 67, 67, 1697, 67, 67, 67, 67, 67, 67, 67, 1702, 97, 97, 1714, 1715, 97, 97, 97, 97, 0, 1721, 1722, 97, 97, 97, 97, 97, 97, 1353, 97, 97, 97, 97, 97, 97, 97, 97, 1362, 1726, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 1734, 97, 97, 97, 97, 97, 848, 849, 97, 97, 97, 97, 856, 97, 97, 97, 97, 97, 354, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 45, 45, 1750, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1681, 45, 0, 1846, 97, 97, 97, 97, 97, 97, 45, 45, 1854, 45, 45, 45, 45, 1859, 67, 67, 67, 1879, 67, 67, 97, 97, 1884, 97, 97, 0, 0, 0, 97, 97, 97, 1105, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1344, 97, 97, 97, 1347, 97, 1892, 97, 0, 0, 0, 97, 97, 97, 1900, 97, 97, 45, 45, 45, 45, 45, 997, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1002, 45, 45, 1005, 1006, 45, 67, 67, 67, 67, 67, 1926, 67, 67, 1928, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1737, 97, 0, 97, 97, 97, 97, 0, 0, 0, 97, 97, 1944, 97, 97, 1946, 45, 45, 45, 1544, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 190, 45, 45, 45, 152, 155, 45, 163, 45, 45, 177, 179, 182, 45, 45, 45, 193, 197, 45, 45, 45, 1672, 45, 45, 45, 45, 45, 1677, 45, 1679, 45, 45, 45, 45, 996, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1212, 45, 45, 45, 45, 67, 260, 264, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 97, 97, 295, 299, 302, 97, 310, 97, 97, 324, 326, 329, 97, 97, 97, 0, 97, 97, 1639, 0, 1641, 97, 97, 97, 97, 97, 97, 97, 97, 1511, 97, 97, 97, 97, 97, 97, 97, 97, 1523, 97, 97, 97, 97, 97, 97, 97, 97, 1719, 97, 97, 97, 97, 97, 97, 97, 97, 1720, 97, 97, 97, 97, 97, 97, 97, 312, 97, 97, 97, 97, 97, 97, 97, 97, 1123, 97, 97, 97, 97, 97, 97, 97, 340, 344, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 139621, 0, 0, 0, 0, 364, 0, 367, 41098, 369, 140, 45, 45, 373, 375, 419, 45, 45, 45, 45, 45, 45, 45, 45, 45, 428, 45, 45, 435, 45, 45, 45, 1751, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1410, 45, 45, 45, 67, 67, 67, 505, 67, 67, 67, 67, 67, 67, 67, 67, 67, 514, 67, 67, 67, 67, 67, 67, 1969, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 45, 67, 0, 97, 45, 67, 0, 97, 2064, 2065, 0, 2066, 45, 521, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 534, 67, 67, 67, 67, 67, 67, 465, 67, 67, 67, 474, 67, 67, 67, 67, 67, 67, 67, 1467, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 1933, 0, 97, 97, 97, 602, 97, 97, 97, 97, 97, 97, 97, 97, 97, 611, 97, 97, 18, 640, 139621, 358, 641, 0, 0, 0, 0, 364, 0, 0, 367, 0, 618, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 631, 97, 97, 97, 97, 97, 881, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 569, 97, 97, 97, 97, 97, 369, 0, 45, 652, 45, 45, 45, 45, 45, 657, 45, 45, 45, 45, 45, 45, 1235, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 1432, 67, 67, 67, 67, 67, 67, 67, 766, 67, 67, 67, 67, 67, 67, 67, 67, 773, 67, 67, 67, 0, 1305, 0, 1311, 0, 1317, 97, 97, 97, 97, 97, 97, 97, 1624, 97, 97, 97, 97, 97, 97, 97, 97, 0, 97, 97, 97, 1724, 97, 97, 97, 777, 67, 67, 782, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 535, 67, 67, 67, 67, 67, 67, 67, 814, 67, 67, 67, 67, 67, 67, 67, 67, 67, 37689, 544, 25403, 546, 70179, 0, 0, 66365, 66365, 552, 0, 97, 837, 97, 97, 97, 97, 97, 97, 1496, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 918, 97, 97, 97, 97, 0, 842, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1168, 97, 97, 97, 97, 864, 97, 97, 97, 97, 97, 97, 97, 97, 871, 97, 97, 97, 0, 1637, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1801, 45, 45, 97, 875, 97, 97, 880, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1151, 1152, 97, 97, 97, 67, 67, 67, 1040, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 790, 67, 67, 67, 1180, 0, 649, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 200, 45, 45, 67, 67, 67, 1454, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 806, 67, 67, 67, 0, 0, 0, 1481, 0, 1094, 0, 0, 97, 1483, 97, 97, 97, 97, 97, 97, 304, 97, 97, 318, 97, 97, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 97, 97, 97, 1507, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1332, 97, 97, 97, 1619, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1631, 97, 1633, 97, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1381, 0, 0, 45, 45, 45, 45, 97, 97, 1727, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 626, 97, 97, 97, 97, 97, 97, 636, 45, 45, 1760, 67, 67, 67, 67, 67, 67, 67, 1765, 67, 67, 67, 67, 67, 67, 67, 1299, 67, 67, 67, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 1616, 97, 97, 1803, 45, 45, 45, 45, 1807, 45, 45, 45, 45, 45, 1813, 45, 45, 45, 67, 67, 1684, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 822, 67, 67, 37689, 544, 67, 67, 1818, 67, 67, 67, 67, 1822, 67, 67, 67, 67, 67, 1828, 67, 67, 67, 67, 67, 97, 0, 0, 97, 97, 97, 97, 97, 45, 45, 45, 2012, 2013, 45, 45, 67, 67, 67, 2018, 2019, 67, 67, 97, 67, 97, 97, 97, 1833, 97, 97, 0, 0, 97, 97, 1840, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 1733, 97, 1735, 97, 97, 97, 0, 97, 97, 97, 1849, 97, 97, 97, 45, 45, 45, 45, 45, 1857, 45, 45, 45, 1910, 45, 1912, 45, 45, 1914, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1017, 67, 67, 1020, 67, 45, 1861, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1872, 67, 67, 67, 67, 67, 67, 752, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1446, 67, 67, 67, 67, 67, 1876, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 1890, 97, 97, 97, 97, 97, 1134, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 570, 97, 97, 97, 97, 580, 1935, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 1906, 45, 67, 67, 67, 67, 2048, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 0, 0, 925, 41606, 0, 0, 0, 931, 45, 45, 45, 45, 45, 45, 1674, 45, 1676, 45, 45, 45, 45, 45, 45, 45, 446, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1871, 67, 67, 67, 67, 0, 97, 97, 45, 67, 0, 97, 2060, 2061, 0, 2063, 45, 67, 0, 97, 45, 45, 156, 45, 45, 45, 45, 45, 45, 45, 45, 45, 192, 45, 45, 45, 45, 1673, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 429, 45, 45, 45, 45, 67, 67, 67, 269, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 97, 349, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 139621, 0, 0, 0, 0, 364, 0, 367, 41098, 369, 140, 45, 45, 374, 45, 45, 67, 67, 213, 217, 67, 67, 67, 67, 67, 242, 67, 247, 67, 253, 45, 45, 698, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 399, 45, 45, 0, 0, 0, 0, 925, 41606, 0, 929, 0, 0, 45, 45, 45, 45, 45, 45, 1391, 45, 45, 1395, 45, 45, 45, 45, 45, 45, 423, 45, 45, 45, 45, 45, 45, 45, 436, 45, 67, 67, 67, 67, 1041, 67, 1043, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1776, 67, 67, 97, 97, 97, 1099, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 888, 97, 97, 97, 1131, 97, 97, 97, 97, 1135, 97, 1137, 97, 97, 97, 97, 97, 97, 97, 1497, 97, 97, 97, 97, 97, 97, 97, 97, 97, 883, 97, 97, 97, 97, 97, 97, 1310, 0, 0, 0, 1316, 0, 0, 0, 0, 1100, 0, 0, 0, 97, 97, 97, 97, 97, 1107, 97, 97, 97, 97, 97, 97, 97, 97, 1343, 97, 97, 97, 97, 97, 97, 1348, 0, 0, 1317, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1112, 97, 45, 1804, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1868, 67, 1870, 67, 67, 67, 67, 67, 1817, 67, 67, 1819, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 823, 67, 37689, 544, 67, 97, 1832, 97, 97, 1834, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 0, 1732, 97, 97, 97, 97, 97, 97, 97, 850, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1177, 0, 0, 925, 0, 0, 0, 0, 97, 97, 97, 97, 0, 0, 1941, 97, 97, 97, 97, 97, 97, 45, 45, 45, 1991, 1992, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1998, 134, 0, 0, 0, 37, 110630, 0, 0, 0, 114730, 106539, 41098, 45, 45, 45, 45, 941, 45, 45, 944, 45, 45, 45, 45, 45, 45, 952, 45, 45, 207, 67, 67, 67, 67, 67, 226, 67, 67, 67, 67, 67, 67, 67, 67, 67, 820, 67, 67, 67, 67, 37689, 544, 369, 650, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1682, 25403, 546, 70179, 0, 0, 66365, 66365, 552, 835, 97, 97, 97, 97, 97, 97, 97, 1522, 97, 97, 97, 97, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1725, 67, 67, 67, 1695, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1034, 67, 1036, 67, 67, 67, 265, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 97, 97, 296, 97, 97, 97, 97, 314, 97, 97, 97, 97, 332, 334, 97, 97, 97, 97, 97, 1146, 1147, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1626, 97, 97, 97, 97, 97, 97, 345, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 139621, 0, 0, 0, 0, 364, 0, 367, 41098, 369, 140, 45, 372, 45, 45, 45, 1220, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1213, 45, 45, 45, 45, 404, 406, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 434, 45, 45, 45, 440, 45, 45, 45, 45, 45, 45, 45, 45, 451, 452, 45, 45, 45, 67, 1683, 67, 67, 67, 1686, 67, 67, 67, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 67, 67, 67, 67, 490, 492, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1447, 67, 67, 1450, 67, 67, 67, 67, 67, 526, 67, 67, 67, 67, 67, 67, 67, 67, 537, 538, 67, 67, 67, 67, 67, 506, 67, 67, 508, 67, 67, 511, 67, 67, 67, 67, 0, 1476, 0, 0, 0, 0, 0, 1478, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 1484, 97, 97, 97, 97, 97, 97, 865, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1499, 97, 97, 97, 97, 97, 97, 97, 97, 97, 587, 589, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 629, 97, 97, 97, 97, 97, 97, 97, 97, 97, 623, 97, 97, 97, 97, 97, 97, 97, 97, 634, 635, 97, 97, 97, 97, 97, 1160, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1628, 97, 97, 97, 97, 369, 0, 45, 45, 45, 45, 45, 655, 45, 45, 45, 45, 45, 45, 45, 45, 999, 45, 1001, 45, 45, 45, 45, 45, 45, 45, 45, 715, 45, 45, 45, 720, 45, 45, 45, 45, 45, 45, 45, 45, 728, 25403, 546, 70179, 0, 0, 66365, 66365, 552, 0, 97, 97, 97, 97, 97, 840, 97, 97, 97, 97, 97, 1174, 97, 97, 97, 97, 0, 0, 925, 0, 0, 0, 0, 0, 0, 0, 1100, 97, 97, 97, 97, 97, 97, 97, 97, 627, 97, 97, 97, 97, 97, 97, 97, 938, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 680, 45, 968, 45, 970, 45, 973, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 962, 45, 45, 45, 45, 45, 979, 45, 45, 45, 45, 45, 985, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1224, 45, 45, 45, 45, 45, 45, 45, 45, 688, 45, 45, 45, 45, 45, 45, 45, 1007, 1008, 67, 67, 67, 67, 67, 1014, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1045, 67, 67, 67, 67, 67, 67, 67, 1038, 67, 67, 67, 67, 67, 67, 1044, 67, 1046, 67, 1049, 67, 67, 67, 67, 67, 67, 800, 67, 67, 67, 67, 67, 67, 808, 67, 67, 0, 0, 0, 1102, 97, 97, 97, 97, 97, 1108, 97, 97, 97, 97, 97, 97, 306, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1371, 97, 97, 97, 97, 97, 97, 97, 97, 1132, 97, 97, 97, 97, 97, 97, 1138, 97, 1140, 97, 1143, 97, 97, 97, 97, 97, 1352, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 869, 97, 97, 97, 97, 97, 45, 1191, 45, 45, 45, 45, 45, 1196, 45, 45, 45, 45, 45, 45, 45, 45, 1407, 45, 45, 45, 45, 45, 45, 45, 45, 986, 45, 45, 45, 45, 45, 45, 991, 45, 67, 67, 67, 1256, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1048, 67, 67, 67, 97, 1336, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 615, 97, 1386, 45, 1387, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 455, 45, 457, 45, 45, 1424, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1433, 67, 1434, 67, 67, 67, 67, 67, 767, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1591, 67, 1593, 67, 67, 45, 45, 1805, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1814, 45, 45, 1816, 67, 67, 67, 67, 1820, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1829, 67, 67, 67, 67, 67, 815, 67, 67, 67, 67, 821, 67, 67, 67, 37689, 544, 67, 1831, 97, 97, 97, 97, 1835, 0, 0, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 1731, 97, 97, 97, 97, 97, 97, 97, 97, 97, 853, 97, 97, 97, 97, 97, 97, 0, 97, 97, 97, 97, 1850, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 1547, 45, 45, 45, 45, 45, 45, 45, 45, 1664, 45, 45, 45, 45, 45, 45, 45, 45, 961, 45, 45, 45, 45, 965, 45, 967, 1907, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1920, 0, 1936, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 67, 67, 67, 67, 67, 67, 1763, 67, 67, 67, 67, 67, 67, 67, 67, 1056, 67, 67, 67, 67, 67, 67, 67, 67, 1273, 67, 67, 67, 67, 67, 67, 67, 67, 1457, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 28672, 97, 45, 67, 67, 67, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 2054, 97, 97, 291, 97, 97, 97, 97, 97, 97, 320, 97, 97, 97, 97, 97, 97, 307, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 12288, 0, 925, 926, 1179, 0, 45, 377, 45, 45, 45, 381, 45, 45, 392, 45, 45, 396, 45, 45, 45, 45, 971, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1756, 45, 45, 45, 67, 67, 67, 67, 463, 67, 67, 67, 467, 67, 67, 478, 67, 67, 482, 67, 67, 67, 67, 67, 1028, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1469, 67, 67, 1472, 67, 502, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1460, 67, 97, 97, 97, 97, 560, 97, 97, 97, 564, 97, 97, 575, 97, 97, 579, 97, 97, 97, 97, 97, 1368, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 925, 0, 0, 930, 97, 599, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 872, 97, 45, 666, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1758, 0, 362, 0, 0, 925, 41606, 0, 0, 0, 0, 45, 45, 934, 45, 45, 45, 164, 168, 174, 178, 45, 45, 45, 45, 45, 194, 45, 45, 45, 165, 45, 45, 45, 45, 45, 45, 45, 45, 45, 199, 45, 45, 45, 67, 67, 1010, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1060, 67, 67, 67, 67, 67, 67, 1052, 1053, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1063, 97, 1157, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1167, 97, 97, 97, 97, 97, 1379, 97, 97, 97, 0, 0, 0, 45, 1383, 45, 45, 45, 1806, 45, 45, 45, 45, 45, 45, 1812, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1577, 67, 67, 67, 67, 67, 67, 67, 753, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1262, 67, 67, 67, 67, 67, 67, 67, 1282, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1471, 67, 45, 1402, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 417, 45, 67, 1462, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 37689, 544, 97, 1517, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1128, 97, 97, 97, 97, 1636, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 851, 97, 97, 97, 97, 97, 97, 97, 67, 67, 1705, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 1842, 0, 0, 1779, 97, 97, 97, 1782, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 1789, 97, 97, 0, 0, 0, 97, 1847, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 1675, 45, 45, 45, 45, 45, 45, 45, 45, 737, 738, 67, 740, 67, 741, 67, 743, 67, 67, 67, 67, 67, 67, 1968, 67, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 45, 67, 0, 97, 45, 67, 2062, 97, 45, 67, 0, 97, 45, 67, 67, 97, 97, 2001, 97, 0, 0, 2004, 97, 97, 0, 97, 97, 97, 97, 1797, 97, 97, 97, 97, 97, 45, 45, 45, 67, 261, 67, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 97, 292, 97, 97, 97, 97, 311, 315, 321, 325, 97, 97, 97, 97, 97, 97, 1623, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1330, 97, 97, 1333, 1334, 97, 341, 97, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 139621, 0, 0, 0, 363, 364, 0, 367, 41098, 369, 140, 45, 45, 45, 45, 1221, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 413, 45, 45, 416, 45, 376, 45, 45, 45, 45, 382, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1408, 45, 45, 45, 45, 45, 403, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 414, 45, 45, 45, 418, 67, 67, 67, 462, 67, 67, 67, 67, 468, 67, 67, 67, 67, 67, 67, 67, 67, 1602, 67, 1604, 67, 67, 67, 67, 67, 67, 67, 67, 489, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 500, 67, 67, 67, 67, 67, 1067, 67, 67, 67, 67, 67, 1072, 67, 67, 67, 67, 67, 67, 274, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 67, 67, 504, 67, 67, 67, 67, 67, 67, 67, 510, 67, 67, 67, 517, 519, 541, 67, 37139, 37139, 24853, 24853, 0, 70179, 0, 0, 0, 65820, 65820, 369, 287, 554, 97, 97, 97, 559, 97, 97, 97, 97, 565, 97, 97, 97, 97, 97, 97, 97, 1718, 0, 97, 97, 97, 97, 97, 97, 97, 898, 97, 97, 97, 97, 97, 97, 906, 97, 97, 97, 97, 586, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 597, 97, 97, 97, 97, 97, 1520, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 45, 1656, 45, 45, 45, 97, 97, 601, 97, 97, 97, 97, 97, 97, 97, 607, 97, 97, 97, 614, 616, 638, 97, 18, 0, 139621, 0, 0, 0, 0, 0, 0, 364, 0, 0, 367, 41606, 369, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 661, 45, 45, 45, 407, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1815, 45, 67, 45, 667, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 678, 45, 45, 45, 421, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 976, 977, 45, 45, 45, 682, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 693, 45, 45, 697, 67, 67, 748, 67, 67, 67, 67, 754, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1274, 67, 67, 67, 67, 67, 67, 67, 67, 765, 67, 67, 67, 67, 769, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1589, 67, 67, 67, 67, 67, 67, 67, 67, 780, 67, 67, 784, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1777, 67, 97, 97, 97, 97, 97, 97, 846, 97, 97, 97, 97, 852, 97, 97, 97, 97, 97, 97, 97, 1742, 45, 45, 45, 45, 45, 45, 45, 1747, 97, 97, 97, 863, 97, 97, 97, 97, 867, 97, 97, 97, 97, 97, 97, 97, 308, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 12288, 1178, 925, 0, 1179, 0, 97, 97, 97, 878, 97, 97, 882, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 12288, 0, 925, 0, 1179, 0, 908, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 925, 0, 0, 0, 954, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 963, 45, 45, 966, 45, 45, 157, 45, 45, 171, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 948, 45, 45, 45, 45, 45, 1022, 67, 67, 1026, 67, 67, 67, 1030, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1603, 1605, 67, 67, 67, 1608, 67, 67, 67, 1039, 67, 67, 1042, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 471, 67, 67, 67, 67, 67, 0, 1100, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 904, 97, 97, 97, 97, 1116, 97, 97, 1120, 97, 97, 97, 1124, 97, 97, 97, 97, 97, 97, 562, 97, 97, 97, 571, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1133, 97, 97, 1136, 97, 97, 97, 97, 97, 97, 97, 97, 915, 917, 97, 97, 97, 97, 97, 0, 97, 1170, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 925, 0, 0, 0, 0, 0, 41606, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 1993, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1275, 67, 67, 67, 1278, 67, 0, 0, 0, 45, 45, 1182, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1189, 1204, 45, 45, 45, 1207, 45, 45, 1209, 45, 1210, 45, 45, 45, 45, 45, 45, 1546, 45, 45, 45, 45, 45, 45, 45, 45, 45, 689, 45, 45, 45, 45, 45, 45, 1231, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 236, 67, 67, 67, 67, 67, 67, 67, 801, 67, 67, 67, 805, 67, 67, 67, 67, 67, 1242, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1249, 67, 67, 67, 67, 67, 67, 507, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1300, 0, 0, 0, 0, 0, 1267, 67, 67, 1269, 67, 1270, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1280, 97, 1349, 97, 1350, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1360, 97, 97, 97, 0, 1980, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 673, 45, 45, 45, 45, 677, 45, 45, 45, 45, 1401, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 953, 67, 1437, 67, 1440, 67, 67, 67, 67, 1445, 67, 67, 67, 1448, 67, 67, 67, 67, 67, 67, 1029, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1825, 67, 67, 67, 67, 67, 1473, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1320, 0, 834, 97, 97, 97, 97, 1490, 97, 1493, 97, 97, 97, 97, 1498, 97, 97, 97, 1501, 97, 97, 97, 0, 97, 1638, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 916, 97, 97, 97, 97, 97, 97, 0, 1528, 97, 97, 97, 0, 45, 45, 45, 1535, 45, 45, 45, 45, 45, 45, 45, 1867, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1932, 0, 0, 1555, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1567, 45, 45, 158, 45, 45, 172, 45, 45, 45, 183, 45, 45, 45, 45, 201, 45, 45, 67, 212, 67, 67, 67, 67, 231, 235, 241, 245, 67, 67, 67, 67, 67, 67, 493, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 472, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1651, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 1539, 45, 45, 45, 67, 1704, 67, 1706, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 1841, 97, 0, 1844, 97, 97, 97, 97, 1716, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 590, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 1385, 1748, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1757, 45, 45, 159, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 415, 45, 45, 97, 97, 1780, 97, 97, 97, 0, 0, 1786, 97, 97, 97, 97, 97, 0, 0, 97, 97, 1730, 0, 97, 97, 97, 97, 97, 1736, 97, 1738, 67, 97, 97, 97, 97, 97, 97, 0, 1838, 97, 97, 97, 97, 97, 0, 0, 97, 1729, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1162, 97, 97, 97, 1165, 97, 97, 97, 45, 1950, 45, 45, 45, 45, 45, 45, 45, 45, 1958, 67, 67, 67, 1962, 67, 67, 67, 67, 67, 1246, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 1710, 97, 97, 97, 1999, 67, 97, 97, 97, 97, 0, 2003, 97, 97, 97, 0, 97, 97, 2008, 2009, 45, 67, 67, 67, 67, 0, 0, 97, 97, 97, 97, 45, 2052, 67, 2053, 0, 0, 0, 0, 925, 41606, 0, 0, 930, 0, 45, 45, 45, 45, 45, 45, 1392, 45, 1394, 45, 45, 45, 45, 45, 45, 45, 1545, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1563, 1565, 45, 45, 45, 1568, 0, 97, 2055, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 28672, 97, 45, 45, 160, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 679, 45, 45, 67, 67, 266, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 346, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 139621, 0, 0, 362, 0, 364, 0, 367, 41098, 369, 140, 371, 45, 45, 45, 379, 45, 45, 45, 388, 45, 45, 45, 45, 45, 45, 45, 45, 1663, 45, 45, 45, 45, 45, 45, 45, 45, 45, 449, 45, 45, 45, 45, 45, 67, 67, 542, 37139, 37139, 24853, 24853, 0, 70179, 0, 0, 0, 65820, 65820, 369, 287, 97, 97, 97, 97, 97, 1622, 97, 97, 97, 97, 97, 97, 97, 1629, 97, 97, 0, 1794, 1795, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1745, 45, 45, 97, 639, 18, 0, 139621, 0, 0, 0, 0, 0, 0, 364, 0, 0, 367, 41606, 45, 731, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 251, 67, 67, 67, 67, 67, 798, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1073, 67, 67, 67, 860, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 873, 0, 0, 1101, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 921, 97, 0, 67, 67, 67, 67, 1245, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1250, 67, 67, 1253, 0, 0, 1312, 0, 0, 0, 1318, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 1106, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1149, 97, 97, 97, 97, 97, 1155, 97, 97, 1325, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1141, 97, 97, 67, 67, 1439, 67, 1441, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1264, 67, 67, 67, 97, 97, 1492, 97, 1494, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1331, 97, 97, 97, 97, 67, 67, 67, 2037, 67, 97, 0, 0, 97, 97, 97, 2043, 97, 45, 45, 45, 442, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 232, 67, 67, 67, 67, 67, 67, 67, 67, 1823, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1975, 0, 0, 97, 874, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1142, 97, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 65, 86, 117, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 63, 84, 115, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 61, 82, 113, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 59, 80, 111, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 57, 78, 109, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 55, 76, 107, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 53, 74, 105, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 51, 72, 103, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 49, 70, 101, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 47, 68, 99, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 45, 67, 97, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 213085, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 0, 0, 44, 0, 0, 32863, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 41, 41, 41, 0, 0, 1138688, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 0, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 89, 53264, 18, 18, 49172, 0, 57366, 0, 24, 24, 24, 0, 127, 127, 127, 127, 102432, 67, 262, 67, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 342, 97, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 139621, 0, 360, 0, 0, 364, 0, 367, 41098, 369, 140, 45, 45, 45, 45, 717, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 412, 45, 45, 45, 45, 45, 67, 1009, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1292, 67, 67, 1294, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 97, 97, 97, 1615, 97, 97, 97, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 66, 87, 118, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 64, 85, 116, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 62, 83, 114, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 60, 81, 112, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 58, 79, 110, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 56, 77, 108, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 54, 75, 106, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 52, 73, 104, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 50, 71, 102, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 48, 69, 100, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 37, 110630, 114730, 106539, 46, 67, 98, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 233472, 53264, 18, 49172, 57366, 24, 8192, 28, 102432, 0, 110630, 114730, 106539, 0, 0, 69724, 53264, 18, 18, 49172, 0, 57366, 262144, 24, 24, 24, 0, 28, 28, 28, 28, 102432, 45, 45, 161, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 710, 45, 45, 28, 139621, 359, 0, 0, 0, 364, 0, 367, 41098, 369, 140, 45, 45, 45, 45, 1389, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 949, 45, 45, 45, 45, 67, 503, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1449, 67, 67, 97, 600, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1154, 97, 0, 0, 0, 0, 925, 41606, 927, 0, 0, 0, 45, 45, 45, 45, 45, 45, 1866, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 772, 67, 67, 67, 67, 67, 45, 45, 969, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 951, 45, 45, 45, 45, 1192, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1202, 45, 45, 0, 0, 0, 1314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1488, 67, 67, 267, 67, 67, 67, 67, 0, 37139, 24853, 0, 0, 0, 0, 41098, 65820, 97, 347, 97, 97, 97, 97, 0, 53264, 0, 18, 18, 24, 24, 0, 28, 28, 139621, 0, 361, 0, 0, 364, 0, 367, 41098, 369, 140, 45, 45, 45, 45, 734, 45, 45, 45, 67, 67, 67, 67, 67, 742, 67, 67, 45, 45, 668, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1214, 45, 45, 1130, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1361, 97, 45, 45, 1671, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1552, 45, 45, 0, 0, 0, 0, 2220032, 0, 0, 1130496, 0, 0, 0, 0, 2170880, 2171020, 2170880, 2170880, 18, 0, 0, 131072, 0, 0, 0, 90112, 0, 2220032, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 1485, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 1537, 45, 45, 45, 45, 45, 1390, 45, 1393, 45, 45, 45, 45, 1398, 45, 45, 45, 2170880, 2171167, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2576384, 2215936, 3117056, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 0, 0, 0, 0, 0, 2174976, 0, 0, 0, 0, 0, 0, 2183168, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2400256, 2170880, 2170880, 2170880, 2170880, 2721252, 2744320, 2170880, 2170880, 2170880, 2834432, 2840040, 2170880, 2908160, 2170880, 2170880, 2936832, 2170880, 2170880, 2985984, 2170880, 2994176, 2170880, 2170880, 3014656, 2170880, 3059712, 3076096, 3088384, 2170880, 2170880, 2170880, 2170880, 0, 0, 0, 0, 2220032, 0, 0, 0, 1142784, 0, 0, 0, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3215360, 2215936, 2215936, 2215936, 2215936, 2215936, 2437120, 2215936, 2215936, 2215936, 3117056, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 2215936, 0, 543, 0, 545, 0, 0, 2183168, 0, 0, 831, 0, 2170880, 2170880, 2170880, 2400256, 2170880, 2170880, 2170880, 2170880, 3031040, 2170880, 3055616, 2170880, 2170880, 2170880, 2170880, 3092480, 2170880, 2170880, 3125248, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 2170880, 3198976, 2170880, 0, 0, 0, 0, 0, 0, 67, 67, 37139, 37139, 24853, 24853, 0, 0, 0, 0, 0, 65820, 65820, 0, 287, 97, 97, 97, 97, 97, 1783, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 1791, 0, 0, 546, 70179, 0, 0, 0, 0, 552, 0, 97, 97, 97, 97, 97, 97, 97, 604, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1150, 97, 97, 97, 97, 97, 147456, 147456, 147456, 147456, 147456, 147456, 147456, 147456, 147456, 147456, 147456, 147456, 0, 0, 147456, 0, 0, 0, 0, 925, 41606, 0, 928, 0, 0, 45, 45, 45, 45, 45, 45, 998, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1562, 45, 1564, 45, 45, 45, 45, 0, 2158592, 2158592, 0, 0, 0, 0, 2232320, 2232320, 2232320, 0, 2240512, 2240512, 2240512, 2240512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2170880, 2170880, 2170880, 2416640 +]; + +JSONiqTokenizer.EXPECTED = +[ 291, 300, 304, 341, 315, 309, 305, 295, 319, 323, 327, 329, 296, 333, 337, 339, 342, 346, 350, 294, 356, 360, 312, 367, 352, 371, 363, 375, 379, 383, 387, 391, 395, 726, 399, 405, 518, 684, 405, 405, 405, 405, 808, 405, 405, 405, 512, 405, 405, 405, 431, 405, 405, 406, 405, 405, 404, 405, 405, 405, 405, 405, 405, 405, 908, 631, 410, 415, 405, 414, 419, 608, 405, 429, 602, 405, 435, 443, 405, 441, 641, 478, 405, 447, 451, 450, 456, 643, 461, 460, 762, 679, 465, 469, 741, 473, 477, 482, 486, 492, 932, 931, 523, 498, 504, 720, 405, 510, 596, 405, 516, 941, 580, 522, 929, 527, 590, 589, 897, 939, 534, 538, 547, 551, 555, 559, 563, 567, 571, 969, 575, 708, 690, 689, 579, 584, 634, 405, 594, 731, 405, 600, 882, 405, 606, 895, 786, 452, 612, 405, 615, 620, 876, 624, 628, 638, 647, 651, 655, 659, 663, 667, 676, 683, 688, 695, 694, 791, 405, 699, 437, 405, 706, 714, 405, 712, 825, 870, 405, 718, 724, 769, 768, 823, 730, 735, 745, 751, 422, 755, 759, 425, 766, 902, 810, 587, 775, 888, 887, 405, 773, 992, 405, 779, 962, 405, 785, 781, 986, 790, 795, 797, 506, 500, 499, 801, 805, 814, 820, 829, 833, 837, 841, 845, 849, 853, 857, 861, 616, 865, 869, 868, 488, 405, 874, 816, 405, 880, 738, 405, 886, 892, 543, 405, 901, 906, 913, 912, 918, 494, 541, 922, 926, 936, 945, 949, 953, 957, 530, 966, 973, 960, 702, 701, 405, 979, 981, 405, 985, 747, 405, 990, 998, 914, 405, 996, 1004, 672, 975, 974, 1014, 1002, 1008, 670, 1012, 405, 405, 405, 405, 405, 401, 1018, 1022, 1026, 1106, 1071, 1111, 1111, 1111, 1082, 1145, 1030, 1101, 1034, 1038, 1106, 1106, 1106, 1106, 1046, 1206, 1052, 1106, 1072, 1111, 1111, 1042, 1134, 1065, 1111, 1112, 1056, 1160, 1207, 1062, 1204, 1208, 1069, 1106, 1106, 1106, 1076, 1111, 1207, 1161, 1122, 1205, 1064, 1094, 1106, 1106, 1107, 1111, 1111, 1111, 1078, 1086, 1207, 1092, 1098, 1046, 1058, 1106, 1106, 1110, 1111, 1111, 1116, 1120, 1161, 1126, 1202, 1104, 1106, 1145, 1146, 1129, 1138, 1088, 1151, 1048, 1157, 1153, 1132, 1141, 1165, 1107, 1111, 1172, 1179, 1109, 1183, 1175, 1143, 1147, 1187, 1108, 1191, 1195, 1144, 1199, 1168, 1212, 1216, 1220, 1224, 1228, 1232, 1236, 1557, 1247, 1241, 1241, 1038, 1434, 1241, 1241, 1241, 1241, 1254, 1275, 1617, 1241, 1280, 1287, 1241, 1241, 1241, 1287, 1241, 2114, 1291, 1241, 1243, 1241, 2049, 1824, 2094, 2095, 1520, 1309, 1241, 1241, 1302, 1241, 1321, 1311, 1241, 1241, 1313, 1778, 1325, 1336, 1241, 1241, 1325, 1330, 1353, 1241, 1241, 1695, 1354, 1241, 1241, 1241, 1294, 1686, 1331, 1241, 1696, 1368, 1241, 1338, 1370, 1241, 1392, 1399, 1364, 2017, 1406, 2016, 1405, 1716, 1406, 1407, 1422, 1417, 1421, 1241, 1241, 1241, 1349, 1426, 1241, 1774, 1756, 1241, 1773, 1241, 1241, 1345, 1964, 1812, 1432, 1241, 1241, 1345, 1993, 1459, 1241, 1241, 1241, 1395, 1848, 1767, 1465, 1241, 1241, 1394, 1847, 1242, 1477, 1241, 1241, 1428, 1241, 1445, 1492, 1241, 1241, 1438, 1241, 1499, 1241, 1241, 1241, 1455, 1241, 1818, 1448, 1241, 1250, 1241, 2026, 1623, 1449, 1241, 1612, 1616, 1241, 1614, 1241, 1257, 1241, 1241, 1985, 1292, 1586, 1512, 1241, 1517, 2050, 1526, 1674, 1519, 1524, 1647, 2051, 1532, 1537, 1551, 1544, 1550, 1555, 1561, 1571, 1578, 1584, 1590, 1591, 1653, 1595, 1602, 1606, 1610, 1634, 1628, 1640, 1633, 1645, 1241, 1241, 1241, 1469, 1241, 1970, 1651, 1241, 1270, 1241, 1241, 1819, 1449, 1241, 1293, 1664, 1241, 1241, 1481, 1485, 1574, 1672, 1241, 1241, 1513, 1317, 1487, 1684, 1241, 1241, 1533, 1299, 1694, 1241, 1241, 1295, 1241, 1241, 1241, 1546, 1700, 1241, 1241, 1707, 1241, 1713, 1241, 1849, 1715, 1241, 1720, 1241, 1276, 1267, 1241, 1241, 2107, 1657, 1864, 1241, 1881, 1241, 1326, 1292, 1241, 1685, 1358, 1724, 1338, 1241, 1363, 1362, 1342, 1340, 1361, 1339, 1833, 1372, 1360, 1833, 1833, 1342, 1343, 1835, 1341, 1731, 1738, 1344, 1241, 1745, 1241, 1379, 1241, 1241, 2092, 1241, 1388, 1761, 1754, 1241, 1386, 1241, 1400, 1760, 1241, 1241, 1241, 1598, 1734, 1241, 1241, 1241, 1635, 1645, 1241, 1780, 1766, 1241, 1241, 1332, 1771, 1241, 1241, 1629, 2079, 1241, 1242, 1784, 1241, 1241, 1680, 1639, 2063, 1790, 1241, 1241, 1741, 1241, 1241, 1800, 1241, 1241, 1762, 1473, 1241, 1806, 1241, 1241, 1786, 1240, 1709, 1241, 1241, 1241, 1668, 1811, 1241, 1940, 1241, 1401, 1974, 1241, 1408, 1413, 1382, 1241, 1816, 1241, 1241, 1802, 2086, 1811, 1241, 1817, 1945, 1823, 2095, 2095, 2047, 2094, 2046, 2080, 1241, 1409, 1312, 1376, 2096, 2048, 1241, 1241, 1807, 1241, 1241, 1241, 2035, 1241, 1241, 1828, 1241, 2057, 2061, 1241, 1241, 1843, 1241, 2059, 1241, 1241, 1241, 1690, 1847, 1241, 1241, 1241, 1703, 2102, 1848, 1241, 1241, 1853, 1292, 1848, 1241, 2016, 1857, 1241, 2002, 1868, 1241, 1436, 1241, 1241, 1271, 1305, 1241, 1874, 1241, 1241, 1884, 2037, 1892, 1241, 1890, 1241, 1461, 1241, 1241, 1795, 1241, 1241, 1891, 1241, 1878, 1241, 1888, 1241, 1888, 1905, 1896, 2087, 1912, 1903, 1241, 1911, 1906, 1916, 1905, 2027, 1863, 1925, 2088, 1859, 1861, 1922, 1927, 1931, 1935, 1494, 1241, 1241, 1918, 1907, 1939, 1917, 1944, 1949, 1241, 1241, 1451, 1955, 1241, 1241, 1241, 1796, 1727, 2061, 1241, 1241, 1899, 1241, 1660, 1968, 1241, 1241, 1951, 1678, 1978, 1241, 1241, 1241, 1839, 1241, 1241, 1984, 1982, 1241, 1488, 1241, 1241, 1624, 1450, 1989, 1241, 1241, 1241, 1870, 1995, 1292, 1241, 1241, 1958, 1261, 1241, 1996, 1241, 1241, 1241, 2039, 2008, 1241, 1241, 1750, 2000, 1241, 1256, 2001, 1960, 1241, 1564, 1241, 1504, 1241, 1241, 1442, 1241, 1241, 1564, 1528, 1263, 1241, 1508, 1241, 1241, 1468, 1498, 2006, 1540, 2015, 1539, 2014, 1748, 2013, 1539, 1831, 2014, 2012, 1500, 1567, 2022, 2021, 1241, 1580, 1241, 1241, 2033, 2037, 1791, 2045, 2031, 1241, 1621, 1241, 1641, 2044, 1241, 1241, 1241, 2093, 1241, 1241, 2055, 1241, 1241, 2067, 1241, 1283, 1241, 1241, 1241, 2101, 2071, 1241, 1241, 1241, 2073, 1848, 2040, 1241, 1241, 1241, 2077, 1241, 1241, 2106, 1241, 1241, 2084, 1241, 2111, 1241, 1241, 1381, 1380, 1241, 1241, 1241, 2100, 1241, 2129, 2118, 2122, 2126, 2197, 2133, 3010, 2825, 2145, 2698, 2156, 2226, 2160, 2161, 2165, 2174, 2293, 2194, 2630, 2201, 2203, 2152, 3019, 2226, 2263, 2209, 2213, 2218, 2269, 2292, 2269, 2269, 2184, 2226, 2238, 2148, 2151, 3017, 2245, 2214, 2269, 2269, 2185, 2226, 2292, 2269, 2291, 2269, 2269, 2269, 2292, 2205, 3019, 2226, 2226, 2160, 2160, 2160, 2261, 2160, 2160, 2160, 2262, 2276, 2160, 2160, 2277, 2216, 2283, 2216, 2269, 2269, 2268, 2269, 2267, 2269, 2269, 2269, 2271, 2568, 2292, 2269, 2293, 2269, 2182, 2190, 2269, 2186, 2226, 2226, 2226, 2226, 2227, 2160, 2160, 2160, 2160, 2263, 2160, 2275, 2277, 2282, 2215, 2217, 2269, 2269, 2291, 2269, 2269, 2293, 2291, 2269, 2220, 2269, 2295, 2294, 2269, 2269, 2305, 2233, 2262, 2278, 2218, 2269, 2234, 2226, 2226, 2228, 2160, 2160, 2160, 2289, 2220, 2294, 2294, 2269, 2269, 2304, 2269, 2160, 2160, 2287, 2269, 2269, 2305, 2269, 2269, 2312, 2269, 2269, 2225, 2226, 2160, 2287, 2289, 2219, 2304, 2295, 2314, 2234, 2226, 2314, 2269, 2226, 2226, 2160, 2288, 2219, 2222, 2304, 2296, 2269, 2224, 2160, 2160, 2269, 2302, 2294, 2314, 2224, 2226, 2288, 2220, 2294, 2269, 2290, 2269, 2269, 2293, 2269, 2269, 2269, 2269, 2270, 2221, 2313, 2225, 2227, 2160, 2300, 2269, 2225, 2261, 2309, 2234, 2229, 2223, 2318, 2318, 2318, 2328, 2336, 2340, 2344, 2350, 2637, 2712, 2358, 2362, 2372, 2135, 2378, 2398, 2135, 2135, 2135, 2135, 2136, 2417, 2241, 2135, 2378, 2135, 2135, 2980, 2984, 2135, 3006, 2135, 2135, 2135, 2945, 2931, 2425, 2400, 2135, 2135, 2135, 2954, 2135, 2481, 2433, 2135, 2135, 2988, 2824, 2135, 2135, 2482, 2434, 2135, 2135, 2440, 2445, 2452, 2135, 2135, 2998, 3002, 2961, 2441, 2446, 2453, 2463, 2974, 2135, 2135, 2135, 2140, 2642, 2709, 2459, 2470, 2465, 2135, 2135, 3005, 2135, 2135, 2987, 2823, 2458, 2469, 2464, 2975, 2135, 2135, 2135, 2353, 2488, 2447, 2324, 2974, 2135, 2409, 2459, 2448, 2135, 2961, 2487, 2446, 2476, 2323, 2973, 2135, 2135, 2135, 2354, 2476, 2974, 2135, 2135, 2135, 2957, 2135, 2135, 2960, 2135, 2135, 2135, 2363, 2409, 2459, 2474, 2465, 2487, 2571, 2973, 2135, 2135, 2168, 2973, 2135, 2135, 2135, 2959, 2135, 2135, 2135, 2506, 2135, 2957, 2488, 2170, 2135, 2135, 2135, 2960, 2135, 2818, 2493, 2135, 2135, 3033, 2135, 2135, 2135, 2934, 2819, 2494, 2135, 2135, 2135, 2976, 2780, 2499, 2135, 2135, 2135, 3000, 2968, 2135, 2935, 2135, 2135, 2135, 2364, 2507, 2135, 2135, 2934, 2135, 2135, 2780, 2492, 2507, 2135, 2135, 2506, 2780, 2135, 2135, 2782, 2780, 2135, 2782, 2135, 2783, 2374, 2514, 2135, 2135, 2135, 3007, 2530, 2974, 2135, 2135, 2135, 3008, 2135, 2135, 2134, 2135, 2526, 2531, 2975, 2135, 2135, 3042, 2581, 2575, 2956, 2135, 2135, 2135, 2394, 2135, 2508, 2535, 2840, 2844, 2495, 2135, 2135, 2136, 2684, 2537, 2842, 2846, 2135, 2136, 2561, 2581, 2551, 2536, 2841, 2845, 2975, 3043, 2582, 2843, 2555, 2135, 3040, 3044, 2538, 2844, 2975, 2135, 2135, 2253, 2644, 2672, 2542, 2554, 2135, 2135, 2346, 2873, 2551, 2555, 2135, 2135, 2135, 2381, 2559, 2565, 2538, 2553, 2135, 2560, 2914, 2576, 2590, 2135, 2135, 2135, 2408, 2136, 2596, 2624, 2135, 2135, 2135, 2409, 2135, 2618, 2597, 3008, 2135, 2135, 2380, 2956, 2601, 2135, 2135, 2135, 2410, 2620, 2624, 2135, 2136, 2383, 2135, 2135, 2783, 2623, 2135, 2135, 2393, 2888, 2136, 2621, 3008, 2135, 2618, 2618, 2622, 2135, 2135, 2405, 2414, 2619, 2384, 2624, 2135, 2136, 2950, 2135, 2138, 2135, 2139, 2135, 2604, 2623, 2135, 2140, 2878, 2665, 2957, 2622, 2135, 2135, 2428, 2762, 2606, 2612, 2135, 2135, 2501, 2586, 2604, 3038, 2135, 2604, 3036, 2387, 2958, 2386, 2135, 2141, 2135, 2421, 2387, 2385, 2135, 2385, 2384, 2384, 2135, 2386, 2628, 2384, 2135, 2135, 2501, 2596, 2591, 2135, 2135, 2135, 2400, 2135, 2634, 2135, 2135, 2559, 2580, 2575, 2648, 2135, 2135, 2135, 2429, 2649, 2135, 2135, 2135, 2435, 2654, 2658, 2135, 2135, 2135, 2436, 2649, 2178, 2659, 2135, 2135, 2595, 2601, 2669, 2677, 2135, 2135, 2616, 2957, 2879, 2665, 2691, 2135, 2363, 2367, 2900, 2878, 2664, 2690, 2975, 2877, 2643, 2670, 2974, 2671, 2975, 2135, 2135, 2619, 2608, 2669, 2673, 2135, 2135, 2653, 2177, 2672, 2135, 2135, 2135, 2486, 2168, 2251, 2255, 2695, 2974, 2709, 2135, 2135, 2135, 2487, 2169, 2399, 2716, 2975, 2135, 2363, 2770, 2776, 2640, 2717, 2135, 2135, 2729, 2135, 2135, 2641, 2718, 2135, 2135, 2135, 2505, 2135, 2640, 2257, 2974, 2135, 2727, 2975, 2135, 2365, 2332, 2895, 2957, 2135, 2959, 2135, 2365, 2749, 2754, 2959, 2958, 2958, 2135, 2380, 2793, 2799, 2135, 2735, 2738, 2135, 2381, 2135, 2135, 2940, 2974, 2135, 2744, 2135, 2135, 2739, 2519, 2976, 2745, 2135, 2135, 2135, 2509, 2755, 2135, 2135, 2135, 2510, 2772, 2778, 2135, 2135, 2740, 2520, 2135, 2771, 2777, 2135, 2135, 2759, 2750, 2792, 2798, 2135, 2135, 2781, 2392, 2779, 2135, 2135, 2135, 2521, 2135, 2679, 2248, 2135, 2135, 2681, 2480, 2135, 2135, 2786, 3000, 2135, 2679, 2683, 2135, 2135, 2416, 2135, 2135, 2135, 2525, 2135, 2730, 2135, 2135, 2135, 2560, 2581, 2135, 2805, 2135, 2135, 2804, 2962, 2832, 2974, 2135, 2382, 2135, 2135, 2958, 2135, 2135, 2960, 2135, 2829, 2833, 2975, 2961, 2965, 2969, 2973, 2968, 2972, 2135, 2135, 2135, 2641, 2135, 2515, 2966, 2970, 2851, 2478, 2135, 2135, 2808, 2135, 2809, 2135, 2135, 2135, 2722, 2852, 2479, 2135, 2135, 2815, 2135, 2135, 2766, 2853, 2480, 2135, 2857, 2479, 2135, 2388, 2723, 2135, 2364, 2331, 2894, 2858, 2480, 2135, 2135, 2850, 2478, 2135, 2135, 2135, 2806, 2864, 2135, 2399, 2256, 2974, 2865, 2135, 2135, 2862, 2135, 2135, 2135, 2685, 2807, 2865, 2135, 2135, 2807, 2863, 2135, 2135, 2135, 2686, 2884, 2807, 2135, 2809, 2807, 2135, 2135, 2807, 2806, 2705, 2810, 2808, 2700, 2869, 2702, 2702, 2702, 2704, 2883, 2135, 2135, 2135, 2730, 2884, 2135, 2135, 2135, 2731, 2321, 2546, 2135, 2135, 2876, 2255, 2889, 2322, 2547, 2135, 2401, 2135, 2135, 2135, 2949, 2367, 2893, 2544, 2973, 2906, 2973, 2135, 2135, 2877, 2663, 2368, 2901, 2907, 2974, 2366, 2899, 2905, 2972, 2920, 2974, 2135, 2135, 2911, 2900, 2920, 2363, 2913, 2918, 2465, 2941, 2975, 2135, 2135, 2924, 2928, 2974, 2945, 2931, 2135, 2135, 2135, 2765, 2136, 2955, 2135, 2135, 2939, 2931, 2380, 2135, 2135, 2380, 2135, 2135, 2135, 2780, 2507, 2137, 2135, 2137, 2135, 2139, 2135, 2806, 2810, 2135, 2135, 2135, 2992, 2135, 2135, 2962, 2966, 2970, 2974, 2135, 2135, 2787, 3014, 2135, 2521, 2993, 2135, 2135, 2135, 2803, 2135, 2135, 2135, 2618, 2607, 2997, 3001, 2135, 2135, 2963, 2967, 2971, 2975, 2135, 2135, 2791, 2797, 2135, 3009, 2999, 3003, 2787, 3001, 2135, 2135, 2964, 2968, 2785, 2999, 3003, 2135, 2135, 2135, 2804, 2785, 2999, 3004, 2135, 2135, 2135, 2807, 2135, 2135, 3023, 2135, 2135, 2135, 2811, 2135, 2135, 3027, 2135, 2135, 2135, 2837, 2968, 3028, 2135, 2135, 2135, 2875, 2135, 2784, 3029, 2135, 2408, 2457, 2446, 0, 14, 0, -2120220672, 1610612736, -2074083328, -2002780160, -2111830528, 1073872896, 1342177280, 1075807216, 4096, 16384, 2048, 8192, 0, 8192, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, -2145386496, 8388608, 1073741824, 0, 0x80000000, 0x80000000, 2097152, 2097152, 2097152, 536870912, 0, 0, 134217728, 33554432, 1536, 268435456, 268435456, 268435456, 268435456, 128, 256, 32, 0, 65536, 131072, 524288, 16777216, 268435456, 0x80000000, 1572864, 1835008, 640, 32768, 65536, 262144, 1048576, 2097152, 196608, 196800, 196608, 196608, 0, 131072, 131072, 131072, 196608, 196624, 196608, 196624, 196608, 196608, 128, 4096, 16384, 16384, 2048, 0, 4, 0, 0, 0x80000000, 2097152, 0, 1024, 32, 32, 0, 65536, 1572864, 1048576, 32768, 32768, 32768, 32768, 196608, 196608, 196608, 64, 64, 196608, 196608, 131072, 131072, 131072, 131072, 268435456, 268435456, 64, 196736, 196608, 196608, 196608, 131072, 196608, 196608, 16384, 4, 4, 4, 2, 32, 32, 65536, 1048576, 12582912, 1073741824, 0, 0, 2, 8, 16, 96, 2048, 32768, 0, 0, 131072, 268435456, 268435456, 268435456, 256, 256, 196608, 196672, 196608, 196608, 196608, 196608, 4, 0, 256, 256, 256, 256, 32, 32, 32768, 32, 32, 32, 32, 32768, 268435456, 268435456, 268435456, 196608, 196608, 196608, 196624, 196608, 196608, 196608, 16, 16, 16, 268435456, 196608, 64, 64, 64, 196608, 196608, 196608, 196672, 268435456, 64, 64, 196608, 196608, 16, 196608, 196608, 196608, 268435456, 64, 196608, 131072, 262144, 4194304, 25165824, 33554432, 134217728, 268435456, 268435456, 196608, 262152, 8, 256, 512, 3072, 16384, 200, -1073741816, 8392713, 40, 8392718, 520, 807404072, 40, 520, 100663304, 0, 0, -540651761, -540651761, 257589048, 0, 262144, 0, 0, 3, 8, 256, 0, 4, 6, 4100, 8388612, 0, 0, 0, 3, 4, 8, 256, 512, 1024, 0, 2097152, 0, 0, -537854471, -537854471, 0, 100663296, 0, 0, 1, 2, 0, 0, 0, 16384, 0, 0, 0, 96, 14336, 0, 0, 0, 7, 8, 234881024, 0, 0, 0, 8, 0, 0, 0, 0, 262144, 0, 0, 16, 64, 384, 512, 0, 1, 1, 0, 12582912, 0, 0, 0, 0, 33554432, 67108864, -606084144, -606084144, -606084138, 0, 0, 28, 32, 768, 1966080, -608174080, 0, 0, 0, 14, 35056, 16, 64, 896, 24576, 98304, 98304, 131072, 262144, 524288, 1048576, 4194304, 25165824, 1048576, 62914560, 134217728, -805306368, 0, 384, 512, 16384, 65536, 131072, 262144, 29360128, 33554432, 134217728, 268435456, 1073741824, 0x80000000, 262144, 524288, 1048576, 29360128, 33554432, 524288, 1048576, 16777216, 33554432, 134217728, 268435456, 1073741824, 0, 0, 0, 123856, 1966080, 0, 64, 384, 16384, 65536, 131072, 16384, 65536, 524288, 268435456, 0x80000000, 0, 0, 524288, 0x80000000, 0, 0, 1, 16, 0, 256, 524288, 0, 0, 0, 25, 96, 128, -537854471, 0, 0, 0, 32, 7404800, -545259520, 0, 0, 0, 60, 0, 249, 64768, 1048576, 6291456, 6291456, 25165824, 100663296, 402653184, 1073741824, 96, 128, 1280, 2048, 4096, 57344, 6291456, 57344, 6291456, 8388608, 16777216, 33554432, 201326592, 1342177280, 0x80000000, 0, 57344, 6291456, 8388608, 100663296, 134217728, 0x80000000, 0, 0, 0, 1, 8, 16, 64, 128, 64, 128, 256, 1024, 131072, 131072, 131072, 262144, 524288, 16777216, 57344, 6291456, 8388608, 67108864, 134217728, 64, 256, 1024, 2048, 4096, 57344, 64, 256, 0, 24576, 32768, 6291456, 67108864, 134217728, 0, 1, 64, 256, 24576, 32768, 4194304, 32768, 4194304, 67108864, 0, 0, 64, 256, 0, 0, 24576, 32768, 0, 16384, 4194304, 67108864, 64, 16384, 0, 0, 1, 64, 256, 16384, 4194304, 67108864, 0, 0, 0, 16384, 0, 16384, 16384, 0, -470447874, -470447874, -470447874, 0, 0, 128, 0, 0, 8, 96, 2048, 32768, 262144, 8388608, 35056, 1376256, -471859200, 0, 0, 14, 16, 224, 2048, 32768, 2097152, 4194304, 8388608, -486539264, 0, 96, 128, 2048, 32768, 262144, 2097152, 262144, 2097152, 8388608, 33554432, 536870912, 1073741824, 0x80000000, 0, 1610612736, 0x80000000, 0, 0, 1, 524288, 1048576, 12582912, 0, 0, 0, 151311, 264503296, 2097152, 8388608, 33554432, 1610612736, 0x80000000, 262144, 8388608, 33554432, 536870912, 67108864, 4194304, 0, 4194304, 0, 4194304, 4194304, 0, 0, 524288, 8388608, 536870912, 1073741824, 0x80000000, 1, 4097, 8388609, 96, 2048, 32768, 1073741824, 0x80000000, 0, 96, 2048, 0x80000000, 0, 0, 96, 2048, 0, 0, 1, 12582912, 0, 0, 0, 0, 1641895695, 1641895695, 0, 0, 0, 249, 7404800, 15, 87808, 1835008, 1639972864, 0, 768, 5120, 16384, 65536, 1835008, 1835008, 12582912, 16777216, 1610612736, 0, 3, 4, 8, 768, 4096, 65536, 0, 0, 256, 512, 786432, 8, 256, 512, 4096, 16384, 1835008, 16384, 1835008, 12582912, 1610612736, 0, 0, 0, 256, 0, 0, 0, 4, 8, 16, 32, 1, 2, 8, 256, 16384, 524288, 16384, 524288, 1048576, 12582912, 1610612736, 0, 0, 0, 8388608, 0, 0, 0, 524288, 4194304, 0, 0, 0, 8388608, -548662288, -548662288, -548662288, 0, 0, 256, 16384, 65536, 520093696, -1073741824, 0, 0, 0, 16777216, 0, 16, 32, 960, 4096, 4980736, 520093696, 1073741824, 0, 32, 896, 4096, 57344, 1048576, 6291456, 8388608, 16777216, 100663296, 134217728, 268435456, 0x80000000, 0, 512, 786432, 4194304, 33554432, 134217728, 268435456, 0, 786432, 4194304, 134217728, 268435456, 0, 524288, 4194304, 268435456, 0, 0, 0, 0, 0, 4194304, 4194304, -540651761, 0, 0, 0, 2, 4, 8, 16, 96, 128, 264503296, -805306368, 0, 0, 0, 8, 256, 512, 19456, 131072, 3072, 16384, 131072, 262144, 8388608, 16777216, 512, 1024, 2048, 16384, 131072, 262144, 131072, 262144, 8388608, 33554432, 201326592, 268435456, 0, 3, 4, 256, 1024, 2048, 57344, 16384, 131072, 8388608, 33554432, 134217728, 268435456, 0, 3, 256, 1024, 16384, 131072, 33554432, 134217728, 1073741824, 0x80000000, 0, 0, 256, 524288, 0x80000000, 0, 3, 256, 33554432, 134217728, 1073741824, 0, 1, 2, 33554432, 1, 2, 134217728, 1073741824, 0, 1, 2, 134217728, 0, 0, 0, 64, 0, 0, 0, 16, 32, 896, 4096, 786432, 4194304, 16777216, 33554432, 201326592, 268435456, 1073741824, 0x80000000, 0, 0, 0, 15, 0, 4980736, 4980736, 4980736, 70460, 70460, 3478332, 0, 0, 1008, 4984832, 520093696, 60, 4864, 65536, 0, 0, 0, 12, 16, 32, 256, 512, 4096, 65536, 0, 0, 0, 67108864, 0, 0, 0, 12, 0, 256, 512, 65536, 0, 0, 1024, 512, 131072, 131072, 4, 16, 32, 65536, 0, 4, 16, 32, 0, 0, 0, 4, 16, 0, 0, 16384, 67108864, 0, 0, 1, 24, 96, 128, 256, 1024 +]; + +JSONiqTokenizer.TOKEN = +[ + "(0)", + "JSONChar", + "JSONCharRef", + "JSONPredefinedCharRef", + "ModuleDecl", + "Annotation", + "OptionDecl", + "Operator", + "Variable", + "Tag", + "EndTag", + "PragmaContents", + "DirCommentContents", + "DirPIContents", + "CDataSectionContents", + "AttrTest", + "Wildcard", + "EQName", + "IntegerLiteral", + "DecimalLiteral", + "DoubleLiteral", + "PredefinedEntityRef", + "'\"\"'", + "EscapeApos", + "AposChar", + "ElementContentChar", + "QuotAttrContentChar", + "AposAttrContentChar", + "NCName", + "QName", + "S", + "CharRef", + "CommentContents", + "DocTag", + "DocCommentContents", + "EOF", + "'!'", + "'\"'", + "'#'", + "'#)'", + "'$$'", + "''''", + "'('", + "'(#'", + "'(:'", + "'(:~'", + "')'", + "'*'", + "'*'", + "','", + "'-->'", + "'.'", + "'/'", + "'/>'", + "':'", + "':)'", + "';'", + "''), token: xmlcomment, next: function(stack){ stack.pop(); } } + ], + CData: [ + { name: 'CDataSectionContents', token: cdata }, + { name: n(']]>'), token: cdata, next: function(stack){ stack.pop(); } } + ], + PI: [ + { name: 'DirPIContents', token: pi }, + { name: n('?'), token: pi }, + { name: n('?>'), token: pi, next: function(stack){ stack.pop(); } } + ], + AposString: [ + { name: n('\'\''), token: 'string', next: function(stack){ stack.pop(); } }, + { name: 'PredefinedEntityRef', token: 'constant.language.escape' }, + { name: 'CharRef', token: 'constant.language.escape' }, + { name: 'EscapeApos', token: 'constant.language.escape' }, + { name: 'AposChar', token: 'string' } + ], + QuotString: [ + { name: n('"'), token: 'string', next: function(stack){ stack.pop(); } }, + { name: 'JSONPredefinedCharRef', token: 'constant.language.escape' }, + { name: 'JSONCharRef', token: 'constant.language.escape' }, + { name: 'JSONChar', token: 'string' } + ] +}; + +exports.JSONiqLexer = function(){ return new Lexer(JSONiqTokenizer, Rules); }; +},{"./JSONiqTokenizer":"/node_modules/xqlint/lib/lexers/JSONiqTokenizer.js","./lexer":"/node_modules/xqlint/lib/lexers/lexer.js"}],"/node_modules/xqlint/lib/lexers/lexer.js":[function(_dereq_,module,exports){ +'use strict'; + +var TokenHandler = function(code) { + var input = code; + this.tokens = []; + + this.reset = function() { + input = input; + this.tokens = []; + }; + + this.startNonterminal = function() {}; + this.endNonterminal = function() {}; + + this.terminal = function(name, begin, end) { + this.tokens.push({ + name: name, + value: input.substring(begin, end) + }); + }; + + this.whitespace = function(begin, end) { + this.tokens.push({ + name: 'WS', + value: input.substring(begin, end) + }); + }; +}; + +exports.Lexer = function(Tokenizer, Rules) { + + this.tokens = []; + + this.getLineTokens = function(line, state) { + state = (state === 'start' || !state) ? '["start"]' : state; + var stack = JSON.parse(state); + var h = new TokenHandler(line); + var tokenizer = new Tokenizer(line, h); + var tokens = []; + + while(true) { + var currentState = stack[stack.length - 1]; + try { + h.tokens = []; + tokenizer['parse_' + currentState](); + var info = null; + + if(h.tokens.length > 1 && h.tokens[0].name === 'WS') { + tokens.push({ + type: 'text', + value: h.tokens[0].value + }); + h.tokens.splice(0, 1); + } + + var token = h.tokens[0]; + var rules = Rules[currentState]; + for(var k = 0; k < rules.length; k++) { + var rule = Rules[currentState][k]; + if((typeof(rule.name) === 'function' && rule.name(token)) || rule.name === token.name) { + info = rule; + break; + } + } + + if(token.name === 'EOF') { break; } + if(token.value === '') { throw 'Encountered empty string lexical rule.'; } + + tokens.push({ + type: info === null ? 'text' : (typeof(info.token) === 'function' ? info.token(token.value) : info.token), + value: token.value + }); + + if(info && info.next) { + info.next(stack); + } + + } catch(e) { + if(e instanceof tokenizer.ParseException) { + var index = 0; + for(var i=0; i < tokens.length; i++) { + index += tokens[i].value.length; + } + tokens.push({ type: 'text', value: line.substring(index) }); + return { + tokens: tokens, + state: JSON.stringify(['start']) + }; + } else { + throw e; + } + } + } + + return { + tokens: tokens, + state: JSON.stringify(stack) + }; + }; +}; +},{}]},{},["/node_modules/xqlint/lib/lexers/jsoniq_lexer.js"]); + +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === "') { + var position = editor.getCursorPosition(); + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken(); + var atCursor = false; + var state = JSON.parse(state).pop(); + if ((token && token.value === '>') || state !== "StartTag") return; + if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ + do { + token = iterator.stepBackward(); + } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); + } else { + atCursor = true; + } + var previous = iterator.stepBackward(); + if (!token || !hasType(token, 'meta.tag') || (previous !== null && previous.value.match('/'))) { + return + } + var tag = token.value.substring(1); + if (atCursor){ + var tag = tag.substring(0, position.column - token.start); + } + + return { + text: '>' + '', + selection: [1, 1] + } + } + }); + + } + oop.inherits(XQueryBehaviour, Behaviour); + + exports.XQueryBehaviour = XQueryBehaviour; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/jsoniq",["require","exports","module","ace/worker/worker_client","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/xquery/jsoniq_lexer","ace/range","ace/mode/behaviour/xquery","ace/mode/folding/cstyle","ace/anchor"], function(require, exports, module) { +"use strict"; + +var WorkerClient = require("../worker/worker_client").WorkerClient; +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var JSONiqLexer = require("./xquery/jsoniq_lexer").JSONiqLexer; +var Range = require("../range").Range; +var XQueryBehaviour = require("./behaviour/xquery").XQueryBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var Anchor = require("../anchor").Anchor; + +var Mode = function() { + this.$tokenizer = new JSONiqLexer(); + this.$behaviour = new XQueryBehaviour(); + this.foldingRules = new CStyleFoldMode(); + this.$highlightRules = new TextHighlightRules(); +}; + +oop.inherits(Mode, TextMode); + +(function() { + + this.completer = { + getCompletions: function(editor, session, pos, prefix, callback) { + if (!session.$worker) + return callback(); + session.$worker.emit("complete", { data: { pos: pos, prefix: prefix } }); + session.$worker.on("complete", function(e){ + callback(null, e.data); + }); + } + }; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var match = line.match(/\s*(?:then|else|return|[{\(]|<\w+>)\s*$/); + if (match) + indent += tab; + return indent; + }; + + this.checkOutdent = function(state, line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*[\}\)]/.test(input); + }; + + this.autoOutdent = function(state, doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*[\}\)])/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.toggleCommentLines = function(state, doc, startRow, endRow) { + var i, line; + var outdent = true; + var re = /^\s*\(:(.*):\)/; + + for (i=startRow; i<= endRow; i++) { + if (!re.test(doc.getLine(i))) { + outdent = false; + break; + } + } + + var range = new Range(0, 0, 0, 0); + for (i=startRow; i<= endRow; i++) { + line = doc.getLine(i); + range.start.row = i; + range.end.row = i; + range.end.column = line.length; + + doc.replace(range, outdent ? line.match(re)[1] : "(:" + line + ":)"); + } + }; + this.createWorker = function(session) { + + var worker = new WorkerClient(["ace"], "ace/mode/xquery_worker", "XQueryWorker"); + var that = this; + + worker.attachToDocument(session.getDocument()); + + worker.on("ok", function(e) { + session.clearAnnotations(); + }); + + worker.on("markers", function(e) { + session.clearAnnotations(); + that.addMarkers(e.data, session); + }); + + return worker; + }; + + this.removeMarkers = function(session) { + var markers = session.getMarkers(false); + for (var id in markers) { + if (markers[id].clazz.indexOf('language_highlight_') === 0) { + session.removeMarker(id); + } + } + for (var i = 0; i < session.markerAnchors.length; i++) { + session.markerAnchors[i].detach(); + } + session.markerAnchors = []; + }; + + this.addMarkers = function(annos, mySession) { + var _self = this; + + if (!mySession.markerAnchors) mySession.markerAnchors = []; + this.removeMarkers(mySession); + mySession.languageAnnos = []; + annos.forEach(function(anno) { + var anchor = new Anchor(mySession.getDocument(), anno.pos.sl, anno.pos.sc || 0); + mySession.markerAnchors.push(anchor); + var markerId; + var colDiff = anno.pos.ec - anno.pos.sc; + var rowDiff = anno.pos.el - anno.pos.sl; + var gutterAnno = { + guttertext: anno.message, + type: anno.level || "warning", + text: anno.message + }; + + function updateFloat(single) { + if (markerId) + mySession.removeMarker(markerId); + gutterAnno.row = anchor.row; + if (anno.pos.sc !== undefined && anno.pos.ec !== undefined) { + var range = new Range(anno.pos.sl, anno.pos.sc, anno.pos.el, anno.pos.ec); + markerId = mySession.addMarker(range, "language_highlight_" + (anno.type ? anno.type : "default")); + } + if (single) mySession.setAnnotations(mySession.languageAnnos); + } + updateFloat(); + anchor.on("change", function() { + updateFloat(true); + }); + if (anno.message) mySession.languageAnnos.push(gutterAnno); + }); + mySession.setAnnotations(mySession.languageAnnos); + }; + + this.$id = "ace/mode/jsoniq"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-jsp.js b/htdocs/includes/ace/mode-jsp.js new file mode 100644 index 00000000000..ad13aed5f79 --- /dev/null +++ b/htdocs/includes/ace/mode-jsp.js @@ -0,0 +1,1388 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JavaHighlightRules = function() { + var keywords = ( + "abstract|continue|for|new|switch|" + + "assert|default|goto|package|synchronized|" + + "boolean|do|if|private|this|" + + "break|double|implements|protected|throw|" + + "byte|else|import|public|throws|" + + "case|enum|instanceof|return|transient|" + + "catch|extends|int|short|try|" + + "char|final|interface|static|void|" + + "class|finally|long|strictfp|volatile|" + + "const|float|native|super|while" + ); + + var buildinConstants = ("null|Infinity|NaN|undefined"); + + + var langClasses = ( + "AbstractMethodError|AssertionError|ClassCircularityError|"+ + "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ + "ExceptionInInitializerError|IllegalAccessError|"+ + "IllegalThreadStateException|InstantiationError|InternalError|"+ + "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ + "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ + "SuppressWarnings|TypeNotPresentException|UnknownError|"+ + "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ + "InstantiationException|IndexOutOfBoundsException|"+ + "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ + "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ + "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ + "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ + "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ + "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ + "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ + "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ + "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ + "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ + "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ + "ArrayStoreException|ClassCastException|LinkageError|"+ + "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ + "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ + "Cloneable|Class|CharSequence|Comparable|String|Object" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "constant.language": buildinConstants, + "support.function": langClasses + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/ + }, { + token : "constant.numeric", // float + regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/ + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(JavaHighlightRules, TextHighlightRules); + +exports.JavaHighlightRules = JavaHighlightRules; +}); + +ace.define("ace/mode/jsp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/java_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules; + +var JspHighlightRules = function() { + HtmlHighlightRules.call(this); + + var builtinVariables = 'request|response|out|session|' + + 'application|config|pageContext|page|Exception'; + + var keywords = 'page|include|taglib'; + + var startRules = [ + { + token : "comment", + regex : "<%--", + push : "jsp-dcomment" + }, { + token : "meta.tag", // jsp open tag + regex : "<%@?|<%=?|<%!?|]+>", + push : "jsp-start" + } + ]; + + var endRules = [ + { + token : "meta.tag", // jsp close tag + regex : "%>|<\\/jsp:[^>]+>", + next : "pop" + }, { + token: "variable.language", + regex : builtinVariables + }, { + token: "keyword", + regex : keywords + } + ]; + + for (var key in this.$rules) + this.$rules[key].unshift.apply(this.$rules[key], startRules); + + this.embedRules(JavaHighlightRules, "jsp-", endRules, ["start"]); + + this.addRules({ + "jsp-dcomment" : [{ + token : "comment", + regex : ".*?--%>", + next : "pop" + }] + }); + + this.normalizeRules(); +}; + +oop.inherits(JspHighlightRules, HtmlHighlightRules); + +exports.JspHighlightRules = JspHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/jsp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jsp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JspHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.$id = "ace/mode/jsp"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-jsx.js b/htdocs/includes/ace/mode-jsx.js new file mode 100644 index 00000000000..3f3d3e4bfa0 --- /dev/null +++ b/htdocs/includes/ace/mode-jsx.js @@ -0,0 +1,404 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/jsx_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JsxHighlightRules = function() { + var keywords = lang.arrayToMap( + ("break|do|instanceof|typeof|case|else|new|var|catch|finally|return|void|continue|for|switch|default|while|function|this|" + + "if|throw|" + + "delete|in|try|" + + "class|extends|super|import|from|into|implements|interface|static|mixin|override|abstract|final|" + + "number|int|string|boolean|variant|" + + "log|assert").split("|") + ); + + var buildinConstants = lang.arrayToMap( + ("null|true|false|NaN|Infinity|__FILE__|__LINE__|undefined").split("|") + ); + + var reserved = lang.arrayToMap( + ("debugger|with|" + + "const|export|" + + "let|private|public|yield|protected|" + + "extern|native|as|operator|__fake__|__readonly__").split("|") + ); + + var identifierRe = "[a-zA-Z_][a-zA-Z0-9_]*\\b"; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : [ + "storage.type", + "text", + "entity.name.function" + ], + regex : "(function)(\\s+)(" + identifierRe + ")" + }, { + token : function(value) { + if (value == "this") + return "variable.language"; + else if (value == "function") + return "storage.type"; + else if (keywords.hasOwnProperty(value) || reserved.hasOwnProperty(value)) + return "keyword"; + else if (buildinConstants.hasOwnProperty(value)) + return "constant.language"; + else if (/^_?[A-Z][a-zA-Z0-9_]*$/.test(value)) + return "language.support.class"; + else + return "identifier"; + }, + regex : identifierRe + }, { + token : "keyword.operator", + regex : "!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({<]" + }, { + token : "paren.rparen", + regex : "[\\])}>]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(JsxHighlightRules, TextHighlightRules); + +exports.JsxHighlightRules = JsxHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/jsx",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jsx_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JsxHighlightRules = require("./jsx_highlight_rules").JsxHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +function Mode() { + this.HighlightRules = JsxHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +} +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/jsx"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-julia.js b/htdocs/includes/ace/mode-julia.js new file mode 100644 index 00000000000..ee1e88abe78 --- /dev/null +++ b/htdocs/includes/ace/mode-julia.js @@ -0,0 +1,296 @@ +ace.define("ace/mode/julia_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JuliaHighlightRules = function() { + + this.$rules = { start: + [ { include: '#function_decl' }, + { include: '#function_call' }, + { include: '#type_decl' }, + { include: '#keyword' }, + { include: '#operator' }, + { include: '#number' }, + { include: '#string' }, + { include: '#comment' } ], + '#bracket': + [ { token: 'keyword.bracket.julia', + regex: '\\(|\\)|\\[|\\]|\\{|\\}|,' } ], + '#comment': + [ { token: + [ 'punctuation.definition.comment.julia', + 'comment.line.number-sign.julia' ], + regex: '(#)(?!\\{)(.*$)'} ], + '#function_call': + [ { token: [ 'support.function.julia', 'text' ], + regex: '([a-zA-Z0-9_]+!?)([\\w\\xff-\\u218e\\u2455-\\uffff]*\\()'} ], + '#function_decl': + [ { token: [ 'keyword.other.julia', 'meta.function.julia', + 'entity.name.function.julia', 'meta.function.julia','text' ], + regex: '(function|macro)(\\s*)([a-zA-Z0-9_\\{]+!?)([\\w\\xff-\\u218e\\u2455-\\uffff]*)([(\\\\{])'} ], + '#keyword': + [ { token: 'keyword.other.julia', + regex: '\\b(?:function|type|immutable|macro|quote|abstract|bitstype|typealias|module|baremodule|new)\\b' }, + { token: 'keyword.control.julia', + regex: '\\b(?:if|else|elseif|while|for|in|begin|let|end|do|try|catch|finally|return|break|continue)\\b' }, + { token: 'storage.modifier.variable.julia', + regex: '\\b(?:global|local|const|export|import|importall|using)\\b' }, + { token: 'variable.macro.julia', regex: '@[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b' } ], + '#number': + [ { token: 'constant.numeric.julia', + regex: '\\b0(?:x|X)[0-9a-fA-F]*|(?:\\b[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]*)?(?:im)?|\\bInf(?:32)?\\b|\\bNaN(?:32)?\\b|\\btrue\\b|\\bfalse\\b' } ], + '#operator': + [ { token: 'keyword.operator.update.julia', + regex: '=|:=|\\+=|-=|\\*=|/=|//=|\\.//=|\\.\\*=|\\\\=|\\.\\\\=|^=|\\.^=|%=|\\|=|&=|\\$=|<<=|>>=' }, + { token: 'keyword.operator.ternary.julia', regex: '\\?|:' }, + { token: 'keyword.operator.boolean.julia', + regex: '\\|\\||&&|!' }, + { token: 'keyword.operator.arrow.julia', regex: '->|<-|-->' }, + { token: 'keyword.operator.relation.julia', + regex: '>|<|>=|<=|==|!=|\\.>|\\.<|\\.>=|\\.>=|\\.==|\\.!=|\\.=|\\.!|<:|:>' }, + { token: 'keyword.operator.range.julia', regex: ':' }, + { token: 'keyword.operator.shift.julia', regex: '<<|>>' }, + { token: 'keyword.operator.bitwise.julia', regex: '\\||\\&|~' }, + { token: 'keyword.operator.arithmetic.julia', + regex: '\\+|-|\\*|\\.\\*|/|\\./|//|\\.//|%|\\.%|\\\\|\\.\\\\|\\^|\\.\\^' }, + { token: 'keyword.operator.isa.julia', regex: '::' }, + { token: 'keyword.operator.dots.julia', + regex: '\\.(?=[a-zA-Z])|\\.\\.+' }, + { token: 'keyword.operator.interpolation.julia', + regex: '\\$#?(?=.)' }, + { token: [ 'variable', 'keyword.operator.transposed-variable.julia' ], + regex: '([\\w\\xff-\\u218e\\u2455-\\uffff]+)((?:\'|\\.\')*\\.?\')' }, + { token: 'text', + regex: '\\[|\\('}, + { token: [ 'text', 'keyword.operator.transposed-matrix.julia' ], + regex: "([\\]\\)])((?:'|\\.')*\\.?')"} ], + '#string': + [ { token: 'punctuation.definition.string.begin.julia', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.julia', + regex: '\'', + next: 'pop' }, + { include: '#string_escaped_char' }, + { defaultToken: 'string.quoted.single.julia' } ] }, + { token: 'punctuation.definition.string.begin.julia', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.julia', + regex: '"', + next: 'pop' }, + { include: '#string_escaped_char' }, + { defaultToken: 'string.quoted.double.julia' } ] }, + { token: 'punctuation.definition.string.begin.julia', + regex: '\\b[\\w\\xff-\\u218e\\u2455-\\uffff]+"', + push: + [ { token: 'punctuation.definition.string.end.julia', + regex: '"[\\w\\xff-\\u218e\\u2455-\\uffff]*', + next: 'pop' }, + { include: '#string_custom_escaped_char' }, + { defaultToken: 'string.quoted.custom-double.julia' } ] }, + { token: 'punctuation.definition.string.begin.julia', + regex: '`', + push: + [ { token: 'punctuation.definition.string.end.julia', + regex: '`', + next: 'pop' }, + { include: '#string_escaped_char' }, + { defaultToken: 'string.quoted.backtick.julia' } ] } ], + '#string_custom_escaped_char': [ { token: 'constant.character.escape.julia', regex: '\\\\"' } ], + '#string_escaped_char': + [ { token: 'constant.character.escape.julia', + regex: '\\\\(?:\\\\|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}|.)' } ], + '#type_decl': + [ { token: + [ 'keyword.control.type.julia', + 'meta.type.julia', + 'entity.name.type.julia', + 'entity.other.inherited-class.julia', + 'punctuation.separator.inheritance.julia', + 'entity.other.inherited-class.julia' ], + regex: '(type|immutable)(\\s+)([a-zA-Z0-9_]+)(?:(\\s*)(<:)(\\s*[.a-zA-Z0-9_:]+))?' }, + { token: [ 'other.typed-variable.julia', 'support.type.julia' ], + regex: '([a-zA-Z0-9_]+)(::[a-zA-Z0-9_{}]+)' } ] } + + this.normalizeRules(); +}; + +JuliaHighlightRules.metaData = { fileTypes: [ 'jl' ], + firstLineMatch: '^#!.*\\bjulia\\s*$', + foldingStartMarker: '^\\s*(?:if|while|for|begin|function|macro|module|baremodule|type|immutable|let)\\b(?!.*\\bend\\b).*$', + foldingStopMarker: '^\\s*(?:end)\\b.*$', + name: 'Julia', + scopeName: 'source.julia' } + + +oop.inherits(JuliaHighlightRules, TextHighlightRules); + +exports.JuliaHighlightRules = JuliaHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/julia",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/julia_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JuliaHighlightRules = require("./julia_highlight_rules").JuliaHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JuliaHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "#"; + this.blockComment = ""; + this.$id = "ace/mode/julia"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-kotlin.js b/htdocs/includes/ace/mode-kotlin.js new file mode 100644 index 00000000000..2621bae8681 --- /dev/null +++ b/htdocs/includes/ace/mode-kotlin.js @@ -0,0 +1,786 @@ +ace.define("ace/mode/kotlin_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var KotlinHighlightRules = function() { + + this.$rules = { + start: [{ + include: "#comments" + }, { + token: [ + "text", + "keyword.other.kotlin", + "text", + "entity.name.package.kotlin", + "text" + ], + regex: /^(\s*)(package)\b(?:(\s*)([^ ;$]+)(\s*))?/ + }, { + include: "#imports" + }, { + include: "#statements" + }], + "#classes": [{ + token: "text", + regex: /(?=\s*(?:companion|class|object|interface))/, + push: [{ + token: "text", + regex: /}|(?=$)/, + next: "pop" + }, { + token: ["keyword.other.kotlin", "text"], + regex: /\b((?:companion\s*)?)(class|object|interface)\b/, + push: [{ + token: "text", + regex: /(?=<|{|\(|:)/, + next: "pop" + }, { + token: "keyword.other.kotlin", + regex: /\bobject\b/ + }, { + token: "entity.name.type.class.kotlin", + regex: /\w+/ + }] + }, { + token: "text", + regex: //, + next: "pop" + }, { + include: "#generics" + }] + }, { + token: "text", + regex: /\(/, + push: [{ + token: "text", + regex: /\)/, + next: "pop" + }, { + include: "#parameters" + }] + }, { + token: "keyword.operator.declaration.kotlin", + regex: /:/, + push: [{ + token: "text", + regex: /(?={|$)/, + next: "pop" + }, { + token: "entity.other.inherited-class.kotlin", + regex: /\w+/ + }, { + token: "text", + regex: /\(/, + push: [{ + token: "text", + regex: /\)/, + next: "pop" + }, { + include: "#expressions" + }] + }] + }, { + token: "text", + regex: /\{/, + push: [{ + token: "text", + regex: /\}/, + next: "pop" + }, { + include: "#statements" + }] + }] + }], + "#comments": [{ + token: "punctuation.definition.comment.kotlin", + regex: /\/\*/, + push: [{ + token: "punctuation.definition.comment.kotlin", + regex: /\*\//, + next: "pop" + }, { + defaultToken: "comment.block.kotlin" + }] + }, { + token: [ + "text", + "punctuation.definition.comment.kotlin", + "comment.line.double-slash.kotlin" + ], + regex: /(\s*)(\/\/)(.*$)/ + }], + "#constants": [{ + token: "constant.language.kotlin", + regex: /\b(?:true|false|null|this|super)\b/ + }, { + token: "constant.numeric.kotlin", + regex: /\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\.?[0-9]*|\.[0-9]+)(?:(?:e|E)(?:\+|-)?[0-9]+)?)(?:[LlFfUuDd]|UL|ul)?\b/ + }, { + token: "constant.other.kotlin", + regex: /\b[A-Z][A-Z0-9_]+\b/ + }], + "#expressions": [{ + token: "text", + regex: /\(/, + push: [{ + token: "text", + regex: /\)/, + next: "pop" + }, { + include: "#expressions" + }] + }, { + include: "#types" + }, { + include: "#strings" + }, { + include: "#constants" + }, { + include: "#comments" + }, { + include: "#keywords" + }], + "#functions": [{ + token: "text", + regex: /(?=\s*fun)/, + push: [{ + token: "text", + regex: /}|(?=$)/, + next: "pop" + }, { + token: "keyword.other.kotlin", + regex: /\bfun\b/, + push: [{ + token: "text", + regex: /(?=\()/, + next: "pop" + }, { + token: "text", + regex: //, + next: "pop" + }, { + include: "#generics" + }] + }, { + token: ["text", "entity.name.function.kotlin"], + regex: /((?:[\.<\?>\w]+\.)?)(\w+)/ + }] + }, { + token: "text", + regex: /\(/, + push: [{ + token: "text", + regex: /\)/, + next: "pop" + }, { + include: "#parameters" + }] + }, { + token: "keyword.operator.declaration.kotlin", + regex: /:/, + push: [{ + token: "text", + regex: /(?={|=|$)/, + next: "pop" + }, { + include: "#types" + }] + }, { + token: "text", + regex: /\{/, + push: [{ + token: "text", + regex: /(?=\})/, + next: "pop" + }, { + include: "#statements" + }] + }, { + token: "keyword.operator.assignment.kotlin", + regex: /=/, + push: [{ + token: "text", + regex: /(?=$)/, + next: "pop" + }, { + include: "#expressions" + }] + }] + }], + "#generics": [{ + token: "keyword.operator.declaration.kotlin", + regex: /:/, + push: [{ + token: "text", + regex: /(?=,|>)/, + next: "pop" + }, { + include: "#types" + }] + }, { + include: "#keywords" + }, { + token: "storage.type.generic.kotlin", + regex: /\w+/ + }], + "#getters-and-setters": [{ + token: ["entity.name.function.kotlin", "text"], + regex: /\b(get)\b(\s*\(\s*\))/, + push: [{ + token: "text", + regex: /\}|(?=\bset\b)|$/, + next: "pop" + }, { + token: "keyword.operator.assignment.kotlin", + regex: /=/, + push: [{ + token: "text", + regex: /(?=$|\bset\b)/, + next: "pop" + }, { + include: "#expressions" + }] + }, { + token: "text", + regex: /\{/, + push: [{ + token: "text", + regex: /\}/, + next: "pop" + }, { + include: "#expressions" + }] + }] + }, { + token: ["entity.name.function.kotlin", "text"], + regex: /\b(set)\b(\s*)(?=\()/, + push: [{ + token: "text", + regex: /\}|(?=\bget\b)|$/, + next: "pop" + }, { + token: "text", + regex: /\(/, + push: [{ + token: "text", + regex: /\)/, + next: "pop" + }, { + include: "#parameters" + }] + }, { + token: "keyword.operator.assignment.kotlin", + regex: /=/, + push: [{ + token: "text", + regex: /(?=$|\bset\b)/, + next: "pop" + }, { + include: "#expressions" + }] + }, { + token: "text", + regex: /\{/, + push: [{ + token: "text", + regex: /\}/, + next: "pop" + }, { + include: "#expressions" + }] + }] + }], + "#imports": [{ + token: [ + "text", + "keyword.other.kotlin", + "text", + "keyword.other.kotlin" + ], + regex: /^(\s*)(import)(\s+[^ $]+\s+)((?:as)?)/ + }], + "#keywords": [{ + token: "storage.modifier.kotlin", + regex: /\b(?:var|val|public|private|protected|abstract|final|enum|open|attribute|annotation|override|inline|var|val|vararg|lazy|in|out|internal|data|tailrec|operator|infix|const|yield|typealias|typeof)\b/ + }, { + token: "keyword.control.catch-exception.kotlin", + regex: /\b(?:try|catch|finally|throw)\b/ + }, { + token: "keyword.control.kotlin", + regex: /\b(?:if|else|while|for|do|return|when|where|break|continue)\b/ + }, { + token: "keyword.operator.kotlin", + regex: /\b(?:in|is|as|assert)\b/ + }, { + token: "keyword.operator.comparison.kotlin", + regex: /==|!=|===|!==|<=|>=|<|>/ + }, { + token: "keyword.operator.assignment.kotlin", + regex: /=/ + }, { + token: "keyword.operator.declaration.kotlin", + regex: /:/ + }, { + token: "keyword.operator.dot.kotlin", + regex: /\./ + }, { + token: "keyword.operator.increment-decrement.kotlin", + regex: /\-\-|\+\+/ + }, { + token: "keyword.operator.arithmetic.kotlin", + regex: /\-|\+|\*|\/|%/ + }, { + token: "keyword.operator.arithmetic.assign.kotlin", + regex: /\+=|\-=|\*=|\/=/ + }, { + token: "keyword.operator.logical.kotlin", + regex: /!|&&|\|\|/ + }, { + token: "keyword.operator.range.kotlin", + regex: /\.\./ + }, { + token: "punctuation.terminator.kotlin", + regex: /;/ + }], + "#namespaces": [{ + token: "keyword.other.kotlin", + regex: /\bnamespace\b/ + }, { + token: "text", + regex: /\{/, + push: [{ + token: "text", + regex: /\}/, + next: "pop" + }, { + include: "#statements" + }] + }], + "#parameters": [{ + token: "keyword.operator.declaration.kotlin", + regex: /:/, + push: [{ + token: "text", + regex: /(?=,|\)|=)/, + next: "pop" + }, { + include: "#types" + }] + }, { + token: "keyword.operator.declaration.kotlin", + regex: /=/, + push: [{ + token: "text", + regex: /(?=,|\))/, + next: "pop" + }, { + include: "#expressions" + }] + }, { + include: "#keywords" + }, { + token: "variable.parameter.function.kotlin", + regex: /\w+/ + }], + "#statements": [{ + include: "#namespaces" + }, { + include: "#typedefs" + }, { + include: "#classes" + }, { + include: "#functions" + }, { + include: "#variables" + }, { + include: "#getters-and-setters" + }, { + include: "#expressions" + }], + "#strings": [{ + token: "punctuation.definition.string.begin.kotlin", + regex: /"""/, + push: [{ + token: "punctuation.definition.string.end.kotlin", + regex: /"""/, + next: "pop" + }, { + token: "variable.parameter.template.kotlin", + regex: /\$\w+|\$\{[^\}]+\}/ + }, { + token: "constant.character.escape.kotlin", + regex: /\\./ + }, { + defaultToken: "string.quoted.third.kotlin" + }] + }, { + token: "punctuation.definition.string.begin.kotlin", + regex: /"/, + push: [{ + token: "punctuation.definition.string.end.kotlin", + regex: /"/, + next: "pop" + }, { + token: "variable.parameter.template.kotlin", + regex: /\$\w+|\$\{[^\}]+\}/ + }, { + token: "constant.character.escape.kotlin", + regex: /\\./ + }, { + defaultToken: "string.quoted.double.kotlin" + }] + }, { + token: "punctuation.definition.string.begin.kotlin", + regex: /'/, + push: [{ + token: "punctuation.definition.string.end.kotlin", + regex: /'/, + next: "pop" + }, { + token: "constant.character.escape.kotlin", + regex: /\\./ + }, { + defaultToken: "string.quoted.single.kotlin" + }] + }, { + token: "punctuation.definition.string.begin.kotlin", + regex: /`/, + push: [{ + token: "punctuation.definition.string.end.kotlin", + regex: /`/, + next: "pop" + }, { + defaultToken: "string.quoted.single.kotlin" + }] + }], + "#typedefs": [{ + token: "text", + regex: /(?=\s*type)/, + push: [{ + token: "text", + regex: /(?=$)/, + next: "pop" + }, { + token: "keyword.other.kotlin", + regex: /\btype\b/ + }, { + token: "text", + regex: //, + next: "pop" + }, { + include: "#generics" + }] + }, { + include: "#expressions" + }] + }], + "#types": [{ + token: "storage.type.buildin.kotlin", + regex: /\b(?:Any|Unit|String|Int|Boolean|Char|Long|Double|Float|Short|Byte|dynamic)\b/ + }, { + token: "storage.type.buildin.array.kotlin", + regex: /\b(?:IntArray|BooleanArray|CharArray|LongArray|DoubleArray|FloatArray|ShortArray|ByteArray)\b/ + }, { + token: [ + "storage.type.buildin.collection.kotlin", + "text" + ], + regex: /\b(Array|List|Map)(<\b)/, + push: [{ + token: "text", + regex: />/, + next: "pop" + }, { + include: "#types" + }, { + include: "#keywords" + }] + }, { + token: "text", + regex: /\w+/, + next: "pop" + }, { + include: "#types" + }, { + include: "#keywords" + }] + }, { + token: ["keyword.operator.tuple.kotlin", "text"], + regex: /(#)(\()/, + push: [{ + token: "text", + regex: /\)/, + next: "pop" + }, { + include: "#expressions" + }] + }, { + token: "text", + regex: /\{/, + push: [{ + token: "text", + regex: /\}/, + next: "pop" + }, { + include: "#statements" + }] + }, { + token: "text", + regex: /\(/, + push: [{ + token: "text", + regex: /\)/, + next: "pop" + }, { + include: "#types" + }] + }, { + token: "keyword.operator.declaration.kotlin", + regex: /->/ + }], + "#variables": [{ + token: "text", + regex: /(?=\s*(?:var|val))/, + push: [{ + token: "text", + regex: /(?=:|=|$)/, + next: "pop" + }, { + token: "keyword.other.kotlin", + regex: /\b(?:var|val)\b/, + push: [{ + token: "text", + regex: /(?=:|=|$)/, + next: "pop" + }, { + token: "text", + regex: //, + next: "pop" + }, { + include: "#generics" + }] + }, { + token: ["text", "entity.name.variable.kotlin"], + regex: /((?:[\.<\?>\w]+\.)?)(\w+)/ + }] + }, { + token: "keyword.operator.declaration.kotlin", + regex: /:/, + push: [{ + token: "text", + regex: /(?==|$)/, + next: "pop" + }, { + include: "#types" + }, { + include: "#getters-and-setters" + }] + }, { + token: "keyword.operator.assignment.kotlin", + regex: /=/, + push: [{ + token: "text", + regex: /(?=$)/, + next: "pop" + }, { + include: "#expressions" + }, { + include: "#getters-and-setters" + }] + }] + }] + } + + this.normalizeRules(); +}; + +KotlinHighlightRules.metaData = { + fileTypes: ["kt", "kts"], + name: "Kotlin", + scopeName: "source.Kotlin" +} + + +oop.inherits(KotlinHighlightRules, TextHighlightRules); + +exports.KotlinHighlightRules = KotlinHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/kotlin",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/kotlin_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var KotlinHighlightRules = require("./kotlin_highlight_rules").KotlinHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = KotlinHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/kotlin" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-latex.js b/htdocs/includes/ace/mode-latex.js new file mode 100644 index 00000000000..cfdf56f3cc1 --- /dev/null +++ b/htdocs/includes/ace/mode-latex.js @@ -0,0 +1,224 @@ +ace.define("ace/mode/latex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var LatexHighlightRules = function() { + + this.$rules = { + "start" : [{ + token : "comment", + regex : "%.*$" + }, { + token : ["keyword", "lparen", "variable.parameter", "rparen", "lparen", "storage.type", "rparen"], + regex : "(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})" + }, { + token : ["keyword","lparen", "variable.parameter", "rparen"], + regex : "(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?" + }, { + token : ["storage.type", "lparen", "variable.parameter", "rparen"], + regex : "(\\\\(?:begin|end))({)(\\w*)(})" + }, { + token : "storage.type", + regex : "\\\\[a-zA-Z]+" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "constant.character.escape", + regex : "\\\\[^a-zA-Z]?" + }, { + token : "string", + regex : "\\${1,2}", + next : "equation" + }], + "equation" : [{ + token : "comment", + regex : "%.*$" + }, { + token : "string", + regex : "\\${1,2}", + next : "start" + }, { + token : "constant.character.escape", + regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)" + }, { + token : "error", + regex : "^\\s*$", + next : "start" + }, { + defaultToken : "string" + }] + + }; +}; +oop.inherits(LatexHighlightRules, TextHighlightRules); + +exports.LatexHighlightRules = LatexHighlightRules; + +}); + +ace.define("ace/mode/folding/latex",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var FoldMode = exports.FoldMode = function() {}; + +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /^\s*\\(begin)|(section|subsection|paragraph)\b|{\s*$/; + this.foldingStopMarker = /^\s*\\(end)\b|^\s*}/; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.doc.getLine(row); + var match = this.foldingStartMarker.exec(line); + if (match) { + if (match[1]) + return this.latexBlock(session, row, match[0].length - 1); + if (match[2]) + return this.latexSection(session, row, match[0].length - 1); + + return this.openingBracketBlock(session, "{", row, match.index); + } + + var match = this.foldingStopMarker.exec(line); + if (match) { + if (match[1]) + return this.latexBlock(session, row, match[0].length - 1); + + return this.closingBracketBlock(session, "}", row, match.index + match[0].length); + } + }; + + this.latexBlock = function(session, row, column) { + var keywords = { + "\\begin": 1, + "\\end": -1 + }; + + var stream = new TokenIterator(session, row, column); + var token = stream.getCurrentToken(); + if (!token || !(token.type == "storage.type" || token.type == "constant.character.escape")) + return; + + var val = token.value; + var dir = keywords[val]; + + var getType = function() { + var token = stream.stepForward(); + var type = token.type == "lparen" ?stream.stepForward().value : ""; + if (dir === -1) { + stream.stepBackward(); + if (type) + stream.stepBackward(); + } + return type; + }; + var stack = [getType()]; + var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length; + var startRow = row; + + stream.step = dir === -1 ? stream.stepBackward : stream.stepForward; + while(token = stream.step()) { + if (!token || !(token.type == "storage.type" || token.type == "constant.character.escape")) + continue; + var level = keywords[token.value]; + if (!level) + continue; + var type = getType(); + if (level === dir) + stack.unshift(type); + else if (stack.shift() !== type || !stack.length) + break; + } + + if (stack.length) + return; + + var row = stream.getCurrentTokenRow(); + if (dir === -1) + return new Range(row, session.getLine(row).length, startRow, startColumn); + stream.stepBackward(); + return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn()); + }; + + this.latexSection = function(session, row, column) { + var keywords = ["\\subsection", "\\section", "\\begin", "\\end", "\\paragraph"]; + + var stream = new TokenIterator(session, row, column); + var token = stream.getCurrentToken(); + if (!token || token.type != "storage.type") + return; + + var startLevel = keywords.indexOf(token.value); + var stackDepth = 0 + var endRow = row; + + while(token = stream.stepForward()) { + if (token.type !== "storage.type") + continue; + var level = keywords.indexOf(token.value); + + if (level >= 2) { + if (!stackDepth) + endRow = stream.getCurrentTokenRow() - 1; + stackDepth += level == 2 ? 1 : - 1; + if (stackDepth < 0) + break + } else if (level >= startLevel) + break; + } + + if (!stackDepth) + endRow = stream.getCurrentTokenRow() - 1; + + while (endRow > row && !/\S/.test(session.getLine(endRow))) + endRow--; + + return new Range( + row, session.getLine(row).length, + endRow, session.getLine(endRow).length + ); + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/latex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/latex_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/latex"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LatexHighlightRules = require("./latex_highlight_rules").LatexHighlightRules; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var LatexFoldMode = require("./folding/latex").FoldMode; + +var Mode = function() { + this.HighlightRules = LatexHighlightRules; + this.foldingRules = new LatexFoldMode(); + this.$behaviour = new CstyleBehaviour({ braces: true }); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.type = "text"; + + this.lineCommentStart = "%"; + + this.$id = "ace/mode/latex"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-lean.js b/htdocs/includes/ace/mode-lean.js new file mode 100644 index 00000000000..00d95f80d29 --- /dev/null +++ b/htdocs/includes/ace/mode-lean.js @@ -0,0 +1,281 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/lean_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var leanHighlightRules = function() { + + var keywordControls = ( + [ "add_rewrite", "alias", "as", "assume", "attribute", + "begin", "by", "calc", "calc_refl", "calc_subst", "calc_trans", "check", + "classes", "coercions", "conjecture", "constants", "context", + "corollary", "else", "end", "environment", "eval", "example", + "exists", "exit", "export", "exposing", "extends", "fields", "find_decl", + "forall", "from", "fun", "have", "help", "hiding", "if", + "import", "in", "infix", "infixl", "infixr", "instances", + "let", "local", "match", "namespace", "notation", "obtain", "obtains", + "omit", "opaque", "open", "options", "parameter", "parameters", "postfix", + "precedence", "prefix", "premise", "premises", "print", "private", "proof", + "protected", "qed", "raw", "renaming", "section", "set_option", + "show", "tactic_hint", "take", "then", "universe", + "universes", "using", "variable", "variables", "with"].join("|") + ); + + var nameProviders = ( + ["inductive", "structure", "record", "theorem", "axiom", + "axioms", "lemma", "hypothesis", "definition", "constant"].join("|") + ); + + var storageType = ( + ["Prop", "Type", "Type'", "Type₊", "Type₁", "Type₂", "Type₃"].join("|") + ); + + var storageModifiers = ( + "\\[(" + + ["abbreviations", "all-transparent", "begin-end-hints", "class", "classes", "coercion", + "coercions", "declarations", "decls", "instance", "irreducible", + "multiple-instances", "notation", "notations", "parsing-only", "persistent", + "reduce-hints", "reducible", "tactic-hints", "visible", "wf", "whnf" + ].join("|") + + ")\\]" + ); + + var keywordOperators = ( + [].join("|") + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword.control" : keywordControls, + "storage.type" : storageType, + "keyword.operator" : keywordOperators, + "variable.language": "sorry" + }, "identifier"); + + var identifierRe = "[A-Za-z_\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2100-\u214f][A-Za-z0-9_'\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2070-\u2079\u207f-\u2089\u2090-\u209c\u2100-\u214f]*"; + var operatorRe = new RegExp(["#", "@", "->", "∼", "↔", "/", "==", "=", ":=", "<->", + "/\\", "\\/", "∧", "∨", "≠", "<", ">", "≤", "≥", "¬", + "<=", ">=", "⁻¹", "⬝", "▸", "\\+", "\\*", "-", "/", + "λ", "→", "∃", "∀", ":="].join("|")); + + this.$rules = { + "start" : [ + { + token : "comment", // single line comment "--" + regex : "--.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment "/-" + regex : "\\/-", + next : "comment" + }, { + stateName: "qqstring", + token : "string.start", regex : '"', next : [ + {token : "string.end", regex : '"', next : "start"}, + {token : "constant.language.escape", regex : /\\[n"\\]/}, + {defaultToken: "string"} + ] + }, { + token : "keyword.control", regex : nameProviders, next : [ + {token : "variable.language", regex : identifierRe, next : "start"} ] + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "storage.modifier", + regex : storageModifiers + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "operator", + regex : operatorRe + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ {token: "comment", regex: "-/", next: "start"}, + {defaultToken: "comment"} ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(leanHighlightRules, TextHighlightRules); + +exports.leanHighlightRules = leanHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/lean",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lean_highlight_rules","ace/mode/matching_brace_outdent","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var leanHighlightRules = require("./lean_highlight_rules").leanHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = leanHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "--"; + this.blockComment = {start: "/-", end: "-/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "- "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/lean"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-less.js b/htdocs/includes/ace/mode-less.js new file mode 100644 index 00000000000..c407a0979aa --- /dev/null +++ b/htdocs/includes/ace/mode-less.js @@ -0,0 +1,819 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var CssHighlightRules = require('./css_highlight_rules'); + +var LessHighlightRules = function() { + + + var keywordList = "@import|@media|@font-face|@keyframes|@-webkit-keyframes|@supports|" + + "@charset|@plugin|@namespace|@document|@page|@viewport|@-ms-viewport|" + + "or|and|when|not"; + + var keywords = keywordList.split('|'); + + var properties = CssHighlightRules.supportType.split('|'); + + var keywordMapper = this.createKeywordMapper({ + "support.constant": CssHighlightRules.supportConstant, + "keyword": keywordList, + "support.constant.color": CssHighlightRules.supportConstantColor, + "support.constant.fonts": CssHighlightRules.supportConstantFonts + }, "identifier", true); + + var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : ["support.function", "paren.lparen", "string", "paren.rparen"], + regex : "(url)(\\()(.*)(\\))" + }, { + token : ["support.function", "paren.lparen"], + regex : "(:extend|[a-z0-9_\\-]+)(\\()" + }, { + token : function(value) { + if (keywords.indexOf(value.toLowerCase()) > -1) + return "keyword"; + else + return "variable"; + }, + regex : "[@\\$][a-z0-9_\\-@\\$]*\\b" + }, { + token : "variable", + regex : "[@\\$]\\{[a-z0-9_\\-@\\$]*\\}" + }, { + token : function(first, second) { + if(properties.indexOf(first.toLowerCase()) > -1) { + return ["support.type.property", "text"]; + } + else { + return ["support.type.unknownProperty", "text"]; + } + }, + regex : "([a-z0-9-_]+)(\\s*:)" + }, { + token : "keyword", + regex : "&" // special case - always treat as keyword + }, { + token : keywordMapper, + regex : "\\-?[@a-z_][@a-z0-9_\\-]*" + }, { + token: "variable.language", + regex: "#[a-z0-9-_]+" + }, { + token: "variable.language", + regex: "\\.[a-z0-9-_]+" + }, { + token: "variable.language", + regex: ":[a-z_][a-z0-9-_]*" + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + token : "keyword.operator", + regex : "<|>|<=|>=|=|!=|-|%|\\+|\\*" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + }, { + caseInsensitive: true + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + this.normalizeRules(); +}; + +oop.inherits(LessHighlightRules, TextHighlightRules); + +exports.LessHighlightRules = LessHighlightRules; + +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/less",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/less_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/css_completions","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CssCompletions = require("./css_completions").CssCompletions; + +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = LessHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions("ruleset", session, pos, prefix); + }; + + this.$id = "ace/mode/less"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-liquid.js b/htdocs/includes/ace/mode-liquid.js new file mode 100644 index 00000000000..925ef305f24 --- /dev/null +++ b/htdocs/includes/ace/mode-liquid.js @@ -0,0 +1,1184 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/liquid_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + +var LiquidHighlightRules = function() { + HtmlHighlightRules.call(this); + var functions = ( + "date|capitalize|downcase|upcase|first|last|join|sort|map|size|escape|" + + "escape_once|strip_html|strip_newlines|newline_to_br|replace|replace_first|" + + "truncate|truncatewords|prepend|append|minus|plus|times|divided_by|split" + ); + + var keywords = ( + "capture|endcapture|case|endcase|when|comment|endcomment|" + + "cycle|for|endfor|in|reversed|if|endif|else|elsif|include|endinclude|unless|endunless|" + + "style|text|image|widget|plugin|marker|endmarker|tablerow|endtablerow" + ); + + var builtinVariables = 'forloop|tablerowloop'; + + var definitions = ("assign"); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": builtinVariables, + "keyword": keywords, + "support.function": functions, + "keyword.definition": definitions + }, "identifier"); + for (var rule in this.$rules) { + this.$rules[rule].unshift({ + token : "variable", + regex : "{%", + push : "liquid-start" + }, { + token : "variable", + regex : "{{", + push : "liquid-start" + }); + } + + this.addRules({ + "liquid-start" : [{ + token: "variable", + regex: "}}", + next: "pop" + }, { + token: "variable", + regex: "%}", + next: "pop" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "/|\\*|\\-|\\+|=|!=|\\?\\:" + }, { + token : "paren.lparen", + regex : /[\[\({]/ + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token : "text", + regex : "\\s+" + }] + }); + + this.normalizeRules(); +}; +oop.inherits(LiquidHighlightRules, TextHighlightRules); + +exports.LiquidHighlightRules = LiquidHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/liquid",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/liquid_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LiquidHighlightRules = require("./liquid_highlight_rules").LiquidHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function() { + this.HighlightRules = LiquidHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/liquid"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-lisp.js b/htdocs/includes/ace/mode-lisp.js new file mode 100644 index 00000000000..fb0897d9da5 --- /dev/null +++ b/htdocs/includes/ace/mode-lisp.js @@ -0,0 +1,105 @@ +ace.define("ace/mode/lisp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var LispHighlightRules = function() { + var keywordControl = "case|do|let|loop|if|else|when"; + var keywordOperator = "eq|neq|and|or"; + var constantLanguage = "null|nil"; + var supportFunctions = "cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn"; + + var keywordMapper = this.createKeywordMapper({ + "keyword.control": keywordControl, + "keyword.operator": keywordOperator, + "constant.language": constantLanguage, + "support.function": supportFunctions + }, "identifier", true); + + this.$rules = + { + "start": [ + { + token : "comment", + regex : ";.*$" + }, + { + token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"], + regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" + }, + { + token: ["punctuation.definition.constant.character.lisp", "constant.character.lisp"], + regex: "(#)((?:\\w|[\\\\+-=<>'\"&#])+)" + }, + { + token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"], + regex: "(\\*)(\\S*)(\\*)" + }, + { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, + { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, + { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, + { + token : "string", + regex : '"(?=.)', + next : "qqstring" + } + ], + "qqstring": [ + { + token: "constant.character.escape.lisp", + regex: "\\\\." + }, + { + token : "string", + regex : '[^"\\\\]+' + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "start" + } + ] +} + +}; + +oop.inherits(LispHighlightRules, TextHighlightRules); + +exports.LispHighlightRules = LispHighlightRules; +}); + +ace.define("ace/mode/lisp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lisp_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LispHighlightRules = require("./lisp_highlight_rules").LispHighlightRules; + +var Mode = function() { + this.HighlightRules = LispHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = ";"; + + this.$id = "ace/mode/lisp"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-live_script.js b/htdocs/includes/ace/mode-live_script.js new file mode 100644 index 00000000000..a5d36ebe220 --- /dev/null +++ b/htdocs/includes/ace/mode-live_script.js @@ -0,0 +1,481 @@ +ace.define("ace/mode/live_script_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var LiveScriptHighlightRules = function() { + + this.$rules = { start: + [ { token: 'punctuation.definition.comment.livescript', + regex: '\\/\\*', + push: + [ { token: 'punctuation.definition.comment.livescript', + regex: '\\*\\/', + next: 'pop' }, + { token: 'storage.type.annotation.livescriptscript', + regex: '@\\w*' }, + { defaultToken: 'comment.block.livescript' } ] }, + { token: + [ 'punctuation.definition.comment.livescript', + 'comment.line.number-sign.livescript' ], + regex: '(#)(?!\\{)(.*$)' }, + { token: + [ 'variable.parameter.function.livescript', + 'meta.inline.function.livescript', + 'storage.type.function.livescript', + 'meta.inline.function.livescript', + 'variable.parameter.function.livescript', + 'meta.inline.function.livescript', + 'storage.type.function.livescript' ], + regex: '(\\s*\\!?\\(\\s*[^()]*?\\))(\\s*)(!?[~-]{1,2}>)|(\\s*\\!?)(\\(?[^()]*?\\)?)(\\s*)(<[~-]{1,2}!?)', + comment: 'match stuff like: a -> … ' }, + { token: + [ 'keyword.operator.new.livescript', + 'meta.class.instance.constructor', + 'entity.name.type.instance.livescript' ], + regex: '(new)(\\s+)(\\w+(?:\\.\\w*)*)' }, + { token: 'keyword.illegal.livescript', + regex: '\\bp(?:ackage|r(?:ivate|otected)|ublic)|interface|enum|static|yield\\b' }, + { token: 'punctuation.definition.string.begin.livescript', + regex: '\'\'\'', + push: + [ { token: 'punctuation.definition.string.end.livescript', + regex: '\'\'\'', + next: 'pop' }, + { defaultToken: 'string.quoted.heredoc.livescript' } ] }, + { token: 'punctuation.definition.string.begin.livescript', + regex: '"""', + push: + [ { token: 'punctuation.definition.string.end.livescript', + regex: '"""', + next: 'pop' }, + { token: 'constant.character.escape.livescript', + regex: '\\\\.' }, + { include: '#interpolated_livescript' }, + { defaultToken: 'string.quoted.double.heredoc.livescript' } ] }, + { token: 'punctuation.definition.string.begin.livescript', + regex: '``', + push: + [ { token: 'punctuation.definition.string.end.livescript', + regex: '``', + next: 'pop' }, + { token: 'constant.character.escape.livescript', + regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' }, + { defaultToken: 'string.quoted.script.livescript' } ] }, + { token: 'string.array-literal.livescript', + regex: '<\\[', + push: + [ { token: 'string.array-literal.livescript', + regex: '\\]>', + next: 'pop' }, + { defaultToken: 'string.array-literal.livescript' } ] }, + { token: 'string.regexp.livescript', + regex: '/{2}(?![\\s=/*+{}?]).*?[^\\\\]/[igmy]{0,4}(?![a-zA-Z0-9])/{2}' }, + { token: 'string.regexp.livescript', + regex: '/{2}$', + push: + [ { token: 'string.regexp.livescript', + regex: '/{2}[imgy]{0,4}', + next: 'pop' }, + { include: '#embedded_spaced_comment' }, + { include: '#interpolated_livescript' }, + { defaultToken: 'string.regexp.livescript' } ] }, + { token: 'string.regexp.livescript', + regex: '/{2}', + push: + [ { token: 'string.regexp.livescript', + regex: '/{2}[imgy]{0,4}', + next: 'pop' }, + { token: 'constant.character.escape.livescript', + regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' }, + { include: '#interpolated_livescript' }, + { defaultToken: 'string.regexp.livescript' } ] }, + { token: 'string.regexp.livescript', + regex: '/(?![\\s=/*+{}?]).*?[^\\\\]/[igmy]{0,4}(?![a-zA-Z0-9])' }, + { token: 'keyword.control.livescript', + regex: '\\b(?)|\\+\\+|\\+|~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<(?!\\[)|(?|(?)|&&|\\.\\.(?:\\.)?|\\s\\.\\s|\\?|\\||\\|\\||\\:|\\*=|(?)|\\+\\+|\\+|\n\t\t\t\t~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|\n\t\t\t\t>>>=|<>|<(?!\\[)|(?|(?)|&&|\\.\\.(\\.)?|\\s\\.\\s|\\?|\\||\\|\\||\\:|\\*=|(?)' }, + { token: 'keyword.operator.livescript', + regex: '(?<=\\s|^)[\\[\\{](?=.*?[\\]\\}]\\s+[:=])', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=\\s|^)([\\[\\{])(?=.*?[\\]\\}]\\s+[:=])', + push: + [ { token: 'keyword.operator.livescript', + regex: '[\\]\\}]\\s*[:=]', + next: 'pop' }, + { include: '#variable_name' }, + { include: '#instance_variable' }, + { include: '#single_quoted_string' }, + { include: '#double_quoted_string' }, + { include: '#numeric' }, + { defaultToken: 'meta.variable.assignment.destructured.livescript' } ] }, + { token: + [ 'meta.function.livescript', + 'entity.name.function.livescript', + 'entity.name.function.livescript', + 'entity.name.function.livescript', + 'entity.name.function.livescript', + 'variable.parameter.function.livescript', + 'entity.name.function.livescript', + 'storage.type.function.livescript' ], + regex: '(\\s*)(?=[a-zA-Z\\$_])([a-zA-Z\\$_])((?:[\\w$.:-])*)(\\s*)([:=])((?:\\s*!?\\s*\\(.*\\))?)(\\s*)(!?[~-]{1,2}>)' }, + { token: 'storage.type.function.livescript', + regex: '!?[~-]{1,2}>' }, + { token: 'constant.language.boolean.true.livescript', + regex: '\\b(?|=>)\\s*$|.*[\\[{]\\s*$', + foldingStopMarker: '^\\s*$|^\\s*[}\\]]\\s*$', + keyEquivalent: '^~C', + name: 'LiveScript', + scopeName: 'source.livescript' } + + +oop.inherits(LiveScriptHighlightRules, TextHighlightRules); + +exports.LiveScriptHighlightRules = LiveScriptHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/live_script",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/live_script_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LiveScriptHighlightRules = require("./live_script_highlight_rules").LiveScriptHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = LiveScriptHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/live_script" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-livescript.js b/htdocs/includes/ace/mode-livescript.js new file mode 100644 index 00000000000..0e480a9133a --- /dev/null +++ b/htdocs/includes/ace/mode-livescript.js @@ -0,0 +1,271 @@ +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/livescript",["require","exports","module","ace/tokenizer","ace/mode/matching_brace_outdent","ace/mode/text"], function(require, exports, module){ + var identifier, LiveScriptMode, keywordend, stringfill; + identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*'; + exports.Mode = LiveScriptMode = (function(superclass){ + var indenter, prototype = extend$((import$(LiveScriptMode, superclass).displayName = 'LiveScriptMode', LiveScriptMode), superclass).prototype, constructor = LiveScriptMode; + function LiveScriptMode(){ + var that; + this.$tokenizer = new (require('../tokenizer')).Tokenizer(LiveScriptMode.Rules); + if (that = require('../mode/matching_brace_outdent')) { + this.$outdent = new that.MatchingBraceOutdent; + } + this.$id = "ace/mode/livescript"; + } + indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$'); + prototype.getNextLineIndent = function(state, line, tab){ + var indent, tokens; + indent = this.$getIndent(line); + tokens = this.$tokenizer.getLineTokens(line, state).tokens; + if (!(tokens.length && tokens[tokens.length - 1].type === 'comment')) { + if (state === 'start' && indenter.test(line)) { + indent += tab; + } + } + return indent; + }; + prototype.lineCommentStart = "#"; + prototype.blockComment = {start: "###", end: "###"}; + prototype.checkOutdent = function(state, line, input){ + var ref$; + return (ref$ = this.$outdent) != null ? ref$.checkOutdent(line, input) : void 8; + }; + prototype.autoOutdent = function(state, doc, row){ + var ref$; + return (ref$ = this.$outdent) != null ? ref$.autoOutdent(doc, row) : void 8; + }; + return LiveScriptMode; + }(require('../mode/text').Mode)); + keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))'; + stringfill = { + defaultToken: 'string' + }; + LiveScriptMode.Rules = { + start: [ + { + 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: 'comment.doc', + regex: '/\\*', + next: 'comment' + }, { + token: 'comment', + regex: '#.*' + }, { + 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: '[\\^!|&%+\\-]+' + }, { + token: 'text', + regex: '\\s+' + } + ], + heregex: [ + { + token: 'string.regex', + regex: '.*?//[gimy$?]{0,4}', + next: 'start' + }, { + token: 'string.regex', + regex: '\\s*#{' + }, { + token: 'comment.regex', + regex: '\\s+(?:#.*)?' + }, { + defaultToken: 'string.regex' + } + ], + key: [ + { + token: 'keyword.operator', + regex: '[.?@!]+' + }, { + token: 'identifier', + regex: identifier, + next: 'start' + }, { + token: 'text', + regex: '', + next: 'start' + } + ], + comment: [ + { + token: 'comment.doc', + regex: '.*?\\*/', + next: 'start' + }, { + defaultToken: 'comment.doc' + } + ], + 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 + ] + }; +function extend$(sub, sup){ + function fun(){} fun.prototype = (sub.superclass = sup).prototype; + (sub.prototype = new fun).constructor = sub; + if (typeof sup.extended == 'function') sup.extended(sub); + return sub; +} +function import$(obj, src){ + var own = {}.hasOwnProperty; + for (var key in src) if (own.call(src, key)) obj[key] = src[key]; + return obj; +} +}); diff --git a/htdocs/includes/ace/mode-logiql.js b/htdocs/includes/ace/mode-logiql.js new file mode 100644 index 00000000000..f4ea30d0190 --- /dev/null +++ b/htdocs/includes/ace/mode-logiql.js @@ -0,0 +1,310 @@ +ace.define("ace/mode/logiql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var LogiQLHighlightRules = function() { + + this.$rules = { start: + [ { token: 'comment.block', + regex: '/\\*', + push: + [ { token: 'comment.block', regex: '\\*/', next: 'pop' }, + { defaultToken: 'comment.block' } ] + }, + { token: 'comment.single', + regex: '//.*' + }, + { token: 'constant.numeric', + regex: '\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fd]?' + }, + { token: 'string', + regex: '"', + push: + [ { token: 'string', regex: '"', next: 'pop' }, + { defaultToken: 'string' } ] + }, + { token: 'constant.language', + regex: '\\b(true|false)\\b' + }, + { token: 'entity.name.type.logicblox', + regex: '`[a-zA-Z_:]+(\\d|\\a)*\\b' + }, + { token: 'keyword.start', regex: '->', comment: 'Constraint' }, + { token: 'keyword.start', regex: '-->', comment: 'Level 1 Constraint'}, + { token: 'keyword.start', regex: '<-', comment: 'Rule' }, + { token: 'keyword.start', regex: '<--', comment: 'Level 1 Rule' }, + { token: 'keyword.end', regex: '\\.', comment: 'Terminator' }, + { token: 'keyword.other', regex: '!', comment: 'Negation' }, + { token: 'keyword.other', regex: ',', comment: 'Conjunction' }, + { token: 'keyword.other', regex: ';', comment: 'Disjunction' }, + { token: 'keyword.operator', regex: '<=|>=|!=|<|>', comment: 'Equality'}, + { token: 'keyword.other', regex: '@', comment: 'Equality' }, + { token: 'keyword.operator', regex: '\\+|-|\\*|/', comment: 'Arithmetic operations'}, + { token: 'keyword', regex: '::', comment: 'Colon colon' }, + { token: 'support.function', + regex: '\\b(agg\\s*<<)', + push: + [ { include: '$self' }, + { token: 'support.function', + regex: '>>', + next: 'pop' } ] + }, + { token: 'storage.modifier', + regex: '\\b(lang:[\\w:]*)' + }, + { token: [ 'storage.type', 'text' ], + regex: '(export|sealed|clauses|block|alias|alias_all)(\\s*\\()(?=`)' + }, + { token: 'entity.name', + regex: '[a-zA-Z_][a-zA-Z_0-9:]*(@prev|@init|@final)?(?=(\\(|\\[))' + }, + { token: 'variable.parameter', + regex: '([a-zA-Z][a-zA-Z_0-9]*|_)\\s*(?=(,|\\.|<-|->|\\)|\\]|=))' + } ] } + + this.normalizeRules(); +}; + +oop.inherits(LogiQLHighlightRules, TextHighlightRules); + +exports.LogiQLHighlightRules = LogiQLHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/logiql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/logiql_highlight_rules","ace/mode/folding/coffee","ace/token_iterator","ace/range","ace/mode/behaviour/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LogiQLHighlightRules = require("./logiql_highlight_rules").LogiQLHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; +var TokenIterator = require("../token_iterator").TokenIterator; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function() { + this.HighlightRules = LogiQLHighlightRules; + this.foldingRules = new FoldMode(); + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + if (/comment|string/.test(endState)) + return indent; + if (tokens.length && tokens[tokens.length - 1].type == "comment.single") + return indent; + + var match = line.match(); + if (/(-->|<--|<-|->|{)\s*$/.test(line)) + indent += tab; + return indent; + }; + + this.checkOutdent = function(state, line, input) { + if (this.$outdent.checkOutdent(line, input)) + return true; + + if (input !== "\n" && input !== "\r\n") + return false; + + if (!/^\s+/.test(line)) + return false; + + return true; + }; + + this.autoOutdent = function(state, doc, row) { + if (this.$outdent.autoOutdent(doc, row)) + return; + var prevLine = doc.getLine(row); + var match = prevLine.match(/^\s+/); + var column = prevLine.lastIndexOf(".") + 1; + if (!match || !row || !column) return 0; + + var line = doc.getLine(row + 1); + var startRange = this.getMatching(doc, {row: row, column: column}); + if (!startRange || startRange.start.row == row) return 0; + + column = match[0].length; + var indent = this.$getIndent(doc.getLine(startRange.start.row)); + doc.replace(new Range(row + 1, 0, row + 1, column), indent); + }; + + this.getMatching = function(session, row, column) { + if (row == undefined) + row = session.selection.lead + if (typeof row == "object") { + column = row.column; + row = row.row; + } + + var startToken = session.getTokenAt(row, column); + var KW_START = "keyword.start", KW_END = "keyword.end"; + var tok; + if (!startToken) + return; + if (startToken.type == KW_START) { + var it = new TokenIterator(session, row, column); + it.step = it.stepForward; + } else if (startToken.type == KW_END) { + var it = new TokenIterator(session, row, column); + it.step = it.stepBackward; + } else + return; + + while (tok = it.step()) { + if (tok.type == KW_START || tok.type == KW_END) + break; + } + if (!tok || tok.type == startToken.type) + return; + + var col = it.getCurrentTokenColumn(); + var row = it.getCurrentTokenRow(); + return new Range(row, col, row, col + tok.value.length); + }; + this.$id = "ace/mode/logiql"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-lsl.js b/htdocs/includes/ace/mode-lsl.js new file mode 100644 index 00000000000..2531f6e1361 --- /dev/null +++ b/htdocs/includes/ace/mode-lsl.js @@ -0,0 +1,335 @@ +ace.define("ace/mode/lsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +oop.inherits(LSLHighlightRules, TextHighlightRules); + +function LSLHighlightRules() { + var keywordMapper = this.createKeywordMapper({ + "constant.language.float.lsl" : "DEG_TO_RAD|PI|PI_BY_TWO|RAD_TO_DEG|SQRT2|TWO_PI", + "constant.language.integer.lsl": "ACTIVE|AGENT|AGENT_ALWAYS_RUN|AGENT_ATTACHMENTS|AGENT_AUTOPILOT|AGENT_AWAY|AGENT_BUSY|AGENT_BY_LEGACY_NAME|AGENT_BY_USERNAME|AGENT_CROUCHING|AGENT_FLYING|AGENT_IN_AIR|AGENT_LIST_PARCEL|AGENT_LIST_PARCEL_OWNER|AGENT_LIST_REGION|AGENT_MOUSELOOK|AGENT_ON_OBJECT|AGENT_SCRIPTED|AGENT_SITTING|AGENT_TYPING|AGENT_WALKING|ALL_SIDES|ANIM_ON|ATTACH_AVATAR_CENTER|ATTACH_BACK|ATTACH_BELLY|ATTACH_CHEST|ATTACH_CHIN|ATTACH_HEAD|ATTACH_HUD_BOTTOM|ATTACH_HUD_BOTTOM_LEFT|ATTACH_HUD_BOTTOM_RIGHT|ATTACH_HUD_CENTER_1|ATTACH_HUD_CENTER_2|ATTACH_HUD_TOP_CENTER|ATTACH_HUD_TOP_LEFT|ATTACH_HUD_TOP_RIGHT|ATTACH_LEAR|ATTACH_LEFT_PEC|ATTACH_LEYE|ATTACH_LFOOT|ATTACH_LHAND|ATTACH_LHIP|ATTACH_LLARM|ATTACH_LLLEG|ATTACH_LSHOULDER|ATTACH_LUARM|ATTACH_LULEG|ATTACH_MOUTH|ATTACH_NECK|ATTACH_NOSE|ATTACH_PELVIS|ATTACH_REAR|ATTACH_REYE|ATTACH_RFOOT|ATTACH_RHAND|ATTACH_RHIP|ATTACH_RIGHT_PEC|ATTACH_RLARM|ATTACH_RLLEG|ATTACH_RSHOULDER|ATTACH_RUARM|ATTACH_RULEG|AVOID_CHARACTERS|AVOID_DYNAMIC_OBSTACLES|AVOID_NONE|CAMERA_ACTIVE|CAMERA_BEHINDNESS_ANGLE|CAMERA_BEHINDNESS_LAG|CAMERA_DISTANCE|CAMERA_FOCUS|CAMERA_FOCUS_LAG|CAMERA_FOCUS_LOCKED|CAMERA_FOCUS_OFFSET|CAMERA_FOCUS_THRESHOLD|CAMERA_PITCH|CAMERA_POSITION|CAMERA_POSITION_LAG|CAMERA_POSITION_LOCKED|CAMERA_POSITION_THRESHOLD|CHANGED_ALLOWED_DROP|CHANGED_COLOR|CHANGED_INVENTORY|CHANGED_LINK|CHANGED_MEDIA|CHANGED_OWNER|CHANGED_REGION|CHANGED_REGION_START|CHANGED_SCALE|CHANGED_SHAPE|CHANGED_TELEPORT|CHANGED_TEXTURE|CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES|CHARACTER_AVOIDANCE_MODE|CHARACTER_CMD_JUMP|CHARACTER_CMD_SMOOTH_STOP|CHARACTER_CMD_STOP|CHARACTER_DESIRED_SPEED|CHARACTER_DESIRED_TURN_SPEED|CHARACTER_LENGTH|CHARACTER_MAX_ACCEL|CHARACTER_MAX_DECEL|CHARACTER_MAX_SPEED|CHARACTER_MAX_TURN_RADIUS|CHARACTER_ORIENTATION|CHARACTER_RADIUS|CHARACTER_STAY_WITHIN_PARCEL|CHARACTER_TYPE|CHARACTER_TYPE_A|CHARACTER_TYPE_B|CHARACTER_TYPE_C|CHARACTER_TYPE_D|CHARACTER_TYPE_NONE|CLICK_ACTION_BUY|CLICK_ACTION_NONE|CLICK_ACTION_OPEN|CLICK_ACTION_OPEN_MEDIA|CLICK_ACTION_PAY|CLICK_ACTION_PLAY|CLICK_ACTION_SIT|CLICK_ACTION_TOUCH|CONTENT_TYPE_ATOM|CONTENT_TYPE_FORM|CONTENT_TYPE_HTML|CONTENT_TYPE_JSON|CONTENT_TYPE_LLSD|CONTENT_TYPE_RSS|CONTENT_TYPE_TEXT|CONTENT_TYPE_XHTML|CONTENT_TYPE_XML|CONTROL_BACK|CONTROL_DOWN|CONTROL_FWD|CONTROL_LBUTTON|CONTROL_LEFT|CONTROL_ML_LBUTTON|CONTROL_RIGHT|CONTROL_ROT_LEFT|CONTROL_ROT_RIGHT|CONTROL_UP|DATA_BORN|DATA_NAME|DATA_ONLINE|DATA_PAYINFO|DATA_SIM_POS|DATA_SIM_RATING|DATA_SIM_STATUS|DEBUG_CHANNEL|DENSITY|ERR_GENERIC|ERR_MALFORMED_PARAMS|ERR_PARCEL_PERMISSIONS|ERR_RUNTIME_PERMISSIONS|ERR_THROTTLED|ESTATE_ACCESS_ALLOWED_AGENT_ADD|ESTATE_ACCESS_ALLOWED_AGENT_REMOVE|ESTATE_ACCESS_ALLOWED_GROUP_ADD|ESTATE_ACCESS_ALLOWED_GROUP_REMOVE|ESTATE_ACCESS_BANNED_AGENT_ADD|ESTATE_ACCESS_BANNED_AGENT_REMOVE|FALSE|FORCE_DIRECT_PATH|FRICTION|GCNP_RADIUS|GCNP_STATIC|GRAVITY_MULTIPLIER|HORIZONTAL|HTTP_BODY_MAXLENGTH|HTTP_BODY_TRUNCATED|HTTP_CUSTOM_HEADER|HTTP_METHOD|HTTP_MIMETYPE|HTTP_PRAGMA_NO_CACHE|HTTP_VERBOSE_THROTTLE|HTTP_VERIFY_CERT|INVENTORY_ALL|INVENTORY_ANIMATION|INVENTORY_BODYPART|INVENTORY_CLOTHING|INVENTORY_GESTURE|INVENTORY_LANDMARK|INVENTORY_NONE|INVENTORY_NOTECARD|INVENTORY_OBJECT|INVENTORY_SCRIPT|INVENTORY_SOUND|INVENTORY_TEXTURE|JSON_APPEND|KFM_CMD_PAUSE|KFM_CMD_PLAY|KFM_CMD_SET_MODE|KFM_CMD_STOP|KFM_COMMAND|KFM_DATA|KFM_FORWARD|KFM_LOOP|KFM_MODE|KFM_PING_PONG|KFM_REVERSE|KFM_ROTATION|KFM_TRANSLATION|LAND_LEVEL|LAND_LOWER|LAND_NOISE|LAND_RAISE|LAND_REVERT|LAND_SMOOTH|LINK_ALL_CHILDREN|LINK_ALL_OTHERS|LINK_ROOT|LINK_SET|LINK_THIS|LIST_STAT_GEOMETRIC_MEAN|LIST_STAT_MAX|LIST_STAT_MEAN|LIST_STAT_MEDIAN|LIST_STAT_MIN|LIST_STAT_NUM_COUNT|LIST_STAT_RANGE|LIST_STAT_STD_DEV|LIST_STAT_SUM|LIST_STAT_SUM_SQUARES|LOOP|MASK_BASE|MASK_EVERYONE|MASK_GROUP|MASK_NEXT|MASK_OWNER|OBJECT_ATTACHED_POINT|OBJECT_BODY_SHAPE_TYPE|OBJECT_CHARACTER_TIME|OBJECT_CLICK_ACTION|OBJECT_CREATOR|OBJECT_DESC|OBJECT_GROUP|OBJECT_HOVER_HEIGHT|OBJECT_LAST_OWNER_ID|OBJECT_NAME|OBJECT_OWNER|OBJECT_PATHFINDING_TYPE|OBJECT_PHANTOM|OBJECT_PHYSICS|OBJECT_PHYSICS_COST|OBJECT_POS|OBJECT_PRIM_EQUIVALENCE|OBJECT_RENDER_WEIGHT|OBJECT_RETURN_PARCEL|OBJECT_RETURN_PARCEL_OWNER|OBJECT_RETURN_REGION|OBJECT_ROOT|OBJECT_ROT|OBJECT_RUNNING_SCRIPT_COUNT|OBJECT_SCRIPT_MEMORY|OBJECT_SCRIPT_TIME|OBJECT_SERVER_COST|OBJECT_STREAMING_COST|OBJECT_TEMP_ON_REZ|OBJECT_TOTAL_SCRIPT_COUNT|OBJECT_UNKNOWN_DETAIL|OBJECT_VELOCITY|OPT_AVATAR|OPT_CHARACTER|OPT_EXCLUSION_VOLUME|OPT_LEGACY_LINKSET|OPT_MATERIAL_VOLUME|OPT_OTHER|OPT_STATIC_OBSTACLE|OPT_WALKABLE|PARCEL_COUNT_GROUP|PARCEL_COUNT_OTHER|PARCEL_COUNT_OWNER|PARCEL_COUNT_SELECTED|PARCEL_COUNT_TEMP|PARCEL_COUNT_TOTAL|PARCEL_DETAILS_AREA|PARCEL_DETAILS_DESC|PARCEL_DETAILS_GROUP|PARCEL_DETAILS_ID|PARCEL_DETAILS_NAME|PARCEL_DETAILS_OWNER|PARCEL_DETAILS_SEE_AVATARS|PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS|PARCEL_FLAG_ALLOW_CREATE_OBJECTS|PARCEL_FLAG_ALLOW_DAMAGE|PARCEL_FLAG_ALLOW_FLY|PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_GROUP_SCRIPTS|PARCEL_FLAG_ALLOW_LANDMARK|PARCEL_FLAG_ALLOW_SCRIPTS|PARCEL_FLAG_ALLOW_TERRAFORM|PARCEL_FLAG_LOCAL_SOUND_ONLY|PARCEL_FLAG_RESTRICT_PUSHOBJECT|PARCEL_FLAG_USE_ACCESS_GROUP|PARCEL_FLAG_USE_ACCESS_LIST|PARCEL_FLAG_USE_BAN_LIST|PARCEL_FLAG_USE_LAND_PASS_LIST|PARCEL_MEDIA_COMMAND_AGENT|PARCEL_MEDIA_COMMAND_AUTO_ALIGN|PARCEL_MEDIA_COMMAND_DESC|PARCEL_MEDIA_COMMAND_LOOP|PARCEL_MEDIA_COMMAND_LOOP_SET|PARCEL_MEDIA_COMMAND_PAUSE|PARCEL_MEDIA_COMMAND_PLAY|PARCEL_MEDIA_COMMAND_SIZE|PARCEL_MEDIA_COMMAND_STOP|PARCEL_MEDIA_COMMAND_TEXTURE|PARCEL_MEDIA_COMMAND_TIME|PARCEL_MEDIA_COMMAND_TYPE|PARCEL_MEDIA_COMMAND_UNLOAD|PARCEL_MEDIA_COMMAND_URL|PASS_ALWAYS|PASS_IF_NOT_HANDLED|PASS_NEVER|PASSIVE|PATROL_PAUSE_AT_WAYPOINTS|PAYMENT_INFO_ON_FILE|PAYMENT_INFO_USED|PAY_DEFAULT|PAY_HIDE|PERMISSION_ATTACH|PERMISSION_CHANGE_LINKS|PERMISSION_CONTROL_CAMERA|PERMISSION_DEBIT|PERMISSION_OVERRIDE_ANIMATIONS|PERMISSION_RETURN_OBJECTS|PERMISSION_SILENT_ESTATE_MANAGEMENT|PERMISSION_TAKE_CONTROLS|PERMISSION_TELEPORT|PERMISSION_TRACK_CAMERA|PERMISSION_TRIGGER_ANIMATION|PERM_ALL|PERM_COPY|PERM_MODIFY|PERM_MOVE|PERM_TRANSFER|PING_PONG|PRIM_ALPHA_MODE|PRIM_ALPHA_MODE_BLEND|PRIM_ALPHA_MODE_EMISSIVE|PRIM_ALPHA_MODE_MASK|PRIM_ALPHA_MODE_NONE|PRIM_BUMP_BARK|PRIM_BUMP_BLOBS|PRIM_BUMP_BRICKS|PRIM_BUMP_BRIGHT|PRIM_BUMP_CHECKER|PRIM_BUMP_CONCRETE|PRIM_BUMP_DARK|PRIM_BUMP_DISKS|PRIM_BUMP_GRAVEL|PRIM_BUMP_LARGETILE|PRIM_BUMP_NONE|PRIM_BUMP_SHINY|PRIM_BUMP_SIDING|PRIM_BUMP_STONE|PRIM_BUMP_STUCCO|PRIM_BUMP_SUCTION|PRIM_BUMP_TILE|PRIM_BUMP_WEAVE|PRIM_BUMP_WOOD|PRIM_COLOR|PRIM_DESC|PRIM_FLEXIBLE|PRIM_FULLBRIGHT|PRIM_GLOW|PRIM_HOLE_CIRCLE|PRIM_HOLE_DEFAULT|PRIM_HOLE_SQUARE|PRIM_HOLE_TRIANGLE|PRIM_LINK_TARGET|PRIM_MATERIAL|PRIM_MATERIAL_FLESH|PRIM_MATERIAL_GLASS|PRIM_MATERIAL_METAL|PRIM_MATERIAL_PLASTIC|PRIM_MATERIAL_RUBBER|PRIM_MATERIAL_STONE|PRIM_MATERIAL_WOOD|PRIM_MEDIA_ALT_IMAGE_ENABLE|PRIM_MEDIA_AUTO_LOOP|PRIM_MEDIA_AUTO_PLAY|PRIM_MEDIA_AUTO_SCALE|PRIM_MEDIA_AUTO_ZOOM|PRIM_MEDIA_CONTROLS|PRIM_MEDIA_CONTROLS_MINI|PRIM_MEDIA_CONTROLS_STANDARD|PRIM_MEDIA_CURRENT_URL|PRIM_MEDIA_FIRST_CLICK_INTERACT|PRIM_MEDIA_HEIGHT_PIXELS|PRIM_MEDIA_HOME_URL|PRIM_MEDIA_MAX_HEIGHT_PIXELS|PRIM_MEDIA_MAX_URL_LENGTH|PRIM_MEDIA_MAX_WHITELIST_COUNT|PRIM_MEDIA_MAX_WHITELIST_SIZE|PRIM_MEDIA_MAX_WIDTH_PIXELS|PRIM_MEDIA_PARAM_MAX|PRIM_MEDIA_PERMS_CONTROL|PRIM_MEDIA_PERMS_INTERACT|PRIM_MEDIA_PERM_ANYONE|PRIM_MEDIA_PERM_GROUP|PRIM_MEDIA_PERM_NONE|PRIM_MEDIA_PERM_OWNER|PRIM_MEDIA_WHITELIST|PRIM_MEDIA_WHITELIST_ENABLE|PRIM_MEDIA_WIDTH_PIXELS|PRIM_NAME|PRIM_NORMAL|PRIM_OMEGA|PRIM_PHANTOM|PRIM_PHYSICS|PRIM_PHYSICS_SHAPE_CONVEX|PRIM_PHYSICS_SHAPE_NONE|PRIM_PHYSICS_SHAPE_PRIM|PRIM_PHYSICS_SHAPE_TYPE|PRIM_POINT_LIGHT|PRIM_POSITION|PRIM_POS_LOCAL|PRIM_ROTATION|PRIM_ROT_LOCAL|PRIM_SCULPT_FLAG_INVERT|PRIM_SCULPT_FLAG_MIRROR|PRIM_SCULPT_TYPE_CYLINDER|PRIM_SCULPT_TYPE_MASK|PRIM_SCULPT_TYPE_PLANE|PRIM_SCULPT_TYPE_SPHERE|PRIM_SCULPT_TYPE_TORUS|PRIM_SHINY_HIGH|PRIM_SHINY_LOW|PRIM_SHINY_MEDIUM|PRIM_SHINY_NONE|PRIM_SIZE|PRIM_SLICE|PRIM_SPECULAR|PRIM_TEMP_ON_REZ|PRIM_TEXGEN|PRIM_TEXGEN_DEFAULT|PRIM_TEXGEN_PLANAR|PRIM_TEXT|PRIM_TEXTURE|PRIM_TYPE|PRIM_TYPE_BOX|PRIM_TYPE_CYLINDER|PRIM_TYPE_PRISM|PRIM_TYPE_RING|PRIM_TYPE_SCULPT|PRIM_TYPE_SPHERE|PRIM_TYPE_TORUS|PRIM_TYPE_TUBE|PROFILE_NONE|PROFILE_SCRIPT_MEMORY|PSYS_PART_BF_DEST_COLOR|PSYS_PART_BF_ONE|PSYS_PART_BF_ONE_MINUS_DEST_COLOR|PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA|PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR|PSYS_PART_BF_SOURCE_ALPHA|PSYS_PART_BF_SOURCE_COLOR|PSYS_PART_BF_ZERO|PSYS_PART_BLEND_FUNC_DEST|PSYS_PART_BLEND_FUNC_SOURCE|PSYS_PART_BOUNCE_MASK|PSYS_PART_EMISSIVE_MASK|PSYS_PART_END_ALPHA|PSYS_PART_END_COLOR|PSYS_PART_END_GLOW|PSYS_PART_END_SCALE|PSYS_PART_FLAGS|PSYS_PART_FOLLOW_SRC_MASK|PSYS_PART_FOLLOW_VELOCITY_MASK|PSYS_PART_INTERP_COLOR_MASK|PSYS_PART_INTERP_SCALE_MASK|PSYS_PART_MAX_AGE|PSYS_PART_RIBBON_MASK|PSYS_PART_START_ALPHA|PSYS_PART_START_COLOR|PSYS_PART_START_GLOW|PSYS_PART_START_SCALE|PSYS_PART_TARGET_LINEAR_MASK|PSYS_PART_TARGET_POS_MASK|PSYS_PART_WIND_MASK|PSYS_SRC_ACCEL|PSYS_SRC_ANGLE_BEGIN|PSYS_SRC_ANGLE_END|PSYS_SRC_BURST_PART_COUNT|PSYS_SRC_BURST_RADIUS|PSYS_SRC_BURST_RATE|PSYS_SRC_BURST_SPEED_MAX|PSYS_SRC_BURST_SPEED_MIN|PSYS_SRC_MAX_AGE|PSYS_SRC_OMEGA|PSYS_SRC_PATTERN|PSYS_SRC_PATTERN_ANGLE|PSYS_SRC_PATTERN_ANGLE_CONE|PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY|PSYS_SRC_PATTERN_DROP|PSYS_SRC_PATTERN_EXPLODE|PSYS_SRC_TARGET_KEY|PSYS_SRC_TEXTURE|PUBLIC_CHANNEL|PURSUIT_FUZZ_FACTOR|PURSUIT_GOAL_TOLERANCE|PURSUIT_INTERCEPT|PURSUIT_OFFSET|PU_EVADE_HIDDEN|PU_EVADE_SPOTTED|PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED|PU_FAILURE_INVALID_GOAL|PU_FAILURE_INVALID_START|PU_FAILURE_NO_NAVMESH|PU_FAILURE_NO_VALID_DESTINATION|PU_FAILURE_OTHER|PU_FAILURE_PARCEL_UNREACHABLE|PU_FAILURE_TARGET_GONE|PU_FAILURE_UNREACHABLE|PU_GOAL_REACHED|PU_SLOWDOWN_DISTANCE_REACHED|RCERR_CAST_TIME_EXCEEDED|RCERR_SIM_PERF_LOW|RCERR_UNKNOWN|RC_DATA_FLAGS|RC_DETECT_PHANTOM|RC_GET_LINK_NUM|RC_GET_NORMAL|RC_GET_ROOT_KEY|RC_MAX_HITS|RC_REJECT_AGENTS|RC_REJECT_LAND|RC_REJECT_NONPHYSICAL|RC_REJECT_PHYSICAL|RC_REJECT_TYPES|REGION_FLAG_ALLOW_DAMAGE|REGION_FLAG_ALLOW_DIRECT_TELEPORT|REGION_FLAG_BLOCK_FLY|REGION_FLAG_BLOCK_TERRAFORM|REGION_FLAG_DISABLE_COLLISIONS|REGION_FLAG_DISABLE_PHYSICS|REGION_FLAG_FIXED_SUN|REGION_FLAG_RESTRICT_PUSHOBJECT|REGION_FLAG_SANDBOX|REMOTE_DATA_CHANNEL|REMOTE_DATA_REPLY|REMOTE_DATA_REQUEST|REQUIRE_LINE_OF_SIGHT|RESTITUTION|REVERSE|ROTATE|SCALE|SCRIPTED|SIM_STAT_PCT_CHARS_STEPPED|SMOOTH|STATUS_BLOCK_GRAB|STATUS_BLOCK_GRAB_OBJECT|STATUS_BOUNDS_ERROR|STATUS_CAST_SHADOWS|STATUS_DIE_AT_EDGE|STATUS_INTERNAL_ERROR|STATUS_MALFORMED_PARAMS|STATUS_NOT_FOUND|STATUS_NOT_SUPPORTED|STATUS_OK|STATUS_PHANTOM|STATUS_PHYSICS|STATUS_RETURN_AT_EDGE|STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z|STATUS_SANDBOX|STATUS_TYPE_MISMATCH|STATUS_WHITELIST_FAILED|STRING_TRIM|STRING_TRIM_HEAD|STRING_TRIM_TAIL|TOUCH_INVALID_FACE|TRAVERSAL_TYPE|TRAVERSAL_TYPE_FAST|TRAVERSAL_TYPE_NONE|TRAVERSAL_TYPE_SLOW|TRUE|TYPE_FLOAT|TYPE_INTEGER|TYPE_INVALID|TYPE_KEY|TYPE_ROTATION|TYPE_STRING|TYPE_VECTOR|VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY|VEHICLE_ANGULAR_DEFLECTION_TIMESCALE|VEHICLE_ANGULAR_FRICTION_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DIRECTION|VEHICLE_ANGULAR_MOTOR_TIMESCALE|VEHICLE_BANKING_EFFICIENCY|VEHICLE_BANKING_MIX|VEHICLE_BANKING_TIMESCALE|VEHICLE_BUOYANCY|VEHICLE_FLAG_CAMERA_DECOUPLED|VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT|VEHICLE_FLAG_HOVER_TERRAIN_ONLY|VEHICLE_FLAG_HOVER_UP_ONLY|VEHICLE_FLAG_HOVER_WATER_ONLY|VEHICLE_FLAG_LIMIT_MOTOR_UP|VEHICLE_FLAG_LIMIT_ROLL_ONLY|VEHICLE_FLAG_MOUSELOOK_BANK|VEHICLE_FLAG_MOUSELOOK_STEER|VEHICLE_FLAG_NO_DEFLECTION_UP|VEHICLE_HOVER_EFFICIENCY|VEHICLE_HOVER_HEIGHT|VEHICLE_HOVER_TIMESCALE|VEHICLE_LINEAR_DEFLECTION_EFFICIENCY|VEHICLE_LINEAR_DEFLECTION_TIMESCALE|VEHICLE_LINEAR_FRICTION_TIMESCALE|VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE|VEHICLE_LINEAR_MOTOR_DIRECTION|VEHICLE_LINEAR_MOTOR_OFFSET|VEHICLE_LINEAR_MOTOR_TIMESCALE|VEHICLE_REFERENCE_FRAME|VEHICLE_TYPE_AIRPLANE|VEHICLE_TYPE_BALLOON|VEHICLE_TYPE_BOAT|VEHICLE_TYPE_CAR|VEHICLE_TYPE_NONE|VEHICLE_TYPE_SLED|VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY|VEHICLE_VERTICAL_ATTRACTION_TIMESCALE|VERTICAL|WANDER_PAUSE_AT_WAYPOINTS|XP_ERROR_EXPERIENCES_DISABLED|XP_ERROR_EXPERIENCE_DISABLED|XP_ERROR_EXPERIENCE_SUSPENDED|XP_ERROR_INVALID_EXPERIENCE|XP_ERROR_INVALID_PARAMETERS|XP_ERROR_KEY_NOT_FOUND|XP_ERROR_MATURITY_EXCEEDED|XP_ERROR_NONE|XP_ERROR_NOT_FOUND|XP_ERROR_NOT_PERMITTED|XP_ERROR_NO_EXPERIENCE|XP_ERROR_QUOTA_EXCEEDED|XP_ERROR_RETRY_UPDATE|XP_ERROR_STORAGE_EXCEPTION|XP_ERROR_STORE_DISABLED|XP_ERROR_THROTTLED|XP_ERROR_UNKNOWN_ERROR", + "constant.language.integer.boolean.lsl" : "FALSE|TRUE", + "constant.language.quaternion.lsl" : "ZERO_ROTATION", + "constant.language.string.lsl" : "EOF|JSON_ARRAY|JSON_DELETE|JSON_FALSE|JSON_INVALID|JSON_NULL|JSON_NUMBER|JSON_OBJECT|JSON_STRING|JSON_TRUE|NULL_KEY|TEXTURE_BLANK|TEXTURE_DEFAULT|TEXTURE_MEDIA|TEXTURE_PLYWOOD|TEXTURE_TRANSPARENT|URL_REQUEST_DENIED|URL_REQUEST_GRANTED", + "constant.language.vector.lsl" : "TOUCH_INVALID_TEXCOORD|TOUCH_INVALID_VECTOR|ZERO_VECTOR", + "invalid.broken.lsl": "LAND_LARGE_BRUSH|LAND_MEDIUM_BRUSH|LAND_SMALL_BRUSH", + "invalid.deprecated.lsl" : "ATTACH_LPEC|ATTACH_RPEC|DATA_RATING|OBJECT_ATTACHMENT_GEOMETRY_BYTES|OBJECT_ATTACHMENT_SURFACE_AREA|PRIM_CAST_SHADOWS|PRIM_MATERIAL_LIGHT|PRIM_TYPE_LEGACY|PSYS_SRC_INNERANGLE|PSYS_SRC_OUTERANGLE|VEHICLE_FLAG_NO_FLY_UP|llClearExperiencePermissions|llCloud|llGetExperienceList|llMakeExplosion|llMakeFire|llMakeFountain|llMakeSmoke|llRemoteDataSetRegion|llSound|llSoundPreload|llXorBase64Strings|llXorBase64StringsCorrect", + "invalid.illegal.lsl": "event", + "invalid.unimplemented.lsl": "CHARACTER_MAX_ANGULAR_ACCEL|CHARACTER_MAX_ANGULAR_SPEED|CHARACTER_TURN_SPEED_MULTIPLIER|PERMISSION_CHANGE_JOINTS|PERMISSION_CHANGE_PERMISSIONS|PERMISSION_EXPERIENCE|PERMISSION_RELEASE_OWNERSHIP|PERMISSION_REMAP_CONTROLS|PRIM_PHYSICS_MATERIAL|PSYS_SRC_OBJ_REL_MASK|llCollisionSprite|llPointAt|llRefreshPrimURL|llReleaseCamera|llRemoteLoadScript|llSetPrimURL|llStopPointAt|llTakeCamera", + "reserved.godmode.lsl": "llGodLikeRezObject|llSetInventoryPermMask|llSetObjectPermMask", + "reserved.log.lsl" : "print", + "keyword.control.lsl" : "do|else|for|if|jump|return|while", + "storage.type.lsl" : "float|integer|key|list|quaternion|rotation|string|vector", + "support.function.lsl": "llAbs|llAcos|llAddToLandBanList|llAddToLandPassList|llAdjustSoundVolume|llAgentInExperience|llAllowInventoryDrop|llAngleBetween|llApplyImpulse|llApplyRotationalImpulse|llAsin|llAtan2|llAttachToAvatar|llAttachToAvatarTemp|llAvatarOnLinkSitTarget|llAvatarOnSitTarget|llAxes2Rot|llAxisAngle2Rot|llBase64ToInteger|llBase64ToString|llBreakAllLinks|llBreakLink|llCSV2List|llCastRay|llCeil|llClearCameraParams|llClearLinkMedia|llClearPrimMedia|llCloseRemoteDataChannel|llCollisionFilter|llCollisionSound|llCos|llCreateCharacter|llCreateKeyValue|llCreateLink|llDataSizeKeyValue|llDeleteCharacter|llDeleteKeyValue|llDeleteSubList|llDeleteSubString|llDetachFromAvatar|llDetectedGrab|llDetectedGroup|llDetectedKey|llDetectedLinkNumber|llDetectedName|llDetectedOwner|llDetectedPos|llDetectedRot|llDetectedTouchBinormal|llDetectedTouchFace|llDetectedTouchNormal|llDetectedTouchPos|llDetectedTouchST|llDetectedTouchUV|llDetectedType|llDetectedVel|llDialog|llDie|llDumpList2String|llEdgeOfWorld|llEjectFromLand|llEmail|llEscapeURL|llEuler2Rot|llEvade|llExecCharacterCmd|llFabs|llFleeFrom|llFloor|llForceMouselook|llFrand|llGenerateKey|llGetAccel|llGetAgentInfo|llGetAgentLanguage|llGetAgentList|llGetAgentSize|llGetAlpha|llGetAndResetTime|llGetAnimation|llGetAnimationList|llGetAnimationOverride|llGetAttached|llGetAttachedList|llGetBoundingBox|llGetCameraPos|llGetCameraRot|llGetCenterOfMass|llGetClosestNavPoint|llGetColor|llGetCreator|llGetDate|llGetDisplayName|llGetEnergy|llGetEnv|llGetExperienceDetails|llGetExperienceErrorMessage|llGetForce|llGetFreeMemory|llGetFreeURLs|llGetGMTclock|llGetGeometricCenter|llGetHTTPHeader|llGetInventoryCreator|llGetInventoryKey|llGetInventoryName|llGetInventoryNumber|llGetInventoryPermMask|llGetInventoryType|llGetKey|llGetLandOwnerAt|llGetLinkKey|llGetLinkMedia|llGetLinkName|llGetLinkNumber|llGetLinkNumberOfSides|llGetLinkPrimitiveParams|llGetListEntryType|llGetListLength|llGetLocalPos|llGetLocalRot|llGetMass|llGetMassMKS|llGetMaxScaleFactor|llGetMemoryLimit|llGetMinScaleFactor|llGetNextEmail|llGetNotecardLine|llGetNumberOfNotecardLines|llGetNumberOfPrims|llGetNumberOfSides|llGetObjectDesc|llGetObjectDetails|llGetObjectMass|llGetObjectName|llGetObjectPermMask|llGetObjectPrimCount|llGetOmega|llGetOwner|llGetOwnerKey|llGetParcelDetails|llGetParcelFlags|llGetParcelMaxPrims|llGetParcelMusicURL|llGetParcelPrimCount|llGetParcelPrimOwners|llGetPermissions|llGetPermissionsKey|llGetPhysicsMaterial|llGetPos|llGetPrimMediaParams|llGetPrimitiveParams|llGetRegionAgentCount|llGetRegionCorner|llGetRegionFPS|llGetRegionFlags|llGetRegionName|llGetRegionTimeDilation|llGetRootPosition|llGetRootRotation|llGetRot|llGetSPMaxMemory|llGetScale|llGetScriptName|llGetScriptState|llGetSimStats|llGetSimulatorHostname|llGetStartParameter|llGetStaticPath|llGetStatus|llGetSubString|llGetSunDirection|llGetTexture|llGetTextureOffset|llGetTextureRot|llGetTextureScale|llGetTime|llGetTimeOfDay|llGetTimestamp|llGetTorque|llGetUnixTime|llGetUsedMemory|llGetUsername|llGetVel|llGetWallclock|llGiveInventory|llGiveInventoryList|llGiveMoney|llGround|llGroundContour|llGroundNormal|llGroundRepel|llGroundSlope|llHTTPRequest|llHTTPResponse|llInsertString|llInstantMessage|llIntegerToBase64|llJson2List|llJsonGetValue|llJsonSetValue|llJsonValueType|llKey2Name|llKeyCountKeyValue|llKeysKeyValue|llLinkParticleSystem|llLinkSitTarget|llList2CSV|llList2Float|llList2Integer|llList2Json|llList2Key|llList2List|llList2ListStrided|llList2Rot|llList2String|llList2Vector|llListFindList|llListInsertList|llListRandomize|llListReplaceList|llListSort|llListStatistics|llListen|llListenControl|llListenRemove|llLoadURL|llLog|llLog10|llLookAt|llLoopSound|llLoopSoundMaster|llLoopSoundSlave|llMD5String|llManageEstateAccess|llMapDestination|llMessageLinked|llMinEventDelay|llModPow|llModifyLand|llMoveToTarget|llNavigateTo|llOffsetTexture|llOpenRemoteDataChannel|llOverMyLand|llOwnerSay|llParcelMediaCommandList|llParcelMediaQuery|llParseString2List|llParseStringKeepNulls|llParticleSystem|llPassCollisions|llPassTouches|llPatrolPoints|llPlaySound|llPlaySoundSlave|llPow|llPreloadSound|llPursue|llPushObject|llReadKeyValue|llRegionSay|llRegionSayTo|llReleaseControls|llReleaseURL|llRemoteDataReply|llRemoteLoadScriptPin|llRemoveFromLandBanList|llRemoveFromLandPassList|llRemoveInventory|llRemoveVehicleFlags|llRequestAgentData|llRequestDisplayName|llRequestExperiencePermissions|llRequestInventoryData|llRequestPermissions|llRequestSecureURL|llRequestSimulatorData|llRequestURL|llRequestUsername|llResetAnimationOverride|llResetLandBanList|llResetLandPassList|llResetOtherScript|llResetScript|llResetTime|llReturnObjectsByID|llReturnObjectsByOwner|llRezAtRoot|llRezObject|llRot2Angle|llRot2Axis|llRot2Euler|llRot2Fwd|llRot2Left|llRot2Up|llRotBetween|llRotLookAt|llRotTarget|llRotTargetRemove|llRotateTexture|llRound|llSHA1String|llSameGroup|llSay|llScaleByFactor|llScaleTexture|llScriptDanger|llScriptProfiler|llSendRemoteData|llSensor|llSensorRemove|llSensorRepeat|llSetAlpha|llSetAngularVelocity|llSetAnimationOverride|llSetBuoyancy|llSetCameraAtOffset|llSetCameraEyeOffset|llSetCameraParams|llSetClickAction|llSetColor|llSetContentType|llSetDamage|llSetForce|llSetForceAndTorque|llSetHoverHeight|llSetKeyframedMotion|llSetLinkAlpha|llSetLinkCamera|llSetLinkColor|llSetLinkMedia|llSetLinkPrimitiveParams|llSetLinkPrimitiveParamsFast|llSetLinkTexture|llSetLinkTextureAnim|llSetLocalRot|llSetMemoryLimit|llSetObjectDesc|llSetObjectName|llSetParcelMusicURL|llSetPayPrice|llSetPhysicsMaterial|llSetPos|llSetPrimMediaParams|llSetPrimitiveParams|llSetRegionPos|llSetRemoteScriptAccessPin|llSetRot|llSetScale|llSetScriptState|llSetSitText|llSetSoundQueueing|llSetSoundRadius|llSetStatus|llSetText|llSetTexture|llSetTextureAnim|llSetTimerEvent|llSetTorque|llSetTouchText|llSetVehicleFlags|llSetVehicleFloatParam|llSetVehicleRotationParam|llSetVehicleType|llSetVehicleVectorParam|llSetVelocity|llShout|llSin|llSitTarget|llSleep|llSqrt|llStartAnimation|llStopAnimation|llStopHover|llStopLookAt|llStopMoveToTarget|llStopSound|llStringLength|llStringToBase64|llStringTrim|llSubStringIndex|llTakeControls|llTan|llTarget|llTargetOmega|llTargetRemove|llTeleportAgent|llTeleportAgentGlobalCoords|llTeleportAgentHome|llTextBox|llToLower|llToUpper|llTransferLindenDollars|llTriggerSound|llTriggerSoundLimited|llUnSit|llUnescapeURL|llUpdateCharacter|llUpdateKeyValue|llVecDist|llVecMag|llVecNorm|llVolumeDetect|llWanderWithin|llWater|llWhisper|llWind|llXorBase64", + "support.function.event.lsl" : "at_rot_target|at_target|attach|changed|collision|collision_end|collision_start|control|dataserver|email|experience_permissions|experience_permissions_denied|http_request|http_response|land_collision|land_collision_end|land_collision_start|link_message|listen|money|moving_end|moving_start|no_sensor|not_at_rot_target|not_at_target|object_rez|on_rez|path_update|remote_data|run_time_permissions|sensor|state_entry|state_exit|timer|touch|touch_end|touch_start|transaction_result" + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment.line.double-slash.lsl", + regex : "\\/\\/.*$" + }, { + token : "comment.block.begin.lsl", + regex : "\\/\\*", + next : "comment" + }, { + token : "string.quoted.double.lsl", + start : '"', + end : '"', + next : [{ + token : "constant.character.escape.lsl", + regex : /\\[tn"\\]/ + }] + }, { + token : "constant.numeric.lsl", + regex : "(0[xX][0-9a-fA-F]+|[+-]?[0-9]+(?:(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)?)\\b" + }, { + token : "entity.name.state.lsl", + regex : "\\b((state)\\s+[A-Za-z_]\\w*|default)\\b" + }, { + token : keywordMapper, + regex : "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b" + }, { + token : "support.function.user-defined.lsl", + regex : /\b([a-zA-Z_]\w*)(?=\(.*?\))/ + }, { + token : "keyword.operator.lsl", + regex : "\\+\\+|\\-\\-|<<|>>|&&?|\\|\\|?|\\^|~|[!%<>=*+\\-\\/]=?" + }, { + token : "invalid.illegal.keyword.operator.lsl", + regex : ":=?" + }, { + token : "punctuation.operator.lsl", + regex : "\\,|\\;" + }, { + token : "paren.lparen.lsl", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen.lsl", + regex : "[\\]\\)\\}]" + }, { + token : "text.lsl", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment.block.end.lsl", + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment.block.lsl" + } + ] + }; + this.normalizeRules(); +} + +exports.LSLHighlightRules = LSLHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/lsl",["require","exports","module","ace/mode/lsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/text","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/lib/oop"], function(require, exports, module) { +"use strict"; + +var Rules = require("./lsl_highlight_rules").LSLHighlightRules; +var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var TextMode = require("./text").Mode; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var oop = require("../lib/oop"); + +var Mode = function() { + this.HighlightRules = Rules; + this.$outdent = new Outdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = ["//"]; + + this.blockComment = { + start: "/*", + end: "*/" + }; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type === "comment.block.lsl") { + return indent; + } + + if (state === "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/lsl"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-lua.js b/htdocs/includes/ace/mode-lua.js new file mode 100644 index 00000000000..bcf4daa5875 --- /dev/null +++ b/htdocs/includes/ace/mode-lua.js @@ -0,0 +1,424 @@ +ace.define("ace/mode/lua_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var LuaHighlightRules = function() { + + var keywords = ( + "break|do|else|elseif|end|for|function|if|in|local|repeat|"+ + "return|then|until|while|or|and|not" + ); + + var builtinConstants = ("true|false|nil|_G|_VERSION"); + + var functions = ( + "string|xpcall|package|tostring|print|os|unpack|require|"+ + "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+ + "collectgarbage|getmetatable|module|rawset|math|debug|"+ + "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+ + "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+ + "load|error|loadfile|"+ + + "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+ + "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+ + "loaders|cpath|config|path|seeall|exit|setlocale|date|"+ + "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+ + "lines|write|close|flush|open|output|type|read|stderr|"+ + "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+ + "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+ + "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+ + "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+ + "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+ + "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+ + "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+ + "status|wrap|create|running|"+ + "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+ + "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber" + ); + + var stdLibaries = ("string|package|os|io|math|debug|table|coroutine"); + + var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn"); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "support.function": functions, + "keyword.deprecated": deprecatedIn5152, + "constant.library": stdLibaries, + "constant.language": builtinConstants, + "variable.language": "self" + }, "identifier"); + + var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; + var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; + var integer = "(?:" + decimalInteger + "|" + hexInteger + ")"; + + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var floatNumber = "(?:" + pointFloat + ")"; + + this.$rules = { + "start" : [{ + stateName: "bracketedComment", + onMatch : function(value, currentState, stack){ + stack.unshift(this.next, value.length - 2, currentState); + return "comment"; + }, + regex : /\-\-\[=*\[/, + next : [ + { + onMatch : function(value, currentState, stack) { + if (value.length == stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack.shift(); + } else { + this.next = ""; + } + return "comment"; + }, + regex : /\]=*\]/, + next : "start" + }, { + defaultToken : "comment" + } + ] + }, + + { + token : "comment", + regex : "\\-\\-.*$" + }, + { + stateName: "bracketedString", + onMatch : function(value, currentState, stack){ + stack.unshift(this.next, value.length, currentState); + return "string.start"; + }, + regex : /\[=*\[/, + next : [ + { + onMatch : function(value, currentState, stack) { + if (value.length == stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack.shift(); + } else { + this.next = ""; + } + return "string.end"; + }, + + regex : /\]=*\]/, + next : "start" + }, { + defaultToken : "string" + } + ] + }, + { + token : "string", // " string + regex : '"(?:[^\\\\]|\\\\.)*?"' + }, { + token : "string", // ' string + regex : "'(?:[^\\\\]|\\\\.)*?'" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\." + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]\\)\\}]" + }, { + token : "text", + regex : "\\s+|\\w+" + } ] + }; + + this.normalizeRules(); +} + +oop.inherits(LuaHighlightRules, TextHighlightRules); + +exports.LuaHighlightRules = LuaHighlightRules; +}); + +ace.define("ace/mode/folding/lua",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; +var TokenIterator = require("../../token_iterator").TokenIterator; + + +var FoldMode = exports.FoldMode = function() {}; + +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /\b(function|then|do|repeat)\b|{\s*$|(\[=*\[)/; + this.foldingStopMarker = /\bend\b|^\s*}|\]=*\]/; + + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var isStart = this.foldingStartMarker.test(line); + var isEnd = this.foldingStopMarker.test(line); + + if (isStart && !isEnd) { + var match = line.match(this.foldingStartMarker); + if (match[1] == "then" && /\belseif\b/.test(line)) + return; + if (match[1]) { + if (session.getTokenAt(row, match.index + 1).type === "keyword") + return "start"; + } else if (match[2]) { + var type = session.bgTokenizer.getState(row) || ""; + if (type[0] == "bracketedComment" || type[0] == "bracketedString") + return "start"; + } else { + return "start"; + } + } + if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd) + return ""; + + var match = line.match(this.foldingStopMarker); + if (match[0] === "end") { + if (session.getTokenAt(row, match.index + 1).type === "keyword") + return "end"; + } else if (match[0][0] === "]") { + var type = session.bgTokenizer.getState(row - 1) || ""; + if (type[0] == "bracketedComment" || type[0] == "bracketedString") + return "end"; + } else + return "end"; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.doc.getLine(row); + var match = this.foldingStartMarker.exec(line); + if (match) { + if (match[1]) + return this.luaBlock(session, row, match.index + 1); + + if (match[2]) + return session.getCommentFoldRange(row, match.index + 1); + + return this.openingBracketBlock(session, "{", row, match.index); + } + + var match = this.foldingStopMarker.exec(line); + if (match) { + if (match[0] === "end") { + if (session.getTokenAt(row, match.index + 1).type === "keyword") + return this.luaBlock(session, row, match.index + 1); + } + + if (match[0][0] === "]") + return session.getCommentFoldRange(row, match.index + 1); + + return this.closingBracketBlock(session, "}", row, match.index + match[0].length); + } + }; + + this.luaBlock = function(session, row, column) { + var stream = new TokenIterator(session, row, column); + var indentKeywords = { + "function": 1, + "do": 1, + "then": 1, + "elseif": -1, + "end": -1, + "repeat": 1, + "until": -1 + }; + + var token = stream.getCurrentToken(); + if (!token || token.type != "keyword") + return; + + var val = token.value; + var stack = [val]; + var dir = indentKeywords[val]; + + if (!dir) + return; + + var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length; + var startRow = row; + + stream.step = dir === -1 ? stream.stepBackward : stream.stepForward; + while(token = stream.step()) { + if (token.type !== "keyword") + continue; + var level = dir * indentKeywords[token.value]; + + if (level > 0) { + stack.unshift(token.value); + } else if (level <= 0) { + stack.shift(); + if (!stack.length && token.value != "elseif") + break; + if (level === 0) + stack.unshift(token.value); + } + } + + var row = stream.getCurrentTokenRow(); + if (dir === -1) + return new Range(row, session.getLine(row).length, startRow, startColumn); + else + return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn()); + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/lua",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lua_highlight_rules","ace/mode/folding/lua","ace/range","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; +var LuaFoldMode = require("./folding/lua").FoldMode; +var Range = require("../range").Range; +var WorkerClient = require("../worker/worker_client").WorkerClient; + +var Mode = function() { + this.HighlightRules = LuaHighlightRules; + + this.foldingRules = new LuaFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "--"; + this.blockComment = {start: "--[", end: "]--"}; + + var indentKeywords = { + "function": 1, + "then": 1, + "do": 1, + "else": 1, + "elseif": 1, + "repeat": 1, + "end": -1, + "until": -1 + }; + var outdentKeywords = [ + "else", + "elseif", + "end", + "until" + ]; + + function getNetIndentLevel(tokens) { + var level = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (token.type == "keyword") { + if (token.value in indentKeywords) { + level += indentKeywords[token.value]; + } + } else if (token.type == "paren.lparen") { + level += token.value.length; + } else if (token.type == "paren.rparen") { + level -= token.value.length; + } + } + if (level < 0) { + return -1; + } else if (level > 0) { + return 1; + } else { + return 0; + } + } + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var level = 0; + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (state == "start") { + level = getNetIndentLevel(tokens); + } + if (level > 0) { + return indent + tab; + } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) { + if (!this.checkOutdent(state, line, "\n")) { + return indent.substr(0, indent.length - tab.length); + } + } + return indent; + }; + + this.checkOutdent = function(state, line, input) { + if (input != "\n" && input != "\r" && input != "\r\n") + return false; + + if (line.match(/^\s*[\)\}\]]$/)) + return true; + + var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + + if (!tokens || !tokens.length) + return false; + + return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1); + }; + + this.autoOutdent = function(state, session, row) { + var prevLine = session.getLine(row - 1); + var prevIndent = this.$getIndent(prevLine).length; + var prevTokens = this.getTokenizer().getLineTokens(prevLine, "start").tokens; + var tabLength = session.getTabString().length; + var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens); + var curIndent = this.$getIndent(session.getLine(row)).length; + if (curIndent <= expectedIndent) { + return; + } + session.outdentRows(new Range(row, 0, row + 2, 0)); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/lua_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/lua"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-luapage.js b/htdocs/includes/ace/mode-luapage.js new file mode 100644 index 00000000000..be6b0922450 --- /dev/null +++ b/htdocs/includes/ace/mode-luapage.js @@ -0,0 +1,2978 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/lua_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var LuaHighlightRules = function() { + + var keywords = ( + "break|do|else|elseif|end|for|function|if|in|local|repeat|"+ + "return|then|until|while|or|and|not" + ); + + var builtinConstants = ("true|false|nil|_G|_VERSION"); + + var functions = ( + "string|xpcall|package|tostring|print|os|unpack|require|"+ + "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+ + "collectgarbage|getmetatable|module|rawset|math|debug|"+ + "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+ + "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+ + "load|error|loadfile|"+ + + "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+ + "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+ + "loaders|cpath|config|path|seeall|exit|setlocale|date|"+ + "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+ + "lines|write|close|flush|open|output|type|read|stderr|"+ + "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+ + "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+ + "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+ + "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+ + "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+ + "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+ + "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+ + "status|wrap|create|running|"+ + "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+ + "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber" + ); + + var stdLibaries = ("string|package|os|io|math|debug|table|coroutine"); + + var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn"); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "support.function": functions, + "keyword.deprecated": deprecatedIn5152, + "constant.library": stdLibaries, + "constant.language": builtinConstants, + "variable.language": "self" + }, "identifier"); + + var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; + var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; + var integer = "(?:" + decimalInteger + "|" + hexInteger + ")"; + + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var floatNumber = "(?:" + pointFloat + ")"; + + this.$rules = { + "start" : [{ + stateName: "bracketedComment", + onMatch : function(value, currentState, stack){ + stack.unshift(this.next, value.length - 2, currentState); + return "comment"; + }, + regex : /\-\-\[=*\[/, + next : [ + { + onMatch : function(value, currentState, stack) { + if (value.length == stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack.shift(); + } else { + this.next = ""; + } + return "comment"; + }, + regex : /\]=*\]/, + next : "start" + }, { + defaultToken : "comment" + } + ] + }, + + { + token : "comment", + regex : "\\-\\-.*$" + }, + { + stateName: "bracketedString", + onMatch : function(value, currentState, stack){ + stack.unshift(this.next, value.length, currentState); + return "string.start"; + }, + regex : /\[=*\[/, + next : [ + { + onMatch : function(value, currentState, stack) { + if (value.length == stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack.shift(); + } else { + this.next = ""; + } + return "string.end"; + }, + + regex : /\]=*\]/, + next : "start" + }, { + defaultToken : "string" + } + ] + }, + { + token : "string", // " string + regex : '"(?:[^\\\\]|\\\\.)*?"' + }, { + token : "string", // ' string + regex : "'(?:[^\\\\]|\\\\.)*?'" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\." + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]\\)\\}]" + }, { + token : "text", + regex : "\\s+|\\w+" + } ] + }; + + this.normalizeRules(); +} + +oop.inherits(LuaHighlightRules, TextHighlightRules); + +exports.LuaHighlightRules = LuaHighlightRules; +}); + +ace.define("ace/mode/folding/lua",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; +var TokenIterator = require("../../token_iterator").TokenIterator; + + +var FoldMode = exports.FoldMode = function() {}; + +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /\b(function|then|do|repeat)\b|{\s*$|(\[=*\[)/; + this.foldingStopMarker = /\bend\b|^\s*}|\]=*\]/; + + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var isStart = this.foldingStartMarker.test(line); + var isEnd = this.foldingStopMarker.test(line); + + if (isStart && !isEnd) { + var match = line.match(this.foldingStartMarker); + if (match[1] == "then" && /\belseif\b/.test(line)) + return; + if (match[1]) { + if (session.getTokenAt(row, match.index + 1).type === "keyword") + return "start"; + } else if (match[2]) { + var type = session.bgTokenizer.getState(row) || ""; + if (type[0] == "bracketedComment" || type[0] == "bracketedString") + return "start"; + } else { + return "start"; + } + } + if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd) + return ""; + + var match = line.match(this.foldingStopMarker); + if (match[0] === "end") { + if (session.getTokenAt(row, match.index + 1).type === "keyword") + return "end"; + } else if (match[0][0] === "]") { + var type = session.bgTokenizer.getState(row - 1) || ""; + if (type[0] == "bracketedComment" || type[0] == "bracketedString") + return "end"; + } else + return "end"; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.doc.getLine(row); + var match = this.foldingStartMarker.exec(line); + if (match) { + if (match[1]) + return this.luaBlock(session, row, match.index + 1); + + if (match[2]) + return session.getCommentFoldRange(row, match.index + 1); + + return this.openingBracketBlock(session, "{", row, match.index); + } + + var match = this.foldingStopMarker.exec(line); + if (match) { + if (match[0] === "end") { + if (session.getTokenAt(row, match.index + 1).type === "keyword") + return this.luaBlock(session, row, match.index + 1); + } + + if (match[0][0] === "]") + return session.getCommentFoldRange(row, match.index + 1); + + return this.closingBracketBlock(session, "}", row, match.index + match[0].length); + } + }; + + this.luaBlock = function(session, row, column) { + var stream = new TokenIterator(session, row, column); + var indentKeywords = { + "function": 1, + "do": 1, + "then": 1, + "elseif": -1, + "end": -1, + "repeat": 1, + "until": -1 + }; + + var token = stream.getCurrentToken(); + if (!token || token.type != "keyword") + return; + + var val = token.value; + var stack = [val]; + var dir = indentKeywords[val]; + + if (!dir) + return; + + var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length; + var startRow = row; + + stream.step = dir === -1 ? stream.stepBackward : stream.stepForward; + while(token = stream.step()) { + if (token.type !== "keyword") + continue; + var level = dir * indentKeywords[token.value]; + + if (level > 0) { + stack.unshift(token.value); + } else if (level <= 0) { + stack.shift(); + if (!stack.length && token.value != "elseif") + break; + if (level === 0) + stack.unshift(token.value); + } + } + + var row = stream.getCurrentTokenRow(); + if (dir === -1) + return new Range(row, session.getLine(row).length, startRow, startColumn); + else + return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn()); + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/lua",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lua_highlight_rules","ace/mode/folding/lua","ace/range","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; +var LuaFoldMode = require("./folding/lua").FoldMode; +var Range = require("../range").Range; +var WorkerClient = require("../worker/worker_client").WorkerClient; + +var Mode = function() { + this.HighlightRules = LuaHighlightRules; + + this.foldingRules = new LuaFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "--"; + this.blockComment = {start: "--[", end: "]--"}; + + var indentKeywords = { + "function": 1, + "then": 1, + "do": 1, + "else": 1, + "elseif": 1, + "repeat": 1, + "end": -1, + "until": -1 + }; + var outdentKeywords = [ + "else", + "elseif", + "end", + "until" + ]; + + function getNetIndentLevel(tokens) { + var level = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (token.type == "keyword") { + if (token.value in indentKeywords) { + level += indentKeywords[token.value]; + } + } else if (token.type == "paren.lparen") { + level += token.value.length; + } else if (token.type == "paren.rparen") { + level -= token.value.length; + } + } + if (level < 0) { + return -1; + } else if (level > 0) { + return 1; + } else { + return 0; + } + } + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var level = 0; + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (state == "start") { + level = getNetIndentLevel(tokens); + } + if (level > 0) { + return indent + tab; + } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) { + if (!this.checkOutdent(state, line, "\n")) { + return indent.substr(0, indent.length - tab.length); + } + } + return indent; + }; + + this.checkOutdent = function(state, line, input) { + if (input != "\n" && input != "\r" && input != "\r\n") + return false; + + if (line.match(/^\s*[\)\}\]]$/)) + return true; + + var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + + if (!tokens || !tokens.length) + return false; + + return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1); + }; + + this.autoOutdent = function(state, session, row) { + var prevLine = session.getLine(row - 1); + var prevIndent = this.$getIndent(prevLine).length; + var prevTokens = this.getTokenizer().getLineTokens(prevLine, "start").tokens; + var tabLength = session.getTabString().length; + var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens); + var curIndent = this.$getIndent(session.getLine(row)).length; + if (curIndent <= expectedIndent) { + return; + } + session.outdentRows(new Range(row, 0, row + 2, 0)); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/lua_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/lua"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/luapage_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/lua_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; + +var LuaPageHighlightRules = function() { + HtmlHighlightRules.call(this); + + var startRules = [ + { + token: "keyword", + regex: "<\\%\\=?", + push: "lua-start" + }, { + token: "keyword", + regex: "<\\?lua\\=?", + push: "lua-start" + } + ]; + + var endRules = [ + { + token: "keyword", + regex: "\\%>", + next: "pop" + }, { + token: "keyword", + regex: "\\?>", + next: "pop" + } + ]; + + this.embedRules(LuaHighlightRules, "lua-", endRules, ["start"]); + + for (var key in this.$rules) + this.$rules[key].unshift.apply(this.$rules[key], startRules); + + this.normalizeRules(); +}; + +oop.inherits(LuaPageHighlightRules, HtmlHighlightRules); + +exports.LuaPageHighlightRules = LuaPageHighlightRules; + +}); + +ace.define("ace/mode/luapage",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/lua","ace/mode/luapage_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var LuaMode = require("./lua").Mode; +var LuaPageHighlightRules = require("./luapage_highlight_rules").LuaPageHighlightRules; + +var Mode = function() { + HtmlMode.call(this); + + this.HighlightRules = LuaPageHighlightRules; + this.createModeDelegates({ + "lua-": LuaMode + }); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + this.$id = "ace/mode/luapage"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-lucene.js b/htdocs/includes/ace/mode-lucene.js new file mode 100644 index 00000000000..b830b7ae32e --- /dev/null +++ b/htdocs/includes/ace/mode-lucene.js @@ -0,0 +1,70 @@ +ace.define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var LuceneHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "constant.character.negation", + regex : "[\\-]" + }, { + token : "constant.character.interro", + regex : "[\\?]" + }, { + token : "constant.character.asterisk", + regex : "[\\*]" + }, { + token: 'constant.character.proximity', + regex: '~[0-9]+\\b' + }, { + token : 'keyword.operator', + regex: '(?:AND|OR|NOT)\\b' + }, { + token : "paren.lparen", + regex : "[\\(]" + }, { + token : "paren.rparen", + regex : "[\\)]" + }, { + token : "keyword", + regex : "[\\S]+:" + }, { + token : "string", // " string + regex : '".*?"' + }, { + token : "text", + regex : "\\s+" + } + ] + }; +}; + +oop.inherits(LuceneHighlightRules, TextHighlightRules); + +exports.LuceneHighlightRules = LuceneHighlightRules; +}); + +ace.define("ace/mode/lucene",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lucene_highlight_rules"], function(require, exports, module) { +'use strict'; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules; + +var Mode = function() { + this.HighlightRules = LuceneHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; + +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/lucene"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-makefile.js b/htdocs/includes/ace/mode-makefile.js new file mode 100644 index 00000000000..cc6fc653e28 --- /dev/null +++ b/htdocs/includes/ace/mode-makefile.js @@ -0,0 +1,404 @@ +ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var reservedKeywords = exports.reservedKeywords = ( + '!|{|}|case|do|done|elif|else|'+ + 'esac|fi|for|if|in|then|until|while|'+ + '&|;|export|local|read|typeset|unset|'+ + 'elif|select|set|function|declare|readonly' + ); + +var languageConstructs = exports.languageConstructs = ( + '[|]|alias|bg|bind|break|builtin|'+ + 'cd|command|compgen|complete|continue|'+ + 'dirs|disown|echo|enable|eval|exec|'+ + 'exit|fc|fg|getopts|hash|help|history|'+ + 'jobs|kill|let|logout|popd|printf|pushd|'+ + 'pwd|return|set|shift|shopt|source|'+ + 'suspend|test|times|trap|type|ulimit|'+ + 'umask|unalias|wait' +); + +var ShHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "keyword": reservedKeywords, + "support.function.builtin": languageConstructs, + "invalid.deprecated": "debugger" + }, "identifier"); + + var integer = "(?:(?:[1-9]\\d*)|(?:0))"; + + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + var fileDescriptor = "(?:&" + intPart + ")"; + + var variableName = "[a-zA-Z_][a-zA-Z0-9_]*"; + var variable = "(?:" + variableName + "=)"; + + var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))"; + + var func = "(?:" + variableName + "\\s*\\(\\))"; + + this.$rules = { + "start" : [{ + token : "constant", + regex : /\\./ + }, { + token : ["text", "comment"], + regex : /(^|\s)(#.*)$/ + }, { + token : "string.start", + regex : '"', + push : [{ + token : "constant.language.escape", + regex : /\\(?:[$`"\\]|$)/ + }, { + include : "variables" + }, { + token : "keyword.operator", + regex : /`/ // TODO highlight ` + }, { + token : "string.end", + regex : '"', + next: "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string", + regex : "\\$'", + push : [{ + token : "constant.language.escape", + regex : /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/ + }, { + token : "string", + regex : "'", + next: "pop" + }, { + defaultToken: "string" + }] + }, { + regex : "<<<", + token : "keyword.operator" + }, { + stateName: "heredoc", + regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)", + onMatch : function(value, currentState, stack) { + var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; + var tokens = value.split(this.splitRegex); + stack.push(next, tokens[4]); + return [ + {type:"constant", value: tokens[1]}, + {type:"text", value: tokens[2]}, + {type:"string", value: tokens[3]}, + {type:"support.class", value: tokens[4]}, + {type:"string", value: tokens[5]} + ]; + }, + rules: { + heredoc: [{ + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^\t+" + }, { + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }] + } + }, { + regex : "$", + token : "empty", + next : function(currentState, stack) { + if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") + return stack[0]; + return currentState; + } + }, { + token : ["keyword", "text", "text", "text", "variable"], + regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/ + }, { + token : "variable.language", + regex : builtinVariable + }, { + token : "variable", + regex : variable + }, { + include : "variables" + }, { + token : "support.function", + regex : func + }, { + token : "support.function", + regex : fileDescriptor + }, { + token : "string", // ' string + start : "'", end : "'" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]" + }, { + token : "punctuation.operator", + regex : ";" + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]]" + }, { + token : "paren.rparen", + regex : "[\\)\\}]", + next : "pop" + }], + variables: [{ + token : "variable", + regex : /(\$)(\w+)/ + }, { + token : ["variable", "paren.lparen"], + regex : /(\$)(\()/, + push : "start" + }, { + token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"], + regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/, + push : "start" + }, { + token : "variable", + regex : /\$[*@#?\-$!0_]/ + }, { + token : ["variable", "paren.lparen"], + regex : /(\$)(\{)/, + push : "start" + }] + }; + + this.normalizeRules(); +}; + +oop.inherits(ShHighlightRules, TextHighlightRules); + +exports.ShHighlightRules = ShHighlightRules; +}); + +ace.define("ace/mode/makefile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/sh_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ShHighlightFile = require("./sh_highlight_rules"); + +var MakefileHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "keyword": ShHighlightFile.reservedKeywords, + "support.function.builtin": ShHighlightFile.languageConstructs, + "invalid.deprecated": "debugger" + }, "string"); + + this.$rules = + { + "start": [ + { + token: "string.interpolated.backtick.makefile", + regex: "`", + next: "shell-start" + }, + { + token: "punctuation.definition.comment.makefile", + regex: /#(?=.)/, + next: "comment" + }, + { + token: [ "keyword.control.makefile"], + regex: "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)" + }, + {// ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.* + token: ["entity.name.function.makefile", "text"], + regex: "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)" + } + ], + "comment": [ + { + token : "punctuation.definition.comment.makefile", + regex : /.+\\/ + }, + { + token : "punctuation.definition.comment.makefile", + regex : ".+", + next : "start" + } + ], + "shell-start": [ + { + token: keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, + { + token: "string", + regex : "\\w+" + }, + { + token : "string.interpolated.backtick.makefile", + regex : "`", + next : "start" + } + ] +} + +}; + +oop.inherits(MakefileHighlightRules, TextHighlightRules); + +exports.MakefileHighlightRules = MakefileHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/makefile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/makefile_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = MakefileHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "#"; + this.$indentWithTabs = true; + + this.$id = "ace/mode/makefile"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-markdown.js b/htdocs/includes/ace/mode-markdown.js new file mode 100644 index 00000000000..51df9be7f79 --- /dev/null +++ b/htdocs/includes/ace/mode-markdown.js @@ -0,0 +1,2865 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var XmlFoldMode = require("./folding/xml").FoldMode; +var WorkerClient = require("../worker/worker_client").WorkerClient; + +var Mode = function() { + this.HighlightRules = XmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.foldingRules = new XmlFoldMode(); +}; + +oop.inherits(Mode, TextMode); + +(function() { + + this.voidElements = lang.arrayToMap([]); + + this.blockComment = {start: ""}; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/xml"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(defaultMode, subModes) { + this.defaultMode = defaultMode; + this.subModes = subModes; +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + + this.$getMode = function(state) { + if (typeof state != "string") + state = state[0]; + for (var key in this.subModes) { + if (state.indexOf(key) === 0) + return this.subModes[key]; + } + return null; + }; + + this.$tryMode = function(state, session, foldStyle, row) { + var mode = this.$getMode(state); + return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); + }; + + this.getFoldWidget = function(session, foldStyle, row) { + return ( + this.$tryMode(session.getState(row-1), session, foldStyle, row) || + this.$tryMode(session.getState(row), session, foldStyle, row) || + this.defaultMode.getFoldWidget(session, foldStyle, row) + ); + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var mode = this.$getMode(session.getState(row-1)); + + if (!mode || !mode.getFoldWidget(session, foldStyle, row)) + mode = this.$getMode(session.getState(row)); + + if (!mode || !mode.getFoldWidget(session, foldStyle, row)) + mode = this.defaultMode; + + return mode.getFoldWidgetRange(session, foldStyle, row); + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; + +var escaped = function(ch) { + return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*"; +} + +function github_embed(tag, prefix) { + return { // Github style block + token : "support.function", + regex : "^\\s*```" + tag + "\\s*$", + push : prefix + "start" + }; +} + +var MarkdownHighlightRules = function() { + HtmlHighlightRules.call(this); + + this.$rules["start"].unshift({ + token : "empty_line", + regex : '^$', + next: "allowBlock" + }, { // h1 + token: "markup.heading.1", + regex: "^=+(?=\\s*$)" + }, { // h2 + token: "markup.heading.2", + regex: "^\\-+(?=\\s*$)" + }, { + token : function(value) { + return "markup.heading." + value.length; + }, + regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/, + next : "header" + }, + github_embed("(?:javascript|js)", "jscode-"), + github_embed("xml", "xmlcode-"), + github_embed("html", "htmlcode-"), + github_embed("css", "csscode-"), + { // Github style block + token : "support.function", + regex : "^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$", + next : "githubblock" + }, { // block quote + token : "string.blockquote", + regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", + next : "blockquote" + }, { // HR * - _ + token : "constant", + regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$", + next: "allowBlock" + }, { // list + token : "markup.list", + regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", + next : "listblock-start" + }, { + include : "basic" + }); + + this.addRules({ + "basic" : [{ + token : "constant.language.escape", + regex : /\\[\\`*_{}\[\]()#+\-.!]/ + }, { // code span ` + token : "support.function", + regex : "(`+)(.*?[^`])(\\1)" + }, { // reference + token : ["text", "constant", "text", "url", "string", "text"], + regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" + }, { // link by reference + token : ["text", "string", "text", "constant", "text"], + regex : "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)("+ escaped("]") + ")(\\])" + }, { // link by url + token : ["text", "string", "text", "markup.underline", "string", "text"], + regex : "(\\[)(" + // [ + escaped("]") + // link text + ")(\\]\\()"+ // ]( + '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href + '(\\s*"' + escaped('"') + '"\\s*)?' + // "title" + "(\\))" // ) + }, { // strong ** __ + token : "string.strong", + regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" + }, { // emphasis * _ + token : "string.emphasis", + regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" + }, { // + token : ["text", "url", "text"], + regex : "(<)("+ + "(?:https?|ftp|dict):[^'\">\\s]+"+ + "|"+ + "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+ + ")(>)" + }], + "allowBlock": [ + {token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, + {token : "empty_line", regex : '^$', next: "allowBlock"}, + {token : "empty", regex : "", next : "start"} + ], + + "header" : [{ + regex: "$", + next : "start" + }, { + include: "basic" + }, { + defaultToken : "heading" + } ], + + "listblock-start" : [{ + token : "support.variable", + regex : /(?:\[[ x]\])?/, + next : "listblock" + }], + + "listblock" : [ { // Lists only escape on completely blank lines. + token : "empty_line", + regex : "^$", + next : "start" + }, { // list + token : "markup.list", + regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", + next : "listblock-start" + }, { + include : "basic", noEscape: true + }, { // Github style block + token : "support.function", + regex : "^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$", + next : "githubblock" + }, { + defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly + } ], + + "blockquote" : [ { // Blockquotes only escape on blank lines. + token : "empty_line", + regex : "^\\s*$", + next : "start" + }, { // block quote + token : "string.blockquote", + regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", + next : "blockquote" + }, { + include : "basic", noEscape: true + }, { + defaultToken : "string.blockquote" + } ], + + "githubblock" : [ { + token : "support.function", + regex : "^\\s*```", + next : "start" + }, { + defaultToken : "support.function" + } ] + }); + + this.embedRules(JavaScriptHighlightRules, "jscode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(HtmlHighlightRules, "htmlcode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(CssHighlightRules, "csscode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(XmlHighlightRules, "xmlcode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.normalizeRules(); +}; +oop.inherits(MarkdownHighlightRules, TextHighlightRules); + +exports.MarkdownHighlightRules = MarkdownHighlightRules; +}); + +ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + this.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/; + + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + if (!this.foldingStartMarker.test(line)) + return ""; + + if (line[0] == "`") { + if (session.bgTokenizer.getState(row) == "start") + return "end"; + return "start"; + } + + return "start"; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + if (!line.match(this.foldingStartMarker)) + return; + + if (line[0] == "`") { + if (session.bgTokenizer.getState(row) !== "start") { + while (++row < maxRow) { + line = session.getLine(row); + if (line[0] == "`" & line.substring(0, 3) == "```") + break; + } + return new Range(startRow, startColumn, row, 0); + } else { + while (row -- > 0) { + line = session.getLine(row); + if (line[0] == "`" & line.substring(0, 3) == "```") + break; + } + return new Range(row, line.length, startRow, 0); + } + } + + var token; + function isHeading(row) { + token = session.getTokens(row)[0]; + return token && token.type.lastIndexOf(heading, 0) === 0; + } + + var heading = "markup.heading"; + function getLevel() { + var ch = token.value[0]; + if (ch == "=") return 6; + if (ch == "-") return 5; + return 7 - token.value.search(/[^#]/); + } + + if (isHeading(row)) { + var startHeadingLevel = getLevel(); + while (++row < maxRow) { + if (!isHeading(row)) + continue; + var level = getLevel(); + if (level >= startHeadingLevel) + break; + } + + endRow = row - (!token || ["=", "-"].indexOf(token.value[0]) == -1 ? 1 : 2); + + if (endRow > startRow) { + while (endRow > startRow && /^\s*$/.test(session.getLine(endRow))) + endRow--; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var XmlMode = require("./xml").Mode; +var HtmlMode = require("./html").Mode; +var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules; +var MarkdownFoldMode = require("./folding/markdown").FoldMode; + +var Mode = function() { + this.HighlightRules = MarkdownHighlightRules; + + this.createModeDelegates({ + "js-": JavaScriptMode, + "xml-": XmlMode, + "html-": HtmlMode + }); + + this.foldingRules = new MarkdownFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.type = "text"; + this.blockComment = {start: ""}; + + this.getNextLineIndent = function(state, line, tab) { + if (state == "listblock") { + var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line); + if (!match) + return ""; + var marker = match[2]; + if (!marker) + marker = parseInt(match[3], 10) + 1 + "."; + return match[1] + marker + match[4]; + } else { + return this.$getIndent(line); + } + }; + this.$id = "ace/mode/markdown"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-mask.js b/htdocs/includes/ace/mode-mask.js new file mode 100644 index 00000000000..983d02f8647 --- /dev/null +++ b/htdocs/includes/ace/mode-mask.js @@ -0,0 +1,1786 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; + +var escaped = function(ch) { + return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*"; +} + +function github_embed(tag, prefix) { + return { // Github style block + token : "support.function", + regex : "^\\s*```" + tag + "\\s*$", + push : prefix + "start" + }; +} + +var MarkdownHighlightRules = function() { + HtmlHighlightRules.call(this); + + this.$rules["start"].unshift({ + token : "empty_line", + regex : '^$', + next: "allowBlock" + }, { // h1 + token: "markup.heading.1", + regex: "^=+(?=\\s*$)" + }, { // h2 + token: "markup.heading.2", + regex: "^\\-+(?=\\s*$)" + }, { + token : function(value) { + return "markup.heading." + value.length; + }, + regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/, + next : "header" + }, + github_embed("(?:javascript|js)", "jscode-"), + github_embed("xml", "xmlcode-"), + github_embed("html", "htmlcode-"), + github_embed("css", "csscode-"), + { // Github style block + token : "support.function", + regex : "^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$", + next : "githubblock" + }, { // block quote + token : "string.blockquote", + regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", + next : "blockquote" + }, { // HR * - _ + token : "constant", + regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$", + next: "allowBlock" + }, { // list + token : "markup.list", + regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", + next : "listblock-start" + }, { + include : "basic" + }); + + this.addRules({ + "basic" : [{ + token : "constant.language.escape", + regex : /\\[\\`*_{}\[\]()#+\-.!]/ + }, { // code span ` + token : "support.function", + regex : "(`+)(.*?[^`])(\\1)" + }, { // reference + token : ["text", "constant", "text", "url", "string", "text"], + regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" + }, { // link by reference + token : ["text", "string", "text", "constant", "text"], + regex : "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)("+ escaped("]") + ")(\\])" + }, { // link by url + token : ["text", "string", "text", "markup.underline", "string", "text"], + regex : "(\\[)(" + // [ + escaped("]") + // link text + ")(\\]\\()"+ // ]( + '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href + '(\\s*"' + escaped('"') + '"\\s*)?' + // "title" + "(\\))" // ) + }, { // strong ** __ + token : "string.strong", + regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" + }, { // emphasis * _ + token : "string.emphasis", + regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" + }, { // + token : ["text", "url", "text"], + regex : "(<)("+ + "(?:https?|ftp|dict):[^'\">\\s]+"+ + "|"+ + "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+ + ")(>)" + }], + "allowBlock": [ + {token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, + {token : "empty_line", regex : '^$', next: "allowBlock"}, + {token : "empty", regex : "", next : "start"} + ], + + "header" : [{ + regex: "$", + next : "start" + }, { + include: "basic" + }, { + defaultToken : "heading" + } ], + + "listblock-start" : [{ + token : "support.variable", + regex : /(?:\[[ x]\])?/, + next : "listblock" + }], + + "listblock" : [ { // Lists only escape on completely blank lines. + token : "empty_line", + regex : "^$", + next : "start" + }, { // list + token : "markup.list", + regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", + next : "listblock-start" + }, { + include : "basic", noEscape: true + }, { // Github style block + token : "support.function", + regex : "^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$", + next : "githubblock" + }, { + defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly + } ], + + "blockquote" : [ { // Blockquotes only escape on blank lines. + token : "empty_line", + regex : "^\\s*$", + next : "start" + }, { // block quote + token : "string.blockquote", + regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", + next : "blockquote" + }, { + include : "basic", noEscape: true + }, { + defaultToken : "string.blockquote" + } ], + + "githubblock" : [ { + token : "support.function", + regex : "^\\s*```", + next : "start" + }, { + defaultToken : "support.function" + } ] + }); + + this.embedRules(JavaScriptHighlightRules, "jscode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(HtmlHighlightRules, "htmlcode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(CssHighlightRules, "csscode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.embedRules(XmlHighlightRules, "xmlcode-", [{ + token : "support.function", + regex : "^\\s*```", + next : "pop" + }]); + + this.normalizeRules(); +}; +oop.inherits(MarkdownHighlightRules, TextHighlightRules); + +exports.MarkdownHighlightRules = MarkdownHighlightRules; +}); + +ace.define("ace/mode/mask_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/css_highlight_rules","ace/mode/markdown_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +exports.MaskHighlightRules = MaskHighlightRules; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextRules = require("./text_highlight_rules").TextHighlightRules; +var JSRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var CssRules = require("./css_highlight_rules").CssHighlightRules; +var MDRules = require("./markdown_highlight_rules").MarkdownHighlightRules; +var HTMLRules = require("./html_highlight_rules").HtmlHighlightRules; + +var token_TAG = "keyword.support.constant.language", + token_COMPO = "support.function.markup.bold", + token_KEYWORD = "keyword", + token_LANG = "constant.language", + token_UTIL = "keyword.control.markup.italic", + token_ATTR = "support.variable.class", + token_PUNKT = "keyword.operator", + token_ITALIC = "markup.italic", + token_BOLD = "markup.bold", + token_LPARE = "paren.lparen", + token_RPARE = "paren.rparen"; + +var const_FUNCTIONS, + const_KEYWORDS, + const_CONST, + const_TAGS; +(function(){ + const_FUNCTIONS = lang.arrayToMap( + ("log").split("|") + ); + const_CONST = lang.arrayToMap( + (":dualbind|:bind|:import|slot|event|style|html|markdown|md").split("|") + ); + const_KEYWORDS = lang.arrayToMap( + ("debugger|define|var|if|each|for|of|else|switch|case|with|visible|+if|+each|+for|+switch|+with|+visible|include|import").split("|") + ); + const_TAGS = lang.arrayToMap( + ("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" + + "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" + + "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" + + "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" + + "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" + + "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" + + "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" + + "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" + + "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|") + ); +}()); + +function MaskHighlightRules () { + + this.$rules = { + "start" : [ + Token("comment", "\\/\\/.*$"), + Token("comment", "\\/\\*", [ + Token("comment", ".*?\\*\\/", "start"), + Token("comment", ".+") + ]), + + Blocks.string("'''"), + Blocks.string('"""'), + Blocks.string('"'), + Blocks.string("'"), + + Blocks.syntax(/(markdown|md)\b/, "md-multiline", "multiline"), + Blocks.syntax(/html\b/, "html-multiline", "multiline"), + Blocks.syntax(/(slot|event)\b/, "js-block", "block"), + Blocks.syntax(/style\b/, "css-block", "block"), + Blocks.syntax(/var\b/, "js-statement", "attr"), + + Blocks.tag(), + + Token(token_LPARE, "[[({>]"), + Token(token_RPARE, "[\\])};]", "start"), + { + caseInsensitive: true + } + ] + }; + var rules = this; + + addJavaScript("interpolation", /\]/, token_RPARE + "." + token_ITALIC); + addJavaScript("statement", /\)|}|;/); + addJavaScript("block", /\}/); + addCss(); + addMarkdown(); + addHtml(); + + function addJavaScript(name, escape, closeType) { + var prfx = "js-" + name + "-", + rootTokens = name === "block" ? ["start"] : ["start", "no_regex"]; + add( + JSRules + , prfx + , escape + , rootTokens + , closeType + ); + } + function addCss() { + add(CssRules, "css-block-", /\}/); + } + function addMarkdown() { + add(MDRules, "md-multiline-", /("""|''')/, []); + } + function addHtml() { + add(HTMLRules, "html-multiline-", /("""|''')/); + } + function add(Rules, strPrfx, rgxEnd, rootTokens, closeType) { + var next = "pop"; + var tokens = rootTokens || [ "start" ]; + if (tokens.length === 0) { + tokens = null; + } + if (/block|multiline/.test(strPrfx)) { + next = strPrfx + "end"; + rules.$rules[next] = [ + Token("empty", "", "start") + ]; + } + rules.embedRules( + Rules + , strPrfx + , [ Token(closeType || token_RPARE, rgxEnd, next) ] + , tokens + , tokens == null ? true : false + ); + } + + this.normalizeRules(); +} +oop.inherits(MaskHighlightRules, TextRules); + +var Blocks = { + string: function(str, next){ + var token = Token( + "string.start" + , str + , [ + Token(token_LPARE + "." + token_ITALIC, /~\[/, Blocks.interpolation()), + Token("string.end", str, "pop"), + { + defaultToken: "string" + } + ] + , next + ); + if (str.length === 1){ + var escaped = Token("string.escape", "\\\\" + str); + token.push.unshift(escaped); + } + return token; + }, + interpolation: function(){ + return [ + Token(token_UTIL, /\s*\w*\s*:/), + "js-interpolation-start" + ]; + }, + tagHead: function (rgx) { + return Token(token_ATTR, rgx, [ + Token(token_ATTR, /[\w\-_]+/), + Token(token_LPARE + "." + token_ITALIC, /~\[/, Blocks.interpolation()), + Blocks.goUp() + ]); + }, + tag: function () { + return { + token: 'tag', + onMatch : function(value) { + if (void 0 !== const_KEYWORDS[value]) + return token_KEYWORD; + if (void 0 !== const_CONST[value]) + return token_LANG; + if (void 0 !== const_FUNCTIONS[value]) + return "support.function"; + if (void 0 !== const_TAGS[value.toLowerCase()]) + return token_TAG; + + return token_COMPO; + }, + regex : /([@\w\-_:+]+)|((^|\s)(?=\s*(\.|#)))/, + push: [ + Blocks.tagHead(/\./) , + Blocks.tagHead(/#/) , + Blocks.expression(), + Blocks.attribute(), + + Token(token_LPARE, /[;>{]/, "pop") + ] + }; + }, + syntax: function(rgx, next, type){ + return { + token: token_LANG, + regex : rgx, + push: ({ + "attr": [ + next + "-start", + Token(token_PUNKT, /;/, "start") + ], + "multiline": [ + Blocks.tagHead(/\./) , + Blocks.tagHead(/#/) , + Blocks.attribute(), + Blocks.expression(), + Token(token_LPARE, /[>\{]/), + Token(token_PUNKT, /;/, "start"), + Token(token_LPARE, /'''|"""/, [ next + "-start" ]) + ], + "block": [ + Blocks.tagHead(/\./) , + Blocks.tagHead(/#/) , + Blocks.attribute(), + Blocks.expression(), + Token(token_LPARE, /\{/, [ next + "-start" ]) + ] + })[type] + }; + }, + attribute: function(){ + return Token(function(value){ + return /^x\-/.test(value) + ? token_ATTR + "." + token_BOLD + : token_ATTR; + }, /[\w_-]+/, [ + Token(token_PUNKT, /\s*=\s*/, [ + Blocks.string('"'), + Blocks.string("'"), + Blocks.word(), + Blocks.goUp() + ]), + Blocks.goUp() + ]); + }, + expression: function(){ + return Token(token_LPARE, /\(/, [ "js-statement-start" ]); + }, + word: function(){ + return Token("string", /[\w-_]+/); + }, + goUp: function(){ + return Token("text", "", "pop"); + }, + goStart: function(){ + return Token("text", "", "start"); + } +}; + + +function Token(token, rgx, mix) { + var push, next, onMatch; + if (arguments.length === 4) { + push = mix; + next = arguments[3]; + } + else if (typeof mix === "string") { + next = mix; + } + else { + push = mix; + } + if (typeof token === "function") { + onMatch = token; + token = "empty"; + } + return { + token: token, + regex: rgx, + push: push, + next: next, + onMatch: onMatch + }; +} + +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/mask",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mask_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MaskHighlightRules = require("./mask_highlight_rules").MaskHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = MaskHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/mask"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-matlab.js b/htdocs/includes/ace/mode-matlab.js new file mode 100644 index 00000000000..b8870403b68 --- /dev/null +++ b/htdocs/includes/ace/mode-matlab.js @@ -0,0 +1,256 @@ +ace.define("ace/mode/matlab_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var MatlabHighlightRules = function() { + +var keywords = ( + "break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|spmd|switch|try|while" + ); + + var builtinConstants = ( + "true|false|inf|Inf|nan|NaN|eps|pi|ans|nargin|nargout|varargin|varargout" + ); + + var builtinFunctions = ( + "abs|accumarray|acos(?:d|h)?|acot(?:d|h)?|acsc(?:d|h)?|actxcontrol(?:list|select)?|actxGetRunningServer|actxserver|addlistener|addpath|addpref|addtodate|"+ + "airy|align|alim|all|allchild|alpha|alphamap|amd|ancestor|and|angle|annotation|any|area|arrayfun|asec(?:d|h)?|asin(?:d|h)?|assert|assignin|atan(?:2|d|h)?|" + + "audiodevinfo|audioplayer|audiorecorder|aufinfo|auread|autumn|auwrite|avifile|aviinfo|aviread|axes|axis|balance|bar(?:3|3h|h)?|base2dec|beep|BeginInvoke|bench|"+ + "bessel(?:h|i|j|k|y)|beta|betainc|betaincinv|betaln|bicg|bicgstab|bicgstabl|bin2dec|bitand|bitcmp|bitget|bitmax|bitnot|bitor|bitset|bitshift|bitxor|blanks|blkdiag|"+ + "bone|box|brighten|brush|bsxfun|builddocsearchdb|builtin|bvp4c|bvp5c|bvpget|bvpinit|bvpset|bvpxtend|calendar|calllib|callSoapService|camdolly|cameratoolbar|camlight|"+ + "camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|cart2pol|cart2sph|cast|cat|caxis|cd|cdf2rdf|cdfepoch|cdfinfo|cdflib(?:.(?:close|closeVar|"+ + "computeEpoch|computeEpoch16|create|createAttr|createVar|delete|deleteAttr|deleteAttrEntry|deleteAttrgEntry|deleteVar|deleteVarRecords|epoch16Breakdown|epochBreakdown|getAttrEntry|"+ + "getAttrgEntry|getAttrMaxEntry|getAttrMaxgEntry|getAttrName|getAttrNum|getAttrScope|getCacheSize|getChecksum|getCompression|getCompressionCacheSize|getConstantNames|"+ + "getConstantValue|getCopyright|getFileBackward|getFormat|getLibraryCopyright|getLibraryVersion|getMajority|getName|getNumAttrEntries|getNumAttrgEntries|getNumAttributes|"+ + "getNumgAttributes|getReadOnlyMode|getStageCacheSize|getValidate|getVarAllocRecords|getVarBlockingFactor|getVarCacheSize|getVarCompression|getVarData|getVarMaxAllocRecNum|"+ + "getVarMaxWrittenRecNum|getVarName|getVarNum|getVarNumRecsWritten|getVarPadValue|getVarRecordData|getVarReservePercent|getVarsMaxWrittenRecNum|getVarSparseRecords|getVersion|"+ + "hyperGetVarData|hyperPutVarData|inquire|inquireAttr|inquireAttrEntry|inquireAttrgEntry|inquireVar|open|putAttrEntry|putAttrgEntry|putVarData|putVarRecordData|renameAttr|"+ + "renameVar|setCacheSize|setChecksum|setCompression|setCompressionCacheSize|setFileBackward|setFormat|setMajority|setReadOnlyMode|setStageCacheSize|setValidate|"+ + "setVarAllocBlockRecords|setVarBlockingFactor|setVarCacheSize|setVarCompression|setVarInitialRecs|setVarPadValue|SetVarReservePercent|setVarsCacheSize|setVarSparseRecords))?|"+ + "cdfread|cdfwrite|ceil|cell2mat|cell2struct|celldisp|cellfun|cellplot|cellstr|cgs|checkcode|checkin|checkout|chol|cholinc|cholupdate|circshift|cla|clabel|class|clc|clear|"+ + "clearvars|clf|clipboard|clock|close|closereq|cmopts|cmpermute|cmunique|colamd|colon|colorbar|colordef|colormap|colormapeditor|colperm|Combine|comet|comet3|commandhistory|"+ + "commandwindow|compan|compass|complex|computer|cond|condeig|condest|coneplot|conj|containers.Map|contour(?:3|c|f|slice)?|contrast|conv|conv2|convhull|convhulln|convn|cool|"+ + "copper|copyfile|copyobj|corrcoef|cos(?:d|h)?|cot(?:d|h)?|cov|cplxpair|cputime|createClassFromWsdl|createSoapMessage|cross|csc(?:d|h)?|csvread|csvwrite|ctranspose|cumprod|"+ + "cumsum|cumtrapz|curl|customverctrl|cylinder|daqread|daspect|datacursormode|datatipinfo|date|datenum|datestr|datetick|datevec|dbclear|dbcont|dbdown|dblquad|dbmex|dbquit|"+ + "dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|dde23|ddeget|ddesd|ddeset|deal|deblank|dec2base|dec2bin|dec2hex|decic|deconv|del2|delaunay|delaunay3|delaunayn|DelaunayTri|delete|"+ + "demo|depdir|depfun|det|detrend|deval|diag|dialog|diary|diff|diffuse|dir|disp|display|dither|divergence|dlmread|dlmwrite|dmperm|doc|docsearch|dos|dot|dragrect|drawnow|dsearch|"+ + "dsearchn|dynamicprops|echo|echodemo|edit|eig|eigs|ellipj|ellipke|ellipsoid|empty|enableNETfromNetworkDrive|enableservice|EndInvoke|enumeration|eomday|eq|erf|erfc|erfcinv|"+ + "erfcx|erfinv|error|errorbar|errordlg|etime|etree|etreeplot|eval|evalc|evalin|event.(?:EventData|listener|PropertyEvent|proplistener)|exifread|exist|exit|exp|expint|expm|"+ + "expm1|export2wsdlg|eye|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|factor|factorial|fclose|feather|feature|feof|ferror|feval|fft|fft2|fftn|"+ + "fftshift|fftw|fgetl|fgets|fieldnames|figure|figurepalette|fileattrib|filebrowser|filemarker|fileparts|fileread|filesep|fill|fill3|filter|filter2|find|findall|findfigs|"+ + "findobj|findstr|finish|fitsdisp|fitsinfo|fitsread|fitswrite|fix|flag|flipdim|fliplr|flipud|floor|flow|fminbnd|fminsearch|fopen|format|fplot|fprintf|frame2im|fread|freqspace|"+ + "frewind|fscanf|fseek|ftell|FTP|full|fullfile|func2str|functions|funm|fwrite|fzero|gallery|gamma|gammainc|gammaincinv|gammaln|gca|gcbf|gcbo|gcd|gcf|gco|ge|genpath|genvarname|"+ + "get|getappdata|getenv|getfield|getframe|getpixelposition|getpref|ginput|gmres|gplot|grabcode|gradient|gray|graymon|grid|griddata(?:3|n)?|griddedInterpolant|gsvd|gt|gtext|"+ + "guidata|guide|guihandles|gunzip|gzip|h5create|h5disp|h5info|h5read|h5readatt|h5write|h5writeatt|hadamard|handle|hankel|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|"+ + "hdfread|hdftool|help|helpbrowser|helpdesk|helpdlg|helpwin|hess|hex2dec|hex2num|hgexport|hggroup|hgload|hgsave|hgsetget|hgtransform|hidden|hilb|hist|histc|hold|home|horzcat|"+ + "hostid|hot|hsv|hsv2rgb|hypot|ichol|idivide|ifft|ifft2|ifftn|ifftshift|ilu|im2frame|im2java|imag|image|imagesc|imapprox|imfinfo|imformats|import|importdata|imread|imwrite|"+ + "ind2rgb|ind2sub|inferiorto|info|inline|inmem|inpolygon|input|inputdlg|inputname|inputParser|inspect|instrcallback|instrfind|instrfindall|int2str|integral(?:2|3)?|interp(?:1|"+ + "1q|2|3|ft|n)|interpstreamspeed|intersect|intmax|intmin|inv|invhilb|ipermute|isa|isappdata|iscell|iscellstr|ischar|iscolumn|isdir|isempty|isequal|isequaln|isequalwithequalnans|"+ + "isfield|isfinite|isfloat|isglobal|ishandle|ishghandle|ishold|isinf|isinteger|isjava|iskeyword|isletter|islogical|ismac|ismatrix|ismember|ismethod|isnan|isnumeric|isobject|"+ + "isocaps|isocolors|isonormals|isosurface|ispc|ispref|isprime|isprop|isreal|isrow|isscalar|issorted|isspace|issparse|isstr|isstrprop|isstruct|isstudent|isunix|isvarname|"+ + "isvector|javaaddpath|javaArray|javachk|javaclasspath|javacomponent|javaMethod|javaMethodEDT|javaObject|javaObjectEDT|javarmpath|jet|keyboard|kron|lasterr|lasterror|"+ + "lastwarn|lcm|ldivide|ldl|le|legend|legendre|length|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|license|light|lightangle|lighting|lin2mu|line|lines|"+ + "linkaxes|linkdata|linkprop|linsolve|linspace|listdlg|listfonts|load|loadlibrary|loadobj|log|log10|log1p|log2|loglog|logm|logspace|lookfor|lower|ls|lscov|lsqnonneg|lsqr|"+ + "lt|lu|luinc|magic|makehgtform|mat2cell|mat2str|material|matfile|matlab.io.MatFile|matlab.mixin.(?:Copyable|Heterogeneous(?:.getDefaultScalarElement)?)|matlabrc|"+ + "matlabroot|max|maxNumCompThreads|mean|median|membrane|memmapfile|memory|menu|mesh|meshc|meshgrid|meshz|meta.(?:class(?:.fromName)?|DynamicProperty|EnumeratedValue|event|"+ + "MetaData|method|package(?:.(?:fromName|getAllPackages))?|property)|metaclass|methods|methodsview|mex(?:.getCompilerConfigurations)?|MException|mexext|mfilename|min|minres|"+ + "minus|mislocked|mkdir|mkpp|mldivide|mlint|mlintrpt|mlock|mmfileinfo|mmreader|mod|mode|more|move|movefile|movegui|movie|movie2avi|mpower|mrdivide|msgbox|mtimes|mu2lin|"+ + "multibandread|multibandwrite|munlock|namelengthmax|nargchk|narginchk|nargoutchk|native2unicode|nccreate|ncdisp|nchoosek|ncinfo|ncread|ncreadatt|ncwrite|ncwriteatt|"+ + "ncwriteschema|ndgrid|ndims|ne|NET(?:.(?:addAssembly|Assembly|convertArray|createArray|createGeneric|disableAutoRelease|enableAutoRelease|GenericClass|invokeGenericMethod|"+ + "NetException|setStaticProperty))?|netcdf.(?:abort|close|copyAtt|create|defDim|defGrp|defVar|defVarChunking|defVarDeflate|defVarFill|defVarFletcher32|delAtt|endDef|getAtt|"+ + "getChunkCache|getConstant|getConstantNames|getVar|inq|inqAtt|inqAttID|inqAttName|inqDim|inqDimID|inqDimIDs|inqFormat|inqGrpName|inqGrpNameFull|inqGrpParent|inqGrps|"+ + "inqLibVers|inqNcid|inqUnlimDims|inqVar|inqVarChunking|inqVarDeflate|inqVarFill|inqVarFletcher32|inqVarID|inqVarIDs|open|putAtt|putVar|reDef|renameAtt|renameDim|renameVar|"+ + "setChunkCache|setDefaultFormat|setFill|sync)|newplot|nextpow2|nnz|noanimate|nonzeros|norm|normest|not|notebook|now|nthroot|null|num2cell|num2hex|num2str|numel|nzmax|"+ + "ode(?:113|15i|15s|23|23s|23t|23tb|45)|odeget|odeset|odextend|onCleanup|ones|open|openfig|opengl|openvar|optimget|optimset|or|ordeig|orderfields|ordqz|ordschur|orient|"+ + "orth|pack|padecoef|pagesetupdlg|pan|pareto|parseSoapResponse|pascal|patch|path|path2rc|pathsep|pathtool|pause|pbaspect|pcg|pchip|pcode|pcolor|pdepe|pdeval|peaks|perl|perms|"+ + "permute|pie|pink|pinv|planerot|playshow|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|plus|pol2cart|polar|poly|polyarea|polyder|polyeig|polyfit|polyint|polyval|"+ + "polyvalm|pow2|power|ppval|prefdir|preferences|primes|print|printdlg|printopt|printpreview|prod|profile|profsave|propedit|propertyeditor|psi|publish|PutCharArray|PutFullMatrix|"+ + "PutWorkspaceData|pwd|qhull|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quad2d|quadgk|quadl|quadv|questdlg|quit|quiver|quiver3|qz|rand|randi|randn|randperm|RandStream(?:.(?:create|"+ + "getDefaultStream|getGlobalStream|list|setDefaultStream|setGlobalStream))?|rank|rat|rats|rbbox|rcond|rdivide|readasync|real|reallog|realmax|realmin|realpow|realsqrt|record|"+ + "rectangle|rectint|recycle|reducepatch|reducevolume|refresh|refreshdata|regexp|regexpi|regexprep|regexptranslate|rehash|rem|Remove|RemoveAll|repmat|reset|reshape|residue|"+ + "restoredefaultpath|rethrow|rgb2hsv|rgb2ind|rgbplot|ribbon|rmappdata|rmdir|rmfield|rmpath|rmpref|rng|roots|rose|rosser|rot90|rotate|rotate3d|round|rref|rsf2csf|run|save|saveas|"+ + "saveobj|savepath|scatter|scatter3|schur|sec|secd|sech|selectmoveresize|semilogx|semilogy|sendmail|serial|set|setappdata|setdiff|setenv|setfield|setpixelposition|setpref|setstr|"+ + "setxor|shading|shg|shiftdim|showplottool|shrinkfaces|sign|sin(?:d|h)?|size|slice|smooth3|snapnow|sort|sortrows|sound|soundsc|spalloc|spaugment|spconvert|spdiags|specular|speye|"+ + "spfun|sph2cart|sphere|spinmap|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spring|sprintf|spy|sqrt|sqrtm|squeeze|ss2tf|sscanf|stairs|startup|std|stem|stem3|stopasync|"+ + "str2double|str2func|str2mat|str2num|strcat|strcmp|strcmpi|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|strfind|strjust|strmatch|strncmp|"+ + "strncmpi|strread|strrep|strtok|strtrim|struct2cell|structfun|strvcat|sub2ind|subplot|subsasgn|subsindex|subspace|subsref|substruct|subvolume|sum|summer|superclasses|superiorto|"+ + "support|surf|surf2patch|surface|surfc|surfl|surfnorm|svd|svds|swapbytes|symamd|symbfact|symmlq|symrcm|symvar|system|tan(?:d|h)?|tar|tempdir|tempname|tetramesh|texlabel|text|"+ + "textread|textscan|textwrap|tfqmr|throw|tic|Tiff(?:.(?:getTagNames|getVersion))?|timer|timerfind|timerfindall|times|timeseries|title|toc|todatenum|toeplitz|toolboxdir|trace|"+ + "transpose|trapz|treelayout|treeplot|tril|trimesh|triplequad|triplot|TriRep|TriScatteredInterp|trisurf|triu|tscollection|tsearch|tsearchn|tstool|type|typecast|uibuttongroup|"+ + "uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uiimport|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitable|"+ + "uitoggletool|uitoolbar|uiwait|uminus|undocheckout|unicode2native|union|unique|unix|unloadlibrary|unmesh|unmkpp|untar|unwrap|unzip|uplus|upper|urlread|urlwrite|usejava|"+ + "userpath|validateattributes|validatestring|vander|var|vectorize|ver|verctrl|verLessThan|version|vertcat|VideoReader(?:.isPlatformSupported)?|VideoWriter(?:.getProfiles)?|"+ + "view|viewmtx|visdiff|volumebounds|voronoi|voronoin|wait|waitbar|waitfor|waitforbuttonpress|warndlg|warning|waterfall|wavfinfo|wavplay|wavread|wavrecord|wavwrite|web|weekday|"+ + "what|whatsnew|which|whitebg|who|whos|wilkinson|winopen|winqueryreg|winter|wk1finfo|wk1read|wk1write|workspace|xlabel|xlim|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xor|xslt|"+ + "ylabel|ylim|zeros|zip|zlabel|zlim|zoom|addedvarplot|andrewsplot|anova(?:1|2|n)|ansaribradley|aoctool|barttest|bbdesign|beta(?:cdf|fit|inv|like|pdf|rnd|stat)|bino(?:cdf|fit|inv|"+ + "pdf|rnd|stat)|biplot|bootci|bootstrp|boxplot|candexch|candgen|canoncorr|capability|capaplot|caseread|casewrite|categorical|ccdesign|cdfplot|chi2(?:cdf|gof|inv|pdf|rnd|stat)|"+ + "cholcov|Classification(?:BaggedEnsemble|Discriminant(?:.(?:fit|make|template))?|Ensemble|KNN(?:.(?:fit|template))?|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|"+ + "template))?)|classify|classregtree|cluster|clusterdata|cmdscale|combnk|Compact(?:Classification(?:Discriminant|Ensemble|Tree)|Regression(?:Ensemble|Tree)|TreeBagger)|confusionmat|"+ + "controlchart|controlrules|cophenet|copula(?:cdf|fit|param|pdf|rnd|stat)|cordexch|corr|corrcov|coxphfit|createns|crosstab|crossval|cvpartition|datasample|dataset|daugment|dcovary|"+ + "dendrogram|dfittool|disttool|dummyvar|dwtest|ecdf|ecdfhist|ev(?:cdf|fit|inv|like|pdf|rnd|stat)|ExhaustiveSearcher|exp(?:cdf|fit|inv|like|pdf|rnd|stat)|factoran|fcdf|ff2n|finv|"+ + "fitdist|fitensemble|fpdf|fracfact|fracfactgen|friedman|frnd|fstat|fsurfht|fullfact|gagerr|gam(?:cdf|fit|inv|like|pdf|rnd|stat)|GeneralizedLinearModel(?:.fit)?|geo(?:cdf|inv|mean|"+ + "pdf|rnd|stat)|gev(?:cdf|fit|inv|like|pdf|rnd|stat)|gline|glmfit|glmval|glyphplot|gmdistribution(?:.fit)?|gname|gp(?:cdf|fit|inv|like|pdf|rnd|stat)|gplotmatrix|grp2idx|grpstats|"+ + "gscatter|haltonset|harmmean|hist3|histfit|hmm(?:decode|estimate|generate|train|viterbi)|hougen|hyge(?:cdf|inv|pdf|rnd|stat)|icdf|inconsistent|interactionplot|invpred|iqr|iwishrnd|"+ + "jackknife|jbtest|johnsrnd|KDTreeSearcher|kmeans|knnsearch|kruskalwallis|ksdensity|kstest|kstest2|kurtosis|lasso|lassoglm|lassoPlot|leverage|lhsdesign|lhsnorm|lillietest|"+ + "LinearModel(?:.fit)?|linhyptest|linkage|logn(?:cdf|fit|inv|like|pdf|rnd|stat)|lsline|mad|mahal|maineffectsplot|manova1|manovacluster|mdscale|mhsample|mle|mlecov|mnpdf|"+ + "mnrfit|mnrnd|mnrval|moment|multcompare|multivarichart|mvn(?:cdf|pdf|rnd)|mvregress|mvregresslike|mvt(?:cdf|pdf|rnd)|NaiveBayes(?:.fit)?|nan(?:cov|max|mean|median|min|std|"+ + "sum|var)|nbin(?:cdf|fit|inv|pdf|rnd|stat)|ncf(?:cdf|inv|pdf|rnd|stat)|nct(?:cdf|inv|pdf|rnd|stat)|ncx2(?:cdf|inv|pdf|rnd|stat)|NeighborSearcher|nlinfit|nlintool|nlmefit|nlmefitsa|"+ + "nlparci|nlpredci|nnmf|nominal|NonLinearModel(?:.fit)?|norm(?:cdf|fit|inv|like|pdf|rnd|stat)|normplot|normspec|ordinal|outlierMeasure|parallelcoords|paretotails|partialcorr|"+ + "pcacov|pcares|pdf|pdist|pdist2|pearsrnd|perfcurve|perms|piecewisedistribution|plsregress|poiss(?:cdf|fit|inv|pdf|rnd|tat)|polyconf|polytool|prctile|princomp|ProbDist(?:Kernel|"+ + "Parametric|UnivKernel|UnivParam)?|probplot|procrustes|qqplot|qrandset|qrandstream|quantile|randg|random|randsample|randtool|range|rangesearch|ranksum|rayl(?:cdf|fit|inv|pdf|"+ + "rnd|stat)|rcoplot|refcurve|refline|regress|Regression(?:BaggedEnsemble|Ensemble|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|regstats|relieff|ridge|"+ + "robustdemo|robustfit|rotatefactors|rowexch|rsmdemo|rstool|runstest|sampsizepwr|scatterhist|sequentialfs|signrank|signtest|silhouette|skewness|slicesample|sobolset|squareform|"+ + "statget|statset|stepwise|stepwisefit|surfht|tabulate|tblread|tblwrite|tcdf|tdfread|tiedrank|tinv|tpdf|TreeBagger|treedisp|treefit|treeprune|treetest|treeval|trimmean|trnd|tstat|"+ + "ttest|ttest2|unid(?:cdf|inv|pdf|rnd|stat)|unif(?:cdf|inv|it|pdf|rnd|stat)|vartest(?:2|n)?|wbl(?:cdf|fit|inv|like|pdf|rnd|stat)|wblplot|wishrnd|x2fx|xptread|zscore|ztest"+ + "adapthisteq|analyze75info|analyze75read|applycform|applylut|axes2pix|bestblk|blockproc|bwarea|bwareaopen|bwboundaries|bwconncomp|bwconvhull|bwdist|bwdistgeodesic|bweuler|"+ + "bwhitmiss|bwlabel|bwlabeln|bwmorph|bwpack|bwperim|bwselect|bwtraceboundary|bwulterode|bwunpack|checkerboard|col2im|colfilt|conndef|convmtx2|corner|cornermetric|corr2|cp2tform|"+ + "cpcorr|cpselect|cpstruct2pairs|dct2|dctmtx|deconvblind|deconvlucy|deconvreg|deconvwnr|decorrstretch|demosaic|dicom(?:anon|dict|info|lookup|read|uid|write)|edge|edgetaper|entropy|"+ + "entropyfilt|fan2para|fanbeam|findbounds|fliptform|freqz2|fsamp2|fspecial|ftrans2|fwind1|fwind2|getheight|getimage|getimagemodel|getline|getneighbors|getnhood|getpts|"+ + "getrangefromclass|getrect|getsequence|gray2ind|graycomatrix|graycoprops|graydist|grayslice|graythresh|hdrread|hdrwrite|histeq|hough|houghlines|houghpeaks|iccfind|iccread|"+ + "iccroot|iccwrite|idct2|ifanbeam|im2bw|im2col|im2double|im2int16|im2java2d|im2single|im2uint16|im2uint8|imabsdiff|imadd|imadjust|ImageAdapter|imageinfo|imagemodel|imapplymatrix|"+ + "imattributes|imbothat|imclearborder|imclose|imcolormaptool|imcomplement|imcontour|imcontrast|imcrop|imdilate|imdisplayrange|imdistline|imdivide|imellipse|imerode|imextendedmax|"+ + "imextendedmin|imfill|imfilter|imfindcircles|imfreehand|imfuse|imgca|imgcf|imgetfile|imhandles|imhist|imhmax|imhmin|imimposemin|imlincomb|imline|immagbox|immovie|immultiply|imnoise|"+ + "imopen|imoverview|imoverviewpanel|impixel|impixelinfo|impixelinfoval|impixelregion|impixelregionpanel|implay|impoint|impoly|impositionrect|improfile|imputfile|impyramid|"+ + "imreconstruct|imrect|imregconfig|imregionalmax|imregionalmin|imregister|imresize|imroi|imrotate|imsave|imscrollpanel|imshow|imshowpair|imsubtract|imtool|imtophat|imtransform|"+ + "imview|ind2gray|ind2rgb|interfileinfo|interfileread|intlut|ippl|iptaddcallback|iptcheckconn|iptcheckhandle|iptcheckinput|iptcheckmap|iptchecknargin|iptcheckstrs|iptdemos|iptgetapi|"+ + "iptGetPointerBehavior|iptgetpref|ipticondir|iptnum2ordinal|iptPointerManager|iptprefs|iptremovecallback|iptSetPointerBehavior|iptsetpref|iptwindowalign|iradon|isbw|isflat|isgray|"+ + "isicc|isind|isnitf|isrgb|isrset|lab2double|lab2uint16|lab2uint8|label2rgb|labelmatrix|makecform|makeConstrainToRectFcn|makehdr|makelut|makeresampler|maketform|mat2gray|mean2|"+ + "medfilt2|montage|nitfinfo|nitfread|nlfilter|normxcorr2|ntsc2rgb|openrset|ordfilt2|otf2psf|padarray|para2fan|phantom|poly2mask|psf2otf|qtdecomp|qtgetblk|qtsetblk|radon|rangefilt|"+ + "reflect|regionprops|registration.metric.(?:MattesMutualInformation|MeanSquares)|registration.optimizer.(?:OnePlusOneEvolutionary|RegularStepGradientDescent)|rgb2gray|"+ + "rgb2ntsc|rgb2ycbcr|roicolor|roifill|roifilt2|roipoly|rsetwrite|std2|stdfilt|strel|stretchlim|subimage|tformarray|tformfwd|tforminv|tonemap|translate|truesize|uintlut|viscircles|"+ + "warp|watershed|whitepoint|wiener2|xyz2double|xyz2uint16|ycbcr2rgb|bintprog|color|fgoalattain|fminbnd|fmincon|fminimax|fminsearch|fminunc|fseminf|fsolve|fzero|fzmult|gangstr|ktrlink|"+ + "linprog|lsqcurvefit|lsqlin|lsqnonlin|lsqnonneg|optimget|optimset|optimtool|quadprog" + ); + var storageType = ( + "cell|struct|char|double|single|logical|u?int(?:8|16|32|64)|sparse" + ); + var keywordMapper = this.createKeywordMapper({ + "storage.type": storageType, + "support.function": builtinFunctions, + "keyword": keywords, + "constant.language": builtinConstants + }, "identifier", true); + + this.$rules = { + start: [{ + token : "string", + regex : "'", + stateName : "qstring", + next : [{ + token : "constant.language.escape", + regex : "''" + }, { + token : "string", + regex : "'|$", + next : "start" + }, { + defaultToken: "string" + }] + }, { + token : "text", + regex : "\\s+" + }, { + regex: "", + next: "noQstring" + }], + noQstring : [{ + regex: "^\\s*%{\\s*$", + token: "comment.start", + push: "blockComment" + }, { + token : "comment", + regex : "%[^\r\n]*" + }, { + token : "string", + regex : '"', + stateName : "qqstring", + next : [{ + token : "constant.language.escape", + regex : /\\./ + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "start" + }, { + defaultToken: "string" + }] + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\/|\\/\\/|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=", + next: "start" + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\.", + next: "start" + }, { + token : "paren.lparen", + regex : "[({\\[]", + next: "start" + }, { + token : "paren.rparen", + regex : "[\\]})]" + }, { + token : "text", + regex : "\\s+" + }, { + token : "text", + regex : "$", + next : "start" + }], + blockComment: [{ + regex: "^\\s*%{\\s*$", + token: "comment.start", + push: "blockComment" + }, { + regex: "^\\s*%}\\s*$", + token: "comment.end", + next: "pop" + }, { + defaultToken: "comment" + }] + }; + + this.normalizeRules(); +}; + +oop.inherits(MatlabHighlightRules, TextHighlightRules); + +exports.MatlabHighlightRules = MatlabHighlightRules; +}); + +ace.define("ace/mode/matlab",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/matlab_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MatlabHighlightRules = require("./matlab_highlight_rules").MatlabHighlightRules; + +var Mode = function() { + this.HighlightRules = MatlabHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "%"; + this.blockComment = {start: "%{", end: "%}"}; + + this.$id = "ace/mode/matlab"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-mavens_mate_log.js b/htdocs/includes/ace/mode-mavens_mate_log.js new file mode 100644 index 00000000000..8f73e66e1e1 --- /dev/null +++ b/htdocs/includes/ace/mode-mavens_mate_log.js @@ -0,0 +1,160 @@ +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/mavens_mate_log",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mavens_mate_log_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MavensMateLogHighlightRules = require("./mavens_mate_log_highlight_rules").MavensMateLogHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = MavensMateLogHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/mavens_mate_log" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-maze.js b/htdocs/includes/ace/mode-maze.js new file mode 100644 index 00000000000..cdc8d221606 --- /dev/null +++ b/htdocs/includes/ace/mode-maze.js @@ -0,0 +1,284 @@ +ace.define("ace/mode/maze_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var MazeHighlightRules = function() { + + this.$rules = { + start: [{ + token: "keyword.control", + regex: /##|``/, + comment: "Wall" + }, { + token: "entity.name.tag", + regex: /\.\./, + comment: "Path" + }, { + token: "keyword.control", + regex: /<>/, + comment: "Splitter" + }, { + token: "entity.name.tag", + regex: /\*[\*A-Za-z0-9]/, + comment: "Signal" + }, { + token: "constant.numeric", + regex: /[0-9]{2}/, + comment: "Pause" + }, { + token: "keyword.control", + regex: /\^\^/, + comment: "Start" + }, { + token: "keyword.control", + regex: /\(\)/, + comment: "Hole" + }, { + token: "support.function", + regex: />>/, + comment: "Out" + }, { + token: "support.function", + regex: />\//, + comment: "Ln Out" + }, { + token: "support.function", + regex: /< *)(?:([-+*\/]=)( *)((?:-)?)([0-9]+)|(=)( *)(?:((?:-)?)([0-9]+)|("[^"]*")|('[^']*')))/, + comment: "Assignment function" + }, { + token: [ + "entity.name.function", + "keyword.other", + "keyword.control", + "keyword.other", + "keyword.operator", + "keyword.other", + "keyword.operator", + "constant.numeric", + "entity.name.tag", + "keyword.other", + "keyword.control", + "keyword.other", + "constant.language", + "keyword.other", + "keyword.control", + "keyword.other", + "constant.language" + ], + regex: /([A-Za-z][A-Za-z0-9])( *-> *)(IF|if)( *)(?:([<>]=?|==)( *)((?:-)?)([0-9]+)|(\*[\*A-Za-z0-9]))( *)(THEN|then)( *)(%[LRUDNlrudn])(?:( *)(ELSE|else)( *)(%[LRUDNlrudn]))?/, + comment: "Equality Function" + }, { + token: "entity.name.function", + regex: /[A-Za-z][A-Za-z0-9]/, + comment: "Function cell" + }, { + token: "comment.line.double-slash", + regex: / *\/\/.*/, + comment: "Comment" + }] + }; + + this.normalizeRules(); +}; + +MazeHighlightRules.metaData = { + fileTypes: ["mz"], + name: "Maze", + scopeName: "source.maze" +}; + + +oop.inherits(MazeHighlightRules, TextHighlightRules); + +exports.MazeHighlightRules = MazeHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/maze",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/maze_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MazeHighlightRules = require("./maze_highlight_rules").MazeHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = MazeHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.$id = "ace/mode/maze"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-mel.js b/htdocs/includes/ace/mode-mel.js new file mode 100644 index 00000000000..20de249b1f6 --- /dev/null +++ b/htdocs/includes/ace/mode-mel.js @@ -0,0 +1,256 @@ +ace.define("ace/mode/mel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var MELHighlightRules = function() { + + this.$rules = { start: + [ { caseInsensitive: true, + token: 'storage.type.mel', + regex: '\\b(matrix|string|vector|float|int|void)\\b' }, + { caseInsensitive: true, + token: 'support.function.mel', + regex: '\\b((s(h(ow(ManipCtx|S(hadingGroupAttrEditor|electionInTitle)|H(idden|elp)|Window)|el(f(Button|TabLayout|Layout)|lField)|ading(GeometryRelCtx|Node|Connection|LightRelCtx))|y(s(tem|File)|mbol(Button|CheckBox))|nap(shot|Mode|2to2 |TogetherCtx|Key)|c(ulpt|ene(UIReplacement|Editor)|ale(BrushBrightness |Constraint|Key(Ctx)?)?|r(ipt(Node|Ctx|Table|edPanel(Type)?|Job|EditorInfo)|oll(Field|Layout))|mh)|t(itch(Surface(Points)?|AndExplodeShell )|a(ckTrace|rt(sWith |String ))|r(cmp|i(ng(ToStringArray |Array(Remove(Duplicates | )|C(ount |atenate )|ToString |Intersector))|p )|oke))|i(n(gleProfileBirailSurface)?|ze|gn|mplify)|o(u(nd(Control)?|rce)|ft(Mod(Ctx)?)?|rt)|u(perCtx|rface(S(haderList|ampler))?|b(st(itute(Geometry|AllString )?|ring)|d(M(irror|a(tchTopology|p(SewMove|Cut)))|iv(Crease|DisplaySmoothness)?|C(ollapse|leanTopology)|T(o(Blind|Poly)|ransferUVsToCache)|DuplicateAndConnect|EditUV|ListComponentConversion|AutoProjection)))|p(h(ere|rand)|otLight(PreviewPort)?|aceLocator|r(ing|eadSheetEditor))|e(t(s|MenuMode|Sta(te |rtupMessage|mpDensity )|NodeTypeFlag|ConstraintRestPosition |ToolTo|In(putDeviceMapping|finity)|D(ynamic|efaultShadingGroup|rivenKeyframe)|UITemplate|P(ar(ticleAttr|ent)|roject )|E(scapeCtx|dit(or|Ctx))|Key(Ctx|frame|Path)|F(ocus|luidAttr)|Attr(Mapping)?)|parator|ed|l(ect(Mode|ionConnection|Context|Type|edNodes|Pr(iority|ef)|Key(Ctx)?)?|LoadSettings)|archPathArray )|kin(Cluster|Percent)|q(uareSurface|rt)|w(itchTable|atchDisplayPort)|a(ve(Menu|Shelf|ToolSettings|I(nitialState|mage)|Pref(s|Objects)|Fluid|A(ttrPreset |llShelves))|mpleImage)|rtContext|mooth(step|Curve|TangentSurface))|h(sv_to_rgb|yp(ot|er(Graph|Shade|Panel))|i(tTest|de|lite)|ot(Box|key(Check)?)|ud(Button|Slider(Button)?)|e(lp(Line)?|adsUpDisplay|rmite)|wRe(nder(Load)?|flectionMap)|ard(enPointCurve|ware(RenderPanel)?))|n(o(nLinear|ise|de(Type|IconButton|Outliner|Preset)|rmal(ize |Constraint))|urbs(Boolean|S(elect|quare)|C(opyUVSet|ube)|To(Subdiv|Poly(gonsPref)?)|Plane|ViewDirectionVector )|ew(ton|PanelItems)|ame(space(Info)?|Command|Field))|c(h(oice|dir|eck(Box(Grp)?|DefaultRenderGlobals)|a(n(nelBox|geSubdiv(Region|ComponentDisplayLevel))|racter(Map|OutlineEditor)?))|y(cleCheck|linder)|tx(Completion|Traverse|EditMode|Abort)|irc(ularFillet|le)|o(s|n(str(uctionHistory|ain(Value)?)|nect(ionInfo|Control|Dynamic|Joint|Attr)|t(extInfo|rol)|dition|e|vert(SolidTx|Tessellation|Unit|FromOldLayers |Lightmap)|firmDialog)|py(SkinWeights|Key|Flexor|Array )|l(or(Slider(Grp|ButtonGrp)|Index(SliderGrp)?|Editor|AtPoint)?|umnLayout|lision)|arsenSubdivSelectionList|m(p(onentEditor|utePolysetVolume |actHairSystem )|mand(Port|Echo|Line)))|u(tKey|r(ve(MoveEPCtx|SketchCtx|CVCtx|Intersect|OnSurface|E(ditorCtx|PCtx)|AddPtCtx)?|rent(Ctx|Time(Ctx)?|Unit)))|p(GetSolverAttr|Button|S(olver(Types)?|e(t(SolverAttr|Edit)|am))|C(o(nstraint|llision)|ache)|Tool|P(anel|roperty))|eil|l(ip(Schedule(rOutliner)?|TrimBefore |Editor(CurrentTimeCtx)?)?|ose(Surface|Curve)|uster|ear(Cache)?|amp)|a(n(CreateManip|vas)|tch(Quiet)?|pitalizeString |mera(View)?)|r(oss(Product )?|eate(RenderLayer|MotionField |SubdivRegion|N(ode|ewShelf )|D(isplayLayer|rawCtx)|Editor))|md(Shell|FileOutput))|M(R(ender(ShadowData|Callback|Data|Util|View|Line(Array)?)|ampAttribute)|G(eometryData|lobal)|M(odelMessage|essage|a(nipData|t(erial|rix)))|BoundingBox|S(yntax|ceneMessage|t(atus|ring(Array)?)|imple|pace|elect(ion(Mask|List)|Info)|watchRender(Register|Base))|H(ardwareRenderer|WShaderSwatchGenerator)|NodeMessage|C(o(nditionMessage|lor(Array)?|m(putation|mand(Result|Message)))|ursor|loth(Material|S(ystem|olverRegister)|Con(straint|trol)|Triangle|Particle|Edge|Force)|allbackIdArray)|T(ypeId|ime(r(Message)?|Array)?|oolsInfo|esselationParams|r(imBoundaryArray|ansformationMatrix))|I(ntArray|t(Geometry|Mesh(Polygon|Edge|Vertex|FaceVertex)|S(urfaceCV|electionList)|CurveCV|Instancer|eratorType|D(ependency(Graph|Nodes)|ag)|Keyframe)|k(System|HandleGroup)|mage)|3dView|Object(SetMessage|Handle|Array)?|D(G(M(odifier|essage)|Context)|ynSwept(Triangle|Line)|istance|oubleArray|evice(State|Channel)|a(ta(Block|Handle)|g(M(odifier|essage)|Path(Array)?))|raw(Request(Queue)?|Info|Data|ProcedureBase))|U(serEventMessage|i(nt(Array|64Array)|Message))|P(o(int(Array)?|lyMessage)|lug(Array)?|rogressWindow|x(G(eometry(Iterator|Data)|lBuffer)|M(idiInputDevice|odelEditorCommand|anipContainer)|S(urfaceShape(UI)?|pringNode|electionContext)|HwShaderNode|Node|Co(ntext(Command)?|m(ponentShape|mand))|T(oolCommand|ransform(ationMatrix)?)|IkSolver(Node)?|3dModelView|ObjectSet|D(eformerNode|ata|ragAndDropBehavior)|PolyT(weakUVCommand|rg)|EmitterNode|F(i(eldNode|leTranslator)|luidEmitterNode)|LocatorNode))|E(ulerRotation|vent(Message)?)|ayatomr|Vector(Array)?|Quaternion|F(n(R(otateManip|eflectShader|adialField)|G(e(nericAttribute|ometry(Data|Filter))|ravityField)|M(otionPath|es(sageAttribute|h(Data)?)|a(nip3D|trix(Data|Attribute)))|B(l(innShader|endShapeDeformer)|ase)|S(caleManip|t(ateManip|ring(Data|ArrayData))|ingleIndexedComponent|ubd(Names|Data)?|p(hereData|otLight)|et|kinCluster)|HikEffector|N(on(ExtendedLight|AmbientLight)|u(rbs(Surface(Data)?|Curve(Data)?)|meric(Data|Attribute))|ewtonField)|C(haracter|ircleSweepManip|ompo(nent(ListData)?|undAttribute)|urveSegmentManip|lip|amera)|T(ypedAttribute|oggleManip|urbulenceField|r(ipleIndexedComponent|ansform))|I(ntArrayData|k(Solver|Handle|Joint|Effector))|D(ynSweptGeometryData|i(s(cManip|tanceManip)|rection(Manip|alLight))|ouble(IndexedComponent|ArrayData)|ependencyNode|a(ta|gNode)|ragField)|U(ni(tAttribute|formField)|Int64ArrayData)|P(hong(Shader|EShader)|oint(On(SurfaceManip|CurveManip)|Light|ArrayData)|fxGeometry|lugin(Data)?|arti(cleSystem|tion))|E(numAttribute|xpression)|V(o(lume(Light|AxisField)|rtexField)|ectorArrayData)|KeyframeDelta(Move|B(lockAddRemove|reakdown)|Scale|Tangent|InfType|Weighted|AddRemove)?|F(ield|luid|reePointTriadManip)|W(ireDeformer|eightGeometryFilter)|L(ight(DataAttribute)?|a(yeredShader|ttice(D(eformer|ata))?|mbertShader))|A(ni(sotropyShader|mCurve)|ttribute|irField|r(eaLight|rayAttrsData)|mbientLight))?|ile(IO|Object)|eedbackLine|loat(Matrix|Point(Array)?|Vector(Array)?|Array))|L(i(ghtLinks|brary)|ockMessage)|A(n(im(Message|C(ontrol|urveC(hange|lipboard(Item(Array)?)?))|Util)|gle)|ttribute(Spec(Array)?|Index)|r(rayData(Builder|Handle)|g(Database|Parser|List))))|t(hreePointArcCtx|ime(Control|Port|rX)|o(ol(Button|HasOptions|Collection|Dropped|PropertyWindow)|NativePath |upper|kenize(List )?|l(ower|erance)|rus|ggle(WindowVisibility|Axis)?)|u(rbulence|mble(Ctx)?)|ex(RotateContext|M(oveContext|anipContext)|t(ScrollList|Curves|ure(HairColor |DisplacePlane |PlacementContext|Window)|ToShelf |Field(Grp|ButtonGrp)?)?|S(caleContext|electContext|mudgeUVContext)|WinToolCtx)|woPointArcCtx|a(n(gentConstraint)?|bLayout)|r(im|unc(ate(HairCache|FluidCache))?|a(ns(formLimits|lator)|c(e|k(Ctx)?))))|i(s(olateSelect|Connected|True|Dirty|ParentOf |Valid(String |ObjectName |UiName )|AnimCurve )|n(s(tance(r)?|ert(Joint(Ctx)?|K(not(Surface|Curve)|eyCtx)))|heritTransform|t(S(crollBar|lider(Grp)?)|er(sect|nalVar|ToUI )|Field(Grp)?))|conText(Radio(Button|Collection)|Button|StaticLabel|CheckBox)|temFilter(Render|Type|Attr)?|prEngine|k(S(ystem(Info)?|olver|plineHandleCtx)|Handle(Ctx|DisplayScale)?|fkDisplayMethod)|m(portComposerCurves |fPlugins|age))|o(ceanNurbsPreviewPlane |utliner(Panel|Editor)|p(tion(Menu(Grp)?|Var)|en(GLExtension|MayaPref))|verrideModifier|ffset(Surface|Curve(OnSurface)?)|r(ientConstraint|bit(Ctx)?)|b(soleteProc |j(ect(Center|Type(UI)?|Layer )|Exists)))|d(yn(RelEd(itor|Panel)|Globals|C(ontrol|ache)|P(a(intEditor|rticleCtx)|ref)|Exp(ort|ression)|amicLoad)|i(s(connect(Joint|Attr)|tanceDim(Context|ension)|pla(y(RGBColor|S(tats|urface|moothness)|C(olor|ull)|Pref|LevelOfDetail|Affected)|cementToPoly)|kCache|able)|r(name |ect(ionalLight|KeyCtx)|map)|mWhen)|o(cServer|Blur|t(Product )?|ubleProfileBirailSurface|peSheetEditor|lly(Ctx)?)|uplicate(Surface|Curve)?|e(tach(Surface|Curve|DeviceAttr)|vice(Panel|Editor)|f(ine(DataServer|VirtualDevice)|ormer|ault(Navigation|LightListCheckBox))|l(ete(Sh(elfTab |adingGroupsAndMaterials )|U(nusedBrushes |I)|Attr)?|randstr)|g_to_rad)|agPose|r(opoffLocator|ag(gerContext)?)|g(timer|dirty|Info|eval))|CBG |u(serCtx|n(t(angleUV|rim)|i(t|form)|do(Info)?|loadPlugin|assignInputDevice|group)|iTemplate|p(dateAE |Axis)|v(Snapshot|Link))|joint(C(tx|luster)|DisplayScale|Lattice)?|p(sd(ChannelOutliner|TextureFile|E(ditTextureFile|xport))|close|i(c(ture|kWalk)|xelMove)|o(se|int(MatrixMult |C(onstraint|urveConstraint)|On(Surface|Curve)|Position|Light)|p(upMenu|en)|w|l(y(Reduce|GeoSampler|M(irrorFace|ove(UV|Edge|Vertex|Facet(UV)?)|erge(UV|Edge(Ctx)?|Vertex|Facet(Ctx)?)|ap(Sew(Move)?|Cut|Del))|B(oolOp|evel|l(indData|endColor))|S(traightenUVBorder|oftEdge|u(perCtx|bdivide(Edge|Facet))|p(her(icalProjection|e)|lit(Ring|Ctx|Edge|Vertex)?)|e(tToFaceNormal|parate|wEdge|lect(Constraint(Monitor)?|EditCtx))|mooth)|Normal(izeUV|PerVertex)?|C(hipOff|ylind(er|ricalProjection)|o(ne|pyUV|l(or(BlindData|Set|PerVertex)|lapse(Edge|Facet)))|u(t(Ctx)?|be)|l(ipboard|oseBorder)|acheMonitor|rea(seEdge|teFacet(Ctx)?))|T(o(Subdiv|rus)|r(iangulate|ansfer))|In(stallAction|fo)|Options|D(uplicate(Edge|AndConnect)|el(Edge|Vertex|Facet))|U(nite|VSet)|P(yramid|oke|lan(e|arProjection)|r(ism|ojection))|E(ditUV|valuate|xtrude(Edge|Facet))|Qu(eryBlindData|ad)|F(orceUV|lip(UV|Edge))|WedgeFace|L(istComponentConversion|ayoutUV)|A(utoProjection|ppend(Vertex|FacetCtx)?|verage(Normal|Vertex)))|eVectorConstraint))|utenv|er(cent|formanceOptions)|fxstrokes|wd|l(uginInfo|a(y(b(last|ackOptions))?|n(e|arSrf)))|a(steKey|ne(l(History|Configuration)?|Layout)|thAnimation|irBlend|use|lettePort|r(ti(cle(RenderInfo|Instancer|Exists)?|tion)|ent(Constraint)?|am(Dim(Context|ension)|Locator)))|r(int|o(j(ect(ion(Manip|Context)|Curve|Tangent)|FileViewer)|pMo(dCtx|ve)|gress(Bar|Window)|mptDialog)|eloadRefEd))|e(n(codeString|d(sWith |String )|v|ableDevice)|dit(RenderLayer(Globals|Members)|or(Template)?|DisplayLayer(Globals|Members)|AttrLimits )|v(ent|al(Deferred|Echo)?)|quivalent(Tol | )|ffector|r(f|ror)|x(clusiveLightCheckBox|t(end(Surface|Curve)|rude)|ists|p(ortComposerCurves |ression(EditorListen)?)?|ec(uteForEachObject )?|actWorldBoundingBox)|mit(ter)?)|v(i(sor|ew(Set|HeadOn|2dToolCtx|C(lipPlane|amera)|Place|Fit|LookAt))|o(lumeAxis|rtex)|e(ctorize|rifyCmd )|alidateShelfName )|key(Tangent|frame(Region(MoveKeyCtx|S(caleKeyCtx|e(tKeyCtx|lectKeyCtx))|CurrentTimeCtx|TrackCtx|InsertKeyCtx|D(irectKeyCtx|ollyCtx))|Stats|Outliner)?)|qu(it|erySubdiv)|f(c(heck|lose)|i(nd(RelatedSkinCluster |MenuItem |er|Keyframe|AllIntersections )|tBspline|l(ter(StudioImport|Curve|Expand)?|e(BrowserDialog|test|Info|Dialog|Extension )?|letCurve)|rstParentOf )|o(ntDialog|pen|rmLayout)|print|eof|flush|write|l(o(or|w|at(S(crollBar|lider(Grp|ButtonGrp|2)?)|Eq |Field(Grp)?))|u(shUndo|id(CacheInfo|Emitter|VoxelInfo))|exor)|r(omNativePath |e(eFormFillet|wind|ad)|ameLayout)|get(word|line)|mod)|w(hatIs|i(ndow(Pref)?|re(Context)?)|orkspace|ebBrowser(Prefs)?|a(itCursor|rning)|ri(nkle(Context)?|teTake))|l(s(T(hroughFilter|ype )|UI)?|i(st(Relatives|MenuAnnotation |Sets|History|NodeTypes|C(onnections|ameras)|Transforms |InputDevice(s|Buttons|Axes)|erEditor|DeviceAttachments|Unselected |A(nimatable|ttr))|n(step|eIntersection )|ght(link|List(Panel|Editor)?))|o(ckNode|okThru|ft|ad(NewShelf |P(lugin|refObjects)|Fluid)|g)|a(ssoContext|y(out|er(Button|ed(ShaderPort|TexturePort)))|ttice(DeformKeyCtx)?|unch(ImageEditor)?))|a(ssign(Command|InputDevice)|n(notate|im(C(one|urveEditor)|Display|View)|gle(Between)?)|tt(ach(Surface|Curve|DeviceAttr)|r(ibute(Menu|Info|Exists|Query)|NavigationControlGrp|Co(ntrolGrp|lorSliderGrp|mpatibility)|PresetEditWin|EnumOptionMenu(Grp)?|Field(Grp|SliderGrp)))|i(r|mConstraint)|d(d(NewShelfTab|Dynamic|PP|Attr(ibuteEditorNodeHelp)?)|vanceToNextDrivenKey)|uto(Place|Keyframe)|pp(endStringArray|l(y(Take|AttrPreset)|icationName))|ffect(s|edNet)|l(i(as(Attr)?|gn(Surface|C(tx|urve))?)|lViewFit)|r(c(len|Len(DimContext|gthDimension))|t(BuildPaintMenu|Se(tPaintCtx|lectCtx)|3dPaintCtx|UserPaintCtx|PuttyCtx|FluidAttrCtx|Attr(SkinPaintCtx|Ctx|PaintVertexCtx))|rayMapper)|mbientLight|b(s|out))|r(igid(Body|Solver)|o(t(at(ionInterpolation|e))?|otOf |undConstantRadius|w(ColumnLayout|Layout)|ll(Ctx)?)|un(up|TimeCommand)|e(s(olutionNode|et(Tool|AE )|ampleFluid)|hash|n(der(GlobalsNode|Manip|ThumbnailUpdate|Info|er|Partition|QualityNode|Window(SelectContext|Editor)|LayerButton)?|ame(SelectionList |UI|Attr)?)|cord(Device|Attr)|target|order(Deformers)?|do|v(olve|erse(Surface|Curve))|quires|f(ineSubdivSelectionList|erence(Edit|Query)?|resh(AE )?)|loadImage|adTake|root|move(MultiInstance|Joint)|build(Surface|Curve))|a(n(d(state|omizeFollicles )?|geControl)|d(i(o(MenuItemCollection|Button(Grp)?|Collection)|al)|_to_deg)|mpColorPort)|gb_to_hsv)|g(o(toBindPose |al)|e(t(M(odifiers|ayaPanelTypes )|Classification|InputDeviceRange|pid|env|DefaultBrush|Pa(nel|rticleAttr)|F(ileList|luidAttr)|A(ttr|pplicationVersionAsFloat ))|ometryConstraint)|l(Render(Editor)?|obalStitch)|a(uss|mma)|r(id(Layout)?|oup(ObjectsByName )?|a(dientControl(NoAttr)?|ph(SelectContext|TrackCtx|DollyCtx)|vity|bColor))|match)|x(pmPicker|form|bmLangPathList )|m(i(n(imizeApp)?|rrorJoint)|o(del(CurrentTimeCtx|Panel|Editor)|use|v(In|e(IKtoFK |VertexAlongDirection|KeyCtx)?|Out))|u(te|ltiProfileBirailSurface)|e(ssageLine|nu(BarLayout|Item(ToShelf )?|Editor)?|mory)|a(nip(Rotate(Context|LimitsCtx)|Move(Context|LimitsCtx)|Scale(Context|LimitsCtx)|Options)|tch|ke(Roll |SingleSurface|TubeOn |Identity|Paintable|bot|Live)|rker|g|x))|b(in(Membership|d(Skin|Pose))|o(neLattice|undary|x(ZoomCtx|DollyCtx))|u(tton(Manip)?|ild(BookmarkMenu|KeyframeMenu)|fferCurve)|e(ssel|vel(Plus)?)|l(indDataType|end(Shape(Panel|Editor)?|2|TwoAttr))|a(sename(Ex | )|tchRender|ke(Results|Simulation|Clip|PartialHistory|FluidShading )))))\\b' }, + { caseInsensitive: true, + token: 'support.constant.mel', + regex: '\\b(s(h(ellTessellate|a(d(ing(Map|Engine)|erGlow)|pe))|n(ow|apshot(Shape)?)|c(ulpt|aleConstraint|ript)|t(yleCurve|itch(Srf|AsNurbsShell)|u(cco|dioClearCoat)|encil|roke(Globals)?)|i(ngleShadingSwitch|mpleVolumeShader)|o(ftMod(Manip|Handle)?|lidFractal)|u(rface(Sha(der|pe)|Info|EdManip|VarGroup|Luminance)|b(Surface|d(M(odifier(UV|World)?|ap(SewMove|Cut|pingManip))|B(lindData|ase)|iv(ReverseFaces|SurfaceVarGroup|Co(llapse|mponentId)|To(Nurbs|Poly))?|HierBlind|CleanTopology|Tweak(UV)?|P(lanarProj|rojManip)|LayoutUV|A(ddTopology|utoProj))|Curve))|p(BirailSrf|otLight|ring)|e(tRange|lectionListOperator)|k(inCluster|etchPlane)|quareSrf|ampler(Info)?|m(ooth(Curve|TangentSrf)|ear))|h(svToRgb|yper(GraphInfo|View|Layout)|ik(Solver|Handle|Effector)|oldMatrix|eightField|w(Re(nderGlobals|flectionMap)|Shader)|a(ir(System|Constraint|TubeShader)|rd(enPoint|wareRenderGlobals)))|n(o(n(ExtendedLightShapeNode|Linear|AmbientLightShapeNode)|ise|rmalConstraint)|urbs(Surface|Curve|T(oSubdiv(Proc)?|essellate)|DimShape)|e(twork|wtonField))|c(h(o(ice|oser)|ecker|aracter(Map|Offset)?)|o(n(straint|tr(olPoint|ast)|dition)|py(ColorSet|UVSet))|urve(Range|Shape|Normalizer(Linear|Angle)?|In(tersect|fo)|VarGroup|From(Mesh(CoM|Edge)?|Su(rface(Bnd|CoS|Iso)?|bdiv(Edge|Face)?)))|l(ip(Scheduler|Library)|o(se(stPointOnSurface|Surface|Curve)|th|ud)|uster(Handle)?|amp)|amera(View)?|r(eate(BPManip|ColorSet|UVSet)|ater))|t(ime(ToUnitConversion|Function)?|oo(nLineAttributes|lDrawManip)|urbulenceField|ex(BaseDeformManip|ture(BakeSet|2d|ToGeom|3d|Env)|SmudgeUVManip|LatticeDeformManip)|weak|angentConstraint|r(i(pleShadingSwitch|m(WithBoundaries)?)|ansform(Geometry)?))|i(n(s(tancer|ertKnot(Surface|Curve))|tersectSurface)|k(RPsolver|MCsolver|S(ystem|olver|Csolver|plineSolver)|Handle|PASolver|Effector)|m(plicit(Box|Sphere|Cone)|agePlane))|o(cean(Shader)?|pticalFX|ffset(Surface|C(os|urve))|ldBlindDataBase|rient(Constraint|ationMarker)|bject(RenderFilter|MultiFilter|BinFilter|S(criptFilter|et)|NameFilter|TypeFilter|Filter|AttrFilter))|d(yn(Globals|Base)|i(s(tance(Between|DimShape)|pla(yLayer(Manager)?|cementShader)|kCache)|rect(ionalLight|edDisc)|mensionShape)|o(ubleShadingSwitch|f)|pBirailSrf|e(tach(Surface|Curve)|pendNode|f(orm(Bend|S(ine|quash)|Twist|ableShape|F(unc|lare)|Wave)|ault(RenderUtilityList|ShaderList|TextureList|LightList))|lete(Co(lorSet|mponent)|UVSet))|ag(Node|Pose)|r(opoffLocator|agField))|u(seBackground|n(trim|i(t(Conversion|ToTimeConversion)|formField)|known(Transform|Dag)?)|vChooser)|j(iggle|oint(Cluster|Ffd|Lattice)?)|p(sdFileTex|hong(E)?|o(s(tProcessList|itionMarker)|int(MatrixMult|Constraint|On(SurfaceInfo|CurveInfo)|Emitter|Light)|l(y(Reduce|M(irror|o(difier(UV|World)?|ve(UV|Edge|Vertex|Face(tUV)?))|erge(UV|Edge|Vert|Face)|ap(Sew(Move)?|Cut|Del))|B(oolOp|evel|lindData|ase)|S(traightenUVBorder|oftEdge|ubd(Edge|Face)|p(h(ere|Proj)|lit(Ring|Edge|Vert)?)|e(parate|wEdge)|mooth(Proxy|Face)?)|Normal(izeUV|PerVertex)?|C(hipOff|yl(inder|Proj)|o(ne|pyUV|l(orPerVertex|lapse(Edge|F)))|u(t(Manip(Container)?)?|be)|loseBorder|rea(seEdge|t(or|eFace)))|T(o(Subdiv|rus)|weak(UV)?|r(iangulate|ansfer))|OptUvs|D(uplicateEdge|el(Edge|Vertex|Facet))|Unite|P(yramid|oke(Manip)?|lan(e|arProj)|r(i(sm|mitive)|oj))|Extrude(Edge|Vertex|Face)|VertexNormalManip|Quad|Flip(UV|Edge)|WedgeFace|LayoutUV|A(utoProj|ppend(Vertex)?|verageVertex))|eVectorConstraint))|fx(Geometry|Hair|Toon)|l(usMinusAverage|a(n(e|arTrimSurface)|ce(2dTexture|3dTexture)))|a(ssMatrix|irBlend|r(ti(cle(SamplerInfo|C(olorMapper|loud)|TranspMapper|IncandMapper|AgeMapper)?|tion)|ent(Constraint|Tessellate)|amDimension))|r(imitive|o(ject(ion|Curve|Tangent)|xyManager)))|e(n(tity|v(Ball|ironmentFog|S(phere|ky)|C(hrome|ube)|Fog))|x(t(end(Surface|Curve)|rude)|p(lodeNurbsShell|ression)))|v(iewManip|o(lume(Shader|Noise|Fog|Light|AxisField)|rtexField)|e(ctor(RenderGlobals|Product)|rtexBakeSet))|quadShadingSwitch|f(i(tBspline|eld|l(ter(Resample|Simplify|ClosestSample|Euler)?|e|letCurve))|o(urByFourMatrix|llicle)|urPointOn(MeshInfo|Subd)|f(BlendSrf(Obsolete)?|d|FilletSrf)|l(ow|uid(S(hape|liceManip)|Texture(2D|3D)|Emitter)|exorShape)|ra(ctal|meCache))|w(tAddMatrix|ire|ood|eightGeometryFilter|ater|rap)|l(ight(Info|Fog|Li(st|nker))?|o(cator|okAt|d(Group|Thresholds)|ft)|uminance|ea(stSquaresModifier|ther)|a(yered(Shader|Texture)|ttice|mbert))|a(n(notationShape|i(sotropic|m(Blend(InOut)?|C(urve(T(T|U|L|A)|U(T|U|L|A))?|lip)))|gleBetween)|tt(ach(Surface|Curve)|rHierarchyTest)|i(rField|mConstraint)|dd(Matrix|DoubleLinear)|udio|vg(SurfacePoints|NurbsSurfacePoints|Curves)|lign(Manip|Surface|Curve)|r(cLengthDimension|tAttrPaintTest|eaLight|rayMapper)|mbientLight|bstractBase(NurbsConversion|Create))|r(igid(Body|Solver|Constraint)|o(ck|undConstantRadius)|e(s(olution|ultCurve(TimeTo(Time|Unitless|Linear|Angular))?)|nder(Rect|Globals(List)?|Box|Sphere|Cone|Quality|L(ight|ayer(Manager)?))|cord|v(olve(dPrimitive)?|erse(Surface|Curve)?)|f(erence|lect)|map(Hsv|Color|Value)|build(Surface|Curve))|a(dialField|mp(Shader)?)|gbToHsv|bfSrf)|g(uide|eo(Connect(or|able)|metry(Shape|Constraint|VarGroup|Filter))|lobal(Stitch|CacheControl)|ammaCorrect|r(id|oup(Id|Parts)|a(nite|vityField)))|Fur(Globals|Description|Feedback|Attractors)|xformManip|m(o(tionPath|untain|vie)|u(te|lt(Matrix|i(plyDivide|listerLight)|DoubleLinear))|pBirailSrf|e(sh(VarGroup)?|ntalray(Texture|IblShape))|a(terialInfo|ke(Group|Nurb(sSquare|Sphere|C(ylinder|ircle|one|ube)|Torus|Plane)|CircularArc|T(hreePointCircularArc|extCurves|woPointCircularArc))|rble))|b(irailSrf|o(neLattice|olean|undary(Base)?)|u(lge|mp(2d|3d))|evel(Plus)?|l(in(n|dDataTemplate)|end(Shape|Color(s|Sets)|TwoAttr|Device|Weighted)?)|a(se(GeometryVarGroup|ShadingSwitch|Lattice)|keSet)|r(ownian|ush)))\\b' }, + { caseInsensitive: true, + token: 'keyword.control.mel', + regex: '\\b(if|in|else|for|while|break|continue|case|default|do|switch|return|switch|case|source|catch|alias)\\b' }, + { token: 'keyword.other.mel', regex: '\\b(global)\\b' }, + { caseInsensitive: true, + token: 'constant.language.mel', + regex: '\\b(null|undefined)\\b' }, + { token: 'constant.numeric.mel', + regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b' }, + { token: 'punctuation.definition.string.begin.mel', + regex: '"', + push: + [ { token: 'constant.character.escape.mel', regex: '\\\\.' }, + { token: 'punctuation.definition.string.end.mel', + regex: '"', + next: 'pop' }, + { defaultToken: 'string.quoted.double.mel' } ] }, + + { token: [ 'variable.other.mel', 'punctuation.definition.variable.mel' ], + regex: '(\\$)([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*?\\b)' }, + + { token: 'punctuation.definition.string.begin.mel', + regex: '\'', + push: + [ { token: 'constant.character.escape.mel', regex: '\\\\.' }, + { token: 'punctuation.definition.string.end.mel', + regex: '\'', + next: 'pop' }, + { defaultToken: 'string.quoted.single.mel' } ] }, + + { token: 'constant.language.mel', + regex: '\\b(false|true|yes|no|on|off)\\b' }, + + { token: 'punctuation.definition.comment.mel', + regex: '/\\*', + push: + [ { token: 'punctuation.definition.comment.mel', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.mel' } ] }, + + { token: [ 'comment.line.double-slash.mel', 'punctuation.definition.comment.mel' ], + regex: '(//)(.*$\\n?)' }, + + { caseInsensitive: true, + token: 'keyword.operator.mel', + regex: '\\b(instanceof)\\b' }, + { token: 'keyword.operator.symbolic.mel', + regex: '[-\\!\\%\\&\\*\\+\\=\\/\\?\\:]' }, + + { token: [ 'meta.preprocessor.mel', 'punctuation.definition.preprocessor.mel' ], + regex: '(^[ \\t]*)((?:#)[a-zA-Z]+)' }, + + { token: [ 'meta.function.mel', 'keyword.other.mel', 'storage.type.mel', 'entity.name.function.mel', 'punctuation.section.function.mel' ], + regex: '(global\\s*)?(proc\\s*)(\\w+\\s*\\[?\\]?\\s+|\\s+)([A-Za-z_][A-Za-z0-9_\\.]*)(\\s*\\()', + push: + [ { include: '$self' }, + { token: 'punctuation.section.function.mel', + regex: '\\)', + next: 'pop' }, + { defaultToken: 'meta.function.mel' } ] } + + ] } + + this.normalizeRules(); +}; + +oop.inherits(MELHighlightRules, TextHighlightRules); + +exports.MELHighlightRules = MELHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/mel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mel_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MELHighlightRules = require("./mel_highlight_rules").MELHighlightRules; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = MELHighlightRules; + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/mel"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-mips_assembler.js b/htdocs/includes/ace/mode-mips_assembler.js new file mode 100644 index 00000000000..94da6f36f12 --- /dev/null +++ b/htdocs/includes/ace/mode-mips_assembler.js @@ -0,0 +1,235 @@ +ace.define("ace/mode/mips_assembler_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var MIPSAssemblerHighlightRules = function() { + + this.$rules = { start: + [ { token: 'support.function.pseudo.mips', + regex: '\\b(?:mul|abs|div|divu|mulo|mulou|neg|negu|not|rem|remu|rol|ror|li|seq|sge|sgeu|sgt|sgtu|sle|sleu|sne|b|beqz|bge|bgeu|bgt|bgtu|ble|bleu|blt|bltu|bnez|la|ld|ulh|ulhu|ulw|sd|ush|usw|move|mfc1\\.d|l\\.d|l\\.s|s\\.d|s\\.s)\\b', + comment: 'ok actually this are instructions, but one also could call them funtions…' }, + { token: 'support.function.mips', + regex: '\\b(?:abs\\.d|abs\\.s|add|add\\.d|add\\.s|addi|addiu|addu|and|andi|bc1f|bc1t|beq|bgez|bgezal|bgtz|blez|bltz|bltzal|bne|break|c\\.eq\\.d|c\\.eq\\.s|c\\.le\\.d|c\\.le\\.s|c\\.lt\\.d|c\\.lt\\.s|ceil\\.w\\.d|ceil\\.w\\.s|clo|clz|cvt\\.d\\.s|cvt\\.d\\.w|cvt\\.s\\.d|cvt\\.s\\.w|cvt\\.w\\.d|cvt\\.w\\.s|div|div\\.d|div\\.s|divu|eret|floor\\.w\\.d|floor\\.w\\.s|j|jal|jalr|jr|lb|lbu|lh|lhu|ll|lui|lw|lwc1|lwl|lwr|madd|maddu|mfc0|mfc1|mfhi|mflo|mov\\.d|mov\\.s|movf|movf\\.d|movf\\.s|movn|movn\\.d|movn\\.s|movt|movt\\.d|movt\\.s|movz|movz\\.d|movz\\.s|msub|mtc0|mtc1|mthi|mtlo|mul|mul\\.d|mul\\.s|mult|multu|neg\\.d|neg\\.s|nop|nor|or|ori|round\\.w\\.d|round\\.w\\.s|sb|sc|sdc1|sh|sll|sllv|slt|slti|sltiu|sltu|sqrt\\.d|sqrt\\.s|sra|srav|srl|srlv|sub|sub\\.d|sub\\.s|subu|sw|swc1|swl|swr|syscall|teq|teqi|tge|tgei|tgeiu|tgeu|tlt|tlti|tltiu|tltu|trunc\\.w\\.d|trunc\\.w\\.s|xor|xori)\\b' }, + { token: 'storage.type.mips', + regex: '\\.(?:ascii|asciiz|byte|data|double|float|half|kdata|ktext|space|text|word|set\\s*(?:noat|at))\\b' }, + { token: 'storage.modifier.mips', + regex: '\\.(?:align|extern||globl)\\b' }, + { token: + [ 'entity.name.function.label.mips', + 'meta.function.label.mips' ], + regex: '\\b([A-Za-z0-9_]+)(:)' }, + { token: + [ 'punctuation.definition.variable.mips', + 'variable.other.register.usable.by-number.mips' ], + regex: '(\\$)(0|[2-9]|1[0-9]|2[0-5]|2[89]|3[0-1])\\b' }, + { token: + [ 'punctuation.definition.variable.mips', + 'variable.other.register.usable.by-name.mips' ], + regex: '(\\$)(zero|v[01]|a[0-3]|t[0-9]|s[0-7]|gp|sp|fp|ra)\\b' }, + { token: + [ 'punctuation.definition.variable.mips', + 'variable.other.register.reserved.mips' ], + regex: '(\\$)(at|k[01]|1|2[67])\\b' }, + { token: + [ 'punctuation.definition.variable.mips', + 'variable.other.register.usable.floating-point.mips', + 'variable.other.register.usable.floating-point.mips' ], + regex: '(\\$)(f)([0-9]|1[0-9]|2[0-9]|3[0-1])\\b' }, + { token: 'constant.numeric.float.mips', + regex: '\\b\\d+\\.\\d+\\b' }, + { token: 'constant.numeric.integer.mips', + regex: '\\b(?:\\d+|0(?:x|X)[a-fA-F0-9]+)\\b' }, + { token: 'punctuation.definition.string.begin.mips', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.mips', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.mips', + regex: '\\\\[rnt\\\\"]' }, + { defaultToken: 'string.quoted.double.mips' } ] }, + { token: 'punctuation.definition.comment.mips', + regex: '#', + push: + [ { token: 'comment.line.number-sign.mips', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.number-sign.mips' } ] } ] } + + this.normalizeRules(); +}; + +MIPSAssemblerHighlightRules.metaData = { fileTypes: [ 's', 'mips', 'spim', 'asm' ], + keyEquivalent: '^~M', + name: 'MIPS Assembler', + scopeName: 'source.mips' } + + +oop.inherits(MIPSAssemblerHighlightRules, TextHighlightRules); + +exports.MIPSAssemblerHighlightRules = MIPSAssemblerHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/mips_assembler",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mips_assembler_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MIPSAssemblerHighlightRules = require("./mips_assembler_highlight_rules").MIPSAssemblerHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = MIPSAssemblerHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/mips_assembler" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-mipsassembler.js b/htdocs/includes/ace/mode-mipsassembler.js new file mode 100644 index 00000000000..42ad657b8e8 --- /dev/null +++ b/htdocs/includes/ace/mode-mipsassembler.js @@ -0,0 +1,196 @@ +ace.define("ace/mode/mipsassembler_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var mipsassemblerHighlightRules = function() { + + this.$rules = { + start: [{ + token: "string.start", + regex: '"', + next: "qstring" + }], + qstring: [{ + token: "escape", + regex: /\\./, + }, { + token: "string.end", + regex: '"', + next: "start" + }], + } + + this.normalizeRules(); +}; + +mipsassemblerHighlightRules.metaData = + + +oop.inherits(mipsassemblerHighlightRules, TextHighlightRules); + +exports.mipsassemblerHighlightRules = mipsassemblerHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/mipsassembler",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mipsassembler_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HighlightRules = require("./mipsassembler_highlight_rules").HighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = HighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/mipsassembler" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-mushcode.js b/htdocs/includes/ace/mode-mushcode.js new file mode 100644 index 00000000000..5e6b7eaf035 --- /dev/null +++ b/htdocs/includes/ace/mode-mushcode.js @@ -0,0 +1,674 @@ +ace.define("ace/mode/mushcode_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var MushCodeRules = function() { + + + var keywords = ( + "@if|"+ + "@ifelse|"+ + "@switch|"+ + "@halt|"+ + "@dolist|"+ + "@create|"+ + "@scent|"+ + "@sound|"+ + "@touch|"+ + "@ataste|"+ + "@osound|"+ + "@ahear|"+ + "@aahear|"+ + "@amhear|"+ + "@otouch|"+ + "@otaste|"+ + "@drop|"+ + "@odrop|"+ + "@adrop|"+ + "@dropfail|"+ + "@odropfail|"+ + "@smell|"+ + "@oemit|"+ + "@emit|"+ + "@pemit|"+ + "@parent|"+ + "@clone|"+ + "@taste|"+ + "whisper|"+ + "page|"+ + "say|"+ + "pose|"+ + "semipose|"+ + "teach|"+ + "touch|"+ + "taste|"+ + "smell|"+ + "listen|"+ + "look|"+ + "move|"+ + "go|"+ + "home|"+ + "follow|"+ + "unfollow|"+ + "desert|"+ + "dismiss|"+ + "@tel" + ); + + var builtinConstants = ( + "=#0" + ); + + var builtinFunctions = ( + "default|"+ + "edefault|"+ + "eval|"+ + "get_eval|"+ + "get|"+ + "grep|"+ + "grepi|"+ + "hasattr|"+ + "hasattrp|"+ + "hasattrval|"+ + "hasattrpval|"+ + "lattr|"+ + "nattr|"+ + "poss|"+ + "udefault|"+ + "ufun|"+ + "u|"+ + "v|"+ + "uldefault|"+ + "xget|"+ + "zfun|"+ + "band|"+ + "bnand|"+ + "bnot|"+ + "bor|"+ + "bxor|"+ + "shl|"+ + "shr|"+ + "and|"+ + "cand|"+ + "cor|"+ + "eq|"+ + "gt|"+ + "gte|"+ + "lt|"+ + "lte|"+ + "nand|"+ + "neq|"+ + "nor|"+ + "not|"+ + "or|"+ + "t|"+ + "xor|"+ + "con|"+ + "entrances|"+ + "exit|"+ + "followers|"+ + "home|"+ + "lcon|"+ + "lexits|"+ + "loc|"+ + "locate|"+ + "lparent|"+ + "lsearch|"+ + "next|"+ + "num|"+ + "owner|"+ + "parent|"+ + "pmatch|"+ + "rloc|"+ + "rnum|"+ + "room|"+ + "where|"+ + "zone|"+ + "worn|"+ + "held|"+ + "carried|"+ + "acos|"+ + "asin|"+ + "atan|"+ + "ceil|"+ + "cos|"+ + "e|"+ + "exp|"+ + "fdiv|"+ + "fmod|"+ + "floor|"+ + "log|"+ + "ln|"+ + "pi|"+ + "power|"+ + "round|"+ + "sin|"+ + "sqrt|"+ + "tan|"+ + "aposs|"+ + "andflags|"+ + "conn|"+ + "commandssent|"+ + "controls|"+ + "doing|"+ + "elock|"+ + "findable|"+ + "flags|"+ + "fullname|"+ + "hasflag|"+ + "haspower|"+ + "hastype|"+ + "hidden|"+ + "idle|"+ + "isbaker|"+ + "lock|"+ + "lstats|"+ + "money|"+ + "who|"+ + "name|"+ + "nearby|"+ + "obj|"+ + "objflags|"+ + "photo|"+ + "poll|"+ + "powers|"+ + "pendingtext|"+ + "receivedtext|"+ + "restarts|"+ + "restarttime|"+ + "subj|"+ + "shortestpath|"+ + "tmoney|"+ + "type|"+ + "visible|"+ + "cat|"+ + "element|"+ + "elements|"+ + "extract|"+ + "filter|"+ + "filterbool|"+ + "first|"+ + "foreach|"+ + "fold|"+ + "grab|"+ + "graball|"+ + "index|"+ + "insert|"+ + "itemize|"+ + "items|"+ + "iter|"+ + "last|"+ + "ldelete|"+ + "map|"+ + "match|"+ + "matchall|"+ + "member|"+ + "mix|"+ + "munge|"+ + "pick|"+ + "remove|"+ + "replace|"+ + "rest|"+ + "revwords|"+ + "setdiff|"+ + "setinter|"+ + "setunion|"+ + "shuffle|"+ + "sort|"+ + "sortby|"+ + "splice|"+ + "step|"+ + "wordpos|"+ + "words|"+ + "add|"+ + "lmath|"+ + "max|"+ + "mean|"+ + "median|"+ + "min|"+ + "mul|"+ + "percent|"+ + "sign|"+ + "stddev|"+ + "sub|"+ + "val|"+ + "bound|"+ + "abs|"+ + "inc|"+ + "dec|"+ + "dist2d|"+ + "dist3d|"+ + "div|"+ + "floordiv|"+ + "mod|"+ + "modulo|"+ + "remainder|"+ + "vadd|"+ + "vdim|"+ + "vdot|"+ + "vmag|"+ + "vmax|"+ + "vmin|"+ + "vmul|"+ + "vsub|"+ + "vunit|"+ + "regedit|"+ + "regeditall|"+ + "regeditalli|"+ + "regediti|"+ + "regmatch|"+ + "regmatchi|"+ + "regrab|"+ + "regraball|"+ + "regraballi|"+ + "regrabi|"+ + "regrep|"+ + "regrepi|"+ + "after|"+ + "alphamin|"+ + "alphamax|"+ + "art|"+ + "before|"+ + "brackets|"+ + "capstr|"+ + "case|"+ + "caseall|"+ + "center|"+ + "containsfansi|"+ + "comp|"+ + "decompose|"+ + "decrypt|"+ + "delete|"+ + "edit|"+ + "encrypt|"+ + "escape|"+ + "if|"+ + "ifelse|"+ + "lcstr|"+ + "left|"+ + "lit|"+ + "ljust|"+ + "merge|"+ + "mid|"+ + "ostrlen|"+ + "pos|"+ + "repeat|"+ + "reverse|"+ + "right|"+ + "rjust|"+ + "scramble|"+ + "secure|"+ + "space|"+ + "spellnum|"+ + "squish|"+ + "strcat|"+ + "strmatch|"+ + "strinsert|"+ + "stripansi|"+ + "stripfansi|"+ + "strlen|"+ + "switch|"+ + "switchall|"+ + "table|"+ + "tr|"+ + "trim|"+ + "ucstr|"+ + "unsafe|"+ + "wrap|"+ + "ctitle|"+ + "cwho|"+ + "channels|"+ + "clock|"+ + "cflags|"+ + "ilev|"+ + "itext|"+ + "inum|"+ + "convsecs|"+ + "convutcsecs|"+ + "convtime|"+ + "ctime|"+ + "etimefmt|"+ + "isdaylight|"+ + "mtime|"+ + "secs|"+ + "msecs|"+ + "starttime|"+ + "time|"+ + "timefmt|"+ + "timestring|"+ + "utctime|"+ + "atrlock|"+ + "clone|"+ + "create|"+ + "cook|"+ + "dig|"+ + "emit|"+ + "lemit|"+ + "link|"+ + "oemit|"+ + "open|"+ + "pemit|"+ + "remit|"+ + "set|"+ + "tel|"+ + "wipe|"+ + "zemit|"+ + "fbcreate|"+ + "fbdestroy|"+ + "fbwrite|"+ + "fbclear|"+ + "fbcopy|"+ + "fbcopyto|"+ + "fbclip|"+ + "fbdump|"+ + "fbflush|"+ + "fbhset|"+ + "fblist|"+ + "fbstats|"+ + "qentries|"+ + "qentry|"+ + "play|"+ + "ansi|"+ + "break|"+ + "c|"+ + "asc|"+ + "die|"+ + "isdbref|"+ + "isint|"+ + "isnum|"+ + "isletters|"+ + "linecoords|"+ + "localize|"+ + "lnum|"+ + "nameshort|"+ + "null|"+ + "objeval|"+ + "r|"+ + "rand|"+ + "s|"+ + "setq|"+ + "setr|"+ + "soundex|"+ + "soundslike|"+ + "valid|"+ + "vchart|"+ + "vchart2|"+ + "vlabel|"+ + "@@|"+ + "bakerdays|"+ + "bodybuild|"+ + "box|"+ + "capall|"+ + "catalog|"+ + "children|"+ + "ctrailer|"+ + "darttime|"+ + "debt|"+ + "detailbar|"+ + "exploredroom|"+ + "fansitoansi|"+ + "fansitoxansi|"+ + "fullbar|"+ + "halfbar|"+ + "isdarted|"+ + "isnewbie|"+ + "isword|"+ + "lambda|"+ + "lobjects|"+ + "lplayers|"+ + "lthings|"+ + "lvexits|"+ + "lvobjects|"+ + "lvplayers|"+ + "lvthings|"+ + "newswrap|"+ + "numsuffix|"+ + "playerson|"+ + "playersthisweek|"+ + "randomad|"+ + "randword|"+ + "realrandword|"+ + "replacechr|"+ + "second|"+ + "splitamount|"+ + "strlenall|"+ + "text|"+ + "third|"+ + "tofansi|"+ + "totalac|"+ + "unique|"+ + "getaddressroom|"+ + "listpropertycomm|"+ + "listpropertyres|"+ + "lotowner|"+ + "lotrating|"+ + "lotratingcount|"+ + "lotvalue|"+ + "boughtproduct|"+ + "companyabb|"+ + "companyicon|"+ + "companylist|"+ + "companyname|"+ + "companyowners|"+ + "companyvalue|"+ + "employees|"+ + "invested|"+ + "productlist|"+ + "productname|"+ + "productowners|"+ + "productrating|"+ + "productratingcount|"+ + "productsoldat|"+ + "producttype|"+ + "ratedproduct|"+ + "soldproduct|"+ + "topproducts|"+ + "totalspentonproduct|"+ + "totalstock|"+ + "transfermoney|"+ + "uniquebuyercount|"+ + "uniqueproductsbought|"+ + "validcompany|"+ + "deletepicture|"+ + "fbsave|"+ + "getpicturesecurity|"+ + "haspicture|"+ + "listpictures|"+ + "picturesize|"+ + "replacecolor|"+ + "rgbtocolor|"+ + "savepicture|"+ + "setpicturesecurity|"+ + "showpicture|"+ + "piechart|"+ + "piechartlabel|"+ + "createmaze|"+ + "drawmaze|"+ + "drawwireframe" + ); + var keywordMapper = this.createKeywordMapper({ + "invalid.deprecated": "debugger", + "support.function": builtinFunctions, + "constant.language": builtinConstants, + "keyword": keywords + }, "identifier"); + + var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; + + var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; + var octInteger = "(?:0[oO]?[0-7]+)"; + var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; + var binInteger = "(?:0[bB][01]+)"; + var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; + + var exponent = "(?:[eE][+-]?\\d+)"; + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + + this.$rules = { + "start" : [ + { + token : "variable", // mush substitution register + regex : "%[0-9]{1}" + }, + { + token : "variable", // mush substitution register + regex : "%q[0-9A-Za-z]{1}" + }, + { + token : "variable", // mush special character register + regex : "%[a-zA-Z]{1}" + }, + { + token: "variable.language", + regex: "%[a-z0-9-_]+" + }, + { + token : "constant.numeric", // imaginary + regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // long integer + regex : integer + "[lL]\\b" + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|#|%|<<|>>|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]\\)\\}]" + }, { + token : "text", + regex : "\\s+" + } ] + }; +}; + +oop.inherits(MushCodeRules, TextHighlightRules); + +exports.MushCodeRules = MushCodeRules; +}); + +ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(markers) { + this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$"); +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var match = line.match(this.foldingStartMarker); + if (match) { + if (match[1]) + return this.openingBracketBlock(session, match[1], row, match.index); + if (match[2]) + return this.indentationBlock(session, row, match.index + match[2].length); + return this.indentationBlock(session, row); + } + } + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/mushcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mushcode_highlight_rules","ace/mode/folding/pythonic","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var MushCodeRules = require("./mushcode_highlight_rules").MushCodeRules; +var PythonFoldMode = require("./folding/pythonic").FoldMode; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = MushCodeRules; + this.foldingRules = new PythonFoldMode("\\:"); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + var outdents = { + "pass": 1, + "return": 1, + "raise": 1, + "break": 1, + "continue": 1 + }; + + this.checkOutdent = function(state, line, input) { + if (input !== "\r\n" && input !== "\r" && input !== "\n") + return false; + + var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + + if (!tokens) + return false; + do { + var last = tokens.pop(); + } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); + + if (!last) + return false; + + return (last.type == "keyword" && outdents[last.value]); + }; + + this.autoOutdent = function(state, doc, row) { + + row += 1; + var indent = this.$getIndent(doc.getLine(row)); + var tab = doc.getTabString(); + if (indent.slice(-tab.length) == tab) + doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); + }; + + this.$id = "ace/mode/mushcode"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-mysql.js b/htdocs/includes/ace/mode-mysql.js new file mode 100644 index 00000000000..7abe675c9e3 --- /dev/null +++ b/htdocs/includes/ace/mode-mysql.js @@ -0,0 +1,160 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/mysql_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var MysqlHighlightRules = function() { + + var mySqlKeywords = /*sql*/ "alter|and|as|asc|between|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" + "|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"; + var builtins = "by|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|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl" + var variable = "charset|clear|connect|edit|ego|exit|go|help|nopager|notee|nowarning|pager|print|prompt|quit|rehash|source|status|system|tee" + + var keywordMapper = this.createKeywordMapper({ + "support.function": builtins, + "keyword": mySqlKeywords, + "constant": "false|true|null|unknown|date|time|timestamp|ODBCdotTable|zerolessFloat", + "variable.language": variable + }, "identifier", true); + + + function string(rule) { + var start = rule.start; + var escapeSeq = rule.escape; + return { + token: "string.start", + regex: start, + next: [ + {token: "constant.language.escape", regex: escapeSeq}, + {token: "string.end", next: "start", regex: start}, + {defaultToken: "string"} + ] + }; + } + + this.$rules = { + "start" : [ { + token : "comment", regex : "(?:-- |#).*$" + }, + string({start: '"', escape: /\\[0'"bnrtZ\\%_]?/}), + string({start: "'", escape: /\\[0'"bnrtZ\\%_]?/}), + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : /\/\*/, + next : "comment" + }, { + token : "constant.numeric", // hex + regex : /0[xX][0-9a-fA-F]+|[xX]'[0-9a-fA-F]+'|0[bB][01]+|[bB]'[01]+'/ + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "constant.class", + regex : "@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "constant.buildin", + regex : "`[^`]*`" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\(]" + }, { + token : "paren.rparen", + regex : "[\\)]" + }, { + token : "text", + regex : "\\s+" + } ], + "comment" : [ + {token : "comment", regex : "\\*\\/", next : "start"}, + {defaultToken : "comment"} + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(MysqlHighlightRules, TextHighlightRules); + +exports.MysqlHighlightRules = MysqlHighlightRules; +}); + +ace.define("ace/mode/mysql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mysql_highlight_rules"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var TextMode = require("../mode/text").Mode; +var MysqlHighlightRules = require("./mysql_highlight_rules").MysqlHighlightRules; + +var Mode = function() { + this.HighlightRules = MysqlHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = ["--", "#"]; // todo space + this.blockComment = {start: "/*", end: "*/"}; + + this.$id = "ace/mode/mysql"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-nix.js b/htdocs/includes/ace/mode-nix.js new file mode 100644 index 00000000000..3424beafda9 --- /dev/null +++ b/htdocs/includes/ace/mode-nix.js @@ -0,0 +1,631 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" + +var c_cppHighlightRules = function() { + + var keywordControls = ( + "break|case|continue|default|do|else|for|goto|if|_Pragma|" + + "return|switch|while|catch|operator|try|throw|using" + ); + + var storageType = ( + "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + + "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + + "class|wchar_t|template|char16_t|char32_t" + ); + + var storageModifiers = ( + "const|extern|register|restrict|static|volatile|inline|private|" + + "protected|public|friend|explicit|virtual|export|mutable|typename|" + + "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" + ); + + var keywordOperators = ( + "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + + "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" + ); + + var builtinConstants = ( + "NULL|true|false|TRUE|FALSE|nullptr" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword.control" : keywordControls, + "storage.type" : storageType, + "storage.modifier" : storageModifiers, + "keyword.operator" : keywordOperators, + "variable.language": "this", + "constant.language": builtinConstants + }, "identifier"); + + var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "//$", + next : "start" + }, { + token : "comment", + regex : "//", + next : "singleLineComment" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // character + regex : "'(?:" + escapeRe + "|.)?'" + }, { + token : "string.start", + regex : '"', + stateName: "qqstring", + next: [ + { token: "string", regex: /\\\s*$/, next: "qqstring" }, + { token: "constant.language.escape", regex: escapeRe }, + { token: "constant.language.escape", regex: /%[^'"\\]/ }, + { token: "string.end", regex: '"|$', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "string.start", + regex : 'R"\\(', + stateName: "rawString", + next: [ + { token: "string.end", regex: '\\)"', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "keyword", // pre-compiler directives + regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", + next : "directive" + }, { + token : "keyword", // special case pre-compiler directive + regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" + }, { + token : "support.function.C99.c", + regex : cFunctions + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" + }, { + token : "keyword.operator", + regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/ + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "singleLineComment" : [ + { + token : "comment", + regex : /\\$/, + next : "singleLineComment" + }, { + token : "comment", + regex : /$/, + next : "start" + }, { + defaultToken: "comment" + } + ], + "directive" : [ + { + token : "constant.other.multiline", + regex : /\\/ + }, + { + token : "constant.other.multiline", + regex : /.*\\/ + }, + { + token : "constant.other", + regex : "\\s*<.+?>", + next : "start" + }, + { + token : "constant.other", // single line + regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', + next : "start" + }, + { + token : "constant.other", // single line + regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", + next : "start" + }, + { + token : "constant.other", + regex : /[^\\\/]+/, + next : "start" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(c_cppHighlightRules, TextHighlightRules); + +exports.c_cppHighlightRules = c_cppHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = c_cppHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/c_cpp"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/nix_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { + "use strict"; + + var oop = require("../lib/oop"); + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + + var NixHighlightRules = function() { + + var constantLanguage = "true|false"; + var keywordControl = "with|import|if|else|then|inherit"; + var keywordDeclaration = "let|in|rec"; + + var keywordMapper = this.createKeywordMapper({ + "constant.language.nix": constantLanguage, + "keyword.control.nix": keywordControl, + "keyword.declaration.nix": keywordDeclaration + }, "identifier"); + + this.$rules = { + "start": [{ + token: "comment", + regex: /#.*$/ + }, { + token: "comment", + regex: /\/\*/, + next: "comment" + }, { + token: "constant", + regex: "<[^>]+>" + }, { + regex: "(==|!=|<=?|>=?)", + token: ["keyword.operator.comparison.nix"] + }, { + regex: "((?:[+*/%-]|\\~)=)", + token: ["keyword.operator.assignment.arithmetic.nix"] + }, { + regex: "=", + token: "keyword.operator.assignment.nix" + }, { + token: "string", + regex: "''", + next: "qqdoc" + }, { + token: "string", + regex: "'", + next: "qstring" + }, { + token: "string", + regex: '"', + push: "qqstring" + }, { + token: "constant.numeric", // hex + regex: "0[xX][0-9a-fA-F]+\\b" + }, { + token: "constant.numeric", // float + regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token: keywordMapper, + regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + regex: "}", + token: function(val, start, stack) { + return stack[1] && stack[1].charAt(0) == "q" ? "constant.language.escape" : "text"; + }, + next: "pop" + }], + "comment": [{ + token: "comment", // closing comment + regex: "\\*\\/", + next: "start" + }, { + defaultToken: "comment" + }], + "qqdoc": [ + { + token: "constant.language.escape", + regex: /\$\{/, + push: "start" + }, { + token: "string", + regex: "''", + next: "pop" + }, { + defaultToken: "string" + }], + "qqstring": [ + { + token: "constant.language.escape", + regex: /\$\{/, + push: "start" + }, { + token: "string", + regex: '"', + next: "pop" + }, { + defaultToken: "string" + }], + "qstring": [ + { + token: "constant.language.escape", + regex: /\$\{/, + push: "start" + }, { + token: "string", + regex: "'", + next: "pop" + }, { + defaultToken: "string" + }] + }; + + this.normalizeRules(); + }; + + oop.inherits(NixHighlightRules, TextHighlightRules); + + exports.NixHighlightRules = NixHighlightRules; +}); + +ace.define("ace/mode/nix",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/nix_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var CMode = require("./c_cpp").Mode; +var NixHighlightRules = require("./nix_highlight_rules").NixHighlightRules; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + CMode.call(this); + this.HighlightRules = NixHighlightRules; + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, CMode); + +(function() { + this.lineCommentStart = "#"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/nix"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-nsis.js b/htdocs/includes/ace/mode-nsis.js new file mode 100644 index 00000000000..a20aed277e2 --- /dev/null +++ b/htdocs/includes/ace/mode-nsis.js @@ -0,0 +1,305 @@ +ace.define("ace/mode/nsis_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var NSISHighlightRules = function() { + + this.$rules = { + start: [{ + token: "keyword.compiler.nsis", + regex: /^\s*!(?:include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|macro|macroend|makensis|searchparse|searchreplace)\b/, + caseInsensitive: true + }, { + token: "keyword.command.nsis", + regex: /^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, + caseInsensitive: true + }, { + token: "keyword.control.nsis", + regex: /^\s*!(?:ifdef|ifndef|if|ifmacrodef|ifmacrondef|else|endif)\b/, + caseInsensitive: true + }, { + token: "keyword.plugin.nsis", + regex: /^\s*\w+::\w+/, + caseInsensitive: true + }, { + token: "keyword.operator.comparison.nsis", + regex: /[!<>]?=|<>|<|>/ + }, { + token: "support.function.nsis", + regex: /(?:\b|^\s*)(?:Function|FunctionEnd|Section|SectionEnd|SectionGroup|SectionGroupEnd|PageEx|PageExEnd)\b/, + caseInsensitive: true + }, { + token: "support.library.nsis", + regex: /\${[\w\.:-]+}/ + }, { + token: "constant.nsis", + regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, + caseInsensitive: true + }, { + token: "constant.library.nsis", + regex: /\${(?:AtLeastServicePack|AtLeastWin7|AtLeastWin8|AtLeastWin10|AtLeastWin95|AtLeastWin98|AtLeastWin2000|AtLeastWin2003|AtLeastWin2008|AtLeastWin2008R2|AtLeastWinME|AtLeastWinNT4|AtLeastWinVista|AtLeastWinXP|AtMostServicePack|AtMostWin7|AtMostWin8|AtMostWin10|AtMostWin95|AtMostWin98|AtMostWin2000|AtMostWin2003|AtMostWin2008|AtMostWin2008R2|AtMostWinME|AtMostWinNT4|AtMostWinVista|AtMostWinXP|IsNT|IsServer|IsServicePack|IsWin7|IsWin8|IsWin10|IsWin95|IsWin98|IsWin2000|IsWin2003|IsWin2008|IsWin2008R2|IsWinME|IsWinNT4|IsWinVista|IsWinXP)}/ + }, { + token: "constant.language.boolean.true.nsis", + regex: /\b(?:true|on)\b/ + }, { + token: "constant.language.boolean.false.nsis", + regex: /\b(?:false|off)\b/ + }, { + token: "constant.language.option.nsis", + regex: /(?:\b|^\s*)(?:(?:un\.)?components|(?:un\.)?custom|(?:un\.)?directory|(?:un\.)?instfiles|(?:un\.)?license|uninstConfirm|admin|all|auto|both|bottom|bzip2|current|force|hide|highest|ifdiff|ifnewer|lastused|leave|left|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|user|Win10|Win7|Win8|WinVista|zlib)\b/, + caseInsensitive: true + }, { + token: "constant.language.slash-option.nsis", + regex: /\b\/(?:a|BRANDING|CENTER|COMPONENTSONLYONCUSTOM|CUSTOMSTRING=|date|e|ENABLECANCEL|FILESONLY|file|FINAL|GLOBAL|gray|ifempty|ifndef|ignorecase|IMGID=|ITALIC|LANG=|NOCUSTOM|noerrors|NONFATAL|nonfatal|oname=|o|REBOOTOK|redef|RESIZETOFIT|r|SHORT|SILENT|SOLID|STRIKE|TRIM|UNDERLINE|utcdate|windows|x)\b/, + caseInsensitive: true + }, { + token: "constant.numeric.nsis", + regex: /\b(?:0(?:x|X)[0-9a-fA-F]+|[0-9]+(?:\.[0-9]+)?)\b/ + }, { + token: "entity.name.function.nsis", + regex: /\$\([\w\.:-]+\)/ + }, { + token: "storage.type.function.nsis", + regex: /\$[\w]+/ + }, { + token: "punctuation.definition.string.begin.nsis", + regex: /`/, + push: [{ + token: "punctuation.definition.string.end.nsis", + regex: /`/, + next: "pop" + }, { + token: "constant.character.escape.nsis", + regex: /\$\\./ + }, { + defaultToken: "string.quoted.back.nsis" + }] + }, { + token: "punctuation.definition.string.begin.nsis", + regex: /"/, + push: [{ + token: "punctuation.definition.string.end.nsis", + regex: /"/, + next: "pop" + }, { + token: "constant.character.escape.nsis", + regex: /\$\\./ + }, { + defaultToken: "string.quoted.double.nsis" + }] + }, { + token: "punctuation.definition.string.begin.nsis", + regex: /'/, + push: [{ + token: "punctuation.definition.string.end.nsis", + regex: /'/, + next: "pop" + }, { + token: "constant.character.escape.nsis", + regex: /\$\\./ + }, { + defaultToken: "string.quoted.single.nsis" + }] + }, { + token: [ + "punctuation.definition.comment.nsis", + "comment.line.nsis" + ], + regex: /(;|#)(.*$)/ + }, { + token: "punctuation.definition.comment.nsis", + regex: /\/\*/, + push: [{ + token: "punctuation.definition.comment.nsis", + regex: /\*\//, + next: "pop" + }, { + defaultToken: "comment.block.nsis" + }] + }, { + token: "text", + regex: /(?:!include|!insertmacro)\b/ + }] + }; + + this.normalizeRules(); +}; + +NSISHighlightRules.metaData = { + comment: "\n\ttodo: - highlight functions\n\t", + fileTypes: ["nsi", "nsh"], + name: "NSIS", + scopeName: "source.nsis" +}; + + +oop.inherits(NSISHighlightRules, TextHighlightRules); + +exports.NSISHighlightRules = NSISHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/nsis",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/nsis_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var NSISHighlightRules = require("./nsis_highlight_rules").NSISHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = NSISHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = [";", "#"]; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/nsis"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-objectivec.js b/htdocs/includes/ace/mode-objectivec.js new file mode 100644 index 00000000000..1dd0cb58502 --- /dev/null +++ b/htdocs/includes/ace/mode-objectivec.js @@ -0,0 +1,725 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" + +var c_cppHighlightRules = function() { + + var keywordControls = ( + "break|case|continue|default|do|else|for|goto|if|_Pragma|" + + "return|switch|while|catch|operator|try|throw|using" + ); + + var storageType = ( + "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + + "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + + "class|wchar_t|template|char16_t|char32_t" + ); + + var storageModifiers = ( + "const|extern|register|restrict|static|volatile|inline|private|" + + "protected|public|friend|explicit|virtual|export|mutable|typename|" + + "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" + ); + + var keywordOperators = ( + "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + + "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" + ); + + var builtinConstants = ( + "NULL|true|false|TRUE|FALSE|nullptr" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword.control" : keywordControls, + "storage.type" : storageType, + "storage.modifier" : storageModifiers, + "keyword.operator" : keywordOperators, + "variable.language": "this", + "constant.language": builtinConstants + }, "identifier"); + + var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "//$", + next : "start" + }, { + token : "comment", + regex : "//", + next : "singleLineComment" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // character + regex : "'(?:" + escapeRe + "|.)?'" + }, { + token : "string.start", + regex : '"', + stateName: "qqstring", + next: [ + { token: "string", regex: /\\\s*$/, next: "qqstring" }, + { token: "constant.language.escape", regex: escapeRe }, + { token: "constant.language.escape", regex: /%[^'"\\]/ }, + { token: "string.end", regex: '"|$', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "string.start", + regex : 'R"\\(', + stateName: "rawString", + next: [ + { token: "string.end", regex: '\\)"', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "keyword", // pre-compiler directives + regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", + next : "directive" + }, { + token : "keyword", // special case pre-compiler directive + regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" + }, { + token : "support.function.C99.c", + regex : cFunctions + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" + }, { + token : "keyword.operator", + regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/ + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "singleLineComment" : [ + { + token : "comment", + regex : /\\$/, + next : "singleLineComment" + }, { + token : "comment", + regex : /$/, + next : "start" + }, { + defaultToken: "comment" + } + ], + "directive" : [ + { + token : "constant.other.multiline", + regex : /\\/ + }, + { + token : "constant.other.multiline", + regex : /.*\\/ + }, + { + token : "constant.other", + regex : "\\s*<.+?>", + next : "start" + }, + { + token : "constant.other", // single line + regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', + next : "start" + }, + { + token : "constant.other", // single line + regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", + next : "start" + }, + { + token : "constant.other", + regex : /[^\\\/]+/, + next : "start" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(c_cppHighlightRules, TextHighlightRules); + +exports.c_cppHighlightRules = c_cppHighlightRules; +}); + +ace.define("ace/mode/objectivec_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/c_cpp_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var C_Highlight_File = require("./c_cpp_highlight_rules"); +var CHighlightRules = C_Highlight_File.c_cppHighlightRules; + +var ObjectiveCHighlightRules = function() { + + var escapedConstRe = "\\\\(?:[abefnrtv'\"?\\\\]|" + + "[0-3]\\d{1,2}|" + + "[4-7]\\d?|" + + "222|" + + "x[a-zA-Z0-9]+)"; + + var specialVariables = [{ + regex: "\\b_cmd\\b", + token: "variable.other.selector.objc" + }, { + regex: "\\b(?:self|super)\\b", + token: "variable.language.objc" + } + ]; + + var cObj = new CHighlightRules(); + var cRules = cObj.getRules(); + + this.$rules = { + "start": [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, + { + token: [ "storage.type.objc", "punctuation.definition.storage.type.objc", + "entity.name.type.objc", "text", "entity.other.inherited-class.objc" + ], + regex: "(@)(interface|protocol)(?!.+;)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*:\\s*)([A-Za-z]+)" + }, + { + token: [ "storage.type.objc" ], + regex: "(@end)" + }, + { + token: [ "storage.type.objc", "entity.name.type.objc", + "entity.other.inherited-class.objc" + ], + regex: "(@implementation)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*?::\\s*(?:[A-Za-z][A-Za-z0-9]*))?" + }, + { + token: "string.begin.objc", + regex: '@"', + next: "constant_NSString" + }, + { + token: "storage.type.objc", + regex: "\\bid\\s*<", + next: "protocol_list" + }, + { + token: "keyword.control.macro.objc", + regex: "\\bNS_DURING|NS_HANDLER|NS_ENDHANDLER\\b" + }, + { + token: ["punctuation.definition.keyword.objc", "keyword.control.exception.objc"], + regex: "(@)(try|catch|finally|throw)\\b" + }, + { + token: ["punctuation.definition.keyword.objc", "keyword.other.objc"], + regex: "(@)(defs|encode)\\b" + }, + { + token: ["storage.type.id.objc", "text"], + regex: "(\\bid\\b)(\\s|\\n)?" + }, + { + token: "storage.type.objc", + regex: "\\bIBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class\\b" + }, + { + token: [ "punctuation.definition.storage.type.objc", "storage.type.objc"], + regex: "(@)(class|protocol)\\b" + }, + { + token: [ "punctuation.definition.storage.type.objc", "punctuation"], + regex: "(@selector)(\\s*\\()", + next: "selectors" + }, + { + token: [ "punctuation.definition.storage.modifier.objc", "storage.modifier.objc"], + regex: "(@)(synchronized|public|private|protected|package)\\b" + }, + { + token: "constant.language.objc", + regex: "\\bYES|NO|Nil|nil\\b" + }, + { + token: "support.variable.foundation", + regex: "\\bNSApp\\b" + }, + { + token: [ "support.function.cocoa.leopard"], + regex: "(?:\\b)(NS(?:Rect(?:ToCGRect|FromCGRect)|MakeCollectable|S(?:tringFromProtocol|ize(?:ToCGSize|FromCGSize))|Draw(?:NinePartImage|ThreePartImage)|P(?:oint(?:ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))(?:\\b)" + }, + { + token: ["support.function.cocoa"], + regex: "(?:\\b)(NS(?:R(?:ound(?:DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(?:CriticalAlertPanel(?:RelativeToWindow)?|InformationalAlertPanel(?:RelativeToWindow)?|AlertPanel(?:RelativeToWindow)?)|e(?:set(?:MapTable|HashTable)|c(?:ycleZone|t(?:Clip(?:List)?|F(?:ill(?:UsingOperation|List(?:UsingOperation|With(?:Grays|Colors(?:UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(?:dPixel|l(?:MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(?:SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(?:s)?|WindowServerMemory|AlertPanel)|M(?:i(?:n(?:X|Y)|d(?:X|Y))|ouseInRect|a(?:p(?:Remove|Get|Member|Insert(?:IfAbsent|KnownAbsent)?)|ke(?:R(?:ect|ange)|Size|Point)|x(?:Range|X|Y)))|B(?:itsPer(?:SampleFromDepth|PixelFromDepth)|e(?:stDepth|ep|gin(?:CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(?:ho(?:uldRetainWithZone|w(?:sServicesMenuItem|AnimationEffect))|tringFrom(?:R(?:ect|ange)|MapTable|S(?:ize|elector)|HashTable|Class|Point)|izeFromString|e(?:t(?:ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(?:Big(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|Short|Host(?:ShortTo(?:Big|Little)|IntTo(?:Big|Little)|DoubleTo(?:Big|Little)|FloatTo(?:Big|Little)|Long(?:To(?:Big|Little)|LongTo(?:Big|Little)))|Int|Double|Float|L(?:ittle(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|ong(?:Long)?)))|H(?:ighlightRect|o(?:stByteOrder|meDirectory(?:ForUser)?)|eight|ash(?:Remove|Get|Insert(?:IfAbsent|KnownAbsent)?)|FSType(?:CodeFromFileType|OfFile))|N(?:umberOfColorComponents|ext(?:MapEnumeratorPair|HashEnumeratorItem))|C(?:o(?:n(?:tainsRect|vert(?:GlyphsToPackedGlyphs|Swapped(?:DoubleToHost|FloatToHost)|Host(?:DoubleToSwapped|FloatToSwapped)))|unt(?:MapTable|HashTable|Frames|Windows(?:ForContext)?)|py(?:M(?:emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(?:MapTables|HashTables))|lassFromString|reate(?:MapTable(?:WithZone)?|HashTable(?:WithZone)?|Zone|File(?:namePboardType|ContentsPboardType)))|TemporaryDirectory|I(?:s(?:ControllerMarker|EmptyRect|FreedObject)|n(?:setRect|crementExtraRefCount|te(?:r(?:sect(?:sRect|ionR(?:ect|ange))|faceStyleForKey)|gralRect)))|Zone(?:Realloc|Malloc|Name|Calloc|Fr(?:omPointer|ee))|O(?:penStepRootDirectory|ffsetRect)|D(?:i(?:sableScreenUpdates|videRect)|ottedFrameRect|e(?:c(?:imal(?:Round|Multiply|S(?:tring|ubtract)|Normalize|Co(?:py|mpa(?:ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(?:MemoryPages|Object))|raw(?:Gr(?:oove|ayBezel)|B(?:itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(?:hiteBezel|indowBackground)|LightBezel))|U(?:serName|n(?:ionR(?:ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(?:Bundle(?:Setup|Cleanup)|Setup(?:VirtualMachine)?|Needs(?:ToLoadClasses|VirtualMachine)|ClassesF(?:orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(?:oint(?:InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(?:n(?:d(?:MapTableEnumeration|HashTableEnumeration)|umerate(?:MapTable|HashTable)|ableScreenUpdates)|qual(?:R(?:ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(?:ileTypeForHFSTypeCode|ullUserName|r(?:ee(?:MapTable|HashTable)|ame(?:Rect(?:WithWidth(?:UsingOperation)?)?|Address)))|Wi(?:ndowList(?:ForContext)?|dth)|Lo(?:cationInRange|g(?:v|PageSize)?)|A(?:ccessibility(?:R(?:oleDescription(?:ForUIElement)?|aiseBadArgumentException)|Unignored(?:Children(?:ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(?:Main|Load)|vailableWindowDepths|ll(?:MapTable(?:Values|Keys)|HashTableObjects|ocate(?:MemoryPages|Collectable|Object)))))(?:\\b)" + }, + { + token: ["support.class.cocoa.leopard"], + regex: "(?:\\b)(NS(?:RuleEditor|G(?:arbageCollector|radient)|MapTable|HashTable|Co(?:ndition|llectionView(?:Item)?)|T(?:oolbarItemGroup|extInputClient|r(?:eeNode|ackingArea))|InvocationOperation|Operation(?:Queue)?|D(?:ictionaryController|ockTile)|P(?:ointer(?:Functions|Array)|athC(?:o(?:ntrol(?:Delegate)?|mponentCell)|ell(?:Delegate)?)|r(?:intPanelAccessorizing|edicateEditor(?:RowTemplate)?))|ViewController|FastEnumeration|Animat(?:ionContext|ablePropertyContainer)))(?:\\b)" + }, + { + token: ["support.class.cocoa"], + regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)" + }, + { + token: ["support.type.cocoa.leopard"], + regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)" + }, + { + token: ["support.class.quartz"], + regex: "(?:\\b)(C(?:I(?:Sampler|Co(?:ntext|lor)|Image(?:Accumulator)?|PlugIn(?:Registration)?|Vector|Kernel|Filter(?:Generator|Shape)?)|A(?:Renderer|MediaTiming(?:Function)?|BasicAnimation|ScrollLayer|Constraint(?:LayoutManager)?|T(?:iledLayer|extLayer|rans(?:ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(?:nimation(?:Group)?|ction))))(?:\\b)" + }, + { + token: ["support.type.quartz"], + regex: "(?:\\b)(C(?:G(?:Float|Point|Size|Rect)|IFormat|AConstraintAttribute))(?:\\b)" + }, + { + token: ["support.type.cocoa"], + regex: "(?:\\b)(NS(?:R(?:ect(?:Edge)?|ange)|G(?:lyph(?:Relation|LayoutMode)?|radientType)|M(?:odalSession|a(?:trixMode|p(?:Table|Enumerator)))|B(?:itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(?:cr(?:oll(?:er(?:Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(?:Granularity|Direction|Affinity)|wapped(?:Double|Float)|aveOperationType)|Ha(?:sh(?:Table|Enumerator)|ndler(?:2)?)|C(?:o(?:ntrol(?:Size|Tint)|mp(?:ositingOperation|arisonResult))|ell(?:State|Type|ImagePosition|Attribute))|T(?:hreadPrivate|ypesetterGlyphInfo|i(?:ckMarkPosition|tlePosition|meInterval)|o(?:ol(?:TipTag|bar(?:SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(?:TabType|Alignment)|ab(?:State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(?:ContextAuxiliary|PixelFormatAuxiliary)|D(?:ocumentChangeType|atePickerElementFlags|ra(?:werState|gOperation))|UsableScrollerParts|P(?:oint|r(?:intingPageOrder|ogressIndicator(?:Style|Th(?:ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(?:nt(?:SymbolicTraits|TraitMask|Action)|cusRingType)|W(?:indow(?:OrderingMode|Depth)|orkspace(?:IconCreationOptions|LaunchOptions)|ritingDirection)|L(?:ineBreakMode|ayout(?:Status|Direction))|A(?:nimation(?:Progress|Effect)|ppl(?:ication(?:TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle)))(?:\\b)" + }, + { + token: ["support.constant.cocoa"], + regex: "(?:\\b)(NS(?:NotFound|Ordered(?:Ascending|Descending|Same)))(?:\\b)" + }, + { + token: ["support.constant.notification.cocoa.leopard"], + regex: "(?:\\b)(NS(?:MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification)(?:\\b)" + }, + { + token: ["support.constant.notification.cocoa"], + regex: "(?:\\b)(NS(?:Menu(?:Did(?:RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(?:ystemColorsDidChange|plitView(?:DidResizeSubviews|WillResizeSubviews))|C(?:o(?:nt(?:extHelpModeDid(?:Deactivate|Activate)|rolT(?:intDidChange|extDid(?:BeginEditing|Change|EndEditing)))|lor(?:PanelColorDidChange|ListDidChange)|mboBox(?:Selection(?:IsChanging|DidChange)|Will(?:Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(?:oolbar(?:DidRemoveItem|WillAddItem)|ext(?:Storage(?:DidProcessEditing|WillProcessEditing)|Did(?:BeginEditing|Change|EndEditing)|View(?:DidChange(?:Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)))|ImageRepRegistryDidChange|OutlineView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)|Item(?:Did(?:Collapse|Expand)|Will(?:Collapse|Expand)))|Drawer(?:Did(?:Close|Open)|Will(?:Close|Open))|PopUpButton(?:CellWillPopUp|WillPopUp)|View(?:GlobalFrameDidChange|BoundsDidChange|F(?:ocusDidChange|rameDidChange))|FontSetChanged|W(?:indow(?:Did(?:Resi(?:ze|gn(?:Main|Key))|M(?:iniaturize|ove)|Become(?:Main|Key)|ChangeScreen(?:|Profile)|Deminiaturize|Update|E(?:ndSheet|xpose))|Will(?:M(?:iniaturize|ove)|BeginSheet|Close))|orkspace(?:SessionDid(?:ResignActive|BecomeActive)|Did(?:Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(?:Sleep|Unmount|PowerOff|LaunchApplication)))|A(?:ntialiasThresholdChanged|ppl(?:ication(?:Did(?:ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(?:nhide|pdate)|FinishLaunching)|Will(?:ResignActive|BecomeActive|Hide|Terminate|U(?:nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification)(?:\\b)" + }, + { + token: ["support.constant.cocoa.leopard"], + regex: "(?:\\b)(NS(?:RuleEditor(?:RowType(?:Simple|Compound)|NestingMode(?:Si(?:ngle|mple)|Compound|List))|GradientDraws(?:BeforeStartingLocation|AfterEndingLocation)|M(?:inusSetExpressionType|a(?:chPortDeallocate(?:ReceiveRight|SendRight|None)|pTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(?:oxCustom|undleExecutableArchitecture(?:X86|I386|PPC(?:64)?)|etweenPredicateOperatorType|ackgroundStyle(?:Raised|Dark|L(?:ight|owered)))|S(?:tring(?:DrawingTruncatesLastVisibleLine|EncodingConversion(?:ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(?:e(?:ech(?:SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(?:GrammarFlag|SpellingFlag))|litViewDividerStyleThi(?:n|ck))|e(?:rvice(?:RequestTimedOutError|M(?:iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(?:inimum|aximum)|Application(?:NotFoundError|LaunchFailedError))|gmentStyle(?:Round(?:Rect|ed)|SmallSquare|Capsule|Textured(?:Rounded|Square)|Automatic)))|H(?:UDWindowMask|ashTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(?:oModeColorPanel|etServiceNoAutoRename)|C(?:hangeRedone|o(?:ntainsPredicateOperatorType|l(?:orRenderingIntent(?:RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(?:None|ContentArea|TrackableArea|EditableTextArea))|T(?:imeZoneNameStyle(?:S(?:hort(?:Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(?:Regular|SourceList)|racking(?:Mouse(?:Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(?:ssumeInside|ctive(?:In(?:KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(?:n(?:tersectSetExpressionType|dexedColorSpaceModel)|mageScale(?:None|Proportionally(?:Down|UpOrDown)|AxesIndependently))|Ope(?:nGLPFAAllowOfflineRenderers|rationQueue(?:DefaultMaxConcurrentOperationCount|Priority(?:High|Normal|Very(?:High|Low)|Low)))|D(?:iacriticInsensitiveSearch|ownloadsDirectory)|U(?:nionSetExpressionType|TF(?:16(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(?:ointerFunctions(?:Ma(?:chVirtualMemory|llocMemory)|Str(?:ongMemory|uctPersonality)|C(?:StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(?:paque(?:Memory|Personality)|bjectP(?:ointerPersonality|ersonality)))|at(?:hStyle(?:Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(?:Scaling|Copies|Orientation|P(?:a(?:perSize|ge(?:Range|SetupAccessory))|review)))|Executable(?:RuntimeMismatchError|NotLoadableError|ErrorM(?:inimum|aximum)|L(?:inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(?:Initial|Prior)|F(?:i(?:ndPanelSubstringMatchType(?:StartsWith|Contains|EndsWith|FullWord)|leRead(?:TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(?:ndow(?:BackingLocation(?:MainMemory|Default|VideoMemory)|Sharing(?:Read(?:Only|Write)|None)|CollectionBehavior(?:MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType))(?:\\b)" + }, + { + token: ["support.constant.cocoa"], + regex: "(?:\\b)(NS(?:R(?:GB(?:ModeColorPanel|ColorSpaceModel)|ight(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey)|ound(?:RectBezelStyle|Bankers|ed(?:BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(?:CapStyle|JoinStyle))|un(?:StoppedResponse|ContinuesResponse|AbortedResponse)|e(?:s(?:izableWindowMask|et(?:CursorRectsRunLoopOrdering|FunctionKey))|ce(?:ssedBezelStyle|iver(?:sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(?:evancyLevelIndicatorStyle|ative(?:Before|After))|gular(?:SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(?:n(?:domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(?:ModeMatrix|Button)))|G(?:IFFileType|lyph(?:Below|Inscribe(?:B(?:elow|ase)|Over(?:strike|Below)|Above)|Layout(?:WithPrevious|A(?:tAPoint|gainstAPoint))|A(?:ttribute(?:BidiLevel|Soft|Inscribe|Elastic)|bove))|r(?:ooveBorder|eaterThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|a(?:y(?:ModeColorPanel|ColorSpaceModel)|dient(?:None|Con(?:cave(?:Strong|Weak)|vex(?:Strong|Weak)))|phiteControlTint)))|XML(?:N(?:o(?:tationDeclarationKind|de(?:CompactEmptyElement|IsCDATA|OptionsNone|Use(?:SingleQuotes|DoubleQuotes)|Pre(?:serve(?:NamespaceOrder|C(?:haracterReferences|DATA)|DTD|Prefixes|E(?:ntities|mptyElements)|Quotes|Whitespace|A(?:ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(?:ocument(?:X(?:MLKind|HTMLKind|Include)|HTMLKind|T(?:idy(?:XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(?:arser(?:GTRequiredError|XMLDeclNot(?:StartedError|FinishedError)|Mi(?:splaced(?:XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(?:StartedError|FinishedError))|S(?:t(?:andaloneValueError|ringNot(?:StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(?:MTOKENRequiredError|o(?:t(?:ationNot(?:StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(?:haracterRef(?:In(?:DTDError|PrologError|EpilogError)|AtEOFError)|o(?:nditionalSectionNot(?:StartedError|FinishedError)|mment(?:NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(?:ternalError|valid(?:HexCharacterRefError|C(?:haracter(?:RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(?:NameError|Error)))|OutOfMemoryError|D(?:ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(?:RI(?:RequiredError|FragmentError)|n(?:declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(?:CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(?:MissingSemiError|NoNameError|In(?:Internal(?:SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(?:ocessingInstructionNot(?:StartedError|FinishedError)|ematureDocumentEndError))|E(?:n(?:codingNotSupportedError|tity(?:Ref(?:In(?:DTDError|PrologError|EpilogError)|erence(?:MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(?:StartedError|FinishedError)|Is(?:ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(?:StartedError|FinishedError)|xt(?:ernalS(?:tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(?:iteralNot(?:StartedError|FinishedError)|T(?:RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(?:RedefinedError|HasNoValueError|Not(?:StartedError|FinishedError)|ListNot(?:StartedError|FinishedError)))|rocessingInstructionKind)|E(?:ntity(?:GeneralKind|DeclarationKind|UnparsedKind|P(?:ar(?:sedKind|ameterKind)|redefined))|lement(?:Declaration(?:MixedKind|UndefinedKind|E(?:lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(?:N(?:MToken(?:sKind|Kind)|otationKind)|CDATAKind|ID(?:Ref(?:sKind|Kind)|Kind)|DeclarationKind|En(?:tit(?:yKind|iesKind)|umerationKind)|Kind))|M(?:i(?:n(?:XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(?:nthCalendarUnit|deSwitchFunctionKey|use(?:Moved(?:Mask)?|E(?:ntered(?:Mask)?|ventSubtype|xited(?:Mask)?))|veToBezierPathElement|mentary(?:ChangeButton|Push(?:Button|InButton)|Light(?:Button)?))|enuFunctionKey|a(?:c(?:intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(?:XEdge|YEdge))|ACHOperatingSystem)|B(?:MPFileType|o(?:ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(?:Se(?:condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(?:zelBorder|velLineJoinStyle|low(?:Bottom|Top)|gin(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(?:spaceCharacter|tabTextMovement|ingStore(?:Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(?:owser(?:NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(?:h(?:ift(?:JISStringEncoding|KeyMask)|ow(?:ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(?:s(?:ReqFunctionKey|tem(?:D(?:omainMask|efined(?:Mask)?)|FunctionKey))|mbolStringEncoding)|c(?:a(?:nnedOption|le(?:None|ToFit|Proportionally))|r(?:oll(?:er(?:NoPart|Increment(?:Page|Line|Arrow)|Decrement(?:Page|Line|Arrow)|Knob(?:Slot)?|Arrows(?:M(?:inEnd|axEnd)|None|DefaultSetting))|Wheel(?:Mask)?|LockFunctionKey)|eenChangedEventType))|t(?:opFunctionKey|r(?:ingDrawing(?:OneShot|DisableScreenFontSubstitution|Uses(?:DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(?:Status(?:Reading|NotOpen|Closed|Open(?:ing)?|Error|Writing|AtEnd)|Event(?:Has(?:BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(?:ndEncountered|rrorOccurred)))))|i(?:ngle(?:DateMode|UnderlineStyle)|ze(?:DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(?:condCalendarUnit|lect(?:By(?:Character|Paragraph|Word)|i(?:ng(?:Next|Previous)|onAffinity(?:Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(?:Momentary|Select(?:One|Any)))|quareLineCapStyle|witchButton|ave(?:ToOperation|Op(?:tions(?:Yes|No|Ask)|eration)|AsOperation)|mall(?:SquareBezelStyle|C(?:ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(?:ighlightModeMatrix|SBModeColorPanel|o(?:ur(?:Minute(?:SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(?:Never|OnlyFromMainDocumentDomain|Always)|e(?:lp(?:ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(?:MonthDa(?:yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(?:o(?:n(?:StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(?:ification(?:SuspensionBehavior(?:Hold|Coalesce|D(?:eliverImmediately|rop))|NoCoalescing|CoalescingOn(?:Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(?:cr(?:iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(?:itle|opLevelContainersSpecifierError|abs(?:BezelBorder|NoBorder|LineBorder))|I(?:nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(?:ll(?:Glyph|CellType)|m(?:eric(?:Search|PadKeyMask)|berFormatter(?:Round(?:Half(?:Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(?:10|Default)|S(?:cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(?:ercentStyle|ad(?:Before(?:Suffix|Prefix)|After(?:Suffix|Prefix))))))|e(?:t(?:Services(?:BadArgumentError|NotFoundError|C(?:ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(?:StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(?:t(?:iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(?:hange(?:ReadOtherContents|GrayCell(?:Mask)?|BackgroundCell(?:Mask)?|Cleared|Done|Undone|Autosaved)|MYK(?:ModeColorPanel|ColorSpaceModel)|ircular(?:BezelStyle|Slider)|o(?:n(?:stantValueExpressionType|t(?:inuousCapacityLevelIndicatorStyle|entsCellMask|ain(?:sComparison|erSpecifierError)|rol(?:Glyph|KeyMask))|densedFontMask)|lor(?:Panel(?:RGBModeMask|GrayModeMask|HSBModeMask|C(?:MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(?:p(?:osite(?:XOR|Source(?:In|O(?:ut|ver)|Atop)|Highlight|C(?:opy|lear)|Destination(?:In|O(?:ut|ver)|Atop)|Plus(?:Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(?:stom(?:SelectorPredicateOperatorType|PaletteModeColorPanel)|r(?:sor(?:Update(?:Mask)?|PointingDevice)|veToBezierPathElement))|e(?:nterT(?:extAlignment|abStopType)|ll(?:State|H(?:ighlighted|as(?:Image(?:Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(?:Bordered|InsetButton)|Disabled|Editable|LightsBy(?:Gray|Background|Contents)|AllowsMixedState))|l(?:ipPagination|o(?:s(?:ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(?:ControlTint|DisplayFunctionKey|LineFunctionKey))|a(?:seInsensitive(?:Search|PredicateOption)|n(?:notCreateScriptCommandError|cel(?:Button|TextMovement))|chesDirectory|lculation(?:NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(?:itical(?:Request|AlertStyle)|ayonModeColorPanel))|T(?:hick(?:SquareBezelStyle|erSquareBezelStyle)|ypesetter(?:Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(?:ineBreakAction|atestBehavior))|i(?:ckMark(?:Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(?:olbarItemVisibilityPriority(?:Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(?:Compression(?:N(?:one|EXT)|CCITTFAX(?:3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(?:rminate(?:Now|Cancel|Later)|xt(?:Read(?:InapplicableDocumentTypeError|WriteErrorM(?:inimum|aximum))|Block(?:M(?:i(?:nimum(?:Height|Width)|ddleAlignment)|a(?:rgin|ximum(?:Height|Width)))|B(?:o(?:ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(?:ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(?:Characters|Attributes)|CellType|ured(?:RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(?:FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(?:RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(?:Character|TextMovement|le(?:tP(?:oint(?:Mask|EventSubtype)?|roximity(?:Mask|EventSubtype)?)|Column(?:NoResizing|UserResizingMask|AutoresizingMask)|View(?:ReverseSequentialColumnAutoresizingStyle|GridNone|S(?:olid(?:HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(?:n(?:sert(?:CharFunctionKey|FunctionKey|LineFunctionKey)|t(?:Type|ernalS(?:criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(?:Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(?:2022JPStringEncoding|Latin(?:1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(?:R(?:ight|ep(?:MatchesDevice|LoadStatus(?:ReadingHeader|Completed|InvalidData|Un(?:expectedEOF|knownType)|WillNeedAllData)))|Below|C(?:ellType|ache(?:BySize|Never|Default|Always))|Interpolation(?:High|None|Default|Low)|O(?:nly|verlaps)|Frame(?:Gr(?:oove|ayBezel)|Button|None|Photo)|L(?:oadStatus(?:ReadError|C(?:ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(?:lign(?:Right|Bottom(?:Right|Left)?|Center|Top(?:Right|Left)?|Left)|bove)))|O(?:n(?:State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|TextMovement)|SF1OperatingSystem|pe(?:n(?:GL(?:GO(?:Re(?:setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(?:R(?:obust|endererID)|M(?:inimumPolicy|ulti(?:sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(?:creenMask|te(?:ncilSize|reo)|ingleRenderer|upersample|ample(?:s|Buffers|Alpha))|NoRecovery|C(?:o(?:lor(?:Size|Float)|mpliant)|losestPolicy)|OffScreen|D(?:oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(?:cc(?:umSize|elerated)|ux(?:Buffers|DepthStencil)|l(?:phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(?:criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(?:B(?:itfield|oolType)|S(?:hortType|tr(?:ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(?:Type|longType)|ArrayType))|D(?:i(?:s(?:c(?:losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(?:Selection|PredicateModifier))|o(?:c(?:ModalWindowMask|ument(?:Directory|ationDirectory))|ubleType|wn(?:TextMovement|ArrowFunctionKey))|e(?:s(?:cendingPageOrder|ktopDirectory)|cimalTabStopType|v(?:ice(?:NColorSpaceModel|IndependentModifierFlagsMask)|eloper(?:Directory|ApplicationDirectory))|fault(?:ControlTint|TokenStyle)|lete(?:Char(?:acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(?:yCalendarUnit|teFormatter(?:MediumStyle|Behavior(?:10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(?:wer(?:Clos(?:ingState|edState)|Open(?:ingState|State))|gOperation(?:Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(?:ser(?:CancelledError|D(?:irectory|omainMask)|FunctionKey)|RL(?:Handle(?:NotLoaded|Load(?:Succeeded|InProgress|Failed))|CredentialPersistence(?:None|Permanent|ForSession))|n(?:scaledWindowMask|cachedRead|i(?:codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(?:o(?:CloseGroupingRunLoopOrdering|FunctionKey)|e(?:finedDateComponent|rline(?:Style(?:Single|None|Thick|Double)|Pattern(?:Solid|D(?:ot|ash(?:Dot(?:Dot)?)?)))))|known(?:ColorSpaceModel|P(?:ointingDevice|ageOrder)|KeyS(?:criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(?:dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(?:ustifiedTextAlignment|PEG(?:2000FileType|FileType)|apaneseEUC(?:GlyphPacking|StringEncoding))|P(?:o(?:s(?:t(?:Now|erFontMask|WhenIdle|ASAP)|iti(?:on(?:Replace|Be(?:fore|ginning)|End|After)|ve(?:IntType|DoubleType|FloatType)))|pUp(?:NoArrow|ArrowAt(?:Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(?:InCell(?:Mask)?|OnPushOffButton)|e(?:n(?:TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(?:Mask)?)|P(?:S(?:caleField|tatus(?:Title|Field)|aveButton)|N(?:ote(?:Title|Field)|ame(?:Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(?:a(?:perFeedButton|ge(?:Range(?:To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(?:useFunctionKey|ragraphSeparatorCharacter|ge(?:DownFunctionKey|UpFunctionKey))|r(?:int(?:ing(?:ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(?:NotFound|OK|Error)|FunctionKey)|o(?:p(?:ertyList(?:XMLFormat|MutableContainers(?:AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(?:BarStyle|SpinningStyle|Preferred(?:SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(?:ssedTab|vFunctionKey))|L(?:HeightForm|CancelButton|TitleField|ImageButton|O(?:KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(?:n(?:terCharacter|d(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|v(?:e(?:nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(?:Comparison|PredicateOperatorType)|ra(?:serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(?:clude(?:10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(?:i(?:ew(?:M(?:in(?:XMargin|YMargin)|ax(?:XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(?:lidationErrorM(?:inimum|aximum)|riableExpressionType))|Key(?:SpecifierEvaluationScriptError|Down(?:Mask)?|Up(?:Mask)?|PathExpressionType|Value(?:MinusSetMutation|SetSetMutation|Change(?:Re(?:placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(?:New|Old)|UnionSetMutation|ValidationError))|QTMovie(?:NormalPlayback|Looping(?:BackAndForthPlayback|Playback))|F(?:1(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(?:nd(?:PanelAction(?:Replace(?:A(?:ndFind|ll(?:InSelection)?))?|S(?:howFindPanel|e(?:tFindString|lectAll(?:InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(?:Read(?:No(?:SuchFileError|PermissionError)|CorruptFileError|In(?:validFileNameError|applicableStringEncodingError)|Un(?:supportedSchemeError|knownError))|HandlingPanel(?:CancelButton|OKButton)|NoSuchFileError|ErrorM(?:inimum|aximum)|Write(?:NoPermissionError|In(?:validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(?:supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(?:nt(?:Mo(?:noSpaceTrait|dernSerifsClass)|BoldTrait|S(?:ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(?:o(?:ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(?:ntegerAdvancementsRenderingMode|talicTrait)|O(?:ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(?:nknownClass|IOptimizedTrait)|Panel(?:S(?:hadowEffectModeMask|t(?:andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(?:ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(?:amilyClassMask|reeformSerifsClass)|Antialiased(?:RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(?:Below|Type(?:None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(?:attingError(?:M(?:inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(?:ExpressionType|KeyMask)|3(?:1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(?:RevertButton|S(?:ize(?:Title|Field)|etButton)|CurrentField|Preview(?:Button|Field))|l(?:oat(?:ingPointSamplesBitmapFormat|Type)|agsChanged(?:Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(?:heelModeColorPanel|indow(?:s(?:NTOperatingSystem|CP125(?:1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(?:InterfaceStyle|OperatingSystem))|M(?:iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(?:NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(?:ctivation|ddingToRecents)|A(?:sync|nd(?:Hide(?:Others)?|Print)|llowingClassicStartup))|eek(?:day(?:CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(?:ntsBidiLevels|rningAlertStyle)|r(?:itingDirection(?:RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(?:i(?:stModeMatrix|ne(?:Moves(?:Right|Down|Up|Left)|B(?:order|reakBy(?:C(?:harWrapping|lipping)|Truncating(?:Middle|Head|Tail)|WordWrapping))|S(?:eparatorCharacter|weep(?:Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(?:ssThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey))|a(?:yout(?:RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(?:sc(?:iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(?:y(?:Type|PredicateModifier|EventMask)|choredSearch|imation(?:Blocking|Nonblocking(?:Threaded)?|E(?:ffect(?:DisappearingItemDefault|Poof)|ase(?:In(?:Out)?|Out))|Linear)|dPredicateType)|t(?:Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(?:obe(?:GB1CharacterCollection|CNS1CharacterCollection|Japan(?:1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(?:saveOperation|Pagination)|pp(?:lication(?:SupportDirectory|D(?:irectory|e(?:fined(?:Mask)?|legateReply(?:Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(?:Mask)?)|l(?:ternateKeyMask|pha(?:ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(?:SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(?:ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(?:sWrongScriptError|EvaluationScriptError)|bove(?:Bottom|Top)|WTEventType)))(?:\\b)" + }, + { + token: "support.function.C99.c", + regex: C_Highlight_File.cFunctions + }, + { + token : cObj.getKeywords(), + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, + { + token: "punctuation.section.scope.begin.objc", + regex: "\\[", + next: "bracketed_content" + }, + { + token: "meta.function.objc", + regex: "^(?:-|\\+)\\s*" + } + ], + "constant_NSString": [ + { + token: "constant.character.escape.objc", + regex: escapedConstRe + }, + { + token: "invalid.illegal.unknown-escape.objc", + regex: "\\\\." + }, + { + token: "string", + regex: '[^"\\\\]+' + }, + { + token: "punctuation.definition.string.end", + regex: "\"", + next: "start" + } + ], + "protocol_list": [ + { + token: "punctuation.section.scope.end.objc", + regex: ">", + next: "start" + }, + { + token: "support.other.protocol.objc", + regex: "\bNS(?:GlyphStorage|M(?:utableCopying|enuItem)|C(?:hangeSpelling|o(?:ding|pying|lorPicking(?:Custom|Default)))|T(?:oolbarItemValidations|ext(?:Input|AttachmentCell))|I(?:nputServ(?:iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(?:CTypeSerializationCallBack|ect)|D(?:ecimalNumberBehaviors|raggingInfo)|U(?:serInterfaceValidations|RL(?:HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(?:ToobarItem|UserInterfaceItem)|Locking)\b" + } + ], + "selectors": [ + { + token: "support.function.any-method.name-of-parameter.objc", + regex: "\\b(?:[a-zA-Z_:][\\w]*)+" + }, + { + token: "punctuation", + regex: "\\)", + next: "start" + } + ], + "bracketed_content": [ + { + token: "punctuation.section.scope.end.objc", + regex: "]", + next: "start" + }, + { + token: ["support.function.any-method.objc"], + regex: "(?:predicateWithFormat:| NSPredicate predicateWithFormat:)", + next: "start" + }, + { + token: "support.function.any-method.objc", + regex: "\\w+(?::|(?=]))", + next: "start" + } + ], + "bracketed_strings": [ + { + token: "punctuation.section.scope.end.objc", + regex: "]", + next: "start" + }, + { + token: "keyword.operator.logical.predicate.cocoa", + regex: "\\b(?:AND|OR|NOT|IN)\\b" + }, + { + token: ["invalid.illegal.unknown-method.objc", "punctuation.separator.arguments.objc"], + regex: "\\b(\\w+)(:)" + }, + { + regex: "\\b(?:ALL|ANY|SOME|NONE)\\b", + token: "constant.language.predicate.cocoa" + }, + { + regex: "\\b(?:NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\\b", + token: "constant.language.predicate.cocoa" + }, + { + regex: "\\b(?:MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\\b", + token: "keyword.operator.comparison.predicate.cocoa" + }, + { + regex: "\\bC(?:ASEINSENSITIVE|I)\\b", + token: "keyword.other.modifier.predicate.cocoa" + }, + { + regex: "\\b(?:ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b", + token: "keyword.other.predicate.cocoa" + }, + { + regex: escapedConstRe, + token: "constant.character.escape.objc" + }, + { + regex: "\\\\.", + token: "invalid.illegal.unknown-escape.objc" + }, + { + token: "string", + regex: '[^"\\\\]' + }, + { + token: "punctuation.definition.string.end.objc", + regex: "\"", + next: "predicates" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : ".*?\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "methods" : [ + { + token : "meta.function.objc", + regex : "(?=\\{|#)|;", + next : "start" + } + ] +} + for (var r in cRules) { + if (this.$rules[r]) { + if (this.$rules[r].push) + this.$rules[r].push.apply(this.$rules[r], cRules[r]); + } else { + this.$rules[r] = cRules[r]; + } + } + + this.$rules.bracketed_content = this.$rules.bracketed_content.concat( + this.$rules.start, specialVariables + ); + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(ObjectiveCHighlightRules, CHighlightRules); + +exports.ObjectiveCHighlightRules = ObjectiveCHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/objectivec",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/objectivec_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ObjectiveCHighlightRules = require("./objectivec_highlight_rules").ObjectiveCHighlightRules; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = ObjectiveCHighlightRules; + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/objectivec"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-ocaml.js b/htdocs/includes/ace/mode-ocaml.js new file mode 100644 index 00000000000..29f26cc4f46 --- /dev/null +++ b/htdocs/includes/ace/mode-ocaml.js @@ -0,0 +1,414 @@ +ace.define("ace/mode/ocaml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var OcamlHighlightRules = function() { + + var keywords = ( + "and|as|assert|begin|class|constraint|do|done|downto|else|end|" + + "exception|external|for|fun|function|functor|if|in|include|" + + "inherit|initializer|lazy|let|match|method|module|mutable|new|" + + "object|of|open|or|private|rec|sig|struct|then|to|try|type|val|" + + "virtual|when|while|with" + ); + + var builtinConstants = ("true|false"); + + var builtinFunctions = ( + "abs|abs_big_int|abs_float|abs_num|abstract_tag|accept|access|acos|add|" + + "add_available_units|add_big_int|add_buffer|add_channel|add_char|" + + "add_initializer|add_int_big_int|add_interfaces|add_num|add_string|" + + "add_substitute|add_substring|alarm|allocated_bytes|allow_only|" + + "allow_unsafe_modules|always|append|appname_get|appname_set|" + + "approx_num_exp|approx_num_fix|arg|argv|arith_status|array|" + + "array1_of_genarray|array2_of_genarray|array3_of_genarray|asin|asr|" + + "assoc|assq|at_exit|atan|atan2|auto_synchronize|background|basename|" + + "beginning_of_input|big_int_of_int|big_int_of_num|big_int_of_string|bind|" + + "bind_class|bind_tag|bits|bits_of_float|black|blit|blit_image|blue|bool|" + + "bool_of_string|bounded_full_split|bounded_split|bounded_split_delim|" + + "bprintf|break|broadcast|bscanf|button_down|c_layout|capitalize|cardinal|" + + "cardinal|catch|catch_break|ceil|ceiling_num|channel|char|char_of_int|" + + "chdir|check|check_suffix|chmod|choose|chop_extension|chop_suffix|chown|" + + "chown|chr|chroot|classify_float|clear|clear_available_units|" + + "clear_close_on_exec|clear_graph|clear_nonblock|clear_parser|" + + "close|close|closeTk|close_box|close_graph|close_in|close_in_noerr|" + + "close_out|close_out_noerr|close_process|close_process|" + + "close_process_full|close_process_in|close_process_out|close_subwindow|" + + "close_tag|close_tbox|closedir|closedir|closure_tag|code|combine|" + + "combine|combine|command|compact|compare|compare_big_int|compare_num|" + + "complex32|complex64|concat|conj|connect|contains|contains_from|contents|" + + "copy|cos|cosh|count|count|counters|create|create_alarm|create_image|" + + "create_matrix|create_matrix|create_matrix|create_object|" + + "create_object_and_run_initializers|create_object_opt|create_process|" + + "create_process|create_process_env|create_process_env|create_table|" + + "current|current_dir_name|current_point|current_x|current_y|curveto|" + + "custom_tag|cyan|data_size|decr|decr_num|default_available_units|delay|" + + "delete_alarm|descr_of_in_channel|descr_of_out_channel|destroy|diff|dim|" + + "dim1|dim2|dim3|dims|dirname|display_mode|div|div_big_int|div_num|" + + "double_array_tag|double_tag|draw_arc|draw_char|draw_circle|draw_ellipse|" + + "draw_image|draw_poly|draw_poly_line|draw_rect|draw_segments|draw_string|" + + "dummy_pos|dummy_table|dump_image|dup|dup2|elements|empty|end_of_input|" + + "environment|eprintf|epsilon_float|eq_big_int|eq_num|equal|err_formatter|" + + "error_message|escaped|establish_server|executable_name|execv|execve|execvp|" + + "execvpe|exists|exists2|exit|exp|failwith|fast_sort|fchmod|fchown|field|" + + "file|file_exists|fill|fill_arc|fill_circle|fill_ellipse|fill_poly|fill_rect|" + + "filter|final_tag|finalise|find|find_all|first_chars|firstkey|flatten|" + + "float|float32|float64|float_of_big_int|float_of_bits|float_of_int|" + + "float_of_num|float_of_string|floor|floor_num|flush|flush_all|flush_input|" + + "flush_str_formatter|fold|fold_left|fold_left2|fold_right|fold_right2|" + + "for_all|for_all2|force|force_newline|force_val|foreground|fork|" + + "format_of_string|formatter_of_buffer|formatter_of_out_channel|" + + "fortran_layout|forward_tag|fprintf|frexp|from|from_channel|from_file|" + + "from_file_bin|from_function|from_string|fscanf|fst|fstat|ftruncate|" + + "full_init|full_major|full_split|gcd_big_int|ge_big_int|ge_num|" + + "genarray_of_array1|genarray_of_array2|genarray_of_array3|get|" + + "get_all_formatter_output_functions|get_approx_printing|get_copy|" + + "get_ellipsis_text|get_error_when_null_denominator|get_floating_precision|" + + "get_formatter_output_functions|get_formatter_tag_functions|get_image|" + + "get_margin|get_mark_tags|get_max_boxes|get_max_indent|get_method|" + + "get_method_label|get_normalize_ratio|get_normalize_ratio_when_printing|" + + "get_print_tags|get_state|get_variable|getcwd|getegid|getegid|getenv|" + + "getenv|getenv|geteuid|geteuid|getgid|getgid|getgrgid|getgrgid|getgrnam|" + + "getgrnam|getgroups|gethostbyaddr|gethostbyname|gethostname|getitimer|" + + "getlogin|getpeername|getpid|getppid|getprotobyname|getprotobynumber|" + + "getpwnam|getpwuid|getservbyname|getservbyport|getsockname|getsockopt|" + + "getsockopt_float|getsockopt_int|getsockopt_optint|gettimeofday|getuid|" + + "global_replace|global_substitute|gmtime|green|grid|group_beginning|" + + "group_end|gt_big_int|gt_num|guard|handle_unix_error|hash|hash_param|" + + "hd|header_size|i|id|ignore|in_channel_length|in_channel_of_descr|incr|" + + "incr_num|index|index_from|inet_addr_any|inet_addr_of_string|infinity|" + + "infix_tag|init|init_class|input|input_binary_int|input_byte|input_char|" + + "input_line|input_value|int|int16_signed|int16_unsigned|int32|int64|" + + "int8_signed|int8_unsigned|int_of_big_int|int_of_char|int_of_float|" + + "int_of_num|int_of_string|integer_num|inter|interactive|inv|invalid_arg|" + + "is_block|is_empty|is_implicit|is_int|is_int_big_int|is_integer_num|" + + "is_relative|iter|iter2|iteri|join|junk|key_pressed|kill|kind|kprintf|" + + "kscanf|land|last_chars|layout|lazy_from_fun|lazy_from_val|lazy_is_val|" + + "lazy_tag|ldexp|le_big_int|le_num|length|lexeme|lexeme_char|lexeme_end|" + + "lexeme_end_p|lexeme_start|lexeme_start_p|lineto|link|list|listen|lnot|" + + "loadfile|loadfile_private|localtime|lock|lockf|log|log10|logand|lognot|" + + "logor|logxor|lor|lower_window|lowercase|lseek|lsl|lsr|lstat|lt_big_int|" + + "lt_num|lxor|magenta|magic|mainLoop|major|major_slice|make|make_formatter|" + + "make_image|make_lexer|make_matrix|make_self_init|map|map2|map_file|mapi|" + + "marshal|match_beginning|match_end|matched_group|matched_string|max|" + + "max_array_length|max_big_int|max_elt|max_float|max_int|max_num|" + + "max_string_length|mem|mem_assoc|mem_assq|memq|merge|min|min_big_int|" + + "min_elt|min_float|min_int|min_num|minor|minus_big_int|minus_num|" + + "minus_one|mkdir|mkfifo|mktime|mod|mod_big_int|mod_float|mod_num|modf|" + + "mouse_pos|moveto|mul|mult_big_int|mult_int_big_int|mult_num|nan|narrow|" + + "nat_of_num|nativeint|neg|neg_infinity|new_block|new_channel|new_method|" + + "new_variable|next|nextkey|nice|nice|no_scan_tag|norm|norm2|not|npeek|" + + "nth|nth_dim|num_digits_big_int|num_dims|num_of_big_int|num_of_int|" + + "num_of_nat|num_of_ratio|num_of_string|O|obj|object_tag|ocaml_version|" + + "of_array|of_channel|of_float|of_int|of_int32|of_list|of_nativeint|" + + "of_string|one|openTk|open_box|open_connection|open_graph|open_hbox|" + + "open_hovbox|open_hvbox|open_in|open_in_bin|open_in_gen|open_out|" + + "open_out_bin|open_out_gen|open_process|open_process_full|open_process_in|" + + "open_process_out|open_subwindow|open_tag|open_tbox|open_temp_file|" + + "open_vbox|opendbm|opendir|openfile|or|os_type|out_channel_length|" + + "out_channel_of_descr|output|output_binary_int|output_buffer|output_byte|" + + "output_char|output_string|output_value|over_max_boxes|pack|params|" + + "parent_dir_name|parse|parse_argv|partition|pause|peek|pipe|pixels|" + + "place|plot|plots|point_color|polar|poll|pop|pos_in|pos_out|pow|" + + "power_big_int_positive_big_int|power_big_int_positive_int|" + + "power_int_positive_big_int|power_int_positive_int|power_num|" + + "pp_close_box|pp_close_tag|pp_close_tbox|pp_force_newline|" + + "pp_get_all_formatter_output_functions|pp_get_ellipsis_text|" + + "pp_get_formatter_output_functions|pp_get_formatter_tag_functions|" + + "pp_get_margin|pp_get_mark_tags|pp_get_max_boxes|pp_get_max_indent|" + + "pp_get_print_tags|pp_open_box|pp_open_hbox|pp_open_hovbox|pp_open_hvbox|" + + "pp_open_tag|pp_open_tbox|pp_open_vbox|pp_over_max_boxes|pp_print_as|" + + "pp_print_bool|pp_print_break|pp_print_char|pp_print_cut|pp_print_float|" + + "pp_print_flush|pp_print_if_newline|pp_print_int|pp_print_newline|" + + "pp_print_space|pp_print_string|pp_print_tab|pp_print_tbreak|" + + "pp_set_all_formatter_output_functions|pp_set_ellipsis_text|" + + "pp_set_formatter_out_channel|pp_set_formatter_output_functions|" + + "pp_set_formatter_tag_functions|pp_set_margin|pp_set_mark_tags|" + + "pp_set_max_boxes|pp_set_max_indent|pp_set_print_tags|pp_set_tab|" + + "pp_set_tags|pred|pred_big_int|pred_num|prerr_char|prerr_endline|" + + "prerr_float|prerr_int|prerr_newline|prerr_string|print|print_as|" + + "print_bool|print_break|print_char|print_cut|print_endline|print_float|" + + "print_flush|print_if_newline|print_int|print_newline|print_space|" + + "print_stat|print_string|print_tab|print_tbreak|printf|prohibit|" + + "public_method_label|push|putenv|quo_num|quomod_big_int|quote|raise|" + + "raise_window|ratio_of_num|rcontains_from|read|read_float|read_int|" + + "read_key|read_line|readdir|readdir|readlink|really_input|receive|recv|" + + "recvfrom|red|ref|regexp|regexp_case_fold|regexp_string|" + + "regexp_string_case_fold|register|register_exception|rem|remember_mode|" + + "remove|remove_assoc|remove_assq|rename|replace|replace_first|" + + "replace_matched|repr|reset|reshape|reshape_1|reshape_2|reshape_3|rev|" + + "rev_append|rev_map|rev_map2|rewinddir|rgb|rhs_end|rhs_end_pos|rhs_start|" + + "rhs_start_pos|rindex|rindex_from|rlineto|rmdir|rmoveto|round_num|" + + "run_initializers|run_initializers_opt|scanf|search_backward|" + + "search_forward|seek_in|seek_out|select|self|self_init|send|sendto|set|" + + "set_all_formatter_output_functions|set_approx_printing|" + + "set_binary_mode_in|set_binary_mode_out|set_close_on_exec|" + + "set_close_on_exec|set_color|set_ellipsis_text|" + + "set_error_when_null_denominator|set_field|set_floating_precision|" + + "set_font|set_formatter_out_channel|set_formatter_output_functions|" + + "set_formatter_tag_functions|set_line_width|set_margin|set_mark_tags|" + + "set_max_boxes|set_max_indent|set_method|set_nonblock|set_nonblock|" + + "set_normalize_ratio|set_normalize_ratio_when_printing|set_print_tags|" + + "set_signal|set_state|set_tab|set_tag|set_tags|set_text_size|" + + "set_window_title|setgid|setgid|setitimer|setitimer|setsid|setsid|" + + "setsockopt|setsockopt|setsockopt_float|setsockopt_float|setsockopt_int|" + + "setsockopt_int|setsockopt_optint|setsockopt_optint|setuid|setuid|" + + "shift_left|shift_left|shift_left|shift_right|shift_right|shift_right|" + + "shift_right_logical|shift_right_logical|shift_right_logical|show_buckets|" + + "shutdown|shutdown|shutdown_connection|shutdown_connection|sigabrt|" + + "sigalrm|sigchld|sigcont|sigfpe|sighup|sigill|sigint|sigkill|sign_big_int|" + + "sign_num|signal|signal|sigpending|sigpending|sigpipe|sigprocmask|" + + "sigprocmask|sigprof|sigquit|sigsegv|sigstop|sigsuspend|sigsuspend|" + + "sigterm|sigtstp|sigttin|sigttou|sigusr1|sigusr2|sigvtalrm|sin|singleton|" + + "sinh|size|size|size_x|size_y|sleep|sleep|sleep|slice_left|slice_left|" + + "slice_left_1|slice_left_2|slice_right|slice_right|slice_right_1|" + + "slice_right_2|snd|socket|socket|socket|socketpair|socketpair|sort|sound|" + + "split|split_delim|sprintf|sprintf|sqrt|sqrt|sqrt_big_int|square_big_int|" + + "square_num|sscanf|stable_sort|stable_sort|stable_sort|stable_sort|stable_sort|" + + "stable_sort|stat|stat|stat|stat|stat|stats|stats|std_formatter|stdbuf|" + + "stderr|stderr|stderr|stdib|stdin|stdin|stdin|stdout|stdout|stdout|" + + "str_formatter|string|string_after|string_before|string_match|" + + "string_of_big_int|string_of_bool|string_of_float|string_of_format|" + + "string_of_inet_addr|string_of_inet_addr|string_of_int|string_of_num|" + + "string_partial_match|string_tag|sub|sub|sub_big_int|sub_left|sub_num|" + + "sub_right|subset|subset|substitute_first|substring|succ|succ|" + + "succ|succ|succ_big_int|succ_num|symbol_end|symbol_end_pos|symbol_start|" + + "symbol_start_pos|symlink|symlink|sync|synchronize|system|system|system|" + + "tag|take|tan|tanh|tcdrain|tcdrain|tcflow|tcflow|tcflush|tcflush|" + + "tcgetattr|tcgetattr|tcsendbreak|tcsendbreak|tcsetattr|tcsetattr|" + + "temp_file|text_size|time|time|time|timed_read|timed_write|times|times|" + + "tl|tl|tl|to_buffer|to_channel|to_float|to_hex|to_int|to_int32|to_list|" + + "to_list|to_list|to_nativeint|to_string|to_string|to_string|to_string|" + + "to_string|top|top|total_size|transfer|transp|truncate|truncate|truncate|" + + "truncate|truncate|truncate|try_lock|umask|umask|uncapitalize|uncapitalize|" + + "uncapitalize|union|union|unit_big_int|unlink|unlink|unlock|unmarshal|" + + "unsafe_blit|unsafe_fill|unsafe_get|unsafe_get|unsafe_set|unsafe_set|" + + "update|uppercase|uppercase|uppercase|uppercase|usage|utimes|utimes|wait|" + + "wait|wait|wait|wait_next_event|wait_pid|wait_read|wait_signal|" + + "wait_timed_read|wait_timed_write|wait_write|waitpid|white|" + + "widen|window_id|word_size|wrap|wrap_abort|write|yellow|yield|zero|zero_big_int|" + + + "Arg|Arith_status|Array|Array1|Array2|Array3|ArrayLabels|Big_int|Bigarray|" + + "Buffer|Callback|CamlinternalOO|Char|Complex|Condition|Dbm|Digest|Dynlink|" + + "Event|Filename|Format|Gc|Genarray|Genlex|Graphics|GraphicsX11|Hashtbl|" + + "Int32|Int64|LargeFile|Lazy|Lexing|List|ListLabels|Make|Map|Marshal|" + + "MoreLabels|Mutex|Nativeint|Num|Obj|Oo|Parsing|Pervasives|Printexc|" + + "Printf|Queue|Random|Scanf|Scanning|Set|Sort|Stack|State|StdLabels|Str|" + + "Stream|String|StringLabels|Sys|Thread|ThreadUnix|Tk|Unix|UnixLabels|Weak" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "constant.language": builtinConstants, + "support.function": builtinFunctions + }, "identifier"); + + var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; + var octInteger = "(?:0[oO]?[0-7]+)"; + var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; + var binInteger = "(?:0[bB][01]+)"; + var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; + + var exponent = "(?:[eE][+-]?\\d+)"; + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : '\\(\\*.*?\\*\\)\\s*?$' + }, + { + token : "comment", + regex : '\\(\\*.*', + next : "comment" + }, + { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, + { + token : "string", // single char + regex : "'.'" + }, + { + token : "string", // " string + regex : '"', + next : "qstring" + }, + { + token : "constant.numeric", // imaginary + regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" + }, + { + token : "constant.numeric", // float + regex : floatNumber + }, + { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, + { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, + { + token : "keyword.operator", + regex : "\\+\\.|\\-\\.|\\*\\.|\\/\\.|#|;;|\\+|\\-|\\*|\\*\\*\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|<-|=" + }, + { + token : "paren.lparen", + regex : "[[({]" + }, + { + token : "paren.rparen", + regex : "[\\])}]" + }, + { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\)", + next : "start" + }, + { + defaultToken : "comment" + } + ], + + "qstring" : [ + { + token : "string", + regex : '"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ] + }; +}; + +oop.inherits(OcamlHighlightRules, TextHighlightRules); + +exports.OcamlHighlightRules = OcamlHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/ocaml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ocaml_highlight_rules","ace/mode/matching_brace_outdent","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var OcamlHighlightRules = require("./ocaml_highlight_rules").OcamlHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = OcamlHighlightRules; + this.$behaviour = this.$defaultBehaviour; + + this.$outdent = new MatchingBraceOutdent(); +}; +oop.inherits(Mode, TextMode); + +var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|with))\s*$/; + +(function() { + + this.toggleCommentLines = function(state, doc, startRow, endRow) { + var i, line; + var outdent = true; + var re = /^\s*\(\*(.*)\*\)/; + + for (i=startRow; i<= endRow; i++) { + if (!re.test(doc.getLine(i))) { + outdent = false; + break; + } + } + + var range = new Range(0, 0, 0, 0); + for (i=startRow; i<= endRow; i++) { + line = doc.getLine(i); + range.start.row = i; + range.end.row = i; + range.end.column = line.length; + + doc.replace(range, outdent ? line.match(re)[1] : "(*" + line + "*)"); + } + }; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + + if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && + state === 'start' && indenter.test(line)) + indent += tab; + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/ocaml"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-pascal.js b/htdocs/includes/ace/mode-pascal.js new file mode 100644 index 00000000000..9ccd1ed5e0c --- /dev/null +++ b/htdocs/includes/ace/mode-pascal.js @@ -0,0 +1,198 @@ +ace.define("ace/mode/pascal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PascalHighlightRules = function() { + + this.$rules = { start: + [ { caseInsensitive: true, + token: 'keyword.control.pascal', + regex: '\\b(?:(absolute|abstract|all|and|and_then|array|as|asm|attribute|begin|bindable|case|class|const|constructor|destructor|div|do|do|else|end|except|export|exports|external|far|file|finalization|finally|for|forward|goto|if|implementation|import|in|inherited|initialization|interface|interrupt|is|label|library|mod|module|name|near|nil|not|object|of|only|operator|or|or_else|otherwise|packed|pow|private|program|property|protected|public|published|qualified|record|repeat|resident|restricted|segment|set|shl|shr|then|to|try|type|unit|until|uses|value|var|view|virtual|while|with|xor))\\b' }, + { caseInsensitive: true, + token: + [ 'variable.pascal', "text", + 'storage.type.prototype.pascal', + 'entity.name.function.prototype.pascal' ], + regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?(?=(?:\\(.*?\\))?;\\s*(?:attribute|forward|external))' }, + { caseInsensitive: true, + token: + [ 'variable.pascal', "text", + 'storage.type.function.pascal', + 'entity.name.function.pascal' ], + regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?' }, + { token: 'constant.numeric.pascal', + regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b' }, + { token: 'punctuation.definition.comment.pascal', + regex: '--.*$', + push_: + [ { token: 'comment.line.double-dash.pascal.one', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.double-dash.pascal.one' } ] }, + { token: 'punctuation.definition.comment.pascal', + regex: '//.*$', + push_: + [ { token: 'comment.line.double-slash.pascal.two', + regex: '$', + next: 'pop' }, + { defaultToken: 'comment.line.double-slash.pascal.two' } ] }, + { token: 'punctuation.definition.comment.pascal', + regex: '\\(\\*', + push: + [ { token: 'punctuation.definition.comment.pascal', + regex: '\\*\\)', + next: 'pop' }, + { defaultToken: 'comment.block.pascal.one' } ] }, + { token: 'punctuation.definition.comment.pascal', + regex: '\\{', + push: + [ { token: 'punctuation.definition.comment.pascal', + regex: '\\}', + next: 'pop' }, + { defaultToken: 'comment.block.pascal.two' } ] }, + { token: 'punctuation.definition.string.begin.pascal', + regex: '"', + push: + [ { token: 'constant.character.escape.pascal', regex: '\\\\.' }, + { token: 'punctuation.definition.string.end.pascal', + regex: '"', + next: 'pop' }, + { defaultToken: 'string.quoted.double.pascal' } ] + }, + { token: 'punctuation.definition.string.begin.pascal', + regex: '\'', + push: + [ { token: 'constant.character.escape.apostrophe.pascal', + regex: '\'\'' }, + { token: 'punctuation.definition.string.end.pascal', + regex: '\'', + next: 'pop' }, + { defaultToken: 'string.quoted.single.pascal' } ] }, + { token: 'keyword.operator', + regex: '[+\\-;,/*%]|:=|=' } ] } + + this.normalizeRules(); +}; + +oop.inherits(PascalHighlightRules, TextHighlightRules); + +exports.PascalHighlightRules = PascalHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/pascal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/pascal_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PascalHighlightRules = require("./pascal_highlight_rules").PascalHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = PascalHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = ["--", "//"]; + this.blockComment = [ + {start: "(*", end: "*)"}, + {start: "{", end: "}"} + ]; + + this.$id = "ace/mode/pascal"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-perl.js b/htdocs/includes/ace/mode-perl.js new file mode 100644 index 00000000000..768c538331a --- /dev/null +++ b/htdocs/includes/ace/mode-perl.js @@ -0,0 +1,373 @@ +ace.define("ace/mode/perl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PerlHighlightRules = function() { + + var keywords = ( + "base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" + + "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars" + ); + + var buildinConstants = ("ARGV|ENV|INC|SIG"); + + var builtinFunctions = ( + "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" + + "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" + + "getpeername|setpriority|getprotoent|setprotoent|getpriority|" + + "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" + + "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" + + "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" + + "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" + + "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" + + "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" + + "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" + + "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" + + "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" + + "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" + + "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" + + "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" + + "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" + + "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" + + "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" + + "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" + + "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" + + "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" + + "map|die|uc|lc|do" + ); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": buildinConstants, + "support.function": builtinFunctions + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment.doc", + regex : "^=(?:begin|item)\\b", + next : "block_comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + regex : '["].*\\\\$', + next : "qqstring" + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "string", // multi line string start + regex : "['].*\\\\$", + next : "qstring" + }, { + token : "constant.numeric", // hex + regex : "0x[0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "%#|\\$#|\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)" + }, { + token : "comment", + regex : "#.*$" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "block_comment": [ + { + token: "comment.doc", + regex: "^=cut\\b", + next: "start" + }, + { + defaultToken: "comment.doc" + } + ] + }; +}; + +oop.inherits(PerlHighlightRules, TextHighlightRules); + +exports.PerlHighlightRules = PerlHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/perl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/perl_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PerlHighlightRules = require("./perl_highlight_rules").PerlHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = PerlHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new CStyleFoldMode({start: "^=(begin|item)\\b", end: "^=(cut)\\b"}); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "#"; + this.blockComment = [ + {start: "=begin", end: "=cut", lineStartOnly: true}, + {start: "=item", end: "=cut", lineStartOnly: true} + ]; + + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/perl"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-pgsql.js b/htdocs/includes/ace/mode-pgsql.js new file mode 100644 index 00000000000..189f17a559b --- /dev/null +++ b/htdocs/includes/ace/mode-pgsql.js @@ -0,0 +1,1500 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/perl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PerlHighlightRules = function() { + + var keywords = ( + "base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" + + "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars" + ); + + var buildinConstants = ("ARGV|ENV|INC|SIG"); + + var builtinFunctions = ( + "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" + + "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" + + "getpeername|setpriority|getprotoent|setprotoent|getpriority|" + + "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" + + "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" + + "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" + + "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" + + "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" + + "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" + + "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" + + "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" + + "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" + + "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" + + "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" + + "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" + + "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" + + "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" + + "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" + + "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" + + "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" + + "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" + + "map|die|uc|lc|do" + ); + + var keywordMapper = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": buildinConstants, + "support.function": builtinFunctions + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment.doc", + regex : "^=(?:begin|item)\\b", + next : "block_comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + regex : '["].*\\\\$', + next : "qqstring" + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "string", // multi line string start + regex : "['].*\\\\$", + next : "qstring" + }, { + token : "constant.numeric", // hex + regex : "0x[0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "%#|\\$#|\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)" + }, { + token : "comment", + regex : "#.*$" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "block_comment": [ + { + token: "comment.doc", + regex: "^=cut\\b", + next: "start" + }, + { + defaultToken: "comment.doc" + } + ] + }; +}; + +oop.inherits(PerlHighlightRules, TextHighlightRules); + +exports.PerlHighlightRules = PerlHighlightRules; +}); + +ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PythonHighlightRules = function() { + + var keywords = ( + "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" + + "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" + + "raise|return|try|while|with|yield" + ); + + var builtinConstants = ( + "True|False|None|NotImplemented|Ellipsis|__debug__" + ); + + var builtinFunctions = ( + "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" + + "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" + + "binfile|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 keywordMapper = this.createKeywordMapper({ + "invalid.deprecated": "debugger", + "support.function": builtinFunctions, + "constant.language": builtinConstants, + "keyword": keywords + }, "identifier"); + + var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; + + var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; + var octInteger = "(?:0[oO]?[0-7]+)"; + var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; + var binInteger = "(?:0[bB][01]+)"; + var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; + + var exponent = "(?:[eE][+-]?\\d+)"; + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + + var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; + + this.$rules = { + "start" : [ { + token : "comment", + regex : "#.*$" + }, { + token : "string", // multi line """ string start + regex : strPre + '"{3}', + next : "qqstring3" + }, { + token : "string", // " string + regex : strPre + '"(?=.)', + next : "qqstring" + }, { + token : "string", // multi line ''' string start + regex : strPre + "'{3}", + next : "qstring3" + }, { + token : "string", // ' string + regex : strPre + "'(?=.)", + next : "qstring" + }, { + token : "constant.numeric", // imaginary + regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // long integer + regex : integer + "[lL]\\b" + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]\\)\\}]" + }, { + token : "text", + regex : "\\s+" + } ], + "qqstring3" : [ { + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", // multi line """ string end + regex : '"{3}', + next : "start" + }, { + defaultToken : "string" + } ], + "qstring3" : [ { + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", // multi line ''' string end + regex : "'{3}", + next : "start" + }, { + defaultToken : "string" + } ], + "qqstring" : [{ + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "start" + }, { + defaultToken: "string" + }], + "qstring" : [{ + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", + regex : "\\\\$", + next : "qstring" + }, { + token : "string", + regex : "'|$", + next : "start" + }, { + defaultToken: "string" + }] + }; +}; + +oop.inherits(PythonHighlightRules, TextHighlightRules); + +exports.PythonHighlightRules = PythonHighlightRules; +}); + +ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var JsonHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "variable", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' + }, { + token : "string", // single line + regex : '"', + next : "string" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : "text", // single quoted strings are not allowed + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "comment", // comments are not allowed, but who cares? + regex : "\\/\\/.*$" + }, { + token : "comment.start", // comments are not allowed, but who cares? + regex : "\\/\\*", + next : "comment" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "string" : [ + { + token : "constant.language.escape", + regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ + }, { + token : "string", + regex : '"|$', + next : "start" + }, { + defaultToken : "string" + } + ], + "comment" : [ + { + token : "comment.end", // comments are not allowed, but who cares? + regex : "\\*\\/", + next : "start" + }, { + defaultToken: "comment" + } + ] + }; + +}; + +oop.inherits(JsonHighlightRules, TextHighlightRules); + +exports.JsonHighlightRules = JsonHighlightRules; +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/pgsql_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules","ace/mode/perl_highlight_rules","ace/mode/python_highlight_rules","ace/mode/json_highlight_rules","ace/mode/javascript_highlight_rules"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var PerlHighlightRules = require("./perl_highlight_rules").PerlHighlightRules; +var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules; +var JsonHighlightRules = require("./json_highlight_rules").JsonHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; + +var PgsqlHighlightRules = function() { + var keywords = ( + "abort|absolute|abstime|access|aclitem|action|add|admin|after|aggregate|all|also|alter|always|" + + "analyse|analyze|and|any|anyarray|anyelement|anyenum|anynonarray|anyrange|array|as|asc|" + + "assertion|assignment|asymmetric|at|attribute|authorization|backward|before|begin|between|" + + "bigint|binary|bit|bool|boolean|both|box|bpchar|by|bytea|cache|called|cascade|cascaded|case|cast|" + + "catalog|chain|char|character|characteristics|check|checkpoint|cid|cidr|circle|class|close|" + + "cluster|coalesce|collate|collation|column|comment|comments|commit|committed|concurrently|" + + "configuration|connection|constraint|constraints|content|continue|conversion|copy|cost|" + + "create|cross|cstring|csv|current|current_catalog|current_date|current_role|" + + "current_schema|current_time|current_timestamp|current_user|cursor|cycle|data|database|" + + "date|daterange|day|deallocate|dec|decimal|declare|default|defaults|deferrable|deferred|" + + "definer|delete|delimiter|delimiters|desc|dictionary|disable|discard|distinct|do|document|" + + "domain|double|drop|each|else|enable|encoding|encrypted|end|enum|escape|event|event_trigger|" + + "except|exclude|excluding|exclusive|execute|exists|explain|extension|external|extract|false|" + + "family|fdw_handler|fetch|first|float|float4|float8|following|for|force|foreign|forward|" + + "freeze|from|full|function|functions|global|grant|granted|greatest|group|gtsvector|handler|" + + "having|header|hold|hour|identity|if|ilike|immediate|immutable|implicit|in|including|" + + "increment|index|indexes|inet|inherit|inherits|initially|inline|inner|inout|input|" + + "insensitive|insert|instead|int|int2|int2vector|int4|int4range|int8|int8range|integer|" + + "internal|intersect|interval|into|invoker|is|isnull|isolation|join|json|key|label|language|" + + "language_handler|large|last|lateral|lc_collate|lc_ctype|leading|leakproof|least|left|level|" + + "like|limit|line|listen|load|local|localtime|localtimestamp|location|lock|lseg|macaddr|" + + "mapping|match|materialized|maxvalue|minute|minvalue|mode|money|month|move|name|names|" + + "national|natural|nchar|next|no|none|not|nothing|notify|notnull|nowait|null|nullif|nulls|" + + "numeric|numrange|object|of|off|offset|oid|oids|oidvector|on|only|opaque|operator|option|" + + "options|or|order|out|outer|over|overlaps|overlay|owned|owner|parser|partial|partition|passing|" + + "password|path|pg_attribute|pg_auth_members|pg_authid|pg_class|pg_database|pg_node_tree|" + + "pg_proc|pg_type|placing|plans|point|polygon|position|preceding|precision|prepare|prepared|" + + "preserve|primary|prior|privileges|procedural|procedure|program|quote|range|read|real|" + + "reassign|recheck|record|recursive|ref|refcursor|references|refresh|regclass|regconfig|" + + "regdictionary|regoper|regoperator|regproc|regprocedure|regtype|reindex|relative|release|" + + "reltime|rename|repeatable|replace|replica|reset|restart|restrict|returning|returns|revoke|" + + "right|role|rollback|row|rows|rule|savepoint|schema|scroll|search|second|security|select|" + + "sequence|sequences|serializable|server|session|session_user|set|setof|share|show|similar|" + + "simple|smallint|smgr|snapshot|some|stable|standalone|start|statement|statistics|stdin|" + + "stdout|storage|strict|strip|substring|symmetric|sysid|system|table|tables|tablespace|temp|" + + "template|temporary|text|then|tid|time|timestamp|timestamptz|timetz|tinterval|to|trailing|" + + "transaction|treat|trigger|trim|true|truncate|trusted|tsquery|tsrange|tstzrange|tsvector|" + + "txid_snapshot|type|types|unbounded|uncommitted|unencrypted|union|unique|unknown|unlisten|" + + "unlogged|until|update|user|using|uuid|vacuum|valid|validate|validator|value|values|varbit|" + + "varchar|variadic|varying|verbose|version|view|void|volatile|when|where|whitespace|window|" + + "with|without|work|wrapper|write|xid|xml|xmlattributes|xmlconcat|xmlelement|xmlexists|" + + "xmlforest|xmlparse|xmlpi|xmlroot|xmlserialize|year|yes|zone" + ); + + + var builtinFunctions = ( + "RI_FKey_cascade_del|RI_FKey_cascade_upd|RI_FKey_check_ins|RI_FKey_check_upd|" + + "RI_FKey_noaction_del|RI_FKey_noaction_upd|RI_FKey_restrict_del|RI_FKey_restrict_upd|" + + "RI_FKey_setdefault_del|RI_FKey_setdefault_upd|RI_FKey_setnull_del|" + + "RI_FKey_setnull_upd|abbrev|abs|abstime|abstimeeq|abstimege|abstimegt|abstimein|abstimele|" + + "abstimelt|abstimene|abstimeout|abstimerecv|abstimesend|aclcontains|acldefault|" + + "aclexplode|aclinsert|aclitemeq|aclitemin|aclitemout|aclremove|acos|age|any_in|any_out|" + + "anyarray_in|anyarray_out|anyarray_recv|anyarray_send|anyelement_in|anyelement_out|" + + "anyenum_in|anyenum_out|anynonarray_in|anynonarray_out|anyrange_in|anyrange_out|" + + "anytextcat|area|areajoinsel|areasel|array_agg|array_agg_finalfn|array_agg_transfn|" + + "array_append|array_cat|array_dims|array_eq|array_fill|array_ge|array_gt|array_in|" + + "array_larger|array_le|array_length|array_lower|array_lt|array_ndims|array_ne|array_out|" + + "array_prepend|array_recv|array_remove|array_replace|array_send|array_smaller|" + + "array_to_json|array_to_string|array_typanalyze|array_upper|arraycontained|" + + "arraycontains|arraycontjoinsel|arraycontsel|arrayoverlap|ascii|ascii_to_mic|" + + "ascii_to_utf8|asin|atan|atan2|avg|big5_to_euc_tw|big5_to_mic|big5_to_utf8|bit_and|bit_in|" + + "bit_length|bit_or|bit_out|bit_recv|bit_send|bitand|bitcat|bitcmp|biteq|bitge|bitgt|bitle|" + + "bitlt|bitne|bitnot|bitor|bitshiftleft|bitshiftright|bittypmodin|bittypmodout|bitxor|bool|" + + "bool_and|bool_or|booland_statefunc|booleq|boolge|boolgt|boolin|boolle|boollt|boolne|" + + "boolor_statefunc|boolout|boolrecv|boolsend|box|box_above|box_above_eq|box_add|box_below|" + + "box_below_eq|box_center|box_contain|box_contain_pt|box_contained|box_distance|box_div|" + + "box_eq|box_ge|box_gt|box_in|box_intersect|box_le|box_left|box_lt|box_mul|box_out|" + + "box_overabove|box_overbelow|box_overlap|box_overleft|box_overright|box_recv|box_right|" + + "box_same|box_send|box_sub|bpchar_larger|bpchar_pattern_ge|bpchar_pattern_gt|" + + "bpchar_pattern_le|bpchar_pattern_lt|bpchar_smaller|bpcharcmp|bpchareq|bpcharge|" + + "bpchargt|bpchariclike|bpcharicnlike|bpcharicregexeq|bpcharicregexne|bpcharin|bpcharle|" + + "bpcharlike|bpcharlt|bpcharne|bpcharnlike|bpcharout|bpcharrecv|bpcharregexeq|" + + "bpcharregexne|bpcharsend|bpchartypmodin|bpchartypmodout|broadcast|btabstimecmp|" + + "btarraycmp|btbeginscan|btboolcmp|btbpchar_pattern_cmp|btbuild|btbuildempty|" + + "btbulkdelete|btcanreturn|btcharcmp|btcostestimate|btendscan|btfloat48cmp|btfloat4cmp|" + + "btfloat4sortsupport|btfloat84cmp|btfloat8cmp|btfloat8sortsupport|btgetbitmap|" + + "btgettuple|btinsert|btint24cmp|btint28cmp|btint2cmp|btint2sortsupport|btint42cmp|" + + "btint48cmp|btint4cmp|btint4sortsupport|btint82cmp|btint84cmp|btint8cmp|" + + "btint8sortsupport|btmarkpos|btnamecmp|btnamesortsupport|btoidcmp|btoidsortsupport|" + + "btoidvectorcmp|btoptions|btrecordcmp|btreltimecmp|btrescan|btrestrpos|btrim|" + + "bttext_pattern_cmp|bttextcmp|bttidcmp|bttintervalcmp|btvacuumcleanup|" + + "bytea_string_agg_finalfn|bytea_string_agg_transfn|byteacat|byteacmp|byteaeq|byteage|" + + "byteagt|byteain|byteale|bytealike|bytealt|byteane|byteanlike|byteaout|bytearecv|byteasend|" + + "cash_cmp|cash_div_cash|cash_div_flt4|cash_div_flt8|cash_div_int2|cash_div_int4|cash_eq|" + + "cash_ge|cash_gt|cash_in|cash_le|cash_lt|cash_mi|cash_mul_flt4|cash_mul_flt8|" + + "cash_mul_int2|cash_mul_int4|cash_ne|cash_out|cash_pl|cash_recv|cash_send|cash_words|" + + "cashlarger|cashsmaller|cbrt|ceil|ceiling|center|char|char_length|character_length|chareq|" + + "charge|chargt|charin|charle|charlt|charne|charout|charrecv|charsend|chr|cideq|cidin|cidout|" + + "cidr|cidr_in|cidr_out|cidr_recv|cidr_send|cidrecv|cidsend|circle|circle_above|" + + "circle_add_pt|circle_below|circle_center|circle_contain|circle_contain_pt|" + + "circle_contained|circle_distance|circle_div_pt|circle_eq|circle_ge|circle_gt|circle_in|" + + "circle_le|circle_left|circle_lt|circle_mul_pt|circle_ne|circle_out|circle_overabove|" + + "circle_overbelow|circle_overlap|circle_overleft|circle_overright|circle_recv|" + + "circle_right|circle_same|circle_send|circle_sub_pt|clock_timestamp|close_lb|close_ls|" + + "close_lseg|close_pb|close_pl|close_ps|close_sb|close_sl|col_description|concat|concat_ws|" + + "contjoinsel|contsel|convert|convert_from|convert_to|corr|cos|cot|count|covar_pop|" + + "covar_samp|cstring_in|cstring_out|cstring_recv|cstring_send|cume_dist|current_database|" + + "current_query|current_schema|current_schemas|current_setting|current_user|currtid|" + + "currtid2|currval|cursor_to_xml|cursor_to_xmlschema|database_to_xml|" + + "database_to_xml_and_xmlschema|database_to_xmlschema|date|date_cmp|date_cmp_timestamp|" + + "date_cmp_timestamptz|date_eq|date_eq_timestamp|date_eq_timestamptz|date_ge|" + + "date_ge_timestamp|date_ge_timestamptz|date_gt|date_gt_timestamp|date_gt_timestamptz|" + + "date_in|date_larger|date_le|date_le_timestamp|date_le_timestamptz|date_lt|" + + "date_lt_timestamp|date_lt_timestamptz|date_mi|date_mi_interval|date_mii|date_ne|" + + "date_ne_timestamp|date_ne_timestamptz|date_out|date_part|date_pl_interval|date_pli|" + + "date_recv|date_send|date_smaller|date_sortsupport|date_trunc|daterange|" + + "daterange_canonical|daterange_subdiff|datetime_pl|datetimetz_pl|dcbrt|decode|degrees|" + + "dense_rank|dexp|diagonal|diameter|dispell_init|dispell_lexize|dist_cpoly|dist_lb|dist_pb|" + + "dist_pc|dist_pl|dist_ppath|dist_ps|dist_sb|dist_sl|div|dlog1|dlog10|domain_in|domain_recv|" + + "dpow|dround|dsimple_init|dsimple_lexize|dsnowball_init|dsnowball_lexize|dsqrt|" + + "dsynonym_init|dsynonym_lexize|dtrunc|elem_contained_by_range|encode|enum_cmp|enum_eq|" + + "enum_first|enum_ge|enum_gt|enum_in|enum_larger|enum_last|enum_le|enum_lt|enum_ne|enum_out|" + + "enum_range|enum_recv|enum_send|enum_smaller|eqjoinsel|eqsel|euc_cn_to_mic|" + + "euc_cn_to_utf8|euc_jis_2004_to_shift_jis_2004|euc_jis_2004_to_utf8|euc_jp_to_mic|" + + "euc_jp_to_sjis|euc_jp_to_utf8|euc_kr_to_mic|euc_kr_to_utf8|euc_tw_to_big5|" + + "euc_tw_to_mic|euc_tw_to_utf8|event_trigger_in|event_trigger_out|every|exp|factorial|" + + "family|fdw_handler_in|fdw_handler_out|first_value|float4|float48div|float48eq|float48ge|" + + "float48gt|float48le|float48lt|float48mi|float48mul|float48ne|float48pl|float4_accum|" + + "float4abs|float4div|float4eq|float4ge|float4gt|float4in|float4larger|float4le|float4lt|" + + "float4mi|float4mul|float4ne|float4out|float4pl|float4recv|float4send|float4smaller|" + + "float4um|float4up|float8|float84div|float84eq|float84ge|float84gt|float84le|float84lt|" + + "float84mi|float84mul|float84ne|float84pl|float8_accum|float8_avg|float8_corr|" + + "float8_covar_pop|float8_covar_samp|float8_regr_accum|float8_regr_avgx|" + + "float8_regr_avgy|float8_regr_intercept|float8_regr_r2|float8_regr_slope|" + + "float8_regr_sxx|float8_regr_sxy|float8_regr_syy|float8_stddev_pop|float8_stddev_samp|" + + "float8_var_pop|float8_var_samp|float8abs|float8div|float8eq|float8ge|float8gt|float8in|" + + "float8larger|float8le|float8lt|float8mi|float8mul|float8ne|float8out|float8pl|float8recv|" + + "float8send|float8smaller|float8um|float8up|floor|flt4_mul_cash|flt8_mul_cash|" + + "fmgr_c_validator|fmgr_internal_validator|fmgr_sql_validator|format|format_type|" + + "gb18030_to_utf8|gbk_to_utf8|generate_series|generate_subscripts|get_bit|get_byte|" + + "get_current_ts_config|getdatabaseencoding|getpgusername|gin_cmp_prefix|" + + "gin_cmp_tslexeme|gin_extract_tsquery|gin_extract_tsvector|gin_tsquery_consistent|" + + "ginarrayconsistent|ginarrayextract|ginbeginscan|ginbuild|ginbuildempty|ginbulkdelete|" + + "gincostestimate|ginendscan|gingetbitmap|gininsert|ginmarkpos|ginoptions|" + + "ginqueryarrayextract|ginrescan|ginrestrpos|ginvacuumcleanup|gist_box_compress|" + + "gist_box_consistent|gist_box_decompress|gist_box_penalty|gist_box_picksplit|" + + "gist_box_same|gist_box_union|gist_circle_compress|gist_circle_consistent|" + + "gist_point_compress|gist_point_consistent|gist_point_distance|gist_poly_compress|" + + "gist_poly_consistent|gistbeginscan|gistbuild|gistbuildempty|gistbulkdelete|" + + "gistcostestimate|gistendscan|gistgetbitmap|gistgettuple|gistinsert|gistmarkpos|" + + "gistoptions|gistrescan|gistrestrpos|gistvacuumcleanup|gtsquery_compress|" + + "gtsquery_consistent|gtsquery_decompress|gtsquery_penalty|gtsquery_picksplit|" + + "gtsquery_same|gtsquery_union|gtsvector_compress|gtsvector_consistent|" + + "gtsvector_decompress|gtsvector_penalty|gtsvector_picksplit|gtsvector_same|" + + "gtsvector_union|gtsvectorin|gtsvectorout|has_any_column_privilege|" + + "has_column_privilege|has_database_privilege|has_foreign_data_wrapper_privilege|" + + "has_function_privilege|has_language_privilege|has_schema_privilege|" + + "has_sequence_privilege|has_server_privilege|has_table_privilege|" + + "has_tablespace_privilege|has_type_privilege|hash_aclitem|hash_array|hash_numeric|" + + "hash_range|hashbeginscan|hashbpchar|hashbuild|hashbuildempty|hashbulkdelete|hashchar|" + + "hashcostestimate|hashendscan|hashenum|hashfloat4|hashfloat8|hashgetbitmap|hashgettuple|" + + "hashinet|hashinsert|hashint2|hashint2vector|hashint4|hashint8|hashmacaddr|hashmarkpos|" + + "hashname|hashoid|hashoidvector|hashoptions|hashrescan|hashrestrpos|hashtext|" + + "hashvacuumcleanup|hashvarlena|height|host|hostmask|iclikejoinsel|iclikesel|" + + "icnlikejoinsel|icnlikesel|icregexeqjoinsel|icregexeqsel|icregexnejoinsel|icregexnesel|" + + "inet_client_addr|inet_client_port|inet_in|inet_out|inet_recv|inet_send|" + + "inet_server_addr|inet_server_port|inetand|inetmi|inetmi_int8|inetnot|inetor|inetpl|" + + "initcap|int2|int24div|int24eq|int24ge|int24gt|int24le|int24lt|int24mi|int24mul|int24ne|" + + "int24pl|int28div|int28eq|int28ge|int28gt|int28le|int28lt|int28mi|int28mul|int28ne|int28pl|" + + "int2_accum|int2_avg_accum|int2_mul_cash|int2_sum|int2abs|int2and|int2div|int2eq|int2ge|" + + "int2gt|int2in|int2larger|int2le|int2lt|int2mi|int2mod|int2mul|int2ne|int2not|int2or|int2out|" + + "int2pl|int2recv|int2send|int2shl|int2shr|int2smaller|int2um|int2up|int2vectoreq|" + + "int2vectorin|int2vectorout|int2vectorrecv|int2vectorsend|int2xor|int4|int42div|int42eq|" + + "int42ge|int42gt|int42le|int42lt|int42mi|int42mul|int42ne|int42pl|int48div|int48eq|int48ge|" + + "int48gt|int48le|int48lt|int48mi|int48mul|int48ne|int48pl|int4_accum|int4_avg_accum|" + + "int4_mul_cash|int4_sum|int4abs|int4and|int4div|int4eq|int4ge|int4gt|int4in|int4inc|" + + "int4larger|int4le|int4lt|int4mi|int4mod|int4mul|int4ne|int4not|int4or|int4out|int4pl|" + + "int4range|int4range_canonical|int4range_subdiff|int4recv|int4send|int4shl|int4shr|" + + "int4smaller|int4um|int4up|int4xor|int8|int82div|int82eq|int82ge|int82gt|int82le|int82lt|" + + "int82mi|int82mul|int82ne|int82pl|int84div|int84eq|int84ge|int84gt|int84le|int84lt|int84mi|" + + "int84mul|int84ne|int84pl|int8_accum|int8_avg|int8_avg_accum|int8_sum|int8abs|int8and|" + + "int8div|int8eq|int8ge|int8gt|int8in|int8inc|int8inc_any|int8inc_float8_float8|int8larger|" + + "int8le|int8lt|int8mi|int8mod|int8mul|int8ne|int8not|int8or|int8out|int8pl|int8pl_inet|" + + "int8range|int8range_canonical|int8range_subdiff|int8recv|int8send|int8shl|int8shr|" + + "int8smaller|int8um|int8up|int8xor|integer_pl_date|inter_lb|inter_sb|inter_sl|internal_in|" + + "internal_out|interval_accum|interval_avg|interval_cmp|interval_div|interval_eq|" + + "interval_ge|interval_gt|interval_hash|interval_in|interval_larger|interval_le|" + + "interval_lt|interval_mi|interval_mul|interval_ne|interval_out|interval_pl|" + + "interval_pl_date|interval_pl_time|interval_pl_timestamp|interval_pl_timestamptz|" + + "interval_pl_timetz|interval_recv|interval_send|interval_smaller|interval_transform|" + + "interval_um|intervaltypmodin|intervaltypmodout|intinterval|isclosed|isempty|isfinite|" + + "ishorizontal|iso8859_1_to_utf8|iso8859_to_utf8|iso_to_koi8r|iso_to_mic|iso_to_win1251|" + + "iso_to_win866|isopen|isparallel|isperp|isvertical|johab_to_utf8|json_agg|" + + "json_agg_finalfn|json_agg_transfn|json_array_element|json_array_element_text|" + + "json_array_elements|json_array_length|json_each|json_each_text|json_extract_path|" + + "json_extract_path_op|json_extract_path_text|json_extract_path_text_op|json_in|" + + "json_object_field|json_object_field_text|json_object_keys|json_out|" + + "json_populate_record|json_populate_recordset|json_recv|json_send|justify_days|" + + "justify_hours|justify_interval|koi8r_to_iso|koi8r_to_mic|koi8r_to_utf8|" + + "koi8r_to_win1251|koi8r_to_win866|koi8u_to_utf8|lag|language_handler_in|" + + "language_handler_out|last_value|lastval|latin1_to_mic|latin2_to_mic|latin2_to_win1250|" + + "latin3_to_mic|latin4_to_mic|lead|left|length|like|like_escape|likejoinsel|likesel|line|" + + "line_distance|line_eq|line_horizontal|line_in|line_interpt|line_intersect|line_out|" + + "line_parallel|line_perp|line_recv|line_send|line_vertical|ln|lo_close|lo_creat|lo_create|" + + "lo_export|lo_import|lo_lseek|lo_lseek64|lo_open|lo_tell|lo_tell64|lo_truncate|" + + "lo_truncate64|lo_unlink|log|loread|lower|lower_inc|lower_inf|lowrite|lpad|lseg|lseg_center|" + + "lseg_distance|lseg_eq|lseg_ge|lseg_gt|lseg_horizontal|lseg_in|lseg_interpt|" + + "lseg_intersect|lseg_le|lseg_length|lseg_lt|lseg_ne|lseg_out|lseg_parallel|lseg_perp|" + + "lseg_recv|lseg_send|lseg_vertical|ltrim|macaddr_and|macaddr_cmp|macaddr_eq|macaddr_ge|" + + "macaddr_gt|macaddr_in|macaddr_le|macaddr_lt|macaddr_ne|macaddr_not|macaddr_or|" + + "macaddr_out|macaddr_recv|macaddr_send|makeaclitem|masklen|max|md5|mic_to_ascii|" + + "mic_to_big5|mic_to_euc_cn|mic_to_euc_jp|mic_to_euc_kr|mic_to_euc_tw|mic_to_iso|" + + "mic_to_koi8r|mic_to_latin1|mic_to_latin2|mic_to_latin3|mic_to_latin4|mic_to_sjis|" + + "mic_to_win1250|mic_to_win1251|mic_to_win866|min|mktinterval|mod|money|mul_d_interval|" + + "name|nameeq|namege|namegt|nameiclike|nameicnlike|nameicregexeq|nameicregexne|namein|" + + "namele|namelike|namelt|namene|namenlike|nameout|namerecv|nameregexeq|nameregexne|namesend|" + + "neqjoinsel|neqsel|netmask|network|network_cmp|network_eq|network_ge|network_gt|" + + "network_le|network_lt|network_ne|network_sub|network_subeq|network_sup|network_supeq|" + + "nextval|nlikejoinsel|nlikesel|notlike|now|npoints|nth_value|ntile|numeric_abs|" + + "numeric_accum|numeric_add|numeric_avg|numeric_avg_accum|numeric_cmp|numeric_div|" + + "numeric_div_trunc|numeric_eq|numeric_exp|numeric_fac|numeric_ge|numeric_gt|numeric_in|" + + "numeric_inc|numeric_larger|numeric_le|numeric_ln|numeric_log|numeric_lt|numeric_mod|" + + "numeric_mul|numeric_ne|numeric_out|numeric_power|numeric_recv|numeric_send|" + + "numeric_smaller|numeric_sqrt|numeric_stddev_pop|numeric_stddev_samp|numeric_sub|" + + "numeric_transform|numeric_uminus|numeric_uplus|numeric_var_pop|numeric_var_samp|" + + "numerictypmodin|numerictypmodout|numnode|numrange|numrange_subdiff|obj_description|" + + "octet_length|oid|oideq|oidge|oidgt|oidin|oidlarger|oidle|oidlt|oidne|oidout|oidrecv|oidsend|" + + "oidsmaller|oidvectoreq|oidvectorge|oidvectorgt|oidvectorin|oidvectorle|oidvectorlt|" + + "oidvectorne|oidvectorout|oidvectorrecv|oidvectorsend|oidvectortypes|on_pb|on_pl|" + + "on_ppath|on_ps|on_sb|on_sl|opaque_in|opaque_out|overlaps|overlay|path|path_add|path_add_pt|" + + "path_center|path_contain_pt|path_distance|path_div_pt|path_in|path_inter|path_length|" + + "path_mul_pt|path_n_eq|path_n_ge|path_n_gt|path_n_le|path_n_lt|path_npoints|path_out|" + + "path_recv|path_send|path_sub_pt|pclose|percent_rank|pg_advisory_lock|" + + "pg_advisory_lock_shared|pg_advisory_unlock|pg_advisory_unlock_all|" + + "pg_advisory_unlock_shared|pg_advisory_xact_lock|pg_advisory_xact_lock_shared|" + + "pg_available_extension_versions|pg_available_extensions|pg_backend_pid|" + + "pg_backup_start_time|pg_cancel_backend|pg_char_to_encoding|pg_client_encoding|" + + "pg_collation_for|pg_collation_is_visible|pg_column_is_updatable|pg_column_size|" + + "pg_conf_load_time|pg_conversion_is_visible|pg_create_restore_point|" + + "pg_current_xlog_insert_location|pg_current_xlog_location|pg_cursor|pg_database_size|" + + "pg_describe_object|pg_encoding_max_length|pg_encoding_to_char|" + + "pg_event_trigger_dropped_objects|pg_export_snapshot|pg_extension_config_dump|" + + "pg_extension_update_paths|pg_function_is_visible|pg_get_constraintdef|pg_get_expr|" + + "pg_get_function_arguments|pg_get_function_identity_arguments|" + + "pg_get_function_result|pg_get_functiondef|pg_get_indexdef|pg_get_keywords|" + + "pg_get_multixact_members|pg_get_ruledef|pg_get_serial_sequence|pg_get_triggerdef|" + + "pg_get_userbyid|pg_get_viewdef|pg_has_role|pg_identify_object|pg_indexes_size|" + + "pg_is_in_backup|pg_is_in_recovery|pg_is_other_temp_schema|pg_is_xlog_replay_paused|" + + "pg_last_xact_replay_timestamp|pg_last_xlog_receive_location|" + + "pg_last_xlog_replay_location|pg_listening_channels|pg_lock_status|pg_ls_dir|" + + "pg_my_temp_schema|pg_node_tree_in|pg_node_tree_out|pg_node_tree_recv|" + + "pg_node_tree_send|pg_notify|pg_opclass_is_visible|pg_operator_is_visible|" + + "pg_opfamily_is_visible|pg_options_to_table|pg_postmaster_start_time|" + + "pg_prepared_statement|pg_prepared_xact|pg_read_binary_file|pg_read_file|" + + "pg_relation_filenode|pg_relation_filepath|pg_relation_is_updatable|pg_relation_size|" + + "pg_reload_conf|pg_rotate_logfile|pg_sequence_parameters|pg_show_all_settings|" + + "pg_size_pretty|pg_sleep|pg_start_backup|pg_stat_clear_snapshot|pg_stat_file|" + + "pg_stat_get_activity|pg_stat_get_analyze_count|pg_stat_get_autoanalyze_count|" + + "pg_stat_get_autovacuum_count|pg_stat_get_backend_activity|" + + "pg_stat_get_backend_activity_start|pg_stat_get_backend_client_addr|" + + "pg_stat_get_backend_client_port|pg_stat_get_backend_dbid|pg_stat_get_backend_idset|" + + "pg_stat_get_backend_pid|pg_stat_get_backend_start|pg_stat_get_backend_userid|" + + "pg_stat_get_backend_waiting|pg_stat_get_backend_xact_start|" + + "pg_stat_get_bgwriter_buf_written_checkpoints|" + + "pg_stat_get_bgwriter_buf_written_clean|pg_stat_get_bgwriter_maxwritten_clean|" + + "pg_stat_get_bgwriter_requested_checkpoints|pg_stat_get_bgwriter_stat_reset_time|" + + "pg_stat_get_bgwriter_timed_checkpoints|pg_stat_get_blocks_fetched|" + + "pg_stat_get_blocks_hit|pg_stat_get_buf_alloc|pg_stat_get_buf_fsync_backend|" + + "pg_stat_get_buf_written_backend|pg_stat_get_checkpoint_sync_time|" + + "pg_stat_get_checkpoint_write_time|pg_stat_get_db_blk_read_time|" + + "pg_stat_get_db_blk_write_time|pg_stat_get_db_blocks_fetched|" + + "pg_stat_get_db_blocks_hit|pg_stat_get_db_conflict_all|" + + "pg_stat_get_db_conflict_bufferpin|pg_stat_get_db_conflict_lock|" + + "pg_stat_get_db_conflict_snapshot|pg_stat_get_db_conflict_startup_deadlock|" + + "pg_stat_get_db_conflict_tablespace|pg_stat_get_db_deadlocks|" + + "pg_stat_get_db_numbackends|pg_stat_get_db_stat_reset_time|" + + "pg_stat_get_db_temp_bytes|pg_stat_get_db_temp_files|pg_stat_get_db_tuples_deleted|" + + "pg_stat_get_db_tuples_fetched|pg_stat_get_db_tuples_inserted|" + + "pg_stat_get_db_tuples_returned|pg_stat_get_db_tuples_updated|" + + "pg_stat_get_db_xact_commit|pg_stat_get_db_xact_rollback|pg_stat_get_dead_tuples|" + + "pg_stat_get_function_calls|pg_stat_get_function_self_time|" + + "pg_stat_get_function_total_time|pg_stat_get_last_analyze_time|" + + "pg_stat_get_last_autoanalyze_time|pg_stat_get_last_autovacuum_time|" + + "pg_stat_get_last_vacuum_time|pg_stat_get_live_tuples|pg_stat_get_numscans|" + + "pg_stat_get_tuples_deleted|pg_stat_get_tuples_fetched|" + + "pg_stat_get_tuples_hot_updated|pg_stat_get_tuples_inserted|" + + "pg_stat_get_tuples_returned|pg_stat_get_tuples_updated|pg_stat_get_vacuum_count|" + + "pg_stat_get_wal_senders|pg_stat_get_xact_blocks_fetched|" + + "pg_stat_get_xact_blocks_hit|pg_stat_get_xact_function_calls|" + + "pg_stat_get_xact_function_self_time|pg_stat_get_xact_function_total_time|" + + "pg_stat_get_xact_numscans|pg_stat_get_xact_tuples_deleted|" + + "pg_stat_get_xact_tuples_fetched|pg_stat_get_xact_tuples_hot_updated|" + + "pg_stat_get_xact_tuples_inserted|pg_stat_get_xact_tuples_returned|" + + "pg_stat_get_xact_tuples_updated|pg_stat_reset|pg_stat_reset_shared|" + + "pg_stat_reset_single_function_counters|pg_stat_reset_single_table_counters|" + + "pg_stop_backup|pg_switch_xlog|pg_table_is_visible|pg_table_size|" + + "pg_tablespace_databases|pg_tablespace_location|pg_tablespace_size|" + + "pg_terminate_backend|pg_timezone_abbrevs|pg_timezone_names|pg_total_relation_size|" + + "pg_trigger_depth|pg_try_advisory_lock|pg_try_advisory_lock_shared|" + + "pg_try_advisory_xact_lock|pg_try_advisory_xact_lock_shared|pg_ts_config_is_visible|" + + "pg_ts_dict_is_visible|pg_ts_parser_is_visible|pg_ts_template_is_visible|" + + "pg_type_is_visible|pg_typeof|pg_xlog_location_diff|pg_xlog_replay_pause|" + + "pg_xlog_replay_resume|pg_xlogfile_name|pg_xlogfile_name_offset|pi|plainto_tsquery|" + + "plpgsql_call_handler|plpgsql_inline_handler|plpgsql_validator|point|point_above|" + + "point_add|point_below|point_distance|point_div|point_eq|point_horiz|point_in|point_left|" + + "point_mul|point_ne|point_out|point_recv|point_right|point_send|point_sub|point_vert|" + + "poly_above|poly_below|poly_center|poly_contain|poly_contain_pt|poly_contained|" + + "poly_distance|poly_in|poly_left|poly_npoints|poly_out|poly_overabove|poly_overbelow|" + + "poly_overlap|poly_overleft|poly_overright|poly_recv|poly_right|poly_same|poly_send|" + + "polygon|popen|position|positionjoinsel|positionsel|postgresql_fdw_validator|pow|power|" + + "prsd_end|prsd_headline|prsd_lextype|prsd_nexttoken|prsd_start|pt_contained_circle|" + + "pt_contained_poly|query_to_xml|query_to_xml_and_xmlschema|query_to_xmlschema|" + + "querytree|quote_ident|quote_literal|quote_nullable|radians|radius|random|range_adjacent|" + + "range_after|range_before|range_cmp|range_contained_by|range_contains|" + + "range_contains_elem|range_eq|range_ge|range_gist_compress|range_gist_consistent|" + + "range_gist_decompress|range_gist_penalty|range_gist_picksplit|range_gist_same|" + + "range_gist_union|range_gt|range_in|range_intersect|range_le|range_lt|range_minus|" + + "range_ne|range_out|range_overlaps|range_overleft|range_overright|range_recv|range_send|" + + "range_typanalyze|range_union|rangesel|rank|record_eq|record_ge|record_gt|record_in|" + + "record_le|record_lt|record_ne|record_out|record_recv|record_send|regclass|regclassin|" + + "regclassout|regclassrecv|regclasssend|regconfigin|regconfigout|regconfigrecv|" + + "regconfigsend|regdictionaryin|regdictionaryout|regdictionaryrecv|regdictionarysend|" + + "regexeqjoinsel|regexeqsel|regexnejoinsel|regexnesel|regexp_matches|regexp_replace|" + + "regexp_split_to_array|regexp_split_to_table|regoperatorin|regoperatorout|" + + "regoperatorrecv|regoperatorsend|regoperin|regoperout|regoperrecv|regopersend|" + + "regprocedurein|regprocedureout|regprocedurerecv|regproceduresend|regprocin|regprocout|" + + "regprocrecv|regprocsend|regr_avgx|regr_avgy|regr_count|regr_intercept|regr_r2|" + + "regr_slope|regr_sxx|regr_sxy|regr_syy|regtypein|regtypeout|regtyperecv|regtypesend|" + + "reltime|reltimeeq|reltimege|reltimegt|reltimein|reltimele|reltimelt|reltimene|reltimeout|" + + "reltimerecv|reltimesend|repeat|replace|reverse|right|round|row_number|row_to_json|rpad|" + + "rtrim|scalargtjoinsel|scalargtsel|scalarltjoinsel|scalarltsel|schema_to_xml|" + + "schema_to_xml_and_xmlschema|schema_to_xmlschema|session_user|set_bit|set_byte|" + + "set_config|set_masklen|setseed|setval|setweight|shell_in|shell_out|" + + "shift_jis_2004_to_euc_jis_2004|shift_jis_2004_to_utf8|shobj_description|sign|" + + "similar_escape|sin|sjis_to_euc_jp|sjis_to_mic|sjis_to_utf8|slope|smgreq|smgrin|smgrne|" + + "smgrout|spg_kd_choose|spg_kd_config|spg_kd_inner_consistent|spg_kd_picksplit|" + + "spg_quad_choose|spg_quad_config|spg_quad_inner_consistent|spg_quad_leaf_consistent|" + + "spg_quad_picksplit|spg_range_quad_choose|spg_range_quad_config|" + + "spg_range_quad_inner_consistent|spg_range_quad_leaf_consistent|" + + "spg_range_quad_picksplit|spg_text_choose|spg_text_config|spg_text_inner_consistent|" + + "spg_text_leaf_consistent|spg_text_picksplit|spgbeginscan|spgbuild|spgbuildempty|" + + "spgbulkdelete|spgcanreturn|spgcostestimate|spgendscan|spggetbitmap|spggettuple|" + + "spginsert|spgmarkpos|spgoptions|spgrescan|spgrestrpos|spgvacuumcleanup|split_part|sqrt|" + + "statement_timestamp|stddev|stddev_pop|stddev_samp|string_agg|string_agg_finalfn|" + + "string_agg_transfn|string_to_array|strip|strpos|substr|substring|sum|" + + "suppress_redundant_updates_trigger|table_to_xml|table_to_xml_and_xmlschema|" + + "table_to_xmlschema|tan|text|text_ge|text_gt|text_larger|text_le|text_lt|text_pattern_ge|" + + "text_pattern_gt|text_pattern_le|text_pattern_lt|text_smaller|textanycat|textcat|texteq|" + + "texticlike|texticnlike|texticregexeq|texticregexne|textin|textlen|textlike|textne|" + + "textnlike|textout|textrecv|textregexeq|textregexne|textsend|thesaurus_init|" + + "thesaurus_lexize|tideq|tidge|tidgt|tidin|tidlarger|tidle|tidlt|tidne|tidout|tidrecv|tidsend|" + + "tidsmaller|time_cmp|time_eq|time_ge|time_gt|time_hash|time_in|time_larger|time_le|time_lt|" + + "time_mi_interval|time_mi_time|time_ne|time_out|time_pl_interval|time_recv|time_send|" + + "time_smaller|time_transform|timedate_pl|timemi|timenow|timeofday|timepl|timestamp_cmp|" + + "timestamp_cmp_date|timestamp_cmp_timestamptz|timestamp_eq|timestamp_eq_date|" + + "timestamp_eq_timestamptz|timestamp_ge|timestamp_ge_date|timestamp_ge_timestamptz|" + + "timestamp_gt|timestamp_gt_date|timestamp_gt_timestamptz|timestamp_hash|timestamp_in|" + + "timestamp_larger|timestamp_le|timestamp_le_date|timestamp_le_timestamptz|" + + "timestamp_lt|timestamp_lt_date|timestamp_lt_timestamptz|timestamp_mi|" + + "timestamp_mi_interval|timestamp_ne|timestamp_ne_date|timestamp_ne_timestamptz|" + + "timestamp_out|timestamp_pl_interval|timestamp_recv|timestamp_send|timestamp_smaller|" + + "timestamp_sortsupport|timestamp_transform|timestamptypmodin|timestamptypmodout|" + + "timestamptz_cmp|timestamptz_cmp_date|timestamptz_cmp_timestamp|timestamptz_eq|" + + "timestamptz_eq_date|timestamptz_eq_timestamp|timestamptz_ge|timestamptz_ge_date|" + + "timestamptz_ge_timestamp|timestamptz_gt|timestamptz_gt_date|" + + "timestamptz_gt_timestamp|timestamptz_in|timestamptz_larger|timestamptz_le|" + + "timestamptz_le_date|timestamptz_le_timestamp|timestamptz_lt|timestamptz_lt_date|" + + "timestamptz_lt_timestamp|timestamptz_mi|timestamptz_mi_interval|timestamptz_ne|" + + "timestamptz_ne_date|timestamptz_ne_timestamp|timestamptz_out|" + + "timestamptz_pl_interval|timestamptz_recv|timestamptz_send|timestamptz_smaller|" + + "timestamptztypmodin|timestamptztypmodout|timetypmodin|timetypmodout|timetz_cmp|" + + "timetz_eq|timetz_ge|timetz_gt|timetz_hash|timetz_in|timetz_larger|timetz_le|timetz_lt|" + + "timetz_mi_interval|timetz_ne|timetz_out|timetz_pl_interval|timetz_recv|timetz_send|" + + "timetz_smaller|timetzdate_pl|timetztypmodin|timetztypmodout|timezone|tinterval|" + + "tintervalct|tintervalend|tintervaleq|tintervalge|tintervalgt|tintervalin|tintervalle|" + + "tintervalleneq|tintervallenge|tintervallengt|tintervallenle|tintervallenlt|" + + "tintervallenne|tintervallt|tintervalne|tintervalout|tintervalov|tintervalrecv|" + + "tintervalrel|tintervalsame|tintervalsend|tintervalstart|to_ascii|to_char|to_date|to_hex|" + + "to_json|to_number|to_timestamp|to_tsquery|to_tsvector|transaction_timestamp|translate|" + + "trigger_in|trigger_out|trunc|ts_debug|ts_headline|ts_lexize|ts_match_qv|ts_match_tq|" + + "ts_match_tt|ts_match_vq|ts_parse|ts_rank|ts_rank_cd|ts_rewrite|ts_stat|ts_token_type|" + + "ts_typanalyze|tsmatchjoinsel|tsmatchsel|tsq_mcontained|tsq_mcontains|tsquery_and|" + + "tsquery_cmp|tsquery_eq|tsquery_ge|tsquery_gt|tsquery_le|tsquery_lt|tsquery_ne|" + + "tsquery_not|tsquery_or|tsqueryin|tsqueryout|tsqueryrecv|tsquerysend|tsrange|" + + "tsrange_subdiff|tstzrange|tstzrange_subdiff|tsvector_cmp|tsvector_concat|tsvector_eq|" + + "tsvector_ge|tsvector_gt|tsvector_le|tsvector_lt|tsvector_ne|tsvector_update_trigger|" + + "tsvector_update_trigger_column|tsvectorin|tsvectorout|tsvectorrecv|tsvectorsend|" + + "txid_current|txid_current_snapshot|txid_snapshot_in|txid_snapshot_out|" + + "txid_snapshot_recv|txid_snapshot_send|txid_snapshot_xip|txid_snapshot_xmax|" + + "txid_snapshot_xmin|txid_visible_in_snapshot|uhc_to_utf8|unique_key_recheck|unknownin|" + + "unknownout|unknownrecv|unknownsend|unnest|upper|upper_inc|upper_inf|utf8_to_ascii|" + + "utf8_to_big5|utf8_to_euc_cn|utf8_to_euc_jis_2004|utf8_to_euc_jp|utf8_to_euc_kr|" + + "utf8_to_euc_tw|utf8_to_gb18030|utf8_to_gbk|utf8_to_iso8859|utf8_to_iso8859_1|" + + "utf8_to_johab|utf8_to_koi8r|utf8_to_koi8u|utf8_to_shift_jis_2004|utf8_to_sjis|" + + "utf8_to_uhc|utf8_to_win|uuid_cmp|uuid_eq|uuid_ge|uuid_gt|uuid_hash|uuid_in|uuid_le|" + + "uuid_lt|uuid_ne|uuid_out|uuid_recv|uuid_send|var_pop|var_samp|varbit_in|varbit_out|" + + "varbit_recv|varbit_send|varbit_transform|varbitcmp|varbiteq|varbitge|varbitgt|varbitle|" + + "varbitlt|varbitne|varbittypmodin|varbittypmodout|varchar_transform|varcharin|" + + "varcharout|varcharrecv|varcharsend|varchartypmodin|varchartypmodout|variance|version|" + + "void_in|void_out|void_recv|void_send|width|width_bucket|win1250_to_latin2|" + + "win1250_to_mic|win1251_to_iso|win1251_to_koi8r|win1251_to_mic|win1251_to_win866|" + + "win866_to_iso|win866_to_koi8r|win866_to_mic|win866_to_win1251|win_to_utf8|xideq|" + + "xideqint4|xidin|xidout|xidrecv|xidsend|xml|xml_in|xml_is_well_formed|" + + "xml_is_well_formed_content|xml_is_well_formed_document|xml_out|xml_recv|xml_send|" + + "xmlagg|xmlcomment|xmlconcat2|xmlexists|xmlvalidate|xpath|xpath_exists" + ); + + var keywordMapper = this.createKeywordMapper({ + "support.function": builtinFunctions, + "keyword": keywords + }, "identifier", true); + + + var sqlRules = [{ + token : "string", // single line string -- assume dollar strings if multi-line for now + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "variable.language", // pg identifier + regex : '".*?"' + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_][a-zA-Z0-9_$]*\\b" // TODO - Unicode in identifiers + }, { + token : "keyword.operator", + regex : "!|!!|!~|!~\\*|!~~|!~~\\*|#|##|#<|#<=|#<>|#=|#>|#>=|%|\\&|\\&\\&|\\&<|\\&<\\||\\&>|\\*|\\+|" + + "\\-|/|<|<#>|<\\->|<<|<<=|<<\\||<=|<>|<\\?>|<@|<\\^|=|>|>=|>>|>>=|>\\^|\\?#|\\?\\-|\\?\\-\\||" + + "\\?\\||\\?\\|\\||@|@\\-@|@>|@@|@@@|\\^|\\||\\|\\&>|\\|/|\\|>>|\\|\\||\\|\\|/|~|~\\*|~<=~|~<~|" + + "~=|~>=~|~>~|~~|~~\\*" + }, { + token : "paren.lparen", + regex : "[\\(]" + }, { + token : "paren.rparen", + regex : "[\\)]" + }, { + token : "text", + regex : "\\s+" + } + ]; + + + this.$rules = { + "start" : [{ + token : "comment", + regex : "--.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi-line comment + regex : "\\/\\*", + next : "comment" + },{ + token : "keyword.statementBegin", + regex : "^[a-zA-Z]+", // Could enumerate starting keywords but this allows things to work when new statements are added. + next : "statement" + },{ + token : "support.buildin", // psql directive + regex : "^\\\\[\\S]+.*$" + } + ], + + "statement" : [{ + token : "comment", + regex : "--.*$" + }, { + token : "comment", // multi-line comment + regex : "\\/\\*", + next : "commentStatement" + }, { + token : "statementEnd", + regex : ";", + next : "start" + }, { + token : "string", + regex : "\\$perl\\$", + next : "perl-start" + }, { + token : "string", + regex : "\\$python\\$", + next : "python-start" + }, { + token : "string", + regex : "\\$json\\$", + next : "json-start" + }, { + token : "string", + regex : "\\$(js|javascript)\\$", + next : "javascript-start" + }, { + token : "string", + regex : "\\$[\\w_0-9]*\\$$", // dollar quote at the end of a line + next : "dollarSql" + }, { + token : "string", + regex : "\\$[\\w_0-9]*\\$", + next : "dollarStatementString" + } + ].concat(sqlRules), + + "dollarSql" : [{ + token : "comment", + regex : "--.*$" + }, { + token : "comment", // multi-line comment + regex : "\\/\\*", + next : "commentDollarSql" + }, { + token : "string", // end quoting with dollar at the start of a line + regex : "^\\$[\\w_0-9]*\\$", + next : "statement" + }, { + token : "string", + regex : "\\$[\\w_0-9]*\\$", + next : "dollarSqlString" + } + ].concat(sqlRules), + + "comment" : [{ + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + + "commentStatement" : [{ + token : "comment", // closing comment + regex : "\\*\\/", + next : "statement" + }, { + defaultToken : "comment" + } + ], + + "commentDollarSql" : [{ + token : "comment", // closing comment + regex : "\\*\\/", + next : "dollarSql" + }, { + defaultToken : "comment" + } + ], + + "dollarStatementString" : [{ + token : "string", // closing dollarstring + regex : ".*?\\$[\\w_0-9]*\\$", + next : "statement" + }, { + token : "string", // dollarstring spanning whole line + regex : ".+" + } + ], + + "dollarSqlString" : [{ + token : "string", // closing dollarstring + regex : ".*?\\$[\\w_0-9]*\\$", + next : "dollarSql" + }, { + token : "string", // dollarstring spanning whole line + regex : ".+" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); + this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]); + this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]); + this.embedRules(JsonHighlightRules, "json-", [{token : "string", regex : "\\$json\\$", next : "statement"}]); + this.embedRules(JavaScriptHighlightRules, "javascript-", [{token : "string", regex : "\\$(js|javascript)\\$", next : "statement"}]); +}; + +oop.inherits(PgsqlHighlightRules, TextHighlightRules); + +exports.PgsqlHighlightRules = PgsqlHighlightRules; +}); + +ace.define("ace/mode/pgsql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/pgsql_highlight_rules"], function(require, exports, module) { + +var oop = require("../lib/oop"); +var TextMode = require("../mode/text").Mode; +var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules; + +var Mode = function() { + this.HighlightRules = PgsqlHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + if (state == "start" || state == "keyword.statementEnd") { + return ""; + } else { + return this.$getIndent(line); // Keep whatever indent the previous line has + } + }; + + this.$id = "ace/mode/pgsql"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-php.js b/htdocs/includes/ace/mode-php.js new file mode 100644 index 00000000000..b4d55de8b6c --- /dev/null +++ b/htdocs/includes/ace/mode-php.js @@ -0,0 +1,12856 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/php_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + +var PhpLangHighlightRules = function() { + var docComment = DocCommentHighlightRules; + var builtinFunctions = lang.arrayToMap( + ('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' + + 'aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|amqpconnection|amqpexchange|amqpqueue|' + + 'apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|' + + 'apache_reset_timeout|apache_response_headers|apache_setenv|apc_add|apc_bin_dump|apc_bin_dumpfile|apc_bin_load|apc_bin_loadfile|' + + 'apc_cache_info|apc_cas|apc_clear_cache|apc_compile_file|apc_dec|apc_define_constants|apc_delete|apc_delete_file|apc_exists|apc_fetch|' + + 'apc_inc|apc_load_constants|apc_sma_info|apc_store|apciterator|apd_breakpoint|apd_callstack|apd_clunk|apd_continue|apd_croak|' + + 'apd_dump_function_table|apd_dump_persistent_resources|apd_dump_regular_resources|apd_echo|apd_get_active_symbols|apd_set_pprof_trace|' + + 'apd_set_session|apd_set_session_trace|apd_set_session_trace_socket|appenditerator|array|array_change_key_case|array_chunk|array_combine|' + + 'array_count_values|array_diff|array_diff_assoc|array_diff_key|array_diff_uassoc|array_diff_ukey|array_fill|array_fill_keys|array_filter|' + + 'array_flip|array_intersect|array_intersect_assoc|array_intersect_key|array_intersect_uassoc|array_intersect_ukey|array_key_exists|' + + 'array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_product|array_push|array_rand|' + + 'array_reduce|array_replace|array_replace_recursive|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|' + + 'array_udiff_assoc|array_udiff_uassoc|array_uintersect|array_uintersect_assoc|array_uintersect_uassoc|array_unique|array_unshift|' + + 'array_values|array_walk|array_walk_recursive|arrayaccess|arrayiterator|arrayobject|arsort|asin|asinh|asort|assert|assert_options|atan|' + + 'atan2|atanh|audioproperties|badfunctioncallexception|badmethodcallexception|base64_decode|base64_encode|base_convert|basename|' + + 'bbcode_add_element|bbcode_add_smiley|bbcode_create|bbcode_destroy|bbcode_parse|bbcode_set_arg_parser|bbcode_set_flags|bcadd|bccomp|bcdiv|' + + 'bcmod|bcmul|bcompiler_load|bcompiler_load_exe|bcompiler_parse_class|bcompiler_read|bcompiler_write_class|bcompiler_write_constant|' + + 'bcompiler_write_exe_footer|bcompiler_write_file|bcompiler_write_footer|bcompiler_write_function|bcompiler_write_functions_from_file|' + + 'bcompiler_write_header|bcompiler_write_included_filename|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|' + + 'bindtextdomain|bson_decode|bson_encode|bumpValue|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|' + + 'cachingiterator|cairo|cairo_create|cairo_font_face_get_type|cairo_font_face_status|cairo_font_options_create|cairo_font_options_equal|' + + 'cairo_font_options_get_antialias|cairo_font_options_get_hint_metrics|cairo_font_options_get_hint_style|' + + 'cairo_font_options_get_subpixel_order|cairo_font_options_hash|cairo_font_options_merge|cairo_font_options_set_antialias|' + + 'cairo_font_options_set_hint_metrics|cairo_font_options_set_hint_style|cairo_font_options_set_subpixel_order|cairo_font_options_status|' + + 'cairo_format_stride_for_width|cairo_image_surface_create|cairo_image_surface_create_for_data|cairo_image_surface_create_from_png|' + + 'cairo_image_surface_get_data|cairo_image_surface_get_format|cairo_image_surface_get_height|cairo_image_surface_get_stride|' + + 'cairo_image_surface_get_width|cairo_matrix_create_scale|cairo_matrix_create_translate|cairo_matrix_invert|cairo_matrix_multiply|' + + 'cairo_matrix_rotate|cairo_matrix_transform_distance|cairo_matrix_transform_point|cairo_matrix_translate|cairo_pattern_add_color_stop_rgb|' + + 'cairo_pattern_add_color_stop_rgba|cairo_pattern_create_for_surface|cairo_pattern_create_linear|cairo_pattern_create_radial|' + + 'cairo_pattern_create_rgb|cairo_pattern_create_rgba|cairo_pattern_get_color_stop_count|cairo_pattern_get_color_stop_rgba|' + + 'cairo_pattern_get_extend|cairo_pattern_get_filter|cairo_pattern_get_linear_points|cairo_pattern_get_matrix|' + + 'cairo_pattern_get_radial_circles|cairo_pattern_get_rgba|cairo_pattern_get_surface|cairo_pattern_get_type|cairo_pattern_set_extend|' + + 'cairo_pattern_set_filter|cairo_pattern_set_matrix|cairo_pattern_status|cairo_pdf_surface_create|cairo_pdf_surface_set_size|' + + 'cairo_ps_get_levels|cairo_ps_level_to_string|cairo_ps_surface_create|cairo_ps_surface_dsc_begin_page_setup|' + + 'cairo_ps_surface_dsc_begin_setup|cairo_ps_surface_dsc_comment|cairo_ps_surface_get_eps|cairo_ps_surface_restrict_to_level|' + + 'cairo_ps_surface_set_eps|cairo_ps_surface_set_size|cairo_scaled_font_create|cairo_scaled_font_extents|cairo_scaled_font_get_ctm|' + + 'cairo_scaled_font_get_font_face|cairo_scaled_font_get_font_matrix|cairo_scaled_font_get_font_options|cairo_scaled_font_get_scale_matrix|' + + 'cairo_scaled_font_get_type|cairo_scaled_font_glyph_extents|cairo_scaled_font_status|cairo_scaled_font_text_extents|' + + 'cairo_surface_copy_page|cairo_surface_create_similar|cairo_surface_finish|cairo_surface_flush|cairo_surface_get_content|' + + 'cairo_surface_get_device_offset|cairo_surface_get_font_options|cairo_surface_get_type|cairo_surface_mark_dirty|' + + 'cairo_surface_mark_dirty_rectangle|cairo_surface_set_device_offset|cairo_surface_set_fallback_resolution|cairo_surface_show_page|' + + 'cairo_surface_status|cairo_surface_write_to_png|cairo_svg_surface_create|cairo_svg_surface_restrict_to_version|' + + 'cairo_svg_version_to_string|cairoantialias|cairocontent|cairocontext|cairoexception|cairoextend|cairofillrule|cairofilter|cairofontface|' + + 'cairofontoptions|cairofontslant|cairofonttype|cairofontweight|cairoformat|cairogradientpattern|cairohintmetrics|cairohintstyle|' + + 'cairoimagesurface|cairolineargradient|cairolinecap|cairolinejoin|cairomatrix|cairooperator|cairopath|cairopattern|cairopatterntype|' + + 'cairopdfsurface|cairopslevel|cairopssurface|cairoradialgradient|cairoscaledfont|cairosolidpattern|cairostatus|cairosubpixelorder|' + + 'cairosurface|cairosurfacepattern|cairosurfacetype|cairosvgsurface|cairosvgversion|cairotoyfontface|cal_days_in_month|cal_from_jd|cal_info|' + + 'cal_to_jd|calcul_hmac|calculhmac|call_user_func|call_user_func_array|call_user_method|call_user_method_array|callbackfilteriterator|ceil|' + + 'chdb|chdb_create|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_alias|class_exists|class_implements|' + + 'class_parents|class_uses|classkit_import|classkit_method_add|classkit_method_copy|classkit_method_redefine|classkit_method_remove|' + + 'classkit_method_rename|clearstatcache|clone|closedir|closelog|collator|com|com_addref|com_create_guid|com_event_sink|com_get|' + + 'com_get_active_object|com_invoke|com_isenum|com_load|com_load_typelib|com_message_pump|com_print_typeinfo|com_propget|com_propput|' + + 'com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|construct|construct|construct|' + + 'convert_cyr_string|convert_uudecode|convert_uuencode|copy|cos|cosh|count|count_chars|countable|counter_bump|counter_bump_value|' + + 'counter_create|counter_get|counter_get_meta|counter_get_named|counter_get_value|counter_reset|counter_reset_value|crack_check|' + + 'crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|' + + 'ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|cubrid_affected_rows|cubrid_bind|' + + 'cubrid_client_encoding|cubrid_close|cubrid_close_prepare|cubrid_close_request|cubrid_col_get|cubrid_col_size|cubrid_column_names|' + + 'cubrid_column_types|cubrid_commit|cubrid_connect|cubrid_connect_with_url|cubrid_current_oid|cubrid_data_seek|cubrid_db_name|' + + 'cubrid_disconnect|cubrid_drop|cubrid_errno|cubrid_error|cubrid_error_code|cubrid_error_code_facility|cubrid_error_msg|cubrid_execute|' + + 'cubrid_fetch|cubrid_fetch_array|cubrid_fetch_assoc|cubrid_fetch_field|cubrid_fetch_lengths|cubrid_fetch_object|cubrid_fetch_row|' + + 'cubrid_field_flags|cubrid_field_len|cubrid_field_name|cubrid_field_seek|cubrid_field_table|cubrid_field_type|cubrid_free_result|' + + 'cubrid_get|cubrid_get_autocommit|cubrid_get_charset|cubrid_get_class_name|cubrid_get_client_info|cubrid_get_db_parameter|' + + 'cubrid_get_server_info|cubrid_insert_id|cubrid_is_instance|cubrid_list_dbs|cubrid_load_from_glo|cubrid_lob_close|cubrid_lob_export|' + + 'cubrid_lob_get|cubrid_lob_send|cubrid_lob_size|cubrid_lock_read|cubrid_lock_write|cubrid_move_cursor|cubrid_new_glo|cubrid_next_result|' + + 'cubrid_num_cols|cubrid_num_fields|cubrid_num_rows|cubrid_ping|cubrid_prepare|cubrid_put|cubrid_query|cubrid_real_escape_string|' + + 'cubrid_result|cubrid_rollback|cubrid_save_to_glo|cubrid_schema|cubrid_send_glo|cubrid_seq_drop|cubrid_seq_insert|cubrid_seq_put|' + + 'cubrid_set_add|cubrid_set_autocommit|cubrid_set_db_parameter|cubrid_set_drop|cubrid_unbuffered_query|cubrid_version|curl_close|' + + 'curl_copy_handle|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|' + + 'curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_setopt_array|' + + 'curl_version|current|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|date_add|date_create|' + + 'date_create_from_format|date_date_set|date_default_timezone_get|date_default_timezone_set|date_diff|date_format|date_get_last_errors|' + + 'date_interval_create_from_date_string|date_interval_format|date_isodate_set|date_modify|date_offset_get|date_parse|date_parse_from_format|' + + 'date_sub|date_sun_info|date_sunrise|date_sunset|date_time_set|date_timestamp_get|date_timestamp_set|date_timezone_get|date_timezone_set|' + + 'dateinterval|dateperiod|datetime|datetimezone|db2_autocommit|db2_bind_param|db2_client_info|db2_close|db2_column_privileges|db2_columns|' + + 'db2_commit|db2_conn_error|db2_conn_errormsg|db2_connect|db2_cursor_type|db2_escape_string|db2_exec|db2_execute|db2_fetch_array|' + + 'db2_fetch_assoc|db2_fetch_both|db2_fetch_object|db2_fetch_row|db2_field_display_size|db2_field_name|db2_field_num|db2_field_precision|' + + 'db2_field_scale|db2_field_type|db2_field_width|db2_foreign_keys|db2_free_result|db2_free_stmt|db2_get_option|db2_last_insert_id|' + + 'db2_lob_read|db2_next_result|db2_num_fields|db2_num_rows|db2_pclose|db2_pconnect|db2_prepare|db2_primary_keys|db2_procedure_columns|' + + 'db2_procedures|db2_result|db2_rollback|db2_server_info|db2_set_option|db2_special_columns|db2_statistics|db2_stmt_error|db2_stmt_errormsg|' + + 'db2_table_privileges|db2_tables|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|' + + 'dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|' + + 'dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|' + + 'dbase_replace_record|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|' + + 'dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|' + + 'dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|' + + 'dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|' + + 'dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|' + + 'dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|' + + 'dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debug_zval_dump|decbin|dechex|decoct|define|' + + 'define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|' + + 'dio_truncate|dio_write|dir|directoryiterator|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|' + + 'dns_get_mx|dns_get_record|dom_import_simplexml|domainexception|domattr|domattribute_name|domattribute_set_value|domattribute_specified|' + + 'domattribute_value|domcharacterdata|domcomment|domdocument|domdocument_add_root|domdocument_create_attribute|' + + 'domdocument_create_cdata_section|domdocument_create_comment|domdocument_create_element|domdocument_create_element_ns|' + + 'domdocument_create_entity_reference|domdocument_create_processing_instruction|domdocument_create_text_node|domdocument_doctype|' + + 'domdocument_document_element|domdocument_dump_file|domdocument_dump_mem|domdocument_get_element_by_id|domdocument_get_elements_by_tagname|' + + 'domdocument_html_dump_mem|domdocument_xinclude|domdocumentfragment|domdocumenttype|domdocumenttype_entities|' + + 'domdocumenttype_internal_subset|domdocumenttype_name|domdocumenttype_notations|domdocumenttype_public_id|domdocumenttype_system_id|' + + 'domelement|domelement_get_attribute|domelement_get_attribute_node|domelement_get_elements_by_tagname|domelement_has_attribute|' + + 'domelement_remove_attribute|domelement_set_attribute|domelement_set_attribute_node|domelement_tagname|domentity|domentityreference|' + + 'domexception|domimplementation|domnamednodemap|domnode|domnode_add_namespace|domnode_append_child|domnode_append_sibling|' + + 'domnode_attributes|domnode_child_nodes|domnode_clone_node|domnode_dump_node|domnode_first_child|domnode_get_content|' + + 'domnode_has_attributes|domnode_has_child_nodes|domnode_insert_before|domnode_is_blank_node|domnode_last_child|domnode_next_sibling|' + + 'domnode_node_name|domnode_node_type|domnode_node_value|domnode_owner_document|domnode_parent_node|domnode_prefix|domnode_previous_sibling|' + + 'domnode_remove_child|domnode_replace_child|domnode_replace_node|domnode_set_content|domnode_set_name|domnode_set_namespace|' + + 'domnode_unlink_node|domnodelist|domnotation|domprocessinginstruction|domprocessinginstruction_data|domprocessinginstruction_target|' + + 'domtext|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|' + + 'domxml_xslt_stylesheet_file|domxml_xslt_version|domxpath|domxsltstylesheet_process|domxsltstylesheet_result_dump_file|' + + 'domxsltstylesheet_result_dump_mem|dotnet|dotnet_load|doubleval|each|easter_date|easter_days|echo|empty|emptyiterator|' + + 'enchant_broker_describe|enchant_broker_dict_exists|enchant_broker_free|enchant_broker_free_dict|enchant_broker_get_error|' + + 'enchant_broker_init|enchant_broker_list_dicts|enchant_broker_request_dict|enchant_broker_request_pwl_dict|enchant_broker_set_ordering|' + + 'enchant_dict_add_to_personal|enchant_dict_add_to_session|enchant_dict_check|enchant_dict_describe|enchant_dict_get_error|' + + 'enchant_dict_is_in_session|enchant_dict_quick_check|enchant_dict_store_replacement|enchant_dict_suggest|end|ereg|ereg_replace|eregi|' + + 'eregi_replace|error_get_last|error_log|error_reporting|errorexception|escapeshellarg|escapeshellcmd|eval|event_add|event_base_free|' + + 'event_base_loop|event_base_loopbreak|event_base_loopexit|event_base_new|event_base_priority_init|event_base_set|event_buffer_base_set|' + + 'event_buffer_disable|event_buffer_enable|event_buffer_fd_set|event_buffer_free|event_buffer_new|event_buffer_priority_set|' + + 'event_buffer_read|event_buffer_set_callback|event_buffer_timeout_set|event_buffer_watermark_set|event_buffer_write|event_del|event_free|' + + 'event_new|event_set|exception|exec|exif_imagetype|exif_read_data|exif_tagname|exif_thumbnail|exit|exp|expect_expectl|expect_popen|explode|' + + 'expm1|export|export|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|' + + 'fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|' + + 'fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|' + + 'fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|' + + 'fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|' + + 'fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|' + + 'fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|' + + 'fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|' + + 'fbsql_rows_fetched|fbsql_select_db|fbsql_set_characterset|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|' + + 'fbsql_stop_db|fbsql_table_name|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|' + + 'fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|' + + 'fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|' + + 'fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_on_import_javascript|fdf_set_opt|' + + 'fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|' + + 'file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|' + + 'filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filesystemiterator|' + + 'filetype|filter_has_var|filter_id|filter_input|filter_input_array|filter_list|filter_var|filter_var_array|filteriterator|finfo_buffer|' + + 'finfo_close|finfo_file|finfo_open|finfo_set_flags|floatval|flock|floor|flush|fmod|fnmatch|fopen|forward_static_call|' + + 'forward_static_call_array|fpassthru|fprintf|fputcsv|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|' + + 'ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|' + + 'ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|' + + 'ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|' + + 'func_num_args|function_exists|fwrite|gc_collect_cycles|gc_disable|gc_enable|gc_enabled|gd_info|gearmanclient|gearmanjob|gearmantask|' + + 'gearmanworker|geoip_continent_code_by_name|geoip_country_code3_by_name|geoip_country_code_by_name|geoip_country_name_by_name|' + + 'geoip_database_info|geoip_db_avail|geoip_db_filename|geoip_db_get_all_info|geoip_id_by_name|geoip_isp_by_name|geoip_org_by_name|' + + 'geoip_record_by_name|geoip_region_by_name|geoip_region_name_by_code|geoip_time_zone_by_country_and_region|getMeta|getNamed|getValue|' + + 'get_browser|get_called_class|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|' + + 'get_declared_interfaces|get_declared_traits|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|' + + 'get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|' + + 'get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getconstant|getconstants|getconstructor|' + + 'getcwd|getdate|getdefaultproperties|getdoccomment|getendline|getenv|getextension|getextensionname|getfilename|gethostbyaddr|gethostbyname|' + + 'gethostbynamel|gethostname|getimagesize|getinterfacenames|getinterfaces|getlastmod|getmethod|getmethods|getmodifiers|getmxrr|getmygid|' + + 'getmyinode|getmypid|getmyuid|getname|getnamespacename|getopt|getparentclass|getproperties|getproperty|getprotobyname|getprotobynumber|' + + 'getrandmax|getrusage|getservbyname|getservbyport|getshortname|getstartline|getstaticproperties|getstaticpropertyvalue|gettext|' + + 'gettimeofday|gettype|glob|globiterator|gmagick|gmagickdraw|gmagickpixel|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|' + + 'gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|' + + 'gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_nextprime|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|' + + 'gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_testbit|gmp_xor|gmstrftime|' + + 'gnupg_adddecryptkey|gnupg_addencryptkey|gnupg_addsignkey|gnupg_cleardecryptkeys|gnupg_clearencryptkeys|gnupg_clearsignkeys|gnupg_decrypt|' + + 'gnupg_decryptverify|gnupg_encrypt|gnupg_encryptsign|gnupg_export|gnupg_geterror|gnupg_getprotocol|gnupg_import|gnupg_init|gnupg_keyinfo|' + + 'gnupg_setarmor|gnupg_seterrormode|gnupg_setsignmode|gnupg_sign|gnupg_verify|gopher_parsedir|grapheme_extract|grapheme_stripos|' + + 'grapheme_stristr|grapheme_strlen|grapheme_strpos|grapheme_strripos|grapheme_strrpos|grapheme_strstr|grapheme_substr|gregoriantojd|' + + 'gupnp_context_get_host_ip|gupnp_context_get_port|gupnp_context_get_subscription_timeout|gupnp_context_host_path|gupnp_context_new|' + + 'gupnp_context_set_subscription_timeout|gupnp_context_timeout_add|gupnp_context_unhost_path|gupnp_control_point_browse_start|' + + 'gupnp_control_point_browse_stop|gupnp_control_point_callback_set|gupnp_control_point_new|gupnp_device_action_callback_set|' + + 'gupnp_device_info_get|gupnp_device_info_get_service|gupnp_root_device_get_available|gupnp_root_device_get_relative_location|' + + 'gupnp_root_device_new|gupnp_root_device_set_available|gupnp_root_device_start|gupnp_root_device_stop|gupnp_service_action_get|' + + 'gupnp_service_action_return|gupnp_service_action_return_error|gupnp_service_action_set|gupnp_service_freeze_notify|gupnp_service_info_get|' + + 'gupnp_service_info_get_introspection|gupnp_service_introspection_get_state_variable|gupnp_service_notify|gupnp_service_proxy_action_get|' + + 'gupnp_service_proxy_action_set|gupnp_service_proxy_add_notify|gupnp_service_proxy_callback_set|gupnp_service_proxy_get_subscribed|' + + 'gupnp_service_proxy_remove_notify|gupnp_service_proxy_set_subscribed|gupnp_service_thaw_notify|gzclose|gzcompress|gzdecode|gzdeflate|' + + 'gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|' + + 'halt_compiler|haruannotation|haruannotation_setborderstyle|haruannotation_sethighlightmode|haruannotation_seticon|' + + 'haruannotation_setopened|harudestination|harudestination_setfit|harudestination_setfitb|harudestination_setfitbh|harudestination_setfitbv|' + + 'harudestination_setfith|harudestination_setfitr|harudestination_setfitv|harudestination_setxyz|harudoc|harudoc_addpage|' + + 'harudoc_addpagelabel|harudoc_construct|harudoc_createoutline|harudoc_getcurrentencoder|harudoc_getcurrentpage|harudoc_getencoder|' + + 'harudoc_getfont|harudoc_getinfoattr|harudoc_getpagelayout|harudoc_getpagemode|harudoc_getstreamsize|harudoc_insertpage|harudoc_loadjpeg|' + + 'harudoc_loadpng|harudoc_loadraw|harudoc_loadttc|harudoc_loadttf|harudoc_loadtype1|harudoc_output|harudoc_readfromstream|' + + 'harudoc_reseterror|harudoc_resetstream|harudoc_save|harudoc_savetostream|harudoc_setcompressionmode|harudoc_setcurrentencoder|' + + 'harudoc_setencryptionmode|harudoc_setinfoattr|harudoc_setinfodateattr|harudoc_setopenaction|harudoc_setpagelayout|harudoc_setpagemode|' + + 'harudoc_setpagesconfiguration|harudoc_setpassword|harudoc_setpermission|harudoc_usecnsencodings|harudoc_usecnsfonts|' + + 'harudoc_usecntencodings|harudoc_usecntfonts|harudoc_usejpencodings|harudoc_usejpfonts|harudoc_usekrencodings|harudoc_usekrfonts|' + + 'haruencoder|haruencoder_getbytetype|haruencoder_gettype|haruencoder_getunicode|haruencoder_getwritingmode|haruexception|harufont|' + + 'harufont_getascent|harufont_getcapheight|harufont_getdescent|harufont_getencodingname|harufont_getfontname|harufont_gettextwidth|' + + 'harufont_getunicodewidth|harufont_getxheight|harufont_measuretext|haruimage|haruimage_getbitspercomponent|haruimage_getcolorspace|' + + 'haruimage_getheight|haruimage_getsize|haruimage_getwidth|haruimage_setcolormask|haruimage_setmaskimage|haruoutline|' + + 'haruoutline_setdestination|haruoutline_setopened|harupage|harupage_arc|harupage_begintext|harupage_circle|harupage_closepath|' + + 'harupage_concat|harupage_createdestination|harupage_createlinkannotation|harupage_createtextannotation|harupage_createurlannotation|' + + 'harupage_curveto|harupage_curveto2|harupage_curveto3|harupage_drawimage|harupage_ellipse|harupage_endpath|harupage_endtext|' + + 'harupage_eofill|harupage_eofillstroke|harupage_fill|harupage_fillstroke|harupage_getcharspace|harupage_getcmykfill|harupage_getcmykstroke|' + + 'harupage_getcurrentfont|harupage_getcurrentfontsize|harupage_getcurrentpos|harupage_getcurrenttextpos|harupage_getdash|' + + 'harupage_getfillingcolorspace|harupage_getflatness|harupage_getgmode|harupage_getgrayfill|harupage_getgraystroke|harupage_getheight|' + + 'harupage_gethorizontalscaling|harupage_getlinecap|harupage_getlinejoin|harupage_getlinewidth|harupage_getmiterlimit|harupage_getrgbfill|' + + 'harupage_getrgbstroke|harupage_getstrokingcolorspace|harupage_gettextleading|harupage_gettextmatrix|harupage_gettextrenderingmode|' + + 'harupage_gettextrise|harupage_gettextwidth|harupage_gettransmatrix|harupage_getwidth|harupage_getwordspace|harupage_lineto|' + + 'harupage_measuretext|harupage_movetextpos|harupage_moveto|harupage_movetonextline|harupage_rectangle|harupage_setcharspace|' + + 'harupage_setcmykfill|harupage_setcmykstroke|harupage_setdash|harupage_setflatness|harupage_setfontandsize|harupage_setgrayfill|' + + 'harupage_setgraystroke|harupage_setheight|harupage_sethorizontalscaling|harupage_setlinecap|harupage_setlinejoin|harupage_setlinewidth|' + + 'harupage_setmiterlimit|harupage_setrgbfill|harupage_setrgbstroke|harupage_setrotate|harupage_setsize|harupage_setslideshow|' + + 'harupage_settextleading|harupage_settextmatrix|harupage_settextrenderingmode|harupage_settextrise|harupage_setwidth|harupage_setwordspace|' + + 'harupage_showtext|harupage_showtextnextline|harupage_stroke|harupage_textout|harupage_textrect|hasconstant|hash|hash_algos|hash_copy|' + + 'hash_file|hash_final|hash_hmac|hash_hmac_file|hash_init|hash_update|hash_update_file|hash_update_stream|hasmethod|hasproperty|header|' + + 'header_register_callback|header_remove|headers_list|headers_sent|hebrev|hebrevc|hex2bin|hexdec|highlight_file|highlight_string|' + + 'html_entity_decode|htmlentities|htmlspecialchars|htmlspecialchars_decode|http_build_cookie|http_build_query|http_build_str|http_build_url|' + + 'http_cache_etag|http_cache_last_modified|http_chunked_decode|http_date|http_deflate|http_get|http_get_request_body|' + + 'http_get_request_body_stream|http_get_request_headers|http_head|http_inflate|http_match_etag|http_match_modified|' + + 'http_match_request_header|http_negotiate_charset|http_negotiate_content_type|http_negotiate_language|http_parse_cookie|http_parse_headers|' + + 'http_parse_message|http_parse_params|http_persistent_handles_clean|http_persistent_handles_count|http_persistent_handles_ident|' + + 'http_post_data|http_post_fields|http_put_data|http_put_file|http_put_stream|http_redirect|http_request|http_request_body_encode|' + + 'http_request_method_exists|http_request_method_name|http_request_method_register|http_request_method_unregister|http_response_code|' + + 'http_send_content_disposition|http_send_content_type|http_send_data|http_send_file|http_send_last_modified|http_send_status|' + + 'http_send_stream|http_support|http_throttle|httpdeflatestream|httpdeflatestream_construct|httpdeflatestream_factory|' + + 'httpdeflatestream_finish|httpdeflatestream_flush|httpdeflatestream_update|httpinflatestream|httpinflatestream_construct|' + + 'httpinflatestream_factory|httpinflatestream_finish|httpinflatestream_flush|httpinflatestream_update|httpmessage|httpmessage_addheaders|' + + 'httpmessage_construct|httpmessage_detach|httpmessage_factory|httpmessage_fromenv|httpmessage_fromstring|httpmessage_getbody|' + + 'httpmessage_getheader|httpmessage_getheaders|httpmessage_gethttpversion|httpmessage_getparentmessage|httpmessage_getrequestmethod|' + + 'httpmessage_getrequesturl|httpmessage_getresponsecode|httpmessage_getresponsestatus|httpmessage_gettype|httpmessage_guesscontenttype|' + + 'httpmessage_prepend|httpmessage_reverse|httpmessage_send|httpmessage_setbody|httpmessage_setheaders|httpmessage_sethttpversion|' + + 'httpmessage_setrequestmethod|httpmessage_setrequesturl|httpmessage_setresponsecode|httpmessage_setresponsestatus|httpmessage_settype|' + + 'httpmessage_tomessagetypeobject|httpmessage_tostring|httpquerystring|httpquerystring_construct|httpquerystring_get|httpquerystring_mod|' + + 'httpquerystring_set|httpquerystring_singleton|httpquerystring_toarray|httpquerystring_tostring|httpquerystring_xlate|httprequest|' + + 'httprequest_addcookies|httprequest_addheaders|httprequest_addpostfields|httprequest_addpostfile|httprequest_addputdata|' + + 'httprequest_addquerydata|httprequest_addrawpostdata|httprequest_addssloptions|httprequest_clearhistory|httprequest_construct|' + + 'httprequest_enablecookies|httprequest_getcontenttype|httprequest_getcookies|httprequest_getheaders|httprequest_gethistory|' + + 'httprequest_getmethod|httprequest_getoptions|httprequest_getpostfields|httprequest_getpostfiles|httprequest_getputdata|' + + 'httprequest_getputfile|httprequest_getquerydata|httprequest_getrawpostdata|httprequest_getrawrequestmessage|' + + 'httprequest_getrawresponsemessage|httprequest_getrequestmessage|httprequest_getresponsebody|httprequest_getresponsecode|' + + 'httprequest_getresponsecookies|httprequest_getresponsedata|httprequest_getresponseheader|httprequest_getresponseinfo|' + + 'httprequest_getresponsemessage|httprequest_getresponsestatus|httprequest_getssloptions|httprequest_geturl|httprequest_resetcookies|' + + 'httprequest_send|httprequest_setcontenttype|httprequest_setcookies|httprequest_setheaders|httprequest_setmethod|httprequest_setoptions|' + + 'httprequest_setpostfields|httprequest_setpostfiles|httprequest_setputdata|httprequest_setputfile|httprequest_setquerydata|' + + 'httprequest_setrawpostdata|httprequest_setssloptions|httprequest_seturl|httprequestpool|httprequestpool_attach|httprequestpool_construct|' + + 'httprequestpool_destruct|httprequestpool_detach|httprequestpool_getattachedrequests|httprequestpool_getfinishedrequests|' + + 'httprequestpool_reset|httprequestpool_send|httprequestpool_socketperform|httprequestpool_socketselect|httpresponse|httpresponse_capture|' + + 'httpresponse_getbuffersize|httpresponse_getcache|httpresponse_getcachecontrol|httpresponse_getcontentdisposition|' + + 'httpresponse_getcontenttype|httpresponse_getdata|httpresponse_getetag|httpresponse_getfile|httpresponse_getgzip|httpresponse_getheader|' + + 'httpresponse_getlastmodified|httpresponse_getrequestbody|httpresponse_getrequestbodystream|httpresponse_getrequestheaders|' + + 'httpresponse_getstream|httpresponse_getthrottledelay|httpresponse_guesscontenttype|httpresponse_redirect|httpresponse_send|' + + 'httpresponse_setbuffersize|httpresponse_setcache|httpresponse_setcachecontrol|httpresponse_setcontentdisposition|' + + 'httpresponse_setcontenttype|httpresponse_setdata|httpresponse_setetag|httpresponse_setfile|httpresponse_setgzip|httpresponse_setheader|' + + 'httpresponse_setlastmodified|httpresponse_setstream|httpresponse_setthrottledelay|httpresponse_status|hw_array2objrec|hw_changeobject|' + + 'hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|' + + 'hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|' + + 'hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|' + + 'hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|' + + 'hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|' + + 'hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|' + + 'hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|' + + 'hwapi_attribute|hwapi_attribute_key|hwapi_attribute_langdepvalue|hwapi_attribute_value|hwapi_attribute_values|hwapi_checkin|' + + 'hwapi_checkout|hwapi_children|hwapi_content|hwapi_content_mimetype|hwapi_content_read|hwapi_copy|hwapi_dbstat|hwapi_dcstat|' + + 'hwapi_dstanchors|hwapi_dstofsrcanchor|hwapi_error_count|hwapi_error_reason|hwapi_find|hwapi_ftstat|hwapi_hgcsp|hwapi_hwstat|' + + 'hwapi_identify|hwapi_info|hwapi_insert|hwapi_insertanchor|hwapi_insertcollection|hwapi_insertdocument|hwapi_link|hwapi_lock|hwapi_move|' + + 'hwapi_new_content|hwapi_object|hwapi_object_assign|hwapi_object_attreditable|hwapi_object_count|hwapi_object_insert|hwapi_object_new|' + + 'hwapi_object_remove|hwapi_object_title|hwapi_object_value|hwapi_objectbyanchor|hwapi_parents|hwapi_reason_description|hwapi_reason_type|' + + 'hwapi_remove|hwapi_replace|hwapi_setcommittedversion|hwapi_srcanchors|hwapi_srcsofdst|hwapi_unlock|hwapi_user|hwapi_userlist|hypot|' + + 'ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|' + + 'ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|' + + 'ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|' + + 'ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|' + + 'ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|' + + 'ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|' + + 'ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|' + + 'iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|id3_get_frame_long_name|id3_get_frame_short_name|id3_get_genre_id|id3_get_genre_list|' + + 'id3_get_genre_name|id3_get_tag|id3_get_version|id3_remove_tag|id3_set_tag|id3v2attachedpictureframe|id3v2frame|id3v2tag|idate|' + + 'idn_to_ascii|idn_to_unicode|idn_to_utf8|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|' + + 'ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|' + + 'ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|' + + 'ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|' + + 'ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|iis_add_server|iis_get_dir_security|' + + 'iis_get_script_map|iis_get_server_by_comment|iis_get_server_by_path|iis_get_server_rights|iis_get_service_state|iis_remove_server|' + + 'iis_set_app_settings|iis_set_dir_security|iis_set_script_map|iis_set_server_rights|iis_start_server|iis_start_service|iis_stop_server|' + + 'iis_stop_service|image2wbmp|image_type_to_extension|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|' + + 'imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|' + + 'imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|' + + 'imagecolorsforindex|imagecolorstotal|imagecolortransparent|imageconvolution|imagecopy|imagecopymerge|imagecopymergegray|' + + 'imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|' + + 'imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|' + + 'imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|' + + 'imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|' + + 'imagegd2|imagegif|imagegrabscreen|imagegrabwindow|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|' + + 'imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|' + + 'imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|' + + 'imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imagick|' + + 'imagick_adaptiveblurimage|imagick_adaptiveresizeimage|imagick_adaptivesharpenimage|imagick_adaptivethresholdimage|imagick_addimage|' + + 'imagick_addnoiseimage|imagick_affinetransformimage|imagick_animateimages|imagick_annotateimage|imagick_appendimages|imagick_averageimages|' + + 'imagick_blackthresholdimage|imagick_blurimage|imagick_borderimage|imagick_charcoalimage|imagick_chopimage|imagick_clear|imagick_clipimage|' + + 'imagick_clippathimage|imagick_clone|imagick_clutimage|imagick_coalesceimages|imagick_colorfloodfillimage|imagick_colorizeimage|' + + 'imagick_combineimages|imagick_commentimage|imagick_compareimagechannels|imagick_compareimagelayers|imagick_compareimages|' + + 'imagick_compositeimage|imagick_construct|imagick_contrastimage|imagick_contraststretchimage|imagick_convolveimage|imagick_cropimage|' + + 'imagick_cropthumbnailimage|imagick_current|imagick_cyclecolormapimage|imagick_decipherimage|imagick_deconstructimages|' + + 'imagick_deleteimageartifact|imagick_despeckleimage|imagick_destroy|imagick_displayimage|imagick_displayimages|imagick_distortimage|' + + 'imagick_drawimage|imagick_edgeimage|imagick_embossimage|imagick_encipherimage|imagick_enhanceimage|imagick_equalizeimage|' + + 'imagick_evaluateimage|imagick_extentimage|imagick_flattenimages|imagick_flipimage|imagick_floodfillpaintimage|imagick_flopimage|' + + 'imagick_frameimage|imagick_fximage|imagick_gammaimage|imagick_gaussianblurimage|imagick_getcolorspace|imagick_getcompression|' + + 'imagick_getcompressionquality|imagick_getcopyright|imagick_getfilename|imagick_getfont|imagick_getformat|imagick_getgravity|' + + 'imagick_gethomeurl|imagick_getimage|imagick_getimagealphachannel|imagick_getimageartifact|imagick_getimagebackgroundcolor|' + + 'imagick_getimageblob|imagick_getimageblueprimary|imagick_getimagebordercolor|imagick_getimagechanneldepth|' + + 'imagick_getimagechanneldistortion|imagick_getimagechanneldistortions|imagick_getimagechannelextrema|imagick_getimagechannelmean|' + + 'imagick_getimagechannelrange|imagick_getimagechannelstatistics|imagick_getimageclipmask|imagick_getimagecolormapcolor|' + + 'imagick_getimagecolors|imagick_getimagecolorspace|imagick_getimagecompose|imagick_getimagecompression|imagick_getimagecompressionquality|' + + 'imagick_getimagedelay|imagick_getimagedepth|imagick_getimagedispose|imagick_getimagedistortion|imagick_getimageextrema|' + + 'imagick_getimagefilename|imagick_getimageformat|imagick_getimagegamma|imagick_getimagegeometry|imagick_getimagegravity|' + + 'imagick_getimagegreenprimary|imagick_getimageheight|imagick_getimagehistogram|imagick_getimageindex|imagick_getimageinterlacescheme|' + + 'imagick_getimageinterpolatemethod|imagick_getimageiterations|imagick_getimagelength|imagick_getimagemagicklicense|imagick_getimagematte|' + + 'imagick_getimagemattecolor|imagick_getimageorientation|imagick_getimagepage|imagick_getimagepixelcolor|imagick_getimageprofile|' + + 'imagick_getimageprofiles|imagick_getimageproperties|imagick_getimageproperty|imagick_getimageredprimary|imagick_getimageregion|' + + 'imagick_getimagerenderingintent|imagick_getimageresolution|imagick_getimagesblob|imagick_getimagescene|imagick_getimagesignature|' + + 'imagick_getimagesize|imagick_getimagetickspersecond|imagick_getimagetotalinkdensity|imagick_getimagetype|imagick_getimageunits|' + + 'imagick_getimagevirtualpixelmethod|imagick_getimagewhitepoint|imagick_getimagewidth|imagick_getinterlacescheme|imagick_getiteratorindex|' + + 'imagick_getnumberimages|imagick_getoption|imagick_getpackagename|imagick_getpage|imagick_getpixeliterator|imagick_getpixelregioniterator|' + + 'imagick_getpointsize|imagick_getquantumdepth|imagick_getquantumrange|imagick_getreleasedate|imagick_getresource|imagick_getresourcelimit|' + + 'imagick_getsamplingfactors|imagick_getsize|imagick_getsizeoffset|imagick_getversion|imagick_hasnextimage|imagick_haspreviousimage|' + + 'imagick_identifyimage|imagick_implodeimage|imagick_labelimage|imagick_levelimage|imagick_linearstretchimage|imagick_liquidrescaleimage|' + + 'imagick_magnifyimage|imagick_mapimage|imagick_mattefloodfillimage|imagick_medianfilterimage|imagick_mergeimagelayers|imagick_minifyimage|' + + 'imagick_modulateimage|imagick_montageimage|imagick_morphimages|imagick_mosaicimages|imagick_motionblurimage|imagick_negateimage|' + + 'imagick_newimage|imagick_newpseudoimage|imagick_nextimage|imagick_normalizeimage|imagick_oilpaintimage|imagick_opaquepaintimage|' + + 'imagick_optimizeimagelayers|imagick_orderedposterizeimage|imagick_paintfloodfillimage|imagick_paintopaqueimage|' + + 'imagick_painttransparentimage|imagick_pingimage|imagick_pingimageblob|imagick_pingimagefile|imagick_polaroidimage|imagick_posterizeimage|' + + 'imagick_previewimages|imagick_previousimage|imagick_profileimage|imagick_quantizeimage|imagick_quantizeimages|imagick_queryfontmetrics|' + + 'imagick_queryfonts|imagick_queryformats|imagick_radialblurimage|imagick_raiseimage|imagick_randomthresholdimage|imagick_readimage|' + + 'imagick_readimageblob|imagick_readimagefile|imagick_recolorimage|imagick_reducenoiseimage|imagick_removeimage|imagick_removeimageprofile|' + + 'imagick_render|imagick_resampleimage|imagick_resetimagepage|imagick_resizeimage|imagick_rollimage|imagick_rotateimage|' + + 'imagick_roundcorners|imagick_sampleimage|imagick_scaleimage|imagick_separateimagechannel|imagick_sepiatoneimage|' + + 'imagick_setbackgroundcolor|imagick_setcolorspace|imagick_setcompression|imagick_setcompressionquality|imagick_setfilename|' + + 'imagick_setfirstiterator|imagick_setfont|imagick_setformat|imagick_setgravity|imagick_setimage|imagick_setimagealphachannel|' + + 'imagick_setimageartifact|imagick_setimagebackgroundcolor|imagick_setimagebias|imagick_setimageblueprimary|imagick_setimagebordercolor|' + + 'imagick_setimagechanneldepth|imagick_setimageclipmask|imagick_setimagecolormapcolor|imagick_setimagecolorspace|imagick_setimagecompose|' + + 'imagick_setimagecompression|imagick_setimagecompressionquality|imagick_setimagedelay|imagick_setimagedepth|imagick_setimagedispose|' + + 'imagick_setimageextent|imagick_setimagefilename|imagick_setimageformat|imagick_setimagegamma|imagick_setimagegravity|' + + 'imagick_setimagegreenprimary|imagick_setimageindex|imagick_setimageinterlacescheme|imagick_setimageinterpolatemethod|' + + 'imagick_setimageiterations|imagick_setimagematte|imagick_setimagemattecolor|imagick_setimageopacity|imagick_setimageorientation|' + + 'imagick_setimagepage|imagick_setimageprofile|imagick_setimageproperty|imagick_setimageredprimary|imagick_setimagerenderingintent|' + + 'imagick_setimageresolution|imagick_setimagescene|imagick_setimagetickspersecond|imagick_setimagetype|imagick_setimageunits|' + + 'imagick_setimagevirtualpixelmethod|imagick_setimagewhitepoint|imagick_setinterlacescheme|imagick_setiteratorindex|imagick_setlastiterator|' + + 'imagick_setoption|imagick_setpage|imagick_setpointsize|imagick_setresolution|imagick_setresourcelimit|imagick_setsamplingfactors|' + + 'imagick_setsize|imagick_setsizeoffset|imagick_settype|imagick_shadeimage|imagick_shadowimage|imagick_sharpenimage|imagick_shaveimage|' + + 'imagick_shearimage|imagick_sigmoidalcontrastimage|imagick_sketchimage|imagick_solarizeimage|imagick_spliceimage|imagick_spreadimage|' + + 'imagick_steganoimage|imagick_stereoimage|imagick_stripimage|imagick_swirlimage|imagick_textureimage|imagick_thresholdimage|' + + 'imagick_thumbnailimage|imagick_tintimage|imagick_transformimage|imagick_transparentpaintimage|imagick_transposeimage|' + + 'imagick_transverseimage|imagick_trimimage|imagick_uniqueimagecolors|imagick_unsharpmaskimage|imagick_valid|imagick_vignetteimage|' + + 'imagick_waveimage|imagick_whitethresholdimage|imagick_writeimage|imagick_writeimagefile|imagick_writeimages|imagick_writeimagesfile|' + + 'imagickdraw|imagickdraw_affine|imagickdraw_annotation|imagickdraw_arc|imagickdraw_bezier|imagickdraw_circle|imagickdraw_clear|' + + 'imagickdraw_clone|imagickdraw_color|imagickdraw_comment|imagickdraw_composite|imagickdraw_construct|imagickdraw_destroy|' + + 'imagickdraw_ellipse|imagickdraw_getclippath|imagickdraw_getcliprule|imagickdraw_getclipunits|imagickdraw_getfillcolor|' + + 'imagickdraw_getfillopacity|imagickdraw_getfillrule|imagickdraw_getfont|imagickdraw_getfontfamily|imagickdraw_getfontsize|' + + 'imagickdraw_getfontstyle|imagickdraw_getfontweight|imagickdraw_getgravity|imagickdraw_getstrokeantialias|imagickdraw_getstrokecolor|' + + 'imagickdraw_getstrokedasharray|imagickdraw_getstrokedashoffset|imagickdraw_getstrokelinecap|imagickdraw_getstrokelinejoin|' + + 'imagickdraw_getstrokemiterlimit|imagickdraw_getstrokeopacity|imagickdraw_getstrokewidth|imagickdraw_gettextalignment|' + + 'imagickdraw_gettextantialias|imagickdraw_gettextdecoration|imagickdraw_gettextencoding|imagickdraw_gettextundercolor|' + + 'imagickdraw_getvectorgraphics|imagickdraw_line|imagickdraw_matte|imagickdraw_pathclose|imagickdraw_pathcurvetoabsolute|' + + 'imagickdraw_pathcurvetoquadraticbezierabsolute|imagickdraw_pathcurvetoquadraticbezierrelative|' + + 'imagickdraw_pathcurvetoquadraticbeziersmoothabsolute|imagickdraw_pathcurvetoquadraticbeziersmoothrelative|imagickdraw_pathcurvetorelative|' + + 'imagickdraw_pathcurvetosmoothabsolute|imagickdraw_pathcurvetosmoothrelative|imagickdraw_pathellipticarcabsolute|' + + 'imagickdraw_pathellipticarcrelative|imagickdraw_pathfinish|imagickdraw_pathlinetoabsolute|imagickdraw_pathlinetohorizontalabsolute|' + + 'imagickdraw_pathlinetohorizontalrelative|imagickdraw_pathlinetorelative|imagickdraw_pathlinetoverticalabsolute|' + + 'imagickdraw_pathlinetoverticalrelative|imagickdraw_pathmovetoabsolute|imagickdraw_pathmovetorelative|imagickdraw_pathstart|' + + 'imagickdraw_point|imagickdraw_polygon|imagickdraw_polyline|imagickdraw_pop|imagickdraw_popclippath|imagickdraw_popdefs|' + + 'imagickdraw_poppattern|imagickdraw_push|imagickdraw_pushclippath|imagickdraw_pushdefs|imagickdraw_pushpattern|imagickdraw_rectangle|' + + 'imagickdraw_render|imagickdraw_rotate|imagickdraw_roundrectangle|imagickdraw_scale|imagickdraw_setclippath|imagickdraw_setcliprule|' + + 'imagickdraw_setclipunits|imagickdraw_setfillalpha|imagickdraw_setfillcolor|imagickdraw_setfillopacity|imagickdraw_setfillpatternurl|' + + 'imagickdraw_setfillrule|imagickdraw_setfont|imagickdraw_setfontfamily|imagickdraw_setfontsize|imagickdraw_setfontstretch|' + + 'imagickdraw_setfontstyle|imagickdraw_setfontweight|imagickdraw_setgravity|imagickdraw_setstrokealpha|imagickdraw_setstrokeantialias|' + + 'imagickdraw_setstrokecolor|imagickdraw_setstrokedasharray|imagickdraw_setstrokedashoffset|imagickdraw_setstrokelinecap|' + + 'imagickdraw_setstrokelinejoin|imagickdraw_setstrokemiterlimit|imagickdraw_setstrokeopacity|imagickdraw_setstrokepatternurl|' + + 'imagickdraw_setstrokewidth|imagickdraw_settextalignment|imagickdraw_settextantialias|imagickdraw_settextdecoration|' + + 'imagickdraw_settextencoding|imagickdraw_settextundercolor|imagickdraw_setvectorgraphics|imagickdraw_setviewbox|imagickdraw_skewx|' + + 'imagickdraw_skewy|imagickdraw_translate|imagickpixel|imagickpixel_clear|imagickpixel_construct|imagickpixel_destroy|imagickpixel_getcolor|' + + 'imagickpixel_getcolorasstring|imagickpixel_getcolorcount|imagickpixel_getcolorvalue|imagickpixel_gethsl|imagickpixel_issimilar|' + + 'imagickpixel_setcolor|imagickpixel_setcolorvalue|imagickpixel_sethsl|imagickpixeliterator|imagickpixeliterator_clear|' + + 'imagickpixeliterator_construct|imagickpixeliterator_destroy|imagickpixeliterator_getcurrentiteratorrow|' + + 'imagickpixeliterator_getiteratorrow|imagickpixeliterator_getnextiteratorrow|imagickpixeliterator_getpreviousiteratorrow|' + + 'imagickpixeliterator_newpixeliterator|imagickpixeliterator_newpixelregioniterator|imagickpixeliterator_resetiterator|' + + 'imagickpixeliterator_setiteratorfirstrow|imagickpixeliterator_setiteratorlastrow|imagickpixeliterator_setiteratorrow|' + + 'imagickpixeliterator_synciterator|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|' + + 'imap_clearflag_full|imap_close|imap_create|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|' + + 'imap_fetchbody|imap_fetchheader|imap_fetchmime|imap_fetchstructure|imap_fetchtext|imap_gc|imap_get_quota|imap_get_quotaroot|imap_getacl|' + + 'imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|' + + 'imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|' + + 'imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_rename|imap_renamemailbox|imap_reopen|' + + 'imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_savebody|imap_scan|imap_scanmailbox|imap_search|' + + 'imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|' + + 'imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implementsinterface|implode|import_request_variables|in_array|include|' + + 'include_once|inclued_get_data|inet_ntop|inet_pton|infiniteiterator|ingres_autocommit|ingres_autocommit_state|ingres_charset|ingres_close|' + + 'ingres_commit|ingres_connect|ingres_cursor|ingres_errno|ingres_error|ingres_errsqlstate|ingres_escape_string|ingres_execute|' + + 'ingres_fetch_array|ingres_fetch_assoc|ingres_fetch_object|ingres_fetch_proc_return|ingres_fetch_row|ingres_field_length|ingres_field_name|' + + 'ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_free_result|ingres_next_error|ingres_num_fields|' + + 'ingres_num_rows|ingres_pconnect|ingres_prepare|ingres_query|ingres_result_seek|ingres_rollback|ingres_set_environment|' + + 'ingres_unbuffered_query|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|innamespace|inotify_add_watch|inotify_init|inotify_queue_len|' + + 'inotify_read|inotify_rm_watch|interface_exists|intl_error_name|intl_get_error_code|intl_get_error_message|intl_is_failure|' + + 'intldateformatter|intval|invalidargumentexception|invoke|invokeargs|ip2long|iptcembed|iptcparse|is_a|is_array|is_bool|is_callable|is_dir|' + + 'is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|' + + 'is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isabstract|' + + 'iscloneable|isdisabled|isfinal|isinstance|isinstantiable|isinterface|isinternal|isiterateable|isset|issubclassof|isuserdefined|iterator|' + + 'iterator_apply|iterator_count|iterator_to_array|iteratoraggregate|iteratoriterator|java_last_exception_clear|java_last_exception_get|' + + 'jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|json_decode|json_encode|' + + 'json_last_error|jsonserializable|judy|judy_type|judy_version|juliantojd|kadm5_chpass_principal|kadm5_create_principal|' + + 'kadm5_delete_principal|kadm5_destroy|kadm5_flush|kadm5_get_policies|kadm5_get_principal|kadm5_get_principals|kadm5_init_with_password|' + + 'kadm5_modify_principal|key|krsort|ksort|lcfirst|lcg_value|lchgrp|lchown|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|' + + 'ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|' + + 'ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|' + + 'ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|' + + 'ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_sasl_bind|ldap_search|ldap_set_option|' + + 'ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|lengthexception|levenshtein|libxml_clear_errors|' + + 'libxml_disable_entity_loader|libxml_get_errors|libxml_get_last_error|libxml_set_streams_context|libxml_use_internal_errors|libxmlerror|' + + 'limititerator|link|linkinfo|list|locale|localeconv|localtime|log|log10|log1p|logicexception|long2ip|lstat|ltrim|lzf_compress|' + + 'lzf_decompress|lzf_optimized_for|m_checkstatus|m_completeauthorizations|m_connect|m_connectionerror|m_deletetrans|m_destroyconn|' + + 'm_destroyengine|m_getcell|m_getcellbynum|m_getcommadelimited|m_getheader|m_initconn|m_initengine|m_iscommadelimited|m_maxconntimeout|' + + 'm_monitor|m_numcolumns|m_numrows|m_parsecommadelimited|m_responsekeys|m_responseparam|m_returnstatus|m_setblocking|m_setdropfile|m_setip|' + + 'm_setssl|m_setssl_cafile|m_setssl_files|m_settimeout|m_sslcert_gen_hash|m_transactionssent|m_transinqueue|m_transkeyval|m_transnew|' + + 'm_transsend|m_uwait|m_validateidentifier|m_verifyconnection|m_verifysslcert|magic_quotes_runtime|mail|' + + 'mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|' + + 'mailparse_msg_extract_whole_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|' + + 'mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|' + + 'maxdb_affected_rows|maxdb_autocommit|maxdb_bind_param|maxdb_bind_result|maxdb_change_user|maxdb_character_set_name|maxdb_client_encoding|' + + 'maxdb_close|maxdb_close_long_data|maxdb_commit|maxdb_connect|maxdb_connect_errno|maxdb_connect_error|maxdb_data_seek|maxdb_debug|' + + 'maxdb_disable_reads_from_master|maxdb_disable_rpl_parse|maxdb_dump_debug_info|maxdb_embedded_connect|maxdb_enable_reads_from_master|' + + 'maxdb_enable_rpl_parse|maxdb_errno|maxdb_error|maxdb_escape_string|maxdb_execute|maxdb_fetch|maxdb_fetch_array|maxdb_fetch_assoc|' + + 'maxdb_fetch_field|maxdb_fetch_field_direct|maxdb_fetch_fields|maxdb_fetch_lengths|maxdb_fetch_object|maxdb_fetch_row|maxdb_field_count|' + + 'maxdb_field_seek|maxdb_field_tell|maxdb_free_result|maxdb_get_client_info|maxdb_get_client_version|maxdb_get_host_info|maxdb_get_metadata|' + + 'maxdb_get_proto_info|maxdb_get_server_info|maxdb_get_server_version|maxdb_info|maxdb_init|maxdb_insert_id|maxdb_kill|maxdb_master_query|' + + 'maxdb_more_results|maxdb_multi_query|maxdb_next_result|maxdb_num_fields|maxdb_num_rows|maxdb_options|maxdb_param_count|maxdb_ping|' + + 'maxdb_prepare|maxdb_query|maxdb_real_connect|maxdb_real_escape_string|maxdb_real_query|maxdb_report|maxdb_rollback|' + + 'maxdb_rpl_parse_enabled|maxdb_rpl_probe|maxdb_rpl_query_type|maxdb_select_db|maxdb_send_long_data|maxdb_send_query|maxdb_server_end|' + + 'maxdb_server_init|maxdb_set_opt|maxdb_sqlstate|maxdb_ssl_set|maxdb_stat|maxdb_stmt_affected_rows|maxdb_stmt_bind_param|' + + 'maxdb_stmt_bind_result|maxdb_stmt_close|maxdb_stmt_close_long_data|maxdb_stmt_data_seek|maxdb_stmt_errno|maxdb_stmt_error|' + + 'maxdb_stmt_execute|maxdb_stmt_fetch|maxdb_stmt_free_result|maxdb_stmt_init|maxdb_stmt_num_rows|maxdb_stmt_param_count|maxdb_stmt_prepare|' + + 'maxdb_stmt_reset|maxdb_stmt_result_metadata|maxdb_stmt_send_long_data|maxdb_stmt_sqlstate|maxdb_stmt_store_result|maxdb_store_result|' + + 'maxdb_thread_id|maxdb_thread_safe|maxdb_use_result|maxdb_warning_count|mb_check_encoding|mb_convert_case|mb_convert_encoding|' + + 'mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|' + + 'mb_encode_numericentity|mb_encoding_aliases|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|' + + 'mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|' + + 'mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_list_encodings|mb_output_handler|mb_parse_str|' + + 'mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_stripos|mb_stristr|' + + 'mb_strlen|mb_strpos|mb_strrchr|mb_strrichr|mb_strripos|mb_strrpos|mb_strstr|mb_strtolower|mb_strtoupper|mb_strwidth|' + + 'mb_substitute_character|mb_substr|mb_substr_count|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|' + + 'mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|' + + 'mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|' + + 'mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|' + + 'mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|' + + 'mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|' + + 'mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|md5|md5_file|' + + 'mdecrypt_generic|memcache|memcache_debug|memcached|memory_get_peak_usage|memory_get_usage|messageformatter|metaphone|method_exists|mhash|' + + 'mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_keypress|' + + 'ming_setcubicthreshold|ming_setscale|ming_setswfcompression|ming_useconstants|ming_useswfversion|mkdir|mktime|money_format|mongo|' + + 'mongobindata|mongocode|mongocollection|mongoconnectionexception|mongocursor|mongocursorexception|mongocursortimeoutexception|mongodate|' + + 'mongodb|mongodbref|mongoexception|mongogridfs|mongogridfscursor|mongogridfsexception|mongogridfsfile|mongoid|mongoint32|mongoint64|' + + 'mongomaxkey|mongominkey|mongoregex|mongotimestamp|move_uploaded_file|mpegfile|mqseries_back|mqseries_begin|mqseries_close|mqseries_cmit|' + + 'mqseries_conn|mqseries_connx|mqseries_disc|mqseries_get|mqseries_inq|mqseries_open|mqseries_put|mqseries_put1|mqseries_set|' + + 'mqseries_strerror|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|' + + 'msession_get_array|msession_get_data|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|' + + 'msession_set|msession_set_array|msession_set_data|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_queue_exists|' + + 'msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|' + + 'msql_createdb|msql_data_seek|msql_db_query|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|' + + 'msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|' + + 'msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|' + + 'msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|' + + 'mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|' + + 'mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|' + + 'mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|' + + 'mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|' + + 'mssql_select_db|mt_getrandmax|mt_rand|mt_srand|multipleiterator|mysql_affected_rows|mysql_client_encoding|mysql_close|mysql_connect|' + + 'mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|' + + 'mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|' + + 'mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|' + + 'mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|' + + 'mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|' + + 'mysql_select_db|mysql_set_charset|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli|mysqli_affected_rows|' + + 'mysqli_autocommit|mysqli_bind_param|mysqli_bind_result|mysqli_cache_stats|mysqli_change_user|mysqli_character_set_name|' + + 'mysqli_client_encoding|mysqli_close|mysqli_commit|mysqli_connect|mysqli_connect_errno|mysqli_connect_error|mysqli_data_seek|' + + 'mysqli_debug|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_driver|mysqli_dump_debug_info|mysqli_embedded_server_end|' + + 'mysqli_embedded_server_start|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_errno|mysqli_error|mysqli_escape_string|' + + 'mysqli_execute|mysqli_fetch|mysqli_fetch_all|mysqli_fetch_array|mysqli_fetch_assoc|mysqli_fetch_field|mysqli_fetch_field_direct|' + + 'mysqli_fetch_fields|mysqli_fetch_lengths|mysqli_fetch_object|mysqli_fetch_row|mysqli_field_count|mysqli_field_seek|mysqli_field_tell|' + + 'mysqli_free_result|mysqli_get_charset|mysqli_get_client_info|mysqli_get_client_stats|mysqli_get_client_version|mysqli_get_connection_stats|' + + 'mysqli_get_host_info|mysqli_get_metadata|mysqli_get_proto_info|mysqli_get_server_info|mysqli_get_server_version|mysqli_get_warnings|' + + 'mysqli_info|mysqli_init|mysqli_insert_id|mysqli_kill|mysqli_link_construct|mysqli_master_query|mysqli_more_results|mysqli_multi_query|' + + 'mysqli_next_result|mysqli_num_fields|mysqli_num_rows|mysqli_options|mysqli_param_count|mysqli_ping|mysqli_poll|mysqli_prepare|' + + 'mysqli_query|mysqli_real_connect|mysqli_real_escape_string|mysqli_real_query|mysqli_reap_async_query|mysqli_refresh|mysqli_report|' + + 'mysqli_result|mysqli_rollback|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_select_db|mysqli_send_long_data|' + + 'mysqli_send_query|mysqli_set_charset|mysqli_set_local_infile_default|mysqli_set_local_infile_handler|mysqli_set_opt|mysqli_slave_query|' + + 'mysqli_sqlstate|mysqli_ssl_set|mysqli_stat|mysqli_stmt|mysqli_stmt_affected_rows|mysqli_stmt_attr_get|mysqli_stmt_attr_set|' + + 'mysqli_stmt_bind_param|mysqli_stmt_bind_result|mysqli_stmt_close|mysqli_stmt_data_seek|mysqli_stmt_errno|mysqli_stmt_error|' + + 'mysqli_stmt_execute|mysqli_stmt_fetch|mysqli_stmt_field_count|mysqli_stmt_free_result|mysqli_stmt_get_result|mysqli_stmt_get_warnings|' + + 'mysqli_stmt_init|mysqli_stmt_insert_id|mysqli_stmt_next_result|mysqli_stmt_num_rows|mysqli_stmt_param_count|mysqli_stmt_prepare|' + + 'mysqli_stmt_reset|mysqli_stmt_result_metadata|mysqli_stmt_send_long_data|mysqli_stmt_sqlstate|mysqli_stmt_store_result|mysqli_store_result|' + + 'mysqli_thread_id|mysqli_thread_safe|mysqli_use_result|mysqli_warning|mysqli_warning_count|mysqlnd_ms_get_stats|' + + 'mysqlnd_ms_query_is_select|mysqlnd_ms_set_user_pick_server|mysqlnd_qc_change_handler|mysqlnd_qc_clear_cache|mysqlnd_qc_get_cache_info|' + + 'mysqlnd_qc_get_core_stats|mysqlnd_qc_get_handler|mysqlnd_qc_get_query_trace_log|mysqlnd_qc_set_user_handlers|natcasesort|natsort|' + + 'ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|' + + 'ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|' + + 'ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|' + + 'ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|' + + 'ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|' + + 'ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|' + + 'ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|' + + 'ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|' + + 'ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|' + + 'ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|' + + 'ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|' + + 'ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|' + + 'ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|' + + 'ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|' + + 'ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|' + + 'ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|' + + 'ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|' + + 'ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|' + + 'ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|' + + 'ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|' + + 'ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|' + + 'ncurses_wstandout|ncurses_wvline|newinstance|newinstanceargs|newt_bell|newt_button|newt_button_bar|newt_centered_window|newt_checkbox|' + + 'newt_checkbox_get_value|newt_checkbox_set_flags|newt_checkbox_set_value|newt_checkbox_tree|newt_checkbox_tree_add_item|' + + 'newt_checkbox_tree_find_item|newt_checkbox_tree_get_current|newt_checkbox_tree_get_entry_value|newt_checkbox_tree_get_multi_selection|' + + 'newt_checkbox_tree_get_selection|newt_checkbox_tree_multi|newt_checkbox_tree_set_current|newt_checkbox_tree_set_entry|' + + 'newt_checkbox_tree_set_entry_value|newt_checkbox_tree_set_width|newt_clear_key_buffer|newt_cls|newt_compact_button|' + + 'newt_component_add_callback|newt_component_takes_focus|newt_create_grid|newt_cursor_off|newt_cursor_on|newt_delay|newt_draw_form|' + + 'newt_draw_root_text|newt_entry|newt_entry_get_value|newt_entry_set|newt_entry_set_filter|newt_entry_set_flags|newt_finished|newt_form|' + + 'newt_form_add_component|newt_form_add_components|newt_form_add_hot_key|newt_form_destroy|newt_form_get_current|newt_form_run|' + + 'newt_form_set_background|newt_form_set_height|newt_form_set_size|newt_form_set_timer|newt_form_set_width|newt_form_watch_fd|' + + 'newt_get_screen_size|newt_grid_add_components_to_form|newt_grid_basic_window|newt_grid_free|newt_grid_get_size|newt_grid_h_close_stacked|' + + 'newt_grid_h_stacked|newt_grid_place|newt_grid_set_field|newt_grid_simple_window|newt_grid_v_close_stacked|newt_grid_v_stacked|' + + 'newt_grid_wrapped_window|newt_grid_wrapped_window_at|newt_init|newt_label|newt_label_set_text|newt_listbox|newt_listbox_append_entry|' + + 'newt_listbox_clear|newt_listbox_clear_selection|newt_listbox_delete_entry|newt_listbox_get_current|newt_listbox_get_selection|' + + 'newt_listbox_insert_entry|newt_listbox_item_count|newt_listbox_select_item|newt_listbox_set_current|newt_listbox_set_current_by_key|' + + 'newt_listbox_set_data|newt_listbox_set_entry|newt_listbox_set_width|newt_listitem|newt_listitem_get_data|newt_listitem_set|' + + 'newt_open_window|newt_pop_help_line|newt_pop_window|newt_push_help_line|newt_radio_get_current|newt_radiobutton|newt_redraw_help_line|' + + 'newt_reflow_text|newt_refresh|newt_resize_screen|newt_resume|newt_run_form|newt_scale|newt_scale_set|newt_scrollbar_set|' + + 'newt_set_help_callback|newt_set_suspend_callback|newt_suspend|newt_textbox|newt_textbox_get_num_lines|newt_textbox_reflowed|' + + 'newt_textbox_set_height|newt_textbox_set_text|newt_vertical_scrollbar|newt_wait_for_key|newt_win_choice|newt_win_entries|newt_win_menu|' + + 'newt_win_message|newt_win_messagev|newt_win_ternary|next|ngettext|nl2br|nl_langinfo|norewinditerator|normalizer|notes_body|notes_copy_db|' + + 'notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|' + + 'notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|nthmac|number_format|' + + 'numberformatter|oauth|oauth_get_sbs|oauth_urlencode|oauthexception|oauthprovider|ob_clean|ob_deflatehandler|ob_end_clean|ob_end_flush|' + + 'ob_etaghandler|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|' + + 'ob_implicit_flush|ob_inflatehandler|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_array_by_name|oci_bind_by_name|oci_cancel|' + + 'oci_client_version|oci_close|oci_collection_append|oci_collection_assign|oci_collection_element_assign|oci_collection_element_get|' + + 'oci_collection_free|oci_collection_max|oci_collection_size|oci_collection_trim|oci_commit|oci_connect|oci_define_by_name|oci_error|' + + 'oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|' + + 'oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_append|' + + 'oci_lob_close|oci_lob_copy|oci_lob_eof|oci_lob_erase|oci_lob_export|oci_lob_flush|oci_lob_free|oci_lob_getbuffering|oci_lob_import|' + + 'oci_lob_is_equal|oci_lob_load|oci_lob_read|oci_lob_rewind|oci_lob_save|oci_lob_savefile|oci_lob_seek|oci_lob_setbuffering|oci_lob_size|' + + 'oci_lob_tell|oci_lob_truncate|oci_lob_write|oci_lob_writetemporary|oci_lob_writetofile|oci_new_collection|oci_new_connect|oci_new_cursor|' + + 'oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|' + + 'oci_set_action|oci_set_client_identifier|oci_set_client_info|oci_set_edition|oci_set_module_name|oci_set_prefetch|oci_statement_type|' + + 'ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|' + + 'ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|' + + 'ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|' + + 'ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|' + + 'ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|' + + 'octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|' + + 'odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|' + + 'odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|' + + 'odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|' + + 'odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|' + + 'odbc_statistics|odbc_tableprivileges|odbc_tables|openal_buffer_create|openal_buffer_data|openal_buffer_destroy|openal_buffer_get|' + + 'openal_buffer_loadwav|openal_context_create|openal_context_current|openal_context_destroy|openal_context_process|openal_context_suspend|' + + 'openal_device_close|openal_device_open|openal_listener_get|openal_listener_set|openal_source_create|openal_source_destroy|' + + 'openal_source_get|openal_source_pause|openal_source_play|openal_source_rewind|openal_source_set|openal_source_stop|openal_stream|opendir|' + + 'openlog|openssl_cipher_iv_length|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_get_public_key|openssl_csr_get_subject|' + + 'openssl_csr_new|openssl_csr_sign|openssl_decrypt|openssl_dh_compute_key|openssl_digest|openssl_encrypt|openssl_error_string|' + + 'openssl_free_key|openssl_get_cipher_methods|openssl_get_md_methods|openssl_get_privatekey|openssl_get_publickey|openssl_open|' + + 'openssl_pkcs12_export|openssl_pkcs12_export_to_file|openssl_pkcs12_read|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|' + + 'openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_free|openssl_pkey_get_details|openssl_pkey_get_private|' + + 'openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|' + + 'openssl_random_pseudo_bytes|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|' + + 'openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ord|outeriterator|' + + 'outofboundsexception|outofrangeexception|output_add_rewrite_var|output_reset_rewrite_vars|overflowexception|overload|override_function|' + + 'ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|' + + 'ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|' + + 'ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parentiterator|parse_ini_file|parse_ini_string|' + + 'parse_str|parse_url|parsekit_compile_file|parsekit_compile_string|parsekit_func_arginfo|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|' + + 'pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_signal_dispatch|pcntl_sigprocmask|pcntl_sigtimedwait|pcntl_sigwaitinfo|' + + 'pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|' + + 'pdf_activate_item|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_nameddest|pdf_add_note|pdf_add_outline|' + + 'pdf_add_pdflink|pdf_add_table_cell|pdf_add_textflow|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_document|' + + 'pdf_begin_font|pdf_begin_glyph|pdf_begin_item|pdf_begin_layer|pdf_begin_page|pdf_begin_page_ext|pdf_begin_pattern|pdf_begin_template|' + + 'pdf_begin_template_ext|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|' + + 'pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_create_3dview|pdf_create_action|pdf_create_annotation|' + + 'pdf_create_bookmark|pdf_create_field|pdf_create_fieldgroup|pdf_create_gstate|pdf_create_pvf|pdf_create_textflow|pdf_curveto|' + + 'pdf_define_layer|pdf_delete|pdf_delete_pvf|pdf_delete_table|pdf_delete_textflow|pdf_encoding_set_char|pdf_end_document|pdf_end_font|' + + 'pdf_end_glyph|pdf_end_item|pdf_end_layer|pdf_end_page|pdf_end_page_ext|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|' + + 'pdf_fill_imageblock|pdf_fill_pdfblock|pdf_fill_stroke|pdf_fill_textblock|pdf_findfont|pdf_fit_image|pdf_fit_pdi_page|pdf_fit_table|' + + 'pdf_fit_textflow|pdf_fit_textline|pdf_get_apiname|pdf_get_buffer|pdf_get_errmsg|pdf_get_errnum|pdf_get_font|pdf_get_fontname|' + + 'pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|' + + 'pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_info_font|pdf_info_matchbox|pdf_info_table|pdf_info_textflow|pdf_info_textline|' + + 'pdf_initgraphics|pdf_lineto|pdf_load_3ddata|pdf_load_font|pdf_load_iccprofile|pdf_load_image|pdf_makespotcolor|pdf_moveto|pdf_new|' + + 'pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|' + + 'pdf_open_pdi_document|pdf_open_pdi_page|pdf_open_tiff|pdf_pcos_get_number|pdf_pcos_get_stream|pdf_pcos_get_string|pdf_place_image|' + + 'pdf_place_pdi_page|pdf_process_pdi|pdf_rect|pdf_restore|pdf_resume_page|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|' + + 'pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_gstate|pdf_set_horiz_scaling|pdf_set_info|' + + 'pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_layer_dependency|' + + 'pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|' + + 'pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setdashpattern|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|' + + 'pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|' + + 'pdf_setrgbcolor_stroke|pdf_shading|pdf_shading_pattern|pdf_shfill|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|' + + 'pdf_suspend_page|pdf_translate|pdf_utf16_to_utf8|pdf_utf32_to_utf16|pdf_utf8_to_utf16|pdo|pdo_cubrid_schema|pdo_pgsqllobcreate|' + + 'pdo_pgsqllobopen|pdo_pgsqllobunlink|pdo_sqlitecreateaggregate|pdo_sqlitecreatefunction|pdoexception|pdostatement|pfsockopen|' + + 'pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|' + + 'pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_execute|pg_fetch_all|' + + 'pg_fetch_all_columns|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|' + + 'pg_field_num|pg_field_prtlen|pg_field_size|pg_field_table|pg_field_type|pg_field_type_oid|pg_free_result|pg_get_notify|pg_get_pid|' + + 'pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|' + + 'pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|' + + 'pg_parameter_status|pg_pconnect|pg_ping|pg_port|pg_prepare|pg_put_line|pg_query|pg_query_params|pg_result_error|pg_result_error_field|' + + 'pg_result_seek|pg_result_status|pg_select|pg_send_execute|pg_send_prepare|pg_send_query|pg_send_query_params|pg_set_client_encoding|' + + 'pg_set_error_verbosity|pg_trace|pg_transaction_status|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|pg_version|php_check_syntax|' + + 'php_ini_loaded_file|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_strip_whitespace|php_uname|phpcredits|phpinfo|phpversion|pi|' + + 'png2wbmp|popen|pos|posix_access|posix_ctermid|posix_errno|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|' + + 'posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|' + + 'posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_initgroups|posix_isatty|posix_kill|posix_mkfifo|posix_mknod|posix_setegid|' + + 'posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_filter|' + + 'preg_grep|preg_last_error|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|' + + 'printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|' + + 'printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|' + + 'printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|' + + 'printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|' + + 'printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|property_exists|' + + 'ps_add_bookmark|ps_add_launchlink|ps_add_locallink|ps_add_note|ps_add_pdflink|ps_add_weblink|ps_arc|ps_arcn|ps_begin_page|' + + 'ps_begin_pattern|ps_begin_template|ps_circle|ps_clip|ps_close|ps_close_image|ps_closepath|ps_closepath_stroke|ps_continue_text|ps_curveto|' + + 'ps_delete|ps_end_page|ps_end_pattern|ps_end_template|ps_fill|ps_fill_stroke|ps_findfont|ps_get_buffer|ps_get_parameter|ps_get_value|' + + 'ps_hyphenate|ps_include_file|ps_lineto|ps_makespotcolor|ps_moveto|ps_new|ps_open_file|ps_open_image|ps_open_image_file|' + + 'ps_open_memory_image|ps_place_image|ps_rect|ps_restore|ps_rotate|ps_save|ps_scale|ps_set_border_color|ps_set_border_dash|' + + 'ps_set_border_style|ps_set_info|ps_set_parameter|ps_set_text_pos|ps_set_value|ps_setcolor|ps_setdash|ps_setflat|ps_setfont|ps_setgray|' + + 'ps_setlinecap|ps_setlinejoin|ps_setlinewidth|ps_setmiterlimit|ps_setoverprintmode|ps_setpolydash|ps_shading|ps_shading_pattern|ps_shfill|' + + 'ps_show|ps_show2|ps_show_boxed|ps_show_xy|ps_show_xy2|ps_string_geometry|ps_stringwidth|ps_stroke|ps_symbol|ps_symbol_name|' + + 'ps_symbol_width|ps_translate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|' + + 'pspell_config_data_dir|pspell_config_dict_dir|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|' + + 'pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|' + + 'pspell_store_replacement|pspell_suggest|putenv|px_close|px_create_fp|px_date2string|px_delete|px_delete_record|px_get_field|px_get_info|' + + 'px_get_parameter|px_get_record|px_get_schema|px_get_value|px_insert_record|px_new|px_numfields|px_numrecords|px_open_fp|px_put_record|' + + 'px_retrieve_record|px_set_blob_file|px_set_parameter|px_set_tablename|px_set_targetencoding|px_set_value|px_timestamp2string|' + + 'px_update_record|qdom_error|qdom_tree|quoted_printable_decode|quoted_printable_encode|quotemeta|rad2deg|radius_acct_open|' + + 'radius_add_server|radius_auth_open|radius_close|radius_config|radius_create_request|radius_cvt_addr|radius_cvt_int|radius_cvt_string|' + + 'radius_demangle|radius_demangle_mppe_key|radius_get_attr|radius_get_vendor_attr|radius_put_addr|radius_put_attr|radius_put_int|' + + 'radius_put_string|radius_put_vendor_addr|radius_put_vendor_attr|radius_put_vendor_int|radius_put_vendor_string|' + + 'radius_request_authenticator|radius_send_request|radius_server_secret|radius_strerror|rand|range|rangeexception|rar_wrapper_cache_stats|' + + 'rararchive|rarentry|rarexception|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|' + + 'readline_callback_handler_install|readline_callback_handler_remove|readline_callback_read_char|readline_clear_history|' + + 'readline_completion_function|readline_info|readline_list_history|readline_on_new_line|readline_read_history|readline_redisplay|' + + 'readline_write_history|readlink|realpath|realpath_cache_get|realpath_cache_size|recode|recode_file|recode_string|recursivearrayiterator|' + + 'recursivecachingiterator|recursivecallbackfilteriterator|recursivedirectoryiterator|recursivefilteriterator|recursiveiterator|' + + 'recursiveiteratoriterator|recursiveregexiterator|recursivetreeiterator|reflection|reflectionclass|reflectionexception|reflectionextension|' + + 'reflectionfunction|reflectionfunctionabstract|reflectionmethod|reflectionobject|reflectionparameter|reflectionproperty|reflector|' + + 'regexiterator|register_shutdown_function|register_tick_function|rename|rename_function|require|require_once|reset|resetValue|' + + 'resourcebundle|restore_error_handler|restore_exception_handler|restore_include_path|return|rewind|rewinddir|rmdir|round|rpm_close|' + + 'rpm_get_tag|rpm_is_valid|rpm_open|rpm_version|rrd_create|rrd_error|rrd_fetch|rrd_first|rrd_graph|rrd_info|rrd_last|rrd_lastupdate|' + + 'rrd_restore|rrd_tune|rrd_update|rrd_xport|rrdcreator|rrdgraph|rrdupdater|rsort|rtrim|runkit_class_adopt|runkit_class_emancipate|' + + 'runkit_constant_add|runkit_constant_redefine|runkit_constant_remove|runkit_function_add|runkit_function_copy|runkit_function_redefine|' + + 'runkit_function_remove|runkit_function_rename|runkit_import|runkit_lint|runkit_lint_file|runkit_method_add|runkit_method_copy|' + + 'runkit_method_redefine|runkit_method_remove|runkit_method_rename|runkit_return_value_used|runkit_sandbox_output_handler|' + + 'runkit_superglobals|runtimeexception|samconnection_commit|samconnection_connect|samconnection_constructor|samconnection_disconnect|' + + 'samconnection_errno|samconnection_error|samconnection_isconnected|samconnection_peek|samconnection_peekall|samconnection_receive|' + + 'samconnection_remove|samconnection_rollback|samconnection_send|samconnection_setDebug|samconnection_subscribe|samconnection_unsubscribe|' + + 'sammessage_body|sammessage_constructor|sammessage_header|sca_createdataobject|sca_getservice|sca_localproxy_createdataobject|' + + 'sca_soapproxy_createdataobject|scandir|sdo_das_changesummary_beginlogging|sdo_das_changesummary_endlogging|' + + 'sdo_das_changesummary_getchangeddataobjects|sdo_das_changesummary_getchangetype|sdo_das_changesummary_getoldcontainer|' + + 'sdo_das_changesummary_getoldvalues|sdo_das_changesummary_islogging|sdo_das_datafactory_addpropertytotype|sdo_das_datafactory_addtype|' + + 'sdo_das_datafactory_getdatafactory|sdo_das_dataobject_getchangesummary|sdo_das_relational_applychanges|sdo_das_relational_construct|' + + 'sdo_das_relational_createrootdataobject|sdo_das_relational_executepreparedquery|sdo_das_relational_executequery|' + + 'sdo_das_setting_getlistindex|sdo_das_setting_getpropertyindex|sdo_das_setting_getpropertyname|sdo_das_setting_getvalue|' + + 'sdo_das_setting_isset|sdo_das_xml_addtypes|sdo_das_xml_create|sdo_das_xml_createdataobject|sdo_das_xml_createdocument|' + + 'sdo_das_xml_document_getrootdataobject|sdo_das_xml_document_getrootelementname|sdo_das_xml_document_getrootelementuri|' + + 'sdo_das_xml_document_setencoding|sdo_das_xml_document_setxmldeclaration|sdo_das_xml_document_setxmlversion|sdo_das_xml_loadfile|' + + 'sdo_das_xml_loadstring|sdo_das_xml_savefile|sdo_das_xml_savestring|sdo_datafactory_create|sdo_dataobject_clear|' + + 'sdo_dataobject_createdataobject|sdo_dataobject_getcontainer|sdo_dataobject_getsequence|sdo_dataobject_gettypename|' + + 'sdo_dataobject_gettypenamespaceuri|sdo_exception_getcause|sdo_list_insert|sdo_model_property_getcontainingtype|' + + 'sdo_model_property_getdefault|sdo_model_property_getname|sdo_model_property_gettype|sdo_model_property_iscontainment|' + + 'sdo_model_property_ismany|sdo_model_reflectiondataobject_construct|sdo_model_reflectiondataobject_export|' + + 'sdo_model_reflectiondataobject_getcontainmentproperty|sdo_model_reflectiondataobject_getinstanceproperties|' + + 'sdo_model_reflectiondataobject_gettype|sdo_model_type_getbasetype|sdo_model_type_getname|sdo_model_type_getnamespaceuri|' + + 'sdo_model_type_getproperties|sdo_model_type_getproperty|sdo_model_type_isabstracttype|sdo_model_type_isdatatype|sdo_model_type_isinstance|' + + 'sdo_model_type_isopentype|sdo_model_type_issequencedtype|sdo_sequence_getproperty|sdo_sequence_insert|sdo_sequence_move|seekableiterator|' + + 'sem_acquire|sem_get|sem_release|sem_remove|serializable|serialize|session_cache_expire|session_cache_limiter|session_commit|' + + 'session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|' + + 'session_pgsql_add_error|session_pgsql_get_error|session_pgsql_get_field|session_pgsql_reset|session_pgsql_set_field|session_pgsql_status|' + + 'session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|' + + 'session_unregister|session_unset|session_write_close|setCounterClass|set_error_handler|set_exception_handler|set_file_buffer|' + + 'set_include_path|set_magic_quotes_runtime|set_socket_blocking|set_time_limit|setcookie|setlocale|setproctitle|setrawcookie|' + + 'setstaticpropertyvalue|setthreadtitle|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_has_var|shm_put_var|' + + 'shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|signeurlpaiement|' + + 'similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|simplexmlelement|simplexmliterator|sin|sinh|sizeof|sleep|snmp|' + + 'snmp2_get|snmp2_getnext|snmp2_real_walk|snmp2_set|snmp2_walk|snmp3_get|snmp3_getnext|snmp3_real_walk|snmp3_set|snmp3_walk|' + + 'snmp_get_quick_print|snmp_get_valueretrieval|snmp_read_mib|snmp_set_enum_print|snmp_set_oid_numeric_print|snmp_set_oid_output_format|' + + 'snmp_set_quick_print|snmp_set_valueretrieval|snmpget|snmpgetnext|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|soapclient|soapfault|' + + 'soapheader|soapparam|soapserver|soapvar|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|' + + 'socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_last_error|' + + 'socket_listen|socket_read|socket_recv|socket_recvfrom|socket_select|socket_send|socket_sendto|socket_set_block|socket_set_blocking|' + + 'socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|solr_get_version|solrclient|' + + 'solrclientexception|solrdocument|solrdocumentfield|solrexception|solrgenericresponse|solrillegalargumentexception|' + + 'solrillegaloperationexception|solrinputdocument|solrmodifiableparams|solrobject|solrparams|solrpingresponse|solrquery|solrqueryresponse|' + + 'solrresponse|solrupdateresponse|solrutils|sort|soundex|sphinxclient|spl_autoload|spl_autoload_call|spl_autoload_extensions|' + + 'spl_autoload_functions|spl_autoload_register|spl_autoload_unregister|spl_classes|spl_object_hash|splbool|spldoublylinkedlist|splenum|' + + 'splfileinfo|splfileobject|splfixedarray|splfloat|splheap|splint|split|spliti|splmaxheap|splminheap|splobjectstorage|splobserver|' + + 'splpriorityqueue|splqueue|splstack|splstring|splsubject|spltempfileobject|spoofchecker|sprintf|sql_regcase|sqlite3|sqlite3result|' + + 'sqlite3stmt|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|' + + 'sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_exec|sqlite_factory|sqlite_fetch_all|' + + 'sqlite_fetch_array|sqlite_fetch_column_types|sqlite_fetch_object|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|' + + 'sqlite_has_more|sqlite_has_prev|sqlite_key|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|' + + 'sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_prev|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_single_query|' + + 'sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqlite_valid|sqrt|srand|sscanf|ssdeep_fuzzy_compare|' + + 'ssdeep_fuzzy_hash|ssdeep_fuzzy_hash_filename|ssh2_auth_hostbased_file|ssh2_auth_none|ssh2_auth_password|ssh2_auth_pubkey_file|' + + 'ssh2_connect|ssh2_exec|ssh2_fetch_stream|ssh2_fingerprint|ssh2_methods_negotiated|ssh2_publickey_add|ssh2_publickey_init|' + + 'ssh2_publickey_list|ssh2_publickey_remove|ssh2_scp_recv|ssh2_scp_send|ssh2_sftp|ssh2_sftp_lstat|ssh2_sftp_mkdir|ssh2_sftp_readlink|' + + 'ssh2_sftp_realpath|ssh2_sftp_rename|ssh2_sftp_rmdir|ssh2_sftp_stat|ssh2_sftp_symlink|ssh2_sftp_unlink|ssh2_shell|ssh2_tunnel|stat|' + + 'stats_absolute_deviation|stats_cdf_beta|stats_cdf_binomial|stats_cdf_cauchy|stats_cdf_chisquare|stats_cdf_exponential|stats_cdf_f|' + + 'stats_cdf_gamma|stats_cdf_laplace|stats_cdf_logistic|stats_cdf_negative_binomial|stats_cdf_noncentral_chisquare|stats_cdf_noncentral_f|' + + 'stats_cdf_poisson|stats_cdf_t|stats_cdf_uniform|stats_cdf_weibull|stats_covariance|stats_den_uniform|stats_dens_beta|stats_dens_cauchy|' + + 'stats_dens_chisquare|stats_dens_exponential|stats_dens_f|stats_dens_gamma|stats_dens_laplace|stats_dens_logistic|' + + 'stats_dens_negative_binomial|stats_dens_normal|stats_dens_pmf_binomial|stats_dens_pmf_hypergeometric|stats_dens_pmf_poisson|stats_dens_t|' + + 'stats_dens_weibull|stats_harmonic_mean|stats_kurtosis|stats_rand_gen_beta|stats_rand_gen_chisquare|stats_rand_gen_exponential|' + + 'stats_rand_gen_f|stats_rand_gen_funiform|stats_rand_gen_gamma|stats_rand_gen_ibinomial|stats_rand_gen_ibinomial_negative|' + + 'stats_rand_gen_int|stats_rand_gen_ipoisson|stats_rand_gen_iuniform|stats_rand_gen_noncenral_chisquare|stats_rand_gen_noncentral_f|' + + 'stats_rand_gen_noncentral_t|stats_rand_gen_normal|stats_rand_gen_t|stats_rand_get_seeds|stats_rand_phrase_to_seeds|stats_rand_ranf|' + + 'stats_rand_setall|stats_skew|stats_standard_deviation|stats_stat_binomial_coef|stats_stat_correlation|stats_stat_gennch|' + + 'stats_stat_independent_t|stats_stat_innerproduct|stats_stat_noncentral_t|stats_stat_paired_t|stats_stat_percentile|stats_stat_powersum|' + + 'stats_variance|stomp|stomp_connect_error|stomp_version|stompexception|stompframe|str_getcsv|str_ireplace|str_pad|str_repeat|str_replace|' + + 'str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_bucket_append|stream_bucket_make_writeable|' + + 'stream_bucket_new|stream_bucket_prepend|stream_context_create|stream_context_get_default|stream_context_get_options|' + + 'stream_context_get_params|stream_context_set_default|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|' + + 'stream_encoding|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_filter_remove|stream_get_contents|' + + 'stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_is_local|' + + 'stream_notification_callback|stream_register_wrapper|stream_resolve_include_path|stream_select|stream_set_blocking|stream_set_read_buffer|' + + 'stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_enable_crypto|stream_socket_get_name|' + + 'stream_socket_pair|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_socket_shutdown|stream_supports_lock|' + + 'stream_wrapper_register|stream_wrapper_restore|stream_wrapper_unregister|streamwrapper|strftime|strip_tags|stripcslashes|stripos|' + + 'stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpbrk|strpos|strptime|strrchr|strrev|strripos|strrpos|strspn|' + + 'strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|svm|svmmodel|svn_add|' + + 'svn_auth_get_parameter|svn_auth_set_parameter|svn_blame|svn_cat|svn_checkout|svn_cleanup|svn_client_version|svn_commit|svn_delete|' + + 'svn_diff|svn_export|svn_fs_abort_txn|svn_fs_apply_text|svn_fs_begin_txn2|svn_fs_change_node_prop|svn_fs_check_path|' + + 'svn_fs_contents_changed|svn_fs_copy|svn_fs_delete|svn_fs_dir_entries|svn_fs_file_contents|svn_fs_file_length|svn_fs_is_dir|svn_fs_is_file|' + + 'svn_fs_make_dir|svn_fs_make_file|svn_fs_node_created_rev|svn_fs_node_prop|svn_fs_props_changed|svn_fs_revision_prop|svn_fs_revision_root|' + + 'svn_fs_txn_root|svn_fs_youngest_rev|svn_import|svn_log|svn_ls|svn_mkdir|svn_repos_create|svn_repos_fs|svn_repos_fs_begin_txn_for_commit|' + + 'svn_repos_fs_commit_txn|svn_repos_hotcopy|svn_repos_open|svn_repos_recover|svn_revert|svn_status|svn_update|swf_actiongeturl|' + + 'swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|' + + 'swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|' + + 'swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|' + + 'swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|' + + 'swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|' + + 'swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|' + + 'swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|' + + 'swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|' + + 'swfbitmap|swfbutton|swfdisplayitem|swffill|swffont|swffontchar|swfgradient|swfmorph|swfmovie|swfprebuiltclip|swfshape|swfsound|' + + 'swfsoundinstance|swfsprite|swftext|swftextfield|swfvideostream|swish_construct|swish_getmetalist|swish_getpropertylist|swish_prepare|' + + 'swish_query|swishresult_getmetalist|swishresult_stem|swishresults_getparsedwords|swishresults_getremovedstopwords|swishresults_nextresult|' + + 'swishresults_seekresult|swishsearch_execute|swishsearch_resetlimit|swishsearch_setlimit|swishsearch_setphrasedelimiter|' + + 'swishsearch_setsort|swishsearch_setstructure|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|' + + 'sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|' + + 'sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|' + + 'sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|' + + 'sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|sys_get_temp_dir|sys_getloadavg|syslog|system|tag|tan|tanh|' + + 'tcpwrap_check|tempnam|textdomain|tidy|tidy_access_count|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_error_buffer|' + + 'tidy_get_output|tidy_load_config|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|tidynode|time|' + + 'time_nanosleep|time_sleep_until|timezone_abbreviations_list|timezone_identifiers_list|timezone_location_get|timezone_name_from_abbr|' + + 'timezone_name_get|timezone_offset_get|timezone_open|timezone_transitions_get|timezone_version_get|tmpfile|token_get_all|token_name|' + + 'tokyotyrant|tokyotyrantquery|tokyotyranttable|tostring|tostring|touch|trait_exists|transliterator|traversable|trigger_error|trim|uasort|ucfirst|' + + 'ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|' + + 'udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|' + + 'udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|' + + 'uksort|umask|underflowexception|unexpectedvalueexception|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|' + + 'urldecode|urlencode|use_soap_error_handler|user_error|usleep|usort|utf8_decode|utf8_encode|v8js|v8jsexception|var_dump|var_export|variant|' + + 'variant_abs|variant_add|variant_and|variant_cast|variant_cat|variant_cmp|variant_date_from_timestamp|variant_date_to_timestamp|' + + 'variant_div|variant_eqv|variant_fix|variant_get_type|variant_idiv|variant_imp|variant_int|variant_mod|variant_mul|variant_neg|variant_not|' + + 'variant_or|variant_pow|variant_round|variant_set|variant_set_type|variant_sub|variant_xor|version_compare|vfprintf|virtual|' + + 'vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|' + + 'vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|' + + 'vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|' + + 'w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|' + + 'wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|win32_continue_service|win32_create_service|win32_delete_service|' + + 'win32_get_last_control_message|win32_pause_service|win32_ps_list_procs|win32_ps_stat_mem|win32_ps_stat_proc|win32_query_service_status|' + + 'win32_set_service_status|win32_start_service|win32_start_service_ctrl_dispatcher|win32_stop_service|wincache_fcache_fileinfo|' + + 'wincache_fcache_meminfo|wincache_lock|wincache_ocache_fileinfo|wincache_ocache_meminfo|wincache_refresh_if_changed|' + + 'wincache_rplist_fileinfo|wincache_rplist_meminfo|wincache_scache_info|wincache_scache_meminfo|wincache_ucache_add|wincache_ucache_cas|' + + 'wincache_ucache_clear|wincache_ucache_dec|wincache_ucache_delete|wincache_ucache_exists|wincache_ucache_get|wincache_ucache_inc|' + + 'wincache_ucache_info|wincache_ucache_meminfo|wincache_ucache_set|wincache_unlock|wordwrap|xattr_get|xattr_list|xattr_remove|xattr_set|' + + 'xattr_supported|xdiff_file_bdiff|xdiff_file_bdiff_size|xdiff_file_bpatch|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|' + + 'xdiff_file_patch|xdiff_file_patch_binary|xdiff_file_rabdiff|xdiff_string_bdiff|xdiff_string_bdiff_size|xdiff_string_bpatch|' + + 'xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xdiff_string_rabdiff|' + + 'xhprof_disable|xhprof_enable|xhprof_sample_disable|xhprof_sample_enable|xml_error_string|xml_get_current_byte_index|' + + 'xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|' + + 'xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|' + + 'xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|' + + 'xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlreader|' + + 'xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_is_fault|xmlrpc_parse_method_descriptions|' + + 'xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|' + + 'xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xmlwriter_end_attribute|xmlwriter_end_cdata|' + + 'xmlwriter_end_comment|xmlwriter_end_document|xmlwriter_end_dtd|xmlwriter_end_dtd_attlist|xmlwriter_end_dtd_element|' + + 'xmlwriter_end_dtd_entity|xmlwriter_end_element|xmlwriter_end_pi|xmlwriter_flush|xmlwriter_full_end_element|xmlwriter_open_memory|' + + 'xmlwriter_open_uri|xmlwriter_output_memory|xmlwriter_set_indent|xmlwriter_set_indent_string|xmlwriter_start_attribute|' + + 'xmlwriter_start_attribute_ns|xmlwriter_start_cdata|xmlwriter_start_comment|xmlwriter_start_document|xmlwriter_start_dtd|' + + 'xmlwriter_start_dtd_attlist|xmlwriter_start_dtd_element|xmlwriter_start_dtd_entity|xmlwriter_start_element|xmlwriter_start_element_ns|' + + 'xmlwriter_start_pi|xmlwriter_text|xmlwriter_write_attribute|xmlwriter_write_attribute_ns|xmlwriter_write_cdata|xmlwriter_write_comment|' + + 'xmlwriter_write_dtd|xmlwriter_write_dtd_attlist|xmlwriter_write_dtd_element|xmlwriter_write_dtd_entity|xmlwriter_write_element|' + + 'xmlwriter_write_element_ns|xmlwriter_write_pi|xmlwriter_write_raw|xpath_eval|xpath_eval_expression|xpath_new_context|xpath_register_ns|' + + 'xpath_register_ns_auto|xptr_eval|xptr_new_context|xslt_backend_info|xslt_backend_name|xslt_backend_version|xslt_create|xslt_errno|' + + 'xslt_error|xslt_free|xslt_getopt|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_object|' + + 'xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|xslt_setopt|xsltprocessor|yaml_emit|' + + 'yaml_emit_file|yaml_parse|yaml_parse_file|yaml_parse_url|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|' + + 'yaz_element|yaz_errno|yaz_error|yaz_es|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|' + + 'yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|' + + 'yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_thread_id|zend_version|zip_close|zip_entry_close|' + + 'zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|' + + 'ziparchive|ziparchive_addemptydir|ziparchive_addfile|ziparchive_addfromstring|ziparchive_close|ziparchive_deleteindex|' + + 'ziparchive_deletename|ziparchive_extractto|ziparchive_getarchivecomment|ziparchive_getcommentindex|ziparchive_getcommentname|' + + 'ziparchive_getfromindex|ziparchive_getfromname|ziparchive_getnameindex|ziparchive_getstatusstring|ziparchive_getstream|' + + 'ziparchive_locatename|ziparchive_open|ziparchive_renameindex|ziparchive_renamename|ziparchive_setCommentName|ziparchive_setarchivecomment|' + + 'ziparchive_setcommentindex|ziparchive_statindex|ziparchive_statname|ziparchive_unchangeall|ziparchive_unchangearchive|' + + 'ziparchive_unchangeindex|ziparchive_unchangename|zlib_get_coding_type').split('|') + ); + var keywords = lang.arrayToMap( + ('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').split('|') + ); + var languageConstructs = lang.arrayToMap( + ('die|echo|empty|exit|eval|include|include_once|isset|list|require|require_once|return|print|unset').split('|') + ); + + var builtinConstants = lang.arrayToMap( + ('true|TRUE|false|FALSE|null|NULL|__CLASS__|__DIR__|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__NAMESPACE__').split('|') + ); + + var builtinVariables = lang.arrayToMap( + ('$GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|' + + '$http_response_header|$argc|$argv').split('|') + ); + var builtinFunctionsDeprecated = lang.arrayToMap( + ('key_exists|cairo_matrix_create_scale|cairo_matrix_create_translate|call_user_method|call_user_method_array|com_addref|com_get|' + + 'com_invoke|com_isenum|com_load|com_release|com_set|connection_timeout|cubrid_load_from_glo|cubrid_new_glo|cubrid_save_to_glo|' + + 'cubrid_send_glo|define_syslog_variables|dl|ereg|ereg_replace|eregi|eregi_replace|hw_documentattributes|hw_documentbodytag|' + + 'hw_documentsize|hw_outputdocument|imagedashedline|maxdb_bind_param|maxdb_bind_result|maxdb_client_encoding|maxdb_close_long_data|' + + 'maxdb_execute|maxdb_fetch|maxdb_get_metadata|maxdb_param_count|maxdb_send_long_data|mcrypt_ecb|mcrypt_generic_end|mime_content_type|' + + 'mysql_createdb|mysql_dbname|mysql_db_query|mysql_drop_db|mysql_dropdb|mysql_escape_string|mysql_fieldflags|mysql_fieldflags|' + + 'mysql_fieldname|mysql_fieldtable|mysql_fieldtype|mysql_freeresult|mysql_listdbs|mysql_list_fields|mysql_listfields|mysql_list_tables|' + + 'mysql_listtables|mysql_numfields|mysql_numrows|mysql_selectdb|mysql_tablename|mysqli_bind_param|mysqli_bind_result|' + + 'mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_execute|' + + 'mysqli_fetch|mysqli_get_metadata|mysqli_master_query|mysqli_param_count|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|' + + 'mysqli_send_long_data|mysqli_send_query|mysqli_slave_query|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|' + + 'ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|' + + 'ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|' + + 'ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|' + + 'ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|' + + 'ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|PDF_add_annotation|PDF_add_bookmark|' + + 'PDF_add_launchlink|PDF_add_locallink|PDF_add_note|PDF_add_outline|PDF_add_pdflink|PDF_add_weblink|PDF_attach_file|PDF_begin_page|' + + 'PDF_begin_template|PDF_close_pdi|PDF_close|PDF_findfont|PDF_get_font|PDF_get_fontname|PDF_get_fontsize|PDF_get_image_height|' + + 'PDF_get_image_width|PDF_get_majorversion|PDF_get_minorversion|PDF_get_pdi_parameter|PDF_get_pdi_value|PDF_open_ccitt|PDF_open_file|' + + 'PDF_open_gif|PDF_open_image_file|PDF_open_image|PDF_open_jpeg|PDF_open_pdi|PDF_open_tiff|PDF_place_image|PDF_place_pdi_page|' + + 'PDF_set_border_color|PDF_set_border_dash|PDF_set_border_style|PDF_set_char_spacing|PDF_set_duration|PDF_set_horiz_scaling|' + + 'PDF_set_info_author|PDF_set_info_creator|PDF_set_info_keywords|PDF_set_info_subject|PDF_set_info_title|PDF_set_leading|' + + 'PDF_set_text_matrix|PDF_set_text_rendering|PDF_set_text_rise|PDF_set_word_spacing|PDF_setgray_fill|PDF_setgray_stroke|PDF_setgray|' + + 'PDF_setpolydash|PDF_setrgbcolor_fill|PDF_setrgbcolor_stroke|PDF_setrgbcolor|PDF_show_boxed|php_check_syntax|px_set_tablename|' + + 'px_set_targetencoding|runkit_sandbox_output_handler|session_is_registered|session_register|session_unregister' + + 'set_magic_quotes_runtime|magic_quotes_runtime|set_socket_blocking|socket_set_blocking|set_socket_timeout|socket_set_timeout|split|spliti|' + + 'sql_regcase').split('|') + ); + + var keywordsDeprecated = lang.arrayToMap( + ('cfunction|old_function').split('|') + ); + + var futureReserved = lang.arrayToMap([]); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : /(?:#|\/\/)(?:[^?]|\?[^>])*/ + }, + docComment.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)" + }, { + token : "string", // " string start + regex : '"', + next : "qqstring" + }, { + token : "string", // ' string start + regex : "'", + next : "qstring" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language", // constants + regex : "\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|" + + "ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|" + + "HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|" + + "L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|" + + "VERSION))|__COMPILER_HALT_OFFSET__)\\b" + }, { + token : ["keyword", "text", "support.class"], + regex : "\\b(new)(\\s+)(\\w+)" + }, { + token : ["support.class", "keyword.operator"], + regex : "\\b(\\w+)(::)" + }, { + token : "constant.language", // constants + regex : "\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|" + + "SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|" + + "O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|" + + "R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|" + + "YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|" + + "ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|" + + "T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|" + + "HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|" + + "I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|" + + "O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|" + + "L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|" + + "M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|" + + "OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|" + + "P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|" + + "RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|" + + "T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b" + }, { + token : function(value) { + if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (builtinConstants.hasOwnProperty(value)) + return "constant.language"; + else if (builtinVariables.hasOwnProperty(value)) + return "variable.language"; + else if (futureReserved.hasOwnProperty(value)) + return "invalid.illegal"; + else if (builtinFunctions.hasOwnProperty(value)) + return "support.function"; + else if (value == "debugger") + return "invalid.deprecated"; + else + if(value.match(/^(\$[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*|self|parent)$/)) + return "variable"; + return "identifier"; + }, + regex : /[a-zA-Z_$\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/ + }, { + onMatch : function(value, currentSate, state) { + value = value.substr(3); + if (value[0] == "'" || value[0] == '"') + value = value.slice(1, -1); + state.unshift(this.next, value); + return "markup.list"; + }, + regex : /<<<(?:\w+|'\w+'|"\w+")$/, + next: "heredoc" + }, { + token : "keyword.operator", + regex : "::|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|!=|!==|<=|>=|=>|<<=|>>=|>>>=|<>|<|>|=|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "heredoc" : [ + { + onMatch : function(value, currentSate, stack) { + if (stack[1] != value) + return "string"; + stack.shift(); + stack.shift(); + return "markup.list"; + }, + regex : "^\\w+(?=;?$)", + next: "start" + }, { + token: "string", + regex : ".*" + } + ], + "comment" : [ + { + token : "comment", + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : '\\\\(?:[nrtvef\\\\"$]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})' + }, { + token : "variable", + regex : /\$[\w]+(?:\[[\w\]+]|[=\-]>\w+)?/ + }, { + token : "variable", + regex : /\$\{[^"\}]+\}?/ // this is wrong but ok for now + }, + {token : "string", regex : '"', next : "start"}, + {defaultToken : "string"} + ], + "qstring" : [ + {token : "constant.language.escape", regex : /\\['\\]/}, + {token : "string", regex : "'", next : "start"}, + {defaultToken : "string"} + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(PhpLangHighlightRules, TextHighlightRules); + + +var PhpHighlightRules = function() { + HtmlHighlightRules.call(this); + + var startRules = [ + { + token : "support.php_tag", // php open tag + regex : "<\\?(?:php|=)?", + push : "php-start" + } + ]; + + var endRules = [ + { + token : "support.php_tag", // php close tag + regex : "\\?>", + next : "pop" + } + ]; + + for (var key in this.$rules) + this.$rules[key].unshift.apply(this.$rules[key], startRules); + + this.embedRules(PhpLangHighlightRules, "php-", endRules, ["start"]); + + this.normalizeRules(); +}; + +oop.inherits(PhpHighlightRules, HtmlHighlightRules); + +exports.PhpHighlightRules = PhpHighlightRules; +exports.PhpLangHighlightRules = PhpLangHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/php_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var functionMap = { + "abs": [ + "int abs(int number)", + "Return the absolute value of the number" + ], + "acos": [ + "float acos(float number)", + "Return the arc cosine of the number in radians" + ], + "acosh": [ + "float acosh(float number)", + "Returns the inverse hyperbolic cosine of the number, i.e. the value whose hyperbolic cosine is number" + ], + "addGlob": [ + "bool addGlob(string pattern[,int flags [, array options]])", + "Add files matching the glob pattern. See php's glob for the pattern syntax." + ], + "addPattern": [ + "bool addPattern(string pattern[, string path [, array options]])", + "Add files matching the pcre pattern. See php's pcre for the pattern syntax." + ], + "addcslashes": [ + "string addcslashes(string str, string charlist)", + "Escapes all chars mentioned in charlist with backslash. It creates octal representations if asked to backslash characters with 8th bit set or with ASCII<32 (except '\\n', '\\r', '\\t' etc...)" + ], + "addslashes": [ + "string addslashes(string str)", + "Escapes single quote, double quotes and backslash characters in a string with backslashes" + ], + "apache_child_terminate": [ + "bool apache_child_terminate(void)", + "Terminate apache process after this request" + ], + "apache_get_modules": [ + "array apache_get_modules(void)", + "Get a list of loaded Apache modules" + ], + "apache_get_version": [ + "string apache_get_version(void)", + "Fetch Apache version" + ], + "apache_getenv": [ + "bool apache_getenv(string variable [, bool walk_to_top])", + "Get an Apache subprocess_env variable" + ], + "apache_lookup_uri": [ + "object apache_lookup_uri(string URI)", + "Perform a partial request of the given URI to obtain information about it" + ], + "apache_note": [ + "string apache_note(string note_name [, string note_value])", + "Get and set Apache request notes" + ], + "apache_request_auth_name": [ + "string apache_request_auth_name()", + "" + ], + "apache_request_auth_type": [ + "string apache_request_auth_type()", + "" + ], + "apache_request_discard_request_body": [ + "long apache_request_discard_request_body()", + "" + ], + "apache_request_err_headers_out": [ + "array apache_request_err_headers_out([{string name|array list} [, string value [, bool replace = false]]])", + "* fetch all headers that go out in case of an error or a subrequest" + ], + "apache_request_headers": [ + "array apache_request_headers(void)", + "Fetch all HTTP request headers" + ], + "apache_request_headers_in": [ + "array apache_request_headers_in()", + "* fetch all incoming request headers" + ], + "apache_request_headers_out": [ + "array apache_request_headers_out([{string name|array list} [, string value [, bool replace = false]]])", + "* fetch all outgoing request headers" + ], + "apache_request_is_initial_req": [ + "bool apache_request_is_initial_req()", + "" + ], + "apache_request_log_error": [ + "boolean apache_request_log_error(string message, [long facility])", + "" + ], + "apache_request_meets_conditions": [ + "long apache_request_meets_conditions()", + "" + ], + "apache_request_remote_host": [ + "int apache_request_remote_host([int type])", + "" + ], + "apache_request_run": [ + "long apache_request_run()", + "This is a wrapper for ap_sub_run_req and ap_destory_sub_req. It takes sub_request, runs it, destroys it, and returns it's status." + ], + "apache_request_satisfies": [ + "long apache_request_satisfies()", + "" + ], + "apache_request_server_port": [ + "int apache_request_server_port()", + "" + ], + "apache_request_set_etag": [ + "void apache_request_set_etag()", + "" + ], + "apache_request_set_last_modified": [ + "void apache_request_set_last_modified()", + "" + ], + "apache_request_some_auth_required": [ + "bool apache_request_some_auth_required()", + "" + ], + "apache_request_sub_req_lookup_file": [ + "object apache_request_sub_req_lookup_file(string file)", + "Returns sub-request for the specified file. You would need to run it yourself with run()." + ], + "apache_request_sub_req_lookup_uri": [ + "object apache_request_sub_req_lookup_uri(string uri)", + "Returns sub-request for the specified uri. You would need to run it yourself with run()" + ], + "apache_request_sub_req_method_uri": [ + "object apache_request_sub_req_method_uri(string method, string uri)", + "Returns sub-request for the specified file. You would need to run it yourself with run()." + ], + "apache_request_update_mtime": [ + "long apache_request_update_mtime([int dependency_mtime])", + "" + ], + "apache_reset_timeout": [ + "bool apache_reset_timeout(void)", + "Reset the Apache write timer" + ], + "apache_response_headers": [ + "array apache_response_headers(void)", + "Fetch all HTTP response headers" + ], + "apache_setenv": [ + "bool apache_setenv(string variable, string value [, bool walk_to_top])", + "Set an Apache subprocess_env variable" + ], + "array_change_key_case": [ + "array array_change_key_case(array input [, int case=CASE_LOWER])", + "Retuns an array with all string keys lowercased [or uppercased]" + ], + "array_chunk": [ + "array array_chunk(array input, int size [, bool preserve_keys])", + "Split array into chunks" + ], + "array_combine": [ + "array array_combine(array keys, array values)", + "Creates an array by using the elements of the first parameter as keys and the elements of the second as the corresponding values" + ], + "array_count_values": [ + "array array_count_values(array input)", + "Return the value as key and the frequency of that value in input as value" + ], + "array_diff": [ + "array array_diff(array arr1, array arr2 [, array ...])", + "Returns the entries of arr1 that have values which are not present in any of the others arguments." + ], + "array_diff_assoc": [ + "array array_diff_assoc(array arr1, array arr2 [, array ...])", + "Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal" + ], + "array_diff_key": [ + "array array_diff_key(array arr1, array arr2 [, array ...])", + "Returns the entries of arr1 that have keys which are not present in any of the others arguments. This function is like array_diff() but works on the keys instead of the values. The associativity is preserved." + ], + "array_diff_uassoc": [ + "array array_diff_uassoc(array arr1, array arr2 [, array ...], callback data_comp_func)", + "Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Elements are compared by user supplied function." + ], + "array_diff_ukey": [ + "array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)", + "Returns the entries of arr1 that have keys which are not present in any of the others arguments. User supplied function is used for comparing the keys. This function is like array_udiff() but works on the keys instead of the values. The associativity is preserved." + ], + "array_fill": [ + "array array_fill(int start_key, int num, mixed val)", + "Create an array containing num elements starting with index start_key each initialized to val" + ], + "array_fill_keys": [ + "array array_fill_keys(array keys, mixed val)", + "Create an array using the elements of the first parameter as keys each initialized to val" + ], + "array_filter": [ + "array array_filter(array input [, mixed callback])", + "Filters elements from the array via the callback." + ], + "array_flip": [ + "array array_flip(array input)", + "Return array with key <-> value flipped" + ], + "array_intersect": [ + "array array_intersect(array arr1, array arr2 [, array ...])", + "Returns the entries of arr1 that have values which are present in all the other arguments" + ], + "array_intersect_assoc": [ + "array array_intersect_assoc(array arr1, array arr2 [, array ...])", + "Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check" + ], + "array_intersect_key": [ + "array array_intersect_key(array arr1, array arr2 [, array ...])", + "Returns the entries of arr1 that have keys which are present in all the other arguments. Kind of equivalent to array_diff(array_keys($arr1), array_keys($arr2)[,array_keys(...)]). Equivalent of array_intersect_assoc() but does not do compare of the data." + ], + "array_intersect_uassoc": [ + "array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)", + "Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check and they are compared by using an user-supplied callback." + ], + "array_intersect_ukey": [ + "array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)", + "Returns the entries of arr1 that have keys which are present in all the other arguments. Kind of equivalent to array_diff(array_keys($arr1), array_keys($arr2)[,array_keys(...)]). The comparison of the keys is performed by a user supplied function. Equivalent of array_intersect_uassoc() but does not do compare of the data." + ], + "array_key_exists": [ + "bool array_key_exists(mixed key, array search)", + "Checks if the given key or index exists in the array" + ], + "array_keys": [ + "array array_keys(array input [, mixed search_value[, bool strict]])", + "Return just the keys from the input array, optionally only for the specified search_value" + ], + "array_map": [ + "array array_map(mixed callback, array input1 [, array input2 ,...])", + "Applies the callback to the elements in given arrays." + ], + "array_merge": [ + "array array_merge(array arr1, array arr2 [, array ...])", + "Merges elements from passed arrays into one array" + ], + "array_merge_recursive": [ + "array array_merge_recursive(array arr1, array arr2 [, array ...])", + "Recursively merges elements from passed arrays into one array" + ], + "array_multisort": [ + "bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]], ...])", + "Sort multiple arrays at once similar to how ORDER BY clause works in SQL" + ], + "array_pad": [ + "array array_pad(array input, int pad_size, mixed pad_value)", + "Returns a copy of input array padded with pad_value to size pad_size" + ], + "array_pop": [ + "mixed array_pop(array stack)", + "Pops an element off the end of the array" + ], + "array_product": [ + "mixed array_product(array input)", + "Returns the product of the array entries" + ], + "array_push": [ + "int array_push(array stack, mixed var [, mixed ...])", + "Pushes elements onto the end of the array" + ], + "array_rand": [ + "mixed array_rand(array input [, int num_req])", + "Return key/keys for random entry/entries in the array" + ], + "array_reduce": [ + "mixed array_reduce(array input, mixed callback [, mixed initial])", + "Iteratively reduce the array to a single value via the callback." + ], + "array_replace": [ + "array array_replace(array arr1, array arr2 [, array ...])", + "Replaces elements from passed arrays into one array" + ], + "array_replace_recursive": [ + "array array_replace_recursive(array arr1, array arr2 [, array ...])", + "Recursively replaces elements from passed arrays into one array" + ], + "array_reverse": [ + "array array_reverse(array input [, bool preserve keys])", + "Return input as a new array with the order of the entries reversed" + ], + "array_search": [ + "mixed array_search(mixed needle, array haystack [, bool strict])", + "Searches the array for a given value and returns the corresponding key if successful" + ], + "array_shift": [ + "mixed array_shift(array stack)", + "Pops an element off the beginning of the array" + ], + "array_slice": [ + "array array_slice(array input, int offset [, int length [, bool preserve_keys]])", + "Returns elements specified by offset and length" + ], + "array_splice": [ + "array array_splice(array input, int offset [, int length [, array replacement]])", + "Removes the elements designated by offset and length and replace them with supplied array" + ], + "array_sum": [ + "mixed array_sum(array input)", + "Returns the sum of the array entries" + ], + "array_udiff": [ + "array array_udiff(array arr1, array arr2 [, array ...], callback data_comp_func)", + "Returns the entries of arr1 that have values which are not present in any of the others arguments. Elements are compared by user supplied function." + ], + "array_udiff_assoc": [ + "array array_udiff_assoc(array arr1, array arr2 [, array ...], callback key_comp_func)", + "Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys are compared by user supplied function." + ], + "array_udiff_uassoc": [ + "array array_udiff_uassoc(array arr1, array arr2 [, array ...], callback data_comp_func, callback key_comp_func)", + "Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys and elements are compared by user supplied functions." + ], + "array_uintersect": [ + "array array_uintersect(array arr1, array arr2 [, array ...], callback data_compare_func)", + "Returns the entries of arr1 that have values which are present in all the other arguments. Data is compared by using an user-supplied callback." + ], + "array_uintersect_assoc": [ + "array array_uintersect_assoc(array arr1, array arr2 [, array ...], callback data_compare_func)", + "Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check. Data is compared by using an user-supplied callback." + ], + "array_uintersect_uassoc": [ + "array array_uintersect_uassoc(array arr1, array arr2 [, array ...], callback data_compare_func, callback key_compare_func)", + "Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check. Both data and keys are compared by using user-supplied callbacks." + ], + "array_unique": [ + "array array_unique(array input [, int sort_flags])", + "Removes duplicate values from array" + ], + "array_unshift": [ + "int array_unshift(array stack, mixed var [, mixed ...])", + "Pushes elements onto the beginning of the array" + ], + "array_values": [ + "array array_values(array input)", + "Return just the values from the input array" + ], + "array_walk": [ + "bool array_walk(array input, string funcname [, mixed userdata])", + "Apply a user function to every member of an array" + ], + "array_walk_recursive": [ + "bool array_walk_recursive(array input, string funcname [, mixed userdata])", + "Apply a user function recursively to every member of an array" + ], + "arsort": [ + "bool arsort(array &array_arg [, int sort_flags])", + "Sort an array in reverse order and maintain index association" + ], + "asin": [ + "float asin(float number)", + "Returns the arc sine of the number in radians" + ], + "asinh": [ + "float asinh(float number)", + "Returns the inverse hyperbolic sine of the number, i.e. the value whose hyperbolic sine is number" + ], + "asort": [ + "bool asort(array &array_arg [, int sort_flags])", + "Sort an array and maintain index association" + ], + "assert": [ + "int assert(string|bool assertion)", + "Checks if assertion is false" + ], + "assert_options": [ + "mixed assert_options(int what [, mixed value])", + "Set/get the various assert flags" + ], + "atan": [ + "float atan(float number)", + "Returns the arc tangent of the number in radians" + ], + "atan2": [ + "float atan2(float y, float x)", + "Returns the arc tangent of y/x, with the resulting quadrant determined by the signs of y and x" + ], + "atanh": [ + "float atanh(float number)", + "Returns the inverse hyperbolic tangent of the number, i.e. the value whose hyperbolic tangent is number" + ], + "attachIterator": [ + "void attachIterator(Iterator iterator[, mixed info])", + "Attach a new iterator" + ], + "base64_decode": [ + "string base64_decode(string str[, bool strict])", + "Decodes string using MIME base64 algorithm" + ], + "base64_encode": [ + "string base64_encode(string str)", + "Encodes string using MIME base64 algorithm" + ], + "base_convert": [ + "string base_convert(string number, int frombase, int tobase)", + "Converts a number in a string from any base <= 36 to any base <= 36" + ], + "basename": [ + "string basename(string path [, string suffix])", + "Returns the filename component of the path" + ], + "bcadd": [ + "string bcadd(string left_operand, string right_operand [, int scale])", + "Returns the sum of two arbitrary precision numbers" + ], + "bccomp": [ + "int bccomp(string left_operand, string right_operand [, int scale])", + "Compares two arbitrary precision numbers" + ], + "bcdiv": [ + "string bcdiv(string left_operand, string right_operand [, int scale])", + "Returns the quotient of two arbitrary precision numbers (division)" + ], + "bcmod": [ + "string bcmod(string left_operand, string right_operand)", + "Returns the modulus of the two arbitrary precision operands" + ], + "bcmul": [ + "string bcmul(string left_operand, string right_operand [, int scale])", + "Returns the multiplication of two arbitrary precision numbers" + ], + "bcpow": [ + "string bcpow(string x, string y [, int scale])", + "Returns the value of an arbitrary precision number raised to the power of another" + ], + "bcpowmod": [ + "string bcpowmod(string x, string y, string mod [, int scale])", + "Returns the value of an arbitrary precision number raised to the power of another reduced by a modulous" + ], + "bcscale": [ + "bool bcscale(int scale)", + "Sets default scale parameter for all bc math functions" + ], + "bcsqrt": [ + "string bcsqrt(string operand [, int scale])", + "Returns the square root of an arbitray precision number" + ], + "bcsub": [ + "string bcsub(string left_operand, string right_operand [, int scale])", + "Returns the difference between two arbitrary precision numbers" + ], + "bin2hex": [ + "string bin2hex(string data)", + "Converts the binary representation of data to hex" + ], + "bind_textdomain_codeset": [ + "string bind_textdomain_codeset (string domain, string codeset)", + "Specify the character encoding in which the messages from the DOMAIN message catalog will be returned." + ], + "bindec": [ + "int bindec(string binary_number)", + "Returns the decimal equivalent of the binary number" + ], + "bindtextdomain": [ + "string bindtextdomain(string domain_name, string dir)", + "Bind to the text domain domain_name, looking for translations in dir. Returns the current domain" + ], + "birdstep_autocommit": [ + "bool birdstep_autocommit(int index)", + "" + ], + "birdstep_close": [ + "bool birdstep_close(int id)", + "" + ], + "birdstep_commit": [ + "bool birdstep_commit(int index)", + "" + ], + "birdstep_connect": [ + "int birdstep_connect(string server, string user, string pass)", + "" + ], + "birdstep_exec": [ + "int birdstep_exec(int index, string exec_str)", + "" + ], + "birdstep_fetch": [ + "bool birdstep_fetch(int index)", + "" + ], + "birdstep_fieldname": [ + "string birdstep_fieldname(int index, int col)", + "" + ], + "birdstep_fieldnum": [ + "int birdstep_fieldnum(int index)", + "" + ], + "birdstep_freeresult": [ + "bool birdstep_freeresult(int index)", + "" + ], + "birdstep_off_autocommit": [ + "bool birdstep_off_autocommit(int index)", + "" + ], + "birdstep_result": [ + "mixed birdstep_result(int index, mixed col)", + "" + ], + "birdstep_rollback": [ + "bool birdstep_rollback(int index)", + "" + ], + "bzcompress": [ + "string bzcompress(string source [, int blocksize100k [, int workfactor]])", + "Compresses a string into BZip2 encoded data" + ], + "bzdecompress": [ + "string bzdecompress(string source [, int small])", + "Decompresses BZip2 compressed data" + ], + "bzerrno": [ + "int bzerrno(resource bz)", + "Returns the error number" + ], + "bzerror": [ + "array bzerror(resource bz)", + "Returns the error number and error string in an associative array" + ], + "bzerrstr": [ + "string bzerrstr(resource bz)", + "Returns the error string" + ], + "bzopen": [ + "resource bzopen(string|int file|fp, string mode)", + "Opens a new BZip2 stream" + ], + "bzread": [ + "string bzread(resource bz[, int length])", + "Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified" + ], + "cal_days_in_month": [ + "int cal_days_in_month(int calendar, int month, int year)", + "Returns the number of days in a month for a given year and calendar" + ], + "cal_from_jd": [ + "array cal_from_jd(int jd, int calendar)", + "Converts from Julian Day Count to a supported calendar and return extended information" + ], + "cal_info": [ + "array cal_info([int calendar])", + "Returns information about a particular calendar" + ], + "cal_to_jd": [ + "int cal_to_jd(int calendar, int month, int day, int year)", + "Converts from a supported calendar to Julian Day Count" + ], + "call_user_func": [ + "mixed call_user_func(mixed function_name [, mixed parmeter] [, mixed ...])", + "Call a user function which is the first parameter" + ], + "call_user_func_array": [ + "mixed call_user_func_array(string function_name, array parameters)", + "Call a user function which is the first parameter with the arguments contained in array" + ], + "call_user_method": [ + "mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])", + "Call a user method on a specific object or class" + ], + "call_user_method_array": [ + "mixed call_user_method_array(string method_name, mixed object, array params)", + "Call a user method on a specific object or class using a parameter array" + ], + "ceil": [ + "float ceil(float number)", + "Returns the next highest integer value of the number" + ], + "chdir": [ + "bool chdir(string directory)", + "Change the current directory" + ], + "checkdate": [ + "bool checkdate(int month, int day, int year)", + "Returns true(1) if it is a valid date in gregorian calendar" + ], + "chgrp": [ + "bool chgrp(string filename, mixed group)", + "Change file group" + ], + "chmod": [ + "bool chmod(string filename, int mode)", + "Change file mode" + ], + "chown": [ + "bool chown (string filename, mixed user)", + "Change file owner" + ], + "chr": [ + "string chr(int ascii)", + "Converts ASCII code to a character" + ], + "chroot": [ + "bool chroot(string directory)", + "Change root directory" + ], + "chunk_split": [ + "string chunk_split(string str [, int chunklen [, string ending]])", + "Returns split line" + ], + "class_alias": [ + "bool class_alias(string user_class_name , string alias_name [, bool autoload])", + "Creates an alias for user defined class" + ], + "class_exists": [ + "bool class_exists(string classname [, bool autoload])", + "Checks if the class exists" + ], + "class_implements": [ + "array class_implements(mixed what [, bool autoload ])", + "Return all classes and interfaces implemented by SPL" + ], + "class_parents": [ + "array class_parents(object instance [, boolean autoload = true])", + "Return an array containing the names of all parent classes" + ], + "clearstatcache": [ + "void clearstatcache([bool clear_realpath_cache[, string filename]])", + "Clear file stat cache" + ], + "closedir": [ + "void closedir([resource dir_handle])", + "Close directory connection identified by the dir_handle" + ], + "closelog": [ + "bool closelog(void)", + "Close connection to system logger" + ], + "collator_asort": [ + "bool collator_asort( Collator $coll, array(string) $arr )", + "* Sort array using specified collator, maintaining index association." + ], + "collator_compare": [ + "int collator_compare( Collator $coll, string $str1, string $str2 )", + "* Compare two strings." + ], + "collator_create": [ + "Collator collator_create( string $locale )", + "* Create collator." + ], + "collator_get_attribute": [ + "int collator_get_attribute( Collator $coll, int $attr )", + "* Get collation attribute value." + ], + "collator_get_error_code": [ + "int collator_get_error_code( Collator $coll )", + "* Get collator's last error code." + ], + "collator_get_error_message": [ + "string collator_get_error_message( Collator $coll )", + "* Get text description for collator's last error code." + ], + "collator_get_locale": [ + "string collator_get_locale( Collator $coll, int $type )", + "* Gets the locale name of the collator." + ], + "collator_get_sort_key": [ + "bool collator_get_sort_key( Collator $coll, string $str )", + "* Get a sort key for a string from a Collator. }}}" + ], + "collator_get_strength": [ + "int collator_get_strength(Collator coll)", + "* Returns the current collation strength." + ], + "collator_set_attribute": [ + "bool collator_set_attribute( Collator $coll, int $attr, int $val )", + "* Set collation attribute." + ], + "collator_set_strength": [ + "bool collator_set_strength(Collator coll, int strength)", + "* Set the collation strength." + ], + "collator_sort": [ + "bool collator_sort( Collator $coll, array(string) $arr [, int $sort_flags] )", + "* Sort array using specified collator." + ], + "collator_sort_with_sort_keys": [ + "bool collator_sort_with_sort_keys( Collator $coll, array(string) $arr )", + "* Equivalent to standard PHP sort using Collator. * Uses ICU ucol_getSortKey for performance." + ], + "com_create_guid": [ + "string com_create_guid()", + "Generate a globally unique identifier (GUID)" + ], + "com_event_sink": [ + "bool com_event_sink(object comobject, object sinkobject [, mixed sinkinterface])", + "Connect events from a COM object to a PHP object" + ], + "com_get_active_object": [ + "object com_get_active_object(string progid [, int code_page ])", + "Returns a handle to an already running instance of a COM object" + ], + "com_load_typelib": [ + "bool com_load_typelib(string typelib_name [, int case_insensitive])", + "Loads a Typelibrary and registers its constants" + ], + "com_message_pump": [ + "bool com_message_pump([int timeoutms])", + "Process COM messages, sleeping for up to timeoutms milliseconds" + ], + "com_print_typeinfo": [ + "bool com_print_typeinfo(object comobject | string typelib, string dispinterface, bool wantsink)", + "Print out a PHP class definition for a dispatchable interface" + ], + "compact": [ + "array compact(mixed var_names [, mixed ...])", + "Creates a hash containing variables and their values" + ], + "compose_locale": [ + "static string compose_locale($array)", + "* Creates a locale by combining the parts of locale-ID passed * }}}" + ], + "confirm_extname_compiled": [ + "string confirm_extname_compiled(string arg)", + "Return a string to confirm that the module is compiled in" + ], + "connection_aborted": [ + "int connection_aborted(void)", + "Returns true if client disconnected" + ], + "connection_status": [ + "int connection_status(void)", + "Returns the connection status bitfield" + ], + "constant": [ + "mixed constant(string const_name)", + "Given the name of a constant this function will return the constant's associated value" + ], + "convert_cyr_string": [ + "string convert_cyr_string(string str, string from, string to)", + "Convert from one Cyrillic character set to another" + ], + "convert_uudecode": [ + "string convert_uudecode(string data)", + "decode a uuencoded string" + ], + "convert_uuencode": [ + "string convert_uuencode(string data)", + "uuencode a string" + ], + "copy": [ + "bool copy(string source_file, string destination_file [, resource context])", + "Copy a file" + ], + "cos": [ + "float cos(float number)", + "Returns the cosine of the number in radians" + ], + "cosh": [ + "float cosh(float number)", + "Returns the hyperbolic cosine of the number, defined as (exp(number) + exp(-number))/2" + ], + "count": [ + "int count(mixed var [, int mode])", + "Count the number of elements in a variable (usually an array)" + ], + "count_chars": [ + "mixed count_chars(string input [, int mode])", + "Returns info about what characters are used in input" + ], + "crc32": [ + "string crc32(string str)", + "Calculate the crc32 polynomial of a string" + ], + "create_function": [ + "string create_function(string args, string code)", + "Creates an anonymous function, and returns its name (funny, eh?)" + ], + "crypt": [ + "string crypt(string str [, string salt])", + "Hash a string" + ], + "ctype_alnum": [ + "bool ctype_alnum(mixed c)", + "Checks for alphanumeric character(s)" + ], + "ctype_alpha": [ + "bool ctype_alpha(mixed c)", + "Checks for alphabetic character(s)" + ], + "ctype_cntrl": [ + "bool ctype_cntrl(mixed c)", + "Checks for control character(s)" + ], + "ctype_digit": [ + "bool ctype_digit(mixed c)", + "Checks for numeric character(s)" + ], + "ctype_graph": [ + "bool ctype_graph(mixed c)", + "Checks for any printable character(s) except space" + ], + "ctype_lower": [ + "bool ctype_lower(mixed c)", + "Checks for lowercase character(s)" + ], + "ctype_print": [ + "bool ctype_print(mixed c)", + "Checks for printable character(s)" + ], + "ctype_punct": [ + "bool ctype_punct(mixed c)", + "Checks for any printable character which is not whitespace or an alphanumeric character" + ], + "ctype_space": [ + "bool ctype_space(mixed c)", + "Checks for whitespace character(s)" + ], + "ctype_upper": [ + "bool ctype_upper(mixed c)", + "Checks for uppercase character(s)" + ], + "ctype_xdigit": [ + "bool ctype_xdigit(mixed c)", + "Checks for character(s) representing a hexadecimal digit" + ], + "curl_close": [ + "void curl_close(resource ch)", + "Close a cURL session" + ], + "curl_copy_handle": [ + "resource curl_copy_handle(resource ch)", + "Copy a cURL handle along with all of it's preferences" + ], + "curl_errno": [ + "int curl_errno(resource ch)", + "Return an integer containing the last error number" + ], + "curl_error": [ + "string curl_error(resource ch)", + "Return a string contain the last error for the current session" + ], + "curl_exec": [ + "bool curl_exec(resource ch)", + "Perform a cURL session" + ], + "curl_getinfo": [ + "mixed curl_getinfo(resource ch [, int option])", + "Get information regarding a specific transfer" + ], + "curl_init": [ + "resource curl_init([string url])", + "Initialize a cURL session" + ], + "curl_multi_add_handle": [ + "int curl_multi_add_handle(resource mh, resource ch)", + "Add a normal cURL handle to a cURL multi handle" + ], + "curl_multi_close": [ + "void curl_multi_close(resource mh)", + "Close a set of cURL handles" + ], + "curl_multi_exec": [ + "int curl_multi_exec(resource mh, int &still_running)", + "Run the sub-connections of the current cURL handle" + ], + "curl_multi_getcontent": [ + "string curl_multi_getcontent(resource ch)", + "Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set" + ], + "curl_multi_info_read": [ + "array curl_multi_info_read(resource mh [, long msgs_in_queue])", + "Get information about the current transfers" + ], + "curl_multi_init": [ + "resource curl_multi_init(void)", + "Returns a new cURL multi handle" + ], + "curl_multi_remove_handle": [ + "int curl_multi_remove_handle(resource mh, resource ch)", + "Remove a multi handle from a set of cURL handles" + ], + "curl_multi_select": [ + "int curl_multi_select(resource mh[, double timeout])", + "Get all the sockets associated with the cURL extension, which can then be \"selected\"" + ], + "curl_setopt": [ + "bool curl_setopt(resource ch, int option, mixed value)", + "Set an option for a cURL transfer" + ], + "curl_setopt_array": [ + "bool curl_setopt_array(resource ch, array options)", + "Set an array of option for a cURL transfer" + ], + "curl_version": [ + "array curl_version([int version])", + "Return cURL version information." + ], + "current": [ + "mixed current(array array_arg)", + "Return the element currently pointed to by the internal array pointer" + ], + "date": [ + "string date(string format [, long timestamp])", + "Format a local date/time" + ], + "date_add": [ + "DateTime date_add(DateTime object, DateInterval interval)", + "Adds an interval to the current date in object." + ], + "date_create": [ + "DateTime date_create([string time[, DateTimeZone object]])", + "Returns new DateTime object" + ], + "date_create_from_format": [ + "DateTime date_create_from_format(string format, string time[, DateTimeZone object])", + "Returns new DateTime object formatted according to the specified format" + ], + "date_date_set": [ + "DateTime date_date_set(DateTime object, long year, long month, long day)", + "Sets the date." + ], + "date_default_timezone_get": [ + "string date_default_timezone_get()", + "Gets the default timezone used by all date/time functions in a script" + ], + "date_default_timezone_set": [ + "bool date_default_timezone_set(string timezone_identifier)", + "Sets the default timezone used by all date/time functions in a script" + ], + "date_diff": [ + "DateInterval date_diff(DateTime object [, bool absolute])", + "Returns the difference between two DateTime objects." + ], + "date_format": [ + "string date_format(DateTime object, string format)", + "Returns date formatted according to given format" + ], + "date_get_last_errors": [ + "array date_get_last_errors()", + "Returns the warnings and errors found while parsing a date/time string." + ], + "date_interval_create_from_date_string": [ + "DateInterval date_interval_create_from_date_string(string time)", + "Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed string" + ], + "date_interval_format": [ + "string date_interval_format(DateInterval object, string format)", + "Formats the interval." + ], + "date_isodate_set": [ + "DateTime date_isodate_set(DateTime object, long year, long week[, long day])", + "Sets the ISO date." + ], + "date_modify": [ + "DateTime date_modify(DateTime object, string modify)", + "Alters the timestamp." + ], + "date_offset_get": [ + "long date_offset_get(DateTime object)", + "Returns the DST offset." + ], + "date_parse": [ + "array date_parse(string date)", + "Returns associative array with detailed info about given date" + ], + "date_parse_from_format": [ + "array date_parse_from_format(string format, string date)", + "Returns associative array with detailed info about given date" + ], + "date_sub": [ + "DateTime date_sub(DateTime object, DateInterval interval)", + "Subtracts an interval to the current date in object." + ], + "date_sun_info": [ + "array date_sun_info(long time, float latitude, float longitude)", + "Returns an array with information about sun set/rise and twilight begin/end" + ], + "date_sunrise": [ + "mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])", + "Returns time of sunrise for a given day and location" + ], + "date_sunset": [ + "mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])", + "Returns time of sunset for a given day and location" + ], + "date_time_set": [ + "DateTime date_time_set(DateTime object, long hour, long minute[, long second])", + "Sets the time." + ], + "date_timestamp_get": [ + "long date_timestamp_get(DateTime object)", + "Gets the Unix timestamp." + ], + "date_timestamp_set": [ + "DateTime date_timestamp_set(DateTime object, long unixTimestamp)", + "Sets the date and time based on an Unix timestamp." + ], + "date_timezone_get": [ + "DateTimeZone date_timezone_get(DateTime object)", + "Return new DateTimeZone object relative to give DateTime" + ], + "date_timezone_set": [ + "DateTime date_timezone_set(DateTime object, DateTimeZone object)", + "Sets the timezone for the DateTime object." + ], + "datefmt_create": [ + "IntlDateFormatter datefmt_create(string $locale, long date_type, long time_type[, string $timezone_str, long $calendar, string $pattern] )", + "* Create formatter." + ], + "datefmt_format": [ + "string datefmt_format( [mixed]int $args or array $args )", + "* Format the time value as a string. }}}" + ], + "datefmt_get_calendar": [ + "string datefmt_get_calendar( IntlDateFormatter $mf )", + "* Get formatter calendar." + ], + "datefmt_get_datetype": [ + "string datefmt_get_datetype( IntlDateFormatter $mf )", + "* Get formatter datetype." + ], + "datefmt_get_error_code": [ + "int datefmt_get_error_code( IntlDateFormatter $nf )", + "* Get formatter's last error code." + ], + "datefmt_get_error_message": [ + "string datefmt_get_error_message( IntlDateFormatter $coll )", + "* Get text description for formatter's last error code." + ], + "datefmt_get_locale": [ + "string datefmt_get_locale(IntlDateFormatter $mf)", + "* Get formatter locale." + ], + "datefmt_get_pattern": [ + "string datefmt_get_pattern( IntlDateFormatter $mf )", + "* Get formatter pattern." + ], + "datefmt_get_timetype": [ + "string datefmt_get_timetype( IntlDateFormatter $mf )", + "* Get formatter timetype." + ], + "datefmt_get_timezone_id": [ + "string datefmt_get_timezone_id( IntlDateFormatter $mf )", + "* Get formatter timezone_id." + ], + "datefmt_isLenient": [ + "string datefmt_isLenient(IntlDateFormatter $mf)", + "* Get formatter locale." + ], + "datefmt_localtime": [ + "integer datefmt_localtime( IntlDateFormatter $fmt, string $text_to_parse[, int $parse_pos ])", + "* Parse the string $value to a localtime array }}}" + ], + "datefmt_parse": [ + "integer datefmt_parse( IntlDateFormatter $fmt, string $text_to_parse [, int $parse_pos] )", + "* Parse the string $value starting at parse_pos to a Unix timestamp -int }}}" + ], + "datefmt_setLenient": [ + "string datefmt_setLenient(IntlDateFormatter $mf)", + "* Set formatter lenient." + ], + "datefmt_set_calendar": [ + "bool datefmt_set_calendar( IntlDateFormatter $mf, int $calendar )", + "* Set formatter calendar." + ], + "datefmt_set_pattern": [ + "bool datefmt_set_pattern( IntlDateFormatter $mf, string $pattern )", + "* Set formatter pattern." + ], + "datefmt_set_timezone_id": [ + "boolean datefmt_set_timezone_id( IntlDateFormatter $mf,$timezone_id)", + "* Set formatter timezone_id." + ], + "dba_close": [ + "void dba_close(resource handle)", + "Closes database" + ], + "dba_delete": [ + "bool dba_delete(string key, resource handle)", + "Deletes the entry associated with key If inifile: remove all other key lines" + ], + "dba_exists": [ + "bool dba_exists(string key, resource handle)", + "Checks, if the specified key exists" + ], + "dba_fetch": [ + "string dba_fetch(string key, [int skip ,] resource handle)", + "Fetches the data associated with key" + ], + "dba_firstkey": [ + "string dba_firstkey(resource handle)", + "Resets the internal key pointer and returns the first key" + ], + "dba_handlers": [ + "array dba_handlers([bool full_info])", + "List configured database handlers" + ], + "dba_insert": [ + "bool dba_insert(string key, string value, resource handle)", + "If not inifile: Insert value as key, return false, if key exists already If inifile: Add vakue as key (next instance of key)" + ], + "dba_key_split": [ + "array|false dba_key_split(string key)", + "Splits an inifile key into an array of the form array(0=>group,1=>value_name) but returns false if input is false or null" + ], + "dba_list": [ + "array dba_list()", + "List opened databases" + ], + "dba_nextkey": [ + "string dba_nextkey(resource handle)", + "Returns the next key" + ], + "dba_open": [ + "resource dba_open(string path, string mode [, string handlername, string ...])", + "Opens path using the specified handler in mode" + ], + "dba_optimize": [ + "bool dba_optimize(resource handle)", + "Optimizes (e.g. clean up, vacuum) database" + ], + "dba_popen": [ + "resource dba_popen(string path, string mode [, string handlername, string ...])", + "Opens path using the specified handler in mode persistently" + ], + "dba_replace": [ + "bool dba_replace(string key, string value, resource handle)", + "Inserts value as key, replaces key, if key exists already If inifile: remove all other key lines" + ], + "dba_sync": [ + "bool dba_sync(resource handle)", + "Synchronizes database" + ], + "dcgettext": [ + "string dcgettext(string domain_name, string msgid, long category)", + "Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist" + ], + "dcngettext": [ + "string dcngettext (string domain, string msgid1, string msgid2, int n, int category)", + "Plural version of dcgettext()" + ], + "debug_backtrace": [ + "array debug_backtrace([bool provide_object])", + "Return backtrace as array" + ], + "debug_print_backtrace": [ + "void debug_print_backtrace(void) */", + "ZEND_FUNCTION(debug_print_backtrace) { zend_execute_data *ptr, *skip; int lineno; char *function_name; char *filename; char *class_name = NULL; char *call_type; char *include_filename = NULL; zval *arg_array = NULL; int indent = 0; if (zend_parse_parameters_none() == FAILURE) { return; } ptr = EG(current_execute_data);", + "PHP_FUNCTION(dom_document_relaxNG_validate_file) { _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); } /* }}} end dom_document_relaxNG_validate_file" + ], + "dom_document_relaxNG_validate_xml": [ + "boolean dom_document_relaxNG_validate_xml(string source); */", + "PHP_FUNCTION(dom_document_relaxNG_validate_xml) { _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); } /* }}} end dom_document_relaxNG_validate_xml" + ], + "dom_document_rename_node": [ + "DOMNode dom_document_rename_node(node n, string namespaceURI, string qualifiedName);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-renameNode Since: DOM Level 3" + ], + "dom_document_save": [ + "int dom_document_save(string file);", + "Convenience method to save to file" + ], + "dom_document_save_html": [ + "string dom_document_save_html();", + "Convenience method to output as html" + ], + "dom_document_save_html_file": [ + "int dom_document_save_html_file(string file);", + "Convenience method to save to file as html" + ], + "dom_document_savexml": [ + "string dom_document_savexml([node n]);", + "URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-saveXML Since: DOM Level 3" + ], + "dom_document_schema_validate": [ + "boolean dom_document_schema_validate(string source); */", + "PHP_FUNCTION(dom_document_schema_validate_xml) { _dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); } /* }}} end dom_document_schema_validate" + ], + "dom_document_schema_validate_file": [ + "boolean dom_document_schema_validate_file(string filename); */", + "PHP_FUNCTION(dom_document_schema_validate_file) { _dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); } /* }}} end dom_document_schema_validate_file" + ], + "dom_document_validate": [ + "boolean dom_document_validate();", + "Since: DOM extended" + ], + "dom_document_xinclude": [ + "int dom_document_xinclude([int options])", + "Substitutues xincludes in a DomDocument" + ], + "dom_domconfiguration_can_set_parameter": [ + "boolean dom_domconfiguration_can_set_parameter(string name, domuserdata value);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-canSetParameter Since:" + ], + "dom_domconfiguration_get_parameter": [ + "domdomuserdata dom_domconfiguration_get_parameter(string name);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-getParameter Since:" + ], + "dom_domconfiguration_set_parameter": [ + "dom_void dom_domconfiguration_set_parameter(string name, domuserdata value);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-property Since:" + ], + "dom_domerrorhandler_handle_error": [ + "dom_boolean dom_domerrorhandler_handle_error(domerror error);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-ERRORS-DOMErrorHandler-handleError Since:" + ], + "dom_domimplementation_create_document": [ + "DOMDocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, DOMDocumentType doctype);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocument Since: DOM Level 2" + ], + "dom_domimplementation_create_document_type": [ + "DOMDocumentType dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocType Since: DOM Level 2" + ], + "dom_domimplementation_get_feature": [ + "DOMNode dom_domimplementation_get_feature(string feature, string version);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementation3-getFeature Since: DOM Level 3" + ], + "dom_domimplementation_has_feature": [ + "boolean dom_domimplementation_has_feature(string feature, string version);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5CED94D7 Since:" + ], + "dom_domimplementationlist_item": [ + "domdomimplementation dom_domimplementationlist_item(int index);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-item Since:" + ], + "dom_domimplementationsource_get_domimplementation": [ + "domdomimplementation dom_domimplementationsource_get_domimplementation(string features);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpl Since:" + ], + "dom_domimplementationsource_get_domimplementations": [ + "domimplementationlist dom_domimplementationsource_get_domimplementations(string features);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpls Since:" + ], + "dom_domstringlist_item": [ + "domstring dom_domstringlist_item(int index);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-item Since:" + ], + "dom_element_get_attribute": [ + "string dom_element_get_attribute(string name);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-666EE0F9 Since:" + ], + "dom_element_get_attribute_node": [ + "DOMAttr dom_element_get_attribute_node(string name);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-217A91B8 Since:" + ], + "dom_element_get_attribute_node_ns": [ + "DOMAttr dom_element_get_attribute_node_ns(string namespaceURI, string localName);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAtNodeNS Since: DOM Level 2" + ], + "dom_element_get_attribute_ns": [ + "string dom_element_get_attribute_ns(string namespaceURI, string localName);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAttrNS Since: DOM Level 2" + ], + "dom_element_get_elements_by_tag_name": [ + "DOMNodeList dom_element_get_elements_by_tag_name(string name);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1938918D Since:" + ], + "dom_element_get_elements_by_tag_name_ns": [ + "DOMNodeList dom_element_get_elements_by_tag_name_ns(string namespaceURI, string localName);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C90942 Since: DOM Level 2" + ], + "dom_element_has_attribute": [ + "boolean dom_element_has_attribute(string name);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElHasAttr Since: DOM Level 2" + ], + "dom_element_has_attribute_ns": [ + "boolean dom_element_has_attribute_ns(string namespaceURI, string localName);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElHasAttrNS Since: DOM Level 2" + ], + "dom_element_remove_attribute": [ + "void dom_element_remove_attribute(string name);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D6AC0F9 Since:" + ], + "dom_element_remove_attribute_node": [ + "DOMAttr dom_element_remove_attribute_node(DOMAttr oldAttr);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D589198 Since:" + ], + "dom_element_remove_attribute_ns": [ + "void dom_element_remove_attribute_ns(string namespaceURI, string localName);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElRemAtNS Since: DOM Level 2" + ], + "dom_element_set_attribute": [ + "void dom_element_set_attribute(string name, string value);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68F082 Since:" + ], + "dom_element_set_attribute_node": [ + "DOMAttr dom_element_set_attribute_node(DOMAttr newAttr);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-887236154 Since:" + ], + "dom_element_set_attribute_node_ns": [ + "DOMAttr dom_element_set_attribute_node_ns(DOMAttr newAttr);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAtNodeNS Since: DOM Level 2" + ], + "dom_element_set_attribute_ns": [ + "void dom_element_set_attribute_ns(string namespaceURI, string qualifiedName, string value);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAttrNS Since: DOM Level 2" + ], + "dom_element_set_id_attribute": [ + "void dom_element_set_id_attribute(string name, boolean isId);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttr Since: DOM Level 3" + ], + "dom_element_set_id_attribute_node": [ + "void dom_element_set_id_attribute_node(attr idAttr, boolean isId);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNode Since: DOM Level 3" + ], + "dom_element_set_id_attribute_ns": [ + "void dom_element_set_id_attribute_ns(string namespaceURI, string localName, boolean isId);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNS Since: DOM Level 3" + ], + "dom_import_simplexml": [ + "somNode dom_import_simplexml(sxeobject node)", + "Get a simplexml_element object from dom to allow for processing" + ], + "dom_namednodemap_get_named_item": [ + "DOMNode dom_namednodemap_get_named_item(string name);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1074577549 Since:" + ], + "dom_namednodemap_get_named_item_ns": [ + "DOMNode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getNamedItemNS Since: DOM Level 2" + ], + "dom_namednodemap_item": [ + "DOMNode dom_namednodemap_item(int index);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-349467F9 Since:" + ], + "dom_namednodemap_remove_named_item": [ + "DOMNode dom_namednodemap_remove_named_item(string name);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D58B193 Since:" + ], + "dom_namednodemap_remove_named_item_ns": [ + "DOMNode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-removeNamedItemNS Since: DOM Level 2" + ], + "dom_namednodemap_set_named_item": [ + "DOMNode dom_namednodemap_set_named_item(DOMNode arg);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1025163788 Since:" + ], + "dom_namednodemap_set_named_item_ns": [ + "DOMNode dom_namednodemap_set_named_item_ns(DOMNode arg);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-setNamedItemNS Since: DOM Level 2" + ], + "dom_namelist_get_name": [ + "string dom_namelist_get_name(int index);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getName Since:" + ], + "dom_namelist_get_namespace_uri": [ + "string dom_namelist_get_namespace_uri(int index);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getNamespaceURI Since:" + ], + "dom_node_append_child": [ + "DomNode dom_node_append_child(DomNode newChild);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-184E7107 Since:" + ], + "dom_node_clone_node": [ + "DomNode dom_node_clone_node(boolean deep);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3A0ED0A4 Since:" + ], + "dom_node_compare_document_position": [ + "short dom_node_compare_document_position(DomNode other);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-compareDocumentPosition Since: DOM Level 3" + ], + "dom_node_get_feature": [ + "DomNode dom_node_get_feature(string feature, string version);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getFeature Since: DOM Level 3" + ], + "dom_node_get_user_data": [ + "mixed dom_node_get_user_data(string key);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getUserData Since: DOM Level 3" + ], + "dom_node_has_attributes": [ + "boolean dom_node_has_attributes();", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeHasAttrs Since: DOM Level 2" + ], + "dom_node_has_child_nodes": [ + "boolean dom_node_has_child_nodes();", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-810594187 Since:" + ], + "dom_node_insert_before": [ + "domnode dom_node_insert_before(DomNode newChild, DomNode refChild);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-952280727 Since:" + ], + "dom_node_is_default_namespace": [ + "boolean dom_node_is_default_namespace(string namespaceURI);", + "URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isDefaultNamespace Since: DOM Level 3" + ], + "dom_node_is_equal_node": [ + "boolean dom_node_is_equal_node(DomNode arg);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isEqualNode Since: DOM Level 3" + ], + "dom_node_is_same_node": [ + "boolean dom_node_is_same_node(DomNode other);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isSameNode Since: DOM Level 3" + ], + "dom_node_is_supported": [ + "boolean dom_node_is_supported(string feature, string version);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Level-2-Core-Node-supports Since: DOM Level 2" + ], + "dom_node_lookup_namespace_uri": [ + "string dom_node_lookup_namespace_uri(string prefix);", + "URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI Since: DOM Level 3" + ], + "dom_node_lookup_prefix": [ + "string dom_node_lookup_prefix(string namespaceURI);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-lookupNamespacePrefix Since: DOM Level 3" + ], + "dom_node_normalize": [ + "void dom_node_normalize();", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-normalize Since:" + ], + "dom_node_remove_child": [ + "DomNode dom_node_remove_child(DomNode oldChild);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1734834066 Since:" + ], + "dom_node_replace_child": [ + "DomNode dom_node_replace_child(DomNode newChild, DomNode oldChild);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-785887307 Since:" + ], + "dom_node_set_user_data": [ + "mixed dom_node_set_user_data(string key, mixed data, userdatahandler handler);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-setUserData Since: DOM Level 3" + ], + "dom_nodelist_item": [ + "DOMNode dom_nodelist_item(int index);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-844377136 Since:" + ], + "dom_string_extend_find_offset16": [ + "int dom_string_extend_find_offset16(int offset32);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset16 Since:" + ], + "dom_string_extend_find_offset32": [ + "int dom_string_extend_find_offset32(int offset16);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset32 Since:" + ], + "dom_text_is_whitespace_in_element_content": [ + "boolean dom_text_is_whitespace_in_element_content();", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-isWhitespaceInElementContent Since: DOM Level 3" + ], + "dom_text_replace_whole_text": [ + "DOMText dom_text_replace_whole_text(string content);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-replaceWholeText Since: DOM Level 3" + ], + "dom_text_split_text": [ + "DOMText dom_text_split_text(int offset);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-38853C1D Since:" + ], + "dom_userdatahandler_handle": [ + "dom_void dom_userdatahandler_handle(short operation, string key, domobject data, node src, node dst);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-handleUserDataEvent Since:" + ], + "dom_xpath_evaluate": [ + "mixed dom_xpath_evaluate(string expr [,DOMNode context]); */", + "PHP_FUNCTION(dom_xpath_evaluate) { php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_EVALUATE); } /* }}} end dom_xpath_evaluate" + ], + "dom_xpath_query": [ + "DOMNodeList dom_xpath_query(string expr [,DOMNode context]); */", + "PHP_FUNCTION(dom_xpath_query) { php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_QUERY); } /* }}} end dom_xpath_query" + ], + "dom_xpath_register_ns": [ + "boolean dom_xpath_register_ns(string prefix, string uri); */", + "PHP_FUNCTION(dom_xpath_register_ns) { zval *id; xmlXPathContextPtr ctxp; int prefix_len, ns_uri_len; dom_xpath_object *intern; unsigned char *prefix, *ns_uri; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), \"Oss\", &id, dom_xpath_class_entry, &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) { return; } intern = (dom_xpath_object *)zend_object_store_get_object(id TSRMLS_CC); ctxp = (xmlXPathContextPtr) intern->ptr; if (ctxp == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, \"Invalid XPath Context\"); RETURN_FALSE; } if (xmlXPathRegisterNs(ctxp, prefix, ns_uri) != 0) { RETURN_FALSE } RETURN_TRUE; } /* }}}" + ], + "dom_xpath_register_php_functions": [ + "void dom_xpath_register_php_functions() */", + "PHP_FUNCTION(dom_xpath_register_php_functions) { zval *id; dom_xpath_object *intern; zval *array_value, **entry, *new_string; int name_len = 0; char *name; DOM_GET_THIS(id); if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, \"a\", &array_value) == SUCCESS) { intern = (dom_xpath_object *)zend_object_store_get_object(id TSRMLS_CC); zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value)); while (zend_hash_get_current_data(Z_ARRVAL_P(array_value), (void **)&entry) == SUCCESS) { SEPARATE_ZVAL(entry); convert_to_string_ex(entry); MAKE_STD_ZVAL(new_string); ZVAL_LONG(new_string,1); zend_hash_update(intern->registered_phpfunctions, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &new_string, sizeof(zval*), NULL); zend_hash_move_forward(Z_ARRVAL_P(array_value)); } intern->registerPhpFunctions = 2; RETURN_TRUE; } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, \"s\", &name, &name_len) == SUCCESS) { intern = (dom_xpath_object *)zend_object_store_get_object(id TSRMLS_CC); MAKE_STD_ZVAL(new_string); ZVAL_LONG(new_string,1); zend_hash_update(intern->registered_phpfunctions, name, name_len + 1, &new_string, sizeof(zval*), NULL); intern->registerPhpFunctions = 2; } else { intern = (dom_xpath_object *)zend_object_store_get_object(id TSRMLS_CC); intern->registerPhpFunctions = 1; } } /* }}} end dom_xpath_register_php_functions" + ], + "each": [ + "array each(array arr)", + "Return the currently pointed key..value pair in the passed array, and advance the pointer to the next element" + ], + "easter_date": [ + "int easter_date([int year])", + "Return the timestamp of midnight on Easter of a given year (defaults to current year)" + ], + "easter_days": [ + "int easter_days([int year, [int method]])", + "Return the number of days after March 21 that Easter falls on for a given year (defaults to current year)" + ], + "echo": [ + "void echo(string arg1 [, string ...])", + "Output one or more strings" + ], + "empty": [ + "bool empty( mixed var )", + "Determine whether a variable is empty" + ], + "enchant_broker_describe": [ + "array enchant_broker_describe(resource broker)", + "Enumerates the Enchant providers and tells you some rudimentary information about them. The same info is provided through phpinfo()" + ], + "enchant_broker_dict_exists": [ + "bool enchant_broker_dict_exists(resource broker, string tag)", + "Wether a dictionary exists or not. Using non-empty tag" + ], + "enchant_broker_free": [ + "boolean enchant_broker_free(resource broker)", + "Destroys the broker object and its dictionnaries" + ], + "enchant_broker_free_dict": [ + "resource enchant_broker_free_dict(resource dict)", + "Free the dictionary resource" + ], + "enchant_broker_get_dict_path": [ + "string enchant_broker_get_dict_path(resource broker, int dict_type)", + "Get the directory path for a given backend, works with ispell and myspell" + ], + "enchant_broker_get_error": [ + "string enchant_broker_get_error(resource broker)", + "Returns the last error of the broker" + ], + "enchant_broker_init": [ + "resource enchant_broker_init()", + "create a new broker object capable of requesting" + ], + "enchant_broker_list_dicts": [ + "string enchant_broker_list_dicts(resource broker)", + "Lists the dictionaries available for the given broker" + ], + "enchant_broker_request_dict": [ + "resource enchant_broker_request_dict(resource broker, string tag)", + "create a new dictionary using tag, the non-empty language tag you wish to request a dictionary for (\"en_US\", \"de_DE\", ...)" + ], + "enchant_broker_request_pwl_dict": [ + "resource enchant_broker_request_pwl_dict(resource broker, string filename)", + "creates a dictionary using a PWL file. A PWL file is personal word file one word per line. It must exist before the call." + ], + "enchant_broker_set_dict_path": [ + "bool enchant_broker_set_dict_path(resource broker, int dict_type, string value)", + "Set the directory path for a given backend, works with ispell and myspell" + ], + "enchant_broker_set_ordering": [ + "bool enchant_broker_set_ordering(resource broker, string tag, string ordering)", + "Declares a preference of dictionaries to use for the language described/referred to by 'tag'. The ordering is a comma delimited list of provider names. As a special exception, the \"*\" tag can be used as a language tag to declare a default ordering for any language that does not explictly declare an ordering." + ], + "enchant_dict_add_to_personal": [ + "void enchant_dict_add_to_personal(resource dict, string word)", + "add 'word' to personal word list" + ], + "enchant_dict_add_to_session": [ + "void enchant_dict_add_to_session(resource dict, string word)", + "add 'word' to this spell-checking session" + ], + "enchant_dict_check": [ + "bool enchant_dict_check(resource dict, string word)", + "If the word is correctly spelled return true, otherwise return false" + ], + "enchant_dict_describe": [ + "array enchant_dict_describe(resource dict)", + "Describes an individual dictionary 'dict'" + ], + "enchant_dict_get_error": [ + "string enchant_dict_get_error(resource dict)", + "Returns the last error of the current spelling-session" + ], + "enchant_dict_is_in_session": [ + "bool enchant_dict_is_in_session(resource dict, string word)", + "whether or not 'word' exists in this spelling-session" + ], + "enchant_dict_quick_check": [ + "bool enchant_dict_quick_check(resource dict, string word [, array &suggestions])", + "If the word is correctly spelled return true, otherwise return false, if suggestions variable is provided, fill it with spelling alternatives." + ], + "enchant_dict_store_replacement": [ + "void enchant_dict_store_replacement(resource dict, string mis, string cor)", + "add a correction for 'mis' using 'cor'. Notes that you replaced @mis with @cor, so it's possibly more likely that future occurrences of @mis will be replaced with @cor. So it might bump @cor up in the suggestion list." + ], + "enchant_dict_suggest": [ + "array enchant_dict_suggest(resource dict, string word)", + "Will return a list of values if any of those pre-conditions are not met." + ], + "end": [ + "mixed end(array array_arg)", + "Advances array argument's internal pointer to the last element and return it" + ], + "ereg": [ + "int ereg(string pattern, string string [, array registers])", + "Regular expression match" + ], + "ereg_replace": [ + "string ereg_replace(string pattern, string replacement, string string)", + "Replace regular expression" + ], + "eregi": [ + "int eregi(string pattern, string string [, array registers])", + "Case-insensitive regular expression match" + ], + "eregi_replace": [ + "string eregi_replace(string pattern, string replacement, string string)", + "Case insensitive replace regular expression" + ], + "error_get_last": [ + "array error_get_last()", + "Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet." + ], + "error_log": [ + "bool error_log(string message [, int message_type [, string destination [, string extra_headers]]])", + "Send an error message somewhere" + ], + "error_reporting": [ + "int error_reporting([int new_error_level])", + "Return the current error_reporting level, and if an argument was passed - change to the new level" + ], + "escapeshellarg": [ + "string escapeshellarg(string arg)", + "Quote and escape an argument for use in a shell command" + ], + "escapeshellcmd": [ + "string escapeshellcmd(string command)", + "Escape shell metacharacters" + ], + "exec": [ + "string exec(string command [, array &output [, int &return_value]])", + "Execute an external program" + ], + "exif_imagetype": [ + "int exif_imagetype(string imagefile)", + "Get the type of an image" + ], + "exif_read_data": [ + "array exif_read_data(string filename [, sections_needed [, sub_arrays[, read_thumbnail]]])", + "Reads header data from the JPEG/TIFF image filename and optionally reads the internal thumbnails" + ], + "exif_tagname": [ + "string exif_tagname(index)", + "Get headername for index or false if not defined" + ], + "exif_thumbnail": [ + "string exif_thumbnail(string filename [, &width, &height [, &imagetype]])", + "Reads the embedded thumbnail" + ], + "exit": [ + "void exit([mixed status])", + "Output a message and terminate the current script" + ], + "exp": [ + "float exp(float number)", + "Returns e raised to the power of the number" + ], + "explode": [ + "array explode(string separator, string str [, int limit])", + "Splits a string on string separator and return array of components. If limit is positive only limit number of components is returned. If limit is negative all components except the last abs(limit) are returned." + ], + "expm1": [ + "float expm1(float number)", + "Returns exp(number) - 1, computed in a way that accurate even when the value of number is close to zero" + ], + "extension_loaded": [ + "bool extension_loaded(string extension_name)", + "Returns true if the named extension is loaded" + ], + "extract": [ + "int extract(array var_array [, int extract_type [, string prefix]])", + "Imports variables into symbol table from an array" + ], + "ezmlm_hash": [ + "int ezmlm_hash(string addr)", + "Calculate EZMLM list hash value." + ], + "fclose": [ + "bool fclose(resource fp)", + "Close an open file pointer" + ], + "feof": [ + "bool feof(resource fp)", + "Test for end-of-file on a file pointer" + ], + "fflush": [ + "bool fflush(resource fp)", + "Flushes output" + ], + "fgetc": [ + "string fgetc(resource fp)", + "Get a character from file pointer" + ], + "fgetcsv": [ + "array fgetcsv(resource fp [,int length [, string delimiter [, string enclosure [, string escape]]]])", + "Get line from file pointer and parse for CSV fields" + ], + "fgets": [ + "string fgets(resource fp[, int length])", + "Get a line from file pointer" + ], + "fgetss": [ + "string fgetss(resource fp [, int length [, string allowable_tags]])", + "Get a line from file pointer and strip HTML tags" + ], + "file": [ + "array file(string filename [, int flags[, resource context]])", + "Read entire file into an array" + ], + "file_exists": [ + "bool file_exists(string filename)", + "Returns true if filename exists" + ], + "file_get_contents": [ + "string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])", + "Read the entire file into a string" + ], + "file_put_contents": [ + "int file_put_contents(string file, mixed data [, int flags [, resource context]])", + "Write/Create a file with contents data and return the number of bytes written" + ], + "fileatime": [ + "int fileatime(string filename)", + "Get last access time of file" + ], + "filectime": [ + "int filectime(string filename)", + "Get inode modification time of file" + ], + "filegroup": [ + "int filegroup(string filename)", + "Get file group" + ], + "fileinode": [ + "int fileinode(string filename)", + "Get file inode" + ], + "filemtime": [ + "int filemtime(string filename)", + "Get last modification time of file" + ], + "fileowner": [ + "int fileowner(string filename)", + "Get file owner" + ], + "fileperms": [ + "int fileperms(string filename)", + "Get file permissions" + ], + "filesize": [ + "int filesize(string filename)", + "Get file size" + ], + "filetype": [ + "string filetype(string filename)", + "Get file type" + ], + "filter_has_var": [ + "mixed filter_has_var(constant type, string variable_name)", + "* Returns true if the variable with the name 'name' exists in source." + ], + "filter_input": [ + "mixed filter_input(constant type, string variable_name [, long filter [, mixed options]])", + "* Returns the filtered variable 'name'* from source `type`." + ], + "filter_input_array": [ + "mixed filter_input_array(constant type, [, mixed options]])", + "* Returns an array with all arguments defined in 'definition'." + ], + "filter_var": [ + "mixed filter_var(mixed variable [, long filter [, mixed options]])", + "* Returns the filtered version of the vriable." + ], + "filter_var_array": [ + "mixed filter_var_array(array data, [, mixed options]])", + "* Returns an array with all arguments defined in 'definition'." + ], + "finfo_buffer": [ + "string finfo_buffer(resource finfo, char *string [, int options [, resource context]])", + "Return infromation about a string buffer." + ], + "finfo_close": [ + "resource finfo_close(resource finfo)", + "Close fileinfo resource." + ], + "finfo_file": [ + "string finfo_file(resource finfo, char *file_name [, int options [, resource context]])", + "Return information about a file." + ], + "finfo_open": [ + "resource finfo_open([int options [, string arg]])", + "Create a new fileinfo resource." + ], + "finfo_set_flags": [ + "bool finfo_set_flags(resource finfo, int options)", + "Set libmagic configuration options." + ], + "floatval": [ + "float floatval(mixed var)", + "Get the float value of a variable" + ], + "flock": [ + "bool flock(resource fp, int operation [, int &wouldblock])", + "Portable file locking" + ], + "floor": [ + "float floor(float number)", + "Returns the next lowest integer value from the number" + ], + "flush": [ + "void flush(void)", + "Flush the output buffer" + ], + "fmod": [ + "float fmod(float x, float y)", + "Returns the remainder of dividing x by y as a float" + ], + "fnmatch": [ + "bool fnmatch(string pattern, string filename [, int flags])", + "Match filename against pattern" + ], + "fopen": [ + "resource fopen(string filename, string mode [, bool use_include_path [, resource context]])", + "Open a file or a URL and return a file pointer" + ], + "forward_static_call": [ + "mixed forward_static_call(mixed function_name [, mixed parmeter] [, mixed ...])", + "Call a user function which is the first parameter" + ], + "fpassthru": [ + "int fpassthru(resource fp)", + "Output all remaining data from a file pointer" + ], + "fprintf": [ + "int fprintf(resource stream, string format [, mixed arg1 [, mixed ...]])", + "Output a formatted string into a stream" + ], + "fputcsv": [ + "int fputcsv(resource fp, array fields [, string delimiter [, string enclosure]])", + "Format line as CSV and write to file pointer" + ], + "fread": [ + "string fread(resource fp, int length)", + "Binary-safe file read" + ], + "frenchtojd": [ + "int frenchtojd(int month, int day, int year)", + "Converts a french republic calendar date to julian day count" + ], + "fscanf": [ + "mixed fscanf(resource stream, string format [, string ...])", + "Implements a mostly ANSI compatible fscanf()" + ], + "fseek": [ + "int fseek(resource fp, int offset [, int whence])", + "Seek on a file pointer" + ], + "fsockopen": [ + "resource fsockopen(string hostname, int port [, int errno [, string errstr [, float timeout]]])", + "Open Internet or Unix domain socket connection" + ], + "fstat": [ + "array fstat(resource fp)", + "Stat() on a filehandle" + ], + "ftell": [ + "int ftell(resource fp)", + "Get file pointer's read/write position" + ], + "ftok": [ + "int ftok(string pathname, string proj)", + "Convert a pathname and a project identifier to a System V IPC key" + ], + "ftp_alloc": [ + "bool ftp_alloc(resource stream, int size[, &response])", + "Attempt to allocate space on the remote FTP server" + ], + "ftp_cdup": [ + "bool ftp_cdup(resource stream)", + "Changes to the parent directory" + ], + "ftp_chdir": [ + "bool ftp_chdir(resource stream, string directory)", + "Changes directories" + ], + "ftp_chmod": [ + "int ftp_chmod(resource stream, int mode, string filename)", + "Sets permissions on a file" + ], + "ftp_close": [ + "bool ftp_close(resource stream)", + "Closes the FTP stream" + ], + "ftp_connect": [ + "resource ftp_connect(string host [, int port [, int timeout]])", + "Opens a FTP stream" + ], + "ftp_delete": [ + "bool ftp_delete(resource stream, string file)", + "Deletes a file" + ], + "ftp_exec": [ + "bool ftp_exec(resource stream, string command)", + "Requests execution of a program on the FTP server" + ], + "ftp_fget": [ + "bool ftp_fget(resource stream, resource fp, string remote_file, int mode[, int resumepos])", + "Retrieves a file from the FTP server and writes it to an open file" + ], + "ftp_fput": [ + "bool ftp_fput(resource stream, string remote_file, resource fp, int mode[, int startpos])", + "Stores a file from an open file to the FTP server" + ], + "ftp_get": [ + "bool ftp_get(resource stream, string local_file, string remote_file, int mode[, int resume_pos])", + "Retrieves a file from the FTP server and writes it to a local file" + ], + "ftp_get_option": [ + "mixed ftp_get_option(resource stream, int option)", + "Gets an FTP option" + ], + "ftp_login": [ + "bool ftp_login(resource stream, string username, string password)", + "Logs into the FTP server" + ], + "ftp_mdtm": [ + "int ftp_mdtm(resource stream, string filename)", + "Returns the last modification time of the file, or -1 on error" + ], + "ftp_mkdir": [ + "string ftp_mkdir(resource stream, string directory)", + "Creates a directory and returns the absolute path for the new directory or false on error" + ], + "ftp_nb_continue": [ + "int ftp_nb_continue(resource stream)", + "Continues retrieving/sending a file nbronously" + ], + "ftp_nb_fget": [ + "int ftp_nb_fget(resource stream, resource fp, string remote_file, int mode[, int resumepos])", + "Retrieves a file from the FTP server asynchronly and writes it to an open file" + ], + "ftp_nb_fput": [ + "int ftp_nb_fput(resource stream, string remote_file, resource fp, int mode[, int startpos])", + "Stores a file from an open file to the FTP server nbronly" + ], + "ftp_nb_get": [ + "int ftp_nb_get(resource stream, string local_file, string remote_file, int mode[, int resume_pos])", + "Retrieves a file from the FTP server nbhronly and writes it to a local file" + ], + "ftp_nb_put": [ + "int ftp_nb_put(resource stream, string remote_file, string local_file, int mode[, int startpos])", + "Stores a file on the FTP server" + ], + "ftp_nlist": [ + "array ftp_nlist(resource stream, string directory)", + "Returns an array of filenames in the given directory" + ], + "ftp_pasv": [ + "bool ftp_pasv(resource stream, bool pasv)", + "Turns passive mode on or off" + ], + "ftp_put": [ + "bool ftp_put(resource stream, string remote_file, string local_file, int mode[, int startpos])", + "Stores a file on the FTP server" + ], + "ftp_pwd": [ + "string ftp_pwd(resource stream)", + "Returns the present working directory" + ], + "ftp_raw": [ + "array ftp_raw(resource stream, string command)", + "Sends a literal command to the FTP server" + ], + "ftp_rawlist": [ + "array ftp_rawlist(resource stream, string directory [, bool recursive])", + "Returns a detailed listing of a directory as an array of output lines" + ], + "ftp_rename": [ + "bool ftp_rename(resource stream, string src, string dest)", + "Renames the given file to a new path" + ], + "ftp_rmdir": [ + "bool ftp_rmdir(resource stream, string directory)", + "Removes a directory" + ], + "ftp_set_option": [ + "bool ftp_set_option(resource stream, int option, mixed value)", + "Sets an FTP option" + ], + "ftp_site": [ + "bool ftp_site(resource stream, string cmd)", + "Sends a SITE command to the server" + ], + "ftp_size": [ + "int ftp_size(resource stream, string filename)", + "Returns the size of the file, or -1 on error" + ], + "ftp_ssl_connect": [ + "resource ftp_ssl_connect(string host [, int port [, int timeout]])", + "Opens a FTP-SSL stream" + ], + "ftp_systype": [ + "string ftp_systype(resource stream)", + "Returns the system type identifier" + ], + "ftruncate": [ + "bool ftruncate(resource fp, int size)", + "Truncate file to 'size' length" + ], + "func_get_arg": [ + "mixed func_get_arg(int arg_num)", + "Get the $arg_num'th argument that was passed to the function" + ], + "func_get_args": [ + "array func_get_args()", + "Get an array of the arguments that were passed to the function" + ], + "func_num_args": [ + "int func_num_args(void)", + "Get the number of arguments that were passed to the function" + ], + "function_exists": [ + "bool function_exists(string function_name)", + "Checks if the function exists" + ], + "fwrite": [ + "int fwrite(resource fp, string str [, int length])", + "Binary-safe file write" + ], + "gc_collect_cycles": [ + "int gc_collect_cycles(void)", + "Forces collection of any existing garbage cycles. Returns number of freed zvals" + ], + "gc_disable": [ + "void gc_disable(void)", + "Deactivates the circular reference collector" + ], + "gc_enable": [ + "void gc_enable(void)", + "Activates the circular reference collector" + ], + "gc_enabled": [ + "void gc_enabled(void)", + "Returns status of the circular reference collector" + ], + "gd_info": [ + "array gd_info()", + "" + ], + "getKeywords": [ + "static array getKeywords(string $locale) {", + "* return an associative array containing keyword-value * pairs for this locale. The keys are keys to the array (doh!) * }}}" + ], + "get_browser": [ + "mixed get_browser([string browser_name [, bool return_array]])", + "Get information about the capabilities of a browser. If browser_name is omitted or null, HTTP_USER_AGENT is used. Returns an object by default; if return_array is true, returns an array." + ], + "get_called_class": [ + "string get_called_class()", + "Retrieves the \"Late Static Binding\" class name" + ], + "get_cfg_var": [ + "mixed get_cfg_var(string option_name)", + "Get the value of a PHP configuration option" + ], + "get_class": [ + "string get_class([object object])", + "Retrieves the class name" + ], + "get_class_methods": [ + "array get_class_methods(mixed class)", + "Returns an array of method names for class or class instance." + ], + "get_class_vars": [ + "array get_class_vars(string class_name)", + "Returns an array of default properties of the class." + ], + "get_current_user": [ + "string get_current_user(void)", + "Get the name of the owner of the current PHP script" + ], + "get_declared_classes": [ + "array get_declared_classes()", + "Returns an array of all declared classes." + ], + "get_declared_interfaces": [ + "array get_declared_interfaces()", + "Returns an array of all declared interfaces." + ], + "get_defined_constants": [ + "array get_defined_constants([bool categorize])", + "Return an array containing the names and values of all defined constants" + ], + "get_defined_functions": [ + "array get_defined_functions(void)", + "Returns an array of all defined functions" + ], + "get_defined_vars": [ + "array get_defined_vars(void)", + "Returns an associative array of names and values of all currently defined variable names (variables in the current scope)" + ], + "get_display_language": [ + "static string get_display_language($locale[, $in_locale = null])", + "* gets the language for the $locale in $in_locale or default_locale" + ], + "get_display_name": [ + "static string get_display_name($locale[, $in_locale = null])", + "* gets the name for the $locale in $in_locale or default_locale" + ], + "get_display_region": [ + "static string get_display_region($locale, $in_locale = null)", + "* gets the region for the $locale in $in_locale or default_locale" + ], + "get_display_script": [ + "static string get_display_script($locale, $in_locale = null)", + "* gets the script for the $locale in $in_locale or default_locale" + ], + "get_extension_funcs": [ + "array get_extension_funcs(string extension_name)", + "Returns an array with the names of functions belonging to the named extension" + ], + "get_headers": [ + "array get_headers(string url[, int format])", + "fetches all the headers sent by the server in response to a HTTP request" + ], + "get_html_translation_table": [ + "array get_html_translation_table([int table [, int quote_style]])", + "Returns the internal translation table used by htmlspecialchars and htmlentities" + ], + "get_include_path": [ + "string get_include_path()", + "Get the current include_path configuration option" + ], + "get_included_files": [ + "array get_included_files(void)", + "Returns an array with the file names that were include_once()'d" + ], + "get_loaded_extensions": [ + "array get_loaded_extensions([bool zend_extensions])", + "Return an array containing names of loaded extensions" + ], + "get_magic_quotes_gpc": [ + "int get_magic_quotes_gpc(void)", + "Get the current active configuration setting of magic_quotes_gpc" + ], + "get_magic_quotes_runtime": [ + "int get_magic_quotes_runtime(void)", + "Get the current active configuration setting of magic_quotes_runtime" + ], + "get_meta_tags": [ + "array get_meta_tags(string filename [, bool use_include_path])", + "Extracts all meta tag content attributes from a file and returns an array" + ], + "get_object_vars": [ + "array get_object_vars(object obj)", + "Returns an array of object properties" + ], + "get_parent_class": [ + "string get_parent_class([mixed object])", + "Retrieves the parent class name for object or class or current scope." + ], + "get_resource_type": [ + "string get_resource_type(resource res)", + "Get the resource type name for a given resource" + ], + "getallheaders": [ + "array getallheaders(void)", + "" + ], + "getcwd": [ + "mixed getcwd(void)", + "Gets the current directory" + ], + "getdate": [ + "array getdate([int timestamp])", + "Get date/time information" + ], + "getenv": [ + "string getenv(string varname)", + "Get the value of an environment variable" + ], + "gethostbyaddr": [ + "string gethostbyaddr(string ip_address)", + "Get the Internet host name corresponding to a given IP address" + ], + "gethostbyname": [ + "string gethostbyname(string hostname)", + "Get the IP address corresponding to a given Internet host name" + ], + "gethostbynamel": [ + "array gethostbynamel(string hostname)", + "Return a list of IP addresses that a given hostname resolves to." + ], + "gethostname": [ + "string gethostname()", + "Get the host name of the current machine" + ], + "getimagesize": [ + "array getimagesize(string imagefile [, array info])", + "Get the size of an image as 4-element array" + ], + "getlastmod": [ + "int getlastmod(void)", + "Get time of last page modification" + ], + "getmygid": [ + "int getmygid(void)", + "Get PHP script owner's GID" + ], + "getmyinode": [ + "int getmyinode(void)", + "Get the inode of the current script being parsed" + ], + "getmypid": [ + "int getmypid(void)", + "Get current process ID" + ], + "getmyuid": [ + "int getmyuid(void)", + "Get PHP script owner's UID" + ], + "getopt": [ + "array getopt(string options [, array longopts])", + "Get options from the command line argument list" + ], + "getprotobyname": [ + "int getprotobyname(string name)", + "Returns protocol number associated with name as per /etc/protocols" + ], + "getprotobynumber": [ + "string getprotobynumber(int proto)", + "Returns protocol name associated with protocol number proto" + ], + "getrandmax": [ + "int getrandmax(void)", + "Returns the maximum value a random number can have" + ], + "getrusage": [ + "array getrusage([int who])", + "Returns an array of usage statistics" + ], + "getservbyname": [ + "int getservbyname(string service, string protocol)", + "Returns port associated with service. Protocol must be \"tcp\" or \"udp\"" + ], + "getservbyport": [ + "string getservbyport(int port, string protocol)", + "Returns service name associated with port. Protocol must be \"tcp\" or \"udp\"" + ], + "gettext": [ + "string gettext(string msgid)", + "Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist" + ], + "gettimeofday": [ + "array gettimeofday([bool get_as_float])", + "Returns the current time as array" + ], + "gettype": [ + "string gettype(mixed var)", + "Returns the type of the variable" + ], + "glob": [ + "array glob(string pattern [, int flags])", + "Find pathnames matching a pattern" + ], + "gmdate": [ + "string gmdate(string format [, long timestamp])", + "Format a GMT date/time" + ], + "gmmktime": [ + "int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])", + "Get UNIX timestamp for a GMT date" + ], + "gmp_abs": [ + "resource gmp_abs(resource a)", + "Calculates absolute value" + ], + "gmp_add": [ + "resource gmp_add(resource a, resource b)", + "Add a and b" + ], + "gmp_and": [ + "resource gmp_and(resource a, resource b)", + "Calculates logical AND of a and b" + ], + "gmp_clrbit": [ + "void gmp_clrbit(resource &a, int index)", + "Clears bit in a" + ], + "gmp_cmp": [ + "int gmp_cmp(resource a, resource b)", + "Compares two numbers" + ], + "gmp_com": [ + "resource gmp_com(resource a)", + "Calculates one's complement of a" + ], + "gmp_div_q": [ + "resource gmp_div_q(resource a, resource b [, int round])", + "Divide a by b, returns quotient only" + ], + "gmp_div_qr": [ + "array gmp_div_qr(resource a, resource b [, int round])", + "Divide a by b, returns quotient and reminder" + ], + "gmp_div_r": [ + "resource gmp_div_r(resource a, resource b [, int round])", + "Divide a by b, returns reminder only" + ], + "gmp_divexact": [ + "resource gmp_divexact(resource a, resource b)", + "Divide a by b using exact division algorithm" + ], + "gmp_fact": [ + "resource gmp_fact(int a)", + "Calculates factorial function" + ], + "gmp_gcd": [ + "resource gmp_gcd(resource a, resource b)", + "Computes greatest common denominator (gcd) of a and b" + ], + "gmp_gcdext": [ + "array gmp_gcdext(resource a, resource b)", + "Computes G, S, and T, such that AS + BT = G = `gcd' (A, B)" + ], + "gmp_hamdist": [ + "int gmp_hamdist(resource a, resource b)", + "Calculates hamming distance between a and b" + ], + "gmp_init": [ + "resource gmp_init(mixed number [, int base])", + "Initializes GMP number" + ], + "gmp_intval": [ + "int gmp_intval(resource gmpnumber)", + "Gets signed long value of GMP number" + ], + "gmp_invert": [ + "resource gmp_invert(resource a, resource b)", + "Computes the inverse of a modulo b" + ], + "gmp_jacobi": [ + "int gmp_jacobi(resource a, resource b)", + "Computes Jacobi symbol" + ], + "gmp_legendre": [ + "int gmp_legendre(resource a, resource b)", + "Computes Legendre symbol" + ], + "gmp_mod": [ + "resource gmp_mod(resource a, resource b)", + "Computes a modulo b" + ], + "gmp_mul": [ + "resource gmp_mul(resource a, resource b)", + "Multiply a and b" + ], + "gmp_neg": [ + "resource gmp_neg(resource a)", + "Negates a number" + ], + "gmp_nextprime": [ + "resource gmp_nextprime(resource a)", + "Finds next prime of a" + ], + "gmp_or": [ + "resource gmp_or(resource a, resource b)", + "Calculates logical OR of a and b" + ], + "gmp_perfect_square": [ + "bool gmp_perfect_square(resource a)", + "Checks if a is an exact square" + ], + "gmp_popcount": [ + "int gmp_popcount(resource a)", + "Calculates the population count of a" + ], + "gmp_pow": [ + "resource gmp_pow(resource base, int exp)", + "Raise base to power exp" + ], + "gmp_powm": [ + "resource gmp_powm(resource base, resource exp, resource mod)", + "Raise base to power exp and take result modulo mod" + ], + "gmp_prob_prime": [ + "int gmp_prob_prime(resource a[, int reps])", + "Checks if a is \"probably prime\"" + ], + "gmp_random": [ + "resource gmp_random([int limiter])", + "Gets random number" + ], + "gmp_scan0": [ + "int gmp_scan0(resource a, int start)", + "Finds first zero bit" + ], + "gmp_scan1": [ + "int gmp_scan1(resource a, int start)", + "Finds first non-zero bit" + ], + "gmp_setbit": [ + "void gmp_setbit(resource &a, int index[, bool set_clear])", + "Sets or clear bit in a" + ], + "gmp_sign": [ + "int gmp_sign(resource a)", + "Gets the sign of the number" + ], + "gmp_sqrt": [ + "resource gmp_sqrt(resource a)", + "Takes integer part of square root of a" + ], + "gmp_sqrtrem": [ + "array gmp_sqrtrem(resource a)", + "Square root with remainder" + ], + "gmp_strval": [ + "string gmp_strval(resource gmpnumber [, int base])", + "Gets string representation of GMP number" + ], + "gmp_sub": [ + "resource gmp_sub(resource a, resource b)", + "Subtract b from a" + ], + "gmp_testbit": [ + "bool gmp_testbit(resource a, int index)", + "Tests if bit is set in a" + ], + "gmp_xor": [ + "resource gmp_xor(resource a, resource b)", + "Calculates logical exclusive OR of a and b" + ], + "gmstrftime": [ + "string gmstrftime(string format [, int timestamp])", + "Format a GMT/UCT time/date according to locale settings" + ], + "grapheme_extract": [ + "string grapheme_extract(string str, int size[, int extract_type[, int start[, int next]]])", + "Function to extract a sequence of default grapheme clusters" + ], + "grapheme_stripos": [ + "int grapheme_stripos(string haystack, string needle [, int offset ])", + "Find position of first occurrence of a string within another, ignoring case differences" + ], + "grapheme_stristr": [ + "string grapheme_stristr(string haystack, string needle[, bool part])", + "Finds first occurrence of a string within another" + ], + "grapheme_strlen": [ + "int grapheme_strlen(string str)", + "Get number of graphemes in a string" + ], + "grapheme_strpos": [ + "int grapheme_strpos(string haystack, string needle [, int offset ])", + "Find position of first occurrence of a string within another" + ], + "grapheme_strripos": [ + "int grapheme_strripos(string haystack, string needle [, int offset])", + "Find position of last occurrence of a string within another, ignoring case" + ], + "grapheme_strrpos": [ + "int grapheme_strrpos(string haystack, string needle [, int offset])", + "Find position of last occurrence of a string within another" + ], + "grapheme_strstr": [ + "string grapheme_strstr(string haystack, string needle[, bool part])", + "Finds first occurrence of a string within another" + ], + "grapheme_substr": [ + "string grapheme_substr(string str, int start [, int length])", + "Returns part of a string" + ], + "gregoriantojd": [ + "int gregoriantojd(int month, int day, int year)", + "Converts a gregorian calendar date to julian day count" + ], + "gzcompress": [ + "string gzcompress(string data [, int level])", + "Gzip-compress a string" + ], + "gzdeflate": [ + "string gzdeflate(string data [, int level])", + "Gzip-compress a string" + ], + "gzencode": [ + "string gzencode(string data [, int level [, int encoding_mode]])", + "GZ encode a string" + ], + "gzfile": [ + "array gzfile(string filename [, int use_include_path])", + "Read und uncompress entire .gz-file into an array" + ], + "gzinflate": [ + "string gzinflate(string data [, int length])", + "Unzip a gzip-compressed string" + ], + "gzopen": [ + "resource gzopen(string filename, string mode [, int use_include_path])", + "Open a .gz-file and return a .gz-file pointer" + ], + "gzuncompress": [ + "string gzuncompress(string data [, int length])", + "Unzip a gzip-compressed string" + ], + "hash": [ + "string hash(string algo, string data[, bool raw_output = false])", + "Generate a hash of a given input string Returns lowercase hexits by default" + ], + "hash_algos": [ + "array hash_algos(void)", + "Return a list of registered hashing algorithms" + ], + "hash_copy": [ + "resource hash_copy(resource context)", + "Copy hash resource" + ], + "hash_file": [ + "string hash_file(string algo, string filename[, bool raw_output = false])", + "Generate a hash of a given file Returns lowercase hexits by default" + ], + "hash_final": [ + "string hash_final(resource context[, bool raw_output=false])", + "Output resulting digest" + ], + "hash_hmac": [ + "string hash_hmac(string algo, string data, string key[, bool raw_output = false])", + "Generate a hash of a given input string with a key using HMAC Returns lowercase hexits by default" + ], + "hash_hmac_file": [ + "string hash_hmac_file(string algo, string filename, string key[, bool raw_output = false])", + "Generate a hash of a given file with a key using HMAC Returns lowercase hexits by default" + ], + "hash_init": [ + "resource hash_init(string algo[, int options, string key])", + "Initialize a hashing context" + ], + "hash_update": [ + "bool hash_update(resource context, string data)", + "Pump data into the hashing algorithm" + ], + "hash_update_file": [ + "bool hash_update_file(resource context, string filename[, resource context])", + "Pump data into the hashing algorithm from a file" + ], + "hash_update_stream": [ + "int hash_update_stream(resource context, resource handle[, integer length])", + "Pump data into the hashing algorithm from an open stream" + ], + "header": [ + "void header(string header [, bool replace, [int http_response_code]])", + "Sends a raw HTTP header" + ], + "header_remove": [ + "void header_remove([string name])", + "Removes an HTTP header previously set using header()" + ], + "headers_list": [ + "array headers_list(void)", + "Return list of headers to be sent / already sent" + ], + "headers_sent": [ + "bool headers_sent([string &$file [, int &$line]])", + "Returns true if headers have already been sent, false otherwise" + ], + "hebrev": [ + "string hebrev(string str [, int max_chars_per_line])", + "Converts logical Hebrew text to visual text" + ], + "hebrevc": [ + "string hebrevc(string str [, int max_chars_per_line])", + "Converts logical Hebrew text to visual text with newline conversion" + ], + "hexdec": [ + "int hexdec(string hexadecimal_number)", + "Returns the decimal equivalent of the hexadecimal number" + ], + "highlight_file": [ + "bool highlight_file(string file_name [, bool return] )", + "Syntax highlight a source file" + ], + "highlight_string": [ + "bool highlight_string(string string [, bool return] )", + "Syntax highlight a string or optionally return it" + ], + "html_entity_decode": [ + "string html_entity_decode(string string [, int quote_style][, string charset])", + "Convert all HTML entities to their applicable characters" + ], + "htmlentities": [ + "string htmlentities(string string [, int quote_style[, string charset[, bool double_encode]]])", + "Convert all applicable characters to HTML entities" + ], + "htmlspecialchars": [ + "string htmlspecialchars(string string [, int quote_style[, string charset[, bool double_encode]]])", + "Convert special characters to HTML entities" + ], + "htmlspecialchars_decode": [ + "string htmlspecialchars_decode(string string [, int quote_style])", + "Convert special HTML entities back to characters" + ], + "http_build_query": [ + "string http_build_query(mixed formdata [, string prefix [, string arg_separator]])", + "Generates a form-encoded query string from an associative array or object." + ], + "hypot": [ + "float hypot(float num1, float num2)", + "Returns sqrt(num1*num1 + num2*num2)" + ], + "ibase_add_user": [ + "bool ibase_add_user(resource service_handle, string user_name, string password [, string first_name [, string middle_name [, string last_name]]])", + "Add a user to security database" + ], + "ibase_affected_rows": [ + "int ibase_affected_rows( [ resource link_identifier ] )", + "Returns the number of rows affected by the previous INSERT, UPDATE or DELETE statement" + ], + "ibase_backup": [ + "mixed ibase_backup(resource service_handle, string source_db, string dest_file [, int options [, bool verbose]])", + "Initiates a backup task in the service manager and returns immediately" + ], + "ibase_blob_add": [ + "bool ibase_blob_add(resource blob_handle, string data)", + "Add data into created blob" + ], + "ibase_blob_cancel": [ + "bool ibase_blob_cancel(resource blob_handle)", + "Cancel creating blob" + ], + "ibase_blob_close": [ + "string ibase_blob_close(resource blob_handle)", + "Close blob" + ], + "ibase_blob_create": [ + "resource ibase_blob_create([resource link_identifier])", + "Create blob for adding data" + ], + "ibase_blob_echo": [ + "bool ibase_blob_echo([ resource link_identifier, ] string blob_id)", + "Output blob contents to browser" + ], + "ibase_blob_get": [ + "string ibase_blob_get(resource blob_handle, int len)", + "Get len bytes data from open blob" + ], + "ibase_blob_import": [ + "string ibase_blob_import([ resource link_identifier, ] resource file)", + "Create blob, copy file in it, and close it" + ], + "ibase_blob_info": [ + "array ibase_blob_info([ resource link_identifier, ] string blob_id)", + "Return blob length and other useful info" + ], + "ibase_blob_open": [ + "resource ibase_blob_open([ resource link_identifier, ] string blob_id)", + "Open blob for retrieving data parts" + ], + "ibase_close": [ + "bool ibase_close([resource link_identifier])", + "Close an InterBase connection" + ], + "ibase_commit": [ + "bool ibase_commit( resource link_identifier )", + "Commit transaction" + ], + "ibase_commit_ret": [ + "bool ibase_commit_ret( resource link_identifier )", + "Commit transaction and retain the transaction context" + ], + "ibase_connect": [ + "resource ibase_connect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]])", + "Open a connection to an InterBase database" + ], + "ibase_db_info": [ + "string ibase_db_info(resource service_handle, string db, int action [, int argument])", + "Request statistics about a database" + ], + "ibase_delete_user": [ + "bool ibase_delete_user(resource service_handle, string user_name, string password [, string first_name [, string middle_name [, string last_name]]])", + "Delete a user from security database" + ], + "ibase_drop_db": [ + "bool ibase_drop_db([resource link_identifier])", + "Drop an InterBase database" + ], + "ibase_errcode": [ + "int ibase_errcode(void)", + "Return error code" + ], + "ibase_errmsg": [ + "string ibase_errmsg(void)", + "Return error message" + ], + "ibase_execute": [ + "mixed ibase_execute(resource query [, mixed bind_arg [, mixed bind_arg [, ...]]])", + "Execute a previously prepared query" + ], + "ibase_fetch_assoc": [ + "array ibase_fetch_assoc(resource result [, int fetch_flags])", + "Fetch a row from the results of a query" + ], + "ibase_fetch_object": [ + "object ibase_fetch_object(resource result [, int fetch_flags])", + "Fetch a object from the results of a query" + ], + "ibase_fetch_row": [ + "array ibase_fetch_row(resource result [, int fetch_flags])", + "Fetch a row from the results of a query" + ], + "ibase_field_info": [ + "array ibase_field_info(resource query_result, int field_number)", + "Get information about a field" + ], + "ibase_free_event_handler": [ + "bool ibase_free_event_handler(resource event)", + "Frees the event handler set by ibase_set_event_handler()" + ], + "ibase_free_query": [ + "bool ibase_free_query(resource query)", + "Free memory used by a query" + ], + "ibase_free_result": [ + "bool ibase_free_result(resource result)", + "Free the memory used by a result" + ], + "ibase_gen_id": [ + "int ibase_gen_id(string generator [, int increment [, resource link_identifier ]])", + "Increments the named generator and returns its new value" + ], + "ibase_maintain_db": [ + "bool ibase_maintain_db(resource service_handle, string db, int action [, int argument])", + "Execute a maintenance command on the database server" + ], + "ibase_modify_user": [ + "bool ibase_modify_user(resource service_handle, string user_name, string password [, string first_name [, string middle_name [, string last_name]]])", + "Modify a user in security database" + ], + "ibase_name_result": [ + "bool ibase_name_result(resource result, string name)", + "Assign a name to a result for use with ... WHERE CURRENT OF statements" + ], + "ibase_num_fields": [ + "int ibase_num_fields(resource query_result)", + "Get the number of fields in result" + ], + "ibase_num_params": [ + "int ibase_num_params(resource query)", + "Get the number of params in a prepared query" + ], + "ibase_num_rows": [ + "int ibase_num_rows( resource result_identifier )", + "Return the number of rows that are available in a result" + ], + "ibase_param_info": [ + "array ibase_param_info(resource query, int field_number)", + "Get information about a parameter" + ], + "ibase_pconnect": [ + "resource ibase_pconnect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]])", + "Open a persistent connection to an InterBase database" + ], + "ibase_prepare": [ + "resource ibase_prepare(resource link_identifier[, string query [, resource trans_identifier ]])", + "Prepare a query for later execution" + ], + "ibase_query": [ + "mixed ibase_query([resource link_identifier, [ resource link_identifier, ]] string query [, mixed bind_arg [, mixed bind_arg [, ...]]])", + "Execute a query" + ], + "ibase_restore": [ + "mixed ibase_restore(resource service_handle, string source_file, string dest_db [, int options [, bool verbose]])", + "Initiates a restore task in the service manager and returns immediately" + ], + "ibase_rollback": [ + "bool ibase_rollback( resource link_identifier )", + "Rollback transaction" + ], + "ibase_rollback_ret": [ + "bool ibase_rollback_ret( resource link_identifier )", + "Rollback transaction and retain the transaction context" + ], + "ibase_server_info": [ + "string ibase_server_info(resource service_handle, int action)", + "Request information about a database server" + ], + "ibase_service_attach": [ + "resource ibase_service_attach(string host, string dba_username, string dba_password)", + "Connect to the service manager" + ], + "ibase_service_detach": [ + "bool ibase_service_detach(resource service_handle)", + "Disconnect from the service manager" + ], + "ibase_set_event_handler": [ + "resource ibase_set_event_handler([resource link_identifier,] callback handler, string event [, string event [, ...]])", + "Register the callback for handling each of the named events" + ], + "ibase_trans": [ + "resource ibase_trans([int trans_args [, resource link_identifier [, ... ], int trans_args [, resource link_identifier [, ... ]] [, ...]]])", + "Start a transaction over one or several databases" + ], + "ibase_wait_event": [ + "string ibase_wait_event([resource link_identifier,] string event [, string event [, ...]])", + "Waits for any one of the passed Interbase events to be posted by the database, and returns its name" + ], + "iconv": [ + "string iconv(string in_charset, string out_charset, string str)", + "Returns str converted to the out_charset character set" + ], + "iconv_get_encoding": [ + "mixed iconv_get_encoding([string type])", + "Get internal encoding and output encoding for ob_iconv_handler()" + ], + "iconv_mime_decode": [ + "string iconv_mime_decode(string encoded_string [, int mode, string charset])", + "Decodes a mime header field" + ], + "iconv_mime_decode_headers": [ + "array iconv_mime_decode_headers(string headers [, int mode, string charset])", + "Decodes multiple mime header fields" + ], + "iconv_mime_encode": [ + "string iconv_mime_encode(string field_name, string field_value [, array preference])", + "Composes a mime header field with field_name and field_value in a specified scheme" + ], + "iconv_set_encoding": [ + "bool iconv_set_encoding(string type, string charset)", + "Sets internal encoding and output encoding for ob_iconv_handler()" + ], + "iconv_strlen": [ + "int iconv_strlen(string str [, string charset])", + "Returns the character count of str" + ], + "iconv_strpos": [ + "int iconv_strpos(string haystack, string needle [, int offset [, string charset]])", + "Finds position of first occurrence of needle within part of haystack beginning with offset" + ], + "iconv_strrpos": [ + "int iconv_strrpos(string haystack, string needle [, string charset])", + "Finds position of last occurrence of needle within part of haystack beginning with offset" + ], + "iconv_substr": [ + "string iconv_substr(string str, int offset, [int length, string charset])", + "Returns specified part of a string" + ], + "idate": [ + "int idate(string format [, int timestamp])", + "Format a local time/date as integer" + ], + "idn_to_ascii": [ + "int idn_to_ascii(string domain[, int options])", + "Converts an Unicode domain to ASCII representation, as defined in the IDNA RFC" + ], + "idn_to_utf8": [ + "int idn_to_utf8(string domain[, int options])", + "Converts an ASCII representation of the domain to Unicode (UTF-8), as defined in the IDNA RFC" + ], + "ignore_user_abort": [ + "int ignore_user_abort([string value])", + "Set whether we want to ignore a user abort event or not" + ], + "image2wbmp": [ + "bool image2wbmp(resource im [, string filename [, int threshold]])", + "Output WBMP image to browser or file" + ], + "image_type_to_extension": [ + "string image_type_to_extension(int imagetype [, bool include_dot])", + "Get file extension for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype" + ], + "image_type_to_mime_type": [ + "string image_type_to_mime_type(int imagetype)", + "Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype" + ], + "imagealphablending": [ + "bool imagealphablending(resource im, bool on)", + "Turn alpha blending mode on or off for the given image" + ], + "imageantialias": [ + "bool imageantialias(resource im, bool on)", + "Should antialiased functions used or not" + ], + "imagearc": [ + "bool imagearc(resource im, int cx, int cy, int w, int h, int s, int e, int col)", + "Draw a partial ellipse" + ], + "imagechar": [ + "bool imagechar(resource im, int font, int x, int y, string c, int col)", + "Draw a character" + ], + "imagecharup": [ + "bool imagecharup(resource im, int font, int x, int y, string c, int col)", + "Draw a character rotated 90 degrees counter-clockwise" + ], + "imagecolorallocate": [ + "int imagecolorallocate(resource im, int red, int green, int blue)", + "Allocate a color for an image" + ], + "imagecolorallocatealpha": [ + "int imagecolorallocatealpha(resource im, int red, int green, int blue, int alpha)", + "Allocate a color with an alpha level. Works for true color and palette based images" + ], + "imagecolorat": [ + "int imagecolorat(resource im, int x, int y)", + "Get the index of the color of a pixel" + ], + "imagecolorclosest": [ + "int imagecolorclosest(resource im, int red, int green, int blue)", + "Get the index of the closest color to the specified color" + ], + "imagecolorclosestalpha": [ + "int imagecolorclosestalpha(resource im, int red, int green, int blue, int alpha)", + "Find the closest matching colour with alpha transparency" + ], + "imagecolorclosesthwb": [ + "int imagecolorclosesthwb(resource im, int red, int green, int blue)", + "Get the index of the color which has the hue, white and blackness nearest to the given color" + ], + "imagecolordeallocate": [ + "bool imagecolordeallocate(resource im, int index)", + "De-allocate a color for an image" + ], + "imagecolorexact": [ + "int imagecolorexact(resource im, int red, int green, int blue)", + "Get the index of the specified color" + ], + "imagecolorexactalpha": [ + "int imagecolorexactalpha(resource im, int red, int green, int blue, int alpha)", + "Find exact match for colour with transparency" + ], + "imagecolormatch": [ + "bool imagecolormatch(resource im1, resource im2)", + "Makes the colors of the palette version of an image more closely match the true color version" + ], + "imagecolorresolve": [ + "int imagecolorresolve(resource im, int red, int green, int blue)", + "Get the index of the specified color or its closest possible alternative" + ], + "imagecolorresolvealpha": [ + "int imagecolorresolvealpha(resource im, int red, int green, int blue, int alpha)", + "Resolve/Allocate a colour with an alpha level. Works for true colour and palette based images" + ], + "imagecolorset": [ + "void imagecolorset(resource im, int col, int red, int green, int blue)", + "Set the color for the specified palette index" + ], + "imagecolorsforindex": [ + "array imagecolorsforindex(resource im, int col)", + "Get the colors for an index" + ], + "imagecolorstotal": [ + "int imagecolorstotal(resource im)", + "Find out the number of colors in an image's palette" + ], + "imagecolortransparent": [ + "int imagecolortransparent(resource im [, int col])", + "Define a color as transparent" + ], + "imageconvolution": [ + "resource imageconvolution(resource src_im, array matrix3x3, double div, double offset)", + "Apply a 3x3 convolution matrix, using coefficient div and offset" + ], + "imagecopy": [ + "bool imagecopy(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h)", + "Copy part of an image" + ], + "imagecopymerge": [ + "bool imagecopymerge(resource src_im, resource dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct)", + "Merge one part of an image with another" + ], + "imagecopymergegray": [ + "bool imagecopymergegray(resource src_im, resource dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct)", + "Merge one part of an image with another" + ], + "imagecopyresampled": [ + "bool imagecopyresampled(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h)", + "Copy and resize part of an image using resampling to help ensure clarity" + ], + "imagecopyresized": [ + "bool imagecopyresized(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h)", + "Copy and resize part of an image" + ], + "imagecreate": [ + "resource imagecreate(int x_size, int y_size)", + "Create a new image" + ], + "imagecreatefromgd": [ + "resource imagecreatefromgd(string filename)", + "Create a new image from GD file or URL" + ], + "imagecreatefromgd2": [ + "resource imagecreatefromgd2(string filename)", + "Create a new image from GD2 file or URL" + ], + "imagecreatefromgd2part": [ + "resource imagecreatefromgd2part(string filename, int srcX, int srcY, int width, int height)", + "Create a new image from a given part of GD2 file or URL" + ], + "imagecreatefromgif": [ + "resource imagecreatefromgif(string filename)", + "Create a new image from GIF file or URL" + ], + "imagecreatefromjpeg": [ + "resource imagecreatefromjpeg(string filename)", + "Create a new image from JPEG file or URL" + ], + "imagecreatefrompng": [ + "resource imagecreatefrompng(string filename)", + "Create a new image from PNG file or URL" + ], + "imagecreatefromstring": [ + "resource imagecreatefromstring(string image)", + "Create a new image from the image stream in the string" + ], + "imagecreatefromwbmp": [ + "resource imagecreatefromwbmp(string filename)", + "Create a new image from WBMP file or URL" + ], + "imagecreatefromxbm": [ + "resource imagecreatefromxbm(string filename)", + "Create a new image from XBM file or URL" + ], + "imagecreatefromxpm": [ + "resource imagecreatefromxpm(string filename)", + "Create a new image from XPM file or URL" + ], + "imagecreatetruecolor": [ + "resource imagecreatetruecolor(int x_size, int y_size)", + "Create a new true color image" + ], + "imagedashedline": [ + "bool imagedashedline(resource im, int x1, int y1, int x2, int y2, int col)", + "Draw a dashed line" + ], + "imagedestroy": [ + "bool imagedestroy(resource im)", + "Destroy an image" + ], + "imageellipse": [ + "bool imageellipse(resource im, int cx, int cy, int w, int h, int color)", + "Draw an ellipse" + ], + "imagefill": [ + "bool imagefill(resource im, int x, int y, int col)", + "Flood fill" + ], + "imagefilledarc": [ + "bool imagefilledarc(resource im, int cx, int cy, int w, int h, int s, int e, int col, int style)", + "Draw a filled partial ellipse" + ], + "imagefilledellipse": [ + "bool imagefilledellipse(resource im, int cx, int cy, int w, int h, int color)", + "Draw an ellipse" + ], + "imagefilledpolygon": [ + "bool imagefilledpolygon(resource im, array point, int num_points, int col)", + "Draw a filled polygon" + ], + "imagefilledrectangle": [ + "bool imagefilledrectangle(resource im, int x1, int y1, int x2, int y2, int col)", + "Draw a filled rectangle" + ], + "imagefilltoborder": [ + "bool imagefilltoborder(resource im, int x, int y, int border, int col)", + "Flood fill to specific color" + ], + "imagefilter": [ + "bool imagefilter(resource src_im, int filtertype, [args] )", + "Applies Filter an image using a custom angle" + ], + "imagefontheight": [ + "int imagefontheight(int font)", + "Get font height" + ], + "imagefontwidth": [ + "int imagefontwidth(int font)", + "Get font width" + ], + "imageftbbox": [ + "array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo])", + "Give the bounding box of a text using fonts via freetype2" + ], + "imagefttext": [ + "array imagefttext(resource im, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo])", + "Write text to the image using fonts via freetype2" + ], + "imagegammacorrect": [ + "bool imagegammacorrect(resource im, float inputgamma, float outputgamma)", + "Apply a gamma correction to a GD image" + ], + "imagegd": [ + "bool imagegd(resource im [, string filename])", + "Output GD image to browser or file" + ], + "imagegd2": [ + "bool imagegd2(resource im [, string filename, [, int chunk_size, [, int type]]])", + "Output GD2 image to browser or file" + ], + "imagegif": [ + "bool imagegif(resource im [, string filename])", + "Output GIF image to browser or file" + ], + "imagegrabscreen": [ + "resource imagegrabscreen()", + "Grab a screenshot" + ], + "imagegrabwindow": [ + "resource imagegrabwindow(int window_handle [, int client_area])", + "Grab a window or its client area using a windows handle (HWND property in COM instance)" + ], + "imageinterlace": [ + "int imageinterlace(resource im [, int interlace])", + "Enable or disable interlace" + ], + "imageistruecolor": [ + "bool imageistruecolor(resource im)", + "return true if the image uses truecolor" + ], + "imagejpeg": [ + "bool imagejpeg(resource im [, string filename [, int quality]])", + "Output JPEG image to browser or file" + ], + "imagelayereffect": [ + "bool imagelayereffect(resource im, int effect)", + "Set the alpha blending flag to use the bundled libgd layering effects" + ], + "imageline": [ + "bool imageline(resource im, int x1, int y1, int x2, int y2, int col)", + "Draw a line" + ], + "imageloadfont": [ + "int imageloadfont(string filename)", + "Load a new font" + ], + "imagepalettecopy": [ + "void imagepalettecopy(resource dst, resource src)", + "Copy the palette from the src image onto the dst image" + ], + "imagepng": [ + "bool imagepng(resource im [, string filename])", + "Output PNG image to browser or file" + ], + "imagepolygon": [ + "bool imagepolygon(resource im, array point, int num_points, int col)", + "Draw a polygon" + ], + "imagepsbbox": [ + "array imagepsbbox(string text, resource font, int size [, int space, int tightness, float angle])", + "Return the bounding box needed by a string if rasterized" + ], + "imagepscopyfont": [ + "int imagepscopyfont(int font_index)", + "Make a copy of a font for purposes like extending or reenconding" + ], + "imagepsencodefont": [ + "bool imagepsencodefont(resource font_index, string filename)", + "To change a fonts character encoding vector" + ], + "imagepsextendfont": [ + "bool imagepsextendfont(resource font_index, float extend)", + "Extend or or condense (if extend < 1) a font" + ], + "imagepsfreefont": [ + "bool imagepsfreefont(resource font_index)", + "Free memory used by a font" + ], + "imagepsloadfont": [ + "resource imagepsloadfont(string pathname)", + "Load a new font from specified file" + ], + "imagepsslantfont": [ + "bool imagepsslantfont(resource font_index, float slant)", + "Slant a font" + ], + "imagepstext": [ + "array imagepstext(resource image, string text, resource font, int size, int foreground, int background, int xcoord, int ycoord [, int space [, int tightness [, float angle [, int antialias])", + "Rasterize a string over an image" + ], + "imagerectangle": [ + "bool imagerectangle(resource im, int x1, int y1, int x2, int y2, int col)", + "Draw a rectangle" + ], + "imagerotate": [ + "resource imagerotate(resource src_im, float angle, int bgdcolor [, int ignoretransparent])", + "Rotate an image using a custom angle" + ], + "imagesavealpha": [ + "bool imagesavealpha(resource im, bool on)", + "Include alpha channel to a saved image" + ], + "imagesetbrush": [ + "bool imagesetbrush(resource image, resource brush)", + "Set the brush image to $brush when filling $image with the \"IMG_COLOR_BRUSHED\" color" + ], + "imagesetpixel": [ + "bool imagesetpixel(resource im, int x, int y, int col)", + "Set a single pixel" + ], + "imagesetstyle": [ + "bool imagesetstyle(resource im, array styles)", + "Set the line drawing styles for use with imageline and IMG_COLOR_STYLED." + ], + "imagesetthickness": [ + "bool imagesetthickness(resource im, int thickness)", + "Set line thickness for drawing lines, ellipses, rectangles, polygons etc." + ], + "imagesettile": [ + "bool imagesettile(resource image, resource tile)", + "Set the tile image to $tile when filling $image with the \"IMG_COLOR_TILED\" color" + ], + "imagestring": [ + "bool imagestring(resource im, int font, int x, int y, string str, int col)", + "Draw a string horizontally" + ], + "imagestringup": [ + "bool imagestringup(resource im, int font, int x, int y, string str, int col)", + "Draw a string vertically - rotated 90 degrees counter-clockwise" + ], + "imagesx": [ + "int imagesx(resource im)", + "Get image width" + ], + "imagesy": [ + "int imagesy(resource im)", + "Get image height" + ], + "imagetruecolortopalette": [ + "void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted)", + "Convert a true colour image to a palette based image with a number of colours, optionally using dithering." + ], + "imagettfbbox": [ + "array imagettfbbox(float size, float angle, string font_file, string text)", + "Give the bounding box of a text using TrueType fonts" + ], + "imagettftext": [ + "array imagettftext(resource im, float size, float angle, int x, int y, int col, string font_file, string text)", + "Write text to the image using a TrueType font" + ], + "imagetypes": [ + "int imagetypes(void)", + "Return the types of images supported in a bitfield - 1=GIF, 2=JPEG, 4=PNG, 8=WBMP, 16=XPM" + ], + "imagewbmp": [ + "bool imagewbmp(resource im [, string filename, [, int foreground]])", + "Output WBMP image to browser or file" + ], + "imagexbm": [ + "int imagexbm(int im, string filename [, int foreground])", + "Output XBM image to browser or file" + ], + "imap_8bit": [ + "string imap_8bit(string text)", + "Convert an 8-bit string to a quoted-printable string" + ], + "imap_alerts": [ + "array imap_alerts(void)", + "Returns an array of all IMAP alerts that have been generated since the last page load or since the last imap_alerts() call, whichever came last. The alert stack is cleared after imap_alerts() is called." + ], + "imap_append": [ + "bool imap_append(resource stream_id, string folder, string message [, string options [, string internal_date]])", + "Append a new message to a specified mailbox" + ], + "imap_base64": [ + "string imap_base64(string text)", + "Decode BASE64 encoded text" + ], + "imap_binary": [ + "string imap_binary(string text)", + "Convert an 8bit string to a base64 string" + ], + "imap_body": [ + "string imap_body(resource stream_id, int msg_no [, int options])", + "Read the message body" + ], + "imap_bodystruct": [ + "object imap_bodystruct(resource stream_id, int msg_no, string section)", + "Read the structure of a specified body section of a specific message" + ], + "imap_check": [ + "object imap_check(resource stream_id)", + "Get mailbox properties" + ], + "imap_clearflag_full": [ + "bool imap_clearflag_full(resource stream_id, string sequence, string flag [, int options])", + "Clears flags on messages" + ], + "imap_close": [ + "bool imap_close(resource stream_id [, int options])", + "Close an IMAP stream" + ], + "imap_createmailbox": [ + "bool imap_createmailbox(resource stream_id, string mailbox)", + "Create a new mailbox" + ], + "imap_delete": [ + "bool imap_delete(resource stream_id, int msg_no [, int options])", + "Mark a message for deletion" + ], + "imap_deletemailbox": [ + "bool imap_deletemailbox(resource stream_id, string mailbox)", + "Delete a mailbox" + ], + "imap_errors": [ + "array imap_errors(void)", + "Returns an array of all IMAP errors generated since the last page load, or since the last imap_errors() call, whichever came last. The error stack is cleared after imap_errors() is called." + ], + "imap_expunge": [ + "bool imap_expunge(resource stream_id)", + "Permanently delete all messages marked for deletion" + ], + "imap_fetch_overview": [ + "array imap_fetch_overview(resource stream_id, string sequence [, int options])", + "Read an overview of the information in the headers of the given message sequence" + ], + "imap_fetchbody": [ + "string imap_fetchbody(resource stream_id, int msg_no, string section [, int options])", + "Get a specific body section" + ], + "imap_fetchheader": [ + "string imap_fetchheader(resource stream_id, int msg_no [, int options])", + "Get the full unfiltered header for a message" + ], + "imap_fetchstructure": [ + "object imap_fetchstructure(resource stream_id, int msg_no [, int options])", + "Read the full structure of a message" + ], + "imap_gc": [ + "bool imap_gc(resource stream_id, int flags)", + "This function garbage collects (purges) the cache of entries of a specific type." + ], + "imap_get_quota": [ + "array imap_get_quota(resource stream_id, string qroot)", + "Returns the quota set to the mailbox account qroot" + ], + "imap_get_quotaroot": [ + "array imap_get_quotaroot(resource stream_id, string mbox)", + "Returns the quota set to the mailbox account mbox" + ], + "imap_getacl": [ + "array imap_getacl(resource stream_id, string mailbox)", + "Gets the ACL for a given mailbox" + ], + "imap_getmailboxes": [ + "array imap_getmailboxes(resource stream_id, string ref, string pattern)", + "Reads the list of mailboxes and returns a full array of objects containing name, attributes, and delimiter" + ], + "imap_getsubscribed": [ + "array imap_getsubscribed(resource stream_id, string ref, string pattern)", + "Return a list of subscribed mailboxes, in the same format as imap_getmailboxes()" + ], + "imap_headerinfo": [ + "object imap_headerinfo(resource stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])", + "Read the headers of the message" + ], + "imap_headers": [ + "array imap_headers(resource stream_id)", + "Returns headers for all messages in a mailbox" + ], + "imap_last_error": [ + "string imap_last_error(void)", + "Returns the last error that was generated by an IMAP function. The error stack is NOT cleared after this call." + ], + "imap_list": [ + "array imap_list(resource stream_id, string ref, string pattern)", + "Read the list of mailboxes" + ], + "imap_listscan": [ + "array imap_listscan(resource stream_id, string ref, string pattern, string content)", + "Read list of mailboxes containing a certain string" + ], + "imap_lsub": [ + "array imap_lsub(resource stream_id, string ref, string pattern)", + "Return a list of subscribed mailboxes" + ], + "imap_mail": [ + "bool imap_mail(string to, string subject, string message [, string additional_headers [, string cc [, string bcc [, string rpath]]]])", + "Send an email message" + ], + "imap_mail_compose": [ + "string imap_mail_compose(array envelope, array body)", + "Create a MIME message based on given envelope and body sections" + ], + "imap_mail_copy": [ + "bool imap_mail_copy(resource stream_id, string msglist, string mailbox [, int options])", + "Copy specified message to a mailbox" + ], + "imap_mail_move": [ + "bool imap_mail_move(resource stream_id, string sequence, string mailbox [, int options])", + "Move specified message to a mailbox" + ], + "imap_mailboxmsginfo": [ + "object imap_mailboxmsginfo(resource stream_id)", + "Returns info about the current mailbox" + ], + "imap_mime_header_decode": [ + "array imap_mime_header_decode(string str)", + "Decode mime header element in accordance with RFC 2047 and return array of objects containing 'charset' encoding and decoded 'text'" + ], + "imap_msgno": [ + "int imap_msgno(resource stream_id, int unique_msg_id)", + "Get the sequence number associated with a UID" + ], + "imap_mutf7_to_utf8": [ + "string imap_mutf7_to_utf8(string in)", + "Decode a modified UTF-7 string to UTF-8" + ], + "imap_num_msg": [ + "int imap_num_msg(resource stream_id)", + "Gives the number of messages in the current mailbox" + ], + "imap_num_recent": [ + "int imap_num_recent(resource stream_id)", + "Gives the number of recent messages in current mailbox" + ], + "imap_open": [ + "resource imap_open(string mailbox, string user, string password [, int options [, int n_retries]])", + "Open an IMAP stream to a mailbox" + ], + "imap_ping": [ + "bool imap_ping(resource stream_id)", + "Check if the IMAP stream is still active" + ], + "imap_qprint": [ + "string imap_qprint(string text)", + "Convert a quoted-printable string to an 8-bit string" + ], + "imap_renamemailbox": [ + "bool imap_renamemailbox(resource stream_id, string old_name, string new_name)", + "Rename a mailbox" + ], + "imap_reopen": [ + "bool imap_reopen(resource stream_id, string mailbox [, int options [, int n_retries]])", + "Reopen an IMAP stream to a new mailbox" + ], + "imap_rfc822_parse_adrlist": [ + "array imap_rfc822_parse_adrlist(string address_string, string default_host)", + "Parses an address string" + ], + "imap_rfc822_parse_headers": [ + "object imap_rfc822_parse_headers(string headers [, string default_host])", + "Parse a set of mail headers contained in a string, and return an object similar to imap_headerinfo()" + ], + "imap_rfc822_write_address": [ + "string imap_rfc822_write_address(string mailbox, string host, string personal)", + "Returns a properly formatted email address given the mailbox, host, and personal info" + ], + "imap_savebody": [ + "bool imap_savebody(resource stream_id, string|resource file, int msg_no[, string section = \"\"[, int options = 0]])", + "Save a specific body section to a file" + ], + "imap_search": [ + "array imap_search(resource stream_id, string criteria [, int options [, string charset]])", + "Return a list of messages matching the given criteria" + ], + "imap_set_quota": [ + "bool imap_set_quota(resource stream_id, string qroot, int mailbox_size)", + "Will set the quota for qroot mailbox" + ], + "imap_setacl": [ + "bool imap_setacl(resource stream_id, string mailbox, string id, string rights)", + "Sets the ACL for a given mailbox" + ], + "imap_setflag_full": [ + "bool imap_setflag_full(resource stream_id, string sequence, string flag [, int options])", + "Sets flags on messages" + ], + "imap_sort": [ + "array imap_sort(resource stream_id, int criteria, int reverse [, int options [, string search_criteria [, string charset]]])", + "Sort an array of message headers, optionally including only messages that meet specified criteria." + ], + "imap_status": [ + "object imap_status(resource stream_id, string mailbox, int options)", + "Get status info from a mailbox" + ], + "imap_subscribe": [ + "bool imap_subscribe(resource stream_id, string mailbox)", + "Subscribe to a mailbox" + ], + "imap_thread": [ + "array imap_thread(resource stream_id [, int options])", + "Return threaded by REFERENCES tree" + ], + "imap_timeout": [ + "mixed imap_timeout(int timeout_type [, int timeout])", + "Set or fetch imap timeout" + ], + "imap_uid": [ + "int imap_uid(resource stream_id, int msg_no)", + "Get the unique message id associated with a standard sequential message number" + ], + "imap_undelete": [ + "bool imap_undelete(resource stream_id, int msg_no [, int flags])", + "Remove the delete flag from a message" + ], + "imap_unsubscribe": [ + "bool imap_unsubscribe(resource stream_id, string mailbox)", + "Unsubscribe from a mailbox" + ], + "imap_utf7_decode": [ + "string imap_utf7_decode(string buf)", + "Decode a modified UTF-7 string" + ], + "imap_utf7_encode": [ + "string imap_utf7_encode(string buf)", + "Encode a string in modified UTF-7" + ], + "imap_utf8": [ + "string imap_utf8(string mime_encoded_text)", + "Convert a mime-encoded text to UTF-8" + ], + "imap_utf8_to_mutf7": [ + "string imap_utf8_to_mutf7(string in)", + "Encode a UTF-8 string to modified UTF-7" + ], + "implode": [ + "string implode([string glue,] array pieces)", + "Joins array elements placing glue string between items and return one string" + ], + "import_request_variables": [ + "bool import_request_variables(string types [, string prefix])", + "Import GET/POST/Cookie variables into the global scope" + ], + "in_array": [ + "bool in_array(mixed needle, array haystack [, bool strict])", + "Checks if the given value exists in the array" + ], + "include": [ + "bool include(string path)", + "Includes and evaluates the specified file" + ], + "include_once": [ + "bool include_once(string path)", + "Includes and evaluates the specified file" + ], + "inet_ntop": [ + "string inet_ntop(string in_addr)", + "Converts a packed inet address to a human readable IP address string" + ], + "inet_pton": [ + "string inet_pton(string ip_address)", + "Converts a human readable IP address to a packed binary string" + ], + "ini_get": [ + "string ini_get(string varname)", + "Get a configuration option" + ], + "ini_get_all": [ + "array ini_get_all([string extension[, bool details = true]])", + "Get all configuration options" + ], + "ini_restore": [ + "void ini_restore(string varname)", + "Restore the value of a configuration option specified by varname" + ], + "ini_set": [ + "string ini_set(string varname, string newvalue)", + "Set a configuration option, returns false on error and the old value of the configuration option on success" + ], + "interface_exists": [ + "bool interface_exists(string classname [, bool autoload])", + "Checks if the class exists" + ], + "intl_error_name": [ + "string intl_error_name()", + "* Return a string for a given error code. * The string will be the same as the name of the error code constant." + ], + "intl_get_error_code": [ + "int intl_get_error_code()", + "* Get code of the last occured error." + ], + "intl_get_error_message": [ + "string intl_get_error_message()", + "* Get text description of the last occured error." + ], + "intl_is_failure": [ + "bool intl_is_failure()", + "* Check whether the given error code indicates a failure. * Returns true if it does, and false if the code * indicates success or a warning." + ], + "intval": [ + "int intval(mixed var [, int base])", + "Get the integer value of a variable using the optional base for the conversion" + ], + "ip2long": [ + "int ip2long(string ip_address)", + "Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address" + ], + "iptcembed": [ + "array iptcembed(string iptcdata, string jpeg_file_name [, int spool])", + "Embed binary IPTC data into a JPEG image." + ], + "iptcparse": [ + "array iptcparse(string iptcdata)", + "Parse binary IPTC-data into associative array" + ], + "is_a": [ + "bool is_a(object object, string class_name)", + "Returns true if the object is of this class or has this class as one of its parents" + ], + "is_array": [ + "bool is_array(mixed var)", + "Returns true if variable is an array" + ], + "is_bool": [ + "bool is_bool(mixed var)", + "Returns true if variable is a boolean" + ], + "is_callable": [ + "bool is_callable(mixed var [, bool syntax_only [, string callable_name]])", + "Returns true if var is callable." + ], + "is_dir": [ + "bool is_dir(string filename)", + "Returns true if file is directory" + ], + "is_executable": [ + "bool is_executable(string filename)", + "Returns true if file is executable" + ], + "is_file": [ + "bool is_file(string filename)", + "Returns true if file is a regular file" + ], + "is_finite": [ + "bool is_finite(float val)", + "Returns whether argument is finite" + ], + "is_float": [ + "bool is_float(mixed var)", + "Returns true if variable is float point" + ], + "is_infinite": [ + "bool is_infinite(float val)", + "Returns whether argument is infinite" + ], + "is_link": [ + "bool is_link(string filename)", + "Returns true if file is symbolic link" + ], + "is_long": [ + "bool is_long(mixed var)", + "Returns true if variable is a long (integer)" + ], + "is_nan": [ + "bool is_nan(float val)", + "Returns whether argument is not a number" + ], + "is_null": [ + "bool is_null(mixed var)", + "Returns true if variable is null" + ], + "is_numeric": [ + "bool is_numeric(mixed value)", + "Returns true if value is a number or a numeric string" + ], + "is_object": [ + "bool is_object(mixed var)", + "Returns true if variable is an object" + ], + "is_readable": [ + "bool is_readable(string filename)", + "Returns true if file can be read" + ], + "is_resource": [ + "bool is_resource(mixed var)", + "Returns true if variable is a resource" + ], + "is_scalar": [ + "bool is_scalar(mixed value)", + "Returns true if value is a scalar" + ], + "is_string": [ + "bool is_string(mixed var)", + "Returns true if variable is a string" + ], + "is_subclass_of": [ + "bool is_subclass_of(object object, string class_name)", + "Returns true if the object has this class as one of its parents" + ], + "is_uploaded_file": [ + "bool is_uploaded_file(string path)", + "Check if file was created by rfc1867 upload" + ], + "is_writable": [ + "bool is_writable(string filename)", + "Returns true if file can be written" + ], + "isset": [ + "bool isset(mixed var [, mixed var])", + "Determine whether a variable is set" + ], + "iterator_apply": [ + "int iterator_apply(Traversable it, mixed function [, mixed params])", + "Calls a function for every element in an iterator" + ], + "iterator_count": [ + "int iterator_count(Traversable it)", + "Count the elements in an iterator" + ], + "iterator_to_array": [ + "array iterator_to_array(Traversable it [, bool use_keys = true])", + "Copy the iterator into an array" + ], + "jddayofweek": [ + "mixed jddayofweek(int juliandaycount [, int mode])", + "Returns name or number of day of week from julian day count" + ], + "jdmonthname": [ + "string jdmonthname(int juliandaycount, int mode)", + "Returns name of month for julian day count" + ], + "jdtofrench": [ + "string jdtofrench(int juliandaycount)", + "Converts a julian day count to a french republic calendar date" + ], + "jdtogregorian": [ + "string jdtogregorian(int juliandaycount)", + "Converts a julian day count to a gregorian calendar date" + ], + "jdtojewish": [ + "string jdtojewish(int juliandaycount [, bool hebrew [, int fl]])", + "Converts a julian day count to a jewish calendar date" + ], + "jdtojulian": [ + "string jdtojulian(int juliandaycount)", + "Convert a julian day count to a julian calendar date" + ], + "jdtounix": [ + "int jdtounix(int jday)", + "Convert Julian Day to UNIX timestamp" + ], + "jewishtojd": [ + "int jewishtojd(int month, int day, int year)", + "Converts a jewish calendar date to a julian day count" + ], + "join": [ + "string join(array src, string glue)", + "An alias for implode" + ], + "jpeg2wbmp": [ + "bool jpeg2wbmp (string f_org, string f_dest, int d_height, int d_width, int threshold)", + "Convert JPEG image to WBMP image" + ], + "json_decode": [ + "mixed json_decode(string json [, bool assoc [, long depth]])", + "Decodes the JSON representation into a PHP value" + ], + "json_encode": [ + "string json_encode(mixed data [, int options])", + "Returns the JSON representation of a value" + ], + "json_last_error": [ + "int json_last_error()", + "Returns the error code of the last json_decode()." + ], + "juliantojd": [ + "int juliantojd(int month, int day, int year)", + "Converts a julian calendar date to julian day count" + ], + "key": [ + "mixed key(array array_arg)", + "Return the key of the element currently pointed to by the internal array pointer" + ], + "krsort": [ + "bool krsort(array &array_arg [, int sort_flags])", + "Sort an array by key value in reverse order" + ], + "ksort": [ + "bool ksort(array &array_arg [, int sort_flags])", + "Sort an array by key" + ], + "lcfirst": [ + "string lcfirst(string str)", + "Make a string's first character lowercase" + ], + "lcg_value": [ + "float lcg_value()", + "Returns a value from the combined linear congruential generator" + ], + "lchgrp": [ + "bool lchgrp(string filename, mixed group)", + "Change symlink group" + ], + "ldap_8859_to_t61": [ + "string ldap_8859_to_t61(string value)", + "Translate 8859 characters to t61 characters" + ], + "ldap_add": [ + "bool ldap_add(resource link, string dn, array entry)", + "Add entries to LDAP directory" + ], + "ldap_bind": [ + "bool ldap_bind(resource link [, string dn [, string password]])", + "Bind to LDAP directory" + ], + "ldap_compare": [ + "bool ldap_compare(resource link, string dn, string attr, string value)", + "Determine if an entry has a specific value for one of its attributes" + ], + "ldap_connect": [ + "resource ldap_connect([string host [, int port [, string wallet [, string wallet_passwd [, int authmode]]]]])", + "Connect to an LDAP server" + ], + "ldap_count_entries": [ + "int ldap_count_entries(resource link, resource result)", + "Count the number of entries in a search result" + ], + "ldap_delete": [ + "bool ldap_delete(resource link, string dn)", + "Delete an entry from a directory" + ], + "ldap_dn2ufn": [ + "string ldap_dn2ufn(string dn)", + "Convert DN to User Friendly Naming format" + ], + "ldap_err2str": [ + "string ldap_err2str(int errno)", + "Convert error number to error string" + ], + "ldap_errno": [ + "int ldap_errno(resource link)", + "Get the current ldap error number" + ], + "ldap_error": [ + "string ldap_error(resource link)", + "Get the current ldap error string" + ], + "ldap_explode_dn": [ + "array ldap_explode_dn(string dn, int with_attrib)", + "Splits DN into its component parts" + ], + "ldap_first_attribute": [ + "string ldap_first_attribute(resource link, resource result_entry)", + "Return first attribute" + ], + "ldap_first_entry": [ + "resource ldap_first_entry(resource link, resource result)", + "Return first result id" + ], + "ldap_first_reference": [ + "resource ldap_first_reference(resource link, resource result)", + "Return first reference" + ], + "ldap_free_result": [ + "bool ldap_free_result(resource result)", + "Free result memory" + ], + "ldap_get_attributes": [ + "array ldap_get_attributes(resource link, resource result_entry)", + "Get attributes from a search result entry" + ], + "ldap_get_dn": [ + "string ldap_get_dn(resource link, resource result_entry)", + "Get the DN of a result entry" + ], + "ldap_get_entries": [ + "array ldap_get_entries(resource link, resource result)", + "Get all result entries" + ], + "ldap_get_option": [ + "bool ldap_get_option(resource link, int option, mixed retval)", + "Get the current value of various session-wide parameters" + ], + "ldap_get_values_len": [ + "array ldap_get_values_len(resource link, resource result_entry, string attribute)", + "Get all values with lengths from a result entry" + ], + "ldap_list": [ + "resource ldap_list(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])", + "Single-level search" + ], + "ldap_mod_add": [ + "bool ldap_mod_add(resource link, string dn, array entry)", + "Add attribute values to current" + ], + "ldap_mod_del": [ + "bool ldap_mod_del(resource link, string dn, array entry)", + "Delete attribute values" + ], + "ldap_mod_replace": [ + "bool ldap_mod_replace(resource link, string dn, array entry)", + "Replace attribute values with new ones" + ], + "ldap_next_attribute": [ + "string ldap_next_attribute(resource link, resource result_entry)", + "Get the next attribute in result" + ], + "ldap_next_entry": [ + "resource ldap_next_entry(resource link, resource result_entry)", + "Get next result entry" + ], + "ldap_next_reference": [ + "resource ldap_next_reference(resource link, resource reference_entry)", + "Get next reference" + ], + "ldap_parse_reference": [ + "bool ldap_parse_reference(resource link, resource reference_entry, array referrals)", + "Extract information from reference entry" + ], + "ldap_parse_result": [ + "bool ldap_parse_result(resource link, resource result, int errcode, string matcheddn, string errmsg, array referrals)", + "Extract information from result" + ], + "ldap_read": [ + "resource ldap_read(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])", + "Read an entry" + ], + "ldap_rename": [ + "bool ldap_rename(resource link, string dn, string newrdn, string newparent, bool deleteoldrdn);", + "Modify the name of an entry" + ], + "ldap_sasl_bind": [ + "bool ldap_sasl_bind(resource link [, string binddn [, string password [, string sasl_mech [, string sasl_realm [, string sasl_authc_id [, string sasl_authz_id [, string props]]]]]]])", + "Bind to LDAP directory using SASL" + ], + "ldap_search": [ + "resource ldap_search(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])", + "Search LDAP tree under base_dn" + ], + "ldap_set_option": [ + "bool ldap_set_option(resource link, int option, mixed newval)", + "Set the value of various session-wide parameters" + ], + "ldap_set_rebind_proc": [ + "bool ldap_set_rebind_proc(resource link, string callback)", + "Set a callback function to do re-binds on referral chasing." + ], + "ldap_sort": [ + "bool ldap_sort(resource link, resource result, string sortfilter)", + "Sort LDAP result entries" + ], + "ldap_start_tls": [ + "bool ldap_start_tls(resource link)", + "Start TLS" + ], + "ldap_t61_to_8859": [ + "string ldap_t61_to_8859(string value)", + "Translate t61 characters to 8859 characters" + ], + "ldap_unbind": [ + "bool ldap_unbind(resource link)", + "Unbind from LDAP directory" + ], + "leak": [ + "void leak(int num_bytes=3)", + "Cause an intentional memory leak, for testing/debugging purposes" + ], + "levenshtein": [ + "int levenshtein(string str1, string str2[, int cost_ins, int cost_rep, int cost_del])", + "Calculate Levenshtein distance between two strings" + ], + "libxml_clear_errors": [ + "void libxml_clear_errors()", + "Clear last error from libxml" + ], + "libxml_disable_entity_loader": [ + "bool libxml_disable_entity_loader([boolean disable])", + "Disable/Enable ability to load external entities" + ], + "libxml_get_errors": [ + "object libxml_get_errors()", + "Retrieve array of errors" + ], + "libxml_get_last_error": [ + "object libxml_get_last_error()", + "Retrieve last error from libxml" + ], + "libxml_set_streams_context": [ + "void libxml_set_streams_context(resource streams_context)", + "Set the streams context for the next libxml document load or write" + ], + "libxml_use_internal_errors": [ + "bool libxml_use_internal_errors([boolean use_errors])", + "Disable libxml errors and allow user to fetch error information as needed" + ], + "link": [ + "int link(string target, string link)", + "Create a hard link" + ], + "linkinfo": [ + "int linkinfo(string filename)", + "Returns the st_dev field of the UNIX C stat structure describing the link" + ], + "litespeed_request_headers": [ + "array litespeed_request_headers(void)", + "Fetch all HTTP request headers" + ], + "litespeed_response_headers": [ + "array litespeed_response_headers(void)", + "Fetch all HTTP response headers" + ], + "locale_accept_from_http": [ + "string locale_accept_from_http(string $http_accept)", + null + ], + "locale_canonicalize": [ + "static string locale_canonicalize(Locale $loc, string $locale)", + "* @param string $locale The locale string to canonicalize" + ], + "locale_filter_matches": [ + "boolean locale_filter_matches(string $langtag, string $locale[, bool $canonicalize])", + "* Checks if a $langtag filter matches with $locale according to RFC 4647's basic filtering algorithm" + ], + "locale_get_all_variants": [ + "static array locale_get_all_variants($locale)", + "* gets an array containing the list of variants, or null" + ], + "locale_get_default": [ + "static string locale_get_default( )", + "Get default locale" + ], + "locale_get_keywords": [ + "static array locale_get_keywords(string $locale) {", + "* return an associative array containing keyword-value * pairs for this locale. The keys are keys to the array (doh!)" + ], + "locale_get_primary_language": [ + "static string locale_get_primary_language($locale)", + "* gets the primary language for the $locale" + ], + "locale_get_region": [ + "static string locale_get_region($locale)", + "* gets the region for the $locale" + ], + "locale_get_script": [ + "static string locale_get_script($locale)", + "* gets the script for the $locale" + ], + "locale_lookup": [ + "string locale_lookup(array $langtag, string $locale[, bool $canonicalize[, string $default = null]])", + "* Searchs the items in $langtag for the best match to the language * range" + ], + "locale_set_default": [ + "static string locale_set_default( string $locale )", + "Set default locale" + ], + "localeconv": [ + "array localeconv(void)", + "Returns numeric formatting information based on the current locale" + ], + "localtime": [ + "array localtime([int timestamp [, bool associative_array]])", + "Returns the results of the C system call localtime as an associative array if the associative_array argument is set to 1 other wise it is a regular array" + ], + "log": [ + "float log(float number, [float base])", + "Returns the natural logarithm of the number, or the base log if base is specified" + ], + "log10": [ + "float log10(float number)", + "Returns the base-10 logarithm of the number" + ], + "log1p": [ + "float log1p(float number)", + "Returns log(1 + number), computed in a way that accurate even when the value of number is close to zero" + ], + "long2ip": [ + "string long2ip(int proper_address)", + "Converts an (IPv4) Internet network address into a string in Internet standard dotted format" + ], + "lstat": [ + "array lstat(string filename)", + "Give information about a file or symbolic link" + ], + "ltrim": [ + "string ltrim(string str [, string character_mask])", + "Strips whitespace from the beginning of a string" + ], + "mail": [ + "int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])", + "Send an email message" + ], + "max": [ + "mixed max(mixed arg1 [, mixed arg2 [, mixed ...]])", + "Return the highest value in an array or a series of arguments" + ], + "mb_check_encoding": [ + "bool mb_check_encoding([string var[, string encoding]])", + "Check if the string is valid for the specified encoding" + ], + "mb_convert_case": [ + "string mb_convert_case(string sourcestring, int mode [, string encoding])", + "Returns a case-folded version of sourcestring" + ], + "mb_convert_encoding": [ + "string mb_convert_encoding(string str, string to-encoding [, mixed from-encoding])", + "Returns converted string in desired encoding" + ], + "mb_convert_kana": [ + "string mb_convert_kana(string str [, string option] [, string encoding])", + "Conversion between full-width character and half-width character (Japanese)" + ], + "mb_convert_variables": [ + "string mb_convert_variables(string to-encoding, mixed from-encoding, mixed vars [, ...])", + "Converts the string resource in variables to desired encoding" + ], + "mb_decode_mimeheader": [ + "string mb_decode_mimeheader(string string)", + "Decodes the MIME \"encoded-word\" in the string" + ], + "mb_decode_numericentity": [ + "string mb_decode_numericentity(string string, array convmap [, string encoding])", + "Converts HTML numeric entities to character code" + ], + "mb_detect_encoding": [ + "string mb_detect_encoding(string str [, mixed encoding_list [, bool strict]])", + "Encodings of the given string is returned (as a string)" + ], + "mb_detect_order": [ + "bool|array mb_detect_order([mixed encoding-list])", + "Sets the current detect_order or Return the current detect_order as a array" + ], + "mb_encode_mimeheader": [ + "string mb_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed [, int indent]]]])", + "Converts the string to MIME \"encoded-word\" in the format of =?charset?(B|Q)?encoded_string?=" + ], + "mb_encode_numericentity": [ + "string mb_encode_numericentity(string string, array convmap [, string encoding])", + "Converts specified characters to HTML numeric entities" + ], + "mb_encoding_aliases": [ + "array mb_encoding_aliases(string encoding)", + "Returns an array of the aliases of a given encoding name" + ], + "mb_ereg": [ + "int mb_ereg(string pattern, string string [, array registers])", + "Regular expression match for multibyte string" + ], + "mb_ereg_match": [ + "bool mb_ereg_match(string pattern, string string [,string option])", + "Regular expression match for multibyte string" + ], + "mb_ereg_replace": [ + "string mb_ereg_replace(string pattern, string replacement, string string [, string option])", + "Replace regular expression for multibyte string" + ], + "mb_ereg_search": [ + "bool mb_ereg_search([string pattern[, string option]])", + "Regular expression search for multibyte string" + ], + "mb_ereg_search_getpos": [ + "int mb_ereg_search_getpos(void)", + "Get search start position" + ], + "mb_ereg_search_getregs": [ + "array mb_ereg_search_getregs(void)", + "Get matched substring of the last time" + ], + "mb_ereg_search_init": [ + "bool mb_ereg_search_init(string string [, string pattern[, string option]])", + "Initialize string and regular expression for search." + ], + "mb_ereg_search_pos": [ + "array mb_ereg_search_pos([string pattern[, string option]])", + "Regular expression search for multibyte string" + ], + "mb_ereg_search_regs": [ + "array mb_ereg_search_regs([string pattern[, string option]])", + "Regular expression search for multibyte string" + ], + "mb_ereg_search_setpos": [ + "bool mb_ereg_search_setpos(int position)", + "Set search start position" + ], + "mb_eregi": [ + "int mb_eregi(string pattern, string string [, array registers])", + "Case-insensitive regular expression match for multibyte string" + ], + "mb_eregi_replace": [ + "string mb_eregi_replace(string pattern, string replacement, string string)", + "Case insensitive replace regular expression for multibyte string" + ], + "mb_get_info": [ + "mixed mb_get_info([string type])", + "Returns the current settings of mbstring" + ], + "mb_http_input": [ + "mixed mb_http_input([string type])", + "Returns the input encoding" + ], + "mb_http_output": [ + "string mb_http_output([string encoding])", + "Sets the current output_encoding or returns the current output_encoding as a string" + ], + "mb_internal_encoding": [ + "string mb_internal_encoding([string encoding])", + "Sets the current internal encoding or Returns the current internal encoding as a string" + ], + "mb_language": [ + "string mb_language([string language])", + "Sets the current language or Returns the current language as a string" + ], + "mb_list_encodings": [ + "mixed mb_list_encodings()", + "Returns an array of all supported entity encodings" + ], + "mb_output_handler": [ + "string mb_output_handler(string contents, int status)", + "Returns string in output buffer converted to the http_output encoding" + ], + "mb_parse_str": [ + "bool mb_parse_str(string encoded_string [, array result])", + "Parses GET/POST/COOKIE data and sets global variables" + ], + "mb_preferred_mime_name": [ + "string mb_preferred_mime_name(string encoding)", + "Return the preferred MIME name (charset) as a string" + ], + "mb_regex_encoding": [ + "string mb_regex_encoding([string encoding])", + "Returns the current encoding for regex as a string." + ], + "mb_regex_set_options": [ + "string mb_regex_set_options([string options])", + "Set or get the default options for mbregex functions" + ], + "mb_send_mail": [ + "int mb_send_mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])", + "* Sends an email message with MIME scheme" + ], + "mb_split": [ + "array mb_split(string pattern, string string [, int limit])", + "split multibyte string into array by regular expression" + ], + "mb_strcut": [ + "string mb_strcut(string str, int start [, int length [, string encoding]])", + "Returns part of a string" + ], + "mb_strimwidth": [ + "string mb_strimwidth(string str, int start, int width [, string trimmarker [, string encoding]])", + "Trim the string in terminal width" + ], + "mb_stripos": [ + "int mb_stripos(string haystack, string needle [, int offset [, string encoding]])", + "Finds position of first occurrence of a string within another, case insensitive" + ], + "mb_stristr": [ + "string mb_stristr(string haystack, string needle[, bool part[, string encoding]])", + "Finds first occurrence of a string within another, case insensitive" + ], + "mb_strlen": [ + "int mb_strlen(string str [, string encoding])", + "Get character numbers of a string" + ], + "mb_strpos": [ + "int mb_strpos(string haystack, string needle [, int offset [, string encoding]])", + "Find position of first occurrence of a string within another" + ], + "mb_strrchr": [ + "string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])", + "Finds the last occurrence of a character in a string within another" + ], + "mb_strrichr": [ + "string mb_strrichr(string haystack, string needle[, bool part[, string encoding]])", + "Finds the last occurrence of a character in a string within another, case insensitive" + ], + "mb_strripos": [ + "int mb_strripos(string haystack, string needle [, int offset [, string encoding]])", + "Finds position of last occurrence of a string within another, case insensitive" + ], + "mb_strrpos": [ + "int mb_strrpos(string haystack, string needle [, int offset [, string encoding]])", + "Find position of last occurrence of a string within another" + ], + "mb_strstr": [ + "string mb_strstr(string haystack, string needle[, bool part[, string encoding]])", + "Finds first occurrence of a string within another" + ], + "mb_strtolower": [ + "string mb_strtolower(string sourcestring [, string encoding])", + "* Returns a lowercased version of sourcestring" + ], + "mb_strtoupper": [ + "string mb_strtoupper(string sourcestring [, string encoding])", + "* Returns a uppercased version of sourcestring" + ], + "mb_strwidth": [ + "int mb_strwidth(string str [, string encoding])", + "Gets terminal width of a string" + ], + "mb_substitute_character": [ + "mixed mb_substitute_character([mixed substchar])", + "Sets the current substitute_character or returns the current substitute_character" + ], + "mb_substr": [ + "string mb_substr(string str, int start [, int length [, string encoding]])", + "Returns part of a string" + ], + "mb_substr_count": [ + "int mb_substr_count(string haystack, string needle [, string encoding])", + "Count the number of substring occurrences" + ], + "mcrypt_cbc": [ + "string mcrypt_cbc(int cipher, string key, string data, int mode, string iv)", + "CBC crypt/decrypt data using key key with cipher cipher starting with iv" + ], + "mcrypt_cfb": [ + "string mcrypt_cfb(int cipher, string key, string data, int mode, string iv)", + "CFB crypt/decrypt data using key key with cipher cipher starting with iv" + ], + "mcrypt_create_iv": [ + "string mcrypt_create_iv(int size, int source)", + "Create an initialization vector (IV)" + ], + "mcrypt_decrypt": [ + "string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)", + "OFB crypt/decrypt data using key key with cipher cipher starting with iv" + ], + "mcrypt_ecb": [ + "string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)", + "ECB crypt/decrypt data using key key with cipher cipher starting with iv" + ], + "mcrypt_enc_get_algorithms_name": [ + "string mcrypt_enc_get_algorithms_name(resource td)", + "Returns the name of the algorithm specified by the descriptor td" + ], + "mcrypt_enc_get_block_size": [ + "int mcrypt_enc_get_block_size(resource td)", + "Returns the block size of the cipher specified by the descriptor td" + ], + "mcrypt_enc_get_iv_size": [ + "int mcrypt_enc_get_iv_size(resource td)", + "Returns the size of the IV in bytes of the algorithm specified by the descriptor td" + ], + "mcrypt_enc_get_key_size": [ + "int mcrypt_enc_get_key_size(resource td)", + "Returns the maximum supported key size in bytes of the algorithm specified by the descriptor td" + ], + "mcrypt_enc_get_modes_name": [ + "string mcrypt_enc_get_modes_name(resource td)", + "Returns the name of the mode specified by the descriptor td" + ], + "mcrypt_enc_get_supported_key_sizes": [ + "array mcrypt_enc_get_supported_key_sizes(resource td)", + "This function decrypts the crypttext" + ], + "mcrypt_enc_is_block_algorithm": [ + "bool mcrypt_enc_is_block_algorithm(resource td)", + "Returns TRUE if the alrogithm is a block algorithms" + ], + "mcrypt_enc_is_block_algorithm_mode": [ + "bool mcrypt_enc_is_block_algorithm_mode(resource td)", + "Returns TRUE if the mode is for use with block algorithms" + ], + "mcrypt_enc_is_block_mode": [ + "bool mcrypt_enc_is_block_mode(resource td)", + "Returns TRUE if the mode outputs blocks" + ], + "mcrypt_enc_self_test": [ + "int mcrypt_enc_self_test(resource td)", + "This function runs the self test on the algorithm specified by the descriptor td" + ], + "mcrypt_encrypt": [ + "string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)", + "OFB crypt/decrypt data using key key with cipher cipher starting with iv" + ], + "mcrypt_generic": [ + "string mcrypt_generic(resource td, string data)", + "This function encrypts the plaintext" + ], + "mcrypt_generic_deinit": [ + "bool mcrypt_generic_deinit(resource td)", + "This function terminates encrypt specified by the descriptor td" + ], + "mcrypt_generic_init": [ + "int mcrypt_generic_init(resource td, string key, string iv)", + "This function initializes all buffers for the specific module" + ], + "mcrypt_get_block_size": [ + "int mcrypt_get_block_size(string cipher, string module)", + "Get the key size of cipher" + ], + "mcrypt_get_cipher_name": [ + "string mcrypt_get_cipher_name(string cipher)", + "Get the key size of cipher" + ], + "mcrypt_get_iv_size": [ + "int mcrypt_get_iv_size(string cipher, string module)", + "Get the IV size of cipher (Usually the same as the blocksize)" + ], + "mcrypt_get_key_size": [ + "int mcrypt_get_key_size(string cipher, string module)", + "Get the key size of cipher" + ], + "mcrypt_list_algorithms": [ + "array mcrypt_list_algorithms([string lib_dir])", + "List all algorithms in \"module_dir\"" + ], + "mcrypt_list_modes": [ + "array mcrypt_list_modes([string lib_dir])", + "List all modes \"module_dir\"" + ], + "mcrypt_module_close": [ + "bool mcrypt_module_close(resource td)", + "Free the descriptor td" + ], + "mcrypt_module_get_algo_block_size": [ + "int mcrypt_module_get_algo_block_size(string algorithm [, string lib_dir])", + "Returns the block size of the algorithm" + ], + "mcrypt_module_get_algo_key_size": [ + "int mcrypt_module_get_algo_key_size(string algorithm [, string lib_dir])", + "Returns the maximum supported key size of the algorithm" + ], + "mcrypt_module_get_supported_key_sizes": [ + "array mcrypt_module_get_supported_key_sizes(string algorithm [, string lib_dir])", + "This function decrypts the crypttext" + ], + "mcrypt_module_is_block_algorithm": [ + "bool mcrypt_module_is_block_algorithm(string algorithm [, string lib_dir])", + "Returns TRUE if the algorithm is a block algorithm" + ], + "mcrypt_module_is_block_algorithm_mode": [ + "bool mcrypt_module_is_block_algorithm_mode(string mode [, string lib_dir])", + "Returns TRUE if the mode is for use with block algorithms" + ], + "mcrypt_module_is_block_mode": [ + "bool mcrypt_module_is_block_mode(string mode [, string lib_dir])", + "Returns TRUE if the mode outputs blocks of bytes" + ], + "mcrypt_module_open": [ + "resource mcrypt_module_open(string cipher, string cipher_directory, string mode, string mode_directory)", + "Opens the module of the algorithm and the mode to be used" + ], + "mcrypt_module_self_test": [ + "bool mcrypt_module_self_test(string algorithm [, string lib_dir])", + "Does a self test of the module \"module\"" + ], + "mcrypt_ofb": [ + "string mcrypt_ofb(int cipher, string key, string data, int mode, string iv)", + "OFB crypt/decrypt data using key key with cipher cipher starting with iv" + ], + "md5": [ + "string md5(string str, [ bool raw_output])", + "Calculate the md5 hash of a string" + ], + "md5_file": [ + "string md5_file(string filename [, bool raw_output])", + "Calculate the md5 hash of given filename" + ], + "mdecrypt_generic": [ + "string mdecrypt_generic(resource td, string data)", + "This function decrypts the plaintext" + ], + "memory_get_peak_usage": [ + "int memory_get_peak_usage([real_usage])", + "Returns the peak allocated by PHP memory" + ], + "memory_get_usage": [ + "int memory_get_usage([real_usage])", + "Returns the allocated by PHP memory" + ], + "metaphone": [ + "string metaphone(string text[, int phones])", + "Break english phrases down into their phonemes" + ], + "method_exists": [ + "bool method_exists(object object, string method)", + "Checks if the class method exists" + ], + "mhash": [ + "string mhash(int hash, string data [, string key])", + "Hash data with hash" + ], + "mhash_count": [ + "int mhash_count(void)", + "Gets the number of available hashes" + ], + "mhash_get_block_size": [ + "int mhash_get_block_size(int hash)", + "Gets the block size of hash" + ], + "mhash_get_hash_name": [ + "string mhash_get_hash_name(int hash)", + "Gets the name of hash" + ], + "mhash_keygen_s2k": [ + "string mhash_keygen_s2k(int hash, string input_password, string salt, int bytes)", + "Generates a key using hash functions" + ], + "microtime": [ + "mixed microtime([bool get_as_float])", + "Returns either a string or a float containing the current time in seconds and microseconds" + ], + "mime_content_type": [ + "string mime_content_type(string filename|resource stream)", + "Return content-type for file" + ], + "min": [ + "mixed min(mixed arg1 [, mixed arg2 [, mixed ...]])", + "Return the lowest value in an array or a series of arguments" + ], + "mkdir": [ + "bool mkdir(string pathname [, int mode [, bool recursive [, resource context]]])", + "Create a directory" + ], + "mktime": [ + "int mktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])", + "Get UNIX timestamp for a date" + ], + "money_format": [ + "string money_format(string format , float value)", + "Convert monetary value(s) to string" + ], + "move_uploaded_file": [ + "bool move_uploaded_file(string path, string new_path)", + "Move a file if and only if it was created by an upload" + ], + "msg_get_queue": [ + "resource msg_get_queue(int key [, int perms])", + "Attach to a message queue" + ], + "msg_queue_exists": [ + "bool msg_queue_exists(int key)", + "Check wether a message queue exists" + ], + "msg_receive": [ + "mixed msg_receive(resource queue, int desiredmsgtype, int &msgtype, int maxsize, mixed message [, bool unserialize=true [, int flags=0 [, int errorcode]]])", + "Send a message of type msgtype (must be > 0) to a message queue" + ], + "msg_remove_queue": [ + "bool msg_remove_queue(resource queue)", + "Destroy the queue" + ], + "msg_send": [ + "bool msg_send(resource queue, int msgtype, mixed message [, bool serialize=true [, bool blocking=true [, int errorcode]]])", + "Send a message of type msgtype (must be > 0) to a message queue" + ], + "msg_set_queue": [ + "bool msg_set_queue(resource queue, array data)", + "Set information for a message queue" + ], + "msg_stat_queue": [ + "array msg_stat_queue(resource queue)", + "Returns information about a message queue" + ], + "msgfmt_create": [ + "MessageFormatter msgfmt_create( string $locale, string $pattern )", + "* Create formatter." + ], + "msgfmt_format": [ + "mixed msgfmt_format( MessageFormatter $nf, array $args )", + "* Format a message." + ], + "msgfmt_format_message": [ + "mixed msgfmt_format_message( string $locale, string $pattern, array $args )", + "* Format a message." + ], + "msgfmt_get_error_code": [ + "int msgfmt_get_error_code( MessageFormatter $nf )", + "* Get formatter's last error code." + ], + "msgfmt_get_error_message": [ + "string msgfmt_get_error_message( MessageFormatter $coll )", + "* Get text description for formatter's last error code." + ], + "msgfmt_get_locale": [ + "string msgfmt_get_locale(MessageFormatter $mf)", + "* Get formatter locale." + ], + "msgfmt_get_pattern": [ + "string msgfmt_get_pattern( MessageFormatter $mf )", + "* Get formatter pattern." + ], + "msgfmt_parse": [ + "array msgfmt_parse( MessageFormatter $nf, string $source )", + "* Parse a message." + ], + "msgfmt_set_pattern": [ + "bool msgfmt_set_pattern( MessageFormatter $mf, string $pattern )", + "* Set formatter pattern." + ], + "mssql_bind": [ + "bool mssql_bind(resource stmt, string param_name, mixed var, int type [, bool is_output [, bool is_null [, int maxlen]]])", + "Adds a parameter to a stored procedure or a remote stored procedure" + ], + "mssql_close": [ + "bool mssql_close([resource conn_id])", + "Closes a connection to a MS-SQL server" + ], + "mssql_connect": [ + "int mssql_connect([string servername [, string username [, string password [, bool new_link]]]])", + "Establishes a connection to a MS-SQL server" + ], + "mssql_data_seek": [ + "bool mssql_data_seek(resource result_id, int offset)", + "Moves the internal row pointer of the MS-SQL result associated with the specified result identifier to pointer to the specified row number" + ], + "mssql_execute": [ + "mixed mssql_execute(resource stmt [, bool skip_results = false])", + "Executes a stored procedure on a MS-SQL server database" + ], + "mssql_fetch_array": [ + "array mssql_fetch_array(resource result_id [, int result_type])", + "Returns an associative array of the current row in the result set specified by result_id" + ], + "mssql_fetch_assoc": [ + "array mssql_fetch_assoc(resource result_id)", + "Returns an associative array of the current row in the result set specified by result_id" + ], + "mssql_fetch_batch": [ + "int mssql_fetch_batch(resource result_index)", + "Returns the next batch of records" + ], + "mssql_fetch_field": [ + "object mssql_fetch_field(resource result_id [, int offset])", + "Gets information about certain fields in a query result" + ], + "mssql_fetch_object": [ + "object mssql_fetch_object(resource result_id)", + "Returns a pseudo-object of the current row in the result set specified by result_id" + ], + "mssql_fetch_row": [ + "array mssql_fetch_row(resource result_id)", + "Returns an array of the current row in the result set specified by result_id" + ], + "mssql_field_length": [ + "int mssql_field_length(resource result_id [, int offset])", + "Get the length of a MS-SQL field" + ], + "mssql_field_name": [ + "string mssql_field_name(resource result_id [, int offset])", + "Returns the name of the field given by offset in the result set given by result_id" + ], + "mssql_field_seek": [ + "bool mssql_field_seek(resource result_id, int offset)", + "Seeks to the specified field offset" + ], + "mssql_field_type": [ + "string mssql_field_type(resource result_id [, int offset])", + "Returns the type of a field" + ], + "mssql_free_result": [ + "bool mssql_free_result(resource result_index)", + "Free a MS-SQL result index" + ], + "mssql_free_statement": [ + "bool mssql_free_statement(resource result_index)", + "Free a MS-SQL statement index" + ], + "mssql_get_last_message": [ + "string mssql_get_last_message(void)", + "Gets the last message from the MS-SQL server" + ], + "mssql_guid_string": [ + "string mssql_guid_string(string binary [,bool short_format])", + "Converts a 16 byte binary GUID to a string" + ], + "mssql_init": [ + "int mssql_init(string sp_name [, resource conn_id])", + "Initializes a stored procedure or a remote stored procedure" + ], + "mssql_min_error_severity": [ + "void mssql_min_error_severity(int severity)", + "Sets the lower error severity" + ], + "mssql_min_message_severity": [ + "void mssql_min_message_severity(int severity)", + "Sets the lower message severity" + ], + "mssql_next_result": [ + "bool mssql_next_result(resource result_id)", + "Move the internal result pointer to the next result" + ], + "mssql_num_fields": [ + "int mssql_num_fields(resource mssql_result_index)", + "Returns the number of fields fetched in from the result id specified" + ], + "mssql_num_rows": [ + "int mssql_num_rows(resource mssql_result_index)", + "Returns the number of rows fetched in from the result id specified" + ], + "mssql_pconnect": [ + "int mssql_pconnect([string servername [, string username [, string password [, bool new_link]]]])", + "Establishes a persistent connection to a MS-SQL server" + ], + "mssql_query": [ + "resource mssql_query(string query [, resource conn_id [, int batch_size]])", + "Perform an SQL query on a MS-SQL server database" + ], + "mssql_result": [ + "string mssql_result(resource result_id, int row, mixed field)", + "Returns the contents of one cell from a MS-SQL result set" + ], + "mssql_rows_affected": [ + "int mssql_rows_affected(resource conn_id)", + "Returns the number of records affected by the query" + ], + "mssql_select_db": [ + "bool mssql_select_db(string database_name [, resource conn_id])", + "Select a MS-SQL database" + ], + "mt_getrandmax": [ + "int mt_getrandmax(void)", + "Returns the maximum value a random number from Mersenne Twister can have" + ], + "mt_rand": [ + "int mt_rand([int min, int max])", + "Returns a random number from Mersenne Twister" + ], + "mt_srand": [ + "void mt_srand([int seed])", + "Seeds Mersenne Twister random number generator" + ], + "mysql_affected_rows": [ + "int mysql_affected_rows([int link_identifier])", + "Gets number of affected rows in previous MySQL operation" + ], + "mysql_client_encoding": [ + "string mysql_client_encoding([int link_identifier])", + "Returns the default character set for the current connection" + ], + "mysql_close": [ + "bool mysql_close([int link_identifier])", + "Close a MySQL connection" + ], + "mysql_connect": [ + "resource mysql_connect([string hostname[:port][:/path/to/socket] [, string username [, string password [, bool new [, int flags]]]]])", + "Opens a connection to a MySQL Server" + ], + "mysql_create_db": [ + "bool mysql_create_db(string database_name [, int link_identifier])", + "Create a MySQL database" + ], + "mysql_data_seek": [ + "bool mysql_data_seek(resource result, int row_number)", + "Move internal result pointer" + ], + "mysql_db_query": [ + "resource mysql_db_query(string database_name, string query [, int link_identifier])", + "Sends an SQL query to MySQL" + ], + "mysql_drop_db": [ + "bool mysql_drop_db(string database_name [, int link_identifier])", + "Drops (delete) a MySQL database" + ], + "mysql_errno": [ + "int mysql_errno([int link_identifier])", + "Returns the number of the error message from previous MySQL operation" + ], + "mysql_error": [ + "string mysql_error([int link_identifier])", + "Returns the text of the error message from previous MySQL operation" + ], + "mysql_escape_string": [ + "string mysql_escape_string(string to_be_escaped)", + "Escape string for mysql query" + ], + "mysql_fetch_array": [ + "array mysql_fetch_array(resource result [, int result_type])", + "Fetch a result row as an array (associative, numeric or both)" + ], + "mysql_fetch_assoc": [ + "array mysql_fetch_assoc(resource result)", + "Fetch a result row as an associative array" + ], + "mysql_fetch_field": [ + "object mysql_fetch_field(resource result [, int field_offset])", + "Gets column information from a result and return as an object" + ], + "mysql_fetch_lengths": [ + "array mysql_fetch_lengths(resource result)", + "Gets max data size of each column in a result" + ], + "mysql_fetch_object": [ + "object mysql_fetch_object(resource result [, string class_name [, NULL|array ctor_params]])", + "Fetch a result row as an object" + ], + "mysql_fetch_row": [ + "array mysql_fetch_row(resource result)", + "Gets a result row as an enumerated array" + ], + "mysql_field_flags": [ + "string mysql_field_flags(resource result, int field_offset)", + "Gets the flags associated with the specified field in a result" + ], + "mysql_field_len": [ + "int mysql_field_len(resource result, int field_offset)", + "Returns the length of the specified field" + ], + "mysql_field_name": [ + "string mysql_field_name(resource result, int field_index)", + "Gets the name of the specified field in a result" + ], + "mysql_field_seek": [ + "bool mysql_field_seek(resource result, int field_offset)", + "Sets result pointer to a specific field offset" + ], + "mysql_field_table": [ + "string mysql_field_table(resource result, int field_offset)", + "Gets name of the table the specified field is in" + ], + "mysql_field_type": [ + "string mysql_field_type(resource result, int field_offset)", + "Gets the type of the specified field in a result" + ], + "mysql_free_result": [ + "bool mysql_free_result(resource result)", + "Free result memory" + ], + "mysql_get_client_info": [ + "string mysql_get_client_info(void)", + "Returns a string that represents the client library version" + ], + "mysql_get_host_info": [ + "string mysql_get_host_info([int link_identifier])", + "Returns a string describing the type of connection in use, including the server host name" + ], + "mysql_get_proto_info": [ + "int mysql_get_proto_info([int link_identifier])", + "Returns the protocol version used by current connection" + ], + "mysql_get_server_info": [ + "string mysql_get_server_info([int link_identifier])", + "Returns a string that represents the server version number" + ], + "mysql_info": [ + "string mysql_info([int link_identifier])", + "Returns a string containing information about the most recent query" + ], + "mysql_insert_id": [ + "int mysql_insert_id([int link_identifier])", + "Gets the ID generated from the previous INSERT operation" + ], + "mysql_list_dbs": [ + "resource mysql_list_dbs([int link_identifier])", + "List databases available on a MySQL server" + ], + "mysql_list_fields": [ + "resource mysql_list_fields(string database_name, string table_name [, int link_identifier])", + "List MySQL result fields" + ], + "mysql_list_processes": [ + "resource mysql_list_processes([int link_identifier])", + "Returns a result set describing the current server threads" + ], + "mysql_list_tables": [ + "resource mysql_list_tables(string database_name [, int link_identifier])", + "List tables in a MySQL database" + ], + "mysql_num_fields": [ + "int mysql_num_fields(resource result)", + "Gets number of fields in a result" + ], + "mysql_num_rows": [ + "int mysql_num_rows(resource result)", + "Gets number of rows in a result" + ], + "mysql_pconnect": [ + "resource mysql_pconnect([string hostname[:port][:/path/to/socket] [, string username [, string password [, int flags]]]])", + "Opens a persistent connection to a MySQL Server" + ], + "mysql_ping": [ + "bool mysql_ping([int link_identifier])", + "Ping a server connection. If no connection then reconnect." + ], + "mysql_query": [ + "resource mysql_query(string query [, int link_identifier])", + "Sends an SQL query to MySQL" + ], + "mysql_real_escape_string": [ + "string mysql_real_escape_string(string to_be_escaped [, int link_identifier])", + "Escape special characters in a string for use in a SQL statement, taking into account the current charset of the connection" + ], + "mysql_result": [ + "mixed mysql_result(resource result, int row [, mixed field])", + "Gets result data" + ], + "mysql_select_db": [ + "bool mysql_select_db(string database_name [, int link_identifier])", + "Selects a MySQL database" + ], + "mysql_set_charset": [ + "bool mysql_set_charset(string csname [, int link_identifier])", + "sets client character set" + ], + "mysql_stat": [ + "string mysql_stat([int link_identifier])", + "Returns a string containing status information" + ], + "mysql_thread_id": [ + "int mysql_thread_id([int link_identifier])", + "Returns the thread id of current connection" + ], + "mysql_unbuffered_query": [ + "resource mysql_unbuffered_query(string query [, int link_identifier])", + "Sends an SQL query to MySQL, without fetching and buffering the result rows" + ], + "mysqli_affected_rows": [ + "mixed mysqli_affected_rows(object link)", + "Get number of affected rows in previous MySQL operation" + ], + "mysqli_autocommit": [ + "bool mysqli_autocommit(object link, bool mode)", + "Turn auto commit on or of" + ], + "mysqli_cache_stats": [ + "array mysqli_cache_stats(void)", + "Returns statistics about the zval cache" + ], + "mysqli_change_user": [ + "bool mysqli_change_user(object link, string user, string password, string database)", + "Change logged-in user of the active connection" + ], + "mysqli_character_set_name": [ + "string mysqli_character_set_name(object link)", + "Returns the name of the character set used for this connection" + ], + "mysqli_close": [ + "bool mysqli_close(object link)", + "Close connection" + ], + "mysqli_commit": [ + "bool mysqli_commit(object link)", + "Commit outstanding actions and close transaction" + ], + "mysqli_connect": [ + "object mysqli_connect([string hostname [,string username [,string passwd [,string dbname [,int port [,string socket]]]]]])", + "Open a connection to a mysql server" + ], + "mysqli_connect_errno": [ + "int mysqli_connect_errno(void)", + "Returns the numerical value of the error message from last connect command" + ], + "mysqli_connect_error": [ + "string mysqli_connect_error(void)", + "Returns the text of the error message from previous MySQL operation" + ], + "mysqli_data_seek": [ + "bool mysqli_data_seek(object result, int offset)", + "Move internal result pointer" + ], + "mysqli_debug": [ + "void mysqli_debug(string debug)", + "" + ], + "mysqli_dump_debug_info": [ + "bool mysqli_dump_debug_info(object link)", + "" + ], + "mysqli_embedded_server_end": [ + "void mysqli_embedded_server_end(void)", + "" + ], + "mysqli_embedded_server_start": [ + "bool mysqli_embedded_server_start(bool start, array arguments, array groups)", + "initialize and start embedded server" + ], + "mysqli_errno": [ + "int mysqli_errno(object link)", + "Returns the numerical value of the error message from previous MySQL operation" + ], + "mysqli_error": [ + "string mysqli_error(object link)", + "Returns the text of the error message from previous MySQL operation" + ], + "mysqli_fetch_all": [ + "mixed mysqli_fetch_all (object result [,int resulttype])", + "Fetches all result rows as an associative array, a numeric array, or both" + ], + "mysqli_fetch_array": [ + "mixed mysqli_fetch_array (object result [,int resulttype])", + "Fetch a result row as an associative array, a numeric array, or both" + ], + "mysqli_fetch_assoc": [ + "mixed mysqli_fetch_assoc (object result)", + "Fetch a result row as an associative array" + ], + "mysqli_fetch_field": [ + "mixed mysqli_fetch_field (object result)", + "Get column information from a result and return as an object" + ], + "mysqli_fetch_field_direct": [ + "mixed mysqli_fetch_field_direct (object result, int offset)", + "Fetch meta-data for a single field" + ], + "mysqli_fetch_fields": [ + "mixed mysqli_fetch_fields (object result)", + "Return array of objects containing field meta-data" + ], + "mysqli_fetch_lengths": [ + "mixed mysqli_fetch_lengths (object result)", + "Get the length of each output in a result" + ], + "mysqli_fetch_object": [ + "mixed mysqli_fetch_object (object result [, string class_name [, NULL|array ctor_params]])", + "Fetch a result row as an object" + ], + "mysqli_fetch_row": [ + "array mysqli_fetch_row (object result)", + "Get a result row as an enumerated array" + ], + "mysqli_field_count": [ + "int mysqli_field_count(object link)", + "Fetch the number of fields returned by the last query for the given link" + ], + "mysqli_field_seek": [ + "int mysqli_field_seek(object result, int fieldnr)", + "Set result pointer to a specified field offset" + ], + "mysqli_field_tell": [ + "int mysqli_field_tell(object result)", + "Get current field offset of result pointer" + ], + "mysqli_free_result": [ + "void mysqli_free_result(object result)", + "Free query result memory for the given result handle" + ], + "mysqli_get_charset": [ + "object mysqli_get_charset(object link)", + "returns a character set object" + ], + "mysqli_get_client_info": [ + "string mysqli_get_client_info(void)", + "Get MySQL client info" + ], + "mysqli_get_client_stats": [ + "array mysqli_get_client_stats(void)", + "Returns statistics about the zval cache" + ], + "mysqli_get_client_version": [ + "int mysqli_get_client_version(void)", + "Get MySQL client info" + ], + "mysqli_get_connection_stats": [ + "array mysqli_get_connection_stats(void)", + "Returns statistics about the zval cache" + ], + "mysqli_get_host_info": [ + "string mysqli_get_host_info (object link)", + "Get MySQL host info" + ], + "mysqli_get_proto_info": [ + "int mysqli_get_proto_info(object link)", + "Get MySQL protocol information" + ], + "mysqli_get_server_info": [ + "string mysqli_get_server_info(object link)", + "Get MySQL server info" + ], + "mysqli_get_server_version": [ + "int mysqli_get_server_version(object link)", + "Return the MySQL version for the server referenced by the given link" + ], + "mysqli_get_warnings": [ + "object mysqli_get_warnings(object link) */", + "PHP_FUNCTION(mysqli_get_warnings) { MY_MYSQL *mysql; zval *mysql_link; MYSQLI_RESOURCE *mysqli_resource; MYSQLI_WARNING *w; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), \"O\", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, \"mysqli_link\", MYSQLI_STATUS_VALID); if (mysql_warning_count(mysql->mysql)) { w = php_get_warnings(mysql->mysql TSRMLS_CC); } else { RETURN_FALSE; } mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); mysqli_resource->ptr = mysqli_resource->info = (void *)w; mysqli_resource->status = MYSQLI_STATUS_VALID; MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry); } /* }}}" + ], + "mysqli_info": [ + "string mysqli_info(object link)", + "Get information about the most recent query" + ], + "mysqli_init": [ + "resource mysqli_init(void)", + "Initialize mysqli and return a resource for use with mysql_real_connect" + ], + "mysqli_insert_id": [ + "mixed mysqli_insert_id(object link)", + "Get the ID generated from the previous INSERT operation" + ], + "mysqli_kill": [ + "bool mysqli_kill(object link, int processid)", + "Kill a mysql process on the server" + ], + "mysqli_link_construct": [ + "object mysqli_link_construct()", + "" + ], + "mysqli_more_results": [ + "bool mysqli_more_results(object link)", + "check if there any more query results from a multi query" + ], + "mysqli_multi_query": [ + "bool mysqli_multi_query(object link, string query)", + "allows to execute multiple queries" + ], + "mysqli_next_result": [ + "bool mysqli_next_result(object link)", + "read next result from multi_query" + ], + "mysqli_num_fields": [ + "int mysqli_num_fields(object result)", + "Get number of fields in result" + ], + "mysqli_num_rows": [ + "mixed mysqli_num_rows(object result)", + "Get number of rows in result" + ], + "mysqli_options": [ + "bool mysqli_options(object link, int flags, mixed values)", + "Set options" + ], + "mysqli_ping": [ + "bool mysqli_ping(object link)", + "Ping a server connection or reconnect if there is no connection" + ], + "mysqli_poll": [ + "int mysqli_poll(array read, array write, array error, long sec [, long usec])", + "Poll connections" + ], + "mysqli_prepare": [ + "mixed mysqli_prepare(object link, string query)", + "Prepare a SQL statement for execution" + ], + "mysqli_query": [ + "mixed mysqli_query(object link, string query [,int resultmode]) */", + "PHP_FUNCTION(mysqli_query) { MY_MYSQL *mysql; zval *mysql_link; MYSQLI_RESOURCE *mysqli_resource; MYSQL_RES *result; char *query = NULL; unsigned int query_len; unsigned long resultmode = MYSQLI_STORE_RESULT; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), \"Os|l\", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) { return; } if (!query_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, \"Empty query\"); RETURN_FALSE; } if ((resultmode & ~MYSQLI_ASYNC) != MYSQLI_USE_RESULT && (resultmode & ~MYSQLI_ASYNC) != MYSQLI_STORE_RESULT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, \"Invalid value for resultmode\"); RETURN_FALSE; } MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, \"mysqli_link\", MYSQLI_STATUS_VALID); MYSQLI_DISABLE_MQ; #ifdef MYSQLI_USE_MYSQLND if (resultmode & MYSQLI_ASYNC) { if (mysqli_async_query(mysql->mysql, query, query_len)) { MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); RETURN_FALSE; } mysql->async_result_fetch_type = resultmode & ~MYSQLI_ASYNC; RETURN_TRUE; } #endif if (mysql_real_query(mysql->mysql, query, query_len)) { MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); RETURN_FALSE; } if (!mysql_field_count(mysql->mysql)) { /* no result set - not a SELECT" + ], + "mysqli_real_connect": [ + "bool mysqli_real_connect(object link [,string hostname [,string username [,string passwd [,string dbname [,int port [,string socket [,int flags]]]]]]])", + "Open a connection to a mysql server" + ], + "mysqli_real_escape_string": [ + "string mysqli_real_escape_string(object link, string escapestr)", + "Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection" + ], + "mysqli_real_query": [ + "bool mysqli_real_query(object link, string query)", + "Binary-safe version of mysql_query()" + ], + "mysqli_reap_async_query": [ + "int mysqli_reap_async_query(object link)", + "Poll connections" + ], + "mysqli_refresh": [ + "bool mysqli_refresh(object link, long options)", + "Flush tables or caches, or reset replication server information" + ], + "mysqli_report": [ + "bool mysqli_report(int flags)", + "sets report level" + ], + "mysqli_rollback": [ + "bool mysqli_rollback(object link)", + "Undo actions from current transaction" + ], + "mysqli_select_db": [ + "bool mysqli_select_db(object link, string dbname)", + "Select a MySQL database" + ], + "mysqli_set_charset": [ + "bool mysqli_set_charset(object link, string csname)", + "sets client character set" + ], + "mysqli_set_local_infile_default": [ + "void mysqli_set_local_infile_default(object link)", + "unsets user defined handler for load local infile command" + ], + "mysqli_set_local_infile_handler": [ + "bool mysqli_set_local_infile_handler(object link, callback read_func)", + "Set callback functions for LOAD DATA LOCAL INFILE" + ], + "mysqli_sqlstate": [ + "string mysqli_sqlstate(object link)", + "Returns the SQLSTATE error from previous MySQL operation" + ], + "mysqli_ssl_set": [ + "bool mysqli_ssl_set(object link ,string key ,string cert ,string ca ,string capath ,string cipher])", + "" + ], + "mysqli_stat": [ + "mixed mysqli_stat(object link)", + "Get current system status" + ], + "mysqli_stmt_affected_rows": [ + "mixed mysqli_stmt_affected_rows(object stmt)", + "Return the number of rows affected in the last query for the given link" + ], + "mysqli_stmt_attr_get": [ + "int mysqli_stmt_attr_get(object stmt, long attr)", + "" + ], + "mysqli_stmt_attr_set": [ + "int mysqli_stmt_attr_set(object stmt, long attr, long mode)", + "" + ], + "mysqli_stmt_bind_param": [ + "bool mysqli_stmt_bind_param(object stmt, string types, mixed variable [,mixed,....])", + "Bind variables to a prepared statement as parameters" + ], + "mysqli_stmt_bind_result": [ + "bool mysqli_stmt_bind_result(object stmt, mixed var, [,mixed, ...])", + "Bind variables to a prepared statement for result storage" + ], + "mysqli_stmt_close": [ + "bool mysqli_stmt_close(object stmt)", + "Close statement" + ], + "mysqli_stmt_data_seek": [ + "void mysqli_stmt_data_seek(object stmt, int offset)", + "Move internal result pointer" + ], + "mysqli_stmt_errno": [ + "int mysqli_stmt_errno(object stmt)", + "" + ], + "mysqli_stmt_error": [ + "string mysqli_stmt_error(object stmt)", + "" + ], + "mysqli_stmt_execute": [ + "bool mysqli_stmt_execute(object stmt)", + "Execute a prepared statement" + ], + "mysqli_stmt_fetch": [ + "mixed mysqli_stmt_fetch(object stmt)", + "Fetch results from a prepared statement into the bound variables" + ], + "mysqli_stmt_field_count": [ + "int mysqli_stmt_field_count(object stmt) {", + "Return the number of result columns for the given statement" + ], + "mysqli_stmt_free_result": [ + "void mysqli_stmt_free_result(object stmt)", + "Free stored result memory for the given statement handle" + ], + "mysqli_stmt_get_result": [ + "object mysqli_stmt_get_result(object link)", + "Buffer result set on client" + ], + "mysqli_stmt_get_warnings": [ + "object mysqli_stmt_get_warnings(object link) */", + "PHP_FUNCTION(mysqli_stmt_get_warnings) { MY_STMT *stmt; zval *stmt_link; MYSQLI_RESOURCE *mysqli_resource; MYSQLI_WARNING *w; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), \"O\", &stmt_link, mysqli_stmt_class_entry) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE(stmt, MY_STMT*, &stmt_link, \"mysqli_stmt\", MYSQLI_STATUS_VALID); if (mysqli_stmt_warning_count(stmt->stmt)) { w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt) TSRMLS_CC); } else { RETURN_FALSE; } mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); mysqli_resource->ptr = mysqli_resource->info = (void *)w; mysqli_resource->status = MYSQLI_STATUS_VALID; MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry); } /* }}}" + ], + "mysqli_stmt_init": [ + "mixed mysqli_stmt_init(object link)", + "Initialize statement object" + ], + "mysqli_stmt_insert_id": [ + "mixed mysqli_stmt_insert_id(object stmt)", + "Get the ID generated from the previous INSERT operation" + ], + "mysqli_stmt_next_result": [ + "bool mysqli_stmt_next_result(object link)", + "read next result from multi_query" + ], + "mysqli_stmt_num_rows": [ + "mixed mysqli_stmt_num_rows(object stmt)", + "Return the number of rows in statements result set" + ], + "mysqli_stmt_param_count": [ + "int mysqli_stmt_param_count(object stmt)", + "Return the number of parameter for the given statement" + ], + "mysqli_stmt_prepare": [ + "bool mysqli_stmt_prepare(object stmt, string query)", + "prepare server side statement with query" + ], + "mysqli_stmt_reset": [ + "bool mysqli_stmt_reset(object stmt)", + "reset a prepared statement" + ], + "mysqli_stmt_result_metadata": [ + "mixed mysqli_stmt_result_metadata(object stmt)", + "return result set from statement" + ], + "mysqli_stmt_send_long_data": [ + "bool mysqli_stmt_send_long_data(object stmt, int param_nr, string data)", + "" + ], + "mysqli_stmt_sqlstate": [ + "string mysqli_stmt_sqlstate(object stmt)", + "" + ], + "mysqli_stmt_store_result": [ + "bool mysqli_stmt_store_result(stmt)", + "" + ], + "mysqli_store_result": [ + "object mysqli_store_result(object link)", + "Buffer result set on client" + ], + "mysqli_thread_id": [ + "int mysqli_thread_id(object link)", + "Return the current thread ID" + ], + "mysqli_thread_safe": [ + "bool mysqli_thread_safe(void)", + "Return whether thread safety is given or not" + ], + "mysqli_use_result": [ + "mixed mysqli_use_result(object link)", + "Directly retrieve query results - do not buffer results on client side" + ], + "mysqli_warning_count": [ + "int mysqli_warning_count (object link)", + "Return number of warnings from the last query for the given link" + ], + "natcasesort": [ + "void natcasesort(array &array_arg)", + "Sort an array using case-insensitive natural sort" + ], + "natsort": [ + "void natsort(array &array_arg)", + "Sort an array using natural sort" + ], + "next": [ + "mixed next(array array_arg)", + "Move array argument's internal pointer to the next element and return it" + ], + "ngettext": [ + "string ngettext(string MSGID1, string MSGID2, int N)", + "Plural version of gettext()" + ], + "nl2br": [ + "string nl2br(string str [, bool is_xhtml])", + "Converts newlines to HTML line breaks" + ], + "nl_langinfo": [ + "string nl_langinfo(int item)", + "Query language and locale information" + ], + "normalizer_is_normalize": [ + "bool normalizer_is_normalize( string $input [, string $form = FORM_C] )", + "* Test if a string is in a given normalization form." + ], + "normalizer_normalize": [ + "string normalizer_normalize( string $input [, string $form = FORM_C] )", + "* Normalize a string." + ], + "nsapi_request_headers": [ + "array nsapi_request_headers(void)", + "Get all headers from the request" + ], + "nsapi_response_headers": [ + "array nsapi_response_headers(void)", + "Get all headers from the response" + ], + "nsapi_virtual": [ + "bool nsapi_virtual(string uri)", + "Perform an NSAPI sub-request" + ], + "number_format": [ + "string number_format(float number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]])", + "Formats a number with grouped thousands" + ], + "numfmt_create": [ + "NumberFormatter numfmt_create( string $locale, int style[, string $pattern ] )", + "* Create number formatter." + ], + "numfmt_format": [ + "mixed numfmt_format( NumberFormatter $nf, mixed $num[, int type] )", + "* Format a number." + ], + "numfmt_format_currency": [ + "mixed numfmt_format_currency( NumberFormatter $nf, double $num, string $currency )", + "* Format a number as currency." + ], + "numfmt_get_attribute": [ + "mixed numfmt_get_attribute( NumberFormatter $nf, int $attr )", + "* Get formatter attribute value." + ], + "numfmt_get_error_code": [ + "int numfmt_get_error_code( NumberFormatter $nf )", + "* Get formatter's last error code." + ], + "numfmt_get_error_message": [ + "string numfmt_get_error_message( NumberFormatter $nf )", + "* Get text description for formatter's last error code." + ], + "numfmt_get_locale": [ + "string numfmt_get_locale( NumberFormatter $nf[, int type] )", + "* Get formatter locale." + ], + "numfmt_get_pattern": [ + "string numfmt_get_pattern( NumberFormatter $nf )", + "* Get formatter pattern." + ], + "numfmt_get_symbol": [ + "string numfmt_get_symbol( NumberFormatter $nf, int $attr )", + "* Get formatter symbol value." + ], + "numfmt_get_text_attribute": [ + "string numfmt_get_text_attribute( NumberFormatter $nf, int $attr )", + "* Get formatter attribute value." + ], + "numfmt_parse": [ + "mixed numfmt_parse( NumberFormatter $nf, string $str[, int $type, int &$position ])", + "* Parse a number." + ], + "numfmt_parse_currency": [ + "double numfmt_parse_currency( NumberFormatter $nf, string $str, string $¤cy[, int $&position] )", + "* Parse a number as currency." + ], + "numfmt_parse_message": [ + "array numfmt_parse_message( string $locale, string $pattern, string $source )", + "* Parse a message." + ], + "numfmt_set_attribute": [ + "bool numfmt_set_attribute( NumberFormatter $nf, int $attr, mixed $value )", + "* Get formatter attribute value." + ], + "numfmt_set_pattern": [ + "bool numfmt_set_pattern( NumberFormatter $nf, string $pattern )", + "* Set formatter pattern." + ], + "numfmt_set_symbol": [ + "bool numfmt_set_symbol( NumberFormatter $nf, int $attr, string $symbol )", + "* Set formatter symbol value." + ], + "numfmt_set_text_attribute": [ + "bool numfmt_set_text_attribute( NumberFormatter $nf, int $attr, string $value )", + "* Get formatter attribute value." + ], + "ob_clean": [ + "bool ob_clean(void)", + "Clean (delete) the current output buffer" + ], + "ob_end_clean": [ + "bool ob_end_clean(void)", + "Clean the output buffer, and delete current output buffer" + ], + "ob_end_flush": [ + "bool ob_end_flush(void)", + "Flush (send) the output buffer, and delete current output buffer" + ], + "ob_flush": [ + "bool ob_flush(void)", + "Flush (send) contents of the output buffer. The last buffer content is sent to next buffer" + ], + "ob_get_clean": [ + "bool ob_get_clean(void)", + "Get current buffer contents and delete current output buffer" + ], + "ob_get_contents": [ + "string ob_get_contents(void)", + "Return the contents of the output buffer" + ], + "ob_get_flush": [ + "bool ob_get_flush(void)", + "Get current buffer contents, flush (send) the output buffer, and delete current output buffer" + ], + "ob_get_length": [ + "int ob_get_length(void)", + "Return the length of the output buffer" + ], + "ob_get_level": [ + "int ob_get_level(void)", + "Return the nesting level of the output buffer" + ], + "ob_get_status": [ + "false|array ob_get_status([bool full_status])", + "Return the status of the active or all output buffers" + ], + "ob_gzhandler": [ + "string ob_gzhandler(string str, int mode)", + "Encode str based on accept-encoding setting - designed to be called from ob_start()" + ], + "ob_iconv_handler": [ + "string ob_iconv_handler(string contents, int status)", + "Returns str in output buffer converted to the iconv.output_encoding character set" + ], + "ob_implicit_flush": [ + "void ob_implicit_flush([int flag])", + "Turn implicit flush on/off and is equivalent to calling flush() after every output call" + ], + "ob_list_handlers": [ + "false|array ob_list_handlers()", + "* List all output_buffers in an array" + ], + "ob_start": [ + "bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])", + "Turn on Output Buffering (specifying an optional output handler)." + ], + "oci_bind_array_by_name": [ + "bool oci_bind_array_by_name(resource stmt, string name, array &var, int max_table_length [, int max_item_length [, int type ]])", + "Bind a PHP array to an Oracle PL/SQL type by name" + ], + "oci_bind_by_name": [ + "bool oci_bind_by_name(resource stmt, string name, mixed &var, [, int maxlength [, int type]])", + "Bind a PHP variable to an Oracle placeholder by name" + ], + "oci_cancel": [ + "bool oci_cancel(resource stmt)", + "Cancel reading from a cursor" + ], + "oci_close": [ + "bool oci_close(resource connection)", + "Disconnect from database" + ], + "oci_collection_append": [ + "bool oci_collection_append(string value)", + "Append an object to the collection" + ], + "oci_collection_assign": [ + "bool oci_collection_assign(object from)", + "Assign a collection from another existing collection" + ], + "oci_collection_element_assign": [ + "bool oci_collection_element_assign(int index, string val)", + "Assign element val to collection at index ndx" + ], + "oci_collection_element_get": [ + "string oci_collection_element_get(int ndx)", + "Retrieve the value at collection index ndx" + ], + "oci_collection_max": [ + "int oci_collection_max()", + "Return the max value of a collection. For a varray this is the maximum length of the array" + ], + "oci_collection_size": [ + "int oci_collection_size()", + "Return the size of a collection" + ], + "oci_collection_trim": [ + "bool oci_collection_trim(int num)", + "Trim num elements from the end of a collection" + ], + "oci_commit": [ + "bool oci_commit(resource connection)", + "Commit the current context" + ], + "oci_connect": [ + "resource oci_connect(string user, string pass [, string db [, string charset [, int session_mode ]])", + "Connect to an Oracle database and log on. Returns a new session." + ], + "oci_define_by_name": [ + "bool oci_define_by_name(resource stmt, string name, mixed &var [, int type])", + "Define a PHP variable to an Oracle column by name" + ], + "oci_error": [ + "array oci_error([resource stmt|connection|global])", + "Return the last error of stmt|connection|global. If no error happened returns false." + ], + "oci_execute": [ + "bool oci_execute(resource stmt [, int mode])", + "Execute a parsed statement" + ], + "oci_fetch": [ + "bool oci_fetch(resource stmt)", + "Prepare a new row of data for reading" + ], + "oci_fetch_all": [ + "int oci_fetch_all(resource stmt, array &output[, int skip[, int maxrows[, int flags]]])", + "Fetch all rows of result data into an array" + ], + "oci_fetch_array": [ + "array oci_fetch_array( resource stmt [, int mode ])", + "Fetch a result row as an array" + ], + "oci_fetch_assoc": [ + "array oci_fetch_assoc( resource stmt )", + "Fetch a result row as an associative array" + ], + "oci_fetch_object": [ + "object oci_fetch_object( resource stmt )", + "Fetch a result row as an object" + ], + "oci_fetch_row": [ + "array oci_fetch_row( resource stmt )", + "Fetch a result row as an enumerated array" + ], + "oci_field_is_null": [ + "bool oci_field_is_null(resource stmt, int col)", + "Tell whether a column is NULL" + ], + "oci_field_name": [ + "string oci_field_name(resource stmt, int col)", + "Tell the name of a column" + ], + "oci_field_precision": [ + "int oci_field_precision(resource stmt, int col)", + "Tell the precision of a column" + ], + "oci_field_scale": [ + "int oci_field_scale(resource stmt, int col)", + "Tell the scale of a column" + ], + "oci_field_size": [ + "int oci_field_size(resource stmt, int col)", + "Tell the maximum data size of a column" + ], + "oci_field_type": [ + "mixed oci_field_type(resource stmt, int col)", + "Tell the data type of a column" + ], + "oci_field_type_raw": [ + "int oci_field_type_raw(resource stmt, int col)", + "Tell the raw oracle data type of a column" + ], + "oci_free_collection": [ + "bool oci_free_collection()", + "Deletes collection object" + ], + "oci_free_descriptor": [ + "bool oci_free_descriptor()", + "Deletes large object description" + ], + "oci_free_statement": [ + "bool oci_free_statement(resource stmt)", + "Free all resources associated with a statement" + ], + "oci_internal_debug": [ + "void oci_internal_debug(int onoff)", + "Toggle internal debugging output for the OCI extension" + ], + "oci_lob_append": [ + "bool oci_lob_append( object lob )", + "Appends data from a LOB to another LOB" + ], + "oci_lob_close": [ + "bool oci_lob_close()", + "Closes lob descriptor" + ], + "oci_lob_copy": [ + "bool oci_lob_copy( object lob_to, object lob_from [, int length ] )", + "Copies data from a LOB to another LOB" + ], + "oci_lob_eof": [ + "bool oci_lob_eof()", + "Checks if EOF is reached" + ], + "oci_lob_erase": [ + "int oci_lob_erase( [ int offset [, int length ] ] )", + "Erases a specified portion of the internal LOB, starting at a specified offset" + ], + "oci_lob_export": [ + "bool oci_lob_export([string filename [, int start [, int length]]])", + "Writes a large object into a file" + ], + "oci_lob_flush": [ + "bool oci_lob_flush( [ int flag ] )", + "Flushes the LOB buffer" + ], + "oci_lob_import": [ + "bool oci_lob_import( string filename )", + "Loads file into a LOB" + ], + "oci_lob_is_equal": [ + "bool oci_lob_is_equal( object lob1, object lob2 )", + "Tests to see if two LOB/FILE locators are equal" + ], + "oci_lob_load": [ + "string oci_lob_load()", + "Loads a large object" + ], + "oci_lob_read": [ + "string oci_lob_read( int length )", + "Reads particular part of a large object" + ], + "oci_lob_rewind": [ + "bool oci_lob_rewind()", + "Rewind pointer of a LOB" + ], + "oci_lob_save": [ + "bool oci_lob_save( string data [, int offset ])", + "Saves a large object" + ], + "oci_lob_seek": [ + "bool oci_lob_seek( int offset [, int whence ])", + "Moves the pointer of a LOB" + ], + "oci_lob_size": [ + "int oci_lob_size()", + "Returns size of a large object" + ], + "oci_lob_tell": [ + "int oci_lob_tell()", + "Tells LOB pointer position" + ], + "oci_lob_truncate": [ + "bool oci_lob_truncate( [ int length ])", + "Truncates a LOB" + ], + "oci_lob_write": [ + "int oci_lob_write( string string [, int length ])", + "Writes data to current position of a LOB" + ], + "oci_lob_write_temporary": [ + "bool oci_lob_write_temporary(string var [, int lob_type])", + "Writes temporary blob" + ], + "oci_new_collection": [ + "object oci_new_collection(resource connection, string tdo [, string schema])", + "Initialize a new collection" + ], + "oci_new_connect": [ + "resource oci_new_connect(string user, string pass [, string db])", + "Connect to an Oracle database and log on. Returns a new session." + ], + "oci_new_cursor": [ + "resource oci_new_cursor(resource connection)", + "Return a new cursor (Statement-Handle) - use this to bind ref-cursors!" + ], + "oci_new_descriptor": [ + "object oci_new_descriptor(resource connection [, int type])", + "Initialize a new empty descriptor LOB/FILE (LOB is default)" + ], + "oci_num_fields": [ + "int oci_num_fields(resource stmt)", + "Return the number of result columns in a statement" + ], + "oci_num_rows": [ + "int oci_num_rows(resource stmt)", + "Return the row count of an OCI statement" + ], + "oci_parse": [ + "resource oci_parse(resource connection, string query)", + "Parse a query and return a statement" + ], + "oci_password_change": [ + "bool oci_password_change(resource connection, string username, string old_password, string new_password)", + "Changes the password of an account" + ], + "oci_pconnect": [ + "resource oci_pconnect(string user, string pass [, string db [, string charset ]])", + "Connect to an Oracle database using a persistent connection and log on. Returns a new session." + ], + "oci_result": [ + "string oci_result(resource stmt, mixed column)", + "Return a single column of result data" + ], + "oci_rollback": [ + "bool oci_rollback(resource connection)", + "Rollback the current context" + ], + "oci_server_version": [ + "string oci_server_version(resource connection)", + "Return a string containing server version information" + ], + "oci_set_action": [ + "bool oci_set_action(resource connection, string value)", + "Sets the action attribute on the connection" + ], + "oci_set_client_identifier": [ + "bool oci_set_client_identifier(resource connection, string value)", + "Sets the client identifier attribute on the connection" + ], + "oci_set_client_info": [ + "bool oci_set_client_info(resource connection, string value)", + "Sets the client info attribute on the connection" + ], + "oci_set_edition": [ + "bool oci_set_edition(string value)", + "Sets the edition attribute for all subsequent connections created" + ], + "oci_set_module_name": [ + "bool oci_set_module_name(resource connection, string value)", + "Sets the module attribute on the connection" + ], + "oci_set_prefetch": [ + "bool oci_set_prefetch(resource stmt, int prefetch_rows)", + "Sets the number of rows to be prefetched on execute to prefetch_rows for stmt" + ], + "oci_statement_type": [ + "string oci_statement_type(resource stmt)", + "Return the query type of an OCI statement" + ], + "ocifetchinto": [ + "int ocifetchinto(resource stmt, array &output [, int mode])", + "Fetch a row of result data into an array" + ], + "ocigetbufferinglob": [ + "bool ocigetbufferinglob()", + "Returns current state of buffering for a LOB" + ], + "ocisetbufferinglob": [ + "bool ocisetbufferinglob( boolean flag )", + "Enables/disables buffering for a LOB" + ], + "octdec": [ + "int octdec(string octal_number)", + "Returns the decimal equivalent of an octal string" + ], + "odbc_autocommit": [ + "mixed odbc_autocommit(resource connection_id [, int OnOff])", + "Toggle autocommit mode or get status" + ], + "odbc_binmode": [ + "bool odbc_binmode(int result_id, int mode)", + "Handle binary column data" + ], + "odbc_close": [ + "void odbc_close(resource connection_id)", + "Close an ODBC connection" + ], + "odbc_close_all": [ + "void odbc_close_all(void)", + "Close all ODBC connections" + ], + "odbc_columnprivileges": [ + "resource odbc_columnprivileges(resource connection_id, string catalog, string schema, string table, string column)", + "Returns a result identifier that can be used to fetch a list of columns and associated privileges for the specified table" + ], + "odbc_columns": [ + "resource odbc_columns(resource connection_id [, string qualifier [, string owner [, string table_name [, string column_name]]]])", + "Returns a result identifier that can be used to fetch a list of column names in specified tables" + ], + "odbc_commit": [ + "bool odbc_commit(resource connection_id)", + "Commit an ODBC transaction" + ], + "odbc_connect": [ + "resource odbc_connect(string DSN, string user, string password [, int cursor_option])", + "Connect to a datasource" + ], + "odbc_cursor": [ + "string odbc_cursor(resource result_id)", + "Get cursor name" + ], + "odbc_data_source": [ + "array odbc_data_source(resource connection_id, int fetch_type)", + "Return information about the currently connected data source" + ], + "odbc_error": [ + "string odbc_error([resource connection_id])", + "Get the last error code" + ], + "odbc_errormsg": [ + "string odbc_errormsg([resource connection_id])", + "Get the last error message" + ], + "odbc_exec": [ + "resource odbc_exec(resource connection_id, string query [, int flags])", + "Prepare and execute an SQL statement" + ], + "odbc_execute": [ + "bool odbc_execute(resource result_id [, array parameters_array])", + "Execute a prepared statement" + ], + "odbc_fetch_array": [ + "array odbc_fetch_array(int result [, int rownumber])", + "Fetch a result row as an associative array" + ], + "odbc_fetch_into": [ + "int odbc_fetch_into(resource result_id, array &result_array, [, int rownumber])", + "Fetch one result row into an array" + ], + "odbc_fetch_object": [ + "object odbc_fetch_object(int result [, int rownumber])", + "Fetch a result row as an object" + ], + "odbc_fetch_row": [ + "bool odbc_fetch_row(resource result_id [, int row_number])", + "Fetch a row" + ], + "odbc_field_len": [ + "int odbc_field_len(resource result_id, int field_number)", + "Get the length (precision) of a column" + ], + "odbc_field_name": [ + "string odbc_field_name(resource result_id, int field_number)", + "Get a column name" + ], + "odbc_field_num": [ + "int odbc_field_num(resource result_id, string field_name)", + "Return column number" + ], + "odbc_field_scale": [ + "int odbc_field_scale(resource result_id, int field_number)", + "Get the scale of a column" + ], + "odbc_field_type": [ + "string odbc_field_type(resource result_id, int field_number)", + "Get the datatype of a column" + ], + "odbc_foreignkeys": [ + "resource odbc_foreignkeys(resource connection_id, string pk_qualifier, string pk_owner, string pk_table, string fk_qualifier, string fk_owner, string fk_table)", + "Returns a result identifier to either a list of foreign keys in the specified table or a list of foreign keys in other tables that refer to the primary key in the specified table" + ], + "odbc_free_result": [ + "bool odbc_free_result(resource result_id)", + "Free resources associated with a result" + ], + "odbc_gettypeinfo": [ + "resource odbc_gettypeinfo(resource connection_id [, int data_type])", + "Returns a result identifier containing information about data types supported by the data source" + ], + "odbc_longreadlen": [ + "bool odbc_longreadlen(int result_id, int length)", + "Handle LONG columns" + ], + "odbc_next_result": [ + "bool odbc_next_result(resource result_id)", + "Checks if multiple results are avaiable" + ], + "odbc_num_fields": [ + "int odbc_num_fields(resource result_id)", + "Get number of columns in a result" + ], + "odbc_num_rows": [ + "int odbc_num_rows(resource result_id)", + "Get number of rows in a result" + ], + "odbc_pconnect": [ + "resource odbc_pconnect(string DSN, string user, string password [, int cursor_option])", + "Establish a persistent connection to a datasource" + ], + "odbc_prepare": [ + "resource odbc_prepare(resource connection_id, string query)", + "Prepares a statement for execution" + ], + "odbc_primarykeys": [ + "resource odbc_primarykeys(resource connection_id, string qualifier, string owner, string table)", + "Returns a result identifier listing the column names that comprise the primary key for a table" + ], + "odbc_procedurecolumns": [ + "resource odbc_procedurecolumns(resource connection_id [, string qualifier, string owner, string proc, string column])", + "Returns a result identifier containing the list of input and output parameters, as well as the columns that make up the result set for the specified procedures" + ], + "odbc_procedures": [ + "resource odbc_procedures(resource connection_id [, string qualifier, string owner, string name])", + "Returns a result identifier containg the list of procedure names in a datasource" + ], + "odbc_result": [ + "mixed odbc_result(resource result_id, mixed field)", + "Get result data" + ], + "odbc_result_all": [ + "int odbc_result_all(resource result_id [, string format])", + "Print result as HTML table" + ], + "odbc_rollback": [ + "bool odbc_rollback(resource connection_id)", + "Rollback a transaction" + ], + "odbc_setoption": [ + "bool odbc_setoption(resource conn_id|result_id, int which, int option, int value)", + "Sets connection or statement options" + ], + "odbc_specialcolumns": [ + "resource odbc_specialcolumns(resource connection_id, int type, string qualifier, string owner, string table, int scope, int nullable)", + "Returns a result identifier containing either the optimal set of columns that uniquely identifies a row in the table or columns that are automatically updated when any value in the row is updated by a transaction" + ], + "odbc_statistics": [ + "resource odbc_statistics(resource connection_id, string qualifier, string owner, string name, int unique, int accuracy)", + "Returns a result identifier that contains statistics about a single table and the indexes associated with the table" + ], + "odbc_tableprivileges": [ + "resource odbc_tableprivileges(resource connection_id, string qualifier, string owner, string name)", + "Returns a result identifier containing a list of tables and the privileges associated with each table" + ], + "odbc_tables": [ + "resource odbc_tables(resource connection_id [, string qualifier [, string owner [, string name [, string table_types]]]])", + "Call the SQLTables function" + ], + "opendir": [ + "mixed opendir(string path[, resource context])", + "Open a directory and return a dir_handle" + ], + "openlog": [ + "bool openlog(string ident, int option, int facility)", + "Open connection to system logger" + ], + "openssl_csr_export": [ + "bool openssl_csr_export(resource csr, string &out [, bool notext=true])", + "Exports a CSR to file or a var" + ], + "openssl_csr_export_to_file": [ + "bool openssl_csr_export_to_file(resource csr, string outfilename [, bool notext=true])", + "Exports a CSR to file" + ], + "openssl_csr_get_public_key": [ + "mixed openssl_csr_get_public_key(mixed csr)", + "Returns the subject of a CERT or FALSE on error" + ], + "openssl_csr_get_subject": [ + "mixed openssl_csr_get_subject(mixed csr)", + "Returns the subject of a CERT or FALSE on error" + ], + "openssl_csr_new": [ + "bool openssl_csr_new(array dn, resource &privkey [, array configargs [, array extraattribs]])", + "Generates a privkey and CSR" + ], + "openssl_csr_sign": [ + "resource openssl_csr_sign(mixed csr, mixed x509, mixed priv_key, long days [, array config_args [, long serial]])", + "Signs a cert with another CERT" + ], + "openssl_decrypt": [ + "string openssl_decrypt(string data, string method, string password [, bool raw_input=false])", + "Takes raw or base64 encoded string and dectupt it using given method and key" + ], + "openssl_dh_compute_key": [ + "string openssl_dh_compute_key(string pub_key, resource dh_key)", + "Computes shared sicret for public value of remote DH key and local DH key" + ], + "openssl_digest": [ + "string openssl_digest(string data, string method [, bool raw_output=false])", + "Computes digest hash value for given data using given method, returns raw or binhex encoded string" + ], + "openssl_encrypt": [ + "string openssl_encrypt(string data, string method, string password [, bool raw_output=false])", + "Encrypts given data with given method and key, returns raw or base64 encoded string" + ], + "openssl_error_string": [ + "mixed openssl_error_string(void)", + "Returns a description of the last error, and alters the index of the error messages. Returns false when the are no more messages" + ], + "openssl_get_cipher_methods": [ + "array openssl_get_cipher_methods([bool aliases = false])", + "Return array of available cipher methods" + ], + "openssl_get_md_methods": [ + "array openssl_get_md_methods([bool aliases = false])", + "Return array of available digest methods" + ], + "openssl_open": [ + "bool openssl_open(string data, &string opendata, string ekey, mixed privkey)", + "Opens data" + ], + "openssl_pkcs12_export": [ + "bool openssl_pkcs12_export(mixed x509, string &out, mixed priv_key, string pass[, array args])", + "Creates and exports a PKCS12 to a var" + ], + "openssl_pkcs12_export_to_file": [ + "bool openssl_pkcs12_export_to_file(mixed x509, string filename, mixed priv_key, string pass[, array args])", + "Creates and exports a PKCS to file" + ], + "openssl_pkcs12_read": [ + "bool openssl_pkcs12_read(string PKCS12, array &certs, string pass)", + "Parses a PKCS12 to an array" + ], + "openssl_pkcs7_decrypt": [ + "bool openssl_pkcs7_decrypt(string infilename, string outfilename, mixed recipcert [, mixed recipkey])", + "Decrypts the S/MIME message in the file name infilename and output the results to the file name outfilename. recipcert is a CERT for one of the recipients. recipkey specifies the private key matching recipcert, if recipcert does not include the key" + ], + "openssl_pkcs7_encrypt": [ + "bool openssl_pkcs7_encrypt(string infile, string outfile, mixed recipcerts, array headers [, long flags [, long cipher]])", + "Encrypts the message in the file named infile with the certificates in recipcerts and output the result to the file named outfile" + ], + "openssl_pkcs7_sign": [ + "bool openssl_pkcs7_sign(string infile, string outfile, mixed signcert, mixed signkey, array headers [, long flags [, string extracertsfilename]])", + "Signs the MIME message in the file named infile with signcert/signkey and output the result to file name outfile. headers lists plain text headers to exclude from the signed portion of the message, and should include to, from and subject as a minimum" + ], + "openssl_pkcs7_verify": [ + "bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]])", + "Verifys that the data block is intact, the signer is who they say they are, and returns the CERTs of the signers" + ], + "openssl_pkey_export": [ + "bool openssl_pkey_export(mixed key, &mixed out [, string passphrase [, array config_args]])", + "Gets an exportable representation of a key into a string or file" + ], + "openssl_pkey_export_to_file": [ + "bool openssl_pkey_export_to_file(mixed key, string outfilename [, string passphrase, array config_args)", + "Gets an exportable representation of a key into a file" + ], + "openssl_pkey_free": [ + "void openssl_pkey_free(int key)", + "Frees a key" + ], + "openssl_pkey_get_details": [ + "resource openssl_pkey_get_details(resource key)", + "returns an array with the key details (bits, pkey, type)" + ], + "openssl_pkey_get_private": [ + "int openssl_pkey_get_private(string key [, string passphrase])", + "Gets private keys" + ], + "openssl_pkey_get_public": [ + "int openssl_pkey_get_public(mixed cert)", + "Gets public key from X.509 certificate" + ], + "openssl_pkey_new": [ + "resource openssl_pkey_new([array configargs])", + "Generates a new private key" + ], + "openssl_private_decrypt": [ + "bool openssl_private_decrypt(string data, string &decrypted, mixed key [, int padding])", + "Decrypts data with private key" + ], + "openssl_private_encrypt": [ + "bool openssl_private_encrypt(string data, string &crypted, mixed key [, int padding])", + "Encrypts data with private key" + ], + "openssl_public_decrypt": [ + "bool openssl_public_decrypt(string data, string &crypted, resource key [, int padding])", + "Decrypts data with public key" + ], + "openssl_public_encrypt": [ + "bool openssl_public_encrypt(string data, string &crypted, mixed key [, int padding])", + "Encrypts data with public key" + ], + "openssl_random_pseudo_bytes": [ + "string openssl_random_pseudo_bytes(integer length [, &bool returned_strong_result])", + "Returns a string of the length specified filled with random pseudo bytes" + ], + "openssl_seal": [ + "int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys)", + "Seals data" + ], + "openssl_sign": [ + "bool openssl_sign(string data, &string signature, mixed key[, mixed method])", + "Signs data" + ], + "openssl_verify": [ + "int openssl_verify(string data, string signature, mixed key[, mixed method])", + "Verifys data" + ], + "openssl_x509_check_private_key": [ + "bool openssl_x509_check_private_key(mixed cert, mixed key)", + "Checks if a private key corresponds to a CERT" + ], + "openssl_x509_checkpurpose": [ + "int openssl_x509_checkpurpose(mixed x509cert, int purpose, array cainfo [, string untrustedfile])", + "Checks the CERT to see if it can be used for the purpose in purpose. cainfo holds information about trusted CAs" + ], + "openssl_x509_export": [ + "bool openssl_x509_export(mixed x509, string &out [, bool notext = true])", + "Exports a CERT to file or a var" + ], + "openssl_x509_export_to_file": [ + "bool openssl_x509_export_to_file(mixed x509, string outfilename [, bool notext = true])", + "Exports a CERT to file or a var" + ], + "openssl_x509_free": [ + "void openssl_x509_free(resource x509)", + "Frees X.509 certificates" + ], + "openssl_x509_parse": [ + "array openssl_x509_parse(mixed x509 [, bool shortnames=true])", + "Returns an array of the fields/values of the CERT" + ], + "openssl_x509_read": [ + "resource openssl_x509_read(mixed cert)", + "Reads X.509 certificates" + ], + "ord": [ + "int ord(string character)", + "Returns ASCII value of character" + ], + "output_add_rewrite_var": [ + "bool output_add_rewrite_var(string name, string value)", + "Add URL rewriter values" + ], + "output_reset_rewrite_vars": [ + "bool output_reset_rewrite_vars(void)", + "Reset(clear) URL rewriter values" + ], + "pack": [ + "string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]])", + "Takes one or more arguments and packs them into a binary string according to the format argument" + ], + "parse_ini_file": [ + "array parse_ini_file(string filename [, bool process_sections [, int scanner_mode]])", + "Parse configuration file" + ], + "parse_ini_string": [ + "array parse_ini_string(string ini_string [, bool process_sections [, int scanner_mode]])", + "Parse configuration string" + ], + "parse_locale": [ + "static array parse_locale($locale)", + "* parses a locale-id into an array the different parts of it" + ], + "parse_str": [ + "void parse_str(string encoded_string [, array result])", + "Parses GET/POST/COOKIE data and sets global variables" + ], + "parse_url": [ + "mixed parse_url(string url, [int url_component])", + "Parse a URL and return its components" + ], + "passthru": [ + "void passthru(string command [, int &return_value])", + "Execute an external program and display raw output" + ], + "pathinfo": [ + "array pathinfo(string path[, int options])", + "Returns information about a certain string" + ], + "pclose": [ + "int pclose(resource fp)", + "Close a file pointer opened by popen()" + ], + "pcnlt_sigwaitinfo": [ + "int pcnlt_sigwaitinfo(array set[, array &siginfo])", + "Synchronously wait for queued signals" + ], + "pcntl_alarm": [ + "int pcntl_alarm(int seconds)", + "Set an alarm clock for delivery of a signal" + ], + "pcntl_exec": [ + "bool pcntl_exec(string path [, array args [, array envs]])", + "Executes specified program in current process space as defined by exec(2)" + ], + "pcntl_fork": [ + "int pcntl_fork(void)", + "Forks the currently running process following the same behavior as the UNIX fork() system call" + ], + "pcntl_getpriority": [ + "int pcntl_getpriority([int pid [, int process_identifier]])", + "Get the priority of any process" + ], + "pcntl_setpriority": [ + "bool pcntl_setpriority(int priority [, int pid [, int process_identifier]])", + "Change the priority of any process" + ], + "pcntl_signal": [ + "bool pcntl_signal(int signo, callback handle [, bool restart_syscalls])", + "Assigns a system signal handler to a PHP function" + ], + "pcntl_signal_dispatch": [ + "bool pcntl_signal_dispatch()", + "Dispatch signals to signal handlers" + ], + "pcntl_sigprocmask": [ + "bool pcntl_sigprocmask(int how, array set[, array &oldset])", + "Examine and change blocked signals" + ], + "pcntl_sigtimedwait": [ + "int pcntl_sigtimedwait(array set[, array &siginfo[, int seconds[, int nanoseconds]]])", + "Wait for queued signals" + ], + "pcntl_wait": [ + "int pcntl_wait(int &status)", + "Waits on or returns the status of a forked child as defined by the waitpid() system call" + ], + "pcntl_waitpid": [ + "int pcntl_waitpid(int pid, int &status, int options)", + "Waits on or returns the status of a forked child as defined by the waitpid() system call" + ], + "pcntl_wexitstatus": [ + "int pcntl_wexitstatus(int status)", + "Returns the status code of a child's exit" + ], + "pcntl_wifexited": [ + "bool pcntl_wifexited(int status)", + "Returns true if the child status code represents a successful exit" + ], + "pcntl_wifsignaled": [ + "bool pcntl_wifsignaled(int status)", + "Returns true if the child status code represents a process that was terminated due to a signal" + ], + "pcntl_wifstopped": [ + "bool pcntl_wifstopped(int status)", + "Returns true if the child status code represents a stopped process (WUNTRACED must have been used with waitpid)" + ], + "pcntl_wstopsig": [ + "int pcntl_wstopsig(int status)", + "Returns the number of the signal that caused the process to stop who's status code is passed" + ], + "pcntl_wtermsig": [ + "int pcntl_wtermsig(int status)", + "Returns the number of the signal that terminated the process who's status code is passed" + ], + "pdo_drivers": [ + "array pdo_drivers()", + "Return array of available PDO drivers" + ], + "pfsockopen": [ + "resource pfsockopen(string hostname, int port [, int errno [, string errstr [, float timeout]]])", + "Open persistent Internet or Unix domain socket connection" + ], + "pg_affected_rows": [ + "int pg_affected_rows(resource result)", + "Returns the number of affected tuples" + ], + "pg_cancel_query": [ + "bool pg_cancel_query(resource connection)", + "Cancel request" + ], + "pg_client_encoding": [ + "string pg_client_encoding([resource connection])", + "Get the current client encoding" + ], + "pg_close": [ + "bool pg_close([resource connection])", + "Close a PostgreSQL connection" + ], + "pg_connect": [ + "resource pg_connect(string connection_string[, int connect_type] | [string host, string port [, string options [, string tty,]]] string database)", + "Open a PostgreSQL connection" + ], + "pg_connection_busy": [ + "bool pg_connection_busy(resource connection)", + "Get connection is busy or not" + ], + "pg_connection_reset": [ + "bool pg_connection_reset(resource connection)", + "Reset connection (reconnect)" + ], + "pg_connection_status": [ + "int pg_connection_status(resource connnection)", + "Get connection status" + ], + "pg_convert": [ + "array pg_convert(resource db, string table, array values[, int options])", + "Check and convert values for PostgreSQL SQL statement" + ], + "pg_copy_from": [ + "bool pg_copy_from(resource connection, string table_name , array rows [, string delimiter [, string null_as]])", + "Copy table from array" + ], + "pg_copy_to": [ + "array pg_copy_to(resource connection, string table_name [, string delimiter [, string null_as]])", + "Copy table to array" + ], + "pg_dbname": [ + "string pg_dbname([resource connection])", + "Get the database name" + ], + "pg_delete": [ + "mixed pg_delete(resource db, string table, array ids[, int options])", + "Delete records has ids (id=>value)" + ], + "pg_end_copy": [ + "bool pg_end_copy([resource connection])", + "Sync with backend. Completes the Copy command" + ], + "pg_escape_bytea": [ + "string pg_escape_bytea([resource connection,] string data)", + "Escape binary for bytea type" + ], + "pg_escape_string": [ + "string pg_escape_string([resource connection,] string data)", + "Escape string for text/char type" + ], + "pg_execute": [ + "resource pg_execute([resource connection,] string stmtname, array params)", + "Execute a prepared query" + ], + "pg_fetch_all": [ + "array pg_fetch_all(resource result)", + "Fetch all rows into array" + ], + "pg_fetch_all_columns": [ + "array pg_fetch_all_columns(resource result [, int column_number])", + "Fetch all rows into array" + ], + "pg_fetch_array": [ + "array pg_fetch_array(resource result [, int row [, int result_type]])", + "Fetch a row as an array" + ], + "pg_fetch_assoc": [ + "array pg_fetch_assoc(resource result [, int row])", + "Fetch a row as an assoc array" + ], + "pg_fetch_object": [ + "object pg_fetch_object(resource result [, int row [, string class_name [, NULL|array ctor_params]]])", + "Fetch a row as an object" + ], + "pg_fetch_result": [ + "mixed pg_fetch_result(resource result, [int row_number,] mixed field_name)", + "Returns values from a result identifier" + ], + "pg_fetch_row": [ + "array pg_fetch_row(resource result [, int row [, int result_type]])", + "Get a row as an enumerated array" + ], + "pg_field_is_null": [ + "int pg_field_is_null(resource result, [int row,] mixed field_name_or_number)", + "Test if a field is NULL" + ], + "pg_field_name": [ + "string pg_field_name(resource result, int field_number)", + "Returns the name of the field" + ], + "pg_field_num": [ + "int pg_field_num(resource result, string field_name)", + "Returns the field number of the named field" + ], + "pg_field_prtlen": [ + "int pg_field_prtlen(resource result, [int row,] mixed field_name_or_number)", + "Returns the printed length" + ], + "pg_field_size": [ + "int pg_field_size(resource result, int field_number)", + "Returns the internal size of the field" + ], + "pg_field_table": [ + "mixed pg_field_table(resource result, int field_number[, bool oid_only])", + "Returns the name of the table field belongs to, or table's oid if oid_only is true" + ], + "pg_field_type": [ + "string pg_field_type(resource result, int field_number)", + "Returns the type name for the given field" + ], + "pg_field_type_oid": [ + "string pg_field_type_oid(resource result, int field_number)", + "Returns the type oid for the given field" + ], + "pg_free_result": [ + "bool pg_free_result(resource result)", + "Free result memory" + ], + "pg_get_notify": [ + "array pg_get_notify([resource connection[, result_type]])", + "Get asynchronous notification" + ], + "pg_get_pid": [ + "int pg_get_pid([resource connection)", + "Get backend(server) pid" + ], + "pg_get_result": [ + "resource pg_get_result(resource connection)", + "Get asynchronous query result" + ], + "pg_host": [ + "string pg_host([resource connection])", + "Returns the host name associated with the connection" + ], + "pg_insert": [ + "mixed pg_insert(resource db, string table, array values[, int options])", + "Insert values (filed=>value) to table" + ], + "pg_last_error": [ + "string pg_last_error([resource connection])", + "Get the error message string" + ], + "pg_last_notice": [ + "string pg_last_notice(resource connection)", + "Returns the last notice set by the backend" + ], + "pg_last_oid": [ + "string pg_last_oid(resource result)", + "Returns the last object identifier" + ], + "pg_lo_close": [ + "bool pg_lo_close(resource large_object)", + "Close a large object" + ], + "pg_lo_create": [ + "mixed pg_lo_create([resource connection],[mixed large_object_oid])", + "Create a large object" + ], + "pg_lo_export": [ + "bool pg_lo_export([resource connection, ] int objoid, string filename)", + "Export large object direct to filesystem" + ], + "pg_lo_import": [ + "int pg_lo_import([resource connection, ] string filename [, mixed oid])", + "Import large object direct from filesystem" + ], + "pg_lo_open": [ + "resource pg_lo_open([resource connection,] int large_object_oid, string mode)", + "Open a large object and return fd" + ], + "pg_lo_read": [ + "string pg_lo_read(resource large_object [, int len])", + "Read a large object" + ], + "pg_lo_read_all": [ + "int pg_lo_read_all(resource large_object)", + "Read a large object and send straight to browser" + ], + "pg_lo_seek": [ + "bool pg_lo_seek(resource large_object, int offset [, int whence])", + "Seeks position of large object" + ], + "pg_lo_tell": [ + "int pg_lo_tell(resource large_object)", + "Returns current position of large object" + ], + "pg_lo_unlink": [ + "bool pg_lo_unlink([resource connection,] string large_object_oid)", + "Delete a large object" + ], + "pg_lo_write": [ + "int pg_lo_write(resource large_object, string buf [, int len])", + "Write a large object" + ], + "pg_meta_data": [ + "array pg_meta_data(resource db, string table)", + "Get meta_data" + ], + "pg_num_fields": [ + "int pg_num_fields(resource result)", + "Return the number of fields in the result" + ], + "pg_num_rows": [ + "int pg_num_rows(resource result)", + "Return the number of rows in the result" + ], + "pg_options": [ + "string pg_options([resource connection])", + "Get the options associated with the connection" + ], + "pg_parameter_status": [ + "string|false pg_parameter_status([resource connection,] string param_name)", + "Returns the value of a server parameter" + ], + "pg_pconnect": [ + "resource pg_pconnect(string connection_string | [string host, string port [, string options [, string tty,]]] string database)", + "Open a persistent PostgreSQL connection" + ], + "pg_ping": [ + "bool pg_ping([resource connection])", + "Ping database. If connection is bad, try to reconnect." + ], + "pg_port": [ + "int pg_port([resource connection])", + "Return the port number associated with the connection" + ], + "pg_prepare": [ + "resource pg_prepare([resource connection,] string stmtname, string query)", + "Prepare a query for future execution" + ], + "pg_put_line": [ + "bool pg_put_line([resource connection,] string query)", + "Send null-terminated string to backend server" + ], + "pg_query": [ + "resource pg_query([resource connection,] string query)", + "Execute a query" + ], + "pg_query_params": [ + "resource pg_query_params([resource connection,] string query, array params)", + "Execute a query" + ], + "pg_result_error": [ + "string pg_result_error(resource result)", + "Get error message associated with result" + ], + "pg_result_error_field": [ + "string pg_result_error_field(resource result, int fieldcode)", + "Get error message field associated with result" + ], + "pg_result_seek": [ + "bool pg_result_seek(resource result, int offset)", + "Set internal row offset" + ], + "pg_result_status": [ + "mixed pg_result_status(resource result[, long result_type])", + "Get status of query result" + ], + "pg_select": [ + "mixed pg_select(resource db, string table, array ids[, int options])", + "Select records that has ids (id=>value)" + ], + "pg_send_execute": [ + "bool pg_send_execute(resource connection, string stmtname, array params)", + "Executes prevriously prepared stmtname asynchronously" + ], + "pg_send_prepare": [ + "bool pg_send_prepare(resource connection, string stmtname, string query)", + "Asynchronously prepare a query for future execution" + ], + "pg_send_query": [ + "bool pg_send_query(resource connection, string query)", + "Send asynchronous query" + ], + "pg_send_query_params": [ + "bool pg_send_query_params(resource connection, string query, array params)", + "Send asynchronous parameterized query" + ], + "pg_set_client_encoding": [ + "int pg_set_client_encoding([resource connection,] string encoding)", + "Set client encoding" + ], + "pg_set_error_verbosity": [ + "int pg_set_error_verbosity([resource connection,] int verbosity)", + "Set error verbosity" + ], + "pg_trace": [ + "bool pg_trace(string filename [, string mode [, resource connection]])", + "Enable tracing a PostgreSQL connection" + ], + "pg_transaction_status": [ + "int pg_transaction_status(resource connnection)", + "Get transaction status" + ], + "pg_tty": [ + "string pg_tty([resource connection])", + "Return the tty name associated with the connection" + ], + "pg_unescape_bytea": [ + "string pg_unescape_bytea(string data)", + "Unescape binary for bytea type" + ], + "pg_untrace": [ + "bool pg_untrace([resource connection])", + "Disable tracing of a PostgreSQL connection" + ], + "pg_update": [ + "mixed pg_update(resource db, string table, array fields, array ids[, int options])", + "Update table using values (field=>value) and ids (id=>value)" + ], + "pg_version": [ + "array pg_version([resource connection])", + "Returns an array with client, protocol and server version (when available)" + ], + "php_egg_logo_guid": [ + "string php_egg_logo_guid(void)", + "Return the special ID used to request the PHP logo in phpinfo screens" + ], + "php_ini_loaded_file": [ + "string php_ini_loaded_file(void)", + "Return the actual loaded ini filename" + ], + "php_ini_scanned_files": [ + "string php_ini_scanned_files(void)", + "Return comma-separated string of .ini files parsed from the additional ini dir" + ], + "php_logo_guid": [ + "string php_logo_guid(void)", + "Return the special ID used to request the PHP logo in phpinfo screens" + ], + "php_real_logo_guid": [ + "string php_real_logo_guid(void)", + "Return the special ID used to request the PHP logo in phpinfo screens" + ], + "php_sapi_name": [ + "string php_sapi_name(void)", + "Return the current SAPI module name" + ], + "php_snmpv3": [ + "void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st)", + "* * Generic SNMPv3 object fetcher * From here is passed on the the common internal object fetcher. * * st=SNMP_CMD_GET snmp3_get() - query an agent and return a single value. * st=SNMP_CMD_GETNEXT snmp3_getnext() - query an agent and return the next single value. * st=SNMP_CMD_WALK snmp3_walk() - walk the mib and return a single dimensional array * containing the values. * st=SNMP_CMD_REALWALK snmp3_real_walk() - walk the mib and return an * array of oid,value pairs. * st=SNMP_CMD_SET snmp3_set() - query an agent and set a single value *" + ], + "php_strip_whitespace": [ + "string php_strip_whitespace(string file_name)", + "Return source with stripped comments and whitespace" + ], + "php_uname": [ + "string php_uname(void)", + "Return information about the system PHP was built on" + ], + "phpcredits": [ + "void phpcredits([int flag])", + "Prints the list of people who've contributed to the PHP project" + ], + "phpinfo": [ + "void phpinfo([int what])", + "Output a page of useful information about PHP and the current request" + ], + "phpversion": [ + "string phpversion([string extension])", + "Return the current PHP version" + ], + "pi": [ + "float pi(void)", + "Returns an approximation of pi" + ], + "png2wbmp": [ + "bool png2wbmp (string f_org, string f_dest, int d_height, int d_width, int threshold)", + "Convert PNG image to WBMP image" + ], + "popen": [ + "resource popen(string command, string mode)", + "Execute a command and open either a read or a write pipe to it" + ], + "posix_access": [ + "bool posix_access(string file [, int mode])", + "Determine accessibility of a file (POSIX.1 5.6.3)" + ], + "posix_ctermid": [ + "string posix_ctermid(void)", + "Generate terminal path name (POSIX.1, 4.7.1)" + ], + "posix_get_last_error": [ + "int posix_get_last_error(void)", + "Retrieve the error number set by the last posix function which failed." + ], + "posix_getcwd": [ + "string posix_getcwd(void)", + "Get working directory pathname (POSIX.1, 5.2.2)" + ], + "posix_getegid": [ + "int posix_getegid(void)", + "Get the current effective group id (POSIX.1, 4.2.1)" + ], + "posix_geteuid": [ + "int posix_geteuid(void)", + "Get the current effective user id (POSIX.1, 4.2.1)" + ], + "posix_getgid": [ + "int posix_getgid(void)", + "Get the current group id (POSIX.1, 4.2.1)" + ], + "posix_getgrgid": [ + "array posix_getgrgid(long gid)", + "Group database access (POSIX.1, 9.2.1)" + ], + "posix_getgrnam": [ + "array posix_getgrnam(string groupname)", + "Group database access (POSIX.1, 9.2.1)" + ], + "posix_getgroups": [ + "array posix_getgroups(void)", + "Get supplementary group id's (POSIX.1, 4.2.3)" + ], + "posix_getlogin": [ + "string posix_getlogin(void)", + "Get user name (POSIX.1, 4.2.4)" + ], + "posix_getpgid": [ + "int posix_getpgid(void)", + "Get the process group id of the specified process (This is not a POSIX function, but a SVR4ism, so we compile conditionally)" + ], + "posix_getpgrp": [ + "int posix_getpgrp(void)", + "Get current process group id (POSIX.1, 4.3.1)" + ], + "posix_getpid": [ + "int posix_getpid(void)", + "Get the current process id (POSIX.1, 4.1.1)" + ], + "posix_getppid": [ + "int posix_getppid(void)", + "Get the parent process id (POSIX.1, 4.1.1)" + ], + "posix_getpwnam": [ + "array posix_getpwnam(string groupname)", + "User database access (POSIX.1, 9.2.2)" + ], + "posix_getpwuid": [ + "array posix_getpwuid(long uid)", + "User database access (POSIX.1, 9.2.2)" + ], + "posix_getrlimit": [ + "array posix_getrlimit(void)", + "Get system resource consumption limits (This is not a POSIX function, but a BSDism and a SVR4ism. We compile conditionally)" + ], + "posix_getsid": [ + "int posix_getsid(void)", + "Get process group id of session leader (This is not a POSIX function, but a SVR4ism, so be compile conditionally)" + ], + "posix_getuid": [ + "int posix_getuid(void)", + "Get the current user id (POSIX.1, 4.2.1)" + ], + "posix_initgroups": [ + "bool posix_initgroups(string name, int base_group_id)", + "Calculate the group access list for the user specified in name." + ], + "posix_isatty": [ + "bool posix_isatty(int fd)", + "Determine if filedesc is a tty (POSIX.1, 4.7.1)" + ], + "posix_kill": [ + "bool posix_kill(int pid, int sig)", + "Send a signal to a process (POSIX.1, 3.3.2)" + ], + "posix_mkfifo": [ + "bool posix_mkfifo(string pathname, int mode)", + "Make a FIFO special file (POSIX.1, 5.4.2)" + ], + "posix_mknod": [ + "bool posix_mknod(string pathname, int mode [, int major [, int minor]])", + "Make a special or ordinary file (POSIX.1)" + ], + "posix_setegid": [ + "bool posix_setegid(long uid)", + "Set effective group id" + ], + "posix_seteuid": [ + "bool posix_seteuid(long uid)", + "Set effective user id" + ], + "posix_setgid": [ + "bool posix_setgid(int uid)", + "Set group id (POSIX.1, 4.2.2)" + ], + "posix_setpgid": [ + "bool posix_setpgid(int pid, int pgid)", + "Set process group id for job control (POSIX.1, 4.3.3)" + ], + "posix_setsid": [ + "int posix_setsid(void)", + "Create session and set process group id (POSIX.1, 4.3.2)" + ], + "posix_setuid": [ + "bool posix_setuid(long uid)", + "Set user id (POSIX.1, 4.2.2)" + ], + "posix_strerror": [ + "string posix_strerror(int errno)", + "Retrieve the system error message associated with the given errno." + ], + "posix_times": [ + "array posix_times(void)", + "Get process times (POSIX.1, 4.5.2)" + ], + "posix_ttyname": [ + "string posix_ttyname(int fd)", + "Determine terminal device name (POSIX.1, 4.7.2)" + ], + "posix_uname": [ + "array posix_uname(void)", + "Get system name (POSIX.1, 4.4.1)" + ], + "pow": [ + "number pow(number base, number exponent)", + "Returns base raised to the power of exponent. Returns integer result when possible" + ], + "preg_filter": [ + "mixed preg_filter(mixed regex, mixed replace, mixed subject [, int limit [, int &count]])", + "Perform Perl-style regular expression replacement and only return matches." + ], + "preg_grep": [ + "array preg_grep(string regex, array input [, int flags])", + "Searches array and returns entries which match regex" + ], + "preg_last_error": [ + "int preg_last_error()", + "Returns the error code of the last regexp execution." + ], + "preg_match": [ + "int preg_match(string pattern, string subject [, array &subpatterns [, int flags [, int offset]]])", + "Perform a Perl-style regular expression match" + ], + "preg_match_all": [ + "int preg_match_all(string pattern, string subject, array &subpatterns [, int flags [, int offset]])", + "Perform a Perl-style global regular expression match" + ], + "preg_quote": [ + "string preg_quote(string str [, string delim_char])", + "Quote regular expression characters plus an optional character" + ], + "preg_replace": [ + "mixed preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, int &count]])", + "Perform Perl-style regular expression replacement." + ], + "preg_replace_callback": [ + "mixed preg_replace_callback(mixed regex, mixed callback, mixed subject [, int limit [, int &count]])", + "Perform Perl-style regular expression replacement using replacement callback." + ], + "preg_split": [ + "array preg_split(string pattern, string subject [, int limit [, int flags]])", + "Split string into an array using a perl-style regular expression as a delimiter" + ], + "prev": [ + "mixed prev(array array_arg)", + "Move array argument's internal pointer to the previous element and return it" + ], + "print": [ + "int print(string arg)", + "Output a string" + ], + "print_r": [ + "mixed print_r(mixed var [, bool return])", + "Prints out or returns information about the specified variable" + ], + "printf": [ + "int printf(string format [, mixed arg1 [, mixed ...]])", + "Output a formatted string" + ], + "proc_close": [ + "int proc_close(resource process)", + "close a process opened by proc_open" + ], + "proc_get_status": [ + "array proc_get_status(resource process)", + "get information about a process opened by proc_open" + ], + "proc_nice": [ + "bool proc_nice(int priority)", + "Change the priority of the current process" + ], + "proc_open": [ + "resource proc_open(string command, array descriptorspec, array &pipes [, string cwd [, array env [, array other_options]]])", + "Run a process with more control over it's file descriptors" + ], + "proc_terminate": [ + "bool proc_terminate(resource process [, long signal])", + "kill a process opened by proc_open" + ], + "property_exists": [ + "bool property_exists(mixed object_or_class, string property_name)", + "Checks if the object or class has a property" + ], + "pspell_add_to_personal": [ + "bool pspell_add_to_personal(int pspell, string word)", + "Adds a word to a personal list" + ], + "pspell_add_to_session": [ + "bool pspell_add_to_session(int pspell, string word)", + "Adds a word to the current session" + ], + "pspell_check": [ + "bool pspell_check(int pspell, string word)", + "Returns true if word is valid" + ], + "pspell_clear_session": [ + "bool pspell_clear_session(int pspell)", + "Clears the current session" + ], + "pspell_config_create": [ + "int pspell_config_create(string language [, string spelling [, string jargon [, string encoding]]])", + "Create a new config to be used later to create a manager" + ], + "pspell_config_data_dir": [ + "bool pspell_config_data_dir(int conf, string directory)", + "location of language data files" + ], + "pspell_config_dict_dir": [ + "bool pspell_config_dict_dir(int conf, string directory)", + "location of the main word list" + ], + "pspell_config_ignore": [ + "bool pspell_config_ignore(int conf, int ignore)", + "Ignore words <= n chars" + ], + "pspell_config_mode": [ + "bool pspell_config_mode(int conf, long mode)", + "Select mode for config (PSPELL_FAST, PSPELL_NORMAL or PSPELL_BAD_SPELLERS)" + ], + "pspell_config_personal": [ + "bool pspell_config_personal(int conf, string personal)", + "Use a personal dictionary for this config" + ], + "pspell_config_repl": [ + "bool pspell_config_repl(int conf, string repl)", + "Use a personal dictionary with replacement pairs for this config" + ], + "pspell_config_runtogether": [ + "bool pspell_config_runtogether(int conf, bool runtogether)", + "Consider run-together words as valid components" + ], + "pspell_config_save_repl": [ + "bool pspell_config_save_repl(int conf, bool save)", + "Save replacement pairs when personal list is saved for this config" + ], + "pspell_new": [ + "int pspell_new(string language [, string spelling [, string jargon [, string encoding [, int mode]]]])", + "Load a dictionary" + ], + "pspell_new_config": [ + "int pspell_new_config(int config)", + "Load a dictionary based on the given config" + ], + "pspell_new_personal": [ + "int pspell_new_personal(string personal, string language [, string spelling [, string jargon [, string encoding [, int mode]]]])", + "Load a dictionary with a personal wordlist" + ], + "pspell_save_wordlist": [ + "bool pspell_save_wordlist(int pspell)", + "Saves the current (personal) wordlist" + ], + "pspell_store_replacement": [ + "bool pspell_store_replacement(int pspell, string misspell, string correct)", + "Notify the dictionary of a user-selected replacement" + ], + "pspell_suggest": [ + "array pspell_suggest(int pspell, string word)", + "Returns array of suggestions" + ], + "putenv": [ + "bool putenv(string setting)", + "Set the value of an environment variable" + ], + "quoted_printable_decode": [ + "string quoted_printable_decode(string str)", + "Convert a quoted-printable string to an 8 bit string" + ], + "quoted_printable_encode": [ + "string quoted_printable_encode(string str) */", + "PHP_FUNCTION(quoted_printable_encode) { char *str, *new_str; int str_len; size_t new_str_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, \"s\", &str, &str_len) != SUCCESS) { return; } if (!str_len) { RETURN_EMPTY_STRING(); } new_str = (char *)php_quot_print_encode((unsigned char *)str, (size_t)str_len, &new_str_len); RETURN_STRINGL(new_str, new_str_len, 0); } /* }}}" + ], + "quotemeta": [ + "string quotemeta(string str)", + "Quotes meta characters" + ], + "rad2deg": [ + "float rad2deg(float number)", + "Converts the radian number to the equivalent number in degrees" + ], + "rand": [ + "int rand([int min, int max])", + "Returns a random number" + ], + "range": [ + "array range(mixed low, mixed high[, int step])", + "Create an array containing the range of integers or characters from low to high (inclusive)" + ], + "rawurldecode": [ + "string rawurldecode(string str)", + "Decodes URL-encodes string" + ], + "rawurlencode": [ + "string rawurlencode(string str)", + "URL-encodes string" + ], + "readdir": [ + "string readdir([resource dir_handle])", + "Read directory entry from dir_handle" + ], + "readfile": [ + "int readfile(string filename [, bool use_include_path[, resource context]])", + "Output a file or a URL" + ], + "readgzfile": [ + "int readgzfile(string filename [, int use_include_path])", + "Output a .gz-file" + ], + "readline": [ + "string readline([string prompt])", + "Reads a line" + ], + "readline_add_history": [ + "bool readline_add_history(string prompt)", + "Adds a line to the history" + ], + "readline_callback_handler_install": [ + "void readline_callback_handler_install(string prompt, mixed callback)", + "Initializes the readline callback interface and terminal, prints the prompt and returns immediately" + ], + "readline_callback_handler_remove": [ + "bool readline_callback_handler_remove()", + "Removes a previously installed callback handler and restores terminal settings" + ], + "readline_callback_read_char": [ + "void readline_callback_read_char()", + "Informs the readline callback interface that a character is ready for input" + ], + "readline_clear_history": [ + "bool readline_clear_history(void)", + "Clears the history" + ], + "readline_completion_function": [ + "bool readline_completion_function(string funcname)", + "Readline completion function?" + ], + "readline_info": [ + "mixed readline_info([string varname [, string newvalue]])", + "Gets/sets various internal readline variables." + ], + "readline_list_history": [ + "array readline_list_history(void)", + "Lists the history" + ], + "readline_on_new_line": [ + "void readline_on_new_line(void)", + "Inform readline that the cursor has moved to a new line" + ], + "readline_read_history": [ + "bool readline_read_history([string filename])", + "Reads the history" + ], + "readline_redisplay": [ + "void readline_redisplay(void)", + "Ask readline to redraw the display" + ], + "readline_write_history": [ + "bool readline_write_history([string filename])", + "Writes the history" + ], + "readlink": [ + "string readlink(string filename)", + "Return the target of a symbolic link" + ], + "realpath": [ + "string realpath(string path)", + "Return the resolved path" + ], + "realpath_cache_get": [ + "bool realpath_cache_get()", + "Get current size of realpath cache" + ], + "realpath_cache_size": [ + "bool realpath_cache_size()", + "Get current size of realpath cache" + ], + "recode_file": [ + "bool recode_file(string request, resource input, resource output)", + "Recode file input into file output according to request" + ], + "recode_string": [ + "string recode_string(string request, string str)", + "Recode string str according to request string" + ], + "register_shutdown_function": [ + "void register_shutdown_function(string function_name)", + "Register a user-level function to be called on request termination" + ], + "register_tick_function": [ + "bool register_tick_function(string function_name [, mixed arg [, mixed ... ]])", + "Registers a tick callback function" + ], + "rename": [ + "bool rename(string old_name, string new_name[, resource context])", + "Rename a file" + ], + "require": [ + "bool require(string path)", + "Includes and evaluates the specified file, erroring if the file cannot be included" + ], + "require_once": [ + "bool require_once(string path)", + "Includes and evaluates the specified file, erroring if the file cannot be included" + ], + "reset": [ + "mixed reset(array array_arg)", + "Set array argument's internal pointer to the first element and return it" + ], + "restore_error_handler": [ + "void restore_error_handler(void)", + "Restores the previously defined error handler function" + ], + "restore_exception_handler": [ + "void restore_exception_handler(void)", + "Restores the previously defined exception handler function" + ], + "restore_include_path": [ + "void restore_include_path()", + "Restore the value of the include_path configuration option" + ], + "rewind": [ + "bool rewind(resource fp)", + "Rewind the position of a file pointer" + ], + "rewinddir": [ + "void rewinddir([resource dir_handle])", + "Rewind dir_handle back to the start" + ], + "rmdir": [ + "bool rmdir(string dirname[, resource context])", + "Remove a directory" + ], + "round": [ + "float round(float number [, int precision [, int mode]])", + "Returns the number rounded to specified precision" + ], + "rsort": [ + "bool rsort(array &array_arg [, int sort_flags])", + "Sort an array in reverse order" + ], + "rtrim": [ + "string rtrim(string str [, string character_mask])", + "Removes trailing whitespace" + ], + "scandir": [ + "array scandir(string dir [, int sorting_order [, resource context]])", + "List files & directories inside the specified path" + ], + "sem_acquire": [ + "bool sem_acquire(resource id)", + "Acquires the semaphore with the given id, blocking if necessary" + ], + "sem_get": [ + "resource sem_get(int key [, int max_acquire [, int perm [, int auto_release]])", + "Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously" + ], + "sem_release": [ + "bool sem_release(resource id)", + "Releases the semaphore with the given id" + ], + "sem_remove": [ + "bool sem_remove(resource id)", + "Removes semaphore from Unix systems" + ], + "serialize": [ + "string serialize(mixed variable)", + "Returns a string representation of variable (which can later be unserialized)" + ], + "session_cache_expire": [ + "int session_cache_expire([int new_cache_expire])", + "Return the current cache expire. If new_cache_expire is given, the current cache_expire is replaced with new_cache_expire" + ], + "session_cache_limiter": [ + "string session_cache_limiter([string new_cache_limiter])", + "Return the current cache limiter. If new_cache_limited is given, the current cache_limiter is replaced with new_cache_limiter" + ], + "session_decode": [ + "bool session_decode(string data)", + "Deserializes data and reinitializes the variables" + ], + "session_destroy": [ + "bool session_destroy(void)", + "Destroy the current session and all data associated with it" + ], + "session_encode": [ + "string session_encode(void)", + "Serializes the current setup and returns the serialized representation" + ], + "session_get_cookie_params": [ + "array session_get_cookie_params(void)", + "Return the session cookie parameters" + ], + "session_id": [ + "string session_id([string newid])", + "Return the current session id. If newid is given, the session id is replaced with newid" + ], + "session_is_registered": [ + "bool session_is_registered(string varname)", + "Checks if a variable is registered in session" + ], + "session_module_name": [ + "string session_module_name([string newname])", + "Return the current module name used for accessing session data. If newname is given, the module name is replaced with newname" + ], + "session_name": [ + "string session_name([string newname])", + "Return the current session name. If newname is given, the session name is replaced with newname" + ], + "session_regenerate_id": [ + "bool session_regenerate_id([bool delete_old_session])", + "Update the current session id with a newly generated one. If delete_old_session is set to true, remove the old session." + ], + "session_register": [ + "bool session_register(mixed var_names [, mixed ...])", + "Adds varname(s) to the list of variables which are freezed at the session end" + ], + "session_save_path": [ + "string session_save_path([string newname])", + "Return the current save path passed to module_name. If newname is given, the save path is replaced with newname" + ], + "session_set_cookie_params": [ + "void session_set_cookie_params(int lifetime [, string path [, string domain [, bool secure[, bool httponly]]]])", + "Set session cookie parameters" + ], + "session_set_save_handler": [ + "void session_set_save_handler(string open, string close, string read, string write, string destroy, string gc)", + "Sets user-level functions" + ], + "session_start": [ + "bool session_start(void)", + "Begin session - reinitializes freezed variables, registers browsers etc" + ], + "session_unregister": [ + "bool session_unregister(string varname)", + "Removes varname from the list of variables which are freezed at the session end" + ], + "session_unset": [ + "void session_unset(void)", + "Unset all registered variables" + ], + "session_write_close": [ + "void session_write_close(void)", + "Write session data and end session" + ], + "set_error_handler": [ + "string set_error_handler(string error_handler [, int error_types])", + "Sets a user-defined error handler function. Returns the previously defined error handler, or false on error" + ], + "set_exception_handler": [ + "string set_exception_handler(callable exception_handler)", + "Sets a user-defined exception handler function. Returns the previously defined exception handler, or false on error" + ], + "set_include_path": [ + "string set_include_path(string new_include_path)", + "Sets the include_path configuration option" + ], + "set_magic_quotes_runtime": [ + "bool set_magic_quotes_runtime(int new_setting)", + "Set the current active configuration setting of magic_quotes_runtime and return previous" + ], + "set_time_limit": [ + "bool set_time_limit(int seconds)", + "Sets the maximum time a script can run" + ], + "setcookie": [ + "bool setcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly]]]]]])", + "Send a cookie" + ], + "setlocale": [ + "string setlocale(mixed category, string locale [, string ...])", + "Set locale information" + ], + "setrawcookie": [ + "bool setrawcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly]]]]]])", + "Send a cookie with no url encoding of the value" + ], + "settype": [ + "bool settype(mixed var, string type)", + "Set the type of the variable" + ], + "sha1": [ + "string sha1(string str [, bool raw_output])", + "Calculate the sha1 hash of a string" + ], + "sha1_file": [ + "string sha1_file(string filename [, bool raw_output])", + "Calculate the sha1 hash of given filename" + ], + "shell_exec": [ + "string shell_exec(string cmd)", + "Execute command via shell and return complete output as string" + ], + "shm_attach": [ + "int shm_attach(int key [, int memsize [, int perm]])", + "Creates or open a shared memory segment" + ], + "shm_detach": [ + "bool shm_detach(resource shm_identifier)", + "Disconnects from shared memory segment" + ], + "shm_get_var": [ + "mixed shm_get_var(resource id, int variable_key)", + "Returns a variable from shared memory" + ], + "shm_has_var": [ + "bool shm_has_var(resource id, int variable_key)", + "Checks whether a specific entry exists" + ], + "shm_put_var": [ + "bool shm_put_var(resource shm_identifier, int variable_key, mixed variable)", + "Inserts or updates a variable in shared memory" + ], + "shm_remove": [ + "bool shm_remove(resource shm_identifier)", + "Removes shared memory from Unix systems" + ], + "shm_remove_var": [ + "bool shm_remove_var(resource id, int variable_key)", + "Removes variable from shared memory" + ], + "shmop_close": [ + "void shmop_close (int shmid)", + "closes a shared memory segment" + ], + "shmop_delete": [ + "bool shmop_delete (int shmid)", + "mark segment for deletion" + ], + "shmop_open": [ + "int shmop_open (int key, string flags, int mode, int size)", + "gets and attaches a shared memory segment" + ], + "shmop_read": [ + "string shmop_read (int shmid, int start, int count)", + "reads from a shm segment" + ], + "shmop_size": [ + "int shmop_size (int shmid)", + "returns the shm size" + ], + "shmop_write": [ + "int shmop_write (int shmid, string data, int offset)", + "writes to a shared memory segment" + ], + "shuffle": [ + "bool shuffle(array array_arg)", + "Randomly shuffle the contents of an array" + ], + "similar_text": [ + "int similar_text(string str1, string str2 [, float percent])", + "Calculates the similarity between two strings" + ], + "simplexml_import_dom": [ + "simplemxml_element simplexml_import_dom(domNode node [, string class_name])", + "Get a simplexml_element object from dom to allow for processing" + ], + "simplexml_load_file": [ + "simplemxml_element simplexml_load_file(string filename [, string class_name [, int options [, string ns [, bool is_prefix]]]])", + "Load a filename and return a simplexml_element object to allow for processing" + ], + "simplexml_load_string": [ + "simplemxml_element simplexml_load_string(string data [, string class_name [, int options [, string ns [, bool is_prefix]]]])", + "Load a string and return a simplexml_element object to allow for processing" + ], + "sin": [ + "float sin(float number)", + "Returns the sine of the number in radians" + ], + "sinh": [ + "float sinh(float number)", + "Returns the hyperbolic sine of the number, defined as (exp(number) - exp(-number))/2" + ], + "sleep": [ + "void sleep(int seconds)", + "Delay for a given number of seconds" + ], + "smfi_addheader": [ + "bool smfi_addheader(string headerf, string headerv)", + "Adds a header to the current message." + ], + "smfi_addrcpt": [ + "bool smfi_addrcpt(string rcpt)", + "Add a recipient to the message envelope." + ], + "smfi_chgheader": [ + "bool smfi_chgheader(string headerf, string headerv)", + "Changes a header's value for the current message." + ], + "smfi_delrcpt": [ + "bool smfi_delrcpt(string rcpt)", + "Removes the named recipient from the current message's envelope." + ], + "smfi_getsymval": [ + "string smfi_getsymval(string macro)", + "Returns the value of the given macro or NULL if the macro is not defined." + ], + "smfi_replacebody": [ + "bool smfi_replacebody(string body)", + "Replaces the body of the current message. If called more than once, subsequent calls result in data being appended to the new body." + ], + "smfi_setflags": [ + "void smfi_setflags(long flags)", + "Sets the flags describing the actions the filter may take." + ], + "smfi_setreply": [ + "bool smfi_setreply(string rcode, string xcode, string message)", + "Directly set the SMTP error reply code for this connection. This code will be used on subsequent error replies resulting from actions taken by this filter." + ], + "smfi_settimeout": [ + "void smfi_settimeout(long timeout)", + "Sets the number of seconds libmilter will wait for an MTA connection before timing out a socket." + ], + "snmp2_get": [ + "string snmp2_get(string host, string community, string object_id [, int timeout [, int retries]])", + "Fetch a SNMP object" + ], + "snmp2_getnext": [ + "string snmp2_getnext(string host, string community, string object_id [, int timeout [, int retries]])", + "Fetch a SNMP object" + ], + "snmp2_real_walk": [ + "array snmp2_real_walk(string host, string community, string object_id [, int timeout [, int retries]])", + "Return all objects including their respective object id withing the specified one" + ], + "snmp2_set": [ + "int snmp2_set(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]])", + "Set the value of a SNMP object" + ], + "snmp2_walk": [ + "array snmp2_walk(string host, string community, string object_id [, int timeout [, int retries]])", + "Return all objects under the specified object id" + ], + "snmp3_get": [ + "int snmp3_get(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])", + "Fetch the value of a SNMP object" + ], + "snmp3_getnext": [ + "int snmp3_getnext(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])", + "Fetch the value of a SNMP object" + ], + "snmp3_real_walk": [ + "int snmp3_real_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])", + "Fetch the value of a SNMP object" + ], + "snmp3_set": [ + "int snmp3_set(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id, string type, mixed value [, int timeout [, int retries]])", + "Fetch the value of a SNMP object" + ], + "snmp3_walk": [ + "int snmp3_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])", + "Fetch the value of a SNMP object" + ], + "snmp_get_quick_print": [ + "bool snmp_get_quick_print(void)", + "Return the current status of quick_print" + ], + "snmp_get_valueretrieval": [ + "int snmp_get_valueretrieval()", + "Return the method how the SNMP values will be returned" + ], + "snmp_read_mib": [ + "int snmp_read_mib(string filename)", + "Reads and parses a MIB file into the active MIB tree." + ], + "snmp_set_enum_print": [ + "void snmp_set_enum_print(int enum_print)", + "Return all values that are enums with their enum value instead of the raw integer" + ], + "snmp_set_oid_output_format": [ + "void snmp_set_oid_output_format(int oid_format)", + "Set the OID output format." + ], + "snmp_set_quick_print": [ + "void snmp_set_quick_print(int quick_print)", + "Return all objects including their respective object id withing the specified one" + ], + "snmp_set_valueretrieval": [ + "void snmp_set_valueretrieval(int method)", + "Specify the method how the SNMP values will be returned" + ], + "snmpget": [ + "string snmpget(string host, string community, string object_id [, int timeout [, int retries]])", + "Fetch a SNMP object" + ], + "snmpgetnext": [ + "string snmpgetnext(string host, string community, string object_id [, int timeout [, int retries]])", + "Fetch a SNMP object" + ], + "snmprealwalk": [ + "array snmprealwalk(string host, string community, string object_id [, int timeout [, int retries]])", + "Return all objects including their respective object id withing the specified one" + ], + "snmpset": [ + "int snmpset(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]])", + "Set the value of a SNMP object" + ], + "snmpwalk": [ + "array snmpwalk(string host, string community, string object_id [, int timeout [, int retries]])", + "Return all objects under the specified object id" + ], + "socket_accept": [ + "resource socket_accept(resource socket)", + "Accepts a connection on the listening socket fd" + ], + "socket_bind": [ + "bool socket_bind(resource socket, string addr [, int port])", + "Binds an open socket to a listening port, port is only specified in AF_INET family." + ], + "socket_clear_error": [ + "void socket_clear_error([resource socket])", + "Clears the error on the socket or the last error code." + ], + "socket_close": [ + "void socket_close(resource socket)", + "Closes a file descriptor" + ], + "socket_connect": [ + "bool socket_connect(resource socket, string addr [, int port])", + "Opens a connection to addr:port on the socket specified by socket" + ], + "socket_create": [ + "resource socket_create(int domain, int type, int protocol)", + "Creates an endpoint for communication in the domain specified by domain, of type specified by type" + ], + "socket_create_listen": [ + "resource socket_create_listen(int port[, int backlog])", + "Opens a socket on port to accept connections" + ], + "socket_create_pair": [ + "bool socket_create_pair(int domain, int type, int protocol, array &fd)", + "Creates a pair of indistinguishable sockets and stores them in fds." + ], + "socket_get_option": [ + "mixed socket_get_option(resource socket, int level, int optname)", + "Gets socket options for the socket" + ], + "socket_getpeername": [ + "bool socket_getpeername(resource socket, string &addr[, int &port])", + "Queries the remote side of the given socket which may either result in host/port or in a UNIX filesystem path, dependent on its type." + ], + "socket_getsockname": [ + "bool socket_getsockname(resource socket, string &addr[, int &port])", + "Queries the remote side of the given socket which may either result in host/port or in a UNIX filesystem path, dependent on its type." + ], + "socket_last_error": [ + "int socket_last_error([resource socket])", + "Returns the last socket error (either the last used or the provided socket resource)" + ], + "socket_listen": [ + "bool socket_listen(resource socket[, int backlog])", + "Sets the maximum number of connections allowed to be waited for on the socket specified by fd" + ], + "socket_read": [ + "string socket_read(resource socket, int length [, int type])", + "Reads a maximum of length bytes from socket" + ], + "socket_recv": [ + "int socket_recv(resource socket, string &buf, int len, int flags)", + "Receives data from a connected socket" + ], + "socket_recvfrom": [ + "int socket_recvfrom(resource socket, string &buf, int len, int flags, string &name [, int &port])", + "Receives data from a socket, connected or not" + ], + "socket_select": [ + "int socket_select(array &read_fds, array &write_fds, array &except_fds, int tv_sec[, int tv_usec])", + "Runs the select() system call on the sets mentioned with a timeout specified by tv_sec and tv_usec" + ], + "socket_send": [ + "int socket_send(resource socket, string buf, int len, int flags)", + "Sends data to a connected socket" + ], + "socket_sendto": [ + "int socket_sendto(resource socket, string buf, int len, int flags, string addr [, int port])", + "Sends a message to a socket, whether it is connected or not" + ], + "socket_set_block": [ + "bool socket_set_block(resource socket)", + "Sets blocking mode on a socket resource" + ], + "socket_set_nonblock": [ + "bool socket_set_nonblock(resource socket)", + "Sets nonblocking mode on a socket resource" + ], + "socket_set_option": [ + "bool socket_set_option(resource socket, int level, int optname, int|array optval)", + "Sets socket options for the socket" + ], + "socket_shutdown": [ + "bool socket_shutdown(resource socket[, int how])", + "Shuts down a socket for receiving, sending, or both." + ], + "socket_strerror": [ + "string socket_strerror(int errno)", + "Returns a string describing an error" + ], + "socket_write": [ + "int socket_write(resource socket, string buf[, int length])", + "Writes the buffer to the socket resource, length is optional" + ], + "solid_fetch_prev": [ + "bool solid_fetch_prev(resource result_id)", + "" + ], + "sort": [ + "bool sort(array &array_arg [, int sort_flags])", + "Sort an array" + ], + "soundex": [ + "string soundex(string str)", + "Calculate the soundex key of a string" + ], + "spl_autoload": [ + "void spl_autoload(string class_name [, string file_extensions])", + "Default implementation for __autoload()" + ], + "spl_autoload_call": [ + "void spl_autoload_call(string class_name)", + "Try all registerd autoload function to load the requested class" + ], + "spl_autoload_extensions": [ + "string spl_autoload_extensions([string file_extensions])", + "Register and return default file extensions for spl_autoload" + ], + "spl_autoload_functions": [ + "false|array spl_autoload_functions()", + "Return all registered __autoload() functionns" + ], + "spl_autoload_register": [ + "bool spl_autoload_register([mixed autoload_function = \"spl_autoload\" [, throw = true [, prepend]]])", + "Register given function as __autoload() implementation" + ], + "spl_autoload_unregister": [ + "bool spl_autoload_unregister(mixed autoload_function)", + "Unregister given function as __autoload() implementation" + ], + "spl_classes": [ + "array spl_classes()", + "Return an array containing the names of all clsses and interfaces defined in SPL" + ], + "spl_object_hash": [ + "string spl_object_hash(object obj)", + "Return hash id for given object" + ], + "split": [ + "array split(string pattern, string string [, int limit])", + "Split string into array by regular expression" + ], + "spliti": [ + "array spliti(string pattern, string string [, int limit])", + "Split string into array by regular expression case-insensitive" + ], + "sprintf": [ + "string sprintf(string format [, mixed arg1 [, mixed ...]])", + "Return a formatted string" + ], + "sql_regcase": [ + "string sql_regcase(string string)", + "Make regular expression for case insensitive match" + ], + "sqlite_array_query": [ + "array sqlite_array_query(resource db, string query [ , int result_type [, bool decode_binary]])", + "Executes a query against a given database and returns an array of arrays." + ], + "sqlite_busy_timeout": [ + "void sqlite_busy_timeout(resource db, int ms)", + "Set busy timeout duration. If ms <= 0, all busy handlers are disabled." + ], + "sqlite_changes": [ + "int sqlite_changes(resource db)", + "Returns the number of rows that were changed by the most recent SQL statement." + ], + "sqlite_close": [ + "void sqlite_close(resource db)", + "Closes an open sqlite database." + ], + "sqlite_column": [ + "mixed sqlite_column(resource result, mixed index_or_name [, bool decode_binary])", + "Fetches a column from the current row of a result set." + ], + "sqlite_create_aggregate": [ + "bool sqlite_create_aggregate(resource db, string funcname, mixed step_func, mixed finalize_func[, long num_args])", + "Registers an aggregate function for queries." + ], + "sqlite_create_function": [ + "bool sqlite_create_function(resource db, string funcname, mixed callback[, long num_args])", + "Registers a \"regular\" function for queries." + ], + "sqlite_current": [ + "array sqlite_current(resource result [, int result_type [, bool decode_binary]])", + "Fetches the current row from a result set as an array." + ], + "sqlite_error_string": [ + "string sqlite_error_string(int error_code)", + "Returns the textual description of an error code." + ], + "sqlite_escape_string": [ + "string sqlite_escape_string(string item)", + "Escapes a string for use as a query parameter." + ], + "sqlite_exec": [ + "boolean sqlite_exec(string query, resource db[, string &error_message])", + "Executes a result-less query against a given database" + ], + "sqlite_factory": [ + "object sqlite_factory(string filename [, int mode [, string &error_message]])", + "Opens a SQLite database and creates an object for it. Will create the database if it does not exist." + ], + "sqlite_fetch_all": [ + "array sqlite_fetch_all(resource result [, int result_type [, bool decode_binary]])", + "Fetches all rows from a result set as an array of arrays." + ], + "sqlite_fetch_array": [ + "array sqlite_fetch_array(resource result [, int result_type [, bool decode_binary]])", + "Fetches the next row from a result set as an array." + ], + "sqlite_fetch_column_types": [ + "resource sqlite_fetch_column_types(string table_name, resource db [, int result_type])", + "Return an array of column types from a particular table." + ], + "sqlite_fetch_object": [ + "object sqlite_fetch_object(resource result [, string class_name [, NULL|array ctor_params [, bool decode_binary]]])", + "Fetches the next row from a result set as an object." + ], + "sqlite_fetch_single": [ + "string sqlite_fetch_single(resource result [, bool decode_binary])", + "Fetches the first column of a result set as a string." + ], + "sqlite_field_name": [ + "string sqlite_field_name(resource result, int field_index)", + "Returns the name of a particular field of a result set." + ], + "sqlite_has_prev": [ + "bool sqlite_has_prev(resource result)", + "* Returns whether a previous row is available." + ], + "sqlite_key": [ + "int sqlite_key(resource result)", + "Return the current row index of a buffered result." + ], + "sqlite_last_error": [ + "int sqlite_last_error(resource db)", + "Returns the error code of the last error for a database." + ], + "sqlite_last_insert_rowid": [ + "int sqlite_last_insert_rowid(resource db)", + "Returns the rowid of the most recently inserted row." + ], + "sqlite_libencoding": [ + "string sqlite_libencoding()", + "Returns the encoding (iso8859 or UTF-8) of the linked SQLite library." + ], + "sqlite_libversion": [ + "string sqlite_libversion()", + "Returns the version of the linked SQLite library." + ], + "sqlite_next": [ + "bool sqlite_next(resource result)", + "Seek to the next row number of a result set." + ], + "sqlite_num_fields": [ + "int sqlite_num_fields(resource result)", + "Returns the number of fields in a result set." + ], + "sqlite_num_rows": [ + "int sqlite_num_rows(resource result)", + "Returns the number of rows in a buffered result set." + ], + "sqlite_open": [ + "resource sqlite_open(string filename [, int mode [, string &error_message]])", + "Opens a SQLite database. Will create the database if it does not exist." + ], + "sqlite_popen": [ + "resource sqlite_popen(string filename [, int mode [, string &error_message]])", + "Opens a persistent handle to a SQLite database. Will create the database if it does not exist." + ], + "sqlite_prev": [ + "bool sqlite_prev(resource result)", + "* Seek to the previous row number of a result set." + ], + "sqlite_query": [ + "resource sqlite_query(string query, resource db [, int result_type [, string &error_message]])", + "Executes a query against a given database and returns a result handle." + ], + "sqlite_rewind": [ + "bool sqlite_rewind(resource result)", + "Seek to the first row number of a buffered result set." + ], + "sqlite_seek": [ + "bool sqlite_seek(resource result, int row)", + "Seek to a particular row number of a buffered result set." + ], + "sqlite_single_query": [ + "array sqlite_single_query(resource db, string query [, bool first_row_only [, bool decode_binary]])", + "Executes a query and returns either an array for one single column or the value of the first row." + ], + "sqlite_udf_decode_binary": [ + "string sqlite_udf_decode_binary(string data)", + "Decode binary encoding on a string parameter passed to an UDF." + ], + "sqlite_udf_encode_binary": [ + "string sqlite_udf_encode_binary(string data)", + "Apply binary encoding (if required) to a string to return from an UDF." + ], + "sqlite_unbuffered_query": [ + "resource sqlite_unbuffered_query(string query, resource db [ , int result_type [, string &error_message]])", + "Executes a query that does not prefetch and buffer all data." + ], + "sqlite_valid": [ + "bool sqlite_valid(resource result)", + "Returns whether more rows are available." + ], + "sqrt": [ + "float sqrt(float number)", + "Returns the square root of the number" + ], + "srand": [ + "void srand([int seed])", + "Seeds random number generator" + ], + "sscanf": [ + "mixed sscanf(string str, string format [, string ...])", + "Implements an ANSI C compatible sscanf" + ], + "stat": [ + "array stat(string filename)", + "Give information about a file" + ], + "str_getcsv": [ + "array str_getcsv(string input[, string delimiter[, string enclosure[, string escape]]])", + "Parse a CSV string into an array" + ], + "str_ireplace": [ + "mixed str_ireplace(mixed search, mixed replace, mixed subject [, int &replace_count])", + "Replaces all occurrences of search in haystack with replace / case-insensitive" + ], + "str_pad": [ + "string str_pad(string input, int pad_length [, string pad_string [, int pad_type]])", + "Returns input string padded on the left or right to specified length with pad_string" + ], + "str_repeat": [ + "string str_repeat(string input, int mult)", + "Returns the input string repeat mult times" + ], + "str_replace": [ + "mixed str_replace(mixed search, mixed replace, mixed subject [, int &replace_count])", + "Replaces all occurrences of search in haystack with replace" + ], + "str_rot13": [ + "string str_rot13(string str)", + "Perform the rot13 transform on a string" + ], + "str_shuffle": [ + "void str_shuffle(string str)", + "Shuffles string. One permutation of all possible is created" + ], + "str_split": [ + "array str_split(string str [, int split_length])", + "Convert a string to an array. If split_length is specified, break the string down into chunks each split_length characters long." + ], + "str_word_count": [ + "mixed str_word_count(string str, [int format [, string charlist]])", + "Counts the number of words inside a string. If format of 1 is specified, then the function will return an array containing all the words found inside the string. If format of 2 is specified, then the function will return an associated array where the position of the word is the key and the word itself is the value. For the purpose of this function, 'word' is defined as a locale dependent string containing alphabetic characters, which also may contain, but not start with \"'\" and \"-\" characters." + ], + "strcasecmp": [ + "int strcasecmp(string str1, string str2)", + "Binary safe case-insensitive string comparison" + ], + "strchr": [ + "string strchr(string haystack, string needle)", + "An alias for strstr" + ], + "strcmp": [ + "int strcmp(string str1, string str2)", + "Binary safe string comparison" + ], + "strcoll": [ + "int strcoll(string str1, string str2)", + "Compares two strings using the current locale" + ], + "strcspn": [ + "int strcspn(string str, string mask [, start [, len]])", + "Finds length of initial segment consisting entirely of characters not found in mask. If start or/and length is provide works like strcspn(substr($s,$start,$len),$bad_chars)" + ], + "stream_bucket_append": [ + "void stream_bucket_append(resource brigade, resource bucket)", + "Append bucket to brigade" + ], + "stream_bucket_make_writeable": [ + "object stream_bucket_make_writeable(resource brigade)", + "Return a bucket object from the brigade for operating on" + ], + "stream_bucket_new": [ + "resource stream_bucket_new(resource stream, string buffer)", + "Create a new bucket for use on the current stream" + ], + "stream_bucket_prepend": [ + "void stream_bucket_prepend(resource brigade, resource bucket)", + "Prepend bucket to brigade" + ], + "stream_context_create": [ + "resource stream_context_create([array options[, array params]])", + "Create a file context and optionally set parameters" + ], + "stream_context_get_default": [ + "resource stream_context_get_default([array options])", + "Get a handle on the default file/stream context and optionally set parameters" + ], + "stream_context_get_options": [ + "array stream_context_get_options(resource context|resource stream)", + "Retrieve options for a stream/wrapper/context" + ], + "stream_context_get_params": [ + "array stream_context_get_params(resource context|resource stream)", + "Get parameters of a file context" + ], + "stream_context_set_default": [ + "resource stream_context_set_default(array options)", + "Set default file/stream context, returns the context as a resource" + ], + "stream_context_set_option": [ + "bool stream_context_set_option(resource context|resource stream, string wrappername, string optionname, mixed value)", + "Set an option for a wrapper" + ], + "stream_context_set_params": [ + "bool stream_context_set_params(resource context|resource stream, array options)", + "Set parameters for a file context" + ], + "stream_copy_to_stream": [ + "long stream_copy_to_stream(resource source, resource dest [, long maxlen [, long pos]])", + "Reads up to maxlen bytes from source stream and writes them to dest stream." + ], + "stream_filter_append": [ + "resource stream_filter_append(resource stream, string filtername[, int read_write[, string filterparams]])", + "Append a filter to a stream" + ], + "stream_filter_prepend": [ + "resource stream_filter_prepend(resource stream, string filtername[, int read_write[, string filterparams]])", + "Prepend a filter to a stream" + ], + "stream_filter_register": [ + "bool stream_filter_register(string filtername, string classname)", + "Registers a custom filter handler class" + ], + "stream_filter_remove": [ + "bool stream_filter_remove(resource stream_filter)", + "Flushes any data in the filter's internal buffer, removes it from the chain, and frees the resource" + ], + "stream_get_contents": [ + "string stream_get_contents(resource source [, long maxlen [, long offset]])", + "Reads all remaining bytes (or up to maxlen bytes) from a stream and returns them as a string." + ], + "stream_get_filters": [ + "array stream_get_filters(void)", + "Returns a list of registered filters" + ], + "stream_get_line": [ + "string stream_get_line(resource stream, int maxlen [, string ending])", + "Read up to maxlen bytes from a stream or until the ending string is found" + ], + "stream_get_meta_data": [ + "array stream_get_meta_data(resource fp)", + "Retrieves header/meta data from streams/file pointers" + ], + "stream_get_transports": [ + "array stream_get_transports()", + "Retrieves list of registered socket transports" + ], + "stream_get_wrappers": [ + "array stream_get_wrappers()", + "Retrieves list of registered stream wrappers" + ], + "stream_is_local": [ + "bool stream_is_local(resource stream|string url)", + "" + ], + "stream_resolve_include_path": [ + "string stream_resolve_include_path(string filename)", + "Determine what file will be opened by calls to fopen() with a relative path" + ], + "stream_select": [ + "int stream_select(array &read_streams, array &write_streams, array &except_streams, int tv_sec[, int tv_usec])", + "Runs the select() system call on the sets of streams with a timeout specified by tv_sec and tv_usec" + ], + "stream_set_blocking": [ + "bool stream_set_blocking(resource socket, int mode)", + "Set blocking/non-blocking mode on a socket or stream" + ], + "stream_set_timeout": [ + "bool stream_set_timeout(resource stream, int seconds [, int microseconds])", + "Set timeout on stream read to seconds + microseonds" + ], + "stream_set_write_buffer": [ + "int stream_set_write_buffer(resource fp, int buffer)", + "Set file write buffer" + ], + "stream_socket_accept": [ + "resource stream_socket_accept(resource serverstream, [ double timeout [, string &peername ]])", + "Accept a client connection from a server socket" + ], + "stream_socket_client": [ + "resource stream_socket_client(string remoteaddress [, long &errcode [, string &errstring [, double timeout [, long flags [, resource context]]]]])", + "Open a client connection to a remote address" + ], + "stream_socket_enable_crypto": [ + "int stream_socket_enable_crypto(resource stream, bool enable [, int cryptokind [, resource sessionstream]])", + "Enable or disable a specific kind of crypto on the stream" + ], + "stream_socket_get_name": [ + "string stream_socket_get_name(resource stream, bool want_peer)", + "Returns either the locally bound or remote name for a socket stream" + ], + "stream_socket_pair": [ + "array stream_socket_pair(int domain, int type, int protocol)", + "Creates a pair of connected, indistinguishable socket streams" + ], + "stream_socket_recvfrom": [ + "string stream_socket_recvfrom(resource stream, long amount [, long flags [, string &remote_addr]])", + "Receives data from a socket stream" + ], + "stream_socket_sendto": [ + "long stream_socket_sendto(resouce stream, string data [, long flags [, string target_addr]])", + "Send data to a socket stream. If target_addr is specified it must be in dotted quad (or [ipv6]) format" + ], + "stream_socket_server": [ + "resource stream_socket_server(string localaddress [, long &errcode [, string &errstring [, long flags [, resource context]]]])", + "Create a server socket bound to localaddress" + ], + "stream_socket_shutdown": [ + "int stream_socket_shutdown(resource stream, int how)", + "causes all or part of a full-duplex connection on the socket associated with stream to be shut down. If how is SHUT_RD, further receptions will be disallowed. If how is SHUT_WR, further transmissions will be disallowed. If how is SHUT_RDWR, further receptions and transmissions will be disallowed." + ], + "stream_supports_lock": [ + "bool stream_supports_lock(resource stream)", + "Tells wether the stream supports locking through flock()." + ], + "stream_wrapper_register": [ + "bool stream_wrapper_register(string protocol, string classname[, integer flags])", + "Registers a custom URL protocol handler class" + ], + "stream_wrapper_restore": [ + "bool stream_wrapper_restore(string protocol)", + "Restore the original protocol handler, overriding if necessary" + ], + "stream_wrapper_unregister": [ + "bool stream_wrapper_unregister(string protocol)", + "Unregister a wrapper for the life of the current request." + ], + "strftime": [ + "string strftime(string format [, int timestamp])", + "Format a local time/date according to locale settings" + ], + "strip_tags": [ + "string strip_tags(string str [, string allowable_tags])", + "Strips HTML and PHP tags from a string" + ], + "stripcslashes": [ + "string stripcslashes(string str)", + "Strips backslashes from a string. Uses C-style conventions" + ], + "stripos": [ + "int stripos(string haystack, string needle [, int offset])", + "Finds position of first occurrence of a string within another, case insensitive" + ], + "stripslashes": [ + "string stripslashes(string str)", + "Strips backslashes from a string" + ], + "stristr": [ + "string stristr(string haystack, string needle[, bool part])", + "Finds first occurrence of a string within another, case insensitive" + ], + "strlen": [ + "int strlen(string str)", + "Get string length" + ], + "strnatcasecmp": [ + "int strnatcasecmp(string s1, string s2)", + "Returns the result of case-insensitive string comparison using 'natural' algorithm" + ], + "strnatcmp": [ + "int strnatcmp(string s1, string s2)", + "Returns the result of string comparison using 'natural' algorithm" + ], + "strncasecmp": [ + "int strncasecmp(string str1, string str2, int len)", + "Binary safe string comparison" + ], + "strncmp": [ + "int strncmp(string str1, string str2, int len)", + "Binary safe string comparison" + ], + "strpbrk": [ + "array strpbrk(string haystack, string char_list)", + "Search a string for any of a set of characters" + ], + "strpos": [ + "int strpos(string haystack, string needle [, int offset])", + "Finds position of first occurrence of a string within another" + ], + "strptime": [ + "string strptime(string timestamp, string format)", + "Parse a time/date generated with strftime()" + ], + "strrchr": [ + "string strrchr(string haystack, string needle)", + "Finds the last occurrence of a character in a string within another" + ], + "strrev": [ + "string strrev(string str)", + "Reverse a string" + ], + "strripos": [ + "int strripos(string haystack, string needle [, int offset])", + "Finds position of last occurrence of a string within another string" + ], + "strrpos": [ + "int strrpos(string haystack, string needle [, int offset])", + "Finds position of last occurrence of a string within another string" + ], + "strspn": [ + "int strspn(string str, string mask [, start [, len]])", + "Finds length of initial segment consisting entirely of characters found in mask. If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)" + ], + "strstr": [ + "string strstr(string haystack, string needle[, bool part])", + "Finds first occurrence of a string within another" + ], + "strtok": [ + "string strtok([string str,] string token)", + "Tokenize a string" + ], + "strtolower": [ + "string strtolower(string str)", + "Makes a string lowercase" + ], + "strtotime": [ + "int strtotime(string time [, int now ])", + "Convert string representation of date and time to a timestamp" + ], + "strtoupper": [ + "string strtoupper(string str)", + "Makes a string uppercase" + ], + "strtr": [ + "string strtr(string str, string from[, string to])", + "Translates characters in str using given translation tables" + ], + "strval": [ + "string strval(mixed var)", + "Get the string value of a variable" + ], + "substr": [ + "string substr(string str, int start [, int length])", + "Returns part of a string" + ], + "substr_compare": [ + "int substr_compare(string main_str, string str, int offset [, int length [, bool case_sensitivity]])", + "Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters" + ], + "substr_count": [ + "int substr_count(string haystack, string needle [, int offset [, int length]])", + "Returns the number of times a substring occurs in the string" + ], + "substr_replace": [ + "mixed substr_replace(mixed str, mixed repl, mixed start [, mixed length])", + "Replaces part of a string with another string" + ], + "sybase_affected_rows": [ + "int sybase_affected_rows([resource link_id])", + "Get number of affected rows in last query" + ], + "sybase_close": [ + "bool sybase_close([resource link_id])", + "Close Sybase connection" + ], + "sybase_connect": [ + "int sybase_connect([string host [, string user [, string password [, string charset [, string appname [, bool new]]]]]])", + "Open Sybase server connection" + ], + "sybase_data_seek": [ + "bool sybase_data_seek(resource result, int offset)", + "Move internal row pointer" + ], + "sybase_deadlock_retry_count": [ + "void sybase_deadlock_retry_count(int retry_count)", + "Sets deadlock retry count" + ], + "sybase_fetch_array": [ + "array sybase_fetch_array(resource result)", + "Fetch row as array" + ], + "sybase_fetch_assoc": [ + "array sybase_fetch_assoc(resource result)", + "Fetch row as array without numberic indices" + ], + "sybase_fetch_field": [ + "object sybase_fetch_field(resource result [, int offset])", + "Get field information" + ], + "sybase_fetch_object": [ + "object sybase_fetch_object(resource result [, mixed object])", + "Fetch row as object" + ], + "sybase_fetch_row": [ + "array sybase_fetch_row(resource result)", + "Get row as enumerated array" + ], + "sybase_field_seek": [ + "bool sybase_field_seek(resource result, int offset)", + "Set field offset" + ], + "sybase_free_result": [ + "bool sybase_free_result(resource result)", + "Free result memory" + ], + "sybase_get_last_message": [ + "string sybase_get_last_message(void)", + "Returns the last message from server (over min_message_severity)" + ], + "sybase_min_client_severity": [ + "void sybase_min_client_severity(int severity)", + "Sets minimum client severity" + ], + "sybase_min_server_severity": [ + "void sybase_min_server_severity(int severity)", + "Sets minimum server severity" + ], + "sybase_num_fields": [ + "int sybase_num_fields(resource result)", + "Get number of fields in result" + ], + "sybase_num_rows": [ + "int sybase_num_rows(resource result)", + "Get number of rows in result" + ], + "sybase_pconnect": [ + "int sybase_pconnect([string host [, string user [, string password [, string charset [, string appname]]]]])", + "Open persistent Sybase connection" + ], + "sybase_query": [ + "int sybase_query(string query [, resource link_id])", + "Send Sybase query" + ], + "sybase_result": [ + "string sybase_result(resource result, int row, mixed field)", + "Get result data" + ], + "sybase_select_db": [ + "bool sybase_select_db(string database [, resource link_id])", + "Select Sybase database" + ], + "sybase_set_message_handler": [ + "bool sybase_set_message_handler(mixed error_func [, resource connection])", + "Set the error handler, to be called when a server message is raised. If error_func is NULL the handler will be deleted" + ], + "sybase_unbuffered_query": [ + "int sybase_unbuffered_query(string query [, resource link_id])", + "Send Sybase query" + ], + "symlink": [ + "int symlink(string target, string link)", + "Create a symbolic link" + ], + "sys_get_temp_dir": [ + "string sys_get_temp_dir()", + "Returns directory path used for temporary files" + ], + "sys_getloadavg": [ + "array sys_getloadavg()", + "" + ], + "syslog": [ + "bool syslog(int priority, string message)", + "Generate a system log message" + ], + "system": [ + "int system(string command [, int &return_value])", + "Execute an external program and display output" + ], + "tan": [ + "float tan(float number)", + "Returns the tangent of the number in radians" + ], + "tanh": [ + "float tanh(float number)", + "Returns the hyperbolic tangent of the number, defined as sinh(number)/cosh(number)" + ], + "tempnam": [ + "string tempnam(string dir, string prefix)", + "Create a unique filename in a directory" + ], + "textdomain": [ + "string textdomain(string domain)", + "Set the textdomain to \"domain\". Returns the current domain" + ], + "tidy_access_count": [ + "int tidy_access_count()", + "Returns the Number of Tidy accessibility warnings encountered for specified document." + ], + "tidy_clean_repair": [ + "boolean tidy_clean_repair()", + "Execute configured cleanup and repair operations on parsed markup" + ], + "tidy_config_count": [ + "int tidy_config_count()", + "Returns the Number of Tidy configuration errors encountered for specified document." + ], + "tidy_diagnose": [ + "boolean tidy_diagnose()", + "Run configured diagnostics on parsed and repaired markup." + ], + "tidy_error_count": [ + "int tidy_error_count()", + "Returns the Number of Tidy errors encountered for specified document." + ], + "tidy_get_body": [ + "TidyNode tidy_get_body(resource tidy)", + "Returns a TidyNode Object starting from the tag of the tidy parse tree" + ], + "tidy_get_config": [ + "array tidy_get_config()", + "Get current Tidy configuarion" + ], + "tidy_get_error_buffer": [ + "string tidy_get_error_buffer([boolean detailed])", + "Return warnings and errors which occured parsing the specified document" + ], + "tidy_get_head": [ + "TidyNode tidy_get_head()", + "Returns a TidyNode Object starting from the tag of the tidy parse tree" + ], + "tidy_get_html": [ + "TidyNode tidy_get_html()", + "Returns a TidyNode Object starting from the tag of the tidy parse tree" + ], + "tidy_get_html_ver": [ + "int tidy_get_html_ver()", + "Get the Detected HTML version for the specified document." + ], + "tidy_get_opt_doc": [ + "string tidy_get_opt_doc(tidy resource, string optname)", + "Returns the documentation for the given option name" + ], + "tidy_get_output": [ + "string tidy_get_output()", + "Return a string representing the parsed tidy markup" + ], + "tidy_get_release": [ + "string tidy_get_release()", + "Get release date (version) for Tidy library" + ], + "tidy_get_root": [ + "TidyNode tidy_get_root()", + "Returns a TidyNode Object representing the root of the tidy parse tree" + ], + "tidy_get_status": [ + "int tidy_get_status()", + "Get status of specfied document." + ], + "tidy_getopt": [ + "mixed tidy_getopt(string option)", + "Returns the value of the specified configuration option for the tidy document." + ], + "tidy_is_xhtml": [ + "boolean tidy_is_xhtml()", + "Indicates if the document is a XHTML document." + ], + "tidy_is_xml": [ + "boolean tidy_is_xml()", + "Indicates if the document is a generic (non HTML/XHTML) XML document." + ], + "tidy_parse_file": [ + "boolean tidy_parse_file(string file [, mixed config_options [, string encoding [, bool use_include_path]]])", + "Parse markup in file or URI" + ], + "tidy_parse_string": [ + "bool tidy_parse_string(string input [, mixed config_options [, string encoding]])", + "Parse a document stored in a string" + ], + "tidy_repair_file": [ + "boolean tidy_repair_file(string filename [, mixed config_file [, string encoding [, bool use_include_path]]])", + "Repair a file using an optionally provided configuration file" + ], + "tidy_repair_string": [ + "boolean tidy_repair_string(string data [, mixed config_file [, string encoding]])", + "Repair a string using an optionally provided configuration file" + ], + "tidy_warning_count": [ + "int tidy_warning_count()", + "Returns the Number of Tidy warnings encountered for specified document." + ], + "time": [ + "int time(void)", + "Return current UNIX timestamp" + ], + "time_nanosleep": [ + "mixed time_nanosleep(long seconds, long nanoseconds)", + "Delay for a number of seconds and nano seconds" + ], + "time_sleep_until": [ + "mixed time_sleep_until(float timestamp)", + "Make the script sleep until the specified time" + ], + "timezone_abbreviations_list": [ + "array timezone_abbreviations_list()", + "Returns associative array containing dst, offset and the timezone name" + ], + "timezone_identifiers_list": [ + "array timezone_identifiers_list([long what[, string country]])", + "Returns numerically index array with all timezone identifiers." + ], + "timezone_location_get": [ + "array timezone_location_get()", + "Returns location information for a timezone, including country code, latitude/longitude and comments" + ], + "timezone_name_from_abbr": [ + "string timezone_name_from_abbr(string abbr[, long gmtOffset[, long isdst]])", + "Returns the timezone name from abbrevation" + ], + "timezone_name_get": [ + "string timezone_name_get(DateTimeZone object)", + "Returns the name of the timezone." + ], + "timezone_offset_get": [ + "long timezone_offset_get(DateTimeZone object, DateTime object)", + "Returns the timezone offset." + ], + "timezone_open": [ + "DateTimeZone timezone_open(string timezone)", + "Returns new DateTimeZone object" + ], + "timezone_transitions_get": [ + "array timezone_transitions_get(DateTimeZone object [, long timestamp_begin [, long timestamp_end ]])", + "Returns numerically indexed array containing associative array for all transitions in the specified range for the timezone." + ], + "timezone_version_get": [ + "array timezone_version_get()", + "Returns the Olson database version number." + ], + "tmpfile": [ + "resource tmpfile(void)", + "Create a temporary file that will be deleted automatically after use" + ], + "token_get_all": [ + "array token_get_all(string source)", + "" + ], + "token_name": [ + "string token_name(int type)", + "" + ], + "touch": [ + "bool touch(string filename [, int time [, int atime]])", + "Set modification time of file" + ], + "trigger_error": [ + "void trigger_error(string messsage [, int error_type])", + "Generates a user-level error/warning/notice message" + ], + "trim": [ + "string trim(string str [, string character_mask])", + "Strips whitespace from the beginning and end of a string" + ], + "uasort": [ + "bool uasort(array array_arg, string cmp_function)", + "Sort an array with a user-defined comparison function and maintain index association" + ], + "ucfirst": [ + "string ucfirst(string str)", + "Make a string's first character lowercase" + ], + "ucwords": [ + "string ucwords(string str)", + "Uppercase the first character of every word in a string" + ], + "uksort": [ + "bool uksort(array array_arg, string cmp_function)", + "Sort an array by keys using a user-defined comparison function" + ], + "umask": [ + "int umask([int mask])", + "Return or change the umask" + ], + "uniqid": [ + "string uniqid([string prefix [, bool more_entropy]])", + "Generates a unique ID" + ], + "unixtojd": [ + "int unixtojd([int timestamp])", + "Convert UNIX timestamp to Julian Day" + ], + "unlink": [ + "bool unlink(string filename[, context context])", + "Delete a file" + ], + "unpack": [ + "array unpack(string format, string input)", + "Unpack binary string into named array elements according to format argument" + ], + "unregister_tick_function": [ + "void unregister_tick_function(string function_name)", + "Unregisters a tick callback function" + ], + "unserialize": [ + "mixed unserialize(string variable_representation)", + "Takes a string representation of variable and recreates it" + ], + "unset": [ + "void unset (mixed var [, mixed var])", + "Unset a given variable" + ], + "urldecode": [ + "string urldecode(string str)", + "Decodes URL-encoded string" + ], + "urlencode": [ + "string urlencode(string str)", + "URL-encodes string" + ], + "usleep": [ + "void usleep(int micro_seconds)", + "Delay for a given number of micro seconds" + ], + "usort": [ + "bool usort(array array_arg, string cmp_function)", + "Sort an array by values using a user-defined comparison function" + ], + "utf8_decode": [ + "string utf8_decode(string data)", + "Converts a UTF-8 encoded string to ISO-8859-1" + ], + "utf8_encode": [ + "string utf8_encode(string data)", + "Encodes an ISO-8859-1 string to UTF-8" + ], + "var_dump": [ + "void var_dump(mixed var)", + "Dumps a string representation of variable to output" + ], + "var_export": [ + "mixed var_export(mixed var [, bool return])", + "Outputs or returns a string representation of a variable" + ], + "variant_abs": [ + "mixed variant_abs(mixed left)", + "Returns the absolute value of a variant" + ], + "variant_add": [ + "mixed variant_add(mixed left, mixed right)", + "\"Adds\" two variant values together and returns the result" + ], + "variant_and": [ + "mixed variant_and(mixed left, mixed right)", + "performs a bitwise AND operation between two variants and returns the result" + ], + "variant_cast": [ + "object variant_cast(object variant, int type)", + "Convert a variant into a new variant object of another type" + ], + "variant_cat": [ + "mixed variant_cat(mixed left, mixed right)", + "concatenates two variant values together and returns the result" + ], + "variant_cmp": [ + "int variant_cmp(mixed left, mixed right [, int lcid [, int flags]])", + "Compares two variants" + ], + "variant_date_from_timestamp": [ + "object variant_date_from_timestamp(int timestamp)", + "Returns a variant date representation of a unix timestamp" + ], + "variant_date_to_timestamp": [ + "int variant_date_to_timestamp(object variant)", + "Converts a variant date/time value to unix timestamp" + ], + "variant_div": [ + "mixed variant_div(mixed left, mixed right)", + "Returns the result from dividing two variants" + ], + "variant_eqv": [ + "mixed variant_eqv(mixed left, mixed right)", + "Performs a bitwise equivalence on two variants" + ], + "variant_fix": [ + "mixed variant_fix(mixed left)", + "Returns the integer part ? of a variant" + ], + "variant_get_type": [ + "int variant_get_type(object variant)", + "Returns the VT_XXX type code for a variant" + ], + "variant_idiv": [ + "mixed variant_idiv(mixed left, mixed right)", + "Converts variants to integers and then returns the result from dividing them" + ], + "variant_imp": [ + "mixed variant_imp(mixed left, mixed right)", + "Performs a bitwise implication on two variants" + ], + "variant_int": [ + "mixed variant_int(mixed left)", + "Returns the integer portion of a variant" + ], + "variant_mod": [ + "mixed variant_mod(mixed left, mixed right)", + "Divides two variants and returns only the remainder" + ], + "variant_mul": [ + "mixed variant_mul(mixed left, mixed right)", + "multiplies the values of the two variants and returns the result" + ], + "variant_neg": [ + "mixed variant_neg(mixed left)", + "Performs logical negation on a variant" + ], + "variant_not": [ + "mixed variant_not(mixed left)", + "Performs bitwise not negation on a variant" + ], + "variant_or": [ + "mixed variant_or(mixed left, mixed right)", + "Performs a logical disjunction on two variants" + ], + "variant_pow": [ + "mixed variant_pow(mixed left, mixed right)", + "Returns the result of performing the power function with two variants" + ], + "variant_round": [ + "mixed variant_round(mixed left, int decimals)", + "Rounds a variant to the specified number of decimal places" + ], + "variant_set": [ + "void variant_set(object variant, mixed value)", + "Assigns a new value for a variant object" + ], + "variant_set_type": [ + "void variant_set_type(object variant, int type)", + "Convert a variant into another type. Variant is modified \"in-place\"" + ], + "variant_sub": [ + "mixed variant_sub(mixed left, mixed right)", + "subtracts the value of the right variant from the left variant value and returns the result" + ], + "variant_xor": [ + "mixed variant_xor(mixed left, mixed right)", + "Performs a logical exclusion on two variants" + ], + "version_compare": [ + "int version_compare(string ver1, string ver2 [, string oper])", + "Compares two \"PHP-standardized\" version number strings" + ], + "vfprintf": [ + "int vfprintf(resource stream, string format, array args)", + "Output a formatted string into a stream" + ], + "virtual": [ + "bool virtual(string filename)", + "Perform an Apache sub-request" + ], + "vprintf": [ + "int vprintf(string format, array args)", + "Output a formatted string" + ], + "vsprintf": [ + "string vsprintf(string format, array args)", + "Return a formatted string" + ], + "wddx_add_vars": [ + "int wddx_add_vars(resource packet_id, mixed var_names [, mixed ...])", + "Serializes given variables and adds them to packet given by packet_id" + ], + "wddx_deserialize": [ + "mixed wddx_deserialize(mixed packet)", + "Deserializes given packet and returns a PHP value" + ], + "wddx_packet_end": [ + "string wddx_packet_end(resource packet_id)", + "Ends specified WDDX packet and returns the string containing the packet" + ], + "wddx_packet_start": [ + "resource wddx_packet_start([string comment])", + "Starts a WDDX packet with optional comment and returns the packet id" + ], + "wddx_serialize_value": [ + "string wddx_serialize_value(mixed var [, string comment])", + "Creates a new packet and serializes the given value" + ], + "wddx_serialize_vars": [ + "string wddx_serialize_vars(mixed var_name [, mixed ...])", + "Creates a new packet and serializes given variables into a struct" + ], + "wordwrap": [ + "string wordwrap(string str [, int width [, string break [, boolean cut]]])", + "Wraps buffer to selected number of characters using string break char" + ], + "xml_error_string": [ + "string xml_error_string(int code)", + "Get XML parser error string" + ], + "xml_get_current_byte_index": [ + "int xml_get_current_byte_index(resource parser)", + "Get current byte index for an XML parser" + ], + "xml_get_current_column_number": [ + "int xml_get_current_column_number(resource parser)", + "Get current column number for an XML parser" + ], + "xml_get_current_line_number": [ + "int xml_get_current_line_number(resource parser)", + "Get current line number for an XML parser" + ], + "xml_get_error_code": [ + "int xml_get_error_code(resource parser)", + "Get XML parser error code" + ], + "xml_parse": [ + "int xml_parse(resource parser, string data [, int isFinal])", + "Start parsing an XML document" + ], + "xml_parse_into_struct": [ + "int xml_parse_into_struct(resource parser, string data, array &values [, array &index ])", + "Parsing a XML document" + ], + "xml_parser_create": [ + "resource xml_parser_create([string encoding])", + "Create an XML parser" + ], + "xml_parser_create_ns": [ + "resource xml_parser_create_ns([string encoding [, string sep]])", + "Create an XML parser" + ], + "xml_parser_free": [ + "int xml_parser_free(resource parser)", + "Free an XML parser" + ], + "xml_parser_get_option": [ + "int xml_parser_get_option(resource parser, int option)", + "Get options from an XML parser" + ], + "xml_parser_set_option": [ + "int xml_parser_set_option(resource parser, int option, mixed value)", + "Set options in an XML parser" + ], + "xml_set_character_data_handler": [ + "int xml_set_character_data_handler(resource parser, string hdl)", + "Set up character data handler" + ], + "xml_set_default_handler": [ + "int xml_set_default_handler(resource parser, string hdl)", + "Set up default handler" + ], + "xml_set_element_handler": [ + "int xml_set_element_handler(resource parser, string shdl, string ehdl)", + "Set up start and end element handlers" + ], + "xml_set_end_namespace_decl_handler": [ + "int xml_set_end_namespace_decl_handler(resource parser, string hdl)", + "Set up character data handler" + ], + "xml_set_external_entity_ref_handler": [ + "int xml_set_external_entity_ref_handler(resource parser, string hdl)", + "Set up external entity reference handler" + ], + "xml_set_notation_decl_handler": [ + "int xml_set_notation_decl_handler(resource parser, string hdl)", + "Set up notation declaration handler" + ], + "xml_set_object": [ + "int xml_set_object(resource parser, object &obj)", + "Set up object which should be used for callbacks" + ], + "xml_set_processing_instruction_handler": [ + "int xml_set_processing_instruction_handler(resource parser, string hdl)", + "Set up processing instruction (PI) handler" + ], + "xml_set_start_namespace_decl_handler": [ + "int xml_set_start_namespace_decl_handler(resource parser, string hdl)", + "Set up character data handler" + ], + "xml_set_unparsed_entity_decl_handler": [ + "int xml_set_unparsed_entity_decl_handler(resource parser, string hdl)", + "Set up unparsed entity declaration handler" + ], + "xmlrpc_decode": [ + "array xmlrpc_decode(string xml [, string encoding])", + "Decodes XML into native PHP types" + ], + "xmlrpc_decode_request": [ + "array xmlrpc_decode_request(string xml, string& method [, string encoding])", + "Decodes XML into native PHP types" + ], + "xmlrpc_encode": [ + "string xmlrpc_encode(mixed value)", + "Generates XML for a PHP value" + ], + "xmlrpc_encode_request": [ + "string xmlrpc_encode_request(string method, mixed params [, array output_options])", + "Generates XML for a method request" + ], + "xmlrpc_get_type": [ + "string xmlrpc_get_type(mixed value)", + "Gets xmlrpc type for a PHP value. Especially useful for base64 and datetime strings" + ], + "xmlrpc_is_fault": [ + "bool xmlrpc_is_fault(array)", + "Determines if an array value represents an XMLRPC fault." + ], + "xmlrpc_parse_method_descriptions": [ + "array xmlrpc_parse_method_descriptions(string xml)", + "Decodes XML into a list of method descriptions" + ], + "xmlrpc_server_add_introspection_data": [ + "int xmlrpc_server_add_introspection_data(resource server, array desc)", + "Adds introspection documentation" + ], + "xmlrpc_server_call_method": [ + "mixed xmlrpc_server_call_method(resource server, string xml, mixed user_data [, array output_options])", + "Parses XML requests and call methods" + ], + "xmlrpc_server_create": [ + "resource xmlrpc_server_create(void)", + "Creates an xmlrpc server" + ], + "xmlrpc_server_destroy": [ + "int xmlrpc_server_destroy(resource server)", + "Destroys server resources" + ], + "xmlrpc_server_register_introspection_callback": [ + "bool xmlrpc_server_register_introspection_callback(resource server, string function)", + "Register a PHP function to generate documentation" + ], + "xmlrpc_server_register_method": [ + "bool xmlrpc_server_register_method(resource server, string method_name, string function)", + "Register a PHP function to handle method matching method_name" + ], + "xmlrpc_set_type": [ + "bool xmlrpc_set_type(string value, string type)", + "Sets xmlrpc type, base64 or datetime, for a PHP string value" + ], + "xmlwriter_end_attribute": [ + "bool xmlwriter_end_attribute(resource xmlwriter)", + "End attribute - returns FALSE on error" + ], + "xmlwriter_end_cdata": [ + "bool xmlwriter_end_cdata(resource xmlwriter)", + "End current CDATA - returns FALSE on error" + ], + "xmlwriter_end_comment": [ + "bool xmlwriter_end_comment(resource xmlwriter)", + "Create end comment - returns FALSE on error" + ], + "xmlwriter_end_document": [ + "bool xmlwriter_end_document(resource xmlwriter)", + "End current document - returns FALSE on error" + ], + "xmlwriter_end_dtd": [ + "bool xmlwriter_end_dtd(resource xmlwriter)", + "End current DTD - returns FALSE on error" + ], + "xmlwriter_end_dtd_attlist": [ + "bool xmlwriter_end_dtd_attlist(resource xmlwriter)", + "End current DTD AttList - returns FALSE on error" + ], + "xmlwriter_end_dtd_element": [ + "bool xmlwriter_end_dtd_element(resource xmlwriter)", + "End current DTD element - returns FALSE on error" + ], + "xmlwriter_end_dtd_entity": [ + "bool xmlwriter_end_dtd_entity(resource xmlwriter)", + "End current DTD Entity - returns FALSE on error" + ], + "xmlwriter_end_element": [ + "bool xmlwriter_end_element(resource xmlwriter)", + "End current element - returns FALSE on error" + ], + "xmlwriter_end_pi": [ + "bool xmlwriter_end_pi(resource xmlwriter)", + "End current PI - returns FALSE on error" + ], + "xmlwriter_flush": [ + "mixed xmlwriter_flush(resource xmlwriter [,bool empty])", + "Output current buffer" + ], + "xmlwriter_full_end_element": [ + "bool xmlwriter_full_end_element(resource xmlwriter)", + "End current element - returns FALSE on error" + ], + "xmlwriter_open_memory": [ + "resource xmlwriter_open_memory()", + "Create new xmlwriter using memory for string output" + ], + "xmlwriter_open_uri": [ + "resource xmlwriter_open_uri(resource xmlwriter, string source)", + "Create new xmlwriter using source uri for output" + ], + "xmlwriter_output_memory": [ + "string xmlwriter_output_memory(resource xmlwriter [,bool flush])", + "Output current buffer as string" + ], + "xmlwriter_set_indent": [ + "bool xmlwriter_set_indent(resource xmlwriter, bool indent)", + "Toggle indentation on/off - returns FALSE on error" + ], + "xmlwriter_set_indent_string": [ + "bool xmlwriter_set_indent_string(resource xmlwriter, string indentString)", + "Set string used for indenting - returns FALSE on error" + ], + "xmlwriter_start_attribute": [ + "bool xmlwriter_start_attribute(resource xmlwriter, string name)", + "Create start attribute - returns FALSE on error" + ], + "xmlwriter_start_attribute_ns": [ + "bool xmlwriter_start_attribute_ns(resource xmlwriter, string prefix, string name, string uri)", + "Create start namespaced attribute - returns FALSE on error" + ], + "xmlwriter_start_cdata": [ + "bool xmlwriter_start_cdata(resource xmlwriter)", + "Create start CDATA tag - returns FALSE on error" + ], + "xmlwriter_start_comment": [ + "bool xmlwriter_start_comment(resource xmlwriter)", + "Create start comment - returns FALSE on error" + ], + "xmlwriter_start_document": [ + "bool xmlwriter_start_document(resource xmlwriter, string version, string encoding, string standalone)", + "Create document tag - returns FALSE on error" + ], + "xmlwriter_start_dtd": [ + "bool xmlwriter_start_dtd(resource xmlwriter, string name, string pubid, string sysid)", + "Create start DTD tag - returns FALSE on error" + ], + "xmlwriter_start_dtd_attlist": [ + "bool xmlwriter_start_dtd_attlist(resource xmlwriter, string name)", + "Create start DTD AttList - returns FALSE on error" + ], + "xmlwriter_start_dtd_element": [ + "bool xmlwriter_start_dtd_element(resource xmlwriter, string name)", + "Create start DTD element - returns FALSE on error" + ], + "xmlwriter_start_dtd_entity": [ + "bool xmlwriter_start_dtd_entity(resource xmlwriter, string name, bool isparam)", + "Create start DTD Entity - returns FALSE on error" + ], + "xmlwriter_start_element": [ + "bool xmlwriter_start_element(resource xmlwriter, string name)", + "Create start element tag - returns FALSE on error" + ], + "xmlwriter_start_element_ns": [ + "bool xmlwriter_start_element_ns(resource xmlwriter, string prefix, string name, string uri)", + "Create start namespaced element tag - returns FALSE on error" + ], + "xmlwriter_start_pi": [ + "bool xmlwriter_start_pi(resource xmlwriter, string target)", + "Create start PI tag - returns FALSE on error" + ], + "xmlwriter_text": [ + "bool xmlwriter_text(resource xmlwriter, string content)", + "Write text - returns FALSE on error" + ], + "xmlwriter_write_attribute": [ + "bool xmlwriter_write_attribute(resource xmlwriter, string name, string content)", + "Write full attribute - returns FALSE on error" + ], + "xmlwriter_write_attribute_ns": [ + "bool xmlwriter_write_attribute_ns(resource xmlwriter, string prefix, string name, string uri, string content)", + "Write full namespaced attribute - returns FALSE on error" + ], + "xmlwriter_write_cdata": [ + "bool xmlwriter_write_cdata(resource xmlwriter, string content)", + "Write full CDATA tag - returns FALSE on error" + ], + "xmlwriter_write_comment": [ + "bool xmlwriter_write_comment(resource xmlwriter, string content)", + "Write full comment tag - returns FALSE on error" + ], + "xmlwriter_write_dtd": [ + "bool xmlwriter_write_dtd(resource xmlwriter, string name, string pubid, string sysid, string subset)", + "Write full DTD tag - returns FALSE on error" + ], + "xmlwriter_write_dtd_attlist": [ + "bool xmlwriter_write_dtd_attlist(resource xmlwriter, string name, string content)", + "Write full DTD AttList tag - returns FALSE on error" + ], + "xmlwriter_write_dtd_element": [ + "bool xmlwriter_write_dtd_element(resource xmlwriter, string name, string content)", + "Write full DTD element tag - returns FALSE on error" + ], + "xmlwriter_write_dtd_entity": [ + "bool xmlwriter_write_dtd_entity(resource xmlwriter, string name, string content [, int pe [, string pubid [, string sysid [, string ndataid]]]])", + "Write full DTD Entity tag - returns FALSE on error" + ], + "xmlwriter_write_element": [ + "bool xmlwriter_write_element(resource xmlwriter, string name[, string content])", + "Write full element tag - returns FALSE on error" + ], + "xmlwriter_write_element_ns": [ + "bool xmlwriter_write_element_ns(resource xmlwriter, string prefix, string name, string uri[, string content])", + "Write full namesapced element tag - returns FALSE on error" + ], + "xmlwriter_write_pi": [ + "bool xmlwriter_write_pi(resource xmlwriter, string target, string content)", + "Write full PI tag - returns FALSE on error" + ], + "xmlwriter_write_raw": [ + "bool xmlwriter_write_raw(resource xmlwriter, string content)", + "Write text - returns FALSE on error" + ], + "xsl_xsltprocessor_get_parameter": [ + "string xsl_xsltprocessor_get_parameter(string namespace, string name);", + "" + ], + "xsl_xsltprocessor_has_exslt_support": [ + "bool xsl_xsltprocessor_has_exslt_support();", + "" + ], + "xsl_xsltprocessor_import_stylesheet": [ + "void xsl_xsltprocessor_import_stylesheet(domdocument doc);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# Since:" + ], + "xsl_xsltprocessor_register_php_functions": [ + "void xsl_xsltprocessor_register_php_functions([mixed $restrict]);", + "" + ], + "xsl_xsltprocessor_remove_parameter": [ + "bool xsl_xsltprocessor_remove_parameter(string namespace, string name);", + "" + ], + "xsl_xsltprocessor_set_parameter": [ + "bool xsl_xsltprocessor_set_parameter(string namespace, mixed name [, string value]);", + "" + ], + "xsl_xsltprocessor_set_profiling": [ + "bool xsl_xsltprocessor_set_profiling(string filename) */", + "PHP_FUNCTION(xsl_xsltprocessor_set_profiling) { zval *id; xsl_object *intern; char *filename = NULL; int filename_len; DOM_GET_THIS(id); if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, \"s!\", &filename, &filename_len) == SUCCESS) { intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern->profiling) { efree(intern->profiling); } if (filename != NULL) { intern->profiling = estrndup(filename,filename_len); } else { intern->profiling = NULL; } RETURN_TRUE; } else { WRONG_PARAM_COUNT; } } /* }}} end xsl_xsltprocessor_set_profiling" + ], + "xsl_xsltprocessor_transform_to_doc": [ + "domdocument xsl_xsltprocessor_transform_to_doc(domnode doc);", + "URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# Since:" + ], + "xsl_xsltprocessor_transform_to_uri": [ + "int xsl_xsltprocessor_transform_to_uri(domdocument doc, string uri);", + "" + ], + "xsl_xsltprocessor_transform_to_xml": [ + "string xsl_xsltprocessor_transform_to_xml(domdocument doc);", + "" + ], + "zend_logo_guid": [ + "string zend_logo_guid(void)", + "Return the special ID used to request the Zend logo in phpinfo screens" + ], + "zend_version": [ + "string zend_version(void)", + "Get the version of the Zend Engine" + ], + "zip_close": [ + "void zip_close(resource zip)", + "Close a Zip archive" + ], + "zip_entry_close": [ + "void zip_entry_close(resource zip_ent)", + "Close a zip entry" + ], + "zip_entry_compressedsize": [ + "int zip_entry_compressedsize(resource zip_entry)", + "Return the compressed size of a ZZip entry" + ], + "zip_entry_compressionmethod": [ + "string zip_entry_compressionmethod(resource zip_entry)", + "Return a string containing the compression method used on a particular entry" + ], + "zip_entry_filesize": [ + "int zip_entry_filesize(resource zip_entry)", + "Return the actual filesize of a ZZip entry" + ], + "zip_entry_name": [ + "string zip_entry_name(resource zip_entry)", + "Return the name given a ZZip entry" + ], + "zip_entry_open": [ + "bool zip_entry_open(resource zip_dp, resource zip_entry [, string mode])", + "Open a Zip File, pointed by the resource entry" + ], + "zip_entry_read": [ + "mixed zip_entry_read(resource zip_entry [, int len])", + "Read from an open directory entry" + ], + "zip_open": [ + "resource zip_open(string filename)", + "Create new zip using source uri for output" + ], + "zip_read": [ + "resource zip_read(resource zip)", + "Returns the next file in the archive" + ], + "zlib_get_coding_type": [ + "string zlib_get_coding_type(void)", + "Returns the coding type used for output compression" + ] +}; + +var variableMap = { + "$_COOKIE": { + type: "array" + }, + "$_ENV": { + type: "array" + }, + "$_FILES": { + type: "array" + }, + "$_GET": { + type: "array" + }, + "$_POST": { + type: "array" + }, + "$_REQUEST": { + type: "array" + }, + "$_SERVER": { + type: "array", + value: { + "DOCUMENT_ROOT": 1, + "GATEWAY_INTERFACE": 1, + "HTTP_ACCEPT": 1, + "HTTP_ACCEPT_CHARSET": 1, + "HTTP_ACCEPT_ENCODING": 1 , + "HTTP_ACCEPT_LANGUAGE": 1, + "HTTP_CONNECTION": 1, + "HTTP_HOST": 1, + "HTTP_REFERER": 1, + "HTTP_USER_AGENT": 1, + "PATH_TRANSLATED": 1, + "PHP_SELF": 1, + "QUERY_STRING": 1, + "REMOTE_ADDR": 1, + "REMOTE_PORT": 1, + "REQUEST_METHOD": 1, + "REQUEST_URI": 1, + "SCRIPT_FILENAME": 1, + "SCRIPT_NAME": 1, + "SERVER_ADMIN": 1, + "SERVER_NAME": 1, + "SERVER_PORT": 1, + "SERVER_PROTOCOL": 1, + "SERVER_SIGNATURE": 1, + "SERVER_SOFTWARE": 1 + } + }, + "$_SESSION": { + type: "array" + }, + "$GLOBALS": { + type: "array" + } +}; + +function is(token, type) { + return token.type.lastIndexOf(type) > -1; +} + +var PhpCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (token.type==='identifier') + return this.getFunctionCompletions(state, session, pos, prefix); + if (is(token, "variable")) + return this.getVariableCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (token.type==='string' && /(\$[\w]*)\[["']([^'"]*)$/i.test(line)) + return this.getArrayKeyCompletions(state, session, pos, prefix); + + return []; + }; + + this.getFunctionCompletions = function(state, session, pos, prefix) { + var functions = Object.keys(functionMap); + return functions.map(function(func){ + return { + caption: func, + snippet: func + '($0)', + meta: "php function", + score: Number.MAX_VALUE, + docHTML: functionMap[func][1] + }; + }); + }; + + this.getVariableCompletions = function(state, session, pos, prefix) { + var variables = Object.keys(variableMap); + return variables.map(function(variable){ + return { + caption: variable, + value: variable, + meta: "php variable", + score: Number.MAX_VALUE + }; + }); + }; + + this.getArrayKeyCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var variable = line.match(/(\$[\w]*)\[["']([^'"]*)$/i)[1]; + + if (!variableMap[variable]) { + return []; + } + + var keys = []; + if (variableMap[variable].type==='array' && variableMap[variable].value) + keys = Object.keys(variableMap[variable].value); + + return keys.map(function(key) { + return { + caption: key, + value: key, + meta: "php array key", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(PhpCompletions.prototype); + +exports.PhpCompletions = PhpCompletions; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/php_highlight_rules","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/php_completions","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/unicode","ace/mode/html","ace/mode/javascript","ace/mode/css"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules; +var PhpLangHighlightRules = require("./php_highlight_rules").PhpLangHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var PhpCompletions = require("./php_completions").PhpCompletions; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var unicode = require("../unicode"); +var HtmlMode = require("./html").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; + +var PhpMode = function(opts) { + this.HighlightRules = PhpLangHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.$completer = new PhpCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(PhpMode, TextMode); + +(function() { + + this.tokenRe = new RegExp("^[" + + unicode.packages.L + + unicode.packages.Mn + unicode.packages.Mc + + unicode.packages.Nd + + unicode.packages.Pc + "_]+", "g" + ); + + this.nonTokenRe = new RegExp("^(?:[^" + + unicode.packages.L + + unicode.packages.Mn + unicode.packages.Mc + + unicode.packages.Nd + + unicode.packages.Pc + "_]|\\s])+", "g" + ); + + + this.lineCommentStart = ["//", "#"]; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState != "doc-start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.$id = "ace/mode/php-inline"; +}).call(PhpMode.prototype); + +var Mode = function(opts) { + if (opts && opts.inline) { + var mode = new PhpMode(); + mode.createWorker = this.createWorker; + mode.inlinePhp = true; + return mode; + } + HtmlMode.call(this); + this.HighlightRules = PhpHighlightRules; + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode, + "php-": PhpMode + }); + this.foldingRules.subModes["php-"] = new CStyleFoldMode(); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/php_worker", "PhpWorker"); + worker.attachToDocument(session.getDocument()); + + if (this.inlinePhp) + worker.call("setOptions", [{inline: true}]); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/php"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-pig.js b/htdocs/includes/ace/mode-pig.js new file mode 100644 index 00000000000..e251e384125 --- /dev/null +++ b/htdocs/includes/ace/mode-pig.js @@ -0,0 +1,303 @@ +ace.define("ace/mode/pig_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PigHighlightRules = function() { + + this.$rules = { + start: [{ + token: "comment.block.pig", + regex: /\/\*/, + push: [{ + token: "comment.block.pig", + regex: /\*\//, + next: "pop" + }, { + defaultToken: "comment.block.pig" + }] + }, { + token: "comment.line.double-dash.asciidoc", + regex: /--.*$/ + }, { + token: "keyword.control.pig", + regex: /\b(?:ASSERT|LOAD|STORE|DUMP|FILTER|DISTINCT|FOREACH|GENERATE|STREAM|JOIN|COGROUP|GROUP|CROSS|ORDER|LIMIT|UNION|SPLIT|DESCRIBE|EXPLAIN|ILLUSTRATE|AS|BY|INTO|USING|LIMIT|PARALLEL|OUTER|INNER|DEFAULT|LEFT|SAMPLE|RANK|CUBE|ALL|KILL|QUIT|MAPREDUCE|ASC|DESC|THROUGH|SHIP|CACHE|DECLARE|CASE|WHEN|THEN|END|IN|PARTITION|FULL|IMPORT|IF|ONSCHEMA|INPUT|OUTPUT)\b/, + caseInsensitive: true + }, { + token: "storage.datatypes.pig", + regex: /\b(?:int|long|float|double|chararray|bytearray|boolean|datetime|biginteger|bigdecimal|tuple|bag|map)\b/, + caseInsensitive: true + }, { + token: "support.function.storage.pig", + regex: /\b(?:PigStorage|BinStorage|BinaryStorage|PigDump|HBaseStorage|JsonLoader|JsonStorage|AvroStorage|TextLoader|PigStreaming|TrevniStorage|AccumuloStorage)\b/ + }, { + token: "support.function.udf.pig", + regex: /\b(?:DIFF|TOBAG|TOMAP|TOP|TOTUPLE|RANDOM|FLATTEN|flatten|CUBE|ROLLUP|IsEmpty|ARITY|PluckTuple|SUBTRACT|BagToString)\b/ + }, { + token: "support.function.udf.math.pig", + regex: /\b(?:ABS|ACOS|ASIN|ATAN|CBRT|CEIL|COS|COSH|EXP|FLOOR|LOG|LOG10|ROUND|ROUND_TO|SIN|SINH|SQRT|TAN|TANH|AVG|COUNT|COUNT_STAR|MAX|MIN|SUM|COR|COV)\b/ + }, { + token: "support.function.udf.string.pig", + regex: /\b(?:CONCAT|INDEXOF|LAST_INDEX_OF|LCFIRST|LOWER|REGEX_EXTRACT|REGEX_EXTRACT_ALL|REPLACE|SIZE|STRSPLIT|SUBSTRING|TOKENIZE|TRIM|UCFIRST|UPPER|LTRIM|RTRIM|ENDSWITH|STARTSWITH|TRIM)\b/ + }, { + token: "support.function.udf.datetime.pig", + regex: /\b(?:AddDuration|CurrentTime|DaysBetween|GetDay|GetHour|GetMilliSecond|GetMinute|GetMonth|GetSecond|GetWeek|GetWeekYear|GetYear|HoursBetween|MilliSecondsBetween|MinutesBetween|MonthsBetween|SecondsBetween|SubtractDuration|ToDate|WeeksBetween|YearsBetween|ToMilliSeconds|ToString|ToUnixTime)\b/ + }, { + token: "support.function.command.pig", + regex: /\b(?:cat|cd|copyFromLocal|copyToLocal|cp|ls|mkdir|mv|pwd|rm)\b/ + }, { + token: "variable.pig", + regex: /\$[a_zA-Z0-9_]+/ + }, { + token: "constant.language.pig", + regex: /\b(?:NULL|true|false|stdin|stdout|stderr)\b/, + caseInsensitive: true + }, { + token: "constant.numeric.pig", + regex: /\b\d+(?:\.\d+)?\b/ + }, { + token: "keyword.operator.comparison.pig", + regex: /!=|==|<|>|<=|>=|\b(?:MATCHES|IS|OR|AND|NOT)\b/, + caseInsensitive: true + }, { + token: "keyword.operator.arithmetic.pig", + regex: /\+|\-|\*|\/|\%|\?|:|::|\.\.|#/ + }, { + token: "string.quoted.double.pig", + regex: /"/, + push: [{ + token: "string.quoted.double.pig", + regex: /"/, + next: "pop" + }, { + token: "constant.character.escape.pig", + regex: /\\./ + }, { + defaultToken: "string.quoted.double.pig" + }] + }, { + token: "string.quoted.single.pig", + regex: /'/, + push: [{ + token: "string.quoted.single.pig", + regex: /'/, + next: "pop" + }, { + token: "constant.character.escape.pig", + regex: /\\./ + }, { + defaultToken: "string.quoted.single.pig" + }] + }, { + todo: { + token: [ + "text", + "keyword.parameter.pig", + "text", + "storage.type.parameter.pig" + ], + regex: /^(\s*)(set)(\s+)(\S+)/, + caseInsensitive: true, + push: [{ + token: "text", + regex: /$/, + next: "pop" + }, { + include: "$self" + }] + } + }, { + token: [ + "text", + "keyword.alias.pig", + "text", + "storage.type.alias.pig" + ], + regex: /(\s*)(DEFINE|DECLARE|REGISTER)(\s+)(\S+)/, + caseInsensitive: true, + push: [{ + token: "text", + regex: /;?$/, + next: "pop" + }] + }] + } + + this.normalizeRules(); +}; + +PigHighlightRules.metaData = { + fileTypes: ["pig"], + name: "Pig", + scopeName: "source.pig" +} + + +oop.inherits(PigHighlightRules, TextHighlightRules); + +exports.PigHighlightRules = PigHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/pig",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/pig_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PigHighlightRules = require("./pig_highlight_rules").PigHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = PigHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/pig" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-plain_text.js b/htdocs/includes/ace/mode-plain_text.js new file mode 100644 index 00000000000..0f0c93805c4 --- /dev/null +++ b/htdocs/includes/ace/mode-plain_text.js @@ -0,0 +1,25 @@ +ace.define("ace/mode/plain_text",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/behaviour"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var Behaviour = require("./behaviour").Behaviour; + +var Mode = function() { + this.HighlightRules = TextHighlightRules; + this.$behaviour = new Behaviour(); +}; + +oop.inherits(Mode, TextMode); + +(function() { + this.type = "text"; + this.getNextLineIndent = function(state, line, tab) { + return ''; + }; + this.$id = "ace/mode/plain_text"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-powershell.js b/htdocs/includes/ace/mode-powershell.js new file mode 100644 index 00000000000..0b43a83e148 --- /dev/null +++ b/htdocs/includes/ace/mode-powershell.js @@ -0,0 +1,411 @@ +ace.define("ace/mode/powershell_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PowershellHighlightRules = function() { + var keywords = ( + "begin|break|catch|continue|data|do|dynamicparam|else|elseif|end|exit|filter|" + + "finally|for|foreach|from|function|if|in|inlinescript|hidden|parallel|param|" + + "process|return|sequence|switch|throw|trap|try|until|while|workflow" + ); + var builtinFunctions = ( + "Get-AppBackgroundTask|Start-AppBackgroundTask|Unregister-AppBackgroundTask|Disable-AppBackgroundTaskDiagnosticLog|Enable-AppBackgroundTaskDiagnosticLog|Set-AppBackgroundTaskResourcePolicy|" + + "Get-AppLockerFileInformation|Get-AppLockerPolicy|New-AppLockerPolicy|Set-AppLockerPolicy|Test-AppLockerPolicy|" + + "Get-AppxLastError|Get-AppxLog|Add-AppxPackage|Add-AppxVolume|Dismount-AppxVolume|Get-AppxDefaultVolume|Get-AppxPackage|Get-AppxPackageManifest|Get-AppxVolume|Mount-AppxVolume|Move-AppxPackage|Remove-AppxPackage|Remove-AppxVolume|Set-AppxDefaultVolume|" + + "Clear-AssignedAccess|Get-AssignedAccess|Set-AssignedAccess|" + + "Add-BitLockerKeyProtector|Backup-BitLockerKeyProtector|Clear-BitLockerAutoUnlock|Disable-BitLocker|Disable-BitLockerAutoUnlock|Enable-BitLocker|Enable-BitLockerAutoUnlock|Get-BitLockerVolume|Lock-BitLocker|Remove-BitLockerKeyProtector|Resume-BitLocker|Suspend-BitLocker|Unlock-BitLocker|" + + "Add-BitsFile|Complete-BitsTransfer|Get-BitsTransfer|Remove-BitsTransfer|Resume-BitsTransfer|Set-BitsTransfer|Start-BitsTransfer|Suspend-BitsTransfer|" + + "Add-BCDataCacheExtension|Clear-BCCache|Disable-BC|Disable-BCDowngrading|Disable-BCServeOnBattery|Enable-BCDistributed|Enable-BCDowngrading|Enable-BCHostedClient|Enable-BCHostedServer|Enable-BCLocal|Enable-BCServeOnBattery|Export-BCCachePackage|Export-BCSecretKey|Get-BCClientConfiguration|Get-BCContentServerConfiguration|Get-BCDataCache|Get-BCDataCacheExtension|Get-BCHashCache|Get-BCHostedCacheServerConfiguration|Get-BCNetworkConfiguration|Get-BCStatus|Import-BCCachePackage|Import-BCSecretKey|Publish-BCFileContent|Publish-BCWebContent|Remove-BCDataCacheExtension|Reset-BC|Set-BCAuthentication|Set-BCCache|Set-BCDataCacheEntryMaxAge|Set-BCMinSMBLatency|Set-BCSecretKey|" + + "Export-BinaryMiLog|Get-CimAssociatedInstance|Get-CimClass|Get-CimInstance|Get-CimSession|Import-BinaryMiLog|Invoke-CimMethod|New-CimInstance|New-CimSession|New-CimSessionOption|Register-CimIndicationEvent|Remove-CimInstance|Remove-CimSession|Set-CimInstance|" + + "ConvertFrom-CIPolicy|" + + "Add-SignerRule|Edit-CIPolicyRule|Get-CIPolicy|Get-CIPolicyInfo|Get-SystemDriver|Merge-CIPolicy|New-CIPolicy|New-CIPolicyRule|Remove-CIPolicyRule|Set-CIPolicyVersion|Set-HVCIOptions|Set-RuleOption|" + + "Add-MpPreference|Get-MpComputerStatus|Get-MpPreference|Get-MpThreat|Get-MpThreatCatalog|Get-MpThreatDetection|Remove-MpPreference|Remove-MpThreat|Set-MpPreference|Start-MpScan|Start-MpWDOScan|Update-MpSignature|" + + "Disable-DAManualEntryPointSelection|Enable-DAManualEntryPointSelection|Get-DAClientExperienceConfiguration|Get-DAEntryPointTableItem|New-DAEntryPointTableItem|Remove-DAEntryPointTableItem|Rename-DAEntryPointTableItem|Reset-DAClientExperienceConfiguration|Reset-DAEntryPointTableItem|Set-DAClientExperienceConfiguration|Set-DAEntryPointTableItem|" + + "Add-ProvisionedAppxPackage|Apply-WindowsUnattend|Get-ProvisionedAppxPackage|Remove-ProvisionedAppxPackage|Add-AppxProvisionedPackage|Add-WindowsCapability|Add-WindowsDriver|Add-WindowsImage|Add-WindowsPackage|Clear-WindowsCorruptMountPoint|Disable-WindowsOptionalFeature|Dismount-WindowsImage|Enable-WindowsOptionalFeature|Expand-WindowsCustomDataImage|Expand-WindowsImage|Export-WindowsDriver|Export-WindowsImage|Get-AppxProvisionedPackage|Get-WIMBootEntry|Get-WindowsCapability|Get-WindowsDriver|Get-WindowsEdition|Get-WindowsImage|Get-WindowsImageContent|Get-WindowsOptionalFeature|Get-WindowsPackage|Mount-WindowsImage|New-WindowsCustomImage|New-WindowsImage|Optimize-WindowsImage|Remove-AppxProvisionedPackage|Remove-WindowsCapability|Remove-WindowsDriver|Remove-WindowsImage|Remove-WindowsPackage|Repair-WindowsImage|Save-WindowsImage|Set-AppXProvisionedDataFile|Set-WindowsEdition|Set-WindowsProductKey|Split-WindowsImage|Update-WIMBootEntry|Use-WindowsUnattend|" + + "Add-DnsClientNrptRule|Clear-DnsClientCache|Get-DnsClient|Get-DnsClientCache|Get-DnsClientGlobalSetting|Get-DnsClientNrptGlobal|Get-DnsClientNrptPolicy|Get-DnsClientNrptRule|Get-DnsClientServerAddress|Register-DnsClient|Remove-DnsClientNrptRule|Set-DnsClient|Set-DnsClientGlobalSetting|Set-DnsClientNrptGlobal|Set-DnsClientNrptRule|Set-DnsClientServerAddress|Resolve-DnsName|" + + "Add-EtwTraceProvider|Get-AutologgerConfig|Get-EtwTraceProvider|Get-EtwTraceSession|New-AutologgerConfig|New-EtwTraceSession|Remove-AutologgerConfig|Remove-EtwTraceProvider|Remove-EtwTraceSession|Send-EtwTraceSession|Set-AutologgerConfig|Set-EtwTraceProvider|Set-EtwTraceSession|" + + "Get-WinAcceptLanguageFromLanguageListOptOut|Get-WinCultureFromLanguageListOptOut|Get-WinDefaultInputMethodOverride|Get-WinHomeLocation|Get-WinLanguageBarOption|Get-WinSystemLocale|Get-WinUILanguageOverride|Get-WinUserLanguageList|New-WinUserLanguageList|Set-Culture|Set-WinAcceptLanguageFromLanguageListOptOut|Set-WinCultureFromLanguageListOptOut|Set-WinDefaultInputMethodOverride|Set-WinHomeLocation|Set-WinLanguageBarOption|Set-WinSystemLocale|Set-WinUILanguageOverride|Set-WinUserLanguageList|" + + "Connect-IscsiTarget|Disconnect-IscsiTarget|Get-IscsiConnection|Get-IscsiSession|Get-IscsiTarget|Get-IscsiTargetPortal|New-IscsiTargetPortal|Register-IscsiSession|Remove-IscsiTargetPortal|Set-IscsiChapSecret|Unregister-IscsiSession|Update-IscsiTarget|Update-IscsiTargetPortal|" + + "Get-IseSnippet|Import-IseSnippet|New-IseSnippet|" + + "Add-KdsRootKey|Clear-KdsCache|Get-KdsConfiguration|Get-KdsRootKey|Set-KdsConfiguration|Test-KdsRootKey|" + + "Compress-Archive|Expand-Archive|" + + "Export-Counter|Get-Counter|Get-WinEvent|Import-Counter|New-WinEvent|" + + "Start-Transcript|Stop-Transcript|" + + "Add-Computer|Add-Content|Checkpoint-Computer|Clear-Content|Clear-EventLog|Clear-Item|Clear-ItemProperty|Clear-RecycleBin|Complete-Transaction|Convert-Path|Copy-Item|Copy-ItemProperty|Debug-Process|Disable-ComputerRestore|Enable-ComputerRestore|Get-ChildItem|Get-Clipboard|Get-ComputerRestorePoint|Get-Content|Get-ControlPanelItem|Get-EventLog|Get-HotFix|Get-Item|Get-ItemProperty|Get-ItemPropertyValue|Get-Location|Get-Process|Get-PSDrive|Get-PSProvider|Get-Service|Get-Transaction|Get-WmiObject|Invoke-Item|Invoke-WmiMethod|Join-Path|Limit-EventLog|Move-Item|Move-ItemProperty|New-EventLog|New-Item|New-ItemProperty|New-PSDrive|New-Service|New-WebServiceProxy|Pop-Location|Push-Location|Register-WmiEvent|Remove-Computer|Remove-EventLog|Remove-Item|Remove-ItemProperty|Remove-PSDrive|Remove-WmiObject|Rename-Computer|Rename-Item|Rename-ItemProperty|Reset-ComputerMachinePassword|Resolve-Path|Restart-Computer|Restart-Service|Restore-Computer|Resume-Service|Set-Clipboard|Set-Content|Set-Item|Set-ItemProperty|Set-Location|Set-Service|Set-WmiInstance|Show-ControlPanelItem|Show-EventLog|Split-Path|Start-Process|Start-Service|Start-Transaction|Stop-Computer|Stop-Process|Stop-Service|Suspend-Service|Test-ComputerSecureChannel|Test-Connection|Test-Path|Undo-Transaction|Use-Transaction|Wait-Process|Write-EventLog|" + + "Export-ODataEndpointProxy|" + + "ConvertFrom-SecureString|ConvertTo-SecureString|Get-Acl|Get-AuthenticodeSignature|Get-CmsMessage|Get-Credential|Get-ExecutionPolicy|Get-PfxCertificate|Protect-CmsMessage|Set-Acl|Set-AuthenticodeSignature|Set-ExecutionPolicy|Unprotect-CmsMessage|" + + "ConvertFrom-SddlString|Format-Hex|Get-FileHash|Import-PowerShellDataFile|New-Guid|New-TemporaryFile|Add-Member|Add-Type|Clear-Variable|Compare-Object|ConvertFrom-Csv|ConvertFrom-Json|ConvertFrom-String|ConvertFrom-StringData|Convert-String|ConvertTo-Csv|ConvertTo-Html|ConvertTo-Json|ConvertTo-Xml|Debug-Runspace|Disable-PSBreakpoint|Disable-RunspaceDebug|Enable-PSBreakpoint|Enable-RunspaceDebug|Export-Alias|Export-Clixml|Export-Csv|Export-FormatData|Export-PSSession|Format-Custom|Format-List|Format-Table|Format-Wide|Get-Alias|Get-Culture|Get-Date|Get-Event|Get-EventSubscriber|Get-FormatData|Get-Host|Get-Member|Get-PSBreakpoint|Get-PSCallStack|Get-Random|Get-Runspace|Get-RunspaceDebug|Get-TraceSource|Get-TypeData|Get-UICulture|Get-Unique|Get-Variable|Group-Object|Import-Alias|Import-Clixml|Import-Csv|Import-LocalizedData|Import-PSSession|Invoke-Expression|Invoke-RestMethod|Invoke-WebRequest|Measure-Command|Measure-Object|New-Alias|New-Event|New-Object|New-TimeSpan|New-Variable|Out-File|Out-GridView|Out-Printer|Out-String|Read-Host|Register-EngineEvent|Register-ObjectEvent|Remove-Event|Remove-PSBreakpoint|Remove-TypeData|Remove-Variable|Select-Object|Select-String|Select-Xml|Send-MailMessage|Set-Alias|Set-Date|Set-PSBreakpoint|Set-TraceSource|Set-Variable|Show-Command|Sort-Object|Start-Sleep|Tee-Object|Trace-Command|Unblock-File|Unregister-Event|Update-FormatData|Update-List|Update-TypeData|Wait-Debugger|Wait-Event|Write-Debug|Write-Error|Write-Host|Write-Information|Write-Output|Write-Progress|Write-Verbose|Write-Warning|" + + "Connect-WSMan|Disable-WSManCredSSP|Disconnect-WSMan|Enable-WSManCredSSP|Get-WSManCredSSP|Get-WSManInstance|Invoke-WSManAction|New-WSManInstance|New-WSManSessionOption|Remove-WSManInstance|Set-WSManInstance|Set-WSManQuickConfig|Test-WSMan|" + + "Debug-MMAppPrelaunch|Disable-MMAgent|Enable-MMAgent|Get-MMAgent|Set-MMAgent|" + + "Add-DtcClusterTMMapping|Get-Dtc|Get-DtcAdvancedHostSetting|Get-DtcAdvancedSetting|Get-DtcClusterDefault|Get-DtcClusterTMMapping|Get-DtcDefault|Get-DtcLog|Get-DtcNetworkSetting|Get-DtcTransaction|Get-DtcTransactionsStatistics|Get-DtcTransactionsTraceSession|Get-DtcTransactionsTraceSetting|Install-Dtc|Remove-DtcClusterTMMapping|Reset-DtcLog|Set-DtcAdvancedHostSetting|Set-DtcAdvancedSetting|Set-DtcClusterDefault|Set-DtcClusterTMMapping|Set-DtcDefault|Set-DtcLog|Set-DtcNetworkSetting|Set-DtcTransaction|Set-DtcTransactionsTraceSession|Set-DtcTransactionsTraceSetting|Start-Dtc|Start-DtcTransactionsTraceSession|Stop-Dtc|Stop-DtcTransactionsTraceSession|Test-Dtc|Uninstall-Dtc|Write-DtcTransactionsTraceSession|Complete-DtcDiagnosticTransaction|Join-DtcDiagnosticResourceManager|New-DtcDiagnosticTransaction|Receive-DtcDiagnosticTransaction|Send-DtcDiagnosticTransaction|Start-DtcDiagnosticResourceManager|Stop-DtcDiagnosticResourceManager|Undo-DtcDiagnosticTransaction|" + + "Disable-NetAdapter|Disable-NetAdapterBinding|Disable-NetAdapterChecksumOffload|Disable-NetAdapterEncapsulatedPacketTaskOffload|Disable-NetAdapterIPsecOffload|Disable-NetAdapterLso|Disable-NetAdapterPacketDirect|Disable-NetAdapterPowerManagement|Disable-NetAdapterQos|Disable-NetAdapterRdma|Disable-NetAdapterRsc|Disable-NetAdapterRss|Disable-NetAdapterSriov|Disable-NetAdapterVmq|Enable-NetAdapter|Enable-NetAdapterBinding|Enable-NetAdapterChecksumOffload|Enable-NetAdapterEncapsulatedPacketTaskOffload|Enable-NetAdapterIPsecOffload|Enable-NetAdapterLso|Enable-NetAdapterPacketDirect|Enable-NetAdapterPowerManagement|Enable-NetAdapterQos|Enable-NetAdapterRdma|Enable-NetAdapterRsc|Enable-NetAdapterRss|Enable-NetAdapterSriov|Enable-NetAdapterVmq|Get-NetAdapter|Get-NetAdapterAdvancedProperty|Get-NetAdapterBinding|Get-NetAdapterChecksumOffload|Get-NetAdapterEncapsulatedPacketTaskOffload|Get-NetAdapterHardwareInfo|Get-NetAdapterIPsecOffload|Get-NetAdapterLso|Get-NetAdapterPacketDirect|Get-NetAdapterPowerManagement|Get-NetAdapterQos|Get-NetAdapterRdma|Get-NetAdapterRsc|Get-NetAdapterRss|Get-NetAdapterSriov|Get-NetAdapterSriovVf|Get-NetAdapterStatistics|Get-NetAdapterVmq|Get-NetAdapterVmqQueue|Get-NetAdapterVPort|New-NetAdapterAdvancedProperty|Remove-NetAdapterAdvancedProperty|Rename-NetAdapter|Reset-NetAdapterAdvancedProperty|Restart-NetAdapter|Set-NetAdapter|Set-NetAdapterAdvancedProperty|Set-NetAdapterBinding|Set-NetAdapterChecksumOffload|Set-NetAdapterEncapsulatedPacketTaskOffload|Set-NetAdapterIPsecOffload|Set-NetAdapterLso|Set-NetAdapterPacketDirect|Set-NetAdapterPowerManagement|Set-NetAdapterQos|Set-NetAdapterRdma|Set-NetAdapterRsc|Set-NetAdapterRss|Set-NetAdapterSriov|Set-NetAdapterVmq|" + + "Get-NetConnectionProfile|Set-NetConnectionProfile|" + + "Add-NetEventNetworkAdapter|Add-NetEventPacketCaptureProvider|Add-NetEventProvider|Add-NetEventVmNetworkAdapter|Add-NetEventVmSwitch|Add-NetEventWFPCaptureProvider|Get-NetEventNetworkAdapter|Get-NetEventPacketCaptureProvider|Get-NetEventProvider|Get-NetEventSession|Get-NetEventVmNetworkAdapter|Get-NetEventVmSwitch|Get-NetEventWFPCaptureProvider|New-NetEventSession|Remove-NetEventNetworkAdapter|Remove-NetEventPacketCaptureProvider|Remove-NetEventProvider|Remove-NetEventSession|Remove-NetEventVmNetworkAdapter|Remove-NetEventVmSwitch|Remove-NetEventWFPCaptureProvider|Set-NetEventPacketCaptureProvider|Set-NetEventProvider|Set-NetEventSession|Set-NetEventWFPCaptureProvider|Start-NetEventSession|Stop-NetEventSession|" + + "Add-NetLbfoTeamMember|Add-NetLbfoTeamNic|Get-NetLbfoTeam|Get-NetLbfoTeamMember|Get-NetLbfoTeamNic|New-NetLbfoTeam|Remove-NetLbfoTeam|Remove-NetLbfoTeamMember|Remove-NetLbfoTeamNic|Rename-NetLbfoTeam|Set-NetLbfoTeam|Set-NetLbfoTeamMember|Set-NetLbfoTeamNic|" + + "Add-NetNatExternalAddress|Add-NetNatStaticMapping|Get-NetNat|Get-NetNatExternalAddress|Get-NetNatGlobal|Get-NetNatSession|Get-NetNatStaticMapping|New-NetNat|Remove-NetNat|Remove-NetNatExternalAddress|Remove-NetNatStaticMapping|Set-NetNat|Set-NetNatGlobal|" + + "Get-NetQosPolicy|New-NetQosPolicy|Remove-NetQosPolicy|Set-NetQosPolicy|" + + "Copy-NetFirewallRule|Copy-NetIPsecMainModeCryptoSet|Copy-NetIPsecMainModeRule|Copy-NetIPsecPhase1AuthSet|Copy-NetIPsecPhase2AuthSet|Copy-NetIPsecQuickModeCryptoSet|Copy-NetIPsecRule|Disable-NetFirewallRule|Disable-NetIPsecMainModeRule|Disable-NetIPsecRule|Enable-NetFirewallRule|Enable-NetIPsecMainModeRule|Enable-NetIPsecRule|Find-NetIPsecRule|Get-NetFirewallAddressFilter|Get-NetFirewallApplicationFilter|Get-NetFirewallInterfaceFilter|Get-NetFirewallInterfaceTypeFilter|Get-NetFirewallPortFilter|Get-NetFirewallProfile|Get-NetFirewallRule|Get-NetFirewallSecurityFilter|Get-NetFirewallServiceFilter|Get-NetFirewallSetting|Get-NetIPsecDospSetting|Get-NetIPsecMainModeCryptoSet|Get-NetIPsecMainModeRule|Get-NetIPsecMainModeSA|Get-NetIPsecPhase1AuthSet|Get-NetIPsecPhase2AuthSet|Get-NetIPsecQuickModeCryptoSet|Get-NetIPsecQuickModeSA|Get-NetIPsecRule|New-NetFirewallRule|New-NetIPsecDospSetting|New-NetIPsecMainModeCryptoSet|New-NetIPsecMainModeRule|New-NetIPsecPhase1AuthSet|New-NetIPsecPhase2AuthSet|New-NetIPsecQuickModeCryptoSet|New-NetIPsecRule|Open-NetGPO|Remove-NetFirewallRule|Remove-NetIPsecDospSetting|Remove-NetIPsecMainModeCryptoSet|Remove-NetIPsecMainModeRule|Remove-NetIPsecMainModeSA|Remove-NetIPsecPhase1AuthSet|Remove-NetIPsecPhase2AuthSet|Remove-NetIPsecQuickModeCryptoSet|Remove-NetIPsecQuickModeSA|Remove-NetIPsecRule|Rename-NetFirewallRule|Rename-NetIPsecMainModeCryptoSet|Rename-NetIPsecMainModeRule|Rename-NetIPsecPhase1AuthSet|Rename-NetIPsecPhase2AuthSet|Rename-NetIPsecQuickModeCryptoSet|Rename-NetIPsecRule|Save-NetGPO|Set-NetFirewallAddressFilter|Set-NetFirewallApplicationFilter|Set-NetFirewallInterfaceFilter|Set-NetFirewallInterfaceTypeFilter|Set-NetFirewallPortFilter|Set-NetFirewallProfile|Set-NetFirewallRule|Set-NetFirewallSecurityFilter|Set-NetFirewallServiceFilter|Set-NetFirewallSetting|Set-NetIPsecDospSetting|Set-NetIPsecMainModeCryptoSet|Set-NetIPsecMainModeRule|Set-NetIPsecPhase1AuthSet|Set-NetIPsecPhase2AuthSet|Set-NetIPsecQuickModeCryptoSet|Set-NetIPsecRule|Show-NetFirewallRule|Show-NetIPsecRule|Sync-NetIPsecRule|Update-NetIPsecRule|Get-DAPolicyChange|New-NetIPsecAuthProposal|New-NetIPsecMainModeCryptoProposal|New-NetIPsecQuickModeCryptoProposal|" + + "Add-NetSwitchTeamMember|Get-NetSwitchTeam|Get-NetSwitchTeamMember|New-NetSwitchTeam|Remove-NetSwitchTeam|Remove-NetSwitchTeamMember|Rename-NetSwitchTeam|" + + "Find-NetRoute|Get-NetCompartment|Get-NetIPAddress|Get-NetIPConfiguration|Get-NetIPInterface|Get-NetIPv4Protocol|Get-NetIPv6Protocol|Get-NetNeighbor|Get-NetOffloadGlobalSetting|Get-NetPrefixPolicy|Get-NetRoute|Get-NetTCPConnection|Get-NetTCPSetting|Get-NetTransportFilter|Get-NetUDPEndpoint|Get-NetUDPSetting|New-NetIPAddress|New-NetNeighbor|New-NetRoute|New-NetTransportFilter|Remove-NetIPAddress|Remove-NetNeighbor|Remove-NetRoute|Remove-NetTransportFilter|Set-NetIPAddress|Set-NetIPInterface|Set-NetIPv4Protocol|Set-NetIPv6Protocol|Set-NetNeighbor|Set-NetOffloadGlobalSetting|Set-NetRoute|Set-NetTCPSetting|Set-NetUDPSetting|Test-NetConnection|" + + "Get-DAConnectionStatus|Get-NCSIPolicyConfiguration|Reset-NCSIPolicyConfiguration|Set-NCSIPolicyConfiguration|" + + "Disable-NetworkSwitchEthernetPort|Disable-NetworkSwitchFeature|Disable-NetworkSwitchVlan|Enable-NetworkSwitchEthernetPort|Enable-NetworkSwitchFeature|Enable-NetworkSwitchVlan|Get-NetworkSwitchEthernetPort|Get-NetworkSwitchFeature|Get-NetworkSwitchGlobalData|Get-NetworkSwitchVlan|New-NetworkSwitchVlan|Remove-NetworkSwitchEthernetPortIPAddress|Remove-NetworkSwitchVlan|Restore-NetworkSwitchConfiguration|Save-NetworkSwitchConfiguration|Set-NetworkSwitchEthernetPortIPAddress|Set-NetworkSwitchPortMode|Set-NetworkSwitchPortProperty|Set-NetworkSwitchVlanProperty|" + + "Add-NetIPHttpsCertBinding|Disable-NetDnsTransitionConfiguration|Disable-NetIPHttpsProfile|Disable-NetNatTransitionConfiguration|Enable-NetDnsTransitionConfiguration|Enable-NetIPHttpsProfile|Enable-NetNatTransitionConfiguration|Get-Net6to4Configuration|Get-NetDnsTransitionConfiguration|Get-NetDnsTransitionMonitoring|Get-NetIPHttpsConfiguration|Get-NetIPHttpsState|Get-NetIsatapConfiguration|Get-NetNatTransitionConfiguration|Get-NetNatTransitionMonitoring|Get-NetTeredoConfiguration|Get-NetTeredoState|New-NetIPHttpsConfiguration|New-NetNatTransitionConfiguration|Remove-NetIPHttpsCertBinding|Remove-NetIPHttpsConfiguration|Remove-NetNatTransitionConfiguration|Rename-NetIPHttpsConfiguration|Reset-Net6to4Configuration|Reset-NetDnsTransitionConfiguration|Reset-NetIPHttpsConfiguration|Reset-NetIsatapConfiguration|Reset-NetTeredoConfiguration|Set-Net6to4Configuration|Set-NetDnsTransitionConfiguration|Set-NetIPHttpsConfiguration|Set-NetIsatapConfiguration|Set-NetNatTransitionConfiguration|Set-NetTeredoConfiguration|" + + "Find-Package|Find-PackageProvider|Get-Package|Get-PackageProvider|Get-PackageSource|Import-PackageProvider|Install-Package|Install-PackageProvider|Register-PackageSource|Save-Package|Set-PackageSource|Uninstall-Package|Unregister-PackageSource|" + + "Clear-PcsvDeviceLog|Get-PcsvDevice|Get-PcsvDeviceLog|Restart-PcsvDevice|Set-PcsvDeviceBootConfiguration|Set-PcsvDeviceNetworkConfiguration|Set-PcsvDeviceUserPassword|Start-PcsvDevice|Stop-PcsvDevice|" + + "AfterAll|AfterEach|Assert-MockCalled|Assert-VerifiableMocks|BeforeAll|BeforeEach|Context|Describe|Get-MockDynamicParameters|Get-TestDriveItem|In|InModuleScope|Invoke-Mock|Invoke-Pester|It|Mock|New-Fixture|Set-DynamicParameterVariables|Setup|Should|" + + "Add-CertificateEnrollmentPolicyServer|Export-Certificate|Export-PfxCertificate|Get-Certificate|Get-CertificateAutoEnrollmentPolicy|Get-CertificateEnrollmentPolicyServer|Get-CertificateNotificationTask|Get-PfxData|Import-Certificate|Import-PfxCertificate|New-CertificateNotificationTask|New-SelfSignedCertificate|Remove-CertificateEnrollmentPolicyServer|Remove-CertificateNotificationTask|Set-CertificateAutoEnrollmentPolicy|Switch-Certificate|Test-Certificate|" + + "Disable-PnpDevice|Enable-PnpDevice|Get-PnpDevice|Get-PnpDeviceProperty|" + + "Find-DscResource|Find-Module|Find-Script|Get-InstalledModule|Get-InstalledScript|Get-PSRepository|Install-Module|Install-Script|New-ScriptFileInfo|Publish-Module|Publish-Script|Register-PSRepository|Save-Module|Save-Script|Set-PSRepository|Test-ScriptFileInfo|Uninstall-Module|Uninstall-Script|Unregister-PSRepository|Update-Module|Update-ModuleManifest|Update-Script|Update-ScriptFileInfo|" + + "Add-Printer|Add-PrinterDriver|Add-PrinterPort|Get-PrintConfiguration|Get-Printer|Get-PrinterDriver|Get-PrinterPort|Get-PrinterProperty|Get-PrintJob|Read-PrinterNfcTag|Remove-Printer|Remove-PrinterDriver|Remove-PrinterPort|Remove-PrintJob|Rename-Printer|Restart-PrintJob|Resume-PrintJob|Set-PrintConfiguration|Set-Printer|Set-PrinterProperty|Suspend-PrintJob|Write-PrinterNfcTag|" + + "Configuration|Disable-DscDebug|Enable-DscDebug|Get-DscConfiguration|Get-DscConfigurationStatus|Get-DscLocalConfigurationManager|Get-DscResource|New-DscChecksum|Remove-DscConfigurationDocument|Restore-DscConfiguration|Stop-DscConfiguration|Invoke-DscResource|Publish-DscConfiguration|Set-DscLocalConfigurationManager|Start-DscConfiguration|Test-DscConfiguration|Update-DscConfiguration|" + + "Disable-PSTrace|Disable-PSWSManCombinedTrace|Disable-WSManTrace|Enable-PSTrace|Enable-PSWSManCombinedTrace|Enable-WSManTrace|Get-LogProperties|Set-LogProperties|Start-Trace|Stop-Trace|" + + "PSConsoleHostReadline|Get-PSReadlineKeyHandler|Get-PSReadlineOption|Remove-PSReadlineKeyHandler|Set-PSReadlineKeyHandler|Set-PSReadlineOption|" + + "Add-JobTrigger|Disable-JobTrigger|Disable-ScheduledJob|Enable-JobTrigger|Enable-ScheduledJob|Get-JobTrigger|Get-ScheduledJob|Get-ScheduledJobOption|New-JobTrigger|New-ScheduledJobOption|Register-ScheduledJob|Remove-JobTrigger|Set-JobTrigger|Set-ScheduledJob|Set-ScheduledJobOption|Unregister-ScheduledJob|" + + "New-PSWorkflowSession|New-PSWorkflowExecutionOption|" + + "Invoke-AsWorkflow|" + + "Disable-ScheduledTask|Enable-ScheduledTask|Export-ScheduledTask|Get-ClusteredScheduledTask|Get-ScheduledTask|Get-ScheduledTaskInfo|New-ScheduledTask|New-ScheduledTaskAction|New-ScheduledTaskPrincipal|New-ScheduledTaskSettingsSet|New-ScheduledTaskTrigger|Register-ClusteredScheduledTask|Register-ScheduledTask|Set-ClusteredScheduledTask|Set-ScheduledTask|Start-ScheduledTask|Stop-ScheduledTask|Unregister-ClusteredScheduledTask|Unregister-ScheduledTask|" + + "Confirm-SecureBootUEFI|Format-SecureBootUEFI|Get-SecureBootPolicy|Get-SecureBootUEFI|Set-SecureBootUEFI|" + + "Block-SmbShareAccess|Close-SmbOpenFile|Close-SmbSession|Disable-SmbDelegation|Enable-SmbDelegation|Get-SmbBandwidthLimit|Get-SmbClientConfiguration|Get-SmbClientNetworkInterface|Get-SmbConnection|Get-SmbDelegation|Get-SmbMapping|Get-SmbMultichannelConnection|Get-SmbMultichannelConstraint|Get-SmbOpenFile|Get-SmbServerConfiguration|Get-SmbServerNetworkInterface|Get-SmbSession|Get-SmbShare|Get-SmbShareAccess|Grant-SmbShareAccess|New-SmbMapping|New-SmbMultichannelConstraint|New-SmbShare|Remove-SmbBandwidthLimit|Remove-SmbMapping|Remove-SmbMultichannelConstraint|Remove-SmbShare|Revoke-SmbShareAccess|Set-SmbBandwidthLimit|Set-SmbClientConfiguration|Set-SmbPathAcl|Set-SmbServerConfiguration|Set-SmbShare|Unblock-SmbShareAccess|Update-SmbMultichannelConnection|" + + "Move-SmbClient|Get-SmbWitnessClient|Move-SmbWitnessClient|" + + "Get-StartApps|Export-StartLayout|Import-StartLayout|" + + "Disable-PhysicalDiskIndication|Disable-StorageDiagnosticLog|Enable-PhysicalDiskIndication|Enable-StorageDiagnosticLog|Flush-Volume|Get-DiskSNV|Get-PhysicalDiskSNV|Get-StorageEnclosureSNV|Initialize-Volume|Write-FileSystemCache|Add-InitiatorIdToMaskingSet|Add-PartitionAccessPath|Add-PhysicalDisk|Add-TargetPortToMaskingSet|Add-VirtualDiskToMaskingSet|Block-FileShareAccess|Clear-Disk|Clear-FileStorageTier|Clear-StorageDiagnosticInfo|Connect-VirtualDisk|Debug-FileShare|Debug-StorageSubSystem|Debug-Volume|Disable-PhysicalDiskIdentification|Disable-StorageEnclosureIdentification|Disable-StorageHighAvailability|Disconnect-VirtualDisk|Dismount-DiskImage|Enable-PhysicalDiskIdentification|Enable-StorageEnclosureIdentification|Enable-StorageHighAvailability|Format-Volume|Get-DedupProperties|Get-Disk|Get-DiskImage|Get-DiskStorageNodeView|Get-FileIntegrity|Get-FileShare|Get-FileShareAccessControlEntry|Get-FileStorageTier|Get-InitiatorId|Get-InitiatorPort|Get-MaskingSet|Get-OffloadDataTransferSetting|Get-Partition|Get-PartitionSupportedSize|Get-PhysicalDisk|Get-PhysicalDiskStorageNodeView|Get-ResiliencySetting|Get-StorageAdvancedProperty|Get-StorageDiagnosticInfo|Get-StorageEnclosure|Get-StorageEnclosureStorageNodeView|Get-StorageEnclosureVendorData|Get-StorageFaultDomain|Get-StorageFileServer|Get-StorageFirmwareInformation|Get-StorageHealthAction|Get-StorageHealthReport|Get-StorageHealthSetting|Get-StorageJob|Get-StorageNode|Get-StoragePool|Get-StorageProvider|Get-StorageReliabilityCounter|Get-StorageSetting|Get-StorageSubSystem|Get-StorageTier|Get-StorageTierSupportedSize|Get-SupportedClusterSizes|Get-SupportedFileSystems|Get-TargetPort|Get-TargetPortal|Get-VirtualDisk|Get-VirtualDiskSupportedSize|Get-Volume|Get-VolumeCorruptionCount|Get-VolumeScrubPolicy|Grant-FileShareAccess|Hide-VirtualDisk|Initialize-Disk|Mount-DiskImage|New-FileShare|New-MaskingSet|New-Partition|New-StorageFileServer|New-StoragePool|New-StorageSubsystemVirtualDisk|New-StorageTier|New-VirtualDisk|New-VirtualDiskClone|New-VirtualDiskSnapshot|New-Volume|Optimize-StoragePool|Optimize-Volume|Register-StorageSubsystem|Remove-FileShare|Remove-InitiatorId|Remove-InitiatorIdFromMaskingSet|Remove-MaskingSet|Remove-Partition|Remove-PartitionAccessPath|Remove-PhysicalDisk|Remove-StorageFileServer|Remove-StorageHealthSetting|Remove-StoragePool|Remove-StorageTier|Remove-TargetPortFromMaskingSet|Remove-VirtualDisk|Remove-VirtualDiskFromMaskingSet|Rename-MaskingSet|Repair-FileIntegrity|Repair-VirtualDisk|Repair-Volume|Reset-PhysicalDisk|Reset-StorageReliabilityCounter|Resize-Partition|Resize-StorageTier|Resize-VirtualDisk|Revoke-FileShareAccess|Set-Disk|Set-FileIntegrity|Set-FileShare|Set-FileStorageTier|Set-InitiatorPort|Set-Partition|Set-PhysicalDisk|Set-ResiliencySetting|Set-StorageFileServer|Set-StorageHealthSetting|Set-StoragePool|Set-StorageProvider|Set-StorageSetting|Set-StorageSubSystem|Set-StorageTier|Set-VirtualDisk|Set-Volume|Set-VolumeScrubPolicy|Show-VirtualDisk|Start-StorageDiagnosticLog|Stop-StorageDiagnosticLog|Stop-StorageJob|Unblock-FileShareAccess|Unregister-StorageSubsystem|Update-Disk|Update-HostStorageCache|Update-StorageFirmware|Update-StoragePool|Update-StorageProviderCache|Write-VolumeCache|" + + "Disable-TlsCipherSuite|Disable-TlsSessionTicketKey|Enable-TlsCipherSuite|Enable-TlsSessionTicketKey|Export-TlsSessionTicketKey|Get-TlsCipherSuite|New-TlsSessionTicketKey|" + + "Get-TroubleshootingPack|Invoke-TroubleshootingPack|" + + "Clear-Tpm|ConvertTo-TpmOwnerAuth|Disable-TpmAutoProvisioning|Enable-TpmAutoProvisioning|Get-Tpm|Get-TpmEndorsementKeyInfo|Get-TpmSupportedFeature|Import-TpmOwnerAuth|Initialize-Tpm|Set-TpmOwnerAuth|Unblock-Tpm|" + + "Add-VpnConnection|Add-VpnConnectionRoute|Add-VpnConnectionTriggerApplication|Add-VpnConnectionTriggerDnsConfiguration|Add-VpnConnectionTriggerTrustedNetwork|Get-VpnConnection|Get-VpnConnectionTrigger|New-EapConfiguration|New-VpnServerAddress|Remove-VpnConnection|Remove-VpnConnectionRoute|Remove-VpnConnectionTriggerApplication|Remove-VpnConnectionTriggerDnsConfiguration|Remove-VpnConnectionTriggerTrustedNetwork|Set-VpnConnection|Set-VpnConnectionIPsecConfiguration|Set-VpnConnectionProxy|Set-VpnConnectionTriggerDnsConfiguration|Set-VpnConnectionTriggerTrustedNetwork|" + + "Add-OdbcDsn|Disable-OdbcPerfCounter|Disable-WdacBidTrace|Enable-OdbcPerfCounter|Enable-WdacBidTrace|Get-OdbcDriver|Get-OdbcDsn|Get-OdbcPerfCounter|Get-WdacBidTrace|Remove-OdbcDsn|Set-OdbcDriver|Set-OdbcDsn|" + + "Get-WindowsDeveloperLicense|Show-WindowsDeveloperLicenseRegistration|Unregister-WindowsDeveloperLicense|" + + "Disable-WindowsErrorReporting|Enable-WindowsErrorReporting|Get-WindowsErrorReporting|" + + "Get-WindowsSearchSetting|Set-WindowsSearchSetting|" + + "Get-WindowsUpdateLog" + ); + + var keywordMapper = this.createKeywordMapper({ + "support.function": builtinFunctions, + "keyword": keywords + }, "identifier"); + var binaryOperatorsRe = ( + "eq|ne|gt|lt|le|ge|like|notlike|match|notmatch|contains|notcontains|in|notin|band|bor|bxor|bnot|" + + "ceq|cne|cgt|clt|cle|cge|clike|cnotlike|cmatch|cnotmatch|ccontains|cnotcontains|cin|cnotin|" + + "ieq|ine|igt|ilt|ile|ige|ilike|inotlike|imatch|inotmatch|icontains|inotcontains|iin|inotin|" + + "and|or|xor|not|" + + "split|join|replace|f|" + + "csplit|creplace|" + + "isplit|ireplace|" + + "is|isnot|as|" + + "shl|shr" + ); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "#.*$" + }, { + token : "comment.start", + regex : "<#", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "[$](?:[Tt]rue|[Ff]alse)\\b" + }, { + token : "constant.language", + regex : "[$][Nn]ull\\b" + }, { + token : "variable.instance", + regex : "[$][a-zA-Z][a-zA-Z0-9_]*\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b" + }, { + token : "keyword.operator", + regex : "\\-(?:" + binaryOperatorsRe + ")" + }, { + token : "keyword.operator", + regex : "&|\\+|\\-|\\*|\\/|\\%|\\=|\\>|\\&|\\!|\\|" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment.end", + regex : "#>", + next : "start" + }, { + token : "doc.comment.tag", + regex : "^\\.\\w+" + }, { + defaultToken : "comment" + } + ] + }; +}; + +oop.inherits(PowershellHighlightRules, TextHighlightRules); + +exports.PowershellHighlightRules = PowershellHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/powershell",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/powershell_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PowershellHighlightRules = require("./powershell_highlight_rules").PowershellHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = PowershellHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode({start: "^\\s*(<#)", end: "^[#\\s]>\\s*$"}); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "#"; + this.blockComment = {start: "<#", end: "#>"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + + this.createWorker = function(session) { + return null; + }; + + this.$id = "ace/mode/powershell"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-praat.js b/htdocs/includes/ace/mode-praat.js new file mode 100644 index 00000000000..a3a50f7e1bf --- /dev/null +++ b/htdocs/includes/ace/mode-praat.js @@ -0,0 +1,468 @@ +ace.define("ace/mode/praat_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PraatHighlightRules = function() { + + var keywords = ( + "if|then|else|elsif|elif|endif|fi|" + + "endfor|endproc|" + // related keywords specified below + "while|endwhile|" + + "repeat|until|" + + "select|plus|minus|" + + "assert|asserterror" + ); + + var predefinedVariables = ( + "macintosh|windows|unix|" + + "praatVersion|praatVersion\\$" + + "pi|undefined|" + + "newline\\$|tab\\$|" + + "shellDirectory\\$|homeDirectory\\$|preferencesDirectory\\$|" + + "temporaryDirectory\\$|defaultDirectory\\$" + ); + var directives = ( + "clearinfo|endSendPraat" + ); + + var functions = ( + "writeInfo|writeInfoLine|appendInfo|appendInfoLine|info\\$|" + + "writeFile|writeFileLine|appendFile|appendFileLine|" + + "abs|round|floor|ceiling|min|max|imin|imax|" + + "sqrt|sin|cos|tan|arcsin|arccos|arctan|arctan2|sinc|sincpi|" + + "exp|ln|lnBeta|lnGamma|log10|log2|" + + "sinh|cosh|tanh|arcsinh|arccosh|arctanh|" + + "sigmoid|invSigmoid|erf|erfc|" + + "random(?:Uniform|Integer|Gauss|Poisson|Binomial)|" + + "gaussP|gaussQ|invGaussQ|incompleteGammaP|incompleteBeta|" + + "chiSquareP|chiSquareQ|invChiSquareQ|studentP|studentQ|invStudentQ|" + + "fisherP|fisherQ|invFisherQ|" + + "binomialP|binomialQ|invBinomialP|invBinomialQ|" + + "hertzToBark|barkToHerz|" + + "hertzToMel|melToHertz|" + + "hertzToSemitones|semitonesToHerz|" + + "erb|hertzToErb|erbToHertz|" + + "phonToDifferenceLimens|differenceLimensToPhon|" + + "soundPressureToPhon|" + + "beta|beta2|besselI|besselK|" + + "numberOfColumns|numberOfRows|" + + "selected|selected\\$|numberOfSelected|variableExists|"+ + "index|rindex|startsWith|endsWith|"+ + "index_regex|rindex_regex|replace_regex\\$|"+ + "length|extractWord\\$|extractLine\\$|extractNumber|" + + "left\\$|right\\$|mid\\$|replace\\$|" + + "date\\$|fixed\\$|percent\\$|" + + "zero#|linear#|randomUniform#|randomInteger#|randomGauss#|" + + "beginPause|endPause|" + + "demoShow|demoWindowTitle|demoInput|demoWaitForInput|" + + "demoClicked|demoClickedIn|demoX|demoY|" + + "demoKeyPressed|demoKey\\$|" + + "demoExtraControlKeyPressed|demoShiftKeyPressed|"+ + "demoCommandKeyPressed|demoOptionKeyPressed|" + + "environment\\$|chooseReadFile\\$|" + + "chooseDirectory\\$|createDirectory|fileReadable|deleteFile|" + + "selectObject|removeObject|plusObject|minusObject|" + + "runScript|exitScript|" + + "beginSendPraat|endSendPraat|" + + "objectsAreIdentical" + ); + + var objectTypes = ( + "Activation|AffineTransform|AmplitudeTier|Art|Artword|Autosegment|" + + "BarkFilter|CCA|Categories|Cepstrum|Cepstrumc|ChebyshevSeries|" + + "ClassificationTable|Cochleagram|Collection|Configuration|" + + "Confusion|ContingencyTable|Corpus|Correlation|Covariance|" + + "CrossCorrelationTable|CrossCorrelationTables|DTW|Diagonalizer|" + + "Discriminant|Dissimilarity|Distance|Distributions|DurationTier|" + + "EEG|ERP|ERPTier|Eigen|Excitation|Excitations|ExperimentMFC|FFNet|" + + "FeatureWeights|Formant|FormantFilter|FormantGrid|FormantPoint|" + + "FormantTier|GaussianMixture|HMM|HMM_Observation|" + + "HMM_ObservationSequence|HMM_State|HMM_StateSequence|Harmonicity|" + + "ISpline|Index|Intensity|IntensityTier|IntervalTier|KNN|KlattGrid|" + + "KlattTable|LFCC|LPC|Label|LegendreSeries|LinearRegression|" + + "LogisticRegression|LongSound|Ltas|MFCC|MSpline|ManPages|" + + "Manipulation|Matrix|MelFilter|MixingMatrix|Movie|Network|" + + "OTGrammar|OTHistory|OTMulti|PCA|PairDistribution|ParamCurve|" + + "Pattern|Permutation|Pitch|PitchTier|PointProcess|Polygon|" + + "Polynomial|Procrustes|RealPoint|RealTier|ResultsMFC|Roots|SPINET|" + + "SSCP|SVD|Salience|ScalarProduct|Similarity|SimpleString|" + + "SortedSetOfString|Sound|Speaker|Spectrogram|Spectrum|SpectrumTier|" + + "SpeechSynthesizer|SpellingChecker|Strings|StringsIndex|Table|" + + "TableOfReal|TextGrid|TextInterval|TextPoint|TextTier|Tier|" + + "Transition|VocalTract|Weight|WordList" + ); + + this.$rules = { + "start" : [ + { + token : "string.interpolated", + regex : /'((?:[a-z][a-zA-Z0-9_]*)(?:\$|#|:[0-9]+)?)'/ + }, { + token : ["text", "text", "keyword.operator", "text", "keyword"], + regex : /(^\s*)(?:([a-z][a-zA-Z0-9_]*\$?\s+)(=)(\s+))?(stopwatch)/ + }, { + token : ["text", "keyword", "text", "string"], + regex : /(^\s*)(print(?:line|tab)?|echo|exit|pause|send(?:praat|socket)|include|execute|system(?:_nocheck)?)(\s+)(.*)/ + }, { + token : ["text", "keyword"], + regex : "(^\\s*)(" + directives + ")$" + }, { + token : ["text", "keyword.operator", "text"], + regex : /(\s+)((?:\+|-|\/|\*|<|>)=?|==?|!=|%|\^|\||and|or|not)(\s+)/ + }, { + token : ["text", "text", "keyword.operator", "text", "keyword", "text", "keyword"], + regex : /(^\s*)(?:([a-z][a-zA-Z0-9_]*\$?\s+)(=)(\s+))?(?:((?:no)?warn|(?:unix_)?nocheck|noprogress)(\s+))?((?:[A-Z][^.:"]+)(?:$|(?:\.{3}|:)))/ + }, { + token : ["text", "keyword", "text", "keyword"], + regex : /(^\s*)(?:(demo)?(\s+))((?:[A-Z][^.:"]+)(?:$|(?:\.{3}|:)))/ + }, { + token : ["text", "keyword", "text", "keyword"], + regex : /^(\s*)(?:(demo)(\s+))?(10|12|14|16|24)$/ + }, { + token : ["text", "support.function", "text"], + regex : /(\s*)(do\$?)(\s*:\s*|\s*\(\s*)/ + }, { + token : "entity.name.type", + regex : "(" + objectTypes + ")" + }, { + token : "variable.language", + regex : "(" + predefinedVariables + ")" + }, { + token : ["support.function", "text"], + regex : "((?:" + functions + ")\\$?)(\\s*(?::|\\())" + }, { + token : "keyword", + regex : /(\bfor\b)/, + next : "for" + }, { + token : "keyword", + regex : "(\\b(?:" + keywords + ")\\b)" + }, { + token : "string", + regex : /"[^"]*"/ + }, { + token : "string", + regex : /"[^"]*$/, + next : "brokenstring" + }, { + token : ["text", "keyword", "text", "entity.name.section"], + regex : /(^\s*)(\bform\b)(\s+)(.*)/, + next : "form" + }, { + token : "constant.numeric", + regex : /\b[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ + }, { + token : ["keyword", "text", "entity.name.function"], + regex : /(procedure)(\s+)(\S+)/ + }, { + token : ["entity.name.function", "text"], + regex : /(@\S+)(:|\s*\()/ + }, { + token : ["text", "keyword", "text", "entity.name.function"], + regex : /(^\s*)(call)(\s+)(\S+)/ + }, { + token : "comment", + regex : /(^\s*#|;).*$/ + }, { + token : "text", + regex : /\s+/ + } + ], + "form" : [ + { + token : ["keyword", "text", "constant.numeric"], + regex : /((?:optionmenu|choice)\s+)(\S+:\s+)([0-9]+)/ + }, { + token : ["keyword", "constant.numeric"], + regex : /((?:option|button)\s+)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b)/ + }, { + token : ["keyword", "string"], + regex : /((?:option|button)\s+)(.*)/ + }, { + token : ["keyword", "text", "string"], + regex : /((?:sentence|text)\s+)(\S+\s*)(.*)/ + }, { + token : ["keyword", "text", "string", "invalid.illegal"], + regex : /(word\s+)(\S+\s*)(\S+)?(\s.*)?/ + }, { + token : ["keyword", "text", "constant.language"], + regex : /(boolean\s+)(\S+\s*)(0|1|"?(?:yes|no)"?)/ + }, { + token : ["keyword", "text", "constant.numeric"], + regex : /((?:real|natural|positive|integer)\s+)(\S+\s*)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b)/ + }, { + token : ["keyword", "string"], + regex : /(comment\s+)(.*)/ + }, { + token : "keyword", + regex : 'endform', + next : "start" + } + ], + "for" : [ + { + token : ["keyword", "text", "constant.numeric", "text"], + regex : /(from|to)(\s+)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?)(\s*)/ + }, { + token : ["keyword", "text"], + regex : /(from|to)(\s+\S+\s*)/ + }, { + token : "text", + regex : /$/, + next : "start" + } + ], + "brokenstring" : [ + { + token : ["text", "string"], + regex : /(\s*\.{3})([^"]*)/ + }, { + token : "string", + regex : /"/, + next : "start" + } + ] + }; +}; + +oop.inherits(PraatHighlightRules, TextHighlightRules); + +exports.PraatHighlightRules = PraatHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/praat",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/praat_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PraatHighlightRules = require("./praat_highlight_rules").PraatHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = PraatHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/praat"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-prolog.js b/htdocs/includes/ace/mode-prolog.js new file mode 100644 index 00000000000..6bf01adb490 --- /dev/null +++ b/htdocs/includes/ace/mode-prolog.js @@ -0,0 +1,364 @@ +ace.define("ace/mode/prolog_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PrologHighlightRules = function() { + + this.$rules = { start: + [ { include: '#comment' }, + { include: '#basic_fact' }, + { include: '#rule' }, + { include: '#directive' }, + { include: '#fact' } ], + '#atom': + [ { token: 'constant.other.atom.prolog', + regex: '\\b[a-z][a-zA-Z0-9_]*\\b' }, + { token: 'constant.numeric.prolog', + regex: '-?\\d+(?:\\.\\d+)?' }, + { include: '#string' } ], + '#basic_elem': + [ { include: '#comment' }, + { include: '#statement' }, + { include: '#constants' }, + { include: '#operators' }, + { include: '#builtins' }, + { include: '#list' }, + { include: '#atom' }, + { include: '#variable' } ], + '#basic_fact': + [ { token: + [ 'entity.name.function.fact.basic.prolog', + 'punctuation.end.fact.basic.prolog' ], + regex: '([a-z]\\w*)(\\.)' } ], + '#builtins': + [ { token: 'support.function.builtin.prolog', + regex: '\\b(?:abolish|abort|ancestors|arg|ascii|assert[az]|atom(?:ic)?|body|char|close|conc|concat|consult|define|definition|dynamic|dump|fail|file|free|free_proc|functor|getc|goal|halt|head|head|integer|length|listing|match_args|member|next_clause|nl|nonvar|nth|number|cvars|nvars|offset|op|print?|prompt|putc|quoted|ratom|read|redefine|rename|retract(?:all)?|see|seeing|seen|skip|spy|statistics|system|tab|tell|telling|term|time|told|univ|unlink_clause|unspy_predicate|var|write)\\b' } ], + '#comment': + [ { token: + [ 'punctuation.definition.comment.prolog', + 'comment.line.percentage.prolog' ], + regex: '(%)(.*$)' }, + { token: 'punctuation.definition.comment.prolog', + regex: '/\\*', + push: + [ { token: 'punctuation.definition.comment.prolog', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.prolog' } ] } ], + '#constants': + [ { token: 'constant.language.prolog', + regex: '\\b(?:true|false|yes|no)\\b' } ], + '#directive': + [ { token: 'keyword.operator.directive.prolog', + regex: ':-', + push: + [ { token: 'meta.directive.prolog', regex: '\\.', next: 'pop' }, + { include: '#comment' }, + { include: '#statement' }, + { defaultToken: 'meta.directive.prolog' } ] } ], + '#expr': + [ { include: '#comments' }, + { token: 'meta.expression.prolog', + regex: '\\(', + push: + [ { token: 'meta.expression.prolog', regex: '\\)', next: 'pop' }, + { include: '#expr' }, + { defaultToken: 'meta.expression.prolog' } ] }, + { token: 'keyword.control.cutoff.prolog', regex: '!' }, + { token: 'punctuation.control.and.prolog', regex: ',' }, + { token: 'punctuation.control.or.prolog', regex: ';' }, + { include: '#basic_elem' } ], + '#fact': + [ { token: + [ 'entity.name.function.fact.prolog', + 'punctuation.begin.fact.parameters.prolog' ], + regex: '([a-z]\\w*)(\\()(?!.*:-)', + push: + [ { token: + [ 'punctuation.end.fact.parameters.prolog', + 'punctuation.end.fact.prolog' ], + regex: '(\\))(\\.?)', + next: 'pop' }, + { include: '#parameter' }, + { defaultToken: 'meta.fact.prolog' } ] } ], + '#list': + [ { token: 'punctuation.begin.list.prolog', + regex: '\\[(?=.*\\])', + push: + [ { token: 'punctuation.end.list.prolog', + regex: '\\]', + next: 'pop' }, + { include: '#comment' }, + { token: 'punctuation.separator.list.prolog', regex: ',' }, + { token: 'punctuation.concat.list.prolog', + regex: '\\|', + push: + [ { token: 'meta.list.concat.prolog', + regex: '(?=\\s*\\])', + next: 'pop' }, + { include: '#basic_elem' }, + { defaultToken: 'meta.list.concat.prolog' } ] }, + { include: '#basic_elem' }, + { defaultToken: 'meta.list.prolog' } ] } ], + '#operators': + [ { token: 'keyword.operator.prolog', + regex: '\\\\\\+|\\bnot\\b|\\bis\\b|->|[><]|[><\\\\:=]?=|(?:=\\\\|\\\\=)=' } ], + '#parameter': + [ { token: 'variable.language.anonymous.prolog', + regex: '\\b_\\b' }, + { token: 'variable.parameter.prolog', + regex: '\\b[A-Z_]\\w*\\b' }, + { token: 'punctuation.separator.parameters.prolog', regex: ',' }, + { include: '#basic_elem' }, + { token: 'text', regex: '[^\\s]' } ], + '#rule': + [ { token: 'meta.rule.prolog', + regex: '(?=[a-z]\\w*.*:-)', + push: + [ { token: 'punctuation.rule.end.prolog', + regex: '\\.', + next: 'pop' }, + { token: 'meta.rule.signature.prolog', + regex: '(?=[a-z]\\w*.*:-)', + push: + [ { token: 'meta.rule.signature.prolog', + regex: '(?=:-)', + next: 'pop' }, + { token: 'entity.name.function.rule.prolog', + regex: '[a-z]\\w*(?=\\(|\\s*:-)' }, + { token: 'punctuation.rule.parameters.begin.prolog', + regex: '\\(', + push: + [ { token: 'punctuation.rule.parameters.end.prolog', + regex: '\\)', + next: 'pop' }, + { include: '#parameter' }, + { defaultToken: 'meta.rule.parameters.prolog' } ] }, + { defaultToken: 'meta.rule.signature.prolog' } ] }, + { token: 'keyword.operator.definition.prolog', + regex: ':-', + push: + [ { token: 'meta.rule.definition.prolog', + regex: '(?=\\.)', + next: 'pop' }, + { include: '#comment' }, + { include: '#expr' }, + { defaultToken: 'meta.rule.definition.prolog' } ] }, + { defaultToken: 'meta.rule.prolog' } ] } ], + '#statement': + [ { token: 'meta.statement.prolog', + regex: '(?=[a-z]\\w*\\()', + push: + [ { token: 'punctuation.end.statement.parameters.prolog', + regex: '\\)', + next: 'pop' }, + { include: '#builtins' }, + { include: '#atom' }, + { token: 'punctuation.begin.statement.parameters.prolog', + regex: '\\(', + push: + [ { token: 'meta.statement.parameters.prolog', + regex: '(?=\\))', + next: 'pop' }, + { token: 'punctuation.separator.statement.prolog', regex: ',' }, + { include: '#basic_elem' }, + { defaultToken: 'meta.statement.parameters.prolog' } ] }, + { defaultToken: 'meta.statement.prolog' } ] } ], + '#string': + [ { token: 'punctuation.definition.string.begin.prolog', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.prolog', + regex: '\'', + next: 'pop' }, + { token: 'constant.character.escape.prolog', regex: '\\\\.' }, + { token: 'constant.character.escape.quote.prolog', + regex: '\'\'' }, + { defaultToken: 'string.quoted.single.prolog' } ] } ], + '#variable': + [ { token: 'variable.language.anonymous.prolog', + regex: '\\b_\\b' }, + { token: 'variable.other.prolog', + regex: '\\b[A-Z_][a-zA-Z0-9_]*\\b' } ] } + + this.normalizeRules(); +}; + +PrologHighlightRules.metaData = { fileTypes: [ 'plg', 'prolog' ], + foldingStartMarker: '(%\\s*region \\w*)|([a-z]\\w*.*:- ?)', + foldingStopMarker: '(%\\s*end(\\s*region)?)|(?=\\.)', + keyEquivalent: '^~P', + name: 'Prolog', + scopeName: 'source.prolog' } + + +oop.inherits(PrologHighlightRules, TextHighlightRules); + +exports.PrologHighlightRules = PrologHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/prolog",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/prolog_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PrologHighlightRules = require("./prolog_highlight_rules").PrologHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = PrologHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "%"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/prolog"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-properties.js b/htdocs/includes/ace/mode-properties.js new file mode 100644 index 00000000000..2e9ba725bd4 --- /dev/null +++ b/htdocs/includes/ace/mode-properties.js @@ -0,0 +1,73 @@ +ace.define("ace/mode/properties_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PropertiesHighlightRules = function() { + + var escapeRe = /\\u[0-9a-fA-F]{4}|\\/; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : /[!#].*$/ + }, { + token : "keyword", + regex : /[=:]$/ + }, { + token : "keyword", + regex : /[=:]/, + next : "value" + }, { + token : "constant.language.escape", + regex : escapeRe + }, { + defaultToken: "variable" + } + ], + "value" : [ + { + regex : /\\$/, + token : "string", + next : "value" + }, { + regex : /$/, + token : "string", + next : "start" + }, { + token : "constant.language.escape", + regex : escapeRe + }, { + defaultToken: "string" + } + ] + }; + +}; + +oop.inherits(PropertiesHighlightRules, TextHighlightRules); + +exports.PropertiesHighlightRules = PropertiesHighlightRules; +}); + +ace.define("ace/mode/properties",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/properties_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PropertiesHighlightRules = require("./properties_highlight_rules").PropertiesHighlightRules; + +var Mode = function() { + this.HighlightRules = PropertiesHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/properties"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-protobuf.js b/htdocs/includes/ace/mode-protobuf.js new file mode 100644 index 00000000000..8cef657623d --- /dev/null +++ b/htdocs/includes/ace/mode-protobuf.js @@ -0,0 +1,577 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" + +var c_cppHighlightRules = function() { + + var keywordControls = ( + "break|case|continue|default|do|else|for|goto|if|_Pragma|" + + "return|switch|while|catch|operator|try|throw|using" + ); + + var storageType = ( + "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + + "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + + "class|wchar_t|template|char16_t|char32_t" + ); + + var storageModifiers = ( + "const|extern|register|restrict|static|volatile|inline|private|" + + "protected|public|friend|explicit|virtual|export|mutable|typename|" + + "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" + ); + + var keywordOperators = ( + "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + + "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" + ); + + var builtinConstants = ( + "NULL|true|false|TRUE|FALSE|nullptr" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword.control" : keywordControls, + "storage.type" : storageType, + "storage.modifier" : storageModifiers, + "keyword.operator" : keywordOperators, + "variable.language": "this", + "constant.language": builtinConstants + }, "identifier"); + + var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "//$", + next : "start" + }, { + token : "comment", + regex : "//", + next : "singleLineComment" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // character + regex : "'(?:" + escapeRe + "|.)?'" + }, { + token : "string.start", + regex : '"', + stateName: "qqstring", + next: [ + { token: "string", regex: /\\\s*$/, next: "qqstring" }, + { token: "constant.language.escape", regex: escapeRe }, + { token: "constant.language.escape", regex: /%[^'"\\]/ }, + { token: "string.end", regex: '"|$', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "string.start", + regex : 'R"\\(', + stateName: "rawString", + next: [ + { token: "string.end", regex: '\\)"', next: "start" }, + { defaultToken: "string"} + ] + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + }, { + token : "keyword", // pre-compiler directives + regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", + next : "directive" + }, { + token : "keyword", // special case pre-compiler directive + regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" + }, { + token : "support.function.C99.c", + regex : cFunctions + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" + }, { + token : "keyword.operator", + regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/ + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "singleLineComment" : [ + { + token : "comment", + regex : /\\$/, + next : "singleLineComment" + }, { + token : "comment", + regex : /$/, + next : "start" + }, { + defaultToken: "comment" + } + ], + "directive" : [ + { + token : "constant.other.multiline", + regex : /\\/ + }, + { + token : "constant.other.multiline", + regex : /.*\\/ + }, + { + token : "constant.other", + regex : "\\s*<.+?>", + next : "start" + }, + { + token : "constant.other", // single line + regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', + next : "start" + }, + { + token : "constant.other", // single line + regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", + next : "start" + }, + { + token : "constant.other", + regex : /[^\\\/]+/, + next : "start" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(c_cppHighlightRules, TextHighlightRules); + +exports.c_cppHighlightRules = c_cppHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = c_cppHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/c_cpp"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/protobuf_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { + "use strict"; + + var oop = require("../lib/oop"); + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + + var ProtobufHighlightRules = function() { + + var builtinTypes = "double|float|int32|int64|uint32|uint64|sint32|" + + "sint64|fixed32|fixed64|sfixed32|sfixed64|bool|" + + "string|bytes"; + var keywordDeclaration = "message|required|optional|repeated|package|" + + "import|option|enum"; + + var keywordMapper = this.createKeywordMapper({ + "keyword.declaration.protobuf": keywordDeclaration, + "support.type": builtinTypes + }, "identifier"); + + this.$rules = { + "start": [{ + token: "comment", + regex: /\/\/.*$/ + }, { + token: "comment", + regex: /\/\*/, + next: "comment" + }, { + token: "constant", + regex: "<[^>]+>" + }, { + regex: "=", + token: "keyword.operator.assignment.protobuf" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : '[\'](?:(?:\\\\.)|(?:[^\'\\\\]))*?[\']' + }, { + token: "constant.numeric", // hex + regex: "0[xX][0-9a-fA-F]+\\b" + }, { + token: "constant.numeric", // float + regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token: keywordMapper, + regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }], + "comment": [{ + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + }] + }; + + this.normalizeRules(); + }; + + oop.inherits(ProtobufHighlightRules, TextHighlightRules); + + exports.ProtobufHighlightRules = ProtobufHighlightRules; +}); + +ace.define("ace/mode/protobuf",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/protobuf_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var CMode = require("./c_cpp").Mode; +var ProtobufHighlightRules = require("./protobuf_highlight_rules").ProtobufHighlightRules; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + CMode.call(this); + this.foldingRules = new CStyleFoldMode(); + this.HighlightRules = ProtobufHighlightRules; +}; +oop.inherits(Mode, CMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/protobuf"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-python.js b/htdocs/includes/ace/mode-python.js new file mode 100644 index 00000000000..19efccb6500 --- /dev/null +++ b/htdocs/includes/ace/mode-python.js @@ -0,0 +1,265 @@ +ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var PythonHighlightRules = function() { + + var keywords = ( + "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" + + "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" + + "raise|return|try|while|with|yield" + ); + + var builtinConstants = ( + "True|False|None|NotImplemented|Ellipsis|__debug__" + ); + + var builtinFunctions = ( + "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" + + "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" + + "binfile|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 keywordMapper = this.createKeywordMapper({ + "invalid.deprecated": "debugger", + "support.function": builtinFunctions, + "constant.language": builtinConstants, + "keyword": keywords + }, "identifier"); + + var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; + + var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; + var octInteger = "(?:0[oO]?[0-7]+)"; + var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; + var binInteger = "(?:0[bB][01]+)"; + var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; + + var exponent = "(?:[eE][+-]?\\d+)"; + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + + var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; + + this.$rules = { + "start" : [ { + token : "comment", + regex : "#.*$" + }, { + token : "string", // multi line """ string start + regex : strPre + '"{3}', + next : "qqstring3" + }, { + token : "string", // " string + regex : strPre + '"(?=.)', + next : "qqstring" + }, { + token : "string", // multi line ''' string start + regex : strPre + "'{3}", + next : "qstring3" + }, { + token : "string", // ' string + regex : strPre + "'(?=.)", + next : "qstring" + }, { + token : "constant.numeric", // imaginary + regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // long integer + regex : integer + "[lL]\\b" + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]\\)\\}]" + }, { + token : "text", + regex : "\\s+" + } ], + "qqstring3" : [ { + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", // multi line """ string end + regex : '"{3}', + next : "start" + }, { + defaultToken : "string" + } ], + "qstring3" : [ { + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", // multi line ''' string end + regex : "'{3}", + next : "start" + }, { + defaultToken : "string" + } ], + "qqstring" : [{ + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "start" + }, { + defaultToken: "string" + }], + "qstring" : [{ + token : "constant.language.escape", + regex : stringEscape + }, { + token : "string", + regex : "\\\\$", + next : "qstring" + }, { + token : "string", + regex : "'|$", + next : "start" + }, { + defaultToken: "string" + }] + }; +}; + +oop.inherits(PythonHighlightRules, TextHighlightRules); + +exports.PythonHighlightRules = PythonHighlightRules; +}); + +ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(markers) { + this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$"); +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var line = session.getLine(row); + var match = line.match(this.foldingStartMarker); + if (match) { + if (match[1]) + return this.openingBracketBlock(session, match[1], row, match.index); + if (match[2]) + return this.indentationBlock(session, row, match.index + match[2].length); + return this.indentationBlock(session, row); + } + } + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules; +var PythonFoldMode = require("./folding/pythonic").FoldMode; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = PythonHighlightRules; + this.foldingRules = new PythonFoldMode("\\:"); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + var outdents = { + "pass": 1, + "return": 1, + "raise": 1, + "break": 1, + "continue": 1 + }; + + this.checkOutdent = function(state, line, input) { + if (input !== "\r\n" && input !== "\r" && input !== "\n") + return false; + + var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + + if (!tokens) + return false; + do { + var last = tokens.pop(); + } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); + + if (!last) + return false; + + return (last.type == "keyword" && outdents[last.value]); + }; + + this.autoOutdent = function(state, doc, row) { + + row += 1; + var indent = this.$getIndent(doc.getLine(row)); + var tab = doc.getTabString(); + if (indent.slice(-tab.length) == tab) + doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); + }; + + this.$id = "ace/mode/python"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-r.js b/htdocs/includes/ace/mode-r.js new file mode 100644 index 00000000000..297d7e0569e --- /dev/null +++ b/htdocs/includes/ace/mode-r.js @@ -0,0 +1,301 @@ +ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var TexHighlightRules = function(textClass) { + + if (!textClass) + textClass = "text"; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "%.*$" + }, { + token : textClass, // non-command + regex : "\\\\[$&%#\\{\\}]" + }, { + token : "keyword", // command + regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b", + next : "nospell" + }, { + token : "keyword", // command + regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])" + }, { + token : "paren.keyword.operator", + regex : "[[({]" + }, { + token : "paren.keyword.operator", + regex : "[\\])}]" + }, { + token : textClass, + regex : "\\s+" + } + ], + "nospell" : [ + { + token : "comment", + regex : "%.*$", + next : "start" + }, { + token : "nospell." + textClass, // non-command + regex : "\\\\[$&%#\\{\\}]" + }, { + token : "keyword", // command + regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b" + }, { + token : "keyword", // command + regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])", + next : "start" + }, { + token : "paren.keyword.operator", + regex : "[[({]" + }, { + token : "paren.keyword.operator", + regex : "[\\])]" + }, { + token : "paren.keyword.operator", + regex : "}", + next : "start" + }, { + token : "nospell." + textClass, + regex : "\\s+" + }, { + token : "nospell." + textClass, + regex : "\\w+" + } + ] + }; +}; + +oop.inherits(TexHighlightRules, TextHighlightRules); + +exports.TexHighlightRules = TexHighlightRules; +}); + +ace.define("ace/mode/r_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"], function(require, exports, module) +{ + + var oop = require("../lib/oop"); + var lang = require("../lib/lang"); + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules; + + var RHighlightRules = function() + { + + var keywords = lang.arrayToMap( + ("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass") + .split("|") + ); + + var buildinConstants = lang.arrayToMap( + ("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|" + + "NA_complex_").split("|") + ); + + this.$rules = { + "start" : [ + { + token : "comment.sectionhead", + regex : "#+(?!').*(?:----|====|####)\\s*$" + }, + { + token : "comment", + regex : "#+'", + next : "rd-start" + }, + { + token : "comment", + regex : "#.*$" + }, + { + token : "string", // multi line string start + regex : '["]', + next : "qqstring" + }, + { + token : "string", // multi line string start + regex : "[']", + next : "qstring" + }, + { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+[Li]?\\b" + }, + { + token : "constant.numeric", // explicit integer + regex : "\\d+L\\b" + }, + { + token : "constant.numeric", // number + regex : "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b" + }, + { + token : "constant.numeric", // number with leading decimal + regex : "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b" + }, + { + token : "constant.language.boolean", + regex : "(?:TRUE|FALSE|T|F)\\b" + }, + { + token : "identifier", + regex : "`.*?`" + }, + { + onMatch : function(value) { + if (keywords[value]) + return "keyword"; + else if (buildinConstants[value]) + return "constant.language"; + else if (value == '...' || value.match(/^\.\.\d+$/)) + return "variable.language"; + else + return "identifier"; + }, + regex : "[a-zA-Z.][a-zA-Z0-9._]*\\b" + }, + { + token : "keyword.operator", + regex : "%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:" + }, + { + token : "keyword.operator", // infix operators + regex : "%.*?%" + }, + { + token : "paren.keyword.operator", + regex : "[[({]" + }, + { + token : "paren.keyword.operator", + regex : "[\\])}]" + }, + { + token : "text", + regex : "\\s+" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, + { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, + { + token : "string", + regex : '.+' + } + ] + }; + + var rdRules = new TexHighlightRules("comment").getRules(); + for (var i = 0; i < rdRules["start"].length; i++) { + rdRules["start"][i].token += ".virtual-comment"; + } + + this.addRules(rdRules, "rd-"); + this.$rules["rd-start"].unshift({ + token: "text", + regex: "^", + next: "start" + }); + this.$rules["rd-start"].unshift({ + token : "keyword", + regex : "@(?!@)[^ ]*" + }); + this.$rules["rd-start"].unshift({ + token : "comment", + regex : "@@" + }); + this.$rules["rd-start"].push({ + token : "comment", + regex : "[^%\\\\[({\\])}]+" + }); + }; + + oop.inherits(RHighlightRules, TextHighlightRules); + + exports.RHighlightRules = RHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/r",["require","exports","module","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/r_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) { + "use strict"; + + var Range = require("../range").Range; + var oop = require("../lib/oop"); + var TextMode = require("./text").Mode; + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + var RHighlightRules = require("./r_highlight_rules").RHighlightRules; + var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + + var Mode = function(){ + this.HighlightRules = RHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = this.$defaultBehaviour; + }; + oop.inherits(Mode, TextMode); + + (function() + { + this.lineCommentStart = "#"; + this.$id = "ace/mode/r"; + }).call(Mode.prototype); + exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-razor.js b/htdocs/includes/ace/mode-razor.js new file mode 100644 index 00000000000..c19ec55f39c --- /dev/null +++ b/htdocs/includes/ace/mode-razor.js @@ -0,0 +1,2845 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/csharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var CSharpHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": "abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic", + "constant.language": "null|true|false" + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // character + regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))?'/ + }, { + token : "string", start : '"', end : '"|$', next: [ + {token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/}, + {token: "invalid", regex: /\\./} + ] + }, { + token : "string", start : '@"', end : '"', next:[ + {token: "constant.language.escape", regex: '""'} + ] + }, { + token : "string", start : /\$"/, end : '"|$', next: [ + {token: "constant.language.escape", regex: /\\(:?$)|{{/}, + {token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/}, + {token: "invalid", regex: /\\./} + ] + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "keyword", + regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)" + }, { + token : "punctuation.operator", + regex : "\\?|\\:|\\,|\\;|\\." + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); +}; + +oop.inherits(CSharpHighlightRules, TextHighlightRules); + +exports.CSharpHighlightRules = CSharpHighlightRules; +}); + +ace.define("ace/mode/razor_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/html_highlight_rules","ace/mode/csharp_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules; + +var blockPrefix = 'razor-block-'; +var RazorLangHighlightRules = function() { + CSharpHighlightRules.call(this); + + var processPotentialCallback = function(value, stackItem) { + if (typeof stackItem === "function") + return stackItem(value); + + return stackItem; + }; + + var inBraces = 'in-braces'; + this.$rules.start.unshift({ + regex: '[\\[({]', + onMatch: function(value, state, stack) { + var prefix = /razor-[^\-]+-/.exec(state)[0]; + + stack.unshift(value); + stack.unshift(prefix + inBraces); + this.next = prefix + inBraces; + return 'paren.lparen'; + } + }, { + start: "@\\*", + end: "\\*@", + token: "comment" + }); + + var parentCloseMap = { + '{': '}', + '[': ']', + '(': ')' + }; + + this.$rules[inBraces] = lang.deepCopy(this.$rules.start); + this.$rules[inBraces].unshift({ + regex: '[\\])}]', + onMatch: function(value, state, stack) { + var open = stack[1]; + if (parentCloseMap[open] !== value) + return 'invalid.illegal'; + + stack.shift(); // exit in-braces block + stack.shift(); // exit brace marker + this.next = processPotentialCallback(value, stack[0]) || 'start'; + return 'paren.rparen'; + } + }); +}; + +oop.inherits(RazorLangHighlightRules, CSharpHighlightRules); + +var RazorHighlightRules = function() { + HtmlHighlightRules.call(this); + + var blockStartRule = { + regex: '@[({]|@functions{', + onMatch: function(value, state, stack) { + stack.unshift(value); + stack.unshift('razor-block-start'); + this.next = 'razor-block-start'; + return 'punctuation.block.razor'; + } + }; + + var blockEndMap = { + '@{': '}', + '@(': ')', + '@functions{':'}' + }; + + var blockEndRule = { + regex: '[})]', + onMatch: function(value, state, stack) { + var blockStart = stack[1]; + if (blockEndMap[blockStart] !== value) + return 'invalid.illegal'; + + stack.shift(); // exit razor block + stack.shift(); // remove block type marker + this.next = stack.shift() || 'start'; + return 'punctuation.block.razor'; + } + }; + + var shortStartRule = { + regex: "@(?![{(])", + onMatch: function(value, state, stack) { + stack.unshift("razor-short-start"); + this.next = "razor-short-start"; + return 'punctuation.short.razor'; + } + }; + + var shortEndRule = { + token: "", + regex: "(?=[^A-Za-z_\\.()\\[\\]])", + next: 'pop' + }; + + var ifStartRule = { + regex: "@(?=if)", + onMatch: function(value, state, stack) { + stack.unshift(function(value) { + if (value !== '}') + return 'start'; + + return stack.shift() || 'start'; + }); + this.next = 'razor-block-start'; + return 'punctuation.control.razor'; + } + }; + + var razorStartRules = [ + { + start: "@\\*", + end: "\\*@", + token: "comment" + }, + { + token: ["meta.directive.razor", "text", "identifier"], + regex: "^(\\s*@model)(\\s+)(.+)$" + }, + blockStartRule, + shortStartRule + ]; + + for (var key in this.$rules) + this.$rules[key].unshift.apply(this.$rules[key], razorStartRules); + + this.embedRules(RazorLangHighlightRules, "razor-block-", [blockEndRule], ["start"]); + this.embedRules(RazorLangHighlightRules, "razor-short-", [shortEndRule], ["start"]); + + this.normalizeRules(); +}; + +oop.inherits(RazorHighlightRules, HtmlHighlightRules); + +exports.RazorHighlightRules = RazorHighlightRules; +exports.RazorLangHighlightRules = RazorLangHighlightRules; +}); + +ace.define("ace/mode/razor_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var keywords = [ + "abstract", "as", "base", "bool", + "break", "byte", "case", "catch", + "char", "checked", "class", "const", + "continue", "decimal", "default", "delegate", + "do", "double","else","enum", + "event", "explicit", "extern", "false", + "finally", "fixed", "float", "for", + "foreach", "goto", "if", "implicit", + "in", "int", "interface", "internal", + "is", "lock", "long", "namespace", + "new", "null", "object", "operator", + "out", "override", "params", "private", + "protected", "public", "readonly", "ref", + "return", "sbyte", "sealed", "short", + "sizeof", "stackalloc", "static", "string", + "struct", "switch", "this", "throw", + "true", "try", "typeof", "uint", + "ulong", "unchecked", "unsafe", "ushort", + "using", "var", "virtual", "void", + "volatile", "while"]; + +var shortHands = [ + "Html", "Model", "Url", "Layout" +]; + +var RazorCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + + if(state.lastIndexOf("razor-short-start") == -1 && state.lastIndexOf("razor-block-start") == -1) + return []; + + var token = session.getTokenAt(pos.row, pos.column); + if (!token) + return []; + + if(state.lastIndexOf("razor-short-start") != -1) { + return this.getShortStartCompletions(state, session, pos, prefix); + } + + if(state.lastIndexOf("razor-block-start") != -1) { + return this.getKeywordCompletions(state, session, pos, prefix); + } + + + }; + + this.getShortStartCompletions = function(state, session, pos, prefix) { + return shortHands.map(function(element){ + return { + value: element, + meta: "keyword", + score: Number.MAX_VALUE + }; + }); + }; + + this.getKeywordCompletions = function(state, session, pos, prefix) { + return shortHands.concat(keywords).map(function(element){ + return { + value: element, + meta: "keyword", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(RazorCompletions.prototype); + +exports.RazorCompletions = RazorCompletions; + +}); + +ace.define("ace/mode/razor",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/razor_highlight_rules","ace/mode/razor_completions","ace/mode/html_completions"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var RazorHighlightRules = require("./razor_highlight_rules").RazorHighlightRules; +var RazorCompletions = require("./razor_completions").RazorCompletions; +var HtmlCompletions = require("./html_completions").HtmlCompletions; + +var Mode = function() { + HtmlMode.call(this); + this.$highlightRules = new RazorHighlightRules(); + this.$completer = new RazorCompletions(); + this.$htmlCompleter = new HtmlCompletions(); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + this.getCompletions = function(state, session, pos, prefix) { + var razorToken = this.$completer.getCompletions(state, session, pos, prefix); + var htmlToken = this.$htmlCompleter.getCompletions(state, session, pos, prefix); + return razorToken.concat(htmlToken); + }; + + this.createWorker = function(session) { + return null; + }; + + this.$id = "ace/mode/razor"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-rdoc.js b/htdocs/includes/ace/mode-rdoc.js new file mode 100644 index 00000000000..50d6b4b3523 --- /dev/null +++ b/htdocs/includes/ace/mode-rdoc.js @@ -0,0 +1,205 @@ +ace.define("ace/mode/latex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var LatexHighlightRules = function() { + + this.$rules = { + "start" : [{ + token : "comment", + regex : "%.*$" + }, { + token : ["keyword", "lparen", "variable.parameter", "rparen", "lparen", "storage.type", "rparen"], + regex : "(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})" + }, { + token : ["keyword","lparen", "variable.parameter", "rparen"], + regex : "(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?" + }, { + token : ["storage.type", "lparen", "variable.parameter", "rparen"], + regex : "(\\\\(?:begin|end))({)(\\w*)(})" + }, { + token : "storage.type", + regex : "\\\\[a-zA-Z]+" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "constant.character.escape", + regex : "\\\\[^a-zA-Z]?" + }, { + token : "string", + regex : "\\${1,2}", + next : "equation" + }], + "equation" : [{ + token : "comment", + regex : "%.*$" + }, { + token : "string", + regex : "\\${1,2}", + next : "start" + }, { + token : "constant.character.escape", + regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)" + }, { + token : "error", + regex : "^\\s*$", + next : "start" + }, { + defaultToken : "string" + }] + + }; +}; +oop.inherits(LatexHighlightRules, TextHighlightRules); + +exports.LatexHighlightRules = LatexHighlightRules; + +}); + +ace.define("ace/mode/rdoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/latex_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var LaTeXHighlightRules = require("./latex_highlight_rules"); + +var RDocHighlightRules = function() { + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "%.*$" + }, { + token : "text", // non-command + regex : "\\\\[$&%#\\{\\}]" + }, { + token : "keyword", // command + regex : "\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b", + next : "nospell" + }, { + token : "keyword", // command + regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])" + }, { + token : "paren.keyword.operator", + regex : "[[({]" + }, { + token : "paren.keyword.operator", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "nospell" : [ + { + token : "comment", + regex : "%.*$", + next : "start" + }, { + token : "nospell.text", // non-command + regex : "\\\\[$&%#\\{\\}]" + }, { + token : "keyword", // command + regex : "\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b" + }, { + token : "keyword", // command + regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])", + next : "start" + }, { + token : "paren.keyword.operator", + regex : "[[({]" + }, { + token : "paren.keyword.operator", + regex : "[\\])]" + }, { + token : "paren.keyword.operator", + regex : "}", + next : "start" + }, { + token : "nospell.text", + regex : "\\s+" + }, { + token : "nospell.text", + regex : "\\w+" + } + ] + }; +}; + +oop.inherits(RDocHighlightRules, TextHighlightRules); + +exports.RDocHighlightRules = RDocHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/rdoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rdoc_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var RDocHighlightRules = require("./rdoc_highlight_rules").RDocHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function(suppressHighlighting) { + this.HighlightRules = RDocHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + this.$id = "ace/mode/rdoc"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-rhtml.js b/htdocs/includes/ace/mode-rhtml.js new file mode 100644 index 00000000000..aae0378d251 --- /dev/null +++ b/htdocs/includes/ace/mode-rhtml.js @@ -0,0 +1,2779 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var TexHighlightRules = function(textClass) { + + if (!textClass) + textClass = "text"; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "%.*$" + }, { + token : textClass, // non-command + regex : "\\\\[$&%#\\{\\}]" + }, { + token : "keyword", // command + regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b", + next : "nospell" + }, { + token : "keyword", // command + regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])" + }, { + token : "paren.keyword.operator", + regex : "[[({]" + }, { + token : "paren.keyword.operator", + regex : "[\\])}]" + }, { + token : textClass, + regex : "\\s+" + } + ], + "nospell" : [ + { + token : "comment", + regex : "%.*$", + next : "start" + }, { + token : "nospell." + textClass, // non-command + regex : "\\\\[$&%#\\{\\}]" + }, { + token : "keyword", // command + regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b" + }, { + token : "keyword", // command + regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])", + next : "start" + }, { + token : "paren.keyword.operator", + regex : "[[({]" + }, { + token : "paren.keyword.operator", + regex : "[\\])]" + }, { + token : "paren.keyword.operator", + regex : "}", + next : "start" + }, { + token : "nospell." + textClass, + regex : "\\s+" + }, { + token : "nospell." + textClass, + regex : "\\w+" + } + ] + }; +}; + +oop.inherits(TexHighlightRules, TextHighlightRules); + +exports.TexHighlightRules = TexHighlightRules; +}); + +ace.define("ace/mode/r_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"], function(require, exports, module) +{ + + var oop = require("../lib/oop"); + var lang = require("../lib/lang"); + var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules; + + var RHighlightRules = function() + { + + var keywords = lang.arrayToMap( + ("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass") + .split("|") + ); + + var buildinConstants = lang.arrayToMap( + ("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|" + + "NA_complex_").split("|") + ); + + this.$rules = { + "start" : [ + { + token : "comment.sectionhead", + regex : "#+(?!').*(?:----|====|####)\\s*$" + }, + { + token : "comment", + regex : "#+'", + next : "rd-start" + }, + { + token : "comment", + regex : "#.*$" + }, + { + token : "string", // multi line string start + regex : '["]', + next : "qqstring" + }, + { + token : "string", // multi line string start + regex : "[']", + next : "qstring" + }, + { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+[Li]?\\b" + }, + { + token : "constant.numeric", // explicit integer + regex : "\\d+L\\b" + }, + { + token : "constant.numeric", // number + regex : "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b" + }, + { + token : "constant.numeric", // number with leading decimal + regex : "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b" + }, + { + token : "constant.language.boolean", + regex : "(?:TRUE|FALSE|T|F)\\b" + }, + { + token : "identifier", + regex : "`.*?`" + }, + { + onMatch : function(value) { + if (keywords[value]) + return "keyword"; + else if (buildinConstants[value]) + return "constant.language"; + else if (value == '...' || value.match(/^\.\.\d+$/)) + return "variable.language"; + else + return "identifier"; + }, + regex : "[a-zA-Z.][a-zA-Z0-9._]*\\b" + }, + { + token : "keyword.operator", + regex : "%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:" + }, + { + token : "keyword.operator", // infix operators + regex : "%.*?%" + }, + { + token : "paren.keyword.operator", + regex : "[[({]" + }, + { + token : "paren.keyword.operator", + regex : "[\\])}]" + }, + { + token : "text", + regex : "\\s+" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, + { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, + { + token : "string", + regex : '.+' + } + ] + }; + + var rdRules = new TexHighlightRules("comment").getRules(); + for (var i = 0; i < rdRules["start"].length; i++) { + rdRules["start"][i].token += ".virtual-comment"; + } + + this.addRules(rdRules, "rd-"); + this.$rules["rd-start"].unshift({ + token: "text", + regex: "^", + next: "start" + }); + this.$rules["rd-start"].unshift({ + token : "keyword", + regex : "@(?!@)[^ ]*" + }); + this.$rules["rd-start"].unshift({ + token : "comment", + regex : "@@" + }); + this.$rules["rd-start"].push({ + token : "comment", + regex : "[^%\\\\[({\\])}]+" + }); + }; + + oop.inherits(RHighlightRules, TextHighlightRules); + + exports.RHighlightRules = RHighlightRules; +}); + +ace.define("ace/mode/rhtml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/r_highlight_rules","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var RHighlightRules = require("./r_highlight_rules").RHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var RHtmlHighlightRules = function() { + HtmlHighlightRules.call(this); + + this.$rules["start"].unshift({ + token: "support.function.codebegin", + regex: "^<" + "!--\\s*begin.rcode\\s*(?:.*)", + next: "r-start" + }); + + this.embedRules(RHighlightRules, "r-", [{ + token: "support.function.codeend", + regex: "^\\s*end.rcode\\s*-->", + next: "start" + }], ["start"]); + + this.normalizeRules(); +}; +oop.inherits(RHtmlHighlightRules, TextHighlightRules); + +exports.RHtmlHighlightRules = RHtmlHighlightRules; +}); + +ace.define("ace/mode/rhtml",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/rhtml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; + +var RHtmlHighlightRules = require("./rhtml_highlight_rules").RHtmlHighlightRules; + +var Mode = function(doc, session) { + HtmlMode.call(this); + this.$session = session; + this.HighlightRules = RHtmlHighlightRules; +}; +oop.inherits(Mode, HtmlMode); + +(function() { + this.insertChunkInfo = { + value: "\n", + position: {row: 0, column: 15} + }; + + this.getLanguageMode = function(position) + { + return this.$session.getState(position.row).match(/^r-/) ? 'R' : 'HTML'; + }; + + this.$id = "ace/mode/rhtml"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-rst.js b/htdocs/includes/ace/mode-rst.js new file mode 100644 index 00000000000..235d31a2397 --- /dev/null +++ b/htdocs/includes/ace/mode-rst.js @@ -0,0 +1,249 @@ +ace.define("ace/mode/rst_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var RSTHighlightRules = function() { + + var tokens = { + title: "markup.heading", + list: "markup.heading", + table: "constant", + directive: "keyword.operator", + entity: "string", + link: "markup.underline.list", + bold: "markup.bold", + italic: "markup.italic", + literal: "support.function", + comment: "comment" + }; + + var startStringPrefix = "(^|\\s|[\"'(<\\[{\\-/:])"; + var endStringSuffix = "(?:$|(?=\\s|[\\\\.,;!?\\-/:\"')>\\]}]))"; + + this.$rules = { + "start": [ + { + token : tokens.title, + regex : "(^)([\\=\\-`:\\.'\"~\\^_\\*\\+#])(\\2{2,}\\s*$)" + }, + { + token : ["text", tokens.directive, tokens.literal], + regex : "(^\\s*\\.\\. )([^: ]+::)(.*$)", + next : "codeblock" + }, + { + token : tokens.directive, + regex : "::$", + next : "codeblock" + }, + { + token : [tokens.entity, tokens.link], + regex : "(^\\.\\. _[^:]+:)(.*$)" + }, + { + token : [tokens.entity, tokens.link], + regex : "(^__ )(https?://.*$)" + }, + { + token : tokens.entity, + regex : "^\\.\\. \\[[^\\]]+\\] " + }, + { + token : tokens.comment, + regex : "^\\.\\. .*$", + next : "comment" + }, + { + token : tokens.list, + regex : "^\\s*[\\*\\+-] " + }, + { + token : tokens.list, + regex : "^\\s*(?:[A-Za-z]|[0-9]+|[ivxlcdmIVXLCDM]+)\\. " + }, + { + token : tokens.list, + regex : "^\\s*\\(?(?:[A-Za-z]|[0-9]+|[ivxlcdmIVXLCDM]+)\\) " + }, + { + token : tokens.table, + regex : "^={2,}(?: +={2,})+$" + }, + { + token : tokens.table, + regex : "^\\+-{2,}(?:\\+-{2,})+\\+$" + }, + { + token : tokens.table, + regex : "^\\+={2,}(?:\\+={2,})+\\+$" + }, + { + token : ["text", tokens.literal], + regex : startStringPrefix + "(``)(?=\\S)", + next : "code" + }, + { + token : ["text", tokens.bold], + regex : startStringPrefix + "(\\*\\*)(?=\\S)", + next : "bold" + }, + { + token : ["text", tokens.italic], + regex : startStringPrefix + "(\\*)(?=\\S)", + next : "italic" + }, + { + token : tokens.entity, + regex : "\\|[\\w\\-]+?\\|" + }, + { + token : tokens.entity, + regex : ":[\\w-:]+:`\\S", + next : "entity" + }, + { + token : ["text", tokens.entity], + regex : startStringPrefix + "(_`)(?=\\S)", + next : "entity" + }, + { + token : tokens.entity, + regex : "_[A-Za-z0-9\\-]+?" + }, + { + token : ["text", tokens.link], + regex : startStringPrefix + "(`)(?=\\S)", + next : "link" + }, + { + token : tokens.link, + regex : "[A-Za-z0-9\\-]+?__?" + }, + { + token : tokens.link, + regex : "\\[[^\\]]+?\\]_" + }, + { + token : tokens.link, + regex : "https?://\\S+" + }, + { + token : tokens.table, + regex : "\\|" + } + ], + "codeblock": [ + { + token : tokens.literal, + regex : "^ +.+$", + next : "codeblock" + }, + { + token : tokens.literal, + regex : '^$', + next: "codeblock" + }, + { + token : "empty", + regex : "", + next : "start" + } + ], + "code": [ + { + token : tokens.literal, + regex : "\\S``" + endStringSuffix, + next : "start" + }, + { + defaultToken: tokens.literal + } + ], + "bold": [ + { + token : tokens.bold, + regex : "\\S\\*\\*" + endStringSuffix, + next : "start" + }, + { + defaultToken: tokens.bold + } + ], + "italic": [ + { + token : tokens.italic, + regex : "\\S\\*" + endStringSuffix, + next : "start" + }, + { + defaultToken: tokens.italic + } + ], + "entity": [ + { + token : tokens.entity, + regex : "\\S`" + endStringSuffix, + next : "start" + }, + { + defaultToken: tokens.entity + } + ], + "link": [ + { + token : tokens.link, + regex : "\\S`__?" + endStringSuffix, + next : "start" + }, + { + defaultToken: tokens.link + } + ], + "comment": [ + { + token : tokens.comment, + regex : "^ +.+$", + next : "comment" + }, + { + token : tokens.comment, + regex : '^$', + next: "comment" + }, + { + token : "empty", + regex : "", + next : "start" + } + ] + }; +}; +oop.inherits(RSTHighlightRules, TextHighlightRules); + +exports.RSTHighlightRules = RSTHighlightRules; +}); + +ace.define("ace/mode/rst",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rst_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var RSTHighlightRules = require("./rst_highlight_rules").RSTHighlightRules; + +var Mode = function() { + this.HighlightRules = RSTHighlightRules; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.type = "text"; + + this.$id = "ace/mode/rst"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-ruby.js b/htdocs/includes/ace/mode-ruby.js new file mode 100644 index 00000000000..6732c68be44 --- /dev/null +++ b/htdocs/includes/ace/mode-ruby.js @@ -0,0 +1,491 @@ +ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var constantOtherSymbol = exports.constantOtherSymbol = { + token : "constant.other.symbol.ruby", // symbol + regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" +}; + +var qString = exports.qString = { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" +}; + +var qqString = exports.qqString = { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' +}; + +var tString = exports.tString = { + token : "string", // backtick string + regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" +}; + +var constantNumericHex = exports.constantNumericHex = { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" +}; + +var constantNumericFloat = exports.constantNumericFloat = { + token : "constant.numeric", // float + regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" +}; + +var instanceVariable = exports.instanceVariable = { + token : "variable.instance", // instance variable + regex : "@{1,2}[a-zA-Z_\\d]+" +}; + +var RubyHighlightRules = function() { + + var builtinFunctions = ( + "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + + "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + + "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + + "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + + "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + + "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + + "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + + "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + + "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + + "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + + "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + + "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + + "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + + "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + + "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + + "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + + "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + + "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + + "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + + "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + + "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + + "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + + "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + + "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + + "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + + "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + + "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + + "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + + "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + + "has_many|has_one|belongs_to|has_and_belongs_to_many" + ); + + var keywords = ( + "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + + "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + + "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" + ); + + var buildinConstants = ( + "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + + "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" + ); + + var builtinVariables = ( + "$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" + + "$!|root_url|flash|session|cookies|params|request|response|logger|self" + ); + + var keywordMapper = this.$keywords = this.createKeywordMapper({ + "keyword": keywords, + "constant.language": buildinConstants, + "variable.language": builtinVariables, + "support.function": builtinFunctions, + "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "#.*$" + }, { + token : "comment", // multi line comment + regex : "^=begin(?:$|\\s.*$)", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, + + [{ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + return "paren.lparen"; + } + if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1) + return "paren.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.start", + regex : /"/, + push : [{ + token : "constant.language.escape", + regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/ + }, { + token : "paren.start", + regex : /#{/, + push : "start" + }, { + token : "string.end", + regex : /"/, + next : "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/ + }, { + token : "paren.start", + regex : /#{/, + push : "start" + }, { + token : "string.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : /'/, + push : [{ + token : "constant.language.escape", + regex : /\\['\\]/ + }, { + token : "string.end", + regex : /'/, + next : "pop" + }, { + defaultToken: "string" + }] + }], + + { + token : "text", // namespaces aren't symbols + regex : "::" + }, { + token : "variable.instance", // instance variable + regex : "@{1,2}[a-zA-Z_\\d]+" + }, { + token : "support.class", // class name + regex : "[A-Z][a-zA-Z_\\d]+" + }, + + constantOtherSymbol, + constantNumericHex, + constantNumericFloat, + + { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "punctuation.separator.key-value", + regex : "=>" + }, { + stateName: "heredoc", + onMatch : function(value, currentState, stack) { + var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; + var tokens = value.split(this.splitRegex); + stack.push(next, tokens[3]); + return [ + {type:"constant", value: tokens[1]}, + {type:"string", value: tokens[2]}, + {type:"support.class", value: tokens[3]}, + {type:"string", value: tokens[4]} + ]; + }, + regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", + rules: { + heredoc: [{ + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^ +" + }, { + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }] + } + }, { + regex : "$", + token : "empty", + next : function(currentState, stack) { + if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") + return stack[0]; + return currentState; + } + }, { + token : "string.character", + regex : "\\B\\?." + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "^=end(?:$|\\s.*$)", + next : "start" + }, { + token : "comment", // comment spanning whole line + regex : ".+" + } + ] + }; + + this.normalizeRules(); +}; + +oop.inherits(RubyHighlightRules, TextHighlightRules); + +exports.RubyHighlightRules = RubyHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = RubyHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/); + var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/); + var startingConditional = line.match(/^\s*(if|else|when)\s*/) + if (match || startingClassOrMethod || startingDoBlock || startingConditional) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return /^\s+(end|else)$/.test(line + input) || this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, session, row) { + var line = session.getLine(row); + if (/}/.test(line)) + return this.$outdent.autoOutdent(session, row); + var indent = this.$getIndent(line); + var prevLine = session.getLine(row - 1); + var prevIndent = this.$getIndent(prevLine); + var tab = session.getTabString(); + if (prevIndent.length <= indent.length) { + if (indent.slice(-tab.length) == tab) + session.remove(new Range(row, indent.length-tab.length, row, indent.length)); + } + }; + + this.$id = "ace/mode/ruby"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-rust.js b/htdocs/includes/ace/mode-rust.js new file mode 100644 index 00000000000..0802f6b420c --- /dev/null +++ b/htdocs/includes/ace/mode-rust.js @@ -0,0 +1,272 @@ +ace.define("ace/mode/rust_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var stringEscape = /\\(?:[nrt0'"\\]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\})/.source; +var RustHighlightRules = function() { + + this.$rules = { start: + [ { token: 'variable.other.source.rust', + regex: '\'[a-zA-Z_][a-zA-Z0-9_]*(?![\\\'])' }, + { token: 'string.quoted.single.source.rust', + regex: "'(?:[^'\\\\]|" + stringEscape + ")'" }, + { + stateName: "bracketedComment", + onMatch : function(value, currentState, stack){ + stack.unshift(this.next, value.length - 1, currentState); + return "string.quoted.raw.source.rust"; + }, + regex : /r#*"/, + next : [ + { + onMatch : function(value, currentState, stack) { + var token = "string.quoted.raw.source.rust"; + if (value.length >= stack[1]) { + if (value.length > stack[1]) + token = "invalid"; + stack.shift(); + stack.shift(); + this.next = stack.shift(); + } else { + this.next = ""; + } + return token; + }, + regex : /"#*/, + next : "start" + }, { + defaultToken : "string.quoted.raw.source.rust" + } + ] + }, + { token: 'string.quoted.double.source.rust', + regex: '"', + push: + [ { token: 'string.quoted.double.source.rust', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.source.rust', + regex: stringEscape }, + { defaultToken: 'string.quoted.double.source.rust' } ] }, + { token: [ 'keyword.source.rust', 'text', 'entity.name.function.source.rust' ], + regex: '\\b(fn)(\\s+)([a-zA-Z_][a-zA-Z0-9_]*)' }, + { token: 'support.constant', regex: '\\b[a-zA-Z_][\\w\\d]*::' }, + { token: 'keyword.source.rust', + regex: '\\b(?:abstract|alignof|as|box|break|continue|const|crate|do|else|enum|extern|for|final|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\\b' }, + { token: 'storage.type.source.rust', + regex: '\\b(?:Self|isize|usize|char|bool|u8|u16|u32|u64|u128|f16|f32|f64|i8|i16|i32|i64|i128|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b' }, + { token: 'variable.language.source.rust', regex: '\\bself\\b' }, + + { token: 'comment.line.doc.source.rust', + regex: '//!.*$' }, + { token: 'comment.line.double-dash.source.rust', + regex: '//.*$' }, + { token: 'comment.start.block.source.rust', + regex: '/\\*', + stateName: 'comment', + push: + [ { token: 'comment.start.block.source.rust', + regex: '/\\*', + push: 'comment' }, + { token: 'comment.end.block.source.rust', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.source.rust' } ] }, + + { token: 'keyword.operator', + regex: /\$|[-=]>|[-+%^=!&|<>]=?|[*/](?![*/])=?/ }, + { token : "punctuation.operator", regex : /[?:,;.]/ }, + { token : "paren.lparen", regex : /[\[({]/ }, + { token : "paren.rparen", regex : /[\])}]/ }, + { token: 'constant.language.source.rust', + regex: '\\b(?:true|false|Some|None|Ok|Err)\\b' }, + { token: 'support.constant.source.rust', + regex: '\\b(?:EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\\b' }, + { token: 'meta.preprocessor.source.rust', + regex: '\\b\\w\\(\\w\\)*!|#\\[[\\w=\\(\\)_]+\\]\\b' }, + { token: 'constant.numeric.source.rust', + regex: /\b(?:0x[a-fA-F0-9_]+|0o[0-7_]+|0b[01_]+|[0-9][0-9_]*(?!\.))(?:[iu](?:size|8|16|32|64|128))?\b/ }, + { token: 'constant.numeric.source.rust', + regex: /\b(?:[0-9][0-9_]*)(?:\.[0-9][0-9_]*)?(?:[Ee][+-][0-9][0-9_]*)?(?:f32|f64)?\b/ } ] } + + this.normalizeRules(); +}; + +RustHighlightRules.metaData = { fileTypes: [ 'rs', 'rc' ], + foldingStartMarker: '^.*\\bfn\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$', + foldingStopMarker: '^\\s*\\}', + name: 'Rust', + scopeName: 'source.rust' } + + +oop.inherits(RustHighlightRules, TextHighlightRules); + +exports.RustHighlightRules = RustHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/rust",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rust_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var RustHighlightRules = require("./rust_highlight_rules").RustHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = RustHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/", nestable: true}; + this.$quotes = { '"': '"' }; + this.$id = "ace/mode/rust"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-sass.js b/htdocs/includes/ace/mode-sass.js new file mode 100644 index 00000000000..bd1817051cf --- /dev/null +++ b/htdocs/includes/ace/mode-sass.js @@ -0,0 +1,434 @@ +ace.define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ScssHighlightRules = function() { + + var properties = lang.arrayToMap( (function () { + + var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); + + var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + + "background-size|binding|border-bottom-colors|border-left-colors|" + + "border-right-colors|border-top-colors|border-end|border-end-color|" + + "border-end-style|border-end-width|border-image|border-start|" + + "border-start-color|border-start-style|border-start-width|box-align|" + + "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + + "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + + "column-rule-width|column-rule-style|column-rule-color|float-edge|" + + "font-feature-settings|font-language-override|force-broken-image-icon|" + + "image-region|margin-end|margin-start|opacity|outline|outline-color|" + + "outline-offset|outline-radius|outline-radius-bottomleft|" + + "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + + "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + + "tab-size|text-blink|text-decoration-color|text-decoration-line|" + + "text-decoration-style|transform|transform-origin|transition|" + + "transition-delay|transition-duration|transition-property|" + + "transition-timing-function|user-focus|user-input|user-modify|user-select|" + + "window-shadow|border-radius").split("|"); + + var properties = ("azimuth|background-attachment|background-color|background-image|" + + "background-position|background-repeat|background|border-bottom-color|" + + "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + + "border-color|border-left-color|border-left-style|border-left-width|" + + "border-left|border-right-color|border-right-style|border-right-width|" + + "border-right|border-spacing|border-style|border-top-color|" + + "border-top-style|border-top-width|border-top|border-width|border|bottom|" + + "box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + + "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + + "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + + "font-stretch|font-style|font-variant|font-weight|font|height|left|" + + "letter-spacing|line-height|list-style-image|list-style-position|" + + "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + + "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + + "min-width|opacity|orphans|outline-color|" + + "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + + "padding-left|padding-right|padding-top|padding|page-break-after|" + + "page-break-before|page-break-inside|page|pause-after|pause-before|" + + "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + + "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + + "stress|table-layout|text-align|text-decoration|text-indent|" + + "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + + "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + + "z-index").split("|"); + var ret = []; + for (var i=0, ln=browserPrefix.length; i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + }, { + caseInsensitive: true + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + regex : '.+' + } + ] + }; +}; + +oop.inherits(ScssHighlightRules, TextHighlightRules); + +exports.ScssHighlightRules = ScssHighlightRules; + +}); + +ace.define("ace/mode/sass_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/scss_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules; + +var SassHighlightRules = function() { + ScssHighlightRules.call(this); + var start = this.$rules.start; + if (start[1].token == "comment") { + start.splice(1, 1, { + onMatch: function(value, currentState, stack) { + stack.unshift(this.next, -1, value.length - 2, currentState); + return "comment"; + }, + regex: /^\s*\/\*/, + next: "comment" + }, { + token: "error.invalid", + regex: "/\\*|[{;}]" + }, { + token: "support.type", + regex: /^\s*:[\w\-]+\s/ + }); + + this.$rules.comment = [ + {regex: /^\s*/, onMatch: function(value, currentState, stack) { + if (stack[1] === -1) + stack[1] = Math.max(stack[2], value.length - 1); + if (value.length <= stack[1]) {stack.shift();stack.shift();stack.shift(); + this.next = stack.shift(); + return "text"; + } else { + this.next = ""; + return "comment"; + } + }, next: "start"}, + {defaultToken: "comment"} + ] + } +}; + +oop.inherits(SassHighlightRules, ScssHighlightRules); + +exports.SassHighlightRules = SassHighlightRules; + +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/sass",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sass_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var SassHighlightRules = require("./sass_highlight_rules").SassHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = SassHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.$id = "ace/mode/sass"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-scad.js b/htdocs/includes/ace/mode-scad.js new file mode 100644 index 00000000000..c9a767b9ceb --- /dev/null +++ b/htdocs/includes/ace/mode-scad.js @@ -0,0 +1,407 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/scad_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var scadHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": "module|if|else|for", + "constant.language": "NULL" + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + regex : '["].*\\\\$', + next : "qqstring" + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "string", // multi line string start + regex : "['].*\\\\$", + next : "qstring" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant", // + regex : "<[a-zA-Z0-9.]+>" + }, { + token : "keyword", // pre-compiler directivs + regex : "(?:use|include)" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + regex : '.+' + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(scadHighlightRules, TextHighlightRules); + +exports.scadHighlightRules = scadHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/scad",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scad_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var scadHighlightRules = require("./scad_highlight_rules").scadHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = scadHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/scad"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-scala.js b/htdocs/includes/ace/mode-scala.js new file mode 100644 index 00000000000..94c645c1013 --- /dev/null +++ b/htdocs/includes/ace/mode-scala.js @@ -0,0 +1,975 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/scala_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ScalaHighlightRules = function() { + + var keywords = ( + "case|default|do|else|for|if|match|while|throw|return|try|trye|catch|finally|yield|" + + "abstract|class|def|extends|final|forSome|implicit|implicits|import|lazy|new|object|null|" + + "override|package|private|protected|sealed|super|this|trait|type|val|var|with|" + + "assert|assume|require|print|println|printf|readLine|readBoolean|readByte|readShort|" + // package scala + "readChar|readInt|readLong|readFloat|readDouble" // package scala + ); + + var buildinConstants = ("true|false"); + + var langClasses = ( + "AbstractMethodError|AssertionError|ClassCircularityError|"+ + "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ + "ExceptionInInitializerError|IllegalAccessError|"+ + "IllegalThreadStateException|InstantiationError|InternalError|"+ + + "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ + "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ + "SuppressWarnings|TypeNotPresentException|UnknownError|"+ + "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ + "InstantiationException|IndexOutOfBoundsException|"+ + "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ + "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ + "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ + "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ + "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ + "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ + "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ + "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ + "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ + "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ + "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ + "ArrayStoreException|ClassCastException|LinkageError|"+ + "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ + "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ + "Cloneable|Class|CharSequence|Comparable|String|Object|" + + "Unit|Any|AnyVal|AnyRef|Null|ScalaObject|Singleton|Seq|Iterable|List|" + + "Option|Array|Char|Byte|Int|Long|Nothing|" + + + "App|Application|BufferedIterator|BigDecimal|BigInt|Console|Either|" + + "Enumeration|Equiv|Fractional|Function|IndexedSeq|Integral|Iterator|" + + "Map|Numeric|Nil|NotNull|Ordered|Ordering|PartialFunction|PartialOrdering|" + + "Product|Proxy|Range|Responder|Seq|Serializable|Set|Specializable|Stream|" + + "StringContext|Symbol|Traversable|TraversableOnce|Tuple|Vector|Pair|Triple" + + + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "support.function": langClasses, + "constant.language": buildinConstants + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, { + token : "string", + regex : '"""', + next : "tstring" + }, { + token : "string", + regex : '"(?=.)', // " strings can't span multiple lines + next : "string" + }, { + token : "symbol.constant", // single line + regex : "'[\\w\\d_]+" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "string" : [ + { + token : "escape", + regex : '\\\\"' + }, { + token : "string", + regex : '"', + next : "start" + }, { + token : "string.invalid", + regex : '[^"\\\\]*$', + next : "start" + }, { + token : "string", + regex : '[^"\\\\]+' + } + ], + "tstring" : [ + { + token : "string", + regex : '"{3,5}', + next : "start" + }, { + defaultToken : "string" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(ScalaHighlightRules, TextHighlightRules); + +exports.ScalaHighlightRules = ScalaHighlightRules; +}); + +ace.define("ace/mode/scala",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/scala_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptMode = require("./javascript").Mode; +var ScalaHighlightRules = require("./scala_highlight_rules").ScalaHighlightRules; + +var Mode = function() { + JavaScriptMode.call(this); + this.HighlightRules = ScalaHighlightRules; +}; +oop.inherits(Mode, JavaScriptMode); + +(function() { + + this.createWorker = function(session) { + return null; + }; + + this.$id = "ace/mode/scala"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-scheme.js b/htdocs/includes/ace/mode-scheme.js new file mode 100644 index 00000000000..2e6b7fff5b0 --- /dev/null +++ b/htdocs/includes/ace/mode-scheme.js @@ -0,0 +1,225 @@ +ace.define("ace/mode/scheme_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SchemeHighlightRules = function() { + var keywordControl = "case|do|let|loop|if|else|when"; + var keywordOperator = "eq?|eqv?|equal?|and|or|not|null?"; + var constantLanguage = "#t|#f"; + var supportFunctions = "cons|car|cdr|cond|lambda|lambda*|syntax-rules|format|set!|quote|eval|append|list|list?|member?|load"; + + var keywordMapper = this.createKeywordMapper({ + "keyword.control": keywordControl, + "keyword.operator": keywordOperator, + "constant.language": constantLanguage, + "support.function": supportFunctions + }, "identifier", true); + + this.$rules = + { + "start": [ + { + token : "comment", + regex : ";.*$" + }, + { + "token": ["storage.type.function-type.scheme", "text", "entity.name.function.scheme"], + "regex": "(?:\\b(?:(define|define-syntax|define-macro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" + }, + { + "token": "punctuation.definition.constant.character.scheme", + "regex": "#:\\S+" + }, + { + "token": ["punctuation.definition.variable.scheme", "variable.other.global.scheme", "punctuation.definition.variable.scheme"], + "regex": "(\\*)(\\S*)(\\*)" + }, + { + "token" : "constant.numeric", // hex + "regex" : "#[xXoObB][0-9a-fA-F]+" + }, + { + "token" : "constant.numeric", // float + "regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?" + }, + { + "token" : keywordMapper, + "regex" : "[a-zA-Z_#][a-zA-Z0-9_\\-\\?\\!\\*]*" + }, + { + "token" : "string", + "regex" : '"(?=.)', + "next" : "qqstring" + } + ], + "qqstring": [ + { + "token": "constant.character.escape.scheme", + "regex": "\\\\." + }, + { + "token" : "string", + "regex" : '[^"\\\\]+', + "merge" : true + }, { + "token" : "string", + "regex" : "\\\\$", + "next" : "qqstring", + "merge" : true + }, { + "token" : "string", + "regex" : '"|$', + "next" : "start", + "merge" : true + } + ] +} + +}; + +oop.inherits(SchemeHighlightRules, TextHighlightRules); + +exports.SchemeHighlightRules = SchemeHighlightRules; +}); + +ace.define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingParensOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\)/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\))/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + var match = line.match(/^(\s+)/); + if (match) { + return match[1]; + } + + return ""; + }; + +}).call(MatchingParensOutdent.prototype); + +exports.MatchingParensOutdent = MatchingParensOutdent; +}); + +ace.define("ace/mode/scheme",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scheme_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var SchemeHighlightRules = require("./scheme_highlight_rules").SchemeHighlightRules; +var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent; + +var Mode = function() { + this.HighlightRules = SchemeHighlightRules; + this.$outdent = new MatchingParensOutdent(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = ";"; + this.minorIndentFunctions = ["define", "lambda", "define-macro", "define-syntax", "syntax-rules", "define-record-type", "define-structure"]; + + this.$toIndent = function(str) { + return str.split('').map(function(ch) { + if (/\s/.exec(ch)) { + return ch; + } else { + return ' '; + } + }).join(''); + }; + + this.$calculateIndent = function(line, tab) { + var baseIndent = this.$getIndent(line); + var delta = 0; + var isParen, ch; + for (var i = line.length - 1; i >= 0; i--) { + ch = line[i]; + if (ch === '(') { + delta--; + isParen = true; + } else if (ch === '(' || ch === '[' || ch === '{') { + delta--; + isParen = false; + } else if (ch === ')' || ch === ']' || ch === '}') { + delta++; + } + if (delta < 0) { + break; + } + } + if (delta < 0 && isParen) { + i += 1; + var iBefore = i; + var fn = ''; + while (true) { + ch = line[i]; + if (ch === ' ' || ch === '\t') { + if(this.minorIndentFunctions.indexOf(fn) !== -1) { + return this.$toIndent(line.substring(0, iBefore - 1) + tab); + } else { + return this.$toIndent(line.substring(0, i + 1)); + } + } else if (ch === undefined) { + return this.$toIndent(line.substring(0, iBefore - 1) + tab); + } + fn += line[i]; + i++; + } + } else if(delta < 0 && !isParen) { + return this.$toIndent(line.substring(0, i+1)); + } else if(delta > 0) { + baseIndent = baseIndent.substring(0, baseIndent.length - tab.length); + return baseIndent; + } else { + return baseIndent; + } + }; + + this.getNextLineIndent = function(state, line, tab) { + return this.$calculateIndent(line, tab); + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/scheme"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-scss.js b/htdocs/includes/ace/mode-scss.js new file mode 100644 index 00000000000..4785dc3672c --- /dev/null +++ b/htdocs/includes/ace/mode-scss.js @@ -0,0 +1,586 @@ +ace.define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ScssHighlightRules = function() { + + var properties = lang.arrayToMap( (function () { + + var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); + + var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + + "background-size|binding|border-bottom-colors|border-left-colors|" + + "border-right-colors|border-top-colors|border-end|border-end-color|" + + "border-end-style|border-end-width|border-image|border-start|" + + "border-start-color|border-start-style|border-start-width|box-align|" + + "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + + "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + + "column-rule-width|column-rule-style|column-rule-color|float-edge|" + + "font-feature-settings|font-language-override|force-broken-image-icon|" + + "image-region|margin-end|margin-start|opacity|outline|outline-color|" + + "outline-offset|outline-radius|outline-radius-bottomleft|" + + "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + + "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + + "tab-size|text-blink|text-decoration-color|text-decoration-line|" + + "text-decoration-style|transform|transform-origin|transition|" + + "transition-delay|transition-duration|transition-property|" + + "transition-timing-function|user-focus|user-input|user-modify|user-select|" + + "window-shadow|border-radius").split("|"); + + var properties = ("azimuth|background-attachment|background-color|background-image|" + + "background-position|background-repeat|background|border-bottom-color|" + + "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + + "border-color|border-left-color|border-left-style|border-left-width|" + + "border-left|border-right-color|border-right-style|border-right-width|" + + "border-right|border-spacing|border-style|border-top-color|" + + "border-top-style|border-top-width|border-top|border-width|border|bottom|" + + "box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + + "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + + "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + + "font-stretch|font-style|font-variant|font-weight|font|height|left|" + + "letter-spacing|line-height|list-style-image|list-style-position|" + + "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + + "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + + "min-width|opacity|orphans|outline-color|" + + "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + + "padding-left|padding-right|padding-top|padding|page-break-after|" + + "page-break-before|page-break-inside|page|pause-after|pause-before|" + + "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + + "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + + "stress|table-layout|text-align|text-decoration|text-indent|" + + "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + + "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + + "z-index").split("|"); + var ret = []; + for (var i=0, ln=browserPrefix.length; i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + }, { + caseInsensitive: true + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + regex : '.+' + } + ] + }; +}; + +oop.inherits(ScssHighlightRules, TextHighlightRules); + +exports.ScssHighlightRules = ScssHighlightRules; + +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/scss",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scss_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = ScssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/scss"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-sh.js b/htdocs/includes/ace/mode-sh.js new file mode 100644 index 00000000000..bcded08909e --- /dev/null +++ b/htdocs/includes/ace/mode-sh.js @@ -0,0 +1,441 @@ +ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var reservedKeywords = exports.reservedKeywords = ( + '!|{|}|case|do|done|elif|else|'+ + 'esac|fi|for|if|in|then|until|while|'+ + '&|;|export|local|read|typeset|unset|'+ + 'elif|select|set|function|declare|readonly' + ); + +var languageConstructs = exports.languageConstructs = ( + '[|]|alias|bg|bind|break|builtin|'+ + 'cd|command|compgen|complete|continue|'+ + 'dirs|disown|echo|enable|eval|exec|'+ + 'exit|fc|fg|getopts|hash|help|history|'+ + 'jobs|kill|let|logout|popd|printf|pushd|'+ + 'pwd|return|set|shift|shopt|source|'+ + 'suspend|test|times|trap|type|ulimit|'+ + 'umask|unalias|wait' +); + +var ShHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "keyword": reservedKeywords, + "support.function.builtin": languageConstructs, + "invalid.deprecated": "debugger" + }, "identifier"); + + var integer = "(?:(?:[1-9]\\d*)|(?:0))"; + + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + var fileDescriptor = "(?:&" + intPart + ")"; + + var variableName = "[a-zA-Z_][a-zA-Z0-9_]*"; + var variable = "(?:" + variableName + "=)"; + + var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))"; + + var func = "(?:" + variableName + "\\s*\\(\\))"; + + this.$rules = { + "start" : [{ + token : "constant", + regex : /\\./ + }, { + token : ["text", "comment"], + regex : /(^|\s)(#.*)$/ + }, { + token : "string.start", + regex : '"', + push : [{ + token : "constant.language.escape", + regex : /\\(?:[$`"\\]|$)/ + }, { + include : "variables" + }, { + token : "keyword.operator", + regex : /`/ // TODO highlight ` + }, { + token : "string.end", + regex : '"', + next: "pop" + }, { + defaultToken: "string" + }] + }, { + token : "string", + regex : "\\$'", + push : [{ + token : "constant.language.escape", + regex : /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/ + }, { + token : "string", + regex : "'", + next: "pop" + }, { + defaultToken: "string" + }] + }, { + regex : "<<<", + token : "keyword.operator" + }, { + stateName: "heredoc", + regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)", + onMatch : function(value, currentState, stack) { + var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; + var tokens = value.split(this.splitRegex); + stack.push(next, tokens[4]); + return [ + {type:"constant", value: tokens[1]}, + {type:"text", value: tokens[2]}, + {type:"string", value: tokens[3]}, + {type:"support.class", value: tokens[4]}, + {type:"string", value: tokens[5]} + ]; + }, + rules: { + heredoc: [{ + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^\t+" + }, { + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }] + } + }, { + regex : "$", + token : "empty", + next : function(currentState, stack) { + if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") + return stack[0]; + return currentState; + } + }, { + token : ["keyword", "text", "text", "text", "variable"], + regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/ + }, { + token : "variable.language", + regex : builtinVariable + }, { + token : "variable", + regex : variable + }, { + include : "variables" + }, { + token : "support.function", + regex : func + }, { + token : "support.function", + regex : fileDescriptor + }, { + token : "string", // ' string + start : "'", end : "'" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]" + }, { + token : "punctuation.operator", + regex : ";" + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]]" + }, { + token : "paren.rparen", + regex : "[\\)\\}]", + next : "pop" + }], + variables: [{ + token : "variable", + regex : /(\$)(\w+)/ + }, { + token : ["variable", "paren.lparen"], + regex : /(\$)(\()/, + push : "start" + }, { + token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"], + regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/, + push : "start" + }, { + token : "variable", + regex : /\$[*@#?\-$!0_]/ + }, { + token : ["variable", "paren.lparen"], + regex : /(\$)(\{)/, + push : "start" + }] + }; + + this.normalizeRules(); +}; + +oop.inherits(ShHighlightRules, TextHighlightRules); + +exports.ShHighlightRules = ShHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules; +var Range = require("../range").Range; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; + +var Mode = function() { + this.HighlightRules = ShHighlightRules; + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = new CstyleBehaviour(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + var outdents = { + "pass": 1, + "return": 1, + "raise": 1, + "break": 1, + "continue": 1 + }; + + this.checkOutdent = function(state, line, input) { + if (input !== "\r\n" && input !== "\r" && input !== "\n") + return false; + + var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + + if (!tokens) + return false; + do { + var last = tokens.pop(); + } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); + + if (!last) + return false; + + return (last.type == "keyword" && outdents[last.value]); + }; + + this.autoOutdent = function(state, doc, row) { + + row += 1; + var indent = this.$getIndent(doc.getLine(row)); + var tab = doc.getTabString(); + if (indent.slice(-tab.length) == tab) + doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); + }; + + this.$id = "ace/mode/sh"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-sjs.js b/htdocs/includes/ace/mode-sjs.js new file mode 100644 index 00000000000..6bcd0bce684 --- /dev/null +++ b/htdocs/includes/ace/mode-sjs.js @@ -0,0 +1,1006 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/sjs_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SJSHighlightRules = function() { + var parent = new JavaScriptHighlightRules({noES6: true}); + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-6][0-7]?|" + // oct + "37[0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + var contextAware = function(f) { + f.isContextAware = true; + return f; + }; + + var ctxBegin = function(opts) { + return { + token: opts.token, + regex: opts.regex, + next: contextAware(function(currentState, stack) { + if (stack.length === 0) + stack.unshift(currentState); + stack.unshift(opts.next); + return opts.next; + }) + }; + }; + + var ctxEnd = function(opts) { + return { + token: opts.token, + regex: opts.regex, + next: contextAware(function(currentState, stack) { + stack.shift(); + return stack[0] || "start"; + }) + }; + }; + + this.$rules = parent.$rules; + this.$rules.no_regex = [ + { + token: "keyword", + regex: "(waitfor|or|and|collapse|spawn|retract)\\b" + }, + { + token: "keyword.operator", + regex: "(->|=>|\\.\\.)" + }, + { + token: "variable.language", + regex: "(hold|default)\\b" + }, + ctxBegin({ + token: "string", + regex: "`", + next: "bstring" + }), + ctxBegin({ + token: "string", + regex: '"', + next: "qqstring" + }), + ctxBegin({ + token: "string", + regex: '"', + next: "qqstring" + }), + { + token: ["paren.lparen", "text", "paren.rparen"], + regex: "(\\{)(\\s*)(\\|)", + next: "block_arguments" + } + + ].concat(this.$rules.no_regex); + + this.$rules.block_arguments = [ + { + token: "paren.rparen", + regex: "\\|", + next: "no_regex" + } + ].concat(this.$rules.function_arguments); + + this.$rules.bstring = [ + { + token : "constant.language.escape", + regex : escapedRe + }, + { + token : "string", + regex : "\\\\$", + next: "bstring" + }, + ctxBegin({ + token : "paren.lparen", + regex : "\\$\\{", + next: "string_interp" + }), + ctxBegin({ + token : "paren.lparen", + regex : "\\$", + next: "bstring_interp_single" + }), + ctxEnd({ + token : "string", + regex : "`" + }), + { + defaultToken: "string" + } + ]; + + this.$rules.qqstring = [ + { + token : "constant.language.escape", + regex : escapedRe + }, + { + token : "string", + regex : "\\\\$", + next: "qqstring" + }, + ctxBegin({ + token : "paren.lparen", + regex : "#\\{", + next: "string_interp" + }), + ctxEnd({ + token : "string", + regex : '"' + }), + { + defaultToken: "string" + } + ]; + var embeddableRules = []; + for (var i=0; i < this.$rules.no_regex.length; i++) { + var rule = this.$rules.no_regex[i]; + var token = String(rule.token); + if (token.indexOf('paren') == -1 && (!rule.next || rule.next.isContextAware)) { + embeddableRules.push(rule); + } + } + + this.$rules.string_interp = [ + ctxEnd({ + token: "paren.rparen", + regex: "\\}" + }), + ctxBegin({ + token: "paren.lparen", + regex: '{', + next: "string_interp" + }) + ].concat(embeddableRules); + this.$rules.bstring_interp_single = [ + { + token: ["identifier", "paren.lparen"], + regex: '(\\w+)(\\()', + next: 'bstring_interp_single_call' + }, + ctxEnd({ + token : "identifier", + regex : "\\w*" + }) + ]; + this.$rules.bstring_interp_single_call = [ + ctxBegin({ + token: "paren.lparen", + regex: "\\(", + next: "bstring_interp_single_call" + }), + ctxEnd({ + token: "paren.rparen", + regex: "\\)" + }) + ].concat(embeddableRules); +} +oop.inherits(SJSHighlightRules, TextHighlightRules); + +exports.SJSHighlightRules = SJSHighlightRules; +}); + +ace.define("ace/mode/sjs",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/sjs_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; +var oop = require("../lib/oop"); +var JSMode = require("./javascript").Mode; +var SJSHighlightRules = require("./sjs_highlight_rules").SJSHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = SJSHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, JSMode); +(function() { + this.createWorker = function(session) { + return null; + } + this.$id = "ace/mode/sjs"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-smarty.js b/htdocs/includes/ace/mode-smarty.js new file mode 100644 index 00000000000..448ced333aa --- /dev/null +++ b/htdocs/includes/ace/mode-smarty.js @@ -0,0 +1,2606 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/smarty_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + +var SmartyHighlightRules = function() { + HtmlHighlightRules.call(this); + var smartyRules = { start: + [ { include: '#comments' }, + { include: '#blocks' } ], + '#blocks': + [ { token: 'punctuation.section.embedded.begin.smarty', + regex: '\\{%?', + push: + [ { token: 'punctuation.section.embedded.end.smarty', + regex: '%?\\}', + next: 'pop' }, + { include: '#strings' }, + { include: '#variables' }, + { include: '#lang' }, + { defaultToken: 'source.smarty' } ] } ], + '#comments': + [ { token: + [ 'punctuation.definition.comment.smarty', + 'comment.block.smarty' ], + regex: '(\\{%?)(\\*)', + push: + [ { token: 'comment.block.smarty', regex: '\\*%?\\}', next: 'pop' }, + { defaultToken: 'comment.block.smarty' } ] } ], + '#lang': + [ { token: 'keyword.operator.smarty', + regex: '(?:!=|!|<=|>=|<|>|===|==|%|&&|\\|\\|)|\\b(?:and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|not|mod)\\b' }, + { token: 'constant.language.smarty', + regex: '\\b(?:TRUE|FALSE|true|false)\\b' }, + { token: 'keyword.control.smarty', + regex: '\\b(?:if|else|elseif|foreach|foreachelse|section|switch|case|break|default)\\b' }, + { token: 'variable.parameter.smarty', regex: '\\b[a-zA-Z]+=' }, + { token: 'support.function.built-in.smarty', + regex: '\\b(?:capture|config_load|counter|cycle|debug|eval|fetch|include_php|include|insert|literal|math|strip|rdelim|ldelim|assign|constant|block|html_[a-z_]*)\\b' }, + { token: 'support.function.variable-modifier.smarty', + regex: '\\|(?:capitalize|cat|count_characters|count_paragraphs|count_sentences|count_words|date_format|default|escape|indent|lower|nl2br|regex_replace|replace|spacify|string_format|strip_tags|strip|truncate|upper|wordwrap)' } ], + '#strings': + [ { token: 'punctuation.definition.string.begin.smarty', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.smarty', + regex: '\'', + next: 'pop' }, + { token: 'constant.character.escape.smarty', regex: '\\\\.' }, + { defaultToken: 'string.quoted.single.smarty' } ] }, + { token: 'punctuation.definition.string.begin.smarty', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.smarty', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.smarty', regex: '\\\\.' }, + { defaultToken: 'string.quoted.double.smarty' } ] } ], + '#variables': + [ { token: + [ 'punctuation.definition.variable.smarty', + 'variable.other.global.smarty' ], + regex: '\\b(\\$)(Smarty\\.)' }, + { token: + [ 'punctuation.definition.variable.smarty', + 'variable.other.smarty' ], + regex: '(\\$)([a-zA-Z_][a-zA-Z0-9_]*)\\b' }, + { token: [ 'keyword.operator.smarty', 'variable.other.property.smarty' ], + regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)\\b' }, + { token: + [ 'keyword.operator.smarty', + 'meta.function-call.object.smarty', + 'punctuation.definition.variable.smarty', + 'variable.other.smarty', + 'punctuation.definition.variable.smarty' ], + regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)(\\()(.*?)(\\))' } ] } + + var smartyStart = smartyRules.start; + + for (var rule in this.$rules) { + this.$rules[rule].unshift.apply(this.$rules[rule], smartyStart); + } + + Object.keys(smartyRules).forEach(function(x) { + if (!this.$rules[x]) + this.$rules[x] = smartyRules[x]; + }, this); + + this.normalizeRules(); +}; + +SmartyHighlightRules.metaData = { fileTypes: [ 'tpl' ], + foldingStartMarker: '\\{%?', + foldingStopMarker: '%?\\}', + name: 'Smarty', + scopeName: 'text.html.smarty' } + + +oop.inherits(SmartyHighlightRules, HtmlHighlightRules); + +exports.SmartyHighlightRules = SmartyHighlightRules; +}); + +ace.define("ace/mode/smarty",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/smarty_highlight_rules"], function(require, exports, module) { + "use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var SmartyHighlightRules = require("./smarty_highlight_rules").SmartyHighlightRules; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = SmartyHighlightRules; +}; + +oop.inherits(Mode, HtmlMode); + +(function() { + + this.$id = "ace/mode/smarty"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-snippets.js b/htdocs/includes/ace/mode-snippets.js new file mode 100644 index 00000000000..a528501fc4b --- /dev/null +++ b/htdocs/includes/ace/mode-snippets.js @@ -0,0 +1,199 @@ +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/snippets",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SnippetHighlightRules = function() { + + var builtins = "SELECTION|CURRENT_WORD|SELECTED_TEXT|CURRENT_LINE|LINE_INDEX|" + + "LINE_NUMBER|SOFT_TABS|TAB_SIZE|FILENAME|FILEPATH|FULLNAME"; + + this.$rules = { + "start" : [ + {token:"constant.language.escape", regex: /\\[\$}`\\]/}, + {token:"keyword", regex: "\\$(?:TM_)?(?:" + builtins + ")\\b"}, + {token:"variable", regex: "\\$\\w+"}, + {onMatch: function(value, state, stack) { + if (stack[1]) + stack[1]++; + else + stack.unshift(state, 1); + return this.tokenName; + }, tokenName: "markup.list", regex: "\\${", next: "varDecl"}, + {onMatch: function(value, state, stack) { + if (!stack[1]) + return "text"; + stack[1]--; + if (!stack[1]) + stack.splice(0,2); + return this.tokenName; + }, tokenName: "markup.list", regex: "}"}, + {token: "doc.comment", regex:/^\${2}-{5,}$/} + ], + "varDecl" : [ + {regex: /\d+\b/, token: "constant.numeric"}, + {token:"keyword", regex: "(?:TM_)?(?:" + builtins + ")\\b"}, + {token:"variable", regex: "\\w+"}, + {regex: /:/, token: "punctuation.operator", next: "start"}, + {regex: /\//, token: "string.regex", next: "regexp"}, + {regex: "", next: "start"} + ], + "regexp" : [ + {regex: /\\./, token: "escape"}, + {regex: /\[/, token: "regex.start", next: "charClass"}, + {regex: "/", token: "string.regex", next: "format"}, + {"token": "string.regex", regex:"."} + ], + charClass : [ + {regex: "\\.", token: "escape"}, + {regex: "\\]", token: "regex.end", next: "regexp"}, + {"token": "string.regex", regex:"."} + ], + "format" : [ + {regex: /\\[ulULE]/, token: "keyword"}, + {regex: /\$\d+/, token: "variable"}, + {regex: "/[gim]*:?", token: "string.regex", next: "start"}, + {"token": "string", regex:"."} + ] + }; +}; +oop.inherits(SnippetHighlightRules, TextHighlightRules); + +exports.SnippetHighlightRules = SnippetHighlightRules; + +var SnippetGroupHighlightRules = function() { + this.$rules = { + "start" : [ + {token: "text", regex: "^\\t", next: "sn-start"}, + {token:"invalid", regex: /^ \s*/}, + {token:"comment", regex: /^#.*/}, + {token:"constant.language.escape", regex: "^regex ", next: "regex"}, + {token:"constant.language.escape", regex: "^(trigger|endTrigger|name|snippet|guard|endGuard|tabTrigger|key)\\b"} + ], + "regex" : [ + {token:"text", regex: "\\."}, + {token:"keyword", regex: "/"}, + {token:"empty", regex: "$", next: "start"} + ] + }; + this.embedRules(SnippetHighlightRules, "sn-", [ + {token: "text", regex: "^\\t", next: "sn-start"}, + {onMatch: function(value, state, stack) { + stack.splice(stack.length); + return this.tokenName; + }, tokenName: "text", regex: "^(?!\t)", next: "start"} + ]) + +}; + +oop.inherits(SnippetGroupHighlightRules, TextHighlightRules); + +exports.SnippetGroupHighlightRules = SnippetGroupHighlightRules; + +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = SnippetGroupHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$indentWithTabs = true; + this.lineCommentStart = "#"; + this.$id = "ace/mode/snippets"; +}).call(Mode.prototype); +exports.Mode = Mode; + + +}); diff --git a/htdocs/includes/ace/mode-soy_template.js b/htdocs/includes/ace/mode-soy_template.js new file mode 100644 index 00000000000..df831bb3bda --- /dev/null +++ b/htdocs/includes/ace/mode-soy_template.js @@ -0,0 +1,2819 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/soy_template_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + +var SoyTemplateHighlightRules = function() { + HtmlHighlightRules.call(this); + + var soyRules = { start: + [ { include: '#template' }, + { include: '#if' }, + { include: '#comment-line' }, + { include: '#comment-block' }, + { include: '#comment-doc' }, + { include: '#call' }, + { include: '#css' }, + { include: '#param' }, + { include: '#print' }, + { include: '#msg' }, + { include: '#for' }, + { include: '#foreach' }, + { include: '#switch' }, + { include: '#tag' }, + { include: 'text.html.basic' } ], + '#call': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.call.soy' ], + regex: '(\\{/?)(\\s*)(?=call|delcall)', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { include: '#string-quoted-single' }, + { include: '#string-quoted-double' }, + { token: ['entity.name.tag.soy', 'variable.parameter.soy'], + regex: '(call|delcall)(\\s+[\\.\\w]+)'}, + { token: + [ 'entity.other.attribute-name.soy', + 'text', + 'keyword.operator.soy' ], + regex: '\\b(data)(\\s*)(=)' }, + { defaultToken: 'meta.tag.call.soy' } ] } ], + '#comment-line': + [ { token: + [ 'comment.line.double-slash.soy', + 'comment.line.double-slash.soy' ], + regex: '(//)(.*$)' } ], + '#comment-block': + [ { token: 'punctuation.definition.comment.begin.soy', + regex: '/\\*(?!\\*)', + push: + [ { token: 'punctuation.definition.comment.end.soy', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.soy' } ] } ], + '#comment-doc': + [ { token: 'punctuation.definition.comment.begin.soy', + regex: '/\\*\\*(?!/)', + push: + [ { token: 'punctuation.definition.comment.end.soy', + regex: '\\*/', + next: 'pop' }, + { token: [ 'support.type.soy', 'text', 'variable.parameter.soy' ], + regex: '(@param|@param\\?)(\\s+)(\\w+)' }, + { defaultToken: 'comment.block.documentation.soy' } ] } ], + '#css': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.css.soy', + 'entity.name.tag.soy' ], + regex: '(\\{/?)(\\s*)(css)\\b', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { token: 'support.constant.soy', + regex: '\\b(?:LITERAL|REFERENCE|BACKEND_SPECIFIC|GOOG)\\b' }, + { defaultToken: 'meta.tag.css.soy' } ] } ], + '#for': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.for.soy', + 'entity.name.tag.soy' ], + regex: '(\\{/?)(\\s*)(for)\\b', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { token: 'keyword.operator.soy', regex: '\\bin\\b' }, + { token: 'support.function.soy', regex: '\\brange\\b' }, + { include: '#variable' }, + { include: '#number' }, + { include: '#primitive' }, + { defaultToken: 'meta.tag.for.soy' } ] } ], + '#foreach': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.foreach.soy', + 'entity.name.tag.soy' ], + regex: '(\\{/?)(\\s*)(foreach)\\b', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { token: 'keyword.operator.soy', regex: '\\bin\\b' }, + { include: '#variable' }, + { defaultToken: 'meta.tag.foreach.soy' } ] } ], + '#function': + [ { token: 'support.function.soy', + regex: '\\b(?:isFirst|isLast|index|hasData|length|keys|round|floor|ceiling|min|max|randomInt)\\b' } ], + '#if': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.if.soy', + 'entity.name.tag.soy' ], + regex: '(\\{/?)(\\s*)(if|elseif)\\b', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { include: '#variable' }, + { include: '#operator' }, + { include: '#function' }, + { include: '#string-quoted-single' }, + { include: '#string-quoted-double' }, + { defaultToken: 'meta.tag.if.soy' } ] } ], + '#namespace': + [ { token: [ 'entity.name.tag.soy', 'text', 'variable.parameter.soy' ], + regex: '(namespace|delpackage)(\\s+)([\\w\\.]+)' } ], + '#number': [ { token: 'constant.numeric', regex: '[\\d]+' } ], + '#operator': + [ { token: 'keyword.operator.soy', + regex: '==|!=|\\band\\b|\\bor\\b|\\bnot\\b|-|\\+|/|\\?:' } ], + '#param': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.param.soy', + 'entity.name.tag.soy' ], + regex: '(\\{/?)(\\s*)(param)', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { include: '#variable' }, + { token: + [ 'entity.other.attribute-name.soy', + 'text', + 'keyword.operator.soy' ], + regex: '\\b([\\w]+)(\\s*)((?::)?)' }, + { defaultToken: 'meta.tag.param.soy' } ] } ], + '#primitive': + [ { token: 'constant.language.soy', + regex: '\\b(?:null|false|true)\\b' } ], + '#msg': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.msg.soy', + 'entity.name.tag.soy' ], + regex: '(\\{/?)(\\s*)(msg)\\b', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { include: '#string-quoted-single' }, + { include: '#string-quoted-double' }, + { token: + [ 'entity.other.attribute-name.soy', + 'text', + 'keyword.operator.soy' ], + regex: '\\b(meaning|desc)(\\s*)(=)' }, + { defaultToken: 'meta.tag.msg.soy' } ] } ], + '#print': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.print.soy', + 'entity.name.tag.soy' ], + regex: '(\\{/?)(\\s*)(print)\\b', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { include: '#variable' }, + { include: '#print-parameter' }, + { include: '#number' }, + { include: '#primitive' }, + { include: '#attribute-lookup' }, + { defaultToken: 'meta.tag.print.soy' } ] } ], + '#print-parameter': + [ { token: 'keyword.operator.soy', regex: '\\|' }, + { token: 'variable.parameter.soy', + regex: 'noAutoescape|id|escapeHtml|escapeJs|insertWorkBreaks|truncate' } ], + '#special-character': + [ { token: 'support.constant.soy', + regex: '\\bsp\\b|\\bnil\\b|\\\\r|\\\\n|\\\\t|\\blb\\b|\\brb\\b' } ], + '#string-quoted-double': [ { token: 'string.quoted.double', regex: '"[^"]*"' } ], + '#string-quoted-single': [ { token: 'string.quoted.single', regex: '\'[^\']*\'' } ], + '#switch': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.switch.soy', + 'entity.name.tag.soy' ], + regex: '(\\{/?)(\\s*)(switch|case)\\b', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { include: '#variable' }, + { include: '#function' }, + { include: '#number' }, + { include: '#string-quoted-single' }, + { include: '#string-quoted-double' }, + { defaultToken: 'meta.tag.switch.soy' } ] } ], + '#attribute-lookup': + [ { token: 'punctuation.definition.attribute-lookup.begin.soy', + regex: '\\[', + push: + [ { token: 'punctuation.definition.attribute-lookup.end.soy', + regex: '\\]', + next: 'pop' }, + { include: '#variable' }, + { include: '#function' }, + { include: '#operator' }, + { include: '#number' }, + { include: '#primitive' }, + { include: '#string-quoted-single' }, + { include: '#string-quoted-double' } ] } ], + '#tag': + [ { token: 'punctuation.definition.tag.begin.soy', + regex: '\\{', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { include: '#namespace' }, + { include: '#variable' }, + { include: '#special-character' }, + { include: '#tag-simple' }, + { include: '#function' }, + { include: '#operator' }, + { include: '#attribute-lookup' }, + { include: '#number' }, + { include: '#primitive' }, + { include: '#print-parameter' } ] } ], + '#tag-simple': + [ { token: 'entity.name.tag.soy', + regex: '{{\\s*(?:literal|else|ifempty|default)\\s*(?=\\})'} ], + '#template': + [ { token: + [ 'punctuation.definition.tag.begin.soy', + 'meta.tag.template.soy' ], + regex: '(\\{/?)(\\s*)(?=template|deltemplate)', + push: + [ { token: 'punctuation.definition.tag.end.soy', + regex: '\\}', + next: 'pop' }, + { token: ['entity.name.tag.soy', 'text', 'entity.name.function.soy' ], + regex: '(template|deltemplate)(\\s+)([\\.\\w]+)', + originalRegex: '(?<=template|deltemplate)\\s+([\\.\\w]+)' }, + { token: + [ 'entity.other.attribute-name.soy', + 'text', + 'keyword.operator.soy', + 'text', + 'string.quoted.double.soy' ], + regex: '\\b(private)(\\s*)(=)(\\s*)("true"|"false")' }, + { token: + [ 'entity.other.attribute-name.soy', + 'text', + 'keyword.operator.soy', + 'text', + 'string.quoted.single.soy' ], + regex: '\\b(private)(\\s*)(=)(\\s*)(\'true\'|\'false\')' }, + { token: + [ 'entity.other.attribute-name.soy', + 'text', + 'keyword.operator.soy', + 'text', + 'string.quoted.double.soy' ], + regex: '\\b(autoescape)(\\s*)(=)(\\s*)("true"|"false"|"contextual")' }, + { token: + [ 'entity.other.attribute-name.soy', + 'text', + 'keyword.operator.soy', + 'text', + 'string.quoted.single.soy' ], + regex: '\\b(autoescape)(\\s*)(=)(\\s*)(\'true\'|\'false\'|\'contextual\')' }, + { defaultToken: 'meta.tag.template.soy' } ] } ], + '#variable': [ { token: 'variable.other.soy', regex: '\\$[\\w\\.]+' } ] } + + + for (var i in soyRules) { + if (this.$rules[i]) { + this.$rules[i].unshift.apply(this.$rules[i], soyRules[i]); + } else { + this.$rules[i] = soyRules[i]; + } + } + + this.normalizeRules(); +}; + +SoyTemplateHighlightRules.metaData = { comment: 'SoyTemplate', + fileTypes: [ 'soy' ], + firstLineMatch: '\\{\\s*namespace\\b', + foldingStartMarker: '\\{\\s*template\\s+[^\\}]*\\}', + foldingStopMarker: '\\{\\s*/\\s*template\\s*\\}', + name: 'SoyTemplate', + scopeName: 'source.soy' } + + +oop.inherits(SoyTemplateHighlightRules, HtmlHighlightRules); + +exports.SoyTemplateHighlightRules = SoyTemplateHighlightRules; +}); + +ace.define("ace/mode/soy_template",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/soy_template_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var SoyTemplateHighlightRules = require("./soy_template_highlight_rules").SoyTemplateHighlightRules; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = SoyTemplateHighlightRules; +}; +oop.inherits(Mode, HtmlMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$id = "ace/mode/soy_template"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-space.js b/htdocs/includes/ace/mode-space.js new file mode 100644 index 00000000000..5bbeb482c79 --- /dev/null +++ b/htdocs/includes/ace/mode-space.js @@ -0,0 +1,160 @@ +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/space_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SpaceHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "empty_line", + regex : / */, + next : "key" + }, + { + token : "empty_line", + regex : /$/, + next : "key" + } + ], + "key" : [ + { + token : "variable", + regex : /\S+/ + }, + { + token : "empty_line", + regex : /$/, + next : "start" + },{ + token : "keyword.operator", + regex : / /, + next : "value" + } + ], + "value" : [ + { + token : "keyword.operator", + regex : /$/, + next : "start" + }, + { + token : "string", + regex : /[^$]/ + } + ] + }; + +}; + +oop.inherits(SpaceHighlightRules, TextHighlightRules); + +exports.SpaceHighlightRules = SpaceHighlightRules; +}); + +ace.define("ace/mode/space",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/folding/coffee","ace/mode/space_highlight_rules"], function(require, exports, module) { +"use strict"; +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var FoldMode = require("./folding/coffee").FoldMode; +var SpaceHighlightRules = require("./space_highlight_rules").SpaceHighlightRules; +var Mode = function() { + this.HighlightRules = SpaceHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); +(function() { + + this.$id = "ace/mode/space"; +}).call(Mode.prototype); +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-sparql.js b/htdocs/includes/ace/mode-sparql.js new file mode 100644 index 00000000000..e5a5854214b --- /dev/null +++ b/htdocs/includes/ace/mode-sparql.js @@ -0,0 +1,313 @@ +ace.define("ace/mode/sparql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SPARQLHighlightRules = function() { + + this.$rules = { + start: [{ + include: "#comments" + }, { + include: "#strings" + }, { + include: "#string-language-suffixes" + }, { + include: "#string-datatype-suffixes" + }, { + include: "#logic-operators" + }, { + include: "#relative-urls" + }, { + include: "#xml-schema-types" + }, { + include: "#rdf-schema-types" + }, { + include: "#owl-types" + }, { + include: "#qnames" + }, { + include: "#keywords" + }, { + include: "#built-in-functions" + }, { + include: "#variables" + }, { + include: "#boolean-literal" + }, { + include: "#punctuation-operators" + }], + "#boolean-literal": [{ + token: "constant.language.boolean.sparql", + regex: /true|false/ + }], + "#built-in-functions": [{ + token: "support.function.sparql", + regex: /[Aa][Bb][Ss]|[Aa][Vv][Gg]|[Bb][Nn][Oo][Dd][Ee]|[Bb][Oo][Uu][Nn][Dd]|[Cc][Ee][Ii][Ll]|[Cc][Oo][Aa][Ll][Ee][Ss][Cc][Ee]|[Cc][Oo][Nn][Cc][Aa][Tt]|[Cc][Oo][Nn][Tt][Aa][Ii][Nn][Ss]|[Cc][Oo][Uu][Nn][Tt]|[Dd][Aa][Tt][Aa][Tt][Yy][Pp][Ee]|[Dd][Aa][Yy]|[Ee][Nn][Cc][Oo][Dd][Ee]_[Ff][Oo][Rr]_[Uu][Rr][Ii]|[Ee][Xx][Ii][Ss][Tt][Ss]|[Ff][Ll][Oo][Oo][Rr]|[Gg][Rr][Oo][Uu][Pp]_[Cc][Oo][Nn][Cc][Aa][Tt]|[Hh][Oo][Uu][Rr][Ss]|[Ii][Ff]|[Ii][Rr][Ii]|[Ii][Ss][Bb][Ll][Aa][Nn][Kk]|[Ii][Ss][Ii][Rr][Ii]|[Ii][Ss][Ll][Ii][Tt][Ee][Rr][Aa][Ll]|[Ii][Ss][Nn][Uu][Mm][Ee][Rr][Ii][Cc]|[Ii][Ss][Uu][Rr][Ii]|[Ll][Aa][Nn][Gg]|[Ll][Aa][Nn][Gg][Mm][Aa][Tt][Cc][Hh][Ee][Ss]|[Ll][Cc][Aa][Ss][Ee]|[Mm][Aa][Xx]|[Mm][Dd]5|[Mm][Ii][Nn]|[Mm][Ii][Nn][Uu][Tt][Ee][Ss]|[Mm][Oo][Nn][Tt][Hh]|[Nn][Oo][Ww]|[Rr][Aa][Nn][Dd]|[Rr][Ee][Gg][Ee][Xx]|[Rr][Ee][Pp][Ll][Aa][Cc][Ee]|[Rr][Oo][Uu][Nn][Dd]|[Ss][Aa][Mm][Ee][Tt][Ee][Rr][Mm]|[Ss][Aa][Mm][Pp][Ll][Ee]|[Ss][Ee][Cc][Oo][Nn][Dd][Ss]|[Ss][Ee][Pp][Aa][Rr][Aa][Tt][Oo][Rr]|[Ss][Hh][Aa](?:1|256|384|512)|[Ss][Tt][Rr]|[Ss][Tt][Rr][Aa][Ff][Tt][Ee][Rr]|[Ss][Tt][Rr][Bb][Ee][Ff][Oo][Rr][Ee]|[Ss][Tt][Rr][Dd][Tt]|[Ss][Tt][Rr][Ee][Nn][Dd][Ss]|[Ss][Tt][Rr][Ll][Aa][Nn][Gg]|[Ss][Tt][Rr][Ll][Ee][Nn]|[Ss][Tt][Rr][Ss][Tt][Aa][Rr][Tt][Ss]|[Ss][Tt][Rr][Uu][Uu][Ii][Dd]|[Ss][Uu][Bb][Ss][Tt][Rr]|[Ss][Uu][Mm]|[Tt][Ii][Mm][Ee][Zz][Oo][Nn][Ee]|[Tt][Zz]|[Uu][Cc][Aa][Ss][Ee]|[Uu][Rr][Ii]|[Uu][Uu][Ii][Dd]|[Yy][Ee][Aa][Rr]/ + }], + "#comments": [{ + token: [ + "punctuation.definition.comment.sparql", + "comment.line.hash.sparql" + ], + regex: /(#)(.*$)/ + }], + "#keywords": [{ + token: "keyword.other.sparql", + regex: /[Aa][Dd][Dd]|[Aa][Ll][Ll]|[Aa][Ss]|[As][Ss][Cc]|[Aa][Ss][Kk]|[Bb][Aa][Ss][Ee]|[Bb][Ii][Nn][Dd]|[Bb][Yy]|[Cc][Ll][Ee][Aa][Rr]|[Cc][Oo][Nn][Ss][Tt][Rr][Uu][Cc][Tt]|[Cc][Oo][Pp][Yy]|[Cc][Rr][Ee][Aa][Tt][Ee]|[Dd][Aa][Tt][Aa]|[Dd][Ee][Ff][Aa][Uu][Ll][Tt]|[Dd][Ee][Ll][Ee][Tt][Ee]|[Dd][Ee][Sc][Cc]|[Dd][Ee][Ss][Cc][Rr][Ii][Bb][Ee]|[Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt]|[Dd][Rr][Oo][Pp]|[Ff][Ii][Ll][Tt][Ee][Rr]|[Ff][Rr][Oo][Mm]|[Gg][Rr][Aa][Pp][Hh]|[Gg][Rr][Oo][Uu][Pp]|[Hh][Aa][Vv][Ii][Nn][Gg]|[Ii][Nn][Ss][Ee][Rr][Tt]|[Ll][Ii][Mm][Ii][Tt]|[Ll][Oo][Aa][Dd]|[Mm][Ii][Nn][Uu][Ss]|[Mm][Oo][Vv][Ee]|[Nn][Aa][Mm][Ee][Dd]|[Oo][Ff][Ff][Ss][Ee][Tt]|[Oo][Pp][Tt][Ii][Oo][Nn][Aa][Ll]|[Oo][Rr][Dd][Ee][Rr]|[Pp][Rr][Ee][Ff][Ii][Xx]|[Rr][Ee][Dd][Uu][Cc][Ee][Dd]|[Ss][Ee][Ll][Ee][Cc][Tt]|[Ss][Ee][Pp][Aa][Rr][Aa][Tt][Oo][Rr]|[Ss][Ee][Rr][Vv][Ii][Cc][Ee]|[Ss][Ii][Ll][Ee][Nn][Tt]|[Tt][Oo]|[Uu][Nn][Dd][Ee][Ff]|[Uu][Nn][Ii][Oo][Nn]|[Uu][Ss][Ii][Nn][Gg]|[Vv][Aa][Ll][Uu][Ee][Ss]|[Ww][He][Ee][Rr][Ee]|[Ww][Ii][Tt][Hh]/ + }], + "#logic-operators": [{ + token: "keyword.operator.logical.sparql", + regex: /\|\||&&|=|!=|<|>|<=|>=|(?:^|!?\s)IN(?:!?\s|$)|(?:^|!?\s)NOT(?:!?\s|$)|-|\+|\*|\/|\!/ + }], + "#owl-types": [{ + token: "support.type.datatype.owl.sparql", + regex: /owl:[a-zA-Z]+/ + }], + "#punctuation-operators": [{ + token: "keyword.operator.punctuation.sparql", + regex: /;|,|\.|\(|\)|\{|\}|\|/ + }], + "#qnames": [{ + token: "entity.name.other.qname.sparql", + regex: /(?:[a-zA-Z][-_a-zA-Z0-9]*)?:(?:[_a-zA-Z][-_a-zA-Z0-9]*)?/ + }], + "#rdf-schema-types": [{ + token: "support.type.datatype.rdf.schema.sparql", + regex: /rdfs?:[a-zA-Z]+|(?:^|\s)a(?:\s|$)/ + }], + "#relative-urls": [{ + token: "string.quoted.other.relative.url.sparql", + regex: //, + next: "pop" + }, { + defaultToken: "string.quoted.other.relative.url.sparql" + }] + }], + "#string-datatype-suffixes": [{ + token: "keyword.operator.datatype.suffix.sparql", + regex: /\^\^/ + }], + "#string-language-suffixes": [{ + token: [ + "keyword.operator.language.suffix.sparql", + "constant.language.suffix.sparql" + ], + regex: /(?!")(@)([a-z]+(?:\-[a-z0-9]+)*)/ + }], + "#strings": [{ + token: "string.quoted.triple.sparql", + regex: /"""/, + push: [{ + token: "string.quoted.triple.sparql", + regex: /"""/, + next: "pop" + }, { + defaultToken: "string.quoted.triple.sparql" + }] + }, { + token: "string.quoted.double.sparql", + regex: /"/, + push: [{ + token: "string.quoted.double.sparql", + regex: /"/, + next: "pop" + }, { + token: "invalid.string.newline", + regex: /$/ + }, { + token: "constant.character.escape.sparql", + regex: /\\./ + }, { + defaultToken: "string.quoted.double.sparql" + }] + }], + "#variables": [{ + token: "variable.other.sparql", + regex: /(?:\?|\$)[-_a-zA-Z0-9]+/ + }], + "#xml-schema-types": [{ + token: "support.type.datatype.schema.sparql", + regex: /xsd?:[a-z][a-zA-Z]+/ + }] + } + + this.normalizeRules(); +}; + +SPARQLHighlightRules.metaData = { + fileTypes: ["rq", "sparql"], + name: "SPARQL", + scopeName: "source.sparql" +} + + +oop.inherits(SPARQLHighlightRules, TextHighlightRules); + +exports.SPARQLHighlightRules = SPARQLHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/sparql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sparql_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var SPARQLHighlightRules = require("./sparql_highlight_rules").SPARQLHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = SPARQLHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/sparql" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-sql.js b/htdocs/includes/ace/mode-sql.js new file mode 100644 index 00000000000..9678787a874 --- /dev/null +++ b/htdocs/includes/ace/mode-sql.js @@ -0,0 +1,103 @@ +ace.define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SqlHighlightRules = function() { + + var keywords = ( + "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" + + "when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|" + + "foreign|not|references|default|null|inner|cross|natural|database|drop|grant" + ); + + var builtinConstants = ( + "true|false" + ); + + var builtinFunctions = ( + "avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|" + + "coalesce|ifnull|isnull|nvl" + ); + + var dataTypes = ( + "int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|" + + "money|real|number|integer" + ); + + var keywordMapper = this.createKeywordMapper({ + "support.function": builtinFunctions, + "keyword": keywords, + "constant.language": builtinConstants, + "storage.type": dataTypes + }, "identifier", true); + + this.$rules = { + "start" : [ { + token : "comment", + regex : "--.*$" + }, { + token : "comment", + start : "/\\*", + end : "\\*/" + }, { + token : "string", // " string + regex : '".*?"' + }, { + token : "string", // ' string + regex : "'.*?'" + }, { + token : "string", // ` string (apache drill) + regex : "`.*?`" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\(]" + }, { + token : "paren.rparen", + regex : "[\\)]" + }, { + token : "text", + regex : "\\s+" + } ] + }; + this.normalizeRules(); +}; + +oop.inherits(SqlHighlightRules, TextHighlightRules); + +exports.SqlHighlightRules = SqlHighlightRules; +}); + +ace.define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules; + +var Mode = function() { + this.HighlightRules = SqlHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "--"; + + this.$id = "ace/mode/sql"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-sqlserver.js b/htdocs/includes/ace/mode-sqlserver.js new file mode 100644 index 00000000000..59e9b9077b8 --- /dev/null +++ b/htdocs/includes/ace/mode-sqlserver.js @@ -0,0 +1,437 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/sqlserver_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SqlServerHighlightRules = function() { + var logicalOperators = "ALL|AND|ANY|BETWEEN|EXISTS|IN|LIKE|NOT|OR|SOME"; + logicalOperators += "|NULL|IS|APPLY|INNER|OUTER|LEFT|RIGHT|JOIN|CROSS"; //SSMS colors these gray too + + + var builtinFunctions = ( + "OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|" + + "AVG|CHECKSUM_AGG|COUNT|COUNT_BIG|GROUPING|GROUPING_ID|MAX|MIN|STDEV|STDEVP|SUM|VAR|VARP|" + + "DENSE_RANK|NTILE|RANK|ROW_NUMBER" + + "@@DATEFIRST|@@DBTS|@@LANGID|@@LANGUAGE|@@LOCK_TIMEOUT|@@MAX_CONNECTIONS|@@MAX_PRECISION|@@NESTLEVEL|@@OPTIONS|@@REMSERVER|@@SERVERNAME|@@SERVICENAME|@@SPID|@@TEXTSIZE|@@VERSION|" + + "CAST|CONVERT|PARSE|TRY_CAST|TRY_CONVERT|TRY_PARSE" + + "@@CURSOR_ROWS|@@FETCH_STATUS|CURSOR_STATUS|" + + "@@DATEFIRST|@@LANGUAGE|CURRENT_TIMESTAMP|DATEADD|DATEDIFF|DATEFROMPARTS|DATENAME|DATEPART|DATETIME2FROMPARTS|DATETIMEFROMPARTS|DATETIMEOFFSETFROMPARTS|DAY|EOMONTH|GETDATE|GETUTCDATE|ISDATE|MONTH|SET DATEFIRST|SET DATEFORMAT|SET LANGUAGE|SMALLDATETIMEFROMPARTS|SP_HELPLANGUAGE|SWITCHOFFSET|SYSDATETIME|SYSDATETIMEOFFSET|SYSUTCDATETIME|TIMEFROMPARTS|TODATETIMEOFFSET|YEAR|" + + "CHOOSE|IIF|" + + "ABS|ACOS|ASIN|ATAN|ATN2|CEILING|COS|COT|DEGREES|EXP|FLOOR|LOG|LOG10|PI|POWER|RADIANS|RAND|ROUND|SIGN|SIN|SQRT|SQUARE|TAN|" + + "@@PROCID|APPLOCK_MODE|APPLOCK_TEST|APP_NAME|ASSEMBLYPROPERTY|COLUMNPROPERTY|COL_LENGTH|COL_NAME|DATABASEPROPERTYEX|DATABASE_PRINCIPAL_ID|DB_ID|DB_NAME|FILEGROUPPROPERTY|FILEGROUP_ID|FILEGROUP_NAME|FILEPROPERTY|FILE_ID|FILE_IDEX|FILE_NAME|FULLTEXTCATALOGPROPERTY|FULLTEXTSERVICEPROPERTY|INDEXKEY_PROPERTY|INDEXPROPERTY|INDEX_COL|OBJECTPROPERTY|OBJECTPROPERTYEX|OBJECT_DEFINITION|OBJECT_ID|OBJECT_NAME|OBJECT_SCHEMA_NAME|ORIGINAL_DB_NAME|PARSENAME|SCHEMA_ID|SCHEMA_NAME|SCOPE_IDENTITY|SERVERPROPERTY|STATS_DATE|TYPEPROPERTY|TYPE_ID|TYPE_NAME|" + + "CERTENCODED|CERTPRIVATEKEY|CURRENT_USER|DATABASE_PRINCIPAL_ID|HAS_PERMS_BY_NAME|IS_MEMBER|IS_ROLEMEMBER|IS_SRVROLEMEMBER|ORIGINAL_LOGIN|PERMISSIONS|PWDCOMPARE|PWDENCRYPT|SCHEMA_ID|SCHEMA_NAME|SESSION_USER|SUSER_ID|SUSER_NAME|SUSER_SID|SUSER_SNAME|SYS.FN_BUILTIN_PERMISSIONS|SYS.FN_GET_AUDIT_FILE|SYS.FN_MY_PERMISSIONS|SYSTEM_USER|USER_ID|USER_NAME|" + + "ASCII|CHAR|CHARINDEX|CONCAT|DIFFERENCE|FORMAT|LEN|LOWER|LTRIM|NCHAR|PATINDEX|QUOTENAME|REPLACE|REPLICATE|REVERSE|RTRIM|SOUNDEX|SPACE|STR|STUFF|SUBSTRING|UNICODE|UPPER|" + + "$PARTITION|@@ERROR|@@IDENTITY|@@PACK_RECEIVED|@@ROWCOUNT|@@TRANCOUNT|BINARY_CHECKSUM|CHECKSUM|CONNECTIONPROPERTY|CONTEXT_INFO|CURRENT_REQUEST_ID|ERROR_LINE|ERROR_MESSAGE|ERROR_NUMBER|ERROR_PROCEDURE|ERROR_SEVERITY|ERROR_STATE|FORMATMESSAGE|GETANSINULL|GET_FILESTREAM_TRANSACTION_CONTEXT|HOST_ID|HOST_NAME|ISNULL|ISNUMERIC|MIN_ACTIVE_ROWVERSION|NEWID|NEWSEQUENTIALID|ROWCOUNT_BIG|XACT_STATE|" + + "@@CONNECTIONS|@@CPU_BUSY|@@IDLE|@@IO_BUSY|@@PACKET_ERRORS|@@PACK_RECEIVED|@@PACK_SENT|@@TIMETICKS|@@TOTAL_ERRORS|@@TOTAL_READ|@@TOTAL_WRITE|FN_VIRTUALFILESTATS|" + + "PATINDEX|TEXTPTR|TEXTVALID|" + + "COALESCE|NULLIF" + ); + var dataTypes = ("BIGINT|BINARY|BIT|CHAR|CURSOR|DATE|DATETIME|DATETIME2|DATETIMEOFFSET|DECIMAL|FLOAT|HIERARCHYID|IMAGE|INTEGER|INT|MONEY|NCHAR|NTEXT|NUMERIC|NVARCHAR|REAL|SMALLDATETIME|SMALLINT|SMALLMONEY|SQL_VARIANT|TABLE|TEXT|TIME|TIMESTAMP|TINYINT|UNIQUEIDENTIFIER|VARBINARY|VARCHAR|XML"); + var builtInStoredProcedures = "sp_addextendedproc|sp_addextendedproperty|sp_addmessage|sp_addtype|sp_addumpdevice|sp_add_data_file_recover_suspect_db|sp_add_log_file_recover_suspect_db|sp_altermessage|sp_attach_db|sp_attach_single_file_db|sp_autostats|sp_bindefault|sp_bindrule|sp_bindsession|sp_certify_removable|sp_clean_db_file_free_space|sp_clean_db_free_space|sp_configure|sp_control_plan_guide|sp_createstats|sp_create_plan_guide|sp_create_plan_guide_from_handle|sp_create_removable|sp_cycle_errorlog|sp_datatype_info|sp_dbcmptlevel|sp_dbmmonitoraddmonitoring|sp_dbmmonitorchangealert|sp_dbmmonitorchangemonitoring|sp_dbmmonitordropalert|sp_dbmmonitordropmonitoring|sp_dbmmonitorhelpalert|sp_dbmmonitorhelpmonitoring|sp_dbmmonitorresults|sp_db_increased_partitions|sp_delete_backuphistory|sp_depends|sp_describe_first_result_set|sp_describe_undeclared_parameters|sp_detach_db|sp_dropdevice|sp_dropextendedproc|sp_dropextendedproperty|sp_dropmessage|sp_droptype|sp_execute|sp_executesql|sp_getapplock|sp_getbindtoken|sp_help|sp_helpconstraint|sp_helpdb|sp_helpdevice|sp_helpextendedproc|sp_helpfile|sp_helpfilegroup|sp_helpindex|sp_helplanguage|sp_helpserver|sp_helpsort|sp_helpstats|sp_helptext|sp_helptrigger|sp_indexoption|sp_invalidate_textptr|sp_lock|sp_monitor|sp_prepare|sp_prepexec|sp_prepexecrpc|sp_procoption|sp_recompile|sp_refreshview|sp_releaseapplock|sp_rename|sp_renamedb|sp_resetstatus|sp_sequence_get_range|sp_serveroption|sp_setnetname|sp_settriggerorder|sp_spaceused|sp_tableoption|sp_unbindefault|sp_unbindrule|sp_unprepare|sp_updateextendedproperty|sp_updatestats|sp_validname|sp_who|sys.sp_merge_xtp_checkpoint_files|sys.sp_xtp_bind_db_resource_pool|sys.sp_xtp_checkpoint_force_garbage_collection|sys.sp_xtp_control_proc_exec_stats|sys.sp_xtp_control_query_exec_stats|sys.sp_xtp_unbind_db_resource_pool"; + var keywords = "ABSOLUTE|ACTION|ADA|ADD|ADMIN|AFTER|AGGREGATE|ALIAS|ALL|ALLOCATE|ALTER|AND|ANY|ARE|ARRAY|AS|ASC|ASENSITIVE|ASSERTION|ASYMMETRIC|AT|ATOMIC|AUTHORIZATION|BACKUP|BEFORE|BEGIN|BETWEEN|BIT_LENGTH|BLOB|BOOLEAN|BOTH|BREADTH|BREAK|BROWSE|BULK|BY|CALL|CALLED|CARDINALITY|CASCADE|CASCADED|CASE|CATALOG|CHARACTER|CHARACTER_LENGTH|CHAR_LENGTH|CHECK|CHECKPOINT|CLASS|CLOB|CLOSE|CLUSTERED|COALESCE|COLLATE|COLLATION|COLLECT|COLUMN|COMMIT|COMPLETION|COMPUTE|CONDITION|CONNECT|CONNECTION|CONSTRAINT|CONSTRAINTS|CONSTRUCTOR|CONTAINS|CONTAINSTABLE|CONTINUE|CORR|CORRESPONDING|COVAR_POP|COVAR_SAMP|CREATE|CROSS|CUBE|CUME_DIST|CURRENT|CURRENT_CATALOG|CURRENT_DATE|CURRENT_DEFAULT_TRANSFORM_GROUP|CURRENT_PATH|CURRENT_ROLE|CURRENT_SCHEMA|CURRENT_TIME|CURRENT_TRANSFORM_GROUP_FOR_TYPE|CYCLE|DATA|DATABASE|DBCC|DEALLOCATE|DEC|DECLARE|DEFAULT|DEFERRABLE|DEFERRED|DELETE|DENY|DEPTH|DEREF|DESC|DESCRIBE|DESCRIPTOR|DESTROY|DESTRUCTOR|DETERMINISTIC|DIAGNOSTICS|DICTIONARY|DISCONNECT|DISK|DISTINCT|DISTRIBUTED|DOMAIN|DOUBLE|DROP|DUMP|DYNAMIC|EACH|ELEMENT|ELSE|END|END-EXEC|EQUALS|ERRLVL|ESCAPE|EVERY|EXCEPT|EXCEPTION|EXEC|EXECUTE|EXISTS|EXIT|EXTERNAL|EXTRACT|FETCH|FILE|FILLFACTOR|FILTER|FIRST|FOR|FOREIGN|FORTRAN|FOUND|FREE|FREETEXT|FREETEXTTABLE|FROM|FULL|FULLTEXTTABLE|FUNCTION|FUSION|GENERAL|GET|GLOBAL|GO|GOTO|GRANT|GROUP|HAVING|HOLD|HOLDLOCK|HOST|HOUR|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IGNORE|IMMEDIATE|IN|INCLUDE|INDEX|INDICATOR|INITIALIZE|INITIALLY|INNER|INOUT|INPUT|INSENSITIVE|INSERT|INTEGER|INTERSECT|INTERSECTION|INTERVAL|INTO|IS|ISOLATION|ITERATE|JOIN|KEY|KILL|LANGUAGE|LARGE|LAST|LATERAL|LEADING|LESS|LEVEL|LIKE|LIKE_REGEX|LIMIT|LINENO|LN|LOAD|LOCAL|LOCALTIME|LOCALTIMESTAMP|LOCATOR|MAP|MATCH|MEMBER|MERGE|METHOD|MINUTE|MOD|MODIFIES|MODIFY|MODULE|MULTISET|NAMES|NATIONAL|NATURAL|NCLOB|NEW|NEXT|NO|NOCHECK|NONCLUSTERED|NONE|NORMALIZE|NOT|NULL|NULLIF|OBJECT|OCCURRENCES_REGEX|OCTET_LENGTH|OF|OFF|OFFSETS|OLD|ON|ONLY|OPEN|OPERATION|OPTION|OR|ORDER|ORDINALITY|OUT|OUTER|OUTPUT|OVER|OVERLAPS|OVERLAY|PAD|PARAMETER|PARAMETERS|PARTIAL|PARTITION|PASCAL|PATH|PERCENT|PERCENTILE_CONT|PERCENTILE_DISC|PERCENT_RANK|PIVOT|PLAN|POSITION|POSITION_REGEX|POSTFIX|PRECISION|PREFIX|PREORDER|PREPARE|PRESERVE|PRIMARY|PRINT|PRIOR|PRIVILEGES|PROC|PROCEDURE|PUBLIC|RAISERROR|RANGE|READ|READS|READTEXT|RECONFIGURE|RECURSIVE|REF|REFERENCES|REFERENCING|REGR_AVGX|REGR_AVGY|REGR_COUNT|REGR_INTERCEPT|REGR_R2|REGR_SLOPE|REGR_SXX|REGR_SXY|REGR_SYY|RELATIVE|RELEASE|REPLICATION|RESTORE|RESTRICT|RESULT|RETURN|RETURNS|REVERT|REVOKE|ROLE|ROLLBACK|ROLLUP|ROUTINE|ROW|ROWCOUNT|ROWGUIDCOL|ROWS|RULE|SAVE|SAVEPOINT|SCHEMA|SCOPE|SCROLL|SEARCH|SECOND|SECTION|SECURITYAUDIT|SELECT|SEMANTICKEYPHRASETABLE|SEMANTICSIMILARITYDETAILSTABLE|SEMANTICSIMILARITYTABLE|SENSITIVE|SEQUENCE|SESSION|SET|SETS|SETUSER|SHUTDOWN|SIMILAR|SIZE|SOME|SPECIFIC|SPECIFICTYPE|SQL|SQLCA|SQLCODE|SQLERROR|SQLEXCEPTION|SQLSTATE|SQLWARNING|START|STATE|STATEMENT|STATIC|STATISTICS|STDDEV_POP|STDDEV_SAMP|STRUCTURE|SUBMULTISET|SUBSTRING_REGEX|SYMMETRIC|SYSTEM|TABLESAMPLE|TEMPORARY|TERMINATE|TEXTSIZE|THAN|THEN|TIMEZONE_HOUR|TIMEZONE_MINUTE|TO|TOP|TRAILING|TRAN|TRANSACTION|TRANSLATE|TRANSLATE_REGEX|TRANSLATION|TREAT|TRIGGER|TRIM|TRUNCATE|TSEQUAL|UESCAPE|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNPIVOT|UPDATE|UPDATETEXT|USAGE|USE|USER|USING|VALUE|VALUES|VARIABLE|VARYING|VAR_POP|VAR_SAMP|VIEW|WAITFOR|WHEN|WHENEVER|WHERE|WHILE|WIDTH_BUCKET|WINDOW|WITH|WITHIN|WITHIN GROUP|WITHOUT|WORK|WRITE|WRITETEXT|XMLAGG|XMLATTRIBUTES|XMLBINARY|XMLCAST|XMLCOMMENT|XMLCONCAT|XMLDOCUMENT|XMLELEMENT|XMLEXISTS|XMLFOREST|XMLITERATE|XMLNAMESPACES|XMLPARSE|XMLPI|XMLQUERY|XMLSERIALIZE|XMLTABLE|XMLTEXT|XMLVALIDATE|ZONE"; + keywords += "|KEEPIDENTITY|KEEPDEFAULTS|IGNORE_CONSTRAINTS|IGNORE_TRIGGERS|XLOCK|FORCESCAN|FORCESEEK|HOLDLOCK|NOLOCK|NOWAIT|PAGLOCK|READCOMMITTED|READCOMMITTEDLOCK|READPAST|READUNCOMMITTED|REPEATABLEREAD|ROWLOCK|SERIALIZABLE|SNAPSHOT|SPATIAL_WINDOW_MAX_CELLS|TABLOCK|TABLOCKX|UPDLOCK|XLOCK|IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX|EXPAND|VIEWS|FAST|FORCE|KEEP|KEEPFIXED|MAXDOP|MAXRECURSION|OPTIMIZE|PARAMETERIZATION|SIMPLE|FORCED|RECOMPILE|ROBUST|PLAN|SPATIAL_WINDOW_MAX_CELLS|NOEXPAND|HINT"; + keywords += "|LOOP|HASH|MERGE|REMOTE"; + keywords += "|TRY|CATCH|THROW"; + keywords += "|TYPE"; + keywords = keywords.split('|'); + keywords = keywords.filter(function(value, index, self) { + return logicalOperators.split('|').indexOf(value) === -1 && builtinFunctions.split('|').indexOf(value) === -1 && dataTypes.split('|').indexOf(value) === -1; + }); + keywords = keywords.sort().join('|'); + + + var keywordMapper = this.createKeywordMapper({ + "constant.language": logicalOperators, + "storage.type": dataTypes, + "support.function": builtinFunctions, + "support.storedprocedure": builtInStoredProcedures, + "keyword": keywords + }, "identifier", true); + var setStatements = "SET ANSI_DEFAULTS|SET ANSI_NULLS|SET ANSI_NULL_DFLT_OFF|SET ANSI_NULL_DFLT_ON|SET ANSI_PADDING|SET ANSI_WARNINGS|SET ARITHABORT|SET ARITHIGNORE|SET CONCAT_NULL_YIELDS_NULL|SET CURSOR_CLOSE_ON_COMMIT|SET DATEFIRST|SET DATEFORMAT|SET DEADLOCK_PRIORITY|SET FIPS_FLAGGER|SET FMTONLY|SET FORCEPLAN|SET IDENTITY_INSERT|SET IMPLICIT_TRANSACTIONS|SET LANGUAGE|SET LOCK_TIMEOUT|SET NOCOUNT|SET NOEXEC|SET NUMERIC_ROUNDABORT|SET OFFSETS|SET PARSEONLY|SET QUERY_GOVERNOR_COST_LIMIT|SET QUOTED_IDENTIFIER|SET REMOTE_PROC_TRANSACTIONS|SET ROWCOUNT|SET SHOWPLAN_ALL|SET SHOWPLAN_TEXT|SET SHOWPLAN_XML|SET STATISTICS IO|SET STATISTICS PROFILE|SET STATISTICS TIME|SET STATISTICS XML|SET TEXTSIZE|SET XACT_ABORT".split('|'); + var isolationLevels = "READ UNCOMMITTED|READ COMMITTED|REPEATABLE READ|SNAPSHOP|SERIALIZABLE".split('|'); + for (var i = 0; i < isolationLevels.length; i++) { + setStatements.push('SET TRANSACTION ISOLATION LEVEL ' + isolationLevels[i]); + } + + + this.$rules = { + start: [{ + token: "string.start", + regex: "'", + next: [{ + token: "constant.language.escape", + regex: /''/ + }, { + token: "string.end", + next: "start", + regex: "'" + }, { + defaultToken: "string" + }] + }, + DocCommentHighlightRules.getStartRule("doc-start"), { + token: "comment", + regex: "--.*$" + }, { + token: "comment", + start: "/\\*", + end: "\\*/" + }, { + token: "constant.numeric", // float + regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token: keywordMapper, + regex: "@{0,2}[a-zA-Z_$][a-zA-Z0-9_$]*\\b(?!])" //up to 2 @symbols for some built in functions + }, { + token: "constant.class", + regex: "@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token: "keyword.operator", + regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=|\\*" + }, { + token: "paren.lparen", + regex: "[\\(]" + }, { + token: "paren.rparen", + regex: "[\\)]" + }, { + token: "punctuation", + regex: ",|;" + }, { + token: "text", + regex: "\\s+" + }], + comment: [ + DocCommentHighlightRules.getTagRule(), { + token: "comment", + regex: "\\*\\/", + next: "no_regex" + }, { + defaultToken: "comment", + caseInsensitive: true + }] + }; + for (var i = 0; i < setStatements.length; i++) { + this.$rules.start.unshift({ + token: "set.statement", + regex: setStatements[i] + }); + } + + this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]); + this.normalizeRules(); + var completions = []; + var addCompletions = function(arr, meta) { + arr.forEach(function(v) { + completions.push({ + name: v, + value: v, + score: 0, + meta: meta + }); + }); + }; + addCompletions(builtInStoredProcedures.split('|'), 'procedure'); + addCompletions(logicalOperators.split('|'), 'operator'); + addCompletions(builtinFunctions.split('|'), 'function'); + addCompletions(dataTypes.split('|'), 'type'); + addCompletions(setStatements, 'statement'); + addCompletions(keywords.split('|'), 'keyword'); + + this.completions = completions; +}; + +oop.inherits(SqlServerHighlightRules, TextHighlightRules); + +exports.SqlHighlightRules = SqlServerHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/sqlserver",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function() {}; + +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\bCASE\b|\bBEGIN\b)|^\s*(\/\*)/i; + this.startRegionRe = /^\s*(\/\*|--)#?region\b/; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + if (match[1]) return this.getBeginEndBlock(session, row, i, match[1]); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } + else if (foldStyle != "all") range = null; + } + + return range; + } + + if (foldStyle === "markbegin") return; + return; + }; + this.getBeginEndBlock = function(session, row, column, matchSequence) { + var start = { + row: row, + column: column + matchSequence.length + }; + var maxRow = session.getLength(); + var line; + + var depth = 1; + var re = /(\bCASE\b|\bBEGIN\b)|(\bEND\b)/i; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth++; + else depth--; + + if (!depth) break; + } + var endRow = row; + if (endRow > start.row) { + return new Range(start.row, start.column, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/sqlserver",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sqlserver_highlight_rules","ace/mode/folding/sqlserver"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var SqlServerHighlightRules = require("./sqlserver_highlight_rules").SqlHighlightRules; +var SqlServerFoldMode = require("./folding/sqlserver").FoldMode; + +var Mode = function() { + this.HighlightRules = SqlServerHighlightRules; + this.foldingRules = new SqlServerFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "--"; + this.blockComment = {start: "/*", end: "*/"}; + this.getCompletions = function(state, session, pos, prefix) { + return session.$mode.$highlightRules.completions; + }; + + this.$id = "ace/mode/sql"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-stylus.js b/htdocs/includes/ace/mode-stylus.js new file mode 100644 index 00000000000..fed3f82fad1 --- /dev/null +++ b/htdocs/includes/ace/mode-stylus.js @@ -0,0 +1,462 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/stylus_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var CssHighlightRules = require("./css_highlight_rules"); + +var StylusHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.type": CssHighlightRules.supportType, + "support.function": CssHighlightRules.supportFunction, + "support.constant": CssHighlightRules.supportConstant, + "support.constant.color": CssHighlightRules.supportConstantColor, + "support.constant.fonts": CssHighlightRules.supportConstantFonts + }, "text", true); + + this.$rules = { + start: [ + { + token : "comment", + regex : /\/\/.*$/ + }, + { + token : "comment", // multi line comment + regex : /\/\*/, + next : "comment" + }, + { + token: ["entity.name.function.stylus", "text"], + regex: "^([-a-zA-Z_][-\\w]*)?(\\()" + }, + { + token: ["entity.other.attribute-name.class.stylus"], + regex: "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*" + }, + { + token: ["entity.language.stylus"], + regex: "^ *&" + }, + { + token: ["variable.language.stylus"], + regex: "(arguments)" + }, + { + token: ["keyword.stylus"], + regex: "@[-\\w]+" + }, + { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : CssHighlightRules.pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : CssHighlightRules.pseudoClasses + }, + { + token: ["entity.name.tag.stylus"], + regex: "(?:\\b)(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(?:h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)(?:\\b)" + }, + { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, + { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, + { + token: ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"], + regex: "(#)([a-zA-Z][a-zA-Z0-9_-]*)" + }, + { + token: "meta.vendor-prefix.stylus", + regex: "-webkit-|-moz\\-|-ms-|-o-" + }, + { + token: "keyword.control.stylus", + regex: "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b" + }, + { + token: "keyword.operator.stylus", + regex: "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!=" + }, + { + token: "keyword.operator.stylus", + regex: "(?:in|is(?:nt)?|not)\\b" + }, + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, + { + token : "constant.numeric", + regex : CssHighlightRules.numRe + }, + { + token : "keyword", + regex : "(?:ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)\\b" + }, + { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : "\\*\\/", + next : "start" + }, { + defaultToken : "comment" + } + ], + "qqstring" : [ + { + token : "string", + regex : '[^"\\\\]+' + }, + { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, + { + token : "string", + regex : '"|$', + next : "start" + } + ], + "qstring" : [ + { + token : "string", + regex : "[^'\\\\]+" + }, + { + token : "string", + regex : "\\\\$", + next : "qstring" + }, + { + token : "string", + regex : "'|$", + next : "start" + } + ] +} + +}; + +oop.inherits(StylusHighlightRules, TextHighlightRules); + +exports.StylusHighlightRules = StylusHighlightRules; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/stylus",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/stylus_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var StylusHighlightRules = require("./stylus_highlight_rules").StylusHighlightRules; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = StylusHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.$id = "ace/mode/stylus"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-svg.js b/htdocs/includes/ace/mode-svg.js new file mode 100644 index 00000000000..25d879b35cf --- /dev/null +++ b/htdocs/includes/ace/mode-svg.js @@ -0,0 +1,1568 @@ +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var XmlFoldMode = require("./folding/xml").FoldMode; +var WorkerClient = require("../worker/worker_client").WorkerClient; + +var Mode = function() { + this.HighlightRules = XmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.foldingRules = new XmlFoldMode(); +}; + +oop.inherits(Mode, TextMode); + +(function() { + + this.voidElements = lang.arrayToMap([]); + + this.blockComment = {start: ""}; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/xml"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/svg_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var SvgHighlightRules = function() { + XmlHighlightRules.call(this); + + this.embedTagRules(JavaScriptHighlightRules, "js-", "script"); + + this.normalizeRules(); +}; + +oop.inherits(SvgHighlightRules, XmlHighlightRules); + +exports.SvgHighlightRules = SvgHighlightRules; +}); + +ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(defaultMode, subModes) { + this.defaultMode = defaultMode; + this.subModes = subModes; +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + + this.$getMode = function(state) { + if (typeof state != "string") + state = state[0]; + for (var key in this.subModes) { + if (state.indexOf(key) === 0) + return this.subModes[key]; + } + return null; + }; + + this.$tryMode = function(state, session, foldStyle, row) { + var mode = this.$getMode(state); + return (mode ? mode.getFoldWidget(session, foldStyle, row) : ""); + }; + + this.getFoldWidget = function(session, foldStyle, row) { + return ( + this.$tryMode(session.getState(row-1), session, foldStyle, row) || + this.$tryMode(session.getState(row), session, foldStyle, row) || + this.defaultMode.getFoldWidget(session, foldStyle, row) + ); + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var mode = this.$getMode(session.getState(row-1)); + + if (!mode || !mode.getFoldWidget(session, foldStyle, row)) + mode = this.$getMode(session.getState(row)); + + if (!mode || !mode.getFoldWidget(session, foldStyle, row)) + mode = this.defaultMode; + + return mode.getFoldWidgetRange(session, foldStyle, row); + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/svg",["require","exports","module","ace/lib/oop","ace/mode/xml","ace/mode/javascript","ace/mode/svg_highlight_rules","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var XmlMode = require("./xml").Mode; +var JavaScriptMode = require("./javascript").Mode; +var SvgHighlightRules = require("./svg_highlight_rules").SvgHighlightRules; +var MixedFoldMode = require("./folding/mixed").FoldMode; +var XmlFoldMode = require("./folding/xml").FoldMode; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + XmlMode.call(this); + + this.HighlightRules = SvgHighlightRules; + + this.createModeDelegates({ + "js-": JavaScriptMode + }); + + this.foldingRules = new MixedFoldMode(new XmlFoldMode(), { + "js-": new CStyleFoldMode() + }); +}; + +oop.inherits(Mode, XmlMode); + +(function() { + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + + this.$id = "ace/mode/svg"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-swift.js b/htdocs/includes/ace/mode-swift.js new file mode 100644 index 00000000000..dc5a4303b7a --- /dev/null +++ b/htdocs/includes/ace/mode-swift.js @@ -0,0 +1,382 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/swift_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SwiftHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "variable.language": "", + "keyword": "__COLUMN__|__FILE__|__FUNCTION__|__LINE__" + + "|as|associativity|break|case|class|continue|default|deinit|didSet" + + "|do|dynamicType|else|enum|extension|fallthrough|for|func|get|if|import" + + "|in|infix|init|inout|is|left|let|let|mutating|new|none|nonmutating" + + "|operator|override|postfix|precedence|prefix|protocol|return|right" + + "|safe|Self|self|set|struct|subscript|switch|Type|typealias" + + "|unowned|unsafe|var|weak|where|while|willSet" + + "|convenience|dynamic|final|infix|lazy|mutating|nonmutating|optional|override|postfix" + + "|prefix|required|static|guard|defer", + "storage.type": "bool|double|Double" + + "|extension|float|Float|int|Int|private|public|string|String", + "constant.language": + "false|Infinity|NaN|nil|no|null|null|off|on|super|this|true|undefined|yes", + "support.function": + "" + }, "identifier"); + + function string(start, options) { + var nestable = options.nestable || options.interpolation; + var interpStart = options.interpolation && options.interpolation.nextState || "start"; + var mainRule = { + regex: start + (options.multiline ? "" : "(?=.)"), + token: "string.start" + }; + var nextState = [ + options.escape && { + regex: options.escape, + token: "character.escape" + }, + options.interpolation && { + token : "paren.quasi.start", + regex : lang.escapeRegExp(options.interpolation.lead + options.interpolation.open), + push : interpStart + }, + options.error && { + regex: options.error, + token: "error.invalid" + }, + { + regex: start + (options.multiline ? "" : "|$"), + token: "string.end", + next: nestable ? "pop" : "start" + }, { + defaultToken: "string" + } + ].filter(Boolean); + + if (nestable) + mainRule.push = nextState; + else + mainRule.next = nextState; + + if (!options.interpolation) + return mainRule; + + var open = options.interpolation.open; + var close = options.interpolation.close; + var counter = { + regex: "[" + lang.escapeRegExp(open + close) + "]", + onMatch: function(val, state, stack) { + this.next = val == open ? this.nextState : ""; + if (val == open && stack.length) { + stack.unshift("start", state); + return "paren"; + } + if (val == close && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1) + return "paren.quasi.end"; + } + return val == open ? "paren.lparen" : "paren.rparen"; + }, + nextState: interpStart + } + return [counter, mainRule]; + } + + function comments() { + return [{ + token : "comment", + regex : "\\/\\/(?=.)", + next : [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next: "start"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment.start", + regex : /\/\*/, + stateName: "nested_comment", + push : [ + DocCommentHighlightRules.getTagRule(), + {token : "comment.start", regex : /\/\*/, push: "nested_comment"}, + {token : "comment.end", regex : "\\*\\/", next : "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; + } + + + this.$rules = { + start: [ + string('"', { + escape: /\\(?:[0\\tnr"']|u{[a-fA-F1-9]{0,8}})/, + interpolation: {lead: "\\", open: "(", close: ")"}, + error: /\\./, + multiline: false + }), + comments({type: "c", nestable: true}), + { + regex: /@[a-zA-Z_$][a-zA-Z_$\d\u0080-\ufffe]*/, + token: "variable.parameter" + }, + { + regex: /[a-zA-Z_$][a-zA-Z_$\d\u0080-\ufffe]*/, + token: keywordMapper + }, + { + token : "constant.numeric", + regex : /[+-]?(?:0(?:b[01]+|o[0-7]+|x[\da-fA-F])|\d+(?:(?:\.\d*)?(?:[PpEe][+-]?\d+)?)\b)/ + }, { + token : "keyword.operator", + regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + } + + ] + }; + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); + + this.normalizeRules(); +}; + + +oop.inherits(SwiftHighlightRules, TextHighlightRules); + +exports.HighlightRules = SwiftHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/swift",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/swift_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var HighlightRules = require("./swift_highlight_rules").HighlightRules; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = HighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = new CstyleBehaviour(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/", nestable: true}; + + this.$id = "ace/mode/swift" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-swig.js b/htdocs/includes/ace/mode-swig.js new file mode 100644 index 00000000000..2b2061777cd --- /dev/null +++ b/htdocs/includes/ace/mode-swig.js @@ -0,0 +1,1099 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|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-after|cue-before|cue|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|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|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|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + token : "comment", // multi line comment + regex : "\\/\\*", + push : "comment" + }, { + token: "paren.lparen", + regex: "\\{", + push: "ruleset" + }, { + token: "string", + regex: "@.*?{", + push: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media" : [{ + token : "comment", // multi line comment + regex : "\\/\\*", + push : "comment" + }, { + token: "paren.lparen", + regex: "\\{", + push: "ruleset" + }, { + token: "string", + regex: "\\}", + next: "pop" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "comment" : [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }], + + "ruleset" : [ + { + token : "paren.rparen", + regex : "\\}", + next: "pop" + }, { + token : "comment", // multi line comment + regex : "\\/\\*", + push : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + token : ["support.function", "string", "support.function"], + regex : "(url\\()(.*)(\\))" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }] + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-6][0-7]?|" + // oct + "37[0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + { + token : "comment", + regex : "\\/\\/", + next : "line_comment" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : /\/\*/, + next : "comment" + }, { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hex + regex : /0[xX][0-9a-fA-F]+\b/ + }, { + token : "constant.numeric", // float + regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment_regex_allowed" + }, { + token : "comment", + regex : "\\/\\/", + next : "line_comment_regex_allowed" + }, { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "comment_regex_allowed" : [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : "start"}, + {defaultToken : "comment", caseInsensitive: true} + ], + "comment" : [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : "no_regex"}, + {defaultToken : "comment", caseInsensitive: true} + ], + "line_comment_regex_allowed" : [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : "start"}, + {defaultToken : "comment", caseInsensitive: true} + ], + "line_comment" : [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : "no_regex"}, + {defaultToken : "comment", caseInsensitive: true} + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + next : "qstring" + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + return "paren"; + } + if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || !options.noJSX) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + jsxJsRule, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + jsxJsRule, + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"], + regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true + }, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction", + }, + {token : "comment.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + processing_instruction : [ + {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"}, + {defaultToken : "instruction.xml"} + ], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : "(?:" + tagRegex + ":)?" + tagRegex + "" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ], + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/swig",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SwigHighlightRules = function() { + HtmlHighlightRules.call(this); + + var tags = "autoescape|block|else|elif|extends|filter|for|if|import|include|macro|parent|raw|set|spaceless"; + tags = tags + "|end" + tags.replace(/\|/g, "|end"); + var filters = "addslashes|capitalize|date|default|escape|first|groupBy|join|json|last|lower|raw|replace|reverse|safe|sort|striptags|title|uniq|upper|url_encode|url_decode"; + var special = "first|last|index|index0|revindex|revindex0|key" + var constants = "null|none|true|false|loop"; + var operators = "in|is|and|or|not|as|with|only"; + + var keywordMapper = this.createKeywordMapper({ + "keyword.control.swig": tags, + "support.function.swig": filters+"|"+special, + "keyword.operator.swig": operators, + "constant.language.swig": constants, + }, "identifier"); + for (var rule in this.$rules) { + this.$rules[rule].unshift({ + token : "variable.other.readwrite.local.swig", + regex : "\\{\\{-?", + push : "swig-start" + }, { + token : "meta.tag.swig", + regex : "\\{%-?", + push : "swig-start" + }, { + token : "comment.block.swig", + regex : "\\{#-?", + push : "swig-comment" + }); + } + this.$rules["swig-comment"] = [{ + token : "comment.block.swig", + regex : ".*-?#}", + next : "pop" + }]; + + this.$rules["swig-start"] = [{ + token : "variable.other.readwrite.local.swig", + regex : "-?\\}\\}", + next : "pop" + }, { + token : "meta.tag.swig", + regex : "-?%\\}", + next : "pop" + }, { + token : "string", + regex : "'", + next : "swig-qstring" + }, { + token : "string", + regex : '"', + next : "swig-qqstring" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator.assignment", + regex : "=|~" + }, { + token : "keyword.operator.comparison", + regex : "==|!=|<|>|>=|<=|===" + }, { + token : "keyword.operator.arithmetic", + regex : "\\+|-|/|%|//|\\*|\\*\\*" + }, { + token : "keyword.operator.other", + regex : "\\.\\.|\\|" + }, { + token : "punctuation.operator", + regex : /\?|\:|\,|\;|\./ + }, { + token : "paren.lparen", + regex : /[\[\({]/ + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token : "text", + regex : "\\s+" + } ]; + + this.$rules["swig-qqstring"] = [{ + token : "constant.language.escape", + regex : /\\[\\"$#ntr]|#{[^"}]*}/ + }, { + token : "string", + regex : '"', + next : "swig-start" + }, { + defaultToken : "string" + } + ]; + + this.$rules["swig-qstring"] = [{ + token : "constant.language.escape", + regex : /\\[\\'ntr]}/ + }, { + token : "string", + regex : "'", + next : "swig-start" + }, { + defaultToken : "string" + } + ]; + + this.normalizeRules(); +}; + +oop.inherits(SwigHighlightRules, TextHighlightRules); + +exports.SwigHighlightRules = SwigHighlightRules; +}); diff --git a/htdocs/includes/ace/mode-tcl.js b/htdocs/includes/ace/mode-tcl.js new file mode 100644 index 00000000000..1f878c31d49 --- /dev/null +++ b/htdocs/includes/ace/mode-tcl.js @@ -0,0 +1,376 @@ +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/tcl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var TclHighlightRules = function() { + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "#.*\\\\$", + next : "commentfollow" + }, { + token : "comment", + regex : "#.*$" + }, { + token : "support.function", + regex : '[\\\\]$', + next : "splitlineStart" + }, { + token : "text", + regex : /\\(?:["{}\[\]$\\])/ + }, { + token : "text", // last value before command + regex : '^|[^{][;][^}]|[/\r/]', + next : "commandItem" + }, { + token : "string", // single line + regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line """ string start + regex : '[ ]*["]', + next : "qqstring" + }, { + token : "variable.instance", + regex : "[$]", + next : "variable" + }, { + token : "support.function", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::" + }, { + token : "identifier", + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "paren.lparen", + regex : "[[{]", + next : "commandItem" + }, { + token : "paren.lparen", + regex : "[(]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "commandItem" : [ + { + token : "comment", + regex : "#.*\\\\$", + next : "commentfollow" + }, { + token : "comment", + regex : "#.*$", + next : "start" + }, { + token : "string", // single line + regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "variable.instance", + regex : "[$]", + next : "variable" + }, { + token : "support.function", + regex : "(?:[:][:])[a-zA-Z0-9_/]+(?:[:][:])", + next : "commandItem" + }, { + token : "support.function", + regex : "[a-zA-Z0-9_/]+(?:[:][:])", + next : "commandItem" + }, { + token : "support.function", + regex : "(?:[:][:])", + next : "commandItem" + }, { + token : "paren.rparen", + regex : "[\\])}]" + }, { + token : "support.function", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::" + }, { + token : "keyword", + regex : "[a-zA-Z0-9_/]+", + next : "start" + } ], + "commentfollow" : [ + { + token : "comment", + regex : ".*\\\\$", + next : "commentfollow" + }, { + token : "comment", + regex : '.+', + next : "start" + } ], + "splitlineStart" : [ + { + token : "text", + regex : "^.", + next : "start" + }], + "variable" : [ + { + token : "variable.instance", // variable tcl + regex : "[a-zA-Z_\\d]+(?:[(][a-zA-Z_\\d]+[)])?", + next : "start" + }, { + token : "variable.instance", // variable tcl with braces + regex : "{?[a-zA-Z_\\d]+}?", + next : "start" + }], + "qqstring" : [ { + token : "string", // multi line """ string end + regex : '(?:[^\\\\]|\\\\.)*?["]', + next : "start" + }, { + token : "string", + regex : '.+' + } ] + }; +}; + +oop.inherits(TclHighlightRules, TextHighlightRules); + +exports.TclHighlightRules = TclHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/tcl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/folding/cstyle","ace/mode/tcl_highlight_rules","ace/mode/matching_brace_outdent","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var TclHighlightRules = require("./tcl_highlight_rules").TclHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = TclHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/tcl"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-tex.js b/htdocs/includes/ace/mode-tex.js new file mode 100644 index 00000000000..f4f13baa179 --- /dev/null +++ b/htdocs/includes/ace/mode-tex.js @@ -0,0 +1,152 @@ +ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var TexHighlightRules = function(textClass) { + + if (!textClass) + textClass = "text"; + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "%.*$" + }, { + token : textClass, // non-command + regex : "\\\\[$&%#\\{\\}]" + }, { + token : "keyword", // command + regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b", + next : "nospell" + }, { + token : "keyword", // command + regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])" + }, { + token : "paren.keyword.operator", + regex : "[[({]" + }, { + token : "paren.keyword.operator", + regex : "[\\])}]" + }, { + token : textClass, + regex : "\\s+" + } + ], + "nospell" : [ + { + token : "comment", + regex : "%.*$", + next : "start" + }, { + token : "nospell." + textClass, // non-command + regex : "\\\\[$&%#\\{\\}]" + }, { + token : "keyword", // command + regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b" + }, { + token : "keyword", // command + regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])", + next : "start" + }, { + token : "paren.keyword.operator", + regex : "[[({]" + }, { + token : "paren.keyword.operator", + regex : "[\\])]" + }, { + token : "paren.keyword.operator", + regex : "}", + next : "start" + }, { + token : "nospell." + textClass, + regex : "\\s+" + }, { + token : "nospell." + textClass, + regex : "\\w+" + } + ] + }; +}; + +oop.inherits(TexHighlightRules, TextHighlightRules); + +exports.TexHighlightRules = TexHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/tex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function(suppressHighlighting) { + if (suppressHighlighting) + this.HighlightRules = TextHighlightRules; + else + this.HighlightRules = TexHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "%"; + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.allowAutoInsert = function() { + return false; + }; + this.$id = "ace/mode/tex"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-text.js b/htdocs/includes/ace/mode-text.js new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/includes/ace/mode-text.js @@ -0,0 +1 @@ + diff --git a/htdocs/includes/ace/mode-textile.js b/htdocs/includes/ace/mode-textile.js new file mode 100644 index 00000000000..94ed5c778dc --- /dev/null +++ b/htdocs/includes/ace/mode-textile.js @@ -0,0 +1,142 @@ +ace.define("ace/mode/textile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var TextileHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : function(value) { + if (value.charAt(0) == "h") + return "markup.heading." + value.charAt(1); + else + return "markup.heading"; + }, + regex : "h1|h2|h3|h4|h5|h6|bq|p|bc|pre", + next : "blocktag" + }, + { + token : "keyword", + regex : "[\\*]+|[#]+" + }, + { + token : "text", + regex : ".+" + } + ], + "blocktag" : [ + { + token : "keyword", + regex : "\\. ", + next : "start" + }, + { + token : "keyword", + regex : "\\(", + next : "blocktagproperties" + } + ], + "blocktagproperties" : [ + { + token : "keyword", + regex : "\\)", + next : "blocktag" + }, + { + token : "string", + regex : "[a-zA-Z0-9\\-_]+" + }, + { + token : "keyword", + regex : "#" + } + ] + }; +}; + +oop.inherits(TextileHighlightRules, TextHighlightRules); + +exports.TextileHighlightRules = TextileHighlightRules; + +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/textile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/textile_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var TextileHighlightRules = require("./textile_highlight_rules").TextileHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function() { + this.HighlightRules = TextileHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.type = "text"; + this.getNextLineIndent = function(state, line, tab) { + if (state == "intag") + return tab; + + return ""; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.$id = "ace/mode/textile"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-toml.js b/htdocs/includes/ace/mode-toml.js new file mode 100644 index 00000000000..2f348937d89 --- /dev/null +++ b/htdocs/includes/ace/mode-toml.js @@ -0,0 +1,146 @@ +ace.define("ace/mode/toml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var TomlHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "constant.language.boolean": "true|false" + }, "identifier"); + + var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + + this.$rules = { + "start": [ + { + token: "comment.toml", + regex: /#.*$/ + }, + { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, + { + token: ["variable.keygroup.toml"], + regex: "(?:^\\s*)(\\[\\[([^\\]]+)\\]\\])" + }, + { + token: ["variable.keygroup.toml"], + regex: "(?:^\\s*)(\\[([^\\]]+)\\])" + }, + { + token : keywordMapper, + regex : identifierRe + }, + { + token : "support.date.toml", + regex: "\\d{4}-\\d{2}-\\d{2}(T)\\d{2}:\\d{2}:\\d{2}(Z)" + }, + { + token: "constant.numeric.toml", + regex: "-?\\d+(\\.?\\d+)?" + } + ], + "qqstring" : [ + { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, + { + token : "constant.language.escape", + regex : '\\\\[0tnr"\\\\]' + }, + { + token : "string", + regex : '"|$', + next : "start" + }, + { + defaultToken: "string" + } + ] + } + +}; + +oop.inherits(TomlHighlightRules, TextHighlightRules); + +exports.TomlHighlightRules = TomlHighlightRules; +}); + +ace.define("ace/mode/folding/ini",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function() { +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /^\s*\[([^\])]*)]\s*(?:$|[;#])/; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var re = this.foldingStartMarker; + var line = session.getLine(row); + + var m = line.match(re); + + if (!m) return; + + var startName = m[1] + "."; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + if (/^\s*$/.test(line)) + continue; + m = line.match(re); + if (m && m[1].lastIndexOf(startName, 0) !== 0) + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/toml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/toml_highlight_rules","ace/mode/folding/ini"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var TomlHighlightRules = require("./toml_highlight_rules").TomlHighlightRules; +var FoldMode = require("./folding/ini").FoldMode; + +var Mode = function() { + this.HighlightRules = TomlHighlightRules; + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "#"; + this.$id = "ace/mode/toml"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-tsx.js b/htdocs/includes/ace/mode-tsx.js new file mode 100644 index 00000000000..9db47ac0b98 --- /dev/null +++ b/htdocs/includes/ace/mode-tsx.js @@ -0,0 +1,891 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/typescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; + +var TypeScriptHighlightRules = function(options) { + + var tsRules = [ + { + token: ["keyword.operator.ts", "text", "variable.parameter.function.ts", "text"], + regex: "\\b(module)(\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*\\{)" + }, + { + token: ["storage.type.variable.ts", "text", "keyword.other.ts", "text"], + regex: "(super)(\\s*\\()([a-zA-Z0-9,_?.$\\s]+\\s*)(\\))" + }, + { + token: ["entity.name.function.ts","paren.lparen", "paren.rparen"], + regex: "([a-zA-Z_?.$][\\w?.$]*)(\\()(\\))" + }, + { + token: ["variable.parameter.function.ts", "text", "variable.parameter.function.ts"], + regex: "([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*:\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)" + }, + { + token: ["keyword.operator.ts"], + regex: "(?:\\b(constructor|declare|interface|as|AS|public|private|class|extends|export|super)\\b)" + }, + { + token: ["storage.type.variable.ts"], + regex: "(?:\\b(this\\.|string\\b|bool\\b|number)\\b)" + }, + { + token: ["keyword.operator.ts", "storage.type.variable.ts", "keyword.operator.ts", "storage.type.variable.ts"], + regex: "(class)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)(extends)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)?" + }, + { + token: "keyword", + regex: "(?:super|export|class|extends|import)\\b" + } + ]; + + var JSRules = new JavaScriptHighlightRules({jsx: (options && options.jsx) == true}).getRules(); + + JSRules.start = tsRules.concat(JSRules.start); + this.$rules = JSRules; +}; + +oop.inherits(TypeScriptHighlightRules, JavaScriptHighlightRules); + +exports.TypeScriptHighlightRules = TypeScriptHighlightRules; +}); + +ace.define("ace/mode/typescript",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/typescript_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var jsMode = require("./javascript").Mode; +var TypeScriptHighlightRules = require("./typescript_highlight_rules").TypeScriptHighlightRules; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function() { + this.HighlightRules = TypeScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, jsMode); + +(function() { + this.createWorker = function(session) { + return null; + }; + this.$id = "ace/mode/typescript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/tsx",["require","exports","module","ace/lib/oop","ace/mode/typescript"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var tsMode = require("./typescript").Mode; + +var Mode = function() { + tsMode.call(this); + this.$highlightRuleConfig = {jsx: true}; +}; +oop.inherits(Mode, tsMode); + +(function() { + this.$id = "ace/mode/tsx"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-turtle.js b/htdocs/includes/ace/mode-turtle.js new file mode 100644 index 00000000000..4eef543d2a8 --- /dev/null +++ b/htdocs/includes/ace/mode-turtle.js @@ -0,0 +1,289 @@ +ace.define("ace/mode/turtle_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var TurtleHighlightRules = function() { + + this.$rules = { + start: [{ + include: "#comments" + }, { + include: "#strings" + }, { + include: "#base-prefix-declarations" + }, { + include: "#string-language-suffixes" + }, { + include: "#string-datatype-suffixes" + }, { + include: "#relative-urls" + }, { + include: "#xml-schema-types" + }, { + include: "#rdf-schema-types" + }, { + include: "#owl-types" + }, { + include: "#qnames" + }, { + include: "#punctuation-operators" + }], + "#base-prefix-declarations": [{ + token: "keyword.other.prefix.turtle", + regex: /@(?:base|prefix)/ + }], + "#comments": [{ + token: [ + "punctuation.definition.comment.turtle", + "comment.line.hash.turtle" + ], + regex: /(#)(.*$)/ + }], + "#owl-types": [{ + token: "support.type.datatype.owl.turtle", + regex: /owl:[a-zA-Z]+/ + }], + "#punctuation-operators": [{ + token: "keyword.operator.punctuation.turtle", + regex: /;|,|\.|\(|\)|\[|\]/ + }], + "#qnames": [{ + token: "entity.name.other.qname.turtle", + regex: /(?:[a-zA-Z][-_a-zA-Z0-9]*)?:(?:[_a-zA-Z][-_a-zA-Z0-9]*)?/ + }], + "#rdf-schema-types": [{ + token: "support.type.datatype.rdf.schema.turtle", + regex: /rdfs?:[a-zA-Z]+|(?:^|\s)a(?:\s|$)/ + }], + "#relative-urls": [{ + token: "string.quoted.other.relative.url.turtle", + regex: //, + next: "pop" + }, { + defaultToken: "string.quoted.other.relative.url.turtle" + }] + }], + "#string-datatype-suffixes": [{ + token: "keyword.operator.datatype.suffix.turtle", + regex: /\^\^/ + }], + "#string-language-suffixes": [{ + token: [ + "keyword.operator.language.suffix.turtle", + "constant.language.suffix.turtle" + ], + regex: /(?!")(@)([a-z]+(?:\-[a-z0-9]+)*)/ + }], + "#strings": [{ + token: "string.quoted.triple.turtle", + regex: /"""/, + push: [{ + token: "string.quoted.triple.turtle", + regex: /"""/, + next: "pop" + }, { + defaultToken: "string.quoted.triple.turtle" + }] + }, { + token: "string.quoted.double.turtle", + regex: /"/, + push: [{ + token: "string.quoted.double.turtle", + regex: /"/, + next: "pop" + }, { + token: "invalid.string.newline", + regex: /$/ + }, { + token: "constant.character.escape.turtle", + regex: /\\./ + }, { + defaultToken: "string.quoted.double.turtle" + }] + }], + "#xml-schema-types": [{ + token: "support.type.datatype.xml.schema.turtle", + regex: /xsd?:[a-z][a-zA-Z]+/ + }] + } + + this.normalizeRules(); +}; + +TurtleHighlightRules.metaData = { + fileTypes: ["ttl", "nt"], + name: "Turtle", + scopeName: "source.turtle" +} + + +oop.inherits(TurtleHighlightRules, TextHighlightRules); + +exports.TurtleHighlightRules = TurtleHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/turtle",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/turtle_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var TurtleHighlightRules = require("./turtle_highlight_rules").TurtleHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = TurtleHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.$id = "ace/mode/turtle" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-twig.js b/htdocs/includes/ace/mode-twig.js new file mode 100644 index 00000000000..557c124b671 --- /dev/null +++ b/htdocs/includes/ace/mode-twig.js @@ -0,0 +1,2664 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/twig_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var TwigHighlightRules = function() { + HtmlHighlightRules.call(this); + + var tags = "autoescape|block|do|embed|extends|filter|flush|for|from|if|import|include|macro|sandbox|set|spaceless|use|verbatim"; + tags = tags + "|end" + tags.replace(/\|/g, "|end"); + var filters = "abs|batch|capitalize|convert_encoding|date|date_modify|default|e|escape|first|format|join|json_encode|keys|last|length|lower|merge|nl2br|number_format|raw|replace|reverse|slice|sort|split|striptags|title|trim|upper|url_encode"; + var functions = "attribute|constant|cycle|date|dump|parent|random|range|template_from_string"; + var tests = "constant|divisibleby|sameas|defined|empty|even|iterable|odd"; + var constants = "null|none|true|false"; + var operators = "b-and|b-xor|b-or|in|is|and|or|not" + + var keywordMapper = this.createKeywordMapper({ + "keyword.control.twig": tags, + "support.function.twig": [filters, functions, tests].join("|"), + "keyword.operator.twig": operators, + "constant.language.twig": constants + }, "identifier"); + for (var rule in this.$rules) { + this.$rules[rule].unshift({ + token : "variable.other.readwrite.local.twig", + regex : "\\{\\{-?", + push : "twig-start" + }, { + token : "meta.tag.twig", + regex : "\\{%-?", + push : "twig-start" + }, { + token : "comment.block.twig", + regex : "\\{#-?", + push : "twig-comment" + }); + } + this.$rules["twig-comment"] = [{ + token : "comment.block.twig", + regex : ".*-?#\\}", + next : "pop" + }]; + + this.$rules["twig-start"] = [{ + token : "variable.other.readwrite.local.twig", + regex : "-?\\}\\}", + next : "pop" + }, { + token : "meta.tag.twig", + regex : "-?%\\}", + next : "pop" + }, { + token : "string", + regex : "'", + next : "twig-qstring" + }, { + token : "string", + regex : '"', + next : "twig-qqstring" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator.assignment", + regex : "=|~" + }, { + token : "keyword.operator.comparison", + regex : "==|!=|<|>|>=|<=|===" + }, { + token : "keyword.operator.arithmetic", + regex : "\\+|-|/|%|//|\\*|\\*\\*" + }, { + token : "keyword.operator.other", + regex : "\\.\\.|\\|" + }, { + token : "punctuation.operator", + regex : /\?|:|,|;|\./ + }, { + token : "paren.lparen", + regex : /[\[\({]/ + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token : "text", + regex : "\\s+" + } ]; + + this.$rules["twig-qqstring"] = [{ + token : "constant.language.escape", + regex : /\\[\\"$#ntr]|#{[^"}]*}/ + }, { + token : "string", + regex : '"', + next : "twig-start" + }, { + defaultToken : "string" + } + ]; + + this.$rules["twig-qstring"] = [{ + token : "constant.language.escape", + regex : /\\[\\'ntr]}/ + }, { + token : "string", + regex : "'", + next : "twig-start" + }, { + defaultToken : "string" + } + ]; + + this.normalizeRules(); +}; + +oop.inherits(TwigHighlightRules, TextHighlightRules); + +exports.TwigHighlightRules = TwigHighlightRules; +}); + +ace.define("ace/mode/twig",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/twig_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var TwigHighlightRules = require("./twig_highlight_rules").TwigHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = TwigHighlightRules; + this.$outdent = new MatchingBraceOutdent(); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + this.blockComment = {start: "{#", end: "#}"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + this.$id = "ace/mode/twig"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-typescript.js b/htdocs/includes/ace/mode-typescript.js new file mode 100644 index 00000000000..1c1b697d928 --- /dev/null +++ b/htdocs/includes/ace/mode-typescript.js @@ -0,0 +1,872 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/typescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; + +var TypeScriptHighlightRules = function(options) { + + var tsRules = [ + { + token: ["keyword.operator.ts", "text", "variable.parameter.function.ts", "text"], + regex: "\\b(module)(\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*\\{)" + }, + { + token: ["storage.type.variable.ts", "text", "keyword.other.ts", "text"], + regex: "(super)(\\s*\\()([a-zA-Z0-9,_?.$\\s]+\\s*)(\\))" + }, + { + token: ["entity.name.function.ts","paren.lparen", "paren.rparen"], + regex: "([a-zA-Z_?.$][\\w?.$]*)(\\()(\\))" + }, + { + token: ["variable.parameter.function.ts", "text", "variable.parameter.function.ts"], + regex: "([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*:\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)" + }, + { + token: ["keyword.operator.ts"], + regex: "(?:\\b(constructor|declare|interface|as|AS|public|private|class|extends|export|super)\\b)" + }, + { + token: ["storage.type.variable.ts"], + regex: "(?:\\b(this\\.|string\\b|bool\\b|number)\\b)" + }, + { + token: ["keyword.operator.ts", "storage.type.variable.ts", "keyword.operator.ts", "storage.type.variable.ts"], + regex: "(class)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)(extends)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)?" + }, + { + token: "keyword", + regex: "(?:super|export|class|extends|import)\\b" + } + ]; + + var JSRules = new JavaScriptHighlightRules({jsx: (options && options.jsx) == true}).getRules(); + + JSRules.start = tsRules.concat(JSRules.start); + this.$rules = JSRules; +}; + +oop.inherits(TypeScriptHighlightRules, JavaScriptHighlightRules); + +exports.TypeScriptHighlightRules = TypeScriptHighlightRules; +}); + +ace.define("ace/mode/typescript",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/typescript_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var jsMode = require("./javascript").Mode; +var TypeScriptHighlightRules = require("./typescript_highlight_rules").TypeScriptHighlightRules; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function() { + this.HighlightRules = TypeScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, jsMode); + +(function() { + this.createWorker = function(session) { + return null; + }; + this.$id = "ace/mode/typescript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-vala.js b/htdocs/includes/ace/mode-vala.js new file mode 100644 index 00000000000..75340fb4c86 --- /dev/null +++ b/htdocs/includes/ace/mode-vala.js @@ -0,0 +1,669 @@ +ace.define("ace/mode/vala_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var ValaHighlightRules = function() { + + this.$rules = { start: + [ { token: + [ 'meta.using.vala', + 'keyword.other.using.vala', + 'meta.using.vala', + 'storage.modifier.using.vala', + 'meta.using.vala', + 'punctuation.terminator.vala' ], + regex: '^(\\s*)(using)\\b(?:(\\s*)([^ ;$]+)(\\s*)((?:;)?))?' }, + { include: '#code' } ], + '#all-types': + [ { include: '#primitive-arrays' }, + { include: '#primitive-types' }, + { include: '#object-types' } ], + '#annotations': + [ { token: + [ 'storage.type.annotation.vala', + 'punctuation.definition.annotation-arguments.begin.vala' ], + regex: '(@[^ (]+)(\\()', + push: + [ { token: 'punctuation.definition.annotation-arguments.end.vala', + regex: '\\)', + next: 'pop' }, + { token: + [ 'constant.other.key.vala', + 'text', + 'keyword.operator.assignment.vala' ], + regex: '(\\w*)(\\s*)(=)' }, + { include: '#code' }, + { token: 'punctuation.seperator.property.vala', regex: ',' }, + { defaultToken: 'meta.declaration.annotation.vala' } ] }, + { token: 'storage.type.annotation.vala', regex: '@\\w*' } ], + '#anonymous-classes-and-new': + [ { token: 'keyword.control.new.vala', + regex: '\\bnew\\b', + push_disabled: + [ { token: 'text', + regex: '(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)', + next: 'pop' }, + { token: [ 'storage.type.vala', 'text' ], + regex: '(\\w+)(\\s*)(?=\\[)', + push: + [ { token: 'text', regex: '}|(?=;|\\))', next: 'pop' }, + { token: 'text', + regex: '\\[', + push: + [ { token: 'text', regex: '\\]', next: 'pop' }, + { include: '#code' } ] }, + { token: 'text', + regex: '{', + push: + [ { token: 'text', regex: '(?=})', next: 'pop' }, + { include: '#code' } ] } ] }, + { token: 'text', + regex: '(?=\\w.*\\()', + push: + [ { token: 'text', + regex: '(?<=\\))', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '(?<=\\))', + next: 'pop' }, + { include: '#object-types' }, + { token: 'text', + regex: '\\(', + push: + [ { token: 'text', regex: '\\)', next: 'pop' }, + { include: '#code' } ] } ] }, + { token: 'meta.inner-class.vala', + regex: '{', + push: + [ { token: 'meta.inner-class.vala', regex: '}', next: 'pop' }, + { include: '#class-body' }, + { defaultToken: 'meta.inner-class.vala' } ] } ] } ], + '#assertions': + [ { token: + [ 'keyword.control.assert.vala', + 'meta.declaration.assertion.vala' ], + regex: '\\b(assert|requires|ensures)(\\s)', + push: + [ { token: 'meta.declaration.assertion.vala', + regex: '$', + next: 'pop' }, + { token: 'keyword.operator.assert.expression-seperator.vala', + regex: ':' }, + { include: '#code' }, + { defaultToken: 'meta.declaration.assertion.vala' } ] } ], + '#class': + [ { token: 'meta.class.vala', + regex: '(?=\\w?[\\w\\s]*(?:class|(?:@)?interface|enum|struct|namespace)\\s+\\w+)', + push: + [ { token: 'paren.vala', + regex: '}', + next: 'pop' }, + { include: '#storage-modifiers' }, + { include: '#comments' }, + { token: + [ 'storage.modifier.vala', + 'meta.class.identifier.vala', + 'entity.name.type.class.vala' ], + regex: '(class|(?:@)?interface|enum|struct|namespace)(\\s+)([\\w\\.]+)' }, + { token: 'storage.modifier.extends.vala', + regex: ':', + push: + [ { token: 'meta.definition.class.inherited.classes.vala', + regex: '(?={|,)', + next: 'pop' }, + { include: '#object-types-inherited' }, + { include: '#comments' }, + { defaultToken: 'meta.definition.class.inherited.classes.vala' } ] }, + { token: + [ 'storage.modifier.implements.vala', + 'meta.definition.class.implemented.interfaces.vala' ], + regex: '(,)(\\s)', + push: + [ { token: 'meta.definition.class.implemented.interfaces.vala', + regex: '(?=\\{)', + next: 'pop' }, + { include: '#object-types-inherited' }, + { include: '#comments' }, + { defaultToken: 'meta.definition.class.implemented.interfaces.vala' } ] }, + { token: 'paren.vala', + regex: '{', + push: + [ { token: 'paren.vala', regex: '(?=})', next: 'pop' }, + { include: '#class-body' }, + { defaultToken: 'meta.class.body.vala' } ] }, + { defaultToken: 'meta.class.vala' } ], + comment: 'attempting to put namespace in here.' } ], + '#class-body': + [ { include: '#comments' }, + { include: '#class' }, + { include: '#enums' }, + { include: '#methods' }, + { include: '#annotations' }, + { include: '#storage-modifiers' }, + { include: '#code' } ], + '#code': + [ { include: '#comments' }, + { include: '#class' }, + { token: 'text', + regex: '{', + push: + [ { token: 'text', regex: '}', next: 'pop' }, + { include: '#code' } ] }, + { include: '#assertions' }, + { include: '#parens' }, + { include: '#constants-and-special-vars' }, + { include: '#anonymous-classes-and-new' }, + { include: '#keywords' }, + { include: '#storage-modifiers' }, + { include: '#strings' }, + { include: '#all-types' } ], + '#comments': + [ { token: 'punctuation.definition.comment.vala', + regex: '/\\*\\*/' }, + { include: 'text.html.javadoc' }, + { include: '#comments-inline' } ], + '#comments-inline': + [ { token: 'punctuation.definition.comment.vala', + regex: '/\\*', + push: + [ { token: 'punctuation.definition.comment.vala', + regex: '\\*/', + next: 'pop' }, + { defaultToken: 'comment.block.vala' } ] }, + { token: + [ 'text', + 'punctuation.definition.comment.vala', + 'comment.line.double-slash.vala' ], + regex: '(\\s*)(//)(.*$)' } ], + '#constants-and-special-vars': + [ { token: 'constant.language.vala', + regex: '\\b(?:true|false|null)\\b' }, + { token: 'variable.language.vala', + regex: '\\b(?:this|base)\\b' }, + { token: 'constant.numeric.vala', + regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:[LlFfUuDd]|UL|ul)?\\b' }, + { token: [ 'keyword.operator.dereference.vala', 'constant.other.vala' ], + regex: '((?:\\.)?)\\b([A-Z][A-Z0-9_]+)(?!<|\\.class|\\s*\\w+\\s*=)\\b' } ], + '#enums': + [ { token: 'text', + regex: '^(?=\\s*[A-Z0-9_]+\\s*(?:{|\\(|,))', + push: + [ { token: 'text', regex: '(?=;|})', next: 'pop' }, + { token: 'constant.other.enum.vala', + regex: '\\w+', + push: + [ { token: 'meta.enum.vala', regex: '(?=,|;|})', next: 'pop' }, + { include: '#parens' }, + { token: 'text', + regex: '{', + push: + [ { token: 'text', regex: '}', next: 'pop' }, + { include: '#class-body' } ] }, + { defaultToken: 'meta.enum.vala' } ] } ] } ], + '#keywords': + [ { token: 'keyword.control.catch-exception.vala', + regex: '\\b(?:try|catch|finally|throw)\\b' }, + { token: 'keyword.control.vala', regex: '\\?|:|\\?\\?' }, + { token: 'keyword.control.vala', + regex: '\\b(?:return|break|case|continue|default|do|while|for|foreach|switch|if|else|in|yield|get|set|value)\\b' }, + { token: 'keyword.operator.vala', + regex: '\\b(?:typeof|is|as)\\b' }, + { token: 'keyword.operator.comparison.vala', + regex: '==|!=|<=|>=|<>|<|>' }, + { token: 'keyword.operator.assignment.vala', regex: '=' }, + { token: 'keyword.operator.increment-decrement.vala', + regex: '\\-\\-|\\+\\+' }, + { token: 'keyword.operator.arithmetic.vala', + regex: '\\-|\\+|\\*|\\/|%' }, + { token: 'keyword.operator.logical.vala', regex: '!|&&|\\|\\|' }, + { token: 'keyword.operator.dereference.vala', + regex: '\\.(?=\\S)', + originalRegex: '(?<=\\S)\\.(?=\\S)' }, + { token: 'punctuation.terminator.vala', regex: ';' }, + { token: 'keyword.operator.ownership', regex: 'owned|unowned' } ], + '#methods': + [ { token: 'meta.method.vala', + regex: '(?!new)(?=\\w.*\\s+)(?=[^=]+\\()', + push: + [ { token: 'paren.vala', regex: '}|(?=;)', next: 'pop' }, + { include: '#storage-modifiers' }, + { token: [ 'entity.name.function.vala', 'meta.method.identifier.vala' ], + regex: '([\\~\\w\\.]+)(\\s*\\()', + push: + [ { token: 'meta.method.identifier.vala', + regex: '\\)', + next: 'pop' }, + { include: '#parameters' }, + { defaultToken: 'meta.method.identifier.vala' } ] }, + { token: 'meta.method.return-type.vala', + regex: '(?=\\w.*\\s+\\w+\\s*\\()', + push: + [ { token: 'meta.method.return-type.vala', + regex: '(?=\\w+\\s*\\()', + next: 'pop' }, + { include: '#all-types' }, + { defaultToken: 'meta.method.return-type.vala' } ] }, + { include: '#throws' }, + { token: 'paren.vala', + regex: '{', + push: + [ { token: 'paren.vala', regex: '(?=})', next: 'pop' }, + { include: '#code' }, + { defaultToken: 'meta.method.body.vala' } ] }, + { defaultToken: 'meta.method.vala' } ] } ], + '#namespace': + [ { token: 'text', + regex: '^(?=\\s*[A-Z0-9_]+\\s*(?:{|\\(|,))', + push: + [ { token: 'text', regex: '(?=;|})', next: 'pop' }, + { token: 'constant.other.namespace.vala', + regex: '\\w+', + push: + [ { token: 'meta.namespace.vala', regex: '(?=,|;|})', next: 'pop' }, + { include: '#parens' }, + { token: 'text', + regex: '{', + push: + [ { token: 'text', regex: '}', next: 'pop' }, + { include: '#code' } ] }, + { defaultToken: 'meta.namespace.vala' } ] } ], + comment: 'This is not quite right. See the class grammar right now' } ], + '#object-types': + [ { token: 'storage.type.generic.vala', + regex: '\\b(?:[a-z]\\w*\\.)*[A-Z]+\\w*<', + push: + [ { token: 'storage.type.generic.vala', + regex: '>|[^\\w\\s,\\?<\\[()\\]]', + TODO: 'FIXME: regexp doesn\'t have js equivalent', + originalRegex: '>|[^\\w\\s,\\?<\\[(?:[,]+)\\]]', + next: 'pop' }, + { include: '#object-types' }, + { token: 'storage.type.generic.vala', + regex: '<', + push: + [ { token: 'storage.type.generic.vala', + regex: '>|[^\\w\\s,\\[\\]<]', + next: 'pop' }, + { defaultToken: 'storage.type.generic.vala' } ], + comment: 'This is just to support <>\'s with no actual type prefix' }, + { defaultToken: 'storage.type.generic.vala' } ] }, + { token: 'storage.type.object.array.vala', + regex: '\\b(?:[a-z]\\w*\\.)*[A-Z]+\\w*(?=\\[)', + push: + [ { token: 'storage.type.object.array.vala', + regex: '(?=[^\\]\\s])', + next: 'pop' }, + { token: 'text', + regex: '\\[', + push: + [ { token: 'text', regex: '\\]', next: 'pop' }, + { include: '#code' } ] }, + { defaultToken: 'storage.type.object.array.vala' } ] }, + { token: + [ 'storage.type.vala', + 'keyword.operator.dereference.vala', + 'storage.type.vala' ], + regex: '\\b(?:([a-z]\\w*)(\\.))*([A-Z]+\\w*\\b)' } ], + '#object-types-inherited': + [ { token: 'entity.other.inherited-class.vala', + regex: '\\b(?:[a-z]\\w*\\.)*[A-Z]+\\w*<', + push: + [ { token: 'entity.other.inherited-class.vala', + regex: '>|[^\\w\\s,<]', + next: 'pop' }, + { include: '#object-types' }, + { token: 'storage.type.generic.vala', + regex: '<', + push: + [ { token: 'storage.type.generic.vala', + regex: '>|[^\\w\\s,<]', + next: 'pop' }, + { defaultToken: 'storage.type.generic.vala' } ], + comment: 'This is just to support <>\'s with no actual type prefix' }, + { defaultToken: 'entity.other.inherited-class.vala' } ] }, + { token: + [ 'entity.other.inherited-class.vala', + 'keyword.operator.dereference.vala', + 'entity.other.inherited-class.vala' ], + regex: '\\b(?:([a-z]\\w*)(\\.))*([A-Z]+\\w*)' } ], + '#parameters': + [ { token: 'storage.modifier.vala', regex: 'final' }, + { include: '#primitive-arrays' }, + { include: '#primitive-types' }, + { include: '#object-types' }, + { token: 'variable.parameter.vala', regex: '\\w+' } ], + '#parens': + [ { token: 'text', + regex: '\\(', + push: + [ { token: 'text', regex: '\\)', next: 'pop' }, + { include: '#code' } ] } ], + '#primitive-arrays': + [ { token: 'storage.type.primitive.array.vala', + regex: '\\b(?:bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void|int8|int16|int32|int64|uint8|uint16|uint32|uint64)(?:\\[\\])*\\b' } ], + '#primitive-types': + [ { token: 'storage.type.primitive.vala', + regex: '\\b(?:var|bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void|signal|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b', + comment: 'var is not really a primitive, but acts like one in most cases' } ], + '#storage-modifiers': + [ { token: 'storage.modifier.vala', + regex: '\\b(?:public|private|protected|internal|static|final|sealed|virtual|override|abstract|readonly|volatile|dynamic|async|unsafe|out|ref|weak|owned|unowned|const)\\b', + comment: 'Not sure about unsafe and readonly' } ], + '#strings': + [ { token: 'punctuation.definition.string.begin.vala', + regex: '@"', + push: + [ { token: 'punctuation.definition.string.end.vala', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.vala', + regex: '\\\\.|%[\\w\\.\\-]+|\\$(?:\\w+|\\([\\w\\s\\+\\-\\*\\/]+\\))' }, + { defaultToken: 'string.quoted.interpolated.vala' } ] }, + { token: 'punctuation.definition.string.begin.vala', + regex: '"', + push: + [ { token: 'punctuation.definition.string.end.vala', + regex: '"', + next: 'pop' }, + { token: 'constant.character.escape.vala', regex: '\\\\.' }, + { token: 'constant.character.escape.vala', + regex: '%[\\w\\.\\-]+' }, + { defaultToken: 'string.quoted.double.vala' } ] }, + { token: 'punctuation.definition.string.begin.vala', + regex: '\'', + push: + [ { token: 'punctuation.definition.string.end.vala', + regex: '\'', + next: 'pop' }, + { token: 'constant.character.escape.vala', regex: '\\\\.' }, + { defaultToken: 'string.quoted.single.vala' } ] }, + { token: 'punctuation.definition.string.begin.vala', + regex: '"""', + push: + [ { token: 'punctuation.definition.string.end.vala', + regex: '"""', + next: 'pop' }, + { token: 'constant.character.escape.vala', + regex: '%[\\w\\.\\-]+' }, + { defaultToken: 'string.quoted.triple.vala' } ] } ], + '#throws': + [ { token: 'storage.modifier.vala', + regex: 'throws', + push: + [ { token: 'meta.throwables.vala', regex: '(?={|;)', next: 'pop' }, + { include: '#object-types' }, + { defaultToken: 'meta.throwables.vala' } ] } ], + '#values': + [ { include: '#strings' }, + { include: '#object-types' }, + { include: '#constants-and-special-vars' } ] } + + this.normalizeRules(); +}; + +ValaHighlightRules.metaData = { + comment: 'Based heavily on the Java bundle\'s language syntax. TODO:\n* Closures\n* Delegates\n* Properties: Better support for properties.\n* Annotations\n* Error domains\n* Named arguments\n* Array slicing, negative indexes, multidimensional\n* construct blocks\n* lock blocks?\n* regex literals\n* DocBlock syntax highlighting. (Currently importing javadoc)\n* Folding rule for comments.\n', + fileTypes: [ 'vala' ], + foldingStartMarker: '(\\{\\s*(//.*)?$|^\\s*// \\{\\{\\{)', + foldingStopMarker: '^\\s*(\\}|// \\}\\}\\}$)', + name: 'Vala', + scopeName: 'source.vala' } + + +oop.inherits(ValaHighlightRules, TextHighlightRules); + +exports.ValaHighlightRules = ValaHighlightRules; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/vala",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/vala_highlight_rules","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var ValaHighlightRules = require("./vala_highlight_rules").ValaHighlightRules; +var FoldMode = require("./folding/cstyle").FoldMode; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; + +var Mode = function() { + this.HighlightRules = ValaHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + this.$id = "ace/mode/vala" +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-vbscript.js b/htdocs/includes/ace/mode-vbscript.js new file mode 100644 index 00000000000..010be5be404 --- /dev/null +++ b/htdocs/includes/ace/mode-vbscript.js @@ -0,0 +1,199 @@ +ace.define("ace/mode/vbscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var VBScriptHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "keyword.control.asp": "If|Then|Else|ElseIf|End|While|Wend|For|To|Each|Case|Select|Return" + + "|Continue|Do|Until|Loop|Next|With|Exit|Function|Property|Type|Enum|Sub|IIf", + "storage.type.asp": "Dim|Call|Class|Const|Dim|Redim|Set|Let|Get|New|Randomize|Option|Explicit", + "storage.modifier.asp": "Private|Public|Default", + "keyword.operator.asp": "Mod|And|Not|Or|Xor|as", + "constant.language.asp": "Empty|False|Nothing|Null|True", + "support.class.asp": "Application|ObjectContext|Request|Response|Server|Session", + "support.class.collection.asp": "Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables", + "support.constant.asp": "TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute" + + "|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout", + "support.function.asp": "Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog" + + "|BinaryWrite|Clear|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex", + "support.function.event.asp": "Application_OnEnd|Application_OnStart" + + "|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart", + "support.function.vb.asp": "Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng" + + "|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial" + + "|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency" + + "|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex" + + "|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric" + + "|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim" + + "|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace" + + "|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion" + + "|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse" + + "|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year", + "support.type.vb.asp": "vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|" + + "int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday" + + "|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek" + + "|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger" + + "|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant" + + "|vbDataObject|vbDecimal|vbByte|vbArray" + }, "identifier", true); + + this.$rules = { + "start": [ + { + token: [ + "meta.ending-space" + ], + regex: "$" + }, + { + token: [null], + regex: "^(?=\\t)", + next: "state_3" + }, + { + token: [null], + regex: "^(?= )", + next: "state_4" + }, + { + token: [ + "text", + "storage.type.function.asp", + "text", + "entity.name.function.asp", + "text", + "punctuation.definition.parameters.asp", + "variable.parameter.function.asp", + "punctuation.definition.parameters.asp" + ], + regex: "^(\\s*)(Function|Sub)(\\s+)([a-zA-Z_]\\w*)(\\s*)(\\()([^)]*)(\\))" + }, + { + token: "punctuation.definition.comment.asp", + regex: "'|REM(?=\\s|$)", + next: "comment", + caseInsensitive: true + }, + { + token: "storage.type.asp", + regex: "On Error Resume Next|On Error GoTo", + caseInsensitive: true + }, + { + token: "punctuation.definition.string.begin.asp", + regex: '"', + next: "string" + }, + { + token: [ + "punctuation.definition.variable.asp" + ], + regex: "(\\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b\\s*" + }, + { + token: "constant.numeric.asp", + regex: "-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b" + }, + { + regex: "\\w+", + token: keywordMapper + }, + { + token: ["entity.name.function.asp"], + regex: "(?:(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b)(?=\\(\\)?))" + }, + { + token: ["keyword.operator.asp"], + regex: "\\-|\\+|\\*\\/|\\>|\\<|\\=|\\&" + } + ], + "state_3": [ + { + token: [ + "meta.odd-tab.tabs", + "meta.even-tab.tabs" + ], + regex: "(\\t)(\\t)?" + }, + { + token: "meta.leading-space", + regex: "(?=[^\\t])", + next: "start" + }, + { + token: "meta.leading-space", + regex: ".", + next: "state_3" + } + ], + "state_4": [ + { + token: ["meta.odd-tab.spaces", "meta.even-tab.spaces"], + regex: "( )( )?" + }, + { + token: "meta.leading-space", + regex: "(?=[^ ])", + next: "start" + }, + { + defaultToken: "meta.leading-space" + } + ], + "comment": [ + { + token: "comment.line.apostrophe.asp", + regex: "$|(?=(?:%>))", + next: "start" + }, + { + defaultToken: "comment.line.apostrophe.asp" + } + ], + "string": [ + { + token: "constant.character.escape.apostrophe.asp", + regex: '""' + }, + { + token: "string.quoted.double.asp", + regex: '"', + next: "start" + }, + { + defaultToken: "string.quoted.double.asp" + } + ] +} + +}; + +oop.inherits(VBScriptHighlightRules, TextHighlightRules); + +exports.VBScriptHighlightRules = VBScriptHighlightRules; +}); + +ace.define("ace/mode/vbscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vbscript_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var VBScriptHighlightRules = require("./vbscript_highlight_rules").VBScriptHighlightRules; + +var Mode = function() { + this.HighlightRules = VBScriptHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = ["'", "REM"]; + + this.$id = "ace/mode/vbscript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-velocity.js b/htdocs/includes/ace/mode-velocity.js new file mode 100644 index 00000000000..2a420b669d7 --- /dev/null +++ b/htdocs/includes/ace/mode-velocity.js @@ -0,0 +1,2762 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; +var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; +var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; +var supportConstantColor = exports.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; +var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; + +var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; +var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; +var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; + +var CssHighlightRules = function() { + + var keywordMapper = this.createKeywordMapper({ + "support.function": supportFunction, + "support.constant": supportConstant, + "support.type": supportType, + "support.constant.color": supportConstantColor, + "support.constant.fonts": supportConstantFonts + }, "text", true); + + this.$rules = { + "start" : [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "ruleset" + }, { + token: "paren.rparen", + regex: "\\}" + }, { + token: "string", + regex: "@", + next: "media" + }, { + token: "keyword", + regex: "#[a-z0-9-_]+" + }, { + token: "keyword", + regex: "%" + }, { + token: "variable", + regex: "\\.[a-z0-9-_]+" + }, { + token: "string", + regex: ":[a-z0-9-_]+" + }, { + token : "constant.numeric", + regex : numRe + }, { + token: "constant", + regex: "[a-z0-9-_]+" + }, { + caseInsensitive: true + }], + + "media": [{ + include : ["strings", "url", "comments"] + }, { + token: "paren.lparen", + regex: "\\{", + next: "start" + }, { + token: "paren.rparen", + regex: "\\}", + next: "start" + }, { + token: "string", + regex: ";", + next: "start" + }, { + token: "keyword", + regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" + + "|page|font|keyframes|viewport|counter-style|font-feature-values" + + "|swash|ornaments|annotation|stylistic|styleset|character-variant)" + }], + + "comments" : [{ + token: "comment", // multi line comment + regex: "\\/\\*", + push: [{ + token : "comment", + regex : "\\*\\/", + next : "pop" + }, { + defaultToken : "comment" + }] + }], + + "ruleset" : [{ + regex : "-(webkit|ms|moz|o)-", + token : "text" + }, { + token : "paren.rparen", + regex : "\\}", + next : "start" + }, { + include : ["strings", "url", "comments"] + }, { + token : ["constant.numeric", "keyword"], + regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + }, { + token : "constant.numeric", + regex : numRe + }, { + token : "constant.numeric", // hex6 color + regex : "#[a-f0-9]{6}" + }, { + token : "constant.numeric", // hex3 color + regex : "#[a-f0-9]{3}" + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], + regex : pseudoElements + }, { + token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], + regex : pseudoClasses + }, { + include: "url" + }, { + token : keywordMapper, + regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" + }, { + caseInsensitive: true + }], + + url: [{ + token : "support.function", + regex : "(?:url(:?-prefix)?|domain|regexp)\\(", + push: [{ + token : "support.function", + regex : "\\)", + next : "pop" + }, { + defaultToken: "string" + }] + }], + + strings: [{ + token : "string.start", + regex : "'", + push : [{ + token : "string.end", + regex : "'|$", + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }, { + token : "string.start", + regex : '"', + push : [{ + token : "string.end", + regex : '"|$', + next: "pop" + }, { + include : "escapes" + }, { + token : "constant.language.escape", + regex : /\\$/, + consumeLineEnd: true + }, { + defaultToken: "string" + }] + }], + escapes: [{ + token : "constant.language.escape", + regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ + }] + + }; + + this.normalizeRules(); +}; + +oop.inherits(CssHighlightRules, TextHighlightRules); + +exports.CssHighlightRules = CssHighlightRules; + +}); + +ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var propertyMap = { + "background": {"#$0": 1}, + "background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, + "background-image": {"url('/$0')": 1}, + "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, + "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, + "background-attachment": {"scroll": 1, "fixed": 1}, + "background-size": {"cover": 1, "contain": 1}, + "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, + "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, + "border-color": {"#$0": 1}, + "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, + "border-collapse": {"collapse": 1, "separate": 1}, + "bottom": {"px": 1, "em": 1, "%": 1}, + "clear": {"left": 1, "right": 1, "both": 1, "none": 1}, + "color": {"#$0": 1, "rgb(#$00,0,0)": 1}, + "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, + "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, + "empty-cells": {"show": 1, "hide": 1}, + "float": {"left": 1, "right": 1, "none": 1}, + "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, + "font-size": {"px": 1, "em": 1, "%": 1}, + "font-weight": {"bold": 1, "normal": 1}, + "font-style": {"italic": 1, "normal": 1}, + "font-variant": {"normal": 1, "small-caps": 1}, + "height": {"px": 1, "em": 1, "%": 1}, + "left": {"px": 1, "em": 1, "%": 1}, + "letter-spacing": {"normal": 1}, + "line-height": {"normal": 1}, + "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, + "margin": {"px": 1, "em": 1, "%": 1}, + "margin-right": {"px": 1, "em": 1, "%": 1}, + "margin-left": {"px": 1, "em": 1, "%": 1}, + "margin-top": {"px": 1, "em": 1, "%": 1}, + "margin-bottom": {"px": 1, "em": 1, "%": 1}, + "max-height": {"px": 1, "em": 1, "%": 1}, + "max-width": {"px": 1, "em": 1, "%": 1}, + "min-height": {"px": 1, "em": 1, "%": 1}, + "min-width": {"px": 1, "em": 1, "%": 1}, + "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, + "padding": {"px": 1, "em": 1, "%": 1}, + "padding-top": {"px": 1, "em": 1, "%": 1}, + "padding-right": {"px": 1, "em": 1, "%": 1}, + "padding-bottom": {"px": 1, "em": 1, "%": 1}, + "padding-left": {"px": 1, "em": 1, "%": 1}, + "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, + "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, + "right": {"px": 1, "em": 1, "%": 1}, + "table-layout": {"fixed": 1, "auto": 1}, + "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, + "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, + "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, + "top": {"px": 1, "em": 1, "%": 1}, + "vertical-align": {"top": 1, "bottom": 1}, + "visibility": {"hidden": 1, "visible": 1}, + "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, + "width": {"px": 1, "em": 1, "%": 1}, + "word-spacing": {"normal": 1}, + "filter": {"alpha(opacity=$0100)": 1}, + + "text-shadow": {"$02px 2px 2px #777": 1}, + "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1}, + "-moz-border-radius": 1, + "-moz-border-radius-topright": 1, + "-moz-border-radius-bottomright": 1, + "-moz-border-radius-topleft": 1, + "-moz-border-radius-bottomleft": 1, + "-webkit-border-radius": 1, + "-webkit-border-top-right-radius": 1, + "-webkit-border-top-left-radius": 1, + "-webkit-border-bottom-right-radius": 1, + "-webkit-border-bottom-left-radius": 1, + "-moz-box-shadow": 1, + "-webkit-box-shadow": 1, + "transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, + "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } +}; + +var CssCompletions = function() { + +}; + +(function() { + + this.completionsDefined = false; + + this.defineCompletions = function() { + if (document) { + var style = document.createElement('c').style; + + for (var i in style) { + if (typeof style[i] !== 'string') + continue; + + var name = i.replace(/[A-Z]/g, function(x) { + return '-' + x.toLowerCase(); + }); + + if (!propertyMap.hasOwnProperty(name)) + propertyMap[name] = 1; + } + } + + this.completionsDefined = true; + } + + this.getCompletions = function(state, session, pos, prefix) { + if (!this.completionsDefined) { + this.defineCompletions(); + } + + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (state==='ruleset'){ + var line = session.getLine(pos.row).substr(0, pos.column); + if (/:[^;]+$/.test(line)) { + /([\w\-]+):[^:]*$/.test(line); + + return this.getPropertyValueCompletions(state, session, pos, prefix); + } else { + return this.getPropertyCompletions(state, session, pos, prefix); + } + } + + return []; + }; + + this.getPropertyCompletions = function(state, session, pos, prefix) { + var properties = Object.keys(propertyMap); + return properties.map(function(property){ + return { + caption: property, + snippet: property + ': $0', + meta: "property", + score: Number.MAX_VALUE + }; + }); + }; + + this.getPropertyValueCompletions = function(state, session, pos, prefix) { + var line = session.getLine(pos.row).substr(0, pos.column); + var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; + + if (!property) + return []; + var values = []; + if (property in propertyMap && typeof propertyMap[property] === "object") { + values = Object.keys(propertyMap[property]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "property value", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(CssCompletions.prototype); + +exports.CssCompletions = CssCompletions; +}); + +ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; + +var CssBehaviour = function () { + + this.inherit(CstyleBehaviour); + + this.add("colon", "insertion", function (state, action, editor, session, text) { + if (text === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ':') { + return { + text: '', + selection: [1, 1] + } + } + if (!line.substring(cursor.column).match(/^\s*;/)) { + return { + text: ':;', + selection: [1, 1] + } + } + } + } + }); + + this.add("colon", "deletion", function (state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected === ':') { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + if (token && token.value.match(/\s+/)) { + token = iterator.stepBackward(); + } + if (token && token.type === 'support.type') { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar === ';') { + range.end.column ++; + return range; + } + } + } + }); + + this.add("semicolon", "insertion", function (state, action, editor, session, text) { + if (text === ';') { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === ';') { + return { + text: '', + selection: [1, 1] + } + } + } + }); + +} +oop.inherits(CssBehaviour, CstyleBehaviour); + +exports.CssBehaviour = CssBehaviour; +}); + +ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CssCompletions = require("./css_completions").CssCompletions; +var CssBehaviour = require("./behaviour/css").CssBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = CssHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CssBehaviour(); + this.$completer = new CssCompletions(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.foldingRules = "cStyle"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + var match = line.match(/^.*\{\s*$/); + if (match) { + indent += tab; + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/css"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); + +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; + +var tagMap = lang.createMap({ + a : 'anchor', + button : 'form', + form : 'form', + img : 'image', + input : 'form', + label : 'form', + option : 'form', + script : 'script', + select : 'form', + textarea : 'form', + style : 'style', + table : 'table', + tbody : 'table', + td : 'table', + tfoot : 'table', + th : 'table', + tr : 'table' +}); + +var HtmlHighlightRules = function() { + XmlHighlightRules.call(this); + + this.addRules({ + attributes: [{ + include : "tag_whitespace" + }, { + token : "entity.other.attribute-name.xml", + regex : "[-_a-zA-Z0-9:.]+" + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=", + push : [{ + include: "tag_whitespace" + }, { + token : "string.unquoted.attribute-value.html", + regex : "[^<>='\"`\\s]+", + next : "pop" + }, { + token : "empty", + regex : "", + next : "pop" + }] + }, { + include : "attribute_value" + }], + tag: [{ + token : function(start, tag) { + var group = tagMap[tag]; + return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; + }, + regex : "(", next : "start"} + ] + }); + + this.embedTagRules(CssHighlightRules, "css-", "style"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); + + if (this.constructor === HtmlHighlightRules) + this.normalizeRules(); +}; + +oop.inherits(HtmlHighlightRules, XmlHighlightRules); + +exports.HtmlHighlightRules = HtmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var MixedFoldMode = require("./mixed").FoldMode; +var XmlFoldMode = require("./xml").FoldMode; +var CStyleFoldMode = require("./cstyle").FoldMode; + +var FoldMode = exports.FoldMode = function(voidElements, optionalTags) { + MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), { + "js-": new CStyleFoldMode(), + "css-": new CStyleFoldMode() + }); +}; + +oop.inherits(FoldMode, MixedFoldMode); + +}); + +ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) { +"use strict"; + +var TokenIterator = require("../token_iterator").TokenIterator; + +var commonAttributes = [ + "accesskey", + "class", + "contenteditable", + "contextmenu", + "dir", + "draggable", + "dropzone", + "hidden", + "id", + "inert", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +]; + +var eventAttributes = [ + "onabort", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onpause", + "onplay", + "onplaying", + "onprogress", + "onratechange", + "onreset", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onstalled", + "onsubmit", + "onsuspend", + "ontimeupdate", + "onvolumechange", + "onwaiting" +]; + +var globalAttributes = commonAttributes.concat(eventAttributes); + +var attributeMap = { + "html": {"manifest": 1}, + "head": {}, + "title": {}, + "base": {"href": 1, "target": 1}, + "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1}, + "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1}, + "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1}, + "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1}, + "noscript": {"href": 1}, + "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1}, + "section": {}, + "nav": {}, + "article": {"pubdate": 1}, + "aside": {}, + "h1": {}, + "h2": {}, + "h3": {}, + "h4": {}, + "h5": {}, + "h6": {}, + "header": {}, + "footer": {}, + "address": {}, + "main": {}, + "p": {}, + "hr": {}, + "pre": {}, + "blockquote": {"cite": 1}, + "ol": {"start": 1, "reversed": 1}, + "ul": {}, + "li": {"value": 1}, + "dl": {}, + "dt": {}, + "dd": {}, + "figure": {}, + "figcaption": {}, + "div": {}, + "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1}, + "em": {}, + "strong": {}, + "small": {}, + "s": {}, + "cite": {}, + "q": {"cite": 1}, + "dfn": {}, + "abbr": {}, + "data": {}, + "time": {"datetime": 1}, + "code": {}, + "var": {}, + "samp": {}, + "kbd": {}, + "sub": {}, + "sup": {}, + "i": {}, + "b": {}, + "u": {}, + "mark": {}, + "ruby": {}, + "rt": {}, + "rp": {}, + "bdi": {}, + "bdo": {}, + "span": {}, + "br": {}, + "wbr": {}, + "ins": {"cite": 1, "datetime": 1}, + "del": {"cite": 1, "datetime": 1}, + "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1}, + "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}}, + "embed": {"src": 1, "height": 1, "width": 1, "type": 1}, + "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1}, + "param": {"name": 1, "value": 1}, + "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}}, + "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }}, + "source": {"src": 1, "type": 1, "media": 1}, + "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1}, + "canvas": {"width": 1, "height": 1}, + "map": {"name": 1}, + "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1}, + "svg": {}, + "math": {}, + "table": {"summary": 1}, + "caption": {}, + "colgroup": {"span": 1}, + "col": {"span": 1}, + "tbody": {}, + "thead": {}, + "tfoot": {}, + "tr": {}, + "td": {"headers": 1, "rowspan": 1, "colspan": 1}, + "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1}, + "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}}, + "fieldset": {"disabled": 1, "form": 1, "name": 1}, + "legend": {}, + "label": {"form": 1, "for": 1}, + "input": { + "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1}, + "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1}, + "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}}, + "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}}, + "datalist": {}, + "optgroup": {"disabled": 1, "label": 1}, + "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1}, + "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}}, + "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1}, + "output": {"for": 1, "form": 1, "name": 1}, + "progress": {"value": 1, "max": 1}, + "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1}, + "details": {"open": 1}, + "summary": {}, + "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1}, + "menu": {"type": 1, "label": 1}, + "dialog": {"open": 1} +}; + +var elements = Object.keys(attributeMap); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +function findTagName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "tag-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +function findAttributeName(session, pos) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + while (token && !is(token, "attribute-name")){ + token = iterator.stepBackward(); + } + if (token) + return token.value; +} + +var HtmlCompletions = function() { + +}; + +(function() { + + this.getCompletions = function(state, session, pos, prefix) { + var token = session.getTokenAt(pos.row, pos.column); + + if (!token) + return []; + if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open")) + return this.getTagCompletions(state, session, pos, prefix); + if (is(token, "tag-whitespace") || is(token, "attribute-name")) + return this.getAttributeCompletions(state, session, pos, prefix); + if (is(token, "attribute-value")) + return this.getAttributeValueCompletions(state, session, pos, prefix); + var line = session.getLine(pos.row).substr(0, pos.column); + if (/&[a-z]*$/i.test(line)) + return this.getHTMLEntityCompletions(state, session, pos, prefix); + + return []; + }; + + this.getTagCompletions = function(state, session, pos, prefix) { + return elements.map(function(element){ + return { + value: element, + meta: "tag", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + if (!tagName) + return []; + var attributes = globalAttributes; + if (tagName in attributeMap) { + attributes = attributes.concat(Object.keys(attributeMap[tagName])); + } + return attributes.map(function(attribute){ + return { + caption: attribute, + snippet: attribute + '="$0"', + meta: "attribute", + score: Number.MAX_VALUE + }; + }); + }; + + this.getAttributeValueCompletions = function(state, session, pos, prefix) { + var tagName = findTagName(session, pos); + var attributeName = findAttributeName(session, pos); + + if (!tagName) + return []; + var values = []; + if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") { + values = Object.keys(attributeMap[tagName][attributeName]); + } + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "attribute value", + score: Number.MAX_VALUE + }; + }); + }; + + this.getHTMLEntityCompletions = function(state, session, pos, prefix) { + var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;']; + + return values.map(function(value){ + return { + caption: value, + snippet: value, + meta: "html entity", + score: Number.MAX_VALUE + }; + }); + }; + +}).call(HtmlCompletions.prototype); + +exports.HtmlCompletions = HtmlCompletions; +}); + +ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var JavaScriptMode = require("./javascript").Mode; +var CssMode = require("./css").Mode; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var HtmlFoldMode = require("./folding/html").FoldMode; +var HtmlCompletions = require("./html_completions").HtmlCompletions; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"]; +var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"]; + +var Mode = function(options) { + this.fragmentContext = options && options.fragmentContext; + this.HighlightRules = HtmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.$completer = new HtmlCompletions(); + + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); + + this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags)); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.blockComment = {start: ""}; + + this.voidElements = lang.arrayToMap(voidElements); + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.getCompletions = function(state, session, pos, prefix) { + return this.$completer.getCompletions(state, session, pos, prefix); + }; + + this.createWorker = function(session) { + if (this.constructor != Mode) + return; + var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + if (this.fragmentContext) + worker.call("setOptions", [{context: this.fragmentContext}]); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/html"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/velocity_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; + +var VelocityHighlightRules = function() { + HtmlHighlightRules.call(this); + + var builtinConstants = lang.arrayToMap( + ('true|false|null').split('|') + ); + + var builtinFunctions = lang.arrayToMap( + ("_DateTool|_DisplayTool|_EscapeTool|_FieldTool|_MathTool|_NumberTool|_SerializerTool|_SortTool|_StringTool|_XPathTool").split('|') + ); + + var builtinVariables = lang.arrayToMap( + ('$contentRoot|$foreach').split('|') + ); + + var keywords = lang.arrayToMap( + ("#set|#macro|#include|#parse|" + + "#if|#elseif|#else|#foreach|" + + "#break|#end|#stop" + ).split('|') + ); + + this.$rules.start.push( + { + token : "comment", + regex : "##.*$" + },{ + token : "comment.block", // multi line comment + regex : "#\\*", + next : "vm_comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : function(value) { + if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (builtinConstants.hasOwnProperty(value)) + return "constant.language"; + else if (builtinVariables.hasOwnProperty(value)) + return "variable.language"; + else if (builtinFunctions.hasOwnProperty(value) || builtinFunctions.hasOwnProperty(value.substring(1))) + return "support.function"; + else if (value == "debugger") + return "invalid.deprecated"; + else + if(value.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*)$/)) + return "variable"; + return "identifier"; + }, + regex : "[a-zA-Z$#][a-zA-Z0-9_]*\\b" + }, { + token : "keyword.operator", + regex : "!|&|\\*|\\-|\\+|=|!=|<=|>=|<|>|&&|\\|\\|" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ); + + this.$rules["vm_comment"] = [ + { + token : "comment", // closing comment + regex : "\\*#|-->", + next : "start" + }, { + defaultToken: "comment" + } + ]; + + this.$rules["vm_start"] = [ + { + token: "variable", + regex: "}", + next: "pop" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : function(value) { + if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (builtinConstants.hasOwnProperty(value)) + return "constant.language"; + else if (builtinVariables.hasOwnProperty(value)) + return "variable.language"; + else if (builtinFunctions.hasOwnProperty(value) || builtinFunctions.hasOwnProperty(value.substring(1))) + return "support.function"; + else if (value == "debugger") + return "invalid.deprecated"; + else + if(value.match(/^(\$[a-zA-Z_$][a-zA-Z0-9_]*)$/)) + return "variable"; + return "identifier"; + }, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|&|\\*|\\-|\\+|=|!=|<=|>=|<|>|&&|\\|\\|" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ]; + + for (var i in this.$rules) { + this.$rules[i].unshift({ + token: "variable", + regex: "\\${", + push: "vm_start" + }); + } + + this.normalizeRules(); +}; + +oop.inherits(VelocityHighlightRules, TextHighlightRules); + +exports.VelocityHighlightRules = VelocityHighlightRules; +}); + +ace.define("ace/mode/folding/velocity",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "##") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "##") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "##" && next[indent] == "##") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "##" && prev[indent] == "##") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/velocity",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/velocity_highlight_rules","ace/mode/folding/velocity"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var VelocityHighlightRules = require("./velocity_highlight_rules").VelocityHighlightRules; +var FoldMode = require("./folding/velocity").FoldMode; + +var Mode = function() { + HtmlMode.call(this); + this.HighlightRules = VelocityHighlightRules; + this.foldingRules = new FoldMode(); +}; +oop.inherits(Mode, HtmlMode); + +(function() { + this.lineCommentStart = "##"; + this.blockComment = {start: "#*", end: "*#"}; + this.$id = "ace/mode/velocity"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-verilog.js b/htdocs/includes/ace/mode-verilog.js new file mode 100644 index 00000000000..7def13b985c --- /dev/null +++ b/htdocs/includes/ace/mode-verilog.js @@ -0,0 +1,104 @@ +ace.define("ace/mode/verilog_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var VerilogHighlightRules = function() { +var keywords = "always|and|assign|automatic|begin|buf|bufif0|bufif1|case|casex|casez|cell|cmos|config|" + + "deassign|default|defparam|design|disable|edge|else|end|endcase|endconfig|endfunction|endgenerate|endmodule|" + + "endprimitive|endspecify|endtable|endtask|event|for|force|forever|fork|function|generate|genvar|highz0|" + + "highz1|if|ifnone|incdir|include|initial|inout|input|instance|integer|join|large|liblist|library|localparam|" + + "macromodule|medium|module|nand|negedge|nmos|nor|noshowcancelled|not|notif0|notif1|or|output|parameter|pmos|" + + "posedge|primitive|pull0|pull1|pulldown|pullup|pulsestyle_onevent|pulsestyle_ondetect|rcmos|real|realtime|" + + "reg|release|repeat|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|showcancelled|signed|small|specify|specparam|" + + "strong0|strong1|supply0|supply1|table|task|time|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|" + + "unsigned|use|vectored|wait|wand|weak0|weak1|while|wire|wor|xnor|xor" + + "begin|bufif0|bufif1|case|casex|casez|config|else|end|endcase|endconfig|endfunction|" + + "endgenerate|endmodule|endprimitive|endspecify|endtable|endtask|for|forever|function|generate|if|ifnone|" + + "macromodule|module|primitive|repeat|specify|table|task|while"; + + var builtinConstants = ( + "true|false|null" + ); + + var builtinFunctions = ( + "count|min|max|avg|sum|rank|now|coalesce|main" + ); + + var keywordMapper = this.createKeywordMapper({ + "support.function": builtinFunctions, + "keyword": keywords, + "constant.language": builtinConstants + }, "identifier", true); + + this.$rules = { + "start" : [ { + token : "comment", + regex : "//.*$" + }, { + token : "comment.start", + regex : "/\\*", + next : [ + { token : "comment.end", regex : "\\*/", next: "start" }, + { defaultToken : "comment" } + ] + }, { + token : "string", // " string + regex : '".*?"' + }, { + token : "string", // ' string + regex : "'.*?'" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" + }, { + token : "paren.lparen", + regex : "[\\(]" + }, { + token : "paren.rparen", + regex : "[\\)]" + }, { + token : "text", + regex : "\\s+" + } ] + }; + this.normalizeRules(); +}; + +oop.inherits(VerilogHighlightRules, TextHighlightRules); + +exports.VerilogHighlightRules = VerilogHighlightRules; +}); + +ace.define("ace/mode/verilog",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/verilog_highlight_rules","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var VerilogHighlightRules = require("./verilog_highlight_rules").VerilogHighlightRules; +var Range = require("../range").Range; + +var Mode = function() { + this.HighlightRules = VerilogHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.$id = "ace/mode/verilog"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-vhdl.js b/htdocs/includes/ace/mode-vhdl.js new file mode 100644 index 00000000000..41dab579287 --- /dev/null +++ b/htdocs/includes/ace/mode-vhdl.js @@ -0,0 +1,110 @@ +ace.define("ace/mode/vhdl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var VHDLHighlightRules = function() { + + + + var keywords = "access|after|ailas|all|architecture|assert|attribute|"+ + "begin|block|buffer|bus|case|component|configuration|"+ + "disconnect|downto|else|elsif|end|entity|file|for|function|"+ + "generate|generic|guarded|if|impure|in|inertial|inout|is|"+ + "label|linkage|literal|loop|mapnew|next|of|on|open|"+ + "others|out|port|process|pure|range|record|reject|"+ + "report|return|select|shared|subtype|then|to|transport|"+ + "type|unaffected|united|until|wait|when|while|with"; + + var storageType = "bit|bit_vector|boolean|character|integer|line|natural|"+ + "positive|real|register|severity|signal|signed|"+ + "std_logic|std_logic_vector|string||text|time|unsigned|"+ + "variable"; + + var storageModifiers = "array|constant"; + + var keywordOperators = "abs|and|mod|nand|nor|not|rem|rol|ror|sla|sll|sra"+ + "srl|xnor|xor"; + + var builtinConstants = ( + "true|false|null" + ); + + + var keywordMapper = this.createKeywordMapper({ + "keyword.operator": keywordOperators, + "keyword": keywords, + "constant.language": builtinConstants, + "storage.modifier": storageModifiers, + "storage.type": storageType + }, "identifier", true); + + this.$rules = { + "start" : [ { + token : "comment", + regex : "--.*$" + }, { + token : "string", // " string + regex : '".*?"' + }, { + token : "string", // ' string + regex : "'.*?'" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "keyword", // pre-compiler directives + regex : "\\s*(?:library|package|use)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "&|\\*|\\+|\\-|\\/|<|=|>|\\||=>|\\*\\*|:=|\\/=|>=|<=|<>" + }, { + token : "punctuation.operator", + regex : "\\'|\\:|\\,|\\;|\\." + },{ + token : "paren.lparen", + regex : "[[(]" + }, { + token : "paren.rparen", + regex : "[\\])]" + }, { + token : "text", + regex : "\\s+" + } ] + + + }; +}; + +oop.inherits(VHDLHighlightRules, TextHighlightRules); + +exports.VHDLHighlightRules = VHDLHighlightRules; +}); + +ace.define("ace/mode/vhdl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vhdl_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var VHDLHighlightRules = require("./vhdl_highlight_rules").VHDLHighlightRules; + +var Mode = function() { + this.HighlightRules = VHDLHighlightRules; + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "--"; + + this.$id = "ace/mode/vhdl"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/mode-wollok.js b/htdocs/includes/ace/mode-wollok.js new file mode 100644 index 00000000000..22c64ac23f1 --- /dev/null +++ b/htdocs/includes/ace/mode-wollok.js @@ -0,0 +1,905 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var JavaScriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hexadecimal, octal and binary + regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // decimal integers and floats + regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "from(?=\\s*('|\"))" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "storage.type", + regex : /=>/ + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + consumeLineEnd : true + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = require("../worker/worker_client").WorkerClient; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = JavaScriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + this.$quotes = {'"': '"', "'": "'", "`": "`"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/javascript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); + +ace.define("ace/mode/wollok_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var WollokHighlightRules = function() { + var keywords = ( + "test|package|inherits|false|import|else|or|class|and|not|native|override|program|this|try|val|var|catch|object|super|throw|if|null|return|true|new|method" + ); + + var buildinConstants = ("null|assert|console"); + + + var langClasses = ( + "Object|Pair|String|Boolean|Number|Integer|Double|Collection|Set|List|Exception|Range" + + "|StackTraceElement" + ); + + var keywordMapper = this.createKeywordMapper({ + "variable.language": "this", + "keyword": keywords, + "constant.language": buildinConstants, + "support.function": langClasses + }, "identifier"); + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + DocCommentHighlightRules.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // hex + regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/ + }, { + token : "constant.numeric", // float + regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/ + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "===|&&|\\*=|\\.\\.|\\*\\*|#|!|%|\\*|\\?:|\\+|\\/|,|\\+=|\\-|\\.\\.<|!==|:|\\/=|\\?\\.|\\+\\+|>|=|<|>=|=>|==|\\]|\\[|\\-=|\\->|\\||\\-\\-|<>|!=|%=|\\|" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : ".*?\\*\\/", + next : "start" + }, { + token : "comment", // comment spanning whole line + regex : ".+" + } + ] + }; + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("start") ]); +}; + +oop.inherits(WollokHighlightRules, TextHighlightRules); + +exports.WollokHighlightRules = WollokHighlightRules; +}); + +ace.define("ace/mode/wollok",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/wollok_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var JavaScriptMode = require("./javascript").Mode; +var WollokHighlightRules = require("./wollok_highlight_rules").WollokHighlightRules; + +var Mode = function() { + JavaScriptMode.call(this); + this.HighlightRules = WollokHighlightRules; +}; +oop.inherits(Mode, JavaScriptMode); + +(function() { + + this.createWorker = function(session) { + return null; + }; + + this.$id = "ace/mode/wollok"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-xml.js b/htdocs/includes/ace/mode-xml.js new file mode 100644 index 00000000000..f5f840a9b2c --- /dev/null +++ b/htdocs/includes/ace/mode-xml.js @@ -0,0 +1,664 @@ +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var XmlHighlightRules = function(normalize) { + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; + + this.$rules = { + start : [ + {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"}, + { + token : ["punctuation.instruction.xml", "keyword.instruction.xml"], + regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction" + }, + {token : "comment.start.xml", regex : "<\\!--", next : "comment"}, + { + token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"], + regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true + }, + {include : "tag"}, + {token : "text.end-tag-open.xml", regex: "", + next : "start" + }], + + doctype : [ + {include : "whitespace"}, + {include : "string"}, + {token : "xml-pe.doctype.xml", regex : ">", next : "start"}, + {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"}, + {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"} + ], + + int_subset : [{ + token : "text.xml", + regex : "\\s+" + }, { + token: "punctuation.int-subset.xml", + regex: "]", + next: "pop" + }, { + token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"], + regex : "(<\\!)(" + tagRegex + ")", + push : [{ + token : "text", + regex : "\\s+" + }, + { + token : "punctuation.markup-decl.xml", + regex : ">", + next : "pop" + }, + {include : "string"}] + }], + + cdata : [ + {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"}, + {token : "text.xml", regex : "\\s+"}, + {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"} + ], + + comment : [ + {token : "comment.end.xml", regex : "-->", next : "start"}, + {defaultToken : "comment.xml"} + ], + + reference : [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + attr_reference : [{ + token : "constant.language.escape.reference.attribute-value.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }], + + tag : [{ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"], + regex : "(?:(<)|(", next : "start"} + ] + }], + + tag_whitespace : [ + {token : "text.tag-whitespace.xml", regex : "\\s+"} + ], + whitespace : [ + {token : "text.whitespace.xml", regex : "\\s+"} + ], + string: [{ + token : "string.xml", + regex : "'", + push : [ + {token : "string.xml", regex: "'", next: "pop"}, + {defaultToken : "string.xml"} + ] + }, { + token : "string.xml", + regex : '"', + push : [ + {token : "string.xml", regex: '"', next: "pop"}, + {defaultToken : "string.xml"} + ] + }], + + attributes: [{ + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + include: "tag_whitespace" + }, { + include: "attribute_value" + }], + + attribute_value: [{ + token : "string.attribute-value.xml", + regex : "'", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "attr_reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }] + }; + + if (this.constructor === XmlHighlightRules) + this.normalizeRules(); +}; + + +(function() { + + this.embedTagRules = function(HighlightRules, prefix, tag){ + this.$rules.tag.unshift({ + token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(<)(" + tag + "(?=\\s|>|$))", + next: [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} + ] + }); + + this.$rules[tag + "-end"] = [ + {include : "attributes"}, + {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start", + onMatch : function(value, currentState, stack) { + stack.splice(0); + return this.token; + }} + ] + + this.embedRules(HighlightRules, prefix, [{ + token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], + regex : "(|$))", + next: tag + "-end" + }, { + token: "string.cdata.xml", + regex : "<\\!\\[CDATA\\[" + }, { + token: "string.cdata.xml", + regex : "\\]\\]>" + }]); + }; + +}).call(TextHighlightRules.prototype); + +oop.inherits(XmlHighlightRules, TextHighlightRules); + +exports.XmlHighlightRules = XmlHighlightRules; +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === " -1; +} + +(function() { + + this.getFoldWidget = function(session, foldStyle, row) { + var tag = this._getFirstTagInLine(session, row); + + if (!tag) + return this.getCommentFoldWidget(session, row); + + if (tag.closing || (!tag.tagName && tag.selfClosing)) + return foldStyle == "markbeginend" ? "end" : ""; + + if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase())) + return ""; + + if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column)) + return ""; + + return "start"; + }; + + this.getCommentFoldWidget = function(session, row) { + if (/comment/.test(session.getState(row)) && /'; + break; + } + } + return tag; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == '/>'; + return tag; + } + tag.start.column += token.value.length; + } + + return null; + }; + + this._findEndTagInLine = function(session, row, tagName, startColumn) { + var tokens = session.getTokens(row); + var column = 0; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + column += token.value.length; + if (column < startColumn) + continue; + if (is(token, "end-tag-open")) { + token = tokens[i + 1]; + if (token && token.value == tagName) + return true; + } + } + return false; + }; + this._readTagForward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + iterator.stepForward(); + return tag; + } + } while(token = iterator.stepForward()); + + return null; + }; + + this._readTagBackward = function(iterator) { + var token = iterator.getCurrentToken(); + if (!token) + return null; + + var tag = new Tag(); + do { + if (is(token, "tag-open")) { + tag.closing = is(token, "end-tag-open"); + tag.start.row = iterator.getCurrentTokenRow(); + tag.start.column = iterator.getCurrentTokenColumn(); + iterator.stepBackward(); + return tag; + } else if (is(token, "tag-name")) { + tag.tagName = token.value; + } else if (is(token, "tag-close")) { + tag.selfClosing = token.value == "/>"; + tag.end.row = iterator.getCurrentTokenRow(); + tag.end.column = iterator.getCurrentTokenColumn() + token.value.length; + } + } while(token = iterator.stepBackward()); + + return null; + }; + + this._pop = function(stack, tag) { + while (stack.length) { + + var top = stack[stack.length-1]; + if (!tag || top.tagName == tag.tagName) { + return stack.pop(); + } + else if (this.optionalEndTags.hasOwnProperty(top.tagName)) { + stack.pop(); + continue; + } else { + return null; + } + } + }; + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var firstTag = this._getFirstTagInLine(session, row); + + if (!firstTag) { + return this.getCommentFoldWidget(session, row) + && session.getCommentFoldRange(row, session.getLine(row).length); + } + + var isBackward = firstTag.closing || firstTag.selfClosing; + var stack = []; + var tag; + + if (!isBackward) { + var iterator = new TokenIterator(session, row, firstTag.start.column); + var start = { + row: row, + column: firstTag.start.column + firstTag.tagName.length + 2 + }; + if (firstTag.start.row == firstTag.end.row) + start.column = firstTag.end.column; + while (tag = this._readTagForward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) + return Range.fromPoints(start, tag.start); + } + else { + stack.push(tag); + } + } + } + else { + var iterator = new TokenIterator(session, row, firstTag.end.column); + var end = { + row: row, + column: firstTag.start.column + }; + + while (tag = this._readTagBackward(iterator)) { + if (tag.selfClosing) { + if (!stack.length) { + tag.start.column += tag.tagName.length + 2; + tag.end.column -= 2; + return Range.fromPoints(tag.start, tag.end); + } else + continue; + } + + if (!tag.closing) { + this._pop(stack, tag); + if (stack.length == 0) { + tag.start.column += tag.tagName.length + 2; + if (tag.start.row == tag.end.row && tag.start.column < tag.end.column) + tag.start.column = tag.end.column; + return Range.fromPoints(tag.start, end); + } + } + else { + stack.push(tag); + } + } + } + + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); +var TextMode = require("./text").Mode; +var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; +var XmlBehaviour = require("./behaviour/xml").XmlBehaviour; +var XmlFoldMode = require("./folding/xml").FoldMode; +var WorkerClient = require("../worker/worker_client").WorkerClient; + +var Mode = function() { + this.HighlightRules = XmlHighlightRules; + this.$behaviour = new XmlBehaviour(); + this.foldingRules = new XmlFoldMode(); +}; + +oop.inherits(Mode, TextMode); + +(function() { + + this.voidElements = lang.arrayToMap([]); + + this.blockComment = {start: ""}; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker"); + worker.attachToDocument(session.getDocument()); + + worker.on("error", function(e) { + session.setAnnotations(e.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/xml"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-xquery.js b/htdocs/includes/ace/mode-xquery.js new file mode 100644 index 00000000000..3de4ec0938b --- /dev/null +++ b/htdocs/includes/ace/mode-xquery.js @@ -0,0 +1,2631 @@ +ace.define("ace/mode/xquery/xquery_lexer",["require","exports","module"], function(require, exports, module) { +module.exports = (function outer (modules, cache, entry) { + var previousRequire = typeof require == "function" && require; + function newRequire(name, jumped){ + if(!cache[name]) { + if(!modules[name]) { + var currentRequire = typeof require == "function" && require; + if (!jumped && currentRequire) return currentRequire(name, true); + if (previousRequire) return previousRequire(name, true); + var err = new Error('Cannot find module \'' + name + '\''); + err.code = 'MODULE_NOT_FOUND'; + throw err; + } + var m = cache[name] = {exports:{}}; + modules[name][0].call(m.exports, function(x){ + var id = modules[name][1][x]; + return newRequire(id ? id : x); + },m,m.exports,outer,modules,cache,entry); + } + return cache[name].exports; + } + for(var i=0;i= 0 ? XQueryTokenizer.TOKEN[o] : null; + }; + + this.getExpectedTokenSet = function(e) + { + var expected; + if (e.getExpected() < 0) + { + expected = XQueryTokenizer.getTokenSet(- e.getState()); + } + else + { + expected = [XQueryTokenizer.TOKEN[e.getExpected()]]; + } + return expected; + }; + + this.getErrorMessage = function(e) + { + var tokenSet = this.getExpectedTokenSet(e); + var found = this.getOffendingToken(e); + var prefix = input.substring(0, e.getBegin()); + var lines = prefix.split("\n"); + var line = lines.length; + var column = lines[line - 1].length + 1; + var size = e.getEnd() - e.getBegin(); + return e.getMessage() + + (found == null ? "" : ", found " + found) + + "\nwhile expecting " + + (tokenSet.length == 1 ? tokenSet[0] : ("[" + tokenSet.join(", ") + "]")) + + "\n" + + (size == 0 || found != null ? "" : "after successfully scanning " + size + " characters beginning ") + + "at line " + line + ", column " + column + ":\n..." + + input.substring(e.getBegin(), Math.min(input.length, e.getBegin() + 64)) + + "..."; + }; + + this.parse_start = function() + { + eventHandler.startNonterminal("start", e0); + lookahead1W(14); // ModuleDecl | Annotation | OptionDecl | Operator | Variable | Tag | AttrTest | + switch (l1) + { + case 55: // '' | '=' | '>' + switch (l1) + { + case 58: // '>' + shift(58); // '>' + break; + case 50: // '/>' + shift(50); // '/>' + break; + case 27: // QName + shift(27); // QName + break; + case 57: // '=' + shift(57); // '=' + break; + case 35: // '"' + shift(35); // '"' + break; + case 38: // "'" + shift(38); // "'" + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("StartTag", e0); + }; + + this.parse_TagContent = function() + { + eventHandler.startNonterminal("TagContent", e0); + lookahead1(11); // Tag | EndTag | PredefinedEntityRef | ElementContentChar | CharRef | EOF | + switch (l1) + { + case 23: // ElementContentChar + shift(23); // ElementContentChar + break; + case 6: // Tag + shift(6); // Tag + break; + case 7: // EndTag + shift(7); // EndTag + break; + case 55: // '' + switch (l1) + { + case 11: // CDataSectionContents + shift(11); // CDataSectionContents + break; + case 64: // ']]>' + shift(64); // ']]>' + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("CData", e0); + }; + + this.parse_XMLComment = function() + { + eventHandler.startNonterminal("XMLComment", e0); + lookahead1(0); // DirCommentContents | EOF | '-->' + switch (l1) + { + case 9: // DirCommentContents + shift(9); // DirCommentContents + break; + case 47: // '-->' + shift(47); // '-->' + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("XMLComment", e0); + }; + + this.parse_PI = function() + { + eventHandler.startNonterminal("PI", e0); + lookahead1(3); // DirPIContents | EOF | '?' | '?>' + switch (l1) + { + case 10: // DirPIContents + shift(10); // DirPIContents + break; + case 59: // '?' + shift(59); // '?' + break; + case 60: // '?>' + shift(60); // '?>' + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("PI", e0); + }; + + this.parse_Pragma = function() + { + eventHandler.startNonterminal("Pragma", e0); + lookahead1(2); // PragmaContents | EOF | '#' | '#)' + switch (l1) + { + case 8: // PragmaContents + shift(8); // PragmaContents + break; + case 36: // '#' + shift(36); // '#' + break; + case 37: // '#)' + shift(37); // '#)' + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("Pragma", e0); + }; + + this.parse_Comment = function() + { + eventHandler.startNonterminal("Comment", e0); + lookahead1(4); // CommentContents | EOF | '(:' | ':)' + switch (l1) + { + case 52: // ':)' + shift(52); // ':)' + break; + case 41: // '(:' + shift(41); // '(:' + break; + case 30: // CommentContents + shift(30); // CommentContents + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("Comment", e0); + }; + + this.parse_CommentDoc = function() + { + eventHandler.startNonterminal("CommentDoc", e0); + lookahead1(5); // DocTag | DocCommentContents | EOF | '(:' | ':)' + switch (l1) + { + case 31: // DocTag + shift(31); // DocTag + break; + case 32: // DocCommentContents + shift(32); // DocCommentContents + break; + case 52: // ':)' + shift(52); // ':)' + break; + case 41: // '(:' + shift(41); // '(:' + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("CommentDoc", e0); + }; + + this.parse_QuotString = function() + { + eventHandler.startNonterminal("QuotString", e0); + lookahead1(6); // PredefinedEntityRef | EscapeQuot | QuotChar | CharRef | EOF | '"' + switch (l1) + { + case 18: // PredefinedEntityRef + shift(18); // PredefinedEntityRef + break; + case 29: // CharRef + shift(29); // CharRef + break; + case 19: // EscapeQuot + shift(19); // EscapeQuot + break; + case 21: // QuotChar + shift(21); // QuotChar + break; + case 35: // '"' + shift(35); // '"' + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("QuotString", e0); + }; + + this.parse_AposString = function() + { + eventHandler.startNonterminal("AposString", e0); + lookahead1(7); // PredefinedEntityRef | EscapeApos | AposChar | CharRef | EOF | "'" + switch (l1) + { + case 18: // PredefinedEntityRef + shift(18); // PredefinedEntityRef + break; + case 29: // CharRef + shift(29); // CharRef + break; + case 20: // EscapeApos + shift(20); // EscapeApos + break; + case 22: // AposChar + shift(22); // AposChar + break; + case 38: // "'" + shift(38); // "'" + break; + default: + shift(33); // EOF + } + eventHandler.endNonterminal("AposString", e0); + }; + + this.parse_Prefix = function() + { + eventHandler.startNonterminal("Prefix", e0); + lookahead1W(13); // NCName^Token | S^WS | 'after' | 'allowing' | 'ancestor' | 'ancestor-or-self' | + whitespace(); + parse_NCName(); + eventHandler.endNonterminal("Prefix", e0); + }; + + this.parse__EQName = function() + { + eventHandler.startNonterminal("_EQName", e0); + lookahead1W(12); // EQName^Token | S^WS | 'after' | 'allowing' | 'ancestor' | 'ancestor-or-self' | + whitespace(); + parse_EQName(); + eventHandler.endNonterminal("_EQName", e0); + }; + + function parse_EQName() + { + eventHandler.startNonterminal("EQName", e0); + switch (l1) + { + case 77: // 'attribute' + shift(77); // 'attribute' + break; + case 91: // 'comment' + shift(91); // 'comment' + break; + case 115: // 'document-node' + shift(115); // 'document-node' + break; + case 116: // 'element' + shift(116); // 'element' + break; + case 119: // 'empty-sequence' + shift(119); // 'empty-sequence' + break; + case 140: // 'function' + shift(140); // 'function' + break; + case 147: // 'if' + shift(147); // 'if' + break; + case 160: // 'item' + shift(160); // 'item' + break; + case 180: // 'namespace-node' + shift(180); // 'namespace-node' + break; + case 186: // 'node' + shift(186); // 'node' + break; + case 211: // 'processing-instruction' + shift(211); // 'processing-instruction' + break; + case 221: // 'schema-attribute' + shift(221); // 'schema-attribute' + break; + case 222: // 'schema-element' + shift(222); // 'schema-element' + break; + case 238: // 'switch' + shift(238); // 'switch' + break; + case 239: // 'text' + shift(239); // 'text' + break; + case 248: // 'typeswitch' + shift(248); // 'typeswitch' + break; + default: + parse_FunctionName(); + } + eventHandler.endNonterminal("EQName", e0); + } + + function parse_FunctionName() + { + eventHandler.startNonterminal("FunctionName", e0); + switch (l1) + { + case 14: // EQName^Token + shift(14); // EQName^Token + break; + case 65: // 'after' + shift(65); // 'after' + break; + case 68: // 'ancestor' + shift(68); // 'ancestor' + break; + case 69: // 'ancestor-or-self' + shift(69); // 'ancestor-or-self' + break; + case 70: // 'and' + shift(70); // 'and' + break; + case 74: // 'as' + shift(74); // 'as' + break; + case 75: // 'ascending' + shift(75); // 'ascending' + break; + case 79: // 'before' + shift(79); // 'before' + break; + case 83: // 'case' + shift(83); // 'case' + break; + case 84: // 'cast' + shift(84); // 'cast' + break; + case 85: // 'castable' + shift(85); // 'castable' + break; + case 88: // 'child' + shift(88); // 'child' + break; + case 89: // 'collation' + shift(89); // 'collation' + break; + case 98: // 'copy' + shift(98); // 'copy' + break; + case 100: // 'count' + shift(100); // 'count' + break; + case 103: // 'declare' + shift(103); // 'declare' + break; + case 104: // 'default' + shift(104); // 'default' + break; + case 105: // 'delete' + shift(105); // 'delete' + break; + case 106: // 'descendant' + shift(106); // 'descendant' + break; + case 107: // 'descendant-or-self' + shift(107); // 'descendant-or-self' + break; + case 108: // 'descending' + shift(108); // 'descending' + break; + case 113: // 'div' + shift(113); // 'div' + break; + case 114: // 'document' + shift(114); // 'document' + break; + case 117: // 'else' + shift(117); // 'else' + break; + case 118: // 'empty' + shift(118); // 'empty' + break; + case 121: // 'end' + shift(121); // 'end' + break; + case 123: // 'eq' + shift(123); // 'eq' + break; + case 124: // 'every' + shift(124); // 'every' + break; + case 126: // 'except' + shift(126); // 'except' + break; + case 129: // 'first' + shift(129); // 'first' + break; + case 130: // 'following' + shift(130); // 'following' + break; + case 131: // 'following-sibling' + shift(131); // 'following-sibling' + break; + case 132: // 'for' + shift(132); // 'for' + break; + case 141: // 'ge' + shift(141); // 'ge' + break; + case 143: // 'group' + shift(143); // 'group' + break; + case 145: // 'gt' + shift(145); // 'gt' + break; + case 146: // 'idiv' + shift(146); // 'idiv' + break; + case 148: // 'import' + shift(148); // 'import' + break; + case 154: // 'insert' + shift(154); // 'insert' + break; + case 155: // 'instance' + shift(155); // 'instance' + break; + case 157: // 'intersect' + shift(157); // 'intersect' + break; + case 158: // 'into' + shift(158); // 'into' + break; + case 159: // 'is' + shift(159); // 'is' + break; + case 165: // 'last' + shift(165); // 'last' + break; + case 167: // 'le' + shift(167); // 'le' + break; + case 169: // 'let' + shift(169); // 'let' + break; + case 173: // 'lt' + shift(173); // 'lt' + break; + case 175: // 'mod' + shift(175); // 'mod' + break; + case 176: // 'modify' + shift(176); // 'modify' + break; + case 177: // 'module' + shift(177); // 'module' + break; + case 179: // 'namespace' + shift(179); // 'namespace' + break; + case 181: // 'ne' + shift(181); // 'ne' + break; + case 193: // 'only' + shift(193); // 'only' + break; + case 195: // 'or' + shift(195); // 'or' + break; + case 196: // 'order' + shift(196); // 'order' + break; + case 197: // 'ordered' + shift(197); // 'ordered' + break; + case 201: // 'parent' + shift(201); // 'parent' + break; + case 207: // 'preceding' + shift(207); // 'preceding' + break; + case 208: // 'preceding-sibling' + shift(208); // 'preceding-sibling' + break; + case 213: // 'rename' + shift(213); // 'rename' + break; + case 214: // 'replace' + shift(214); // 'replace' + break; + case 215: // 'return' + shift(215); // 'return' + break; + case 219: // 'satisfies' + shift(219); // 'satisfies' + break; + case 224: // 'self' + shift(224); // 'self' + break; + case 230: // 'some' + shift(230); // 'some' + break; + case 231: // 'stable' + shift(231); // 'stable' + break; + case 232: // 'start' + shift(232); // 'start' + break; + case 243: // 'to' + shift(243); // 'to' + break; + case 244: // 'treat' + shift(244); // 'treat' + break; + case 245: // 'try' + shift(245); // 'try' + break; + case 249: // 'union' + shift(249); // 'union' + break; + case 251: // 'unordered' + shift(251); // 'unordered' + break; + case 255: // 'validate' + shift(255); // 'validate' + break; + case 261: // 'where' + shift(261); // 'where' + break; + case 265: // 'with' + shift(265); // 'with' + break; + case 269: // 'xquery' + shift(269); // 'xquery' + break; + case 67: // 'allowing' + shift(67); // 'allowing' + break; + case 76: // 'at' + shift(76); // 'at' + break; + case 78: // 'base-uri' + shift(78); // 'base-uri' + break; + case 80: // 'boundary-space' + shift(80); // 'boundary-space' + break; + case 81: // 'break' + shift(81); // 'break' + break; + case 86: // 'catch' + shift(86); // 'catch' + break; + case 93: // 'construction' + shift(93); // 'construction' + break; + case 96: // 'context' + shift(96); // 'context' + break; + case 97: // 'continue' + shift(97); // 'continue' + break; + case 99: // 'copy-namespaces' + shift(99); // 'copy-namespaces' + break; + case 101: // 'decimal-format' + shift(101); // 'decimal-format' + break; + case 120: // 'encoding' + shift(120); // 'encoding' + break; + case 127: // 'exit' + shift(127); // 'exit' + break; + case 128: // 'external' + shift(128); // 'external' + break; + case 136: // 'ft-option' + shift(136); // 'ft-option' + break; + case 149: // 'in' + shift(149); // 'in' + break; + case 150: // 'index' + shift(150); // 'index' + break; + case 156: // 'integrity' + shift(156); // 'integrity' + break; + case 166: // 'lax' + shift(166); // 'lax' + break; + case 187: // 'nodes' + shift(187); // 'nodes' + break; + case 194: // 'option' + shift(194); // 'option' + break; + case 198: // 'ordering' + shift(198); // 'ordering' + break; + case 217: // 'revalidation' + shift(217); // 'revalidation' + break; + case 220: // 'schema' + shift(220); // 'schema' + break; + case 223: // 'score' + shift(223); // 'score' + break; + case 229: // 'sliding' + shift(229); // 'sliding' + break; + case 235: // 'strict' + shift(235); // 'strict' + break; + case 246: // 'tumbling' + shift(246); // 'tumbling' + break; + case 247: // 'type' + shift(247); // 'type' + break; + case 252: // 'updating' + shift(252); // 'updating' + break; + case 256: // 'value' + shift(256); // 'value' + break; + case 257: // 'variable' + shift(257); // 'variable' + break; + case 258: // 'version' + shift(258); // 'version' + break; + case 262: // 'while' + shift(262); // 'while' + break; + case 92: // 'constraint' + shift(92); // 'constraint' + break; + case 171: // 'loop' + shift(171); // 'loop' + break; + default: + shift(216); // 'returning' + } + eventHandler.endNonterminal("FunctionName", e0); + } + + function parse_NCName() + { + eventHandler.startNonterminal("NCName", e0); + switch (l1) + { + case 26: // NCName^Token + shift(26); // NCName^Token + break; + case 65: // 'after' + shift(65); // 'after' + break; + case 70: // 'and' + shift(70); // 'and' + break; + case 74: // 'as' + shift(74); // 'as' + break; + case 75: // 'ascending' + shift(75); // 'ascending' + break; + case 79: // 'before' + shift(79); // 'before' + break; + case 83: // 'case' + shift(83); // 'case' + break; + case 84: // 'cast' + shift(84); // 'cast' + break; + case 85: // 'castable' + shift(85); // 'castable' + break; + case 89: // 'collation' + shift(89); // 'collation' + break; + case 100: // 'count' + shift(100); // 'count' + break; + case 104: // 'default' + shift(104); // 'default' + break; + case 108: // 'descending' + shift(108); // 'descending' + break; + case 113: // 'div' + shift(113); // 'div' + break; + case 117: // 'else' + shift(117); // 'else' + break; + case 118: // 'empty' + shift(118); // 'empty' + break; + case 121: // 'end' + shift(121); // 'end' + break; + case 123: // 'eq' + shift(123); // 'eq' + break; + case 126: // 'except' + shift(126); // 'except' + break; + case 132: // 'for' + shift(132); // 'for' + break; + case 141: // 'ge' + shift(141); // 'ge' + break; + case 143: // 'group' + shift(143); // 'group' + break; + case 145: // 'gt' + shift(145); // 'gt' + break; + case 146: // 'idiv' + shift(146); // 'idiv' + break; + case 155: // 'instance' + shift(155); // 'instance' + break; + case 157: // 'intersect' + shift(157); // 'intersect' + break; + case 158: // 'into' + shift(158); // 'into' + break; + case 159: // 'is' + shift(159); // 'is' + break; + case 167: // 'le' + shift(167); // 'le' + break; + case 169: // 'let' + shift(169); // 'let' + break; + case 173: // 'lt' + shift(173); // 'lt' + break; + case 175: // 'mod' + shift(175); // 'mod' + break; + case 176: // 'modify' + shift(176); // 'modify' + break; + case 181: // 'ne' + shift(181); // 'ne' + break; + case 193: // 'only' + shift(193); // 'only' + break; + case 195: // 'or' + shift(195); // 'or' + break; + case 196: // 'order' + shift(196); // 'order' + break; + case 215: // 'return' + shift(215); // 'return' + break; + case 219: // 'satisfies' + shift(219); // 'satisfies' + break; + case 231: // 'stable' + shift(231); // 'stable' + break; + case 232: // 'start' + shift(232); // 'start' + break; + case 243: // 'to' + shift(243); // 'to' + break; + case 244: // 'treat' + shift(244); // 'treat' + break; + case 249: // 'union' + shift(249); // 'union' + break; + case 261: // 'where' + shift(261); // 'where' + break; + case 265: // 'with' + shift(265); // 'with' + break; + case 68: // 'ancestor' + shift(68); // 'ancestor' + break; + case 69: // 'ancestor-or-self' + shift(69); // 'ancestor-or-self' + break; + case 77: // 'attribute' + shift(77); // 'attribute' + break; + case 88: // 'child' + shift(88); // 'child' + break; + case 91: // 'comment' + shift(91); // 'comment' + break; + case 98: // 'copy' + shift(98); // 'copy' + break; + case 103: // 'declare' + shift(103); // 'declare' + break; + case 105: // 'delete' + shift(105); // 'delete' + break; + case 106: // 'descendant' + shift(106); // 'descendant' + break; + case 107: // 'descendant-or-self' + shift(107); // 'descendant-or-self' + break; + case 114: // 'document' + shift(114); // 'document' + break; + case 115: // 'document-node' + shift(115); // 'document-node' + break; + case 116: // 'element' + shift(116); // 'element' + break; + case 119: // 'empty-sequence' + shift(119); // 'empty-sequence' + break; + case 124: // 'every' + shift(124); // 'every' + break; + case 129: // 'first' + shift(129); // 'first' + break; + case 130: // 'following' + shift(130); // 'following' + break; + case 131: // 'following-sibling' + shift(131); // 'following-sibling' + break; + case 140: // 'function' + shift(140); // 'function' + break; + case 147: // 'if' + shift(147); // 'if' + break; + case 148: // 'import' + shift(148); // 'import' + break; + case 154: // 'insert' + shift(154); // 'insert' + break; + case 160: // 'item' + shift(160); // 'item' + break; + case 165: // 'last' + shift(165); // 'last' + break; + case 177: // 'module' + shift(177); // 'module' + break; + case 179: // 'namespace' + shift(179); // 'namespace' + break; + case 180: // 'namespace-node' + shift(180); // 'namespace-node' + break; + case 186: // 'node' + shift(186); // 'node' + break; + case 197: // 'ordered' + shift(197); // 'ordered' + break; + case 201: // 'parent' + shift(201); // 'parent' + break; + case 207: // 'preceding' + shift(207); // 'preceding' + break; + case 208: // 'preceding-sibling' + shift(208); // 'preceding-sibling' + break; + case 211: // 'processing-instruction' + shift(211); // 'processing-instruction' + break; + case 213: // 'rename' + shift(213); // 'rename' + break; + case 214: // 'replace' + shift(214); // 'replace' + break; + case 221: // 'schema-attribute' + shift(221); // 'schema-attribute' + break; + case 222: // 'schema-element' + shift(222); // 'schema-element' + break; + case 224: // 'self' + shift(224); // 'self' + break; + case 230: // 'some' + shift(230); // 'some' + break; + case 238: // 'switch' + shift(238); // 'switch' + break; + case 239: // 'text' + shift(239); // 'text' + break; + case 245: // 'try' + shift(245); // 'try' + break; + case 248: // 'typeswitch' + shift(248); // 'typeswitch' + break; + case 251: // 'unordered' + shift(251); // 'unordered' + break; + case 255: // 'validate' + shift(255); // 'validate' + break; + case 257: // 'variable' + shift(257); // 'variable' + break; + case 269: // 'xquery' + shift(269); // 'xquery' + break; + case 67: // 'allowing' + shift(67); // 'allowing' + break; + case 76: // 'at' + shift(76); // 'at' + break; + case 78: // 'base-uri' + shift(78); // 'base-uri' + break; + case 80: // 'boundary-space' + shift(80); // 'boundary-space' + break; + case 81: // 'break' + shift(81); // 'break' + break; + case 86: // 'catch' + shift(86); // 'catch' + break; + case 93: // 'construction' + shift(93); // 'construction' + break; + case 96: // 'context' + shift(96); // 'context' + break; + case 97: // 'continue' + shift(97); // 'continue' + break; + case 99: // 'copy-namespaces' + shift(99); // 'copy-namespaces' + break; + case 101: // 'decimal-format' + shift(101); // 'decimal-format' + break; + case 120: // 'encoding' + shift(120); // 'encoding' + break; + case 127: // 'exit' + shift(127); // 'exit' + break; + case 128: // 'external' + shift(128); // 'external' + break; + case 136: // 'ft-option' + shift(136); // 'ft-option' + break; + case 149: // 'in' + shift(149); // 'in' + break; + case 150: // 'index' + shift(150); // 'index' + break; + case 156: // 'integrity' + shift(156); // 'integrity' + break; + case 166: // 'lax' + shift(166); // 'lax' + break; + case 187: // 'nodes' + shift(187); // 'nodes' + break; + case 194: // 'option' + shift(194); // 'option' + break; + case 198: // 'ordering' + shift(198); // 'ordering' + break; + case 217: // 'revalidation' + shift(217); // 'revalidation' + break; + case 220: // 'schema' + shift(220); // 'schema' + break; + case 223: // 'score' + shift(223); // 'score' + break; + case 229: // 'sliding' + shift(229); // 'sliding' + break; + case 235: // 'strict' + shift(235); // 'strict' + break; + case 246: // 'tumbling' + shift(246); // 'tumbling' + break; + case 247: // 'type' + shift(247); // 'type' + break; + case 252: // 'updating' + shift(252); // 'updating' + break; + case 256: // 'value' + shift(256); // 'value' + break; + case 258: // 'version' + shift(258); // 'version' + break; + case 262: // 'while' + shift(262); // 'while' + break; + case 92: // 'constraint' + shift(92); // 'constraint' + break; + case 171: // 'loop' + shift(171); // 'loop' + break; + default: + shift(216); // 'returning' + } + eventHandler.endNonterminal("NCName", e0); + } + + function shift(t) + { + if (l1 == t) + { + whitespace(); + eventHandler.terminal(XQueryTokenizer.TOKEN[l1], b1, e1 > size ? size : e1); + b0 = b1; e0 = e1; l1 = 0; + } + else + { + error(b1, e1, 0, l1, t); + } + } + + function whitespace() + { + if (e0 != b1) + { + b0 = e0; + e0 = b1; + eventHandler.whitespace(b0, e0); + } + } + + function matchW(set) + { + var code; + for (;;) + { + code = match(set); + if (code != 28) // S^WS + { + break; + } + } + return code; + } + + function lookahead1W(set) + { + if (l1 == 0) + { + l1 = matchW(set); + b1 = begin; + e1 = end; + } + } + + function lookahead1(set) + { + if (l1 == 0) + { + l1 = match(set); + b1 = begin; + e1 = end; + } + } + + function error(b, e, s, l, t) + { + throw new self.ParseException(b, e, s, l, t); + } + + var lk, b0, e0; + var l1, b1, e1; + var eventHandler; + + var input; + var size; + var begin; + var end; + + function match(tokenSetId) + { + var nonbmp = false; + begin = end; + var current = end; + var result = XQueryTokenizer.INITIAL[tokenSetId]; + var state = 0; + + for (var code = result & 4095; code != 0; ) + { + var charclass; + var c0 = current < size ? input.charCodeAt(current) : 0; + ++current; + if (c0 < 0x80) + { + charclass = XQueryTokenizer.MAP0[c0]; + } + else if (c0 < 0xd800) + { + var c1 = c0 >> 4; + charclass = XQueryTokenizer.MAP1[(c0 & 15) + XQueryTokenizer.MAP1[(c1 & 31) + XQueryTokenizer.MAP1[c1 >> 5]]]; + } + else + { + if (c0 < 0xdc00) + { + var c1 = current < size ? input.charCodeAt(current) : 0; + if (c1 >= 0xdc00 && c1 < 0xe000) + { + ++current; + c0 = ((c0 & 0x3ff) << 10) + (c1 & 0x3ff) + 0x10000; + nonbmp = true; + } + } + var lo = 0, hi = 5; + for (var m = 3; ; m = (hi + lo) >> 1) + { + if (XQueryTokenizer.MAP2[m] > c0) hi = m - 1; + else if (XQueryTokenizer.MAP2[6 + m] < c0) lo = m + 1; + else {charclass = XQueryTokenizer.MAP2[12 + m]; break;} + if (lo > hi) {charclass = 0; break;} + } + } + + state = code; + var i0 = (charclass << 12) + code - 1; + code = XQueryTokenizer.TRANSITION[(i0 & 15) + XQueryTokenizer.TRANSITION[i0 >> 4]]; + + if (code > 4095) + { + result = code; + code &= 4095; + end = current; + } + } + + result >>= 12; + if (result == 0) + { + end = current - 1; + var c1 = end < size ? input.charCodeAt(end) : 0; + if (c1 >= 0xdc00 && c1 < 0xe000) --end; + return error(begin, end, state, -1, -1); + } + + if (nonbmp) + { + for (var i = result >> 9; i > 0; --i) + { + --end; + var c1 = end < size ? input.charCodeAt(end) : 0; + if (c1 >= 0xdc00 && c1 < 0xe000) --end; + } + } + else + { + end -= result >> 9; + } + + return (result & 511) - 1; + } +} + +XQueryTokenizer.getTokenSet = function(tokenSetId) +{ + var set = []; + var s = tokenSetId < 0 ? - tokenSetId : INITIAL[tokenSetId] & 4095; + for (var i = 0; i < 276; i += 32) + { + var j = i; + var i0 = (i >> 5) * 2062 + s - 1; + var i1 = i0 >> 2; + var i2 = i1 >> 2; + var f = XQueryTokenizer.EXPECTED[(i0 & 3) + XQueryTokenizer.EXPECTED[(i1 & 3) + XQueryTokenizer.EXPECTED[(i2 & 3) + XQueryTokenizer.EXPECTED[i2 >> 2]]]]; + for ( ; f != 0; f >>>= 1, ++j) + { + if ((f & 1) != 0) + { + set.push(XQueryTokenizer.TOKEN[j]); + } + } + } + return set; +}; + +XQueryTokenizer.MAP0 = +[ 66, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, 33, 31, 31, 31, 31, 31, 31, 34, 35, 36, 35, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 31, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 31, 61, 62, 63, 64, 35 +]; + +XQueryTokenizer.MAP1 = +[ 108, 124, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 156, 181, 181, 181, 181, 181, 214, 215, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 247, 261, 277, 293, 309, 347, 363, 379, 416, 416, 416, 408, 331, 323, 331, 323, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 433, 433, 433, 433, 433, 433, 433, 316, 331, 331, 331, 331, 331, 331, 331, 331, 394, 416, 416, 417, 415, 416, 416, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 330, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 416, 66, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 35, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, 33, 31, 31, 31, 31, 31, 31, 34, 35, 36, 35, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 31, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 31, 61, 62, 63, 64, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 31, 31, 35, 35, 35, 35, 35, 35, 35, 65, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65 +]; + +XQueryTokenizer.MAP2 = +[ 57344, 63744, 64976, 65008, 65536, 983040, 63743, 64975, 65007, 65533, 983039, 1114111, 35, 31, 35, 31, 31, 35 +]; + +XQueryTokenizer.INITIAL = +[ 1, 2, 36867, 45060, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 +]; + +XQueryTokenizer.TRANSITION = +[ 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22908, 18836, 17152, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 17365, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 17470, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 18157, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 17848, 17880, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18023, 36545, 18621, 18039, 18056, 18072, 18117, 18143, 18173, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17687, 18805, 18421, 18437, 18101, 17393, 18489, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18579, 21711, 17152, 19008, 19233, 20367, 19008, 28684, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 17365, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 17470, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 18157, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 17848, 17880, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18023, 36545, 18621, 18039, 18056, 18072, 18117, 18143, 18173, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17687, 18805, 18421, 18437, 18101, 17393, 18489, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 20116, 18836, 18637, 19008, 19233, 21267, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18763, 18778, 18794, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 18821, 22923, 18906, 19008, 19233, 17431, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18937, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 19054, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 18953, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21843, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21696, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22429, 20131, 18720, 19008, 19233, 20367, 19008, 17173, 23559, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 18087, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 21242, 19111, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19024, 18836, 18609, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19081, 22444, 18987, 19008, 19233, 20367, 19008, 19065, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21992, 22007, 18987, 19008, 19233, 20367, 19008, 18690, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22414, 18836, 18987, 19008, 19233, 30651, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 19138, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 19280, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 19172, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21783, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 19218, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21651, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 19249, 19265, 19307, 18888, 27857, 30536, 24401, 31444, 23357, 18888, 19351, 18888, 18890, 27211, 19370, 27211, 27211, 19392, 24401, 31911, 24401, 24401, 25467, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 28537, 19440, 24401, 24401, 24401, 24401, 24036, 17994, 24060, 18888, 18888, 18888, 18890, 19468, 27211, 27211, 27211, 27211, 19484, 35367, 19520, 24401, 24401, 24401, 19628, 18888, 29855, 18888, 18888, 23086, 27211, 19538, 27211, 27211, 30756, 24012, 24401, 19560, 24401, 24401, 26750, 18888, 18888, 19327, 27855, 27211, 27211, 19580, 17590, 24017, 24401, 24401, 19600, 25665, 18888, 18888, 28518, 27211, 27212, 24016, 19620, 19868, 28435, 25722, 18889, 19644, 27211, 32888, 35852, 19868, 31018, 19694, 19376, 19717, 22215, 19735, 22098, 19751, 35203, 19776, 19797, 19817, 19840, 25783, 31738, 24135, 19701, 19856, 31015, 23516, 31008, 28311, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21768, 18836, 19307, 18888, 27857, 27904, 24401, 29183, 28015, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 19888, 24401, 24401, 24401, 24401, 22953, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 28537, 19440, 24401, 24401, 24401, 24401, 24036, 18881, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22399, 18836, 19918, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21666, 18836, 19307, 18888, 27857, 27525, 24401, 29183, 21467, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 19946, 24401, 24401, 24401, 24401, 32382, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 28537, 19998, 24401, 24401, 24401, 24401, 31500, 18467, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 20021, 24401, 24401, 24401, 24401, 24401, 34271, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 32926, 29908, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 20050, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 20101, 19039, 20191, 20412, 20903, 17569, 20309, 20872, 25633, 20623, 20505, 20218, 20242, 17189, 17208, 17281, 20355, 20265, 20306, 20328, 20383, 22490, 20796, 20619, 21354, 20654, 20410, 20956, 21232, 20765, 17421, 20535, 17192, 18127, 22459, 20312, 25531, 22470, 20309, 20428, 18964, 20466, 20491, 21342, 21070, 20521, 20682, 17714, 18326, 17543, 17559, 17585, 22497, 20559, 19504, 20279, 20575, 20290, 20475, 20604, 20639, 20226, 20670, 17661, 21190, 17703, 21176, 17730, 19494, 20698, 20711, 22480, 21046, 21116, 18971, 21130, 20727, 20755, 17675, 17753, 17832, 17590, 25518, 20394, 20781, 20831, 20202, 20847, 21401, 17292, 17934, 17979, 18549, 20863, 20588, 25542, 20888, 20919, 18072, 18117, 20935, 20972, 21032, 21062, 21086, 18239, 21102, 18563, 21146, 21162, 21206, 18351, 20949, 20902, 18340, 21222, 21258, 21283, 18360, 20249, 17405, 21295, 21311, 21327, 20739, 20343, 21370, 21386, 21417, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21977, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 21452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 21504, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 36501, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 28674, 21946, 17617, 36473, 18223, 17237, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 21575, 21534, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 21560, 30628, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21798, 18836, 21612, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21636, 18836, 18987, 19008, 19233, 17902, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21753, 19096, 21903, 19008, 19233, 20367, 19008, 19291, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 17379, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 21931, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 18280, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21962, 18594, 18987, 19008, 19233, 22043, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21681, 21858, 18987, 19008, 19233, 20367, 19008, 21544, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 31500, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 32319, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 22231, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 31500, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 31678, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 31500, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 33588, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 35019, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22248, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 31500, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 21431, 24401, 24401, 24401, 24401, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22324, 18836, 22059, 18888, 27857, 30501, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 34365, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22354, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 27086, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 19930, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21828, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22309, 22513, 18987, 19008, 19233, 20367, 19008, 19122, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 22544, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22608, 18836, 22988, 23004, 27585, 23020, 23036, 23067, 22087, 18888, 18888, 18888, 23083, 27211, 27211, 27211, 23102, 22121, 24401, 24401, 24401, 23122, 31386, 26154, 19674, 18888, 28119, 28232, 19424, 23705, 27211, 27211, 23142, 23173, 23189, 23212, 24401, 24401, 23246, 34427, 31693, 23262, 18888, 23290, 23308, 27783, 27620, 23327, 35263, 35107, 33383, 23346, 18193, 23393, 32748, 23968, 24401, 23414, 35153, 23463, 18888, 33913, 23442, 23482, 27211, 27211, 23532, 23552, 21431, 23575, 24401, 24401, 23604, 26095, 23635, 23657, 18888, 33482, 23685, 33251, 27211, 22187, 18851, 23721, 35536, 24401, 18887, 23750, 32641, 27211, 23769, 23787, 20080, 33012, 24384, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 23803, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 28224, 31826, 23823, 26917, 34978, 23850, 26493, 25782, 23878, 23914, 23516, 31008, 22105, 19419, 27963, 19659, 29781, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22623, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 28909, 25783, 27211, 27211, 27211, 34048, 23933, 22164, 24401, 24401, 24401, 28409, 23949, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 31181, 26583, 18888, 18888, 18888, 35585, 23984, 27211, 27211, 27211, 24005, 22201, 24033, 24401, 24401, 24401, 24052, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 26496, 24076, 24126, 24151, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22638, 18836, 22059, 19678, 27857, 24185, 24401, 24201, 24217, 26592, 18888, 18888, 18890, 24252, 24268, 27211, 27211, 22121, 24287, 24303, 24401, 24401, 30613, 19781, 35432, 36007, 32649, 18888, 25783, 24322, 28966, 23771, 27211, 35072, 22164, 24358, 32106, 26829, 24400, 31500, 31693, 18888, 18888, 18888, 24801, 18890, 27211, 27211, 27211, 27211, 24418, 19484, 24401, 24401, 24401, 24401, 20167, 31181, 18888, 18888, 18888, 27833, 23086, 27211, 27211, 33540, 27211, 30756, 21431, 24401, 24401, 22972, 24401, 26095, 18888, 36131, 18888, 27855, 27211, 24440, 27211, 22187, 22968, 24401, 24459, 24401, 31699, 28454, 18888, 34528, 34570, 35779, 24478, 24402, 24494, 25659, 18888, 36228, 27211, 27211, 24515, 30981, 23734, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 24538, 31017, 27856, 31741, 30059, 23377, 24563, 19837, 25782, 19760, 31015, 23516, 25374, 22105, 19419, 29793, 24579, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22653, 18836, 22059, 25756, 19982, 34097, 23196, 29183, 24614, 24110, 23641, 24673, 26103, 24697, 24443, 24713, 28558, 22121, 24748, 24462, 24764, 23398, 30613, 18888, 18888, 18888, 18888, 24798, 25783, 27211, 27211, 27211, 34232, 35072, 22164, 24401, 24401, 24401, 33302, 31500, 22559, 24106, 24232, 18888, 18888, 34970, 24817, 30411, 27211, 27211, 32484, 19484, 29750, 35127, 24401, 24401, 19872, 31181, 24852, 18888, 18888, 24871, 29221, 27211, 27211, 32072, 27211, 30756, 34441, 24401, 24401, 31571, 24401, 26095, 33141, 27802, 27011, 27855, 25295, 25607, 24888, 22187, 22968, 19195, 34593, 24906, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 18888, 33663, 27211, 27211, 24924, 24947, 23588, 31018, 18890, 27211, 31833, 22135, 19447, 23086, 23330, 19828, 30904, 31042, 24972, 19840, 25000, 31738, 30898, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 25016, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22668, 18836, 25041, 25057, 31320, 25073, 25089, 25105, 22087, 34796, 24236, 36138, 34870, 34125, 25121, 23106, 35497, 22248, 36613, 25137, 30671, 27365, 30613, 25153, 26447, 25199, 25233, 22574, 23274, 25249, 25265, 25281, 25318, 25344, 25360, 25400, 25428, 25452, 26731, 25504, 31693, 23669, 25558, 27407, 25575, 28599, 25934, 25599, 27211, 28180, 27304, 25623, 25839, 25649, 24401, 34820, 25681, 25698, 22586, 27775, 30190, 25745, 25778, 25799, 25817, 28995, 33569, 30756, 21518, 33443, 25837, 25855, 25893, 26095, 31254, 26677, 30136, 27855, 25930, 25950, 27211, 22187, 22968, 25966, 25986, 24401, 23428, 27763, 36330, 26959, 26002, 26029, 26045, 26085, 26119, 26170, 26203, 26222, 26239, 30527, 26372, 26274, 28404, 31018, 33757, 27211, 34262, 26316, 36729, 26345, 26366, 35337, 31017, 26388, 26407, 30954, 26350, 33861, 26434, 26463, 26479, 26512, 23516, 33189, 26531, 26547, 27963, 31293, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22683, 18836, 26568, 26181, 26608, 34097, 26643, 29183, 22087, 26669, 18888, 18888, 18890, 26693, 27211, 27211, 27211, 22121, 26720, 24401, 24401, 24401, 30613, 18888, 18888, 18888, 18888, 26774, 25783, 27211, 27211, 27211, 26619, 35072, 22164, 24401, 24401, 24401, 21596, 31500, 31693, 18888, 18888, 33978, 18888, 18890, 27211, 27211, 25801, 27211, 27211, 19484, 24401, 24401, 24401, 26792, 24401, 31181, 18888, 18888, 18888, 35464, 23086, 27211, 27211, 27211, 26809, 30756, 21431, 24401, 24401, 24401, 26828, 26095, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 22187, 22968, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 35779, 20080, 24402, 19868, 25659, 31948, 18889, 35707, 27211, 19719, 26845, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 26905, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 24984, 31088, 19419, 26945, 27651, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22698, 18836, 26999, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 23051, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 27033, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 27056, 18888, 18890, 27211, 27211, 30320, 27211, 27211, 27075, 24401, 24401, 29032, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 33986, 27855, 27211, 27211, 27102, 17590, 24017, 24401, 24401, 27123, 27144, 36254, 27162, 27210, 27228, 28500, 18187, 34842, 33426, 27244, 35980, 27277, 27302, 27320, 36048, 34013, 20999, 31882, 21478, 27895, 27356, 30287, 27381, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 26329, 30087, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 27406, 27423, 27445, 35294, 27461, 22087, 18888, 18888, 30140, 18890, 27211, 27211, 27989, 27211, 22121, 24401, 24401, 25682, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 34042, 27211, 27211, 27211, 27211, 29700, 22164, 24401, 24401, 24401, 24401, 27128, 31693, 27477, 18888, 18888, 18888, 18890, 27194, 27211, 27211, 27211, 27211, 19484, 35299, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 27059, 23086, 27211, 27211, 27211, 33366, 30756, 24012, 24401, 24401, 24401, 35044, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 20815, 27211, 30818, 19960, 33969, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22713, 18836, 22059, 27496, 27516, 27541, 35231, 27557, 22087, 29662, 26292, 23292, 27573, 24836, 27601, 27211, 27636, 22121, 35544, 27686, 24401, 27721, 18866, 18888, 27799, 18888, 27818, 22071, 27853, 32260, 27211, 26013, 27873, 27920, 22164, 29419, 24401, 29946, 33413, 26742, 27751, 26881, 18888, 18888, 27261, 36776, 27936, 27211, 27211, 27211, 27988, 28005, 28031, 28052, 24401, 24401, 28069, 28088, 28135, 25488, 28152, 26069, 28167, 27211, 28340, 24657, 28196, 30756, 31523, 24401, 28212, 34176, 36174, 24956, 28248, 28266, 28290, 21488, 33077, 28327, 28356, 17590, 20986, 23126, 28391, 28425, 28102, 28451, 28470, 28490, 28516, 28534, 20034, 33728, 25868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 30241, 28274, 28553, 28574, 19406, 28590, 23086, 23330, 19828, 19452, 28615, 28660, 26147, 25783, 31738, 19837, 25782, 19760, 29613, 35958, 29276, 22105, 19419, 27963, 23157, 28700, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 18888, 27857, 34097, 24401, 29183, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 22528, 18888, 18888, 18888, 18888, 18890, 27333, 27211, 27211, 27211, 27211, 19484, 30853, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22728, 18836, 28747, 28782, 28817, 28841, 28857, 28880, 28896, 24161, 28943, 32011, 36261, 27340, 28961, 29492, 28982, 29011, 24522, 29027, 25436, 29048, 23051, 27500, 29090, 29110, 30713, 18888, 23512, 29130, 25183, 27211, 29155, 28927, 27033, 29173, 23230, 24401, 29199, 35373, 31693, 18888, 18888, 25583, 32629, 29218, 27211, 27211, 31461, 30692, 29237, 27075, 24401, 24401, 24401, 29262, 29302, 19628, 18888, 34329, 18888, 18888, 23086, 27211, 29329, 27211, 27211, 30756, 24012, 35933, 24401, 24401, 24401, 27705, 31612, 18888, 18888, 29346, 29374, 27211, 35650, 17590, 21436, 29393, 24401, 25970, 18887, 33895, 18888, 27211, 32528, 27212, 24016, 32769, 19868, 25659, 18888, 26889, 27211, 27211, 29412, 23889, 24371, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31768, 19840, 25783, 31738, 19837, 29435, 29508, 31102, 29550, 29606, 22105, 30300, 29462, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22743, 18836, 22059, 29629, 29473, 34097, 33285, 29183, 29651, 27254, 18888, 29678, 33329, 32535, 27211, 29694, 29716, 22121, 19202, 24401, 32742, 29741, 18866, 26776, 33921, 28474, 18888, 18888, 25783, 29766, 27211, 29809, 27211, 35072, 22164, 35825, 24401, 29828, 24401, 24036, 36769, 25217, 18888, 18888, 29848, 18890, 27211, 29871, 27211, 26258, 27211, 29894, 24401, 29929, 24401, 36587, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 29725, 29962, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18473, 18888, 18888, 19584, 27211, 27212, 24016, 29982, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19902, 19447, 32052, 19544, 19828, 29998, 30097, 30031, 19840, 25783, 30047, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 30075, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22758, 18836, 30121, 30156, 30206, 30257, 30273, 30336, 22087, 35624, 32837, 25762, 18890, 29878, 34934, 26812, 27211, 22121, 24931, 23223, 29202, 24401, 18866, 34373, 30352, 18888, 18888, 18888, 23447, 24828, 27211, 27211, 27211, 35072, 30370, 35052, 24401, 24401, 24401, 24036, 29523, 18888, 18888, 27146, 18888, 31308, 30386, 27211, 27211, 30405, 30558, 19484, 30427, 24401, 24401, 29938, 35686, 19628, 28766, 30447, 34506, 35614, 23086, 28731, 30482, 30517, 30552, 30756, 24012, 20156, 30574, 30598, 30667, 26283, 33464, 28945, 27670, 30687, 32915, 33504, 25328, 17590, 23963, 20450, 33837, 21016, 32397, 26300, 30708, 30729, 27885, 30748, 21588, 36373, 30779, 26653, 24628, 33220, 32514, 30806, 31835, 25412, 25906, 26515, 18890, 28825, 31833, 26133, 19447, 28304, 31730, 23834, 26057, 30869, 30885, 32181, 30920, 30942, 32797, 25782, 30970, 31015, 23516, 31008, 30997, 31034, 27963, 19659, 29450, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22773, 18836, 31058, 31074, 32463, 31125, 31141, 31197, 22087, 18888, 29534, 35471, 36738, 27211, 24342, 31213, 24424, 22121, 24401, 20175, 31229, 31917, 27736, 31245, 34334, 27175, 18888, 29094, 27286, 27211, 31278, 31336, 27211, 31355, 31371, 24401, 31402, 31418, 24401, 31437, 31693, 18888, 31619, 32841, 18888, 18890, 27211, 27211, 31460, 31477, 27211, 19484, 24401, 24401, 31497, 36581, 24401, 33020, 18888, 18888, 18888, 18888, 30007, 27211, 27211, 27211, 27211, 31516, 32310, 24401, 24401, 24401, 24401, 31539, 18888, 28762, 18888, 24651, 35740, 27211, 27211, 28644, 31565, 35796, 24401, 24401, 19318, 32188, 18888, 24334, 28366, 27212, 29966, 29832, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 31587, 19868, 31635, 32435, 33693, 30105, 31663, 20005, 31715, 31757, 31784, 31812, 30015, 31851, 31878, 25783, 31898, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 31933, 30221, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22788, 18836, 22059, 25729, 30466, 31968, 24306, 31984, 32000, 32807, 35160, 27017, 29590, 34941, 19801, 29377, 33700, 22121, 27040, 30431, 29396, 28864, 29565, 18888, 18888, 18888, 32027, 18888, 25783, 27211, 27211, 23698, 27211, 35072, 22164, 24401, 24401, 30845, 24401, 24036, 32045, 18888, 26929, 18888, 18888, 18890, 27211, 31481, 32068, 27211, 27211, 32088, 24401, 33058, 32122, 24401, 24401, 33736, 18888, 18888, 33162, 18888, 23086, 27211, 27211, 29484, 27211, 28375, 32144, 24401, 24401, 33831, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 36704, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 33107, 22171, 33224, 24271, 32169, 31017, 27856, 31741, 19840, 25783, 31738, 30234, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 32204, 32232, 32252, 32677, 33295, 29074, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 23619, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 32276, 24401, 24401, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 32299, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 33886, 18889, 36065, 27211, 19719, 35326, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22803, 18836, 32335, 31647, 34666, 32351, 32367, 32417, 22087, 18888, 32433, 19335, 32451, 27211, 32479, 27107, 32500, 22121, 24401, 32551, 20085, 32572, 18866, 22287, 23753, 18888, 18888, 32602, 32665, 27211, 32693, 27211, 26972, 32713, 32729, 24401, 32764, 24401, 25877, 32785, 34768, 18888, 27390, 32823, 24594, 24855, 32857, 24890, 32878, 32904, 27211, 32942, 32977, 24401, 33000, 29313, 24401, 30790, 26206, 27666, 33904, 18888, 23086, 36353, 27211, 33036, 27211, 30756, 24012, 32153, 24401, 33056, 24401, 35861, 18888, 18888, 30354, 27972, 27211, 27211, 33800, 17590, 20145, 24401, 24401, 34638, 20811, 18888, 18888, 33074, 27211, 27212, 36167, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 34616, 24169, 33093, 33123, 33157, 27856, 31741, 23862, 26552, 34302, 19837, 25782, 19760, 31015, 23516, 31008, 33178, 19973, 27963, 23497, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22818, 18836, 33205, 28113, 33240, 34097, 33275, 29183, 22087, 33318, 35438, 18888, 18890, 33345, 26391, 33382, 27211, 22121, 33399, 28072, 33442, 24401, 18866, 22232, 18888, 33459, 18888, 18888, 33480, 33498, 25175, 27211, 27211, 26704, 22164, 24775, 35239, 24401, 24401, 25914, 29580, 18888, 18888, 31109, 25211, 33520, 33539, 27211, 27211, 33556, 36284, 19484, 33585, 24401, 24401, 33604, 32556, 19628, 18888, 18888, 31262, 33658, 23086, 27211, 27211, 33679, 27211, 30756, 24012, 24401, 24401, 33716, 24401, 26854, 27480, 18888, 33752, 27855, 33259, 34701, 27211, 17590, 32102, 24782, 23807, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 33773, 36105, 19868, 25659, 18888, 23368, 27211, 29157, 19719, 23889, 34454, 29286, 18890, 33794, 25302, 33816, 19447, 34079, 33853, 31862, 31017, 27856, 31741, 33877, 28920, 33937, 19837, 30461, 34002, 22276, 36041, 34029, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22833, 18836, 34064, 32616, 34113, 34141, 34157, 34192, 34208, 32216, 36013, 31549, 31952, 34224, 34248, 34287, 29330, 34350, 34389, 34413, 34481, 26793, 18866, 26187, 29635, 22293, 18888, 36654, 25783, 34522, 34544, 34566, 25821, 35072, 22164, 34586, 34609, 34632, 19604, 24036, 36644, 36674, 24681, 18888, 32401, 34654, 31339, 34682, 34698, 27211, 34717, 34753, 28053, 34812, 34836, 24401, 33619, 19628, 34858, 32236, 34906, 24598, 33523, 27612, 34890, 34922, 24732, 29246, 36717, 33634, 34465, 32984, 34168, 26750, 34957, 18888, 18888, 34994, 35010, 27211, 33040, 17590, 29913, 35035, 24401, 36304, 25482, 30171, 35883, 35068, 35088, 26627, 20441, 31173, 35123, 35143, 35176, 24640, 30492, 29358, 19719, 35192, 35219, 25384, 28801, 35255, 35279, 32586, 34496, 23086, 23330, 29061, 31017, 27856, 31741, 19840, 25783, 31738, 24547, 25164, 35315, 31796, 35353, 34316, 22105, 19419, 27963, 24091, 28630, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22848, 18836, 22059, 34782, 34088, 35389, 21008, 35405, 35421, 35454, 18888, 18888, 23466, 35487, 27211, 27211, 27211, 35513, 31154, 24401, 24401, 24401, 35560, 18888, 26863, 36664, 35601, 24872, 25783, 30389, 23536, 26250, 35647, 35666, 22164, 19522, 19564, 30582, 35682, 27697, 35575, 29114, 18888, 18888, 18888, 18890, 27211, 35702, 27211, 27211, 27211, 35723, 24401, 35527, 24401, 24401, 24401, 19628, 30184, 18888, 18888, 18888, 23086, 35739, 27211, 27211, 27211, 29139, 22938, 24401, 24401, 24401, 24401, 23898, 35756, 18888, 18888, 25025, 35778, 27211, 27211, 17590, 20064, 35795, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 23917, 18890, 34550, 31833, 22262, 19447, 23086, 23330, 26418, 31017, 27856, 31741, 19840, 25783, 35812, 19837, 27187, 35841, 33135, 23516, 31008, 22105, 22148, 28712, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22863, 18836, 22059, 35877, 28723, 34097, 31164, 29183, 22087, 26758, 18888, 22592, 18890, 23989, 27211, 29812, 27211, 22121, 33778, 24401, 31421, 24401, 18866, 18888, 18888, 26872, 18888, 18888, 25783, 27211, 30732, 27211, 27211, 35072, 22164, 24401, 24908, 24401, 24401, 24036, 31693, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22878, 18836, 22059, 27837, 27857, 35899, 24401, 35915, 22087, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 22121, 24401, 24401, 24401, 24401, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 31602, 18888, 18888, 18888, 18888, 26223, 27211, 27211, 27211, 27211, 27211, 19484, 35931, 24401, 24401, 24401, 24401, 19628, 18888, 28136, 18888, 18888, 35949, 27211, 32862, 27211, 32697, 30756, 24012, 24401, 32283, 24401, 32128, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22893, 18836, 22059, 35974, 34882, 34097, 33960, 29183, 35996, 18888, 23311, 18888, 36029, 27211, 27211, 36064, 36081, 22121, 24401, 24401, 36104, 33950, 18866, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 35072, 22164, 24401, 24401, 24401, 24401, 24036, 36121, 18888, 25559, 18888, 18888, 18890, 27211, 27211, 30313, 27211, 27211, 36154, 24401, 24401, 34397, 24401, 24401, 19628, 28250, 18888, 18888, 18888, 23086, 30926, 27211, 27211, 27211, 26983, 24012, 33642, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22339, 18836, 22059, 19354, 27857, 36190, 24401, 36206, 22087, 18888, 18888, 18888, 18007, 27211, 27211, 27211, 24724, 22121, 24401, 24401, 24401, 30827, 18866, 18888, 36222, 18888, 28795, 18888, 25783, 35100, 27211, 27429, 27211, 35072, 22164, 30836, 24401, 24499, 24401, 24036, 31693, 18888, 36244, 18888, 18888, 18890, 27211, 36088, 27211, 27211, 27211, 19484, 24401, 28036, 24401, 24401, 24401, 19628, 18888, 18888, 35631, 18888, 35762, 27211, 27211, 36277, 27211, 34730, 24012, 24401, 24401, 36300, 24401, 36320, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 25712, 18888, 18888, 36346, 27211, 27212, 19184, 24402, 19868, 25659, 32029, 18889, 27211, 33359, 19719, 23889, 36369, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22384, 18836, 36389, 19008, 19233, 20367, 36434, 17173, 17595, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 36453, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 20362, 21726, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 22369, 18836, 18987, 19008, 19233, 20367, 19008, 21737, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17949, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21813, 18836, 36489, 19008, 19233, 20367, 19008, 17173, 17737, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17768, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 20543, 22022, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21828, 18836, 18987, 19008, 19233, 20367, 19008, 17173, 30763, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 36517, 17308, 17327, 17346, 18918, 18452, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 18127, 21873, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 21828, 18836, 19307, 18888, 27857, 30756, 24401, 29183, 28015, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 36567, 24401, 24401, 24401, 24401, 22953, 18888, 18888, 18888, 18888, 18888, 25783, 27211, 27211, 27211, 27211, 28537, 36603, 24401, 24401, 24401, 24401, 24036, 18881, 18888, 18888, 18888, 18888, 18890, 27211, 27211, 27211, 27211, 27211, 19484, 24401, 24401, 24401, 24401, 24401, 19628, 18888, 18888, 18888, 18888, 23086, 27211, 27211, 27211, 27211, 30756, 24012, 24401, 24401, 24401, 24401, 26750, 18888, 18888, 18888, 27855, 27211, 27211, 27211, 17590, 24017, 24401, 24401, 24401, 18887, 18888, 18888, 27211, 27211, 27212, 24016, 24402, 19868, 25659, 18888, 18889, 27211, 27211, 19719, 23889, 19868, 31018, 18890, 27211, 31833, 19406, 19447, 23086, 23330, 19828, 31017, 27856, 31741, 19840, 25783, 31738, 19837, 25782, 19760, 31015, 23516, 31008, 22105, 19419, 27963, 19659, 27951, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 36629, 36690, 18720, 19008, 19233, 20367, 19008, 17454, 17595, 36437, 17330, 17349, 18921, 17189, 17208, 17281, 20355, 17223, 17308, 17327, 17346, 18918, 36754, 21880, 18649, 18665, 19006, 17265, 22033, 20765, 17421, 20535, 17192, 20362, 21726, 17311, 18658, 18999, 19008, 17447, 32952, 17497, 17520, 17251, 36411, 17782, 20682, 17714, 18326, 17543, 17559, 17585, 21887, 17504, 17527, 17258, 36418, 21915, 21940, 17611, 36467, 18217, 17633, 17661, 21190, 17703, 21176, 17730, 34737, 21946, 17617, 36473, 18223, 36531, 17477, 19152, 17860, 17892, 17675, 17753, 17832, 17590, 21620, 17481, 19156, 17864, 18731, 17918, 36551, 17292, 17934, 17979, 18727, 18681, 18405, 18621, 18039, 18056, 18072, 18117, 18143, 18706, 18052, 18209, 18250, 18239, 18266, 17963, 18296, 18312, 18376, 17807, 36403, 19232, 17796, 17163, 30642, 18392, 17816, 32961, 17645, 18805, 18421, 18437, 18519, 17393, 18747, 18505, 18535, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 17590, 0, 94242, 0, 118820, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2482176, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 2207744, 2404352, 2412544, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3104768, 2605056, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2678784, 2207744, 2695168, 2207744, 2703360, 2207744, 2711552, 2752512, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 3170304, 3174400, 2158592, 0, 139, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2748416, 2756608, 2777088, 2801664, 2158592, 2158592, 2158592, 2863104, 2891776, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2785280, 2207744, 2809856, 2207744, 2207744, 2842624, 2207744, 2207744, 2207744, 2899968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2473984, 2207744, 2207744, 2494464, 2207744, 2207744, 2207744, 2523136, 2158592, 2404352, 2412544, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2564096, 2158592, 2158592, 2605056, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2678784, 2158592, 2695168, 2158592, 2703360, 2158592, 2711552, 2752512, 2158592, 2158592, 2785280, 2158592, 2158592, 2785280, 2158592, 2809856, 2158592, 2158592, 2842624, 2158592, 2158592, 2158592, 2899968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 641, 0, 2158592, 0, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 32768, 0, 2158592, 0, 2158592, 2158592, 2158592, 2383872, 2158592, 2158592, 2158592, 2158592, 3006464, 2383872, 2207744, 2207744, 2207744, 2207744, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2572573, 2158877, 2158877, 0, 2207744, 2207744, 2596864, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2641920, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 167936, 0, 0, 2162688, 0, 0, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2146304, 2146304, 2224128, 2224128, 2232320, 2232320, 2232320, 641, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2531328, 2158592, 2158592, 2158592, 2158592, 2158592, 2617344, 2158592, 2158592, 2158592, 2158592, 2441216, 2445312, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2502656, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2580480, 2158592, 2158592, 2158592, 2158592, 2621440, 2158592, 2580480, 2158592, 2158592, 2158592, 2158592, 2621440, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2699264, 2158592, 2158592, 2158592, 2158592, 2158592, 2748416, 2756608, 2777088, 2801664, 2207744, 2863104, 2891776, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3018752, 2207744, 3043328, 2207744, 2207744, 2207744, 2207744, 3080192, 2207744, 2207744, 3112960, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 172310, 279, 0, 2162688, 0, 0, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2404352, 2412544, 2158592, 2510848, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2584576, 2158592, 2609152, 2158592, 2158592, 2629632, 2158592, 2158592, 2158592, 2686976, 2158592, 2715648, 2158592, 2158592, 3121152, 2158592, 2158592, 2158592, 3149824, 2158592, 2158592, 3170304, 3174400, 2158592, 2367488, 2207744, 2207744, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2572288, 2158592, 2158592, 0, 2207744, 2207744, 2207744, 2433024, 2207744, 2453504, 2461696, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2510848, 2207744, 2207744, 2207744, 2207744, 2207744, 2531328, 2207744, 2207744, 2207744, 2207744, 2207744, 2617344, 2207744, 2207744, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2572288, 2158592, 2158592, 1508, 2715648, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2867200, 2207744, 2904064, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2580480, 2207744, 2207744, 2207744, 2207744, 2621440, 2207744, 2207744, 2207744, 3149824, 2207744, 2207744, 3170304, 3174400, 2207744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 2158592, 2158592, 2158592, 2404352, 2412544, 2707456, 2732032, 2207744, 2207744, 2207744, 2822144, 2826240, 2207744, 2895872, 2207744, 2207744, 2924544, 2207744, 2207744, 2973696, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 285, 2158592, 2158592, 3112960, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 2207744, 2207744, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 0, 0, 2535424, 2543616, 2158592, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2990080, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2572288, 2981888, 2207744, 2207744, 3002368, 2207744, 3047424, 3063808, 3076096, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3203072, 2708960, 2732032, 2158592, 2158592, 2158592, 2822144, 2827748, 2158592, 2895872, 2158592, 2158592, 2924544, 2158592, 2158592, 2973696, 2158592, 2981888, 2158592, 2158592, 3002368, 2158592, 3047424, 3063808, 3076096, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3203072, 2981888, 2158592, 2158592, 3003876, 2158592, 3047424, 3063808, 3076096, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3203072, 2207744, 2207744, 2207744, 2207744, 2207744, 2424832, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 20480, 0, 0, 0, 0, 0, 2162688, 20480, 0, 2523136, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2908160, 2527232, 2207744, 2207744, 2576384, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2908160, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 286, 2158592, 2158592, 0, 0, 2158592, 2158592, 2158592, 2158592, 2633728, 2658304, 0, 0, 2740224, 2744320, 0, 2834432, 2207744, 2207744, 2977792, 2207744, 2207744, 2207744, 2207744, 3039232, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3158016, 0, 0, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 933, 45, 45, 45, 45, 442, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 2494464, 2158592, 2158592, 2158592, 2524757, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 1504, 2158592, 2498560, 2158592, 2158592, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 2736128, 2158592, 2158592, 0, 2158592, 2912256, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3108864, 2158592, 2158592, 3133440, 3145728, 3153920, 2375680, 2379776, 2207744, 2207744, 2420736, 2207744, 2449408, 2207744, 2207744, 2207744, 2498560, 2207744, 2207744, 2207744, 2207744, 2568192, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 0, 551, 2158592, 2158592, 2158592, 2158592, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158592, 2506752, 0, 2020, 2158592, 2592768, 2625536, 2207744, 2207744, 2674688, 2736128, 2207744, 2207744, 2207744, 2912256, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 542, 0, 544, 2207744, 3108864, 2207744, 2207744, 3133440, 3145728, 3153920, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 641, 0, 0, 0, 0, 0, 0, 2367488, 2158592, 2498560, 2158592, 2158592, 1621, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 0, 0, 0, 0, 0, 1608, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1107, 97, 97, 1110, 97, 97, 3133440, 3145728, 3153920, 2158592, 2408448, 2416640, 2158592, 2465792, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3014656, 2158592, 2158592, 3051520, 2158592, 2158592, 3100672, 2158592, 2158592, 3121152, 2158592, 2158592, 2158592, 3149824, 2416640, 2207744, 2465792, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2633728, 2658304, 2740224, 2744320, 2834432, 2949120, 2158592, 2985984, 2158592, 2998272, 2158592, 2158592, 2158592, 3129344, 2207744, 2408448, 2949120, 2207744, 2985984, 2207744, 2998272, 2207744, 2207744, 2207744, 3129344, 2158592, 2408448, 2416640, 2158592, 2465792, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 32768, 0, 0, 0, 0, 0, 0, 2367488, 2949120, 2158592, 2985984, 2158592, 2998272, 2158592, 2158592, 2158592, 3129344, 2158592, 2158592, 2478080, 2158592, 2158592, 2158592, 2535424, 2543616, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3117056, 2207744, 2207744, 2478080, 2207744, 2207744, 2207744, 2207744, 2699264, 2207744, 2207744, 2207744, 2207744, 2207744, 2748416, 2756608, 2777088, 2801664, 2207744, 2207744, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 0, 0, 2535709, 2543901, 2158877, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2990365, 2158877, 2158877, 2158730, 2158730, 2158730, 2158730, 2158730, 2572426, 2207744, 2535424, 2543616, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3117056, 2158592, 2158592, 2478080, 2207744, 2207744, 2990080, 2207744, 2207744, 2158592, 2158592, 2482176, 2158592, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 0, 2158592, 2908160, 2158592, 2158592, 2158592, 2977792, 2158592, 2158592, 2158592, 2158592, 3039232, 2158592, 2158592, 3010560, 2207744, 2428928, 2207744, 2514944, 2207744, 2588672, 2207744, 2838528, 2207744, 2207744, 2207744, 3010560, 2158592, 2428928, 2158592, 2514944, 0, 0, 2158592, 2588672, 2158592, 0, 2838528, 2158592, 2158592, 2158592, 3010560, 2158592, 2506752, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 0, 29315, 922, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1539, 45, 3006464, 2383872, 0, 2020, 2158592, 2158592, 2158592, 2158592, 3006464, 2158592, 2637824, 2953216, 2158592, 2207744, 2637824, 2953216, 2207744, 0, 0, 2158592, 2637824, 2953216, 2158592, 2539520, 2158592, 2539520, 2207744, 0, 0, 2539520, 2158592, 2158592, 2158592, 2158592, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158592, 2506752, 0, 0, 2158592, 2207744, 0, 2158592, 2158592, 2207744, 0, 2158592, 2158592, 2207744, 0, 2158592, 2965504, 2965504, 2965504, 0, 0, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2474269, 2158877, 2158877, 0, 0, 2158877, 2158877, 2158877, 2158877, 2634013, 2658589, 0, 0, 2740509, 2744605, 0, 2834717, 40976, 18, 36884, 45078, 24, 28, 90143, 94242, 118820, 102439, 106538, 98347, 118820, 118820, 118820, 40976, 18, 18, 36884, 0, 0, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 86016, 0, 0, 2211840, 102439, 0, 0, 0, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 0, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 135, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2564096, 2158592, 2158592, 2158592, 2158592, 2158592, 2596864, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2641920, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2781184, 2793472, 2494464, 2158592, 2158592, 2158592, 2523136, 2527232, 2158592, 2158592, 2576384, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 0, 27, 27, 0, 2158592, 2498560, 2158592, 2158592, 0, 2158592, 2158592, 2568192, 2158592, 2592768, 2625536, 2158592, 2158592, 2674688, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2473984, 2158592, 2158592, 2494464, 2158592, 2158592, 2158592, 3006464, 2383872, 0, 0, 2158592, 2158592, 2158592, 2158592, 3006464, 2158592, 2637824, 2953216, 2158592, 2207744, 2637824, 2953216, 40976, 18, 36884, 45078, 24, 27, 147488, 94242, 147456, 147488, 106538, 98347, 0, 0, 147456, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 0, 81920, 0, 94242, 0, 0, 0, 2211840, 0, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2428928, 2158592, 2514944, 2158592, 2588672, 2158592, 2838528, 2158592, 2158592, 40976, 18, 151573, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 0, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 1315, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1487, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 0, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 130, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3096576, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2158592, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 644, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 1080, 0, 1084, 0, 1088, 0, 0, 0, 0, 0, 0, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2531466, 2158730, 2158730, 2158730, 2158730, 2158730, 2617482, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2781184, 2793472, 2158592, 2818048, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 45078, 24, 27, 90143, 159779, 159744, 102439, 159779, 98347, 0, 0, 159744, 40976, 18, 18, 36884, 0, 45078, 0, 2224253, 172032, 2224253, 2232448, 2232448, 172032, 2232448, 90143, 0, 0, 2170880, 0, 0, 550, 829, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 124, 124, 127, 127, 127, 40976, 18, 36884, 45078, 25, 29, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 163931, 40976, 18, 18, 36884, 0, 45078, 249856, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 2170880, 0, 0, 827, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 4243810, 4243810, 24, 24, 27, 27, 27, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 0, 0, 0, 0, 57344, 286, 2158592, 2158592, 2158592, 2158592, 2707456, 2732032, 2158592, 2158592, 2158592, 2822144, 2826240, 2158592, 2895872, 2158592, 2158592, 2924544, 2158592, 2158592, 2973696, 2158592, 2207744, 2207744, 2207744, 3186688, 2207744, 0, 0, 0, 0, 0, 0, 53248, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 1613, 97, 97, 97, 97, 97, 97, 1495, 97, 97, 97, 97, 97, 97, 97, 97, 97, 566, 97, 97, 97, 97, 97, 97, 2207744, 0, 0, 0, 0, 0, 0, 2166784, 546, 0, 0, 0, 0, 286, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 17, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 120, 121, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 2170880, 0, 53248, 550, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 196608, 18, 266240, 24, 24, 27, 27, 27, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 0, 45, 45, 45, 45, 45, 45, 45, 1535, 45, 45, 45, 45, 45, 45, 45, 1416, 45, 45, 45, 45, 45, 45, 45, 45, 424, 45, 45, 45, 45, 45, 45, 45, 45, 45, 405, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 199, 45, 45, 67, 67, 67, 67, 67, 491, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1766, 67, 67, 67, 1767, 67, 24850, 24850, 12564, 12564, 0, 0, 2166784, 546, 0, 53531, 53531, 0, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 743, 57889, 0, 2170880, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 1856, 45, 1858, 1859, 67, 67, 67, 1009, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1021, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2367773, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2699549, 2158877, 2158877, 2158877, 2158877, 2158877, 2748701, 2756893, 2777373, 2801949, 97, 1115, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 857, 97, 67, 67, 67, 67, 67, 1258, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1826, 67, 97, 97, 97, 97, 97, 97, 1338, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 870, 97, 97, 67, 67, 67, 1463, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1579, 67, 67, 97, 97, 97, 1518, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 904, 905, 97, 97, 97, 97, 1620, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 0, 0, 0, 0, 45, 1679, 67, 67, 67, 1682, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1690, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 669, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 189, 45, 45, 45, 1748, 45, 45, 45, 1749, 1750, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1959, 67, 67, 67, 67, 1768, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1791, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1802, 67, 1817, 67, 67, 67, 67, 67, 67, 1823, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 1848, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 659, 45, 45, 45, 45, 45, 45, 45, 1863, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 495, 67, 67, 67, 67, 67, 1878, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 0, 1973, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1165, 97, 1167, 67, 24850, 24850, 12564, 12564, 0, 0, 2166784, 0, 0, 53531, 53531, 0, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 1789, 97, 0, 94242, 0, 0, 0, 2211840, 102439, 0, 0, 106538, 98347, 136, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 229376, 2375680, 2379776, 2158592, 2158592, 2420736, 2158592, 2449408, 2158592, 2158592, 67, 24850, 24850, 12564, 12564, 0, 0, 280, 547, 0, 53531, 53531, 0, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 1788, 97, 97, 0, 97, 2024, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 235, 67, 67, 67, 67, 67, 57889, 547, 547, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 1799, 45, 45, 45, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 1092, 0, 0, 0, 0, 0, 97, 97, 97, 97, 1612, 97, 97, 97, 97, 1616, 97, 1297, 1472, 0, 0, 0, 0, 1303, 1474, 0, 0, 0, 0, 1309, 1476, 0, 0, 0, 0, 97, 97, 97, 1481, 97, 97, 97, 97, 97, 97, 1488, 97, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 607, 97, 97, 97, 97, 40976, 18, 36884, 45078, 26, 30, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 213080, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 143448, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 0, 0, 0, 0, 97, 97, 97, 97, 1482, 97, 1483, 97, 97, 97, 97, 97, 97, 1326, 97, 97, 1329, 1330, 97, 97, 97, 97, 97, 97, 1159, 1160, 97, 97, 97, 97, 97, 97, 97, 97, 590, 97, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 2211974, 102439, 0, 0, 106538, 98347, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2474122, 2158730, 2158730, 2494602, 2158730, 2158730, 2158730, 2809994, 2158730, 2158730, 2842762, 2158730, 2158730, 2158730, 2900106, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3014794, 2158730, 2158730, 3051658, 2158730, 2158730, 3100810, 2158730, 2158730, 2158730, 2158730, 3096714, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2207744, 2207744, 2572288, 2207744, 2207744, 2207744, 2207744, 541, 541, 543, 543, 0, 0, 2166784, 0, 548, 549, 549, 0, 286, 2158877, 2158877, 2158877, 2863389, 2892061, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3186973, 2158877, 0, 0, 0, 0, 0, 0, 0, 0, 2367626, 2158877, 2404637, 2412829, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2564381, 2158877, 2158877, 2605341, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2679069, 2158877, 2695453, 2158877, 2703645, 2158877, 2711837, 2752797, 2158877, 0, 2158877, 2158877, 2158877, 2384010, 2158730, 2158730, 2158730, 2158730, 3006602, 2383872, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3096576, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 0, 0, 2158877, 2785565, 2158877, 2810141, 2158877, 2158877, 2842909, 2158877, 2158877, 2158877, 2900253, 2158877, 2158877, 2158877, 2158877, 2158877, 2531613, 2158877, 2158877, 2158877, 2158877, 2158877, 2617629, 2158877, 2158877, 2158877, 2158877, 2158730, 2818186, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3105053, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 0, 0, 0, 0, 97, 97, 97, 1611, 97, 97, 97, 97, 97, 97, 97, 1496, 97, 97, 1499, 97, 97, 97, 97, 97, 2441354, 2445450, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2502794, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2433162, 2158730, 2453642, 2461834, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2580618, 2158730, 2158730, 2158730, 2158730, 2621578, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2699402, 2158730, 2158730, 2158730, 2158730, 2678922, 2158730, 2695306, 2158730, 2703498, 2158730, 2711690, 2752650, 2158730, 2158730, 2785418, 2158730, 2158730, 2158730, 3113098, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3186826, 2158730, 2207744, 2207744, 2207744, 2207744, 2781184, 2793472, 2207744, 2818048, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 541, 0, 543, 2158877, 2502941, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2580765, 2158877, 2158877, 2158877, 2158877, 2621725, 2158877, 3019037, 2158877, 3043613, 2158877, 2158877, 2158877, 2158877, 3080477, 2158877, 2158877, 3113245, 2158877, 2158877, 2158877, 2158877, 0, 2158877, 2908445, 2158877, 2158877, 2158877, 2978077, 2158877, 2158877, 2158877, 2158877, 3039517, 2158877, 2158730, 2510986, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2584714, 2158730, 2609290, 2158730, 2158730, 2629770, 2158730, 2158730, 2158730, 2388106, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2605194, 2158730, 2158730, 2158730, 2158730, 2687114, 2158730, 2715786, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2867338, 2158730, 2904202, 2158730, 2158730, 2158730, 2642058, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2781322, 2793610, 2158730, 3121290, 2158730, 2158730, 2158730, 3149962, 2158730, 2158730, 3170442, 3174538, 2158730, 2367488, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2441216, 2445312, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2502656, 2158877, 2433309, 2158877, 2453789, 2461981, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2511133, 2158877, 2158877, 2158877, 2158877, 2584861, 2158877, 2609437, 2158877, 2158877, 2629917, 2158877, 2158877, 2158877, 2687261, 2158877, 2715933, 2158877, 2158730, 2158730, 2973834, 2158730, 2982026, 2158730, 2158730, 3002506, 2158730, 3047562, 3063946, 3076234, 2158730, 2158730, 2158730, 2158730, 2207744, 2506752, 2207744, 2207744, 2207744, 2207744, 2207744, 2158877, 2507037, 0, 0, 2158877, 2158730, 2158730, 2158730, 3203210, 2207744, 2207744, 2207744, 2207744, 2207744, 2424832, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2564096, 2207744, 2207744, 2207744, 2707741, 2732317, 2158877, 2158877, 2158877, 2822429, 2826525, 2158877, 2896157, 2158877, 2158877, 2924829, 2158877, 2158877, 2973981, 2158877, 18, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 642, 0, 2158592, 0, 45, 1529, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1755, 45, 67, 67, 2982173, 2158877, 2158877, 3002653, 2158877, 3047709, 3064093, 3076381, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3203357, 2523274, 2527370, 2158730, 2158730, 2576522, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2908298, 2494749, 2158877, 2158877, 2158877, 2523421, 2527517, 2158877, 2158877, 2576669, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 0, 40976, 0, 18, 18, 4321280, 2224253, 2232448, 4329472, 2232448, 2158730, 2498698, 2158730, 2158730, 2158730, 2158730, 2568330, 2158730, 2592906, 2625674, 2158730, 2158730, 2674826, 2736266, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2158730, 2912394, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3109002, 2158730, 2158730, 3133578, 3145866, 3154058, 2375680, 2207744, 3108864, 2207744, 2207744, 3133440, 3145728, 3153920, 2375965, 2380061, 2158877, 2158877, 2421021, 2158877, 2449693, 2158877, 2158877, 2158877, 3117341, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3104906, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158877, 2498845, 2158877, 2158877, 0, 2158877, 2158877, 2568477, 2158877, 2593053, 2625821, 2158877, 2158877, 2674973, 0, 0, 0, 0, 97, 97, 1480, 97, 97, 97, 97, 97, 1485, 97, 97, 97, 0, 97, 97, 1729, 97, 1731, 97, 97, 97, 97, 97, 97, 97, 311, 97, 97, 97, 97, 97, 97, 97, 97, 1520, 97, 97, 1523, 97, 97, 1526, 97, 2736413, 2158877, 2158877, 0, 2158877, 2912541, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3109149, 2158877, 2158877, 3014941, 2158877, 2158877, 3051805, 2158877, 2158877, 3100957, 2158877, 2158877, 3121437, 2158877, 2158877, 2158877, 3150109, 3133725, 3146013, 3154205, 2158730, 2408586, 2416778, 2158730, 2465930, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3018890, 2158730, 3043466, 2158730, 2158730, 2158730, 2158730, 3080330, 2633866, 2658442, 2740362, 2744458, 2834570, 2949258, 2158730, 2986122, 2158730, 2998410, 2158730, 2158730, 2158730, 3129482, 2207744, 2408448, 2949120, 2207744, 2985984, 2207744, 2998272, 2207744, 2207744, 2207744, 3129344, 2158877, 2408733, 2416925, 2158877, 2466077, 2158877, 2158877, 3170589, 3174685, 2158877, 0, 0, 0, 2158730, 2158730, 2158730, 2158730, 2158730, 2424970, 2158730, 2158730, 2158730, 2158730, 2707594, 2732170, 2158730, 2158730, 2158730, 2822282, 2826378, 2158730, 2896010, 2158730, 2158730, 2924682, 2949405, 2158877, 2986269, 2158877, 2998557, 2158877, 2158877, 2158877, 3129629, 2158730, 2158730, 2478218, 2158730, 2158730, 2158730, 2535562, 2543754, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3117194, 2207744, 2207744, 2478080, 2207744, 2207744, 2207744, 2207744, 3014656, 2207744, 2207744, 3051520, 2207744, 2207744, 3100672, 2207744, 2207744, 3121152, 2207744, 2207744, 2207744, 2207744, 2207744, 2584576, 2207744, 2609152, 2207744, 2207744, 2629632, 2207744, 2207744, 2207744, 2686976, 2207744, 2207744, 2535424, 2543616, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3117056, 2158877, 2158877, 2478365, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158730, 2158730, 2482314, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2207744, 2207744, 2207744, 2387968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 823, 0, 825, 2158730, 2158730, 2158730, 2990218, 2158730, 2158730, 2207744, 2207744, 2482176, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 135, 0, 2207744, 2207744, 2990080, 2207744, 2207744, 2158877, 2158877, 2482461, 2158877, 2158877, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2158730, 2429066, 2158730, 2515082, 2158730, 2588810, 2158730, 2838666, 2158730, 2158730, 2158730, 3010698, 2207744, 2428928, 2207744, 2514944, 2207744, 2588672, 2207744, 2838528, 2207744, 2207744, 2207744, 3010560, 2158877, 2429213, 2158877, 2515229, 0, 0, 2158877, 2588957, 2158877, 0, 2838813, 2158877, 2158877, 2158877, 3010845, 2158730, 2506890, 2158730, 2158730, 2158730, 2748554, 2756746, 2777226, 2801802, 2158730, 2158730, 2158730, 2863242, 2891914, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 2564234, 2158730, 2158730, 2158730, 2158730, 2158730, 2597002, 2158730, 2158730, 2158730, 3006464, 2384157, 0, 0, 2158877, 2158877, 2158877, 2158877, 3006749, 2158730, 2637962, 2953354, 2158730, 2207744, 2637824, 2953216, 2207744, 0, 0, 2158877, 2638109, 2953501, 2158877, 2539658, 2158730, 2539520, 2207744, 0, 0, 2539805, 2158877, 2158730, 2158730, 2158730, 2977930, 2158730, 2158730, 2158730, 2158730, 3039370, 2158730, 2158730, 2158730, 2158730, 2158730, 2158730, 3158154, 2207744, 0, 2158877, 2158730, 2207744, 0, 2158877, 2158730, 2207744, 0, 2158877, 2965642, 2965504, 2965789, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1484, 97, 97, 97, 97, 2158592, 18, 0, 122880, 0, 0, 0, 77824, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 356, 0, 0, 0, 0, 0, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 45, 1751, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1427, 67, 67, 67, 67, 67, 1432, 67, 67, 67, 3104768, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 122880, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 1322, 550, 0, 286, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 4329472, 27, 27, 2207744, 2207744, 2977792, 2207744, 2207744, 2207744, 2207744, 3039232, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 3158016, 542, 0, 0, 0, 542, 0, 544, 0, 0, 0, 544, 0, 550, 0, 0, 0, 0, 0, 97, 97, 1610, 97, 97, 97, 97, 97, 97, 97, 97, 898, 97, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 2211840, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 237568, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 192512, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 94, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 96, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 12378, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 126, 126, 126, 126, 90143, 0, 0, 2170880, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 20480, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 241664, 102439, 106538, 98347, 0, 0, 20568, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 200797, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 0, 0, 44, 0, 0, 20575, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 41, 41, 41, 0, 0, 1126400, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 0, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 89, 40976, 18, 18, 36884, 0, 45078, 0, 24, 24, 24, 27, 131201, 27, 27, 90143, 0, 0, 2170880, 0, 0, 550, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2441216, 2445312, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 94242, 0, 0, 208896, 2211840, 102439, 0, 0, 106538, 98347, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 0, 0, 0, 0, 0, 0, 0, 2367488, 32768, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2433024, 2158592, 2453504, 2461696, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2510848, 2158592, 2158592, 2158592, 2158592, 40976, 18, 36884, 245783, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 20480, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 221184, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 180224, 40976, 18, 18, 36884, 155648, 45078, 0, 24, 24, 217088, 27, 27, 27, 217088, 90143, 0, 0, 2170880, 0, 0, 828, 0, 2158592, 2158592, 2158592, 2387968, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2387968, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 233472, 0, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 45, 718, 45, 45, 45, 45, 45, 45, 45, 45, 45, 727, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 45, 1808, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 97, 97, 0, 0, 97, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 97, 0, 0, 97, 97, 97, 97, 97, 97, 1787, 0, 97, 97, 0, 97, 97, 97, 45, 45, 45, 45, 2029, 45, 67, 67, 67, 67, 2033, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 45, 1798, 45, 45, 1800, 45, 45, 0, 1472, 0, 0, 0, 0, 0, 1474, 0, 0, 0, 0, 0, 1476, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 1320, 97, 97, 0, 0, 97, 97, 97, 97, 1786, 97, 0, 0, 97, 97, 0, 1790, 1527, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 663, 67, 24850, 24850, 12564, 12564, 0, 57889, 281, 0, 0, 53531, 53531, 367, 286, 97, 97, 0, 0, 97, 97, 97, 1785, 97, 97, 0, 0, 97, 97, 0, 97, 97, 1979, 97, 97, 45, 45, 1983, 45, 1984, 45, 45, 45, 45, 45, 652, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 690, 45, 45, 694, 45, 45, 40976, 19, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 262144, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 46, 67, 98, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 45, 67, 97, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 258048, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 1122423, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 1114152, 1114152, 1114152, 0, 0, 1114112, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 37, 102439, 106538, 98347, 0, 0, 204800, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 0, 102439, 106538, 98347, 0, 0, 57436, 40976, 18, 36884, 45078, 24, 27, 33, 33, 0, 33, 33, 33, 0, 0, 0, 40976, 18, 18, 36884, 0, 45078, 0, 124, 124, 124, 127, 127, 127, 127, 90143, 0, 0, 2170880, 0, 0, 550, 0, 2158877, 2158877, 2158877, 2388253, 2158877, 2158877, 2158877, 2158877, 2158877, 2781469, 2793757, 2158877, 2818333, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2867485, 2158877, 2904349, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 3096861, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2441501, 2445597, 2158877, 2158877, 2158877, 2158877, 2158877, 40976, 122, 123, 36884, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 936, 2158592, 4243810, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 935, 45, 45, 45, 715, 45, 45, 45, 45, 45, 45, 45, 723, 45, 45, 45, 45, 45, 1182, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 430, 45, 45, 45, 45, 45, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 47, 68, 99, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 48, 69, 100, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 49, 70, 101, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 50, 71, 102, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 51, 72, 103, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 52, 73, 104, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 53, 74, 105, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 54, 75, 106, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 55, 76, 107, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 56, 77, 108, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 57, 78, 109, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 58, 79, 110, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 59, 80, 111, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 60, 81, 112, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 61, 82, 113, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 62, 83, 114, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 63, 84, 115, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 64, 85, 116, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 65, 86, 117, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 38, 102439, 106538, 98347, 66, 87, 118, 40976, 18, 36884, 45078, 24, 27, 90143, 94242, 118820, 102439, 106538, 98347, 118820, 118820, 118820, 40976, 18, 18, 0, 0, 45078, 0, 24, 24, 24, 27, 27, 27, 27, 90143, 0, 0, 1314, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 1321, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 0, 367, 0, 0, 1315, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1360, 97, 97, 131, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 145, 149, 45, 45, 45, 45, 45, 174, 45, 179, 45, 185, 45, 188, 45, 45, 202, 67, 255, 67, 67, 269, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 292, 296, 97, 97, 97, 97, 97, 321, 97, 326, 97, 332, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 646, 335, 97, 97, 349, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 437, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 523, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 511, 67, 67, 67, 97, 97, 97, 620, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1501, 1502, 97, 793, 67, 67, 796, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 808, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 2052, 67, 67, 67, 67, 813, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 830, 97, 97, 97, 97, 97, 97, 97, 97, 97, 315, 97, 97, 97, 97, 97, 97, 841, 97, 97, 97, 97, 97, 97, 97, 97, 97, 854, 97, 97, 97, 97, 97, 97, 589, 97, 97, 97, 97, 97, 97, 97, 97, 97, 867, 97, 97, 97, 97, 97, 97, 97, 891, 97, 97, 894, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 906, 45, 937, 45, 45, 940, 45, 45, 45, 45, 45, 45, 948, 45, 45, 45, 45, 45, 734, 735, 67, 737, 67, 738, 67, 740, 67, 67, 67, 45, 967, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 435, 45, 45, 45, 980, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 415, 45, 45, 67, 67, 1024, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 67, 67, 67, 67, 67, 25398, 1081, 13112, 1085, 54074, 1089, 0, 0, 0, 0, 0, 0, 363, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 45, 1674, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1913, 67, 1914, 67, 67, 67, 1918, 67, 67, 97, 97, 97, 97, 1118, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 630, 97, 97, 97, 97, 97, 1169, 97, 97, 97, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 1534, 45, 45, 45, 45, 45, 1538, 45, 45, 45, 45, 1233, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 742, 67, 45, 45, 1191, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 454, 67, 67, 67, 67, 1243, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1251, 67, 0, 0, 97, 97, 97, 97, 45, 45, 67, 67, 2050, 0, 97, 97, 45, 45, 45, 732, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 67, 67, 67, 1284, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 772, 67, 67, 67, 1293, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 368, 2158592, 2158592, 2158592, 2404352, 2412544, 1323, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1331, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1737, 97, 1364, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1373, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 647, 45, 45, 1387, 45, 45, 1391, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 410, 45, 45, 45, 45, 45, 1400, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1407, 45, 45, 45, 45, 45, 941, 45, 943, 45, 45, 45, 45, 45, 45, 951, 45, 67, 1438, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1447, 67, 67, 67, 67, 67, 67, 782, 67, 67, 67, 67, 67, 67, 67, 67, 67, 756, 67, 67, 67, 67, 67, 67, 97, 1491, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1500, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1736, 97, 45, 45, 1541, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 677, 45, 45, 67, 1581, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 791, 792, 67, 67, 67, 67, 1598, 67, 1600, 67, 67, 67, 67, 67, 67, 67, 67, 1472, 97, 97, 97, 1727, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1513, 97, 97, 67, 67, 97, 1879, 97, 1881, 97, 0, 1884, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 1842, 97, 97, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1928, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 1903, 45, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 1971, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 1381, 45, 45, 45, 45, 1976, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1747, 809, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 907, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 0, 0, 1478, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1150, 97, 97, 97, 97, 67, 67, 67, 67, 1244, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 477, 67, 67, 67, 67, 67, 67, 1294, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1324, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 1374, 97, 97, 97, 97, 0, 1175, 0, 45, 45, 45, 45, 45, 45, 45, 45, 945, 45, 45, 45, 45, 45, 45, 45, 45, 1908, 45, 45, 1910, 45, 67, 67, 67, 67, 67, 67, 67, 67, 1919, 67, 0, 0, 97, 97, 97, 97, 45, 2048, 67, 2049, 0, 0, 97, 2051, 45, 45, 45, 939, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 397, 45, 45, 45, 1921, 67, 67, 1923, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 1947, 45, 1935, 0, 0, 0, 97, 1939, 97, 97, 1941, 97, 45, 45, 45, 45, 45, 45, 382, 389, 45, 45, 45, 45, 45, 45, 45, 45, 1810, 45, 45, 1812, 67, 67, 67, 67, 67, 256, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 336, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 371, 373, 45, 45, 45, 955, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 413, 45, 45, 45, 457, 459, 67, 67, 67, 67, 67, 67, 67, 67, 473, 67, 478, 67, 67, 482, 67, 67, 485, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 1828, 97, 554, 556, 97, 97, 97, 97, 97, 97, 97, 97, 570, 97, 575, 97, 97, 579, 97, 97, 582, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 330, 97, 97, 67, 746, 67, 67, 67, 67, 67, 67, 67, 67, 67, 758, 67, 67, 67, 67, 67, 67, 67, 1575, 67, 67, 67, 67, 67, 67, 67, 67, 493, 67, 67, 67, 67, 67, 67, 67, 97, 97, 844, 97, 97, 97, 97, 97, 97, 97, 97, 97, 856, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1735, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 1642, 97, 1644, 97, 97, 890, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 67, 67, 67, 67, 1065, 1066, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 532, 67, 67, 67, 67, 67, 67, 67, 1451, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 496, 67, 67, 97, 97, 1505, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 593, 97, 97, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1617, 97, 97, 1635, 0, 1637, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 885, 97, 97, 97, 97, 67, 67, 1704, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 565, 572, 97, 97, 97, 97, 97, 97, 97, 97, 1832, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 1946, 45, 45, 67, 67, 67, 67, 67, 97, 1926, 97, 1927, 97, 0, 0, 0, 97, 97, 1934, 2043, 0, 0, 97, 97, 97, 2047, 45, 45, 67, 67, 0, 1832, 97, 97, 45, 45, 45, 981, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1227, 45, 45, 45, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 372, 45, 45, 45, 45, 1661, 1662, 45, 45, 45, 45, 45, 1666, 45, 45, 45, 45, 45, 1673, 45, 1675, 45, 45, 45, 45, 45, 45, 45, 67, 1426, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1275, 67, 67, 67, 67, 67, 45, 418, 45, 45, 420, 45, 45, 423, 45, 45, 45, 45, 45, 45, 45, 45, 959, 45, 45, 962, 45, 45, 45, 45, 458, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 483, 67, 67, 67, 67, 504, 67, 67, 506, 67, 67, 509, 67, 67, 67, 67, 67, 67, 67, 528, 67, 67, 67, 67, 67, 67, 67, 67, 1287, 67, 67, 67, 67, 67, 67, 67, 555, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 580, 97, 97, 97, 97, 601, 97, 97, 603, 97, 97, 606, 97, 97, 97, 97, 97, 97, 848, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1498, 97, 97, 97, 97, 97, 97, 45, 45, 714, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 989, 990, 45, 67, 67, 67, 67, 67, 1011, 67, 67, 67, 67, 1015, 67, 67, 67, 67, 67, 67, 67, 753, 67, 67, 67, 67, 67, 67, 67, 67, 467, 67, 67, 67, 67, 67, 67, 67, 45, 45, 1179, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1003, 1004, 67, 1217, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 728, 67, 1461, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1034, 67, 97, 1516, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 871, 97, 67, 67, 67, 1705, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 567, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1715, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 1380, 45, 45, 45, 45, 45, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 1887, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 2006, 45, 45, 1907, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1920, 67, 97, 0, 2035, 97, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 1428, 67, 67, 67, 67, 67, 67, 1435, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 146, 45, 152, 45, 45, 165, 45, 175, 45, 180, 45, 45, 187, 190, 195, 45, 203, 254, 257, 262, 67, 270, 67, 67, 0, 24850, 12564, 0, 0, 0, 281, 28809, 53531, 97, 97, 97, 293, 97, 299, 97, 97, 312, 97, 322, 97, 327, 97, 97, 334, 337, 342, 97, 350, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 67, 484, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 499, 97, 581, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 596, 648, 45, 650, 45, 651, 45, 653, 45, 45, 45, 657, 45, 45, 45, 45, 45, 45, 1954, 67, 67, 67, 1958, 67, 67, 67, 67, 67, 67, 67, 768, 67, 67, 67, 67, 67, 67, 67, 67, 769, 67, 67, 67, 67, 67, 67, 67, 680, 45, 45, 45, 45, 45, 45, 45, 45, 688, 689, 691, 45, 45, 45, 45, 45, 983, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 947, 45, 45, 45, 45, 952, 45, 45, 698, 699, 45, 45, 702, 703, 45, 45, 45, 45, 45, 45, 45, 711, 744, 67, 67, 67, 67, 67, 67, 67, 67, 67, 757, 67, 67, 67, 67, 761, 67, 67, 67, 67, 765, 67, 767, 67, 67, 67, 67, 67, 67, 67, 67, 775, 776, 778, 67, 67, 67, 67, 67, 67, 785, 786, 67, 67, 789, 790, 67, 67, 67, 67, 67, 67, 1442, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1775, 97, 97, 97, 67, 67, 67, 67, 67, 798, 67, 67, 67, 802, 67, 67, 67, 67, 67, 67, 67, 67, 1465, 67, 67, 1468, 67, 67, 1471, 67, 67, 810, 67, 67, 67, 67, 67, 67, 67, 67, 67, 821, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 833, 97, 835, 97, 836, 97, 838, 97, 97, 0, 0, 97, 97, 97, 2002, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 1740, 45, 45, 45, 1744, 45, 45, 45, 97, 842, 97, 97, 97, 97, 97, 97, 97, 97, 97, 855, 97, 97, 97, 97, 0, 1717, 1718, 97, 97, 97, 97, 97, 1722, 97, 0, 0, 859, 97, 97, 97, 97, 863, 97, 865, 97, 97, 97, 97, 97, 97, 97, 97, 604, 97, 97, 97, 97, 97, 97, 97, 873, 874, 876, 97, 97, 97, 97, 97, 97, 883, 884, 97, 97, 887, 888, 97, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 225280, 0, 365, 0, 367, 0, 45, 45, 45, 1531, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1199, 45, 45, 45, 45, 45, 97, 97, 908, 97, 97, 97, 97, 97, 97, 97, 97, 97, 919, 638, 0, 0, 0, 0, 2158877, 2158877, 2158877, 2158877, 2158877, 2425117, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2597149, 2158877, 2158877, 2158877, 2158877, 2158877, 2158877, 2642205, 2158877, 2158877, 2158877, 2158877, 2158877, 3158301, 0, 2375818, 2379914, 2158730, 2158730, 2420874, 2158730, 2449546, 2158730, 2158730, 953, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 965, 978, 45, 45, 45, 45, 45, 45, 985, 45, 45, 45, 45, 45, 45, 45, 45, 971, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1027, 67, 1029, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1455, 67, 67, 67, 67, 67, 67, 67, 1077, 1078, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 366, 0, 139, 2158730, 2158730, 2158730, 2404490, 2412682, 1113, 97, 97, 97, 97, 97, 97, 1121, 97, 1123, 97, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1540, 1155, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 615, 1168, 97, 97, 1171, 1172, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 45, 45, 45, 45, 1533, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1663, 45, 45, 45, 45, 45, 45, 45, 45, 45, 183, 45, 45, 45, 45, 201, 45, 45, 45, 1219, 45, 45, 45, 45, 45, 45, 45, 1226, 45, 45, 45, 45, 45, 168, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 427, 45, 45, 45, 45, 45, 45, 45, 1231, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1242, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1046, 67, 67, 1254, 67, 1256, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 806, 807, 67, 67, 97, 1336, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1111, 97, 97, 97, 97, 97, 1351, 97, 97, 97, 1354, 97, 97, 97, 1359, 97, 97, 97, 0, 97, 97, 97, 97, 1640, 97, 97, 97, 97, 97, 97, 97, 897, 97, 97, 97, 902, 97, 97, 97, 97, 97, 97, 97, 97, 1366, 97, 97, 97, 97, 97, 97, 97, 1371, 97, 97, 97, 0, 97, 97, 97, 1730, 97, 97, 97, 97, 97, 97, 97, 97, 915, 97, 97, 97, 97, 0, 360, 0, 67, 67, 67, 1440, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1017, 67, 1019, 67, 67, 67, 67, 67, 1453, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1459, 97, 97, 97, 1493, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1525, 97, 97, 97, 97, 97, 97, 1507, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1514, 67, 67, 67, 67, 1584, 67, 67, 67, 67, 67, 1590, 67, 67, 67, 67, 67, 67, 67, 783, 67, 67, 67, 788, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1599, 1601, 67, 67, 67, 1604, 67, 1606, 1607, 67, 1472, 0, 1474, 0, 1476, 0, 97, 97, 97, 97, 97, 97, 1614, 97, 97, 97, 97, 45, 45, 1850, 45, 45, 45, 45, 1855, 45, 45, 45, 45, 45, 1222, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1229, 97, 1618, 97, 97, 97, 97, 97, 97, 97, 1625, 97, 97, 97, 97, 97, 0, 1175, 0, 45, 45, 45, 45, 45, 45, 45, 45, 447, 45, 45, 45, 45, 45, 67, 67, 1633, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 1643, 1645, 97, 97, 0, 0, 97, 97, 1784, 97, 97, 97, 0, 0, 97, 97, 0, 97, 1894, 1895, 97, 1897, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 656, 45, 45, 45, 45, 45, 45, 97, 1648, 97, 1650, 1651, 97, 0, 45, 45, 45, 1654, 45, 45, 45, 45, 45, 169, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 658, 45, 45, 45, 45, 664, 45, 45, 1659, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1187, 45, 45, 1669, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1005, 67, 67, 1681, 67, 67, 67, 67, 67, 67, 67, 1686, 67, 67, 67, 67, 67, 67, 67, 784, 67, 67, 67, 67, 67, 67, 67, 67, 1055, 67, 67, 67, 67, 1060, 67, 67, 97, 97, 1713, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 1378, 45, 45, 45, 45, 45, 45, 45, 408, 45, 45, 45, 45, 45, 45, 45, 45, 1547, 45, 1549, 45, 45, 45, 45, 45, 97, 97, 1780, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 45, 2027, 2028, 45, 45, 67, 67, 2031, 2032, 67, 45, 45, 1804, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1917, 67, 67, 67, 67, 67, 67, 67, 1819, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1708, 97, 97, 97, 97, 97, 45, 45, 1862, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 497, 67, 67, 67, 1877, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 97, 97, 97, 97, 97, 1839, 0, 0, 97, 97, 97, 97, 1936, 0, 0, 97, 97, 97, 97, 97, 97, 1943, 1944, 1945, 45, 45, 45, 45, 670, 45, 45, 45, 45, 674, 45, 45, 45, 45, 678, 45, 1948, 45, 1950, 45, 45, 45, 45, 1955, 1956, 1957, 67, 67, 67, 1960, 67, 1962, 67, 67, 67, 67, 1967, 1968, 1969, 97, 0, 0, 0, 97, 97, 1974, 97, 0, 1936, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 1906, 0, 1977, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1746, 45, 45, 45, 45, 2011, 67, 67, 2013, 67, 67, 67, 2017, 97, 97, 0, 0, 2021, 97, 8192, 97, 97, 2025, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1916, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 140, 45, 45, 45, 1180, 45, 45, 45, 45, 1184, 45, 45, 45, 45, 45, 45, 45, 387, 45, 392, 45, 45, 396, 45, 45, 399, 45, 45, 67, 207, 67, 67, 67, 67, 67, 67, 236, 67, 67, 67, 67, 67, 67, 67, 800, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1603, 67, 67, 67, 67, 67, 0, 97, 97, 287, 97, 97, 97, 97, 97, 97, 316, 97, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 1656, 1657, 45, 376, 45, 45, 45, 45, 45, 388, 45, 45, 45, 45, 45, 45, 45, 45, 1406, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 462, 67, 67, 67, 67, 67, 474, 67, 67, 67, 67, 67, 67, 67, 817, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 97, 97, 97, 559, 97, 97, 97, 97, 97, 571, 97, 97, 97, 97, 97, 97, 896, 97, 97, 97, 900, 97, 97, 97, 97, 97, 97, 912, 914, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 391, 45, 45, 45, 45, 45, 45, 45, 45, 713, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 662, 45, 1140, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 636, 67, 67, 1283, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 513, 67, 67, 1363, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 889, 97, 97, 97, 1714, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 926, 45, 45, 45, 45, 45, 45, 45, 45, 672, 45, 45, 45, 45, 45, 45, 45, 45, 686, 45, 45, 45, 45, 45, 45, 45, 45, 944, 45, 45, 45, 45, 45, 45, 45, 45, 1676, 45, 45, 45, 45, 45, 45, 67, 97, 97, 97, 1833, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 1902, 45, 45, 45, 45, 45, 957, 45, 45, 45, 45, 961, 45, 963, 45, 45, 45, 67, 97, 2034, 0, 97, 97, 97, 97, 97, 2040, 45, 45, 45, 2042, 67, 67, 67, 67, 67, 67, 1574, 67, 67, 67, 67, 67, 1578, 67, 67, 67, 67, 67, 67, 799, 67, 67, 67, 804, 67, 67, 67, 67, 67, 67, 67, 1298, 0, 0, 0, 1304, 0, 0, 0, 1310, 132, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 45, 1414, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 428, 45, 45, 45, 45, 45, 57889, 0, 0, 54074, 54074, 550, 831, 97, 97, 97, 97, 97, 97, 97, 97, 97, 568, 97, 97, 97, 97, 578, 97, 45, 45, 968, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1228, 45, 45, 67, 67, 67, 67, 67, 25398, 1082, 13112, 1086, 54074, 1090, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 139, 2158592, 2158592, 2158592, 2404352, 2412544, 67, 67, 67, 67, 1464, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 510, 67, 67, 67, 67, 97, 97, 97, 97, 1519, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 918, 97, 0, 0, 0, 0, 1528, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 976, 45, 1554, 45, 45, 45, 45, 45, 45, 45, 45, 1562, 45, 45, 1565, 45, 45, 45, 45, 683, 45, 45, 45, 687, 45, 45, 692, 45, 45, 45, 45, 45, 1953, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1014, 67, 67, 67, 67, 67, 67, 1568, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 67, 67, 67, 67, 67, 1585, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1594, 97, 97, 1649, 97, 97, 97, 0, 45, 45, 1653, 45, 45, 45, 45, 45, 45, 383, 45, 45, 45, 45, 45, 45, 45, 45, 45, 986, 45, 45, 45, 45, 45, 45, 45, 45, 1670, 45, 1672, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 736, 67, 67, 67, 67, 67, 741, 67, 67, 67, 1680, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1074, 67, 67, 67, 1692, 67, 67, 67, 67, 67, 67, 67, 1697, 67, 1699, 67, 67, 67, 67, 67, 67, 1012, 67, 67, 67, 67, 67, 67, 67, 67, 67, 468, 475, 67, 67, 67, 67, 67, 67, 1769, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 624, 97, 97, 97, 97, 97, 97, 634, 97, 97, 1792, 97, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 958, 45, 45, 45, 45, 45, 45, 964, 45, 150, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 977, 204, 45, 67, 67, 67, 217, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 787, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 271, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 97, 351, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 45, 938, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1398, 45, 45, 45, 153, 45, 161, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 660, 661, 45, 45, 205, 45, 67, 67, 67, 67, 220, 67, 228, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 280, 94, 0, 0, 67, 67, 67, 67, 67, 272, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 97, 352, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 439, 45, 45, 45, 45, 45, 445, 45, 45, 45, 452, 45, 45, 67, 67, 212, 216, 67, 67, 67, 67, 67, 241, 67, 246, 67, 252, 67, 67, 486, 67, 67, 67, 67, 67, 67, 67, 494, 67, 67, 67, 67, 67, 67, 67, 1245, 67, 67, 67, 67, 67, 67, 67, 67, 1013, 67, 67, 1016, 67, 67, 67, 67, 67, 521, 67, 67, 525, 67, 67, 67, 67, 67, 531, 67, 67, 67, 538, 67, 0, 0, 2046, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 1192, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1418, 45, 45, 1421, 97, 97, 583, 97, 97, 97, 97, 97, 97, 97, 591, 97, 97, 97, 97, 97, 97, 913, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 1384, 97, 618, 97, 97, 622, 97, 97, 97, 97, 97, 628, 97, 97, 97, 635, 97, 18, 131427, 0, 0, 0, 639, 0, 132, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 932, 45, 45, 45, 45, 45, 1544, 45, 45, 45, 45, 45, 1550, 45, 45, 45, 45, 45, 1194, 45, 1196, 45, 45, 45, 45, 45, 45, 45, 45, 999, 45, 45, 45, 45, 45, 67, 67, 45, 45, 667, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1408, 45, 45, 45, 696, 45, 45, 45, 701, 45, 45, 45, 45, 45, 45, 45, 45, 710, 45, 45, 45, 1220, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 194, 45, 45, 45, 729, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 797, 67, 67, 67, 67, 67, 67, 805, 67, 67, 67, 67, 67, 67, 67, 1587, 67, 1589, 67, 67, 67, 67, 67, 67, 67, 67, 1763, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 2162968, 0, 0, 67, 67, 67, 67, 67, 814, 816, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 67, 67, 1008, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1020, 67, 0, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 1429, 67, 1430, 67, 67, 67, 67, 67, 1062, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 518, 1076, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 0, 28809, 0, 139, 45, 45, 45, 45, 45, 97, 97, 97, 97, 1102, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1124, 97, 1126, 97, 97, 1114, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1112, 97, 97, 1156, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 594, 97, 97, 97, 97, 1170, 97, 97, 97, 97, 0, 921, 0, 0, 0, 0, 0, 0, 45, 45, 45, 45, 1532, 45, 45, 45, 45, 1536, 45, 45, 45, 45, 45, 172, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 706, 45, 45, 709, 45, 45, 1177, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1202, 45, 1204, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1215, 45, 45, 45, 1232, 45, 45, 45, 45, 45, 45, 45, 67, 1237, 67, 67, 67, 67, 67, 67, 1053, 1054, 67, 67, 67, 67, 67, 67, 1061, 67, 67, 1282, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1289, 67, 67, 67, 1292, 97, 97, 97, 97, 1339, 97, 97, 97, 97, 97, 97, 1344, 97, 97, 97, 97, 45, 1849, 45, 1851, 45, 45, 45, 45, 45, 45, 45, 45, 721, 45, 45, 45, 45, 45, 726, 45, 1385, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1188, 45, 45, 1401, 1402, 45, 45, 45, 45, 1405, 45, 45, 45, 45, 45, 45, 45, 45, 1752, 45, 45, 45, 45, 45, 67, 67, 1410, 45, 45, 45, 1413, 45, 1415, 45, 45, 45, 45, 45, 45, 1419, 45, 45, 45, 45, 1806, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 97, 97, 2019, 0, 97, 67, 67, 67, 1452, 67, 67, 67, 67, 67, 67, 67, 67, 1457, 67, 67, 67, 67, 67, 67, 1259, 67, 67, 67, 67, 67, 67, 1264, 67, 67, 1460, 67, 1462, 67, 67, 67, 67, 67, 67, 1466, 67, 67, 67, 67, 67, 67, 67, 67, 1588, 67, 67, 67, 67, 67, 67, 67, 0, 1300, 0, 0, 0, 1306, 0, 0, 0, 97, 97, 97, 1506, 97, 97, 97, 97, 97, 97, 97, 97, 1512, 97, 97, 97, 0, 1728, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 901, 97, 97, 97, 97, 1515, 97, 1517, 97, 97, 97, 97, 97, 97, 1521, 97, 97, 97, 97, 97, 97, 0, 45, 1652, 45, 45, 45, 1655, 45, 45, 45, 45, 45, 1542, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1552, 1553, 45, 45, 45, 1556, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 693, 45, 45, 45, 67, 67, 67, 67, 1572, 67, 67, 67, 67, 1576, 67, 67, 67, 67, 67, 67, 67, 67, 1602, 67, 67, 1605, 67, 67, 67, 0, 67, 1582, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1580, 67, 67, 1596, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 542, 0, 544, 67, 67, 67, 67, 1759, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 533, 67, 67, 67, 67, 67, 67, 67, 1770, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 1777, 97, 97, 97, 1793, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 998, 45, 45, 1001, 1002, 45, 45, 67, 67, 45, 1861, 45, 67, 67, 67, 67, 67, 67, 67, 67, 1871, 67, 1873, 1874, 67, 0, 97, 45, 67, 0, 97, 45, 67, 16384, 97, 45, 67, 97, 0, 0, 0, 1473, 0, 1082, 0, 0, 0, 1475, 0, 1086, 0, 0, 0, 1477, 1876, 67, 97, 97, 97, 97, 97, 1883, 0, 1885, 97, 97, 97, 1889, 0, 0, 0, 286, 0, 0, 0, 286, 0, 2367488, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 40976, 0, 18, 18, 24, 24, 126, 126, 126, 2053, 0, 2055, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 2039, 97, 45, 45, 45, 45, 67, 67, 67, 67, 67, 226, 67, 67, 67, 67, 67, 67, 67, 67, 1246, 67, 67, 1249, 1250, 67, 67, 67, 132, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 141, 45, 45, 45, 1403, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1186, 45, 45, 1189, 45, 45, 155, 45, 45, 45, 45, 45, 45, 45, 45, 45, 191, 45, 45, 45, 45, 700, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1753, 45, 45, 45, 67, 67, 45, 45, 67, 208, 67, 67, 67, 222, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1764, 67, 67, 67, 67, 67, 67, 67, 258, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 288, 97, 97, 97, 302, 97, 97, 97, 97, 97, 97, 97, 97, 97, 627, 97, 97, 97, 97, 97, 97, 338, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 370, 45, 45, 45, 45, 716, 45, 45, 45, 45, 45, 722, 45, 45, 45, 45, 45, 45, 1912, 67, 67, 67, 67, 67, 67, 67, 67, 67, 819, 67, 67, 25398, 542, 13112, 544, 45, 403, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1409, 45, 67, 67, 67, 67, 489, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 771, 67, 67, 67, 67, 520, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 534, 67, 67, 67, 67, 67, 67, 1271, 67, 67, 67, 1274, 67, 67, 67, 1279, 67, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 553, 97, 97, 97, 97, 586, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1138, 97, 97, 97, 97, 617, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 631, 97, 97, 97, 0, 1834, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 353, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 45, 668, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 724, 45, 45, 45, 45, 45, 682, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 949, 45, 45, 45, 67, 67, 747, 748, 67, 67, 67, 67, 755, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 1302, 0, 0, 0, 1308, 0, 67, 794, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1701, 67, 97, 97, 97, 845, 846, 97, 97, 97, 97, 853, 97, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 97, 97, 892, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 610, 97, 97, 45, 992, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 1239, 67, 67, 67, 1063, 67, 67, 67, 67, 67, 1068, 67, 67, 67, 67, 67, 67, 67, 0, 0, 1301, 0, 0, 0, 1307, 0, 0, 97, 1141, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1152, 97, 97, 0, 0, 97, 97, 2001, 0, 97, 2003, 97, 97, 97, 45, 45, 45, 1739, 45, 45, 45, 1742, 45, 45, 45, 45, 45, 97, 97, 97, 97, 1157, 97, 97, 97, 97, 97, 1162, 97, 97, 97, 97, 97, 97, 1145, 97, 97, 97, 97, 97, 1151, 97, 97, 97, 1253, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 539, 45, 1423, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1431, 67, 67, 67, 67, 67, 67, 67, 1695, 67, 67, 67, 67, 67, 1700, 67, 1702, 67, 67, 1439, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 514, 67, 67, 97, 97, 1492, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 611, 97, 97, 1703, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 97, 97, 852, 97, 97, 97, 97, 97, 97, 45, 1949, 45, 1951, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 1961, 67, 0, 97, 45, 67, 0, 97, 2060, 2061, 0, 2062, 45, 67, 97, 0, 0, 2036, 97, 97, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 67, 223, 67, 67, 237, 67, 67, 67, 67, 67, 67, 67, 1272, 67, 67, 67, 67, 67, 67, 67, 67, 507, 67, 67, 67, 67, 67, 67, 67, 1963, 67, 67, 67, 97, 97, 97, 97, 0, 1972, 0, 97, 97, 97, 1975, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 931, 45, 45, 45, 45, 45, 407, 45, 45, 45, 45, 45, 45, 45, 45, 45, 417, 45, 45, 1989, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1996, 97, 18, 131427, 0, 0, 360, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 930, 45, 45, 45, 45, 45, 45, 444, 45, 45, 45, 45, 45, 45, 45, 67, 67, 97, 97, 1998, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1985, 45, 1986, 45, 45, 45, 156, 45, 45, 170, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 675, 45, 45, 45, 45, 679, 131427, 0, 358, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 381, 45, 45, 45, 45, 45, 45, 45, 45, 45, 400, 45, 45, 419, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 436, 67, 67, 67, 67, 67, 505, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 820, 67, 25398, 542, 13112, 544, 67, 67, 522, 67, 67, 67, 67, 67, 529, 67, 67, 67, 67, 67, 67, 67, 0, 1299, 0, 0, 0, 1305, 0, 0, 0, 97, 97, 619, 97, 97, 97, 97, 97, 626, 97, 97, 97, 97, 97, 97, 97, 1105, 97, 97, 97, 97, 1109, 97, 97, 97, 67, 67, 67, 67, 749, 67, 67, 67, 67, 67, 67, 67, 67, 67, 760, 67, 0, 97, 45, 67, 2058, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 97, 97, 97, 97, 45, 45, 45, 2041, 67, 67, 67, 67, 67, 780, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 516, 67, 67, 97, 97, 97, 878, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1629, 97, 0, 45, 979, 45, 45, 45, 45, 984, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1198, 45, 45, 45, 45, 45, 45, 67, 1023, 67, 67, 67, 67, 1028, 67, 67, 67, 67, 67, 67, 67, 67, 67, 470, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 1094, 0, 0, 0, 1092, 1315, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1486, 97, 1489, 97, 97, 97, 1117, 97, 97, 97, 97, 1122, 97, 97, 97, 97, 97, 97, 97, 1146, 97, 97, 97, 97, 97, 97, 97, 97, 881, 97, 97, 97, 886, 97, 97, 97, 1311, 0, 0, 0, 0, 0, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1615, 97, 97, 97, 97, 97, 1619, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1631, 97, 97, 1847, 97, 45, 45, 45, 45, 1852, 45, 45, 45, 45, 45, 45, 45, 1235, 45, 45, 45, 67, 67, 67, 67, 67, 1868, 67, 67, 67, 1872, 67, 67, 67, 67, 67, 97, 97, 97, 97, 1882, 0, 0, 0, 97, 97, 97, 97, 0, 1891, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 1929, 0, 0, 97, 97, 97, 97, 97, 97, 45, 1900, 45, 1901, 45, 45, 45, 1905, 45, 67, 2054, 97, 45, 67, 0, 97, 45, 67, 0, 97, 45, 67, 97, 0, 0, 97, 2037, 2038, 97, 97, 45, 45, 45, 45, 67, 67, 67, 67, 1867, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1774, 97, 97, 97, 97, 97, 97, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 142, 45, 45, 45, 1412, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 432, 45, 45, 45, 45, 45, 157, 45, 45, 171, 45, 45, 45, 182, 45, 45, 45, 45, 200, 45, 45, 45, 1543, 45, 45, 45, 45, 45, 45, 45, 45, 1551, 45, 45, 45, 45, 1181, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1211, 45, 45, 45, 1214, 45, 45, 45, 67, 209, 67, 67, 67, 224, 67, 67, 238, 67, 67, 67, 249, 67, 0, 97, 2056, 2057, 0, 2059, 45, 67, 0, 97, 45, 67, 97, 0, 0, 1937, 97, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1741, 45, 45, 45, 45, 45, 45, 67, 67, 67, 267, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 289, 97, 97, 97, 304, 97, 97, 318, 97, 97, 97, 329, 97, 97, 0, 0, 97, 1783, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 45, 2026, 45, 45, 45, 45, 67, 2030, 67, 67, 67, 67, 67, 67, 1041, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1044, 67, 67, 67, 67, 67, 67, 97, 97, 347, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 45, 666, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1420, 45, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 840, 67, 1007, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 759, 67, 67, 67, 67, 67, 67, 67, 1052, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1031, 67, 67, 67, 67, 67, 97, 97, 97, 1101, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 592, 97, 97, 97, 1190, 45, 45, 45, 45, 45, 1195, 45, 1197, 45, 45, 45, 45, 1201, 45, 45, 45, 45, 1952, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 250, 67, 67, 67, 1255, 67, 1257, 67, 67, 67, 67, 1261, 67, 67, 67, 67, 67, 67, 67, 67, 1685, 67, 67, 67, 67, 67, 67, 67, 0, 24851, 12565, 0, 0, 0, 0, 28809, 53532, 67, 67, 1267, 67, 67, 67, 67, 67, 67, 1273, 67, 67, 67, 67, 67, 67, 67, 67, 1696, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 2162688, 0, 0, 1281, 67, 67, 67, 67, 1285, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1070, 67, 67, 67, 67, 67, 1335, 97, 1337, 97, 97, 97, 97, 1341, 97, 97, 97, 97, 97, 97, 97, 97, 882, 97, 97, 97, 97, 97, 97, 97, 1347, 97, 97, 97, 97, 97, 97, 1353, 97, 97, 97, 97, 97, 97, 1361, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 544, 0, 550, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2473984, 2158592, 2158592, 2158592, 2990080, 2158592, 2158592, 2207744, 2207744, 2482176, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 2207744, 0, 0, 0, 0, 0, 0, 2162688, 0, 53530, 97, 97, 97, 1365, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 608, 97, 97, 97, 45, 45, 1424, 45, 1425, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1058, 67, 67, 67, 67, 45, 1555, 45, 45, 1557, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 707, 45, 45, 45, 45, 67, 67, 1570, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 773, 67, 67, 1595, 67, 67, 1597, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 2158592, 2158592, 2158592, 2404352, 2412544, 97, 97, 97, 1636, 97, 97, 97, 1639, 97, 97, 1641, 97, 97, 97, 97, 97, 97, 1173, 0, 921, 0, 0, 0, 0, 0, 0, 45, 67, 67, 67, 1693, 67, 67, 67, 67, 67, 67, 67, 1698, 67, 67, 67, 67, 67, 67, 67, 1773, 67, 97, 97, 97, 97, 97, 97, 97, 625, 97, 97, 97, 97, 97, 97, 97, 97, 850, 97, 97, 97, 97, 97, 97, 97, 97, 880, 97, 97, 97, 97, 97, 97, 97, 97, 1106, 97, 97, 97, 97, 97, 97, 97, 1860, 45, 45, 67, 67, 1865, 67, 67, 67, 67, 1870, 67, 67, 67, 67, 1875, 67, 67, 97, 97, 1880, 97, 97, 0, 0, 0, 97, 97, 1888, 97, 0, 0, 0, 1938, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 1854, 45, 45, 45, 45, 45, 45, 45, 1909, 45, 45, 1911, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1248, 67, 67, 67, 67, 67, 67, 1922, 67, 67, 1924, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 1898, 45, 45, 45, 45, 45, 45, 1904, 45, 45, 67, 67, 67, 67, 97, 97, 97, 97, 0, 0, 16384, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 1724, 2008, 2009, 45, 45, 67, 67, 67, 2014, 2015, 67, 67, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 2022, 0, 2023, 97, 97, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1869, 67, 67, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 147, 151, 154, 45, 162, 45, 45, 176, 178, 181, 45, 45, 45, 192, 196, 45, 45, 45, 45, 2012, 67, 67, 67, 67, 67, 67, 2018, 97, 0, 0, 97, 1978, 97, 97, 97, 1982, 45, 45, 45, 45, 45, 45, 45, 45, 45, 972, 973, 45, 45, 45, 45, 45, 67, 259, 263, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 294, 298, 301, 97, 309, 97, 97, 323, 325, 328, 97, 97, 97, 97, 97, 560, 97, 97, 97, 569, 97, 97, 97, 97, 97, 97, 306, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1624, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 1175, 0, 0, 0, 0, 45, 339, 343, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 67, 67, 503, 67, 67, 67, 67, 67, 67, 67, 67, 67, 512, 67, 67, 519, 97, 97, 600, 97, 97, 97, 97, 97, 97, 97, 97, 97, 609, 97, 97, 616, 45, 649, 45, 45, 45, 45, 45, 654, 45, 45, 45, 45, 45, 45, 45, 45, 1393, 45, 45, 45, 45, 45, 45, 45, 45, 1209, 45, 45, 45, 45, 45, 45, 45, 67, 763, 67, 67, 67, 67, 67, 67, 67, 67, 770, 67, 67, 67, 774, 67, 0, 2045, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 994, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 213, 67, 219, 67, 67, 232, 67, 242, 67, 247, 67, 67, 67, 779, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1018, 67, 67, 67, 67, 811, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 97, 834, 97, 97, 97, 97, 97, 839, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 645, 97, 97, 861, 97, 97, 97, 97, 97, 97, 97, 97, 868, 97, 97, 97, 872, 97, 97, 877, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 613, 97, 97, 97, 97, 97, 909, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, 18, 18, 24, 24, 27, 27, 27, 1036, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1047, 67, 67, 67, 1050, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1033, 67, 67, 67, 97, 97, 1130, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 67, 67, 67, 1295, 67, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 1317, 97, 97, 97, 97, 97, 97, 1375, 97, 97, 97, 0, 0, 0, 45, 1379, 45, 45, 45, 45, 45, 45, 422, 45, 45, 45, 429, 431, 45, 45, 45, 45, 0, 1090, 0, 0, 97, 1479, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1357, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1716, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1723, 0, 921, 29315, 0, 0, 0, 0, 45, 929, 45, 45, 45, 45, 45, 45, 45, 1392, 45, 45, 45, 45, 45, 45, 45, 45, 45, 960, 45, 45, 45, 45, 45, 45, 97, 97, 97, 1738, 45, 45, 45, 45, 45, 45, 45, 1743, 45, 45, 45, 45, 166, 45, 45, 45, 45, 184, 186, 45, 45, 197, 45, 45, 97, 1779, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 18, 131427, 0, 638, 0, 0, 0, 0, 362, 0, 640, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1537, 45, 45, 45, 45, 45, 1803, 45, 45, 45, 45, 45, 1809, 45, 45, 45, 67, 67, 67, 1814, 67, 67, 67, 67, 67, 67, 1821, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 0, 67, 67, 67, 1818, 67, 67, 67, 67, 67, 1824, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 1890, 0, 1829, 97, 97, 0, 0, 97, 97, 1836, 97, 97, 0, 0, 0, 97, 97, 97, 97, 1981, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1987, 1845, 97, 97, 97, 45, 45, 45, 45, 45, 1853, 45, 45, 45, 1857, 45, 45, 45, 67, 1864, 67, 1866, 67, 67, 67, 67, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 97, 97, 1710, 1711, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 1886, 97, 97, 97, 0, 0, 97, 97, 97, 97, 1838, 0, 0, 0, 97, 1843, 97, 0, 1893, 97, 97, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1745, 45, 45, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 1931, 97, 97, 97, 97, 97, 588, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 629, 97, 97, 97, 97, 97, 67, 2044, 0, 97, 97, 97, 97, 45, 45, 67, 67, 0, 0, 97, 97, 45, 45, 45, 1660, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 453, 45, 455, 67, 67, 67, 67, 268, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 348, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 359, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 421, 45, 45, 45, 45, 45, 45, 45, 434, 45, 45, 695, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1667, 45, 0, 921, 29315, 0, 925, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1811, 45, 67, 67, 67, 67, 67, 67, 1037, 67, 1039, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1277, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 1095, 0, 0, 0, 1096, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 869, 97, 97, 97, 97, 97, 97, 1131, 97, 1133, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1370, 97, 97, 97, 97, 97, 1312, 0, 0, 0, 0, 1096, 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, 1327, 97, 97, 97, 97, 97, 1332, 97, 97, 97, 1830, 97, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 1896, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1548, 45, 45, 45, 45, 45, 45, 133, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 45, 380, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 401, 45, 45, 158, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1200, 45, 45, 45, 45, 206, 67, 67, 67, 67, 67, 225, 67, 67, 67, 67, 67, 67, 67, 67, 754, 67, 67, 67, 67, 67, 67, 67, 57889, 0, 0, 54074, 54074, 550, 832, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1342, 97, 97, 97, 97, 97, 97, 67, 67, 67, 67, 67, 25398, 1083, 13112, 1087, 54074, 1091, 0, 0, 0, 0, 0, 0, 1316, 0, 831, 97, 97, 97, 97, 97, 97, 97, 1174, 921, 0, 1175, 0, 0, 0, 0, 45, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 45, 148, 67, 67, 264, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 97, 295, 97, 97, 97, 97, 313, 97, 97, 97, 97, 331, 333, 97, 18, 131427, 356, 638, 0, 0, 0, 0, 362, 0, 0, 365, 0, 367, 0, 45, 45, 1530, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 988, 45, 45, 45, 97, 344, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 402, 404, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1756, 67, 438, 45, 45, 45, 45, 45, 45, 45, 45, 449, 450, 45, 45, 45, 67, 67, 214, 218, 221, 67, 229, 67, 67, 243, 245, 248, 67, 67, 67, 67, 67, 488, 490, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1071, 67, 1073, 67, 67, 67, 67, 67, 524, 67, 67, 67, 67, 67, 67, 67, 67, 535, 536, 67, 67, 67, 67, 67, 67, 1683, 1684, 67, 67, 67, 67, 1688, 1689, 67, 67, 67, 67, 67, 67, 1586, 67, 67, 67, 67, 67, 67, 67, 67, 67, 469, 67, 67, 67, 67, 67, 67, 97, 97, 97, 585, 587, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1163, 97, 97, 97, 97, 97, 97, 97, 621, 97, 97, 97, 97, 97, 97, 97, 97, 632, 633, 97, 97, 0, 0, 1782, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 712, 45, 45, 45, 717, 45, 45, 45, 45, 45, 45, 45, 45, 725, 45, 45, 45, 163, 167, 173, 177, 45, 45, 45, 45, 45, 193, 45, 45, 45, 45, 982, 45, 45, 45, 45, 45, 45, 987, 45, 45, 45, 45, 45, 1558, 45, 1560, 45, 45, 45, 45, 45, 45, 45, 45, 704, 705, 45, 45, 45, 45, 45, 45, 45, 45, 731, 45, 45, 45, 67, 67, 67, 67, 67, 739, 67, 67, 67, 67, 67, 67, 273, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 67, 67, 67, 764, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1290, 67, 67, 67, 67, 67, 67, 812, 67, 67, 67, 67, 818, 67, 67, 67, 25398, 542, 13112, 544, 57889, 0, 0, 54074, 54074, 550, 0, 97, 97, 97, 97, 97, 837, 97, 97, 97, 97, 97, 602, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1137, 97, 97, 97, 97, 97, 97, 97, 97, 97, 862, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1627, 97, 97, 97, 0, 97, 97, 97, 97, 910, 97, 97, 97, 97, 916, 97, 97, 97, 0, 0, 0, 97, 97, 1940, 97, 97, 1942, 45, 45, 45, 45, 45, 45, 385, 45, 45, 45, 45, 395, 45, 45, 45, 45, 966, 45, 969, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 975, 45, 45, 45, 406, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 974, 45, 45, 45, 67, 67, 67, 67, 1010, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1262, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1040, 67, 1042, 67, 1045, 67, 67, 67, 67, 67, 67, 67, 97, 1706, 97, 97, 97, 1709, 97, 97, 97, 67, 67, 67, 67, 1051, 67, 67, 67, 67, 67, 1057, 67, 67, 67, 67, 67, 67, 67, 1443, 67, 67, 1446, 67, 67, 67, 67, 67, 67, 67, 1297, 0, 0, 0, 1303, 0, 0, 0, 1309, 67, 67, 67, 67, 1079, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2207744, 2207744, 2207744, 2207744, 2207744, 2572288, 2207744, 2207744, 2207744, 1098, 97, 97, 97, 97, 97, 1104, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1356, 97, 97, 97, 97, 97, 97, 1128, 97, 97, 97, 97, 97, 97, 1134, 97, 1136, 97, 1139, 97, 97, 97, 97, 97, 97, 1622, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 0, 1176, 0, 646, 45, 67, 67, 67, 1268, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1469, 67, 67, 67, 97, 1348, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1127, 97, 67, 1569, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1448, 1449, 67, 1816, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1825, 67, 67, 1827, 97, 97, 0, 1781, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 1831, 0, 0, 97, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 1980, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1395, 45, 45, 45, 45, 45, 97, 1846, 97, 97, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1212, 45, 45, 45, 45, 45, 45, 2010, 45, 67, 67, 67, 67, 67, 2016, 67, 97, 97, 0, 0, 97, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 2007, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 143, 45, 45, 45, 1671, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 1813, 67, 67, 1815, 45, 45, 67, 210, 67, 67, 67, 67, 67, 67, 239, 67, 67, 67, 67, 67, 67, 67, 1454, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1445, 67, 67, 67, 67, 67, 67, 97, 97, 290, 97, 97, 97, 97, 97, 97, 319, 97, 97, 97, 97, 97, 97, 303, 97, 97, 317, 97, 97, 97, 97, 97, 97, 305, 97, 97, 97, 97, 97, 97, 97, 97, 97, 899, 97, 97, 97, 97, 97, 97, 375, 45, 45, 45, 379, 45, 45, 390, 45, 45, 394, 45, 45, 45, 45, 45, 443, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 461, 67, 67, 67, 465, 67, 67, 476, 67, 67, 480, 67, 67, 67, 67, 67, 67, 1694, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1288, 67, 67, 67, 67, 67, 67, 500, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1075, 97, 97, 97, 558, 97, 97, 97, 562, 97, 97, 573, 97, 97, 577, 97, 97, 97, 97, 97, 895, 97, 97, 97, 97, 97, 97, 903, 97, 97, 97, 0, 97, 97, 1638, 97, 97, 97, 97, 97, 97, 97, 97, 1646, 597, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1334, 45, 681, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1396, 45, 45, 1399, 45, 45, 730, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1434, 67, 67, 67, 67, 67, 67, 750, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1456, 67, 67, 67, 67, 67, 45, 45, 993, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1238, 67, 67, 1006, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1280, 1048, 1049, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1059, 67, 67, 67, 67, 67, 67, 1286, 67, 67, 67, 67, 67, 67, 67, 1291, 67, 97, 97, 1100, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 638, 0, 920, 97, 97, 1142, 1143, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1153, 97, 97, 97, 97, 97, 1158, 97, 97, 97, 1161, 97, 97, 97, 97, 1166, 97, 97, 97, 97, 97, 1325, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1328, 97, 97, 97, 97, 97, 97, 97, 45, 1218, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1678, 45, 45, 45, 67, 67, 67, 67, 67, 1269, 67, 67, 67, 67, 67, 67, 67, 67, 1278, 67, 67, 67, 67, 67, 67, 1761, 67, 67, 67, 67, 67, 67, 67, 67, 67, 530, 67, 67, 67, 67, 67, 67, 97, 97, 1349, 97, 97, 97, 97, 97, 97, 97, 97, 1358, 97, 97, 97, 97, 97, 97, 1623, 97, 97, 97, 97, 97, 97, 97, 97, 0, 921, 0, 0, 926, 0, 0, 0, 45, 45, 1411, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1754, 45, 45, 67, 67, 1301, 0, 1307, 0, 1313, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 21054, 97, 97, 97, 97, 67, 1757, 67, 67, 67, 1760, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1467, 67, 67, 67, 67, 67, 1778, 97, 0, 0, 97, 97, 97, 97, 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, 97, 97, 1352, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1511, 97, 97, 97, 97, 97, 67, 67, 67, 67, 67, 1820, 67, 1822, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 97, 1933, 97, 1892, 97, 97, 97, 97, 97, 97, 1899, 45, 45, 45, 45, 45, 45, 45, 45, 1664, 45, 45, 45, 45, 45, 45, 45, 45, 1546, 45, 45, 45, 45, 45, 45, 45, 45, 1208, 45, 45, 45, 45, 45, 45, 45, 45, 1224, 45, 45, 45, 45, 45, 45, 45, 45, 673, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 1925, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 97, 623, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 307, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1796, 97, 45, 45, 45, 45, 45, 45, 45, 970, 45, 45, 45, 45, 45, 45, 45, 45, 1417, 45, 45, 45, 45, 45, 45, 45, 67, 1964, 67, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1721, 97, 97, 0, 0, 1997, 97, 0, 0, 2000, 97, 97, 0, 97, 97, 97, 97, 97, 45, 45, 45, 45, 733, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 803, 67, 67, 67, 67, 67, 0, 94242, 0, 0, 0, 38, 102439, 0, 0, 106538, 98347, 28809, 45, 45, 144, 45, 45, 45, 1805, 45, 1807, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 231, 67, 67, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 45, 45, 67, 211, 67, 67, 67, 67, 230, 234, 240, 244, 67, 67, 67, 67, 67, 67, 464, 67, 67, 67, 67, 67, 67, 479, 67, 67, 67, 260, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 97, 291, 97, 97, 97, 97, 310, 314, 320, 324, 97, 97, 97, 97, 97, 97, 1367, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1355, 97, 97, 97, 97, 97, 97, 1362, 340, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 360, 0, 362, 0, 365, 28809, 367, 139, 369, 45, 45, 45, 374, 67, 67, 460, 67, 67, 67, 67, 466, 67, 67, 67, 67, 67, 67, 67, 67, 801, 67, 67, 67, 67, 67, 67, 67, 67, 67, 487, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 498, 67, 67, 67, 67, 67, 67, 1772, 67, 67, 97, 97, 97, 97, 97, 97, 97, 0, 921, 922, 1175, 0, 0, 0, 0, 45, 67, 502, 67, 67, 67, 67, 67, 67, 67, 508, 67, 67, 67, 515, 517, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 0, 0, 1932, 97, 97, 0, 1999, 97, 97, 97, 0, 97, 97, 2004, 2005, 97, 45, 45, 45, 45, 1193, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 676, 45, 45, 45, 45, 67, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 552, 97, 97, 97, 97, 97, 1377, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 655, 45, 45, 45, 45, 45, 45, 45, 97, 97, 557, 97, 97, 97, 97, 563, 97, 97, 97, 97, 97, 97, 97, 97, 1135, 97, 97, 97, 97, 97, 97, 97, 97, 97, 584, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 595, 97, 97, 97, 97, 97, 911, 97, 97, 97, 97, 97, 97, 97, 638, 0, 0, 0, 0, 1315, 0, 0, 0, 0, 97, 97, 97, 1319, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 1733, 97, 97, 97, 97, 97, 97, 1340, 97, 97, 97, 1343, 97, 97, 1345, 97, 1346, 97, 599, 97, 97, 97, 97, 97, 97, 97, 605, 97, 97, 97, 612, 614, 97, 97, 97, 97, 97, 1794, 97, 97, 97, 45, 45, 45, 45, 45, 45, 45, 1207, 45, 45, 45, 45, 45, 45, 1213, 45, 45, 745, 67, 67, 67, 67, 751, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1577, 67, 67, 67, 67, 67, 762, 67, 67, 67, 67, 766, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1765, 67, 67, 67, 67, 67, 777, 67, 67, 781, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1592, 1593, 67, 67, 97, 843, 97, 97, 97, 97, 849, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1510, 97, 97, 97, 97, 97, 97, 97, 860, 97, 97, 97, 97, 864, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1797, 45, 45, 45, 45, 1801, 45, 97, 875, 97, 97, 879, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1522, 97, 97, 97, 97, 97, 991, 45, 45, 45, 45, 996, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 215, 67, 67, 67, 67, 233, 67, 67, 67, 67, 251, 253, 1022, 67, 67, 67, 1026, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1035, 67, 67, 1038, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1458, 67, 67, 67, 67, 67, 1064, 67, 67, 67, 1067, 67, 67, 67, 67, 1072, 67, 67, 67, 67, 67, 67, 1296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2367488, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 1096, 0, 921, 29315, 0, 0, 0, 0, 928, 45, 45, 45, 45, 45, 934, 45, 45, 45, 164, 45, 45, 45, 45, 45, 45, 45, 45, 45, 198, 45, 45, 45, 378, 45, 45, 45, 45, 45, 45, 393, 45, 45, 45, 398, 45, 97, 97, 1116, 97, 97, 97, 1120, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1147, 1148, 97, 97, 97, 97, 97, 97, 97, 1129, 97, 97, 1132, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1626, 97, 97, 97, 97, 0, 45, 1178, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1185, 45, 45, 45, 45, 441, 45, 45, 45, 45, 45, 45, 451, 45, 45, 67, 67, 67, 67, 67, 227, 67, 67, 67, 67, 67, 67, 67, 67, 1260, 67, 67, 67, 1263, 67, 67, 1265, 1203, 45, 45, 1205, 45, 1206, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1216, 67, 1266, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1276, 67, 67, 67, 67, 67, 67, 492, 67, 67, 67, 67, 67, 67, 67, 67, 67, 471, 67, 67, 67, 67, 481, 67, 45, 1386, 45, 1389, 45, 45, 45, 45, 1394, 45, 45, 45, 1397, 45, 45, 45, 45, 995, 45, 997, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 1915, 67, 67, 67, 67, 67, 1422, 45, 45, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1433, 67, 1436, 67, 67, 67, 67, 1441, 67, 67, 67, 1444, 67, 67, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 281, 28809, 53531, 97, 97, 97, 97, 1494, 97, 97, 97, 1497, 97, 97, 97, 97, 97, 97, 97, 1368, 97, 97, 97, 97, 97, 97, 97, 97, 851, 97, 97, 97, 97, 97, 97, 97, 67, 67, 67, 1571, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 67, 67, 1583, 67, 67, 67, 67, 67, 67, 67, 67, 1591, 67, 67, 67, 67, 67, 67, 752, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1056, 67, 67, 67, 67, 67, 67, 97, 1634, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1125, 97, 97, 97, 1647, 97, 97, 97, 97, 97, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1183, 45, 45, 45, 45, 45, 45, 45, 45, 45, 409, 45, 45, 45, 45, 45, 45, 1658, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1668, 1712, 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 0, 0, 1835, 97, 97, 97, 97, 0, 0, 0, 97, 97, 1844, 97, 97, 1726, 0, 97, 97, 97, 97, 97, 1732, 97, 1734, 97, 97, 97, 97, 97, 300, 97, 308, 97, 97, 97, 97, 97, 97, 97, 97, 866, 97, 97, 97, 97, 97, 97, 97, 67, 67, 67, 1758, 67, 67, 67, 1762, 67, 67, 67, 67, 67, 67, 67, 67, 1043, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1771, 67, 67, 67, 97, 97, 97, 97, 97, 1776, 97, 97, 97, 97, 297, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1108, 97, 97, 97, 97, 67, 67, 67, 1966, 97, 97, 97, 1970, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 97, 1720, 97, 97, 97, 97, 97, 0, 0, 97, 97, 97, 1837, 97, 0, 1840, 1841, 97, 97, 97, 1988, 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1994, 1995, 67, 97, 97, 97, 97, 97, 1103, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 917, 97, 97, 0, 0, 0, 67, 67, 265, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 345, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 131427, 0, 0, 0, 361, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 671, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 411, 45, 45, 414, 45, 45, 45, 45, 377, 45, 45, 45, 386, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1223, 45, 45, 45, 45, 45, 45, 45, 45, 45, 426, 45, 45, 433, 45, 45, 45, 67, 67, 67, 67, 67, 463, 67, 67, 67, 472, 67, 67, 67, 67, 67, 67, 67, 527, 67, 67, 67, 67, 67, 67, 537, 67, 540, 24850, 24850, 12564, 12564, 0, 57889, 0, 0, 0, 53531, 53531, 367, 286, 97, 97, 97, 97, 97, 1119, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1509, 97, 97, 97, 97, 97, 97, 97, 97, 564, 97, 97, 97, 97, 97, 97, 97, 637, 18, 131427, 0, 0, 0, 0, 0, 0, 362, 0, 0, 365, 29315, 367, 0, 921, 29315, 0, 0, 0, 927, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1234, 45, 45, 45, 45, 67, 67, 67, 67, 1240, 45, 697, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 708, 45, 45, 45, 45, 1221, 45, 45, 45, 45, 1225, 45, 45, 45, 45, 45, 45, 384, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1210, 45, 45, 45, 45, 45, 45, 67, 67, 795, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1470, 67, 67, 67, 67, 67, 67, 67, 815, 67, 67, 67, 67, 67, 67, 25398, 542, 13112, 544, 97, 97, 97, 893, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1164, 97, 97, 97, 67, 67, 67, 1025, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1687, 67, 67, 67, 67, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 0, 0, 0, 1097, 1241, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1450, 45, 45, 1388, 45, 1390, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1236, 67, 67, 67, 67, 67, 1437, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1472, 1490, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1503, 67, 67, 67, 67, 67, 97, 97, 97, 97, 97, 0, 1930, 0, 97, 97, 97, 97, 97, 847, 97, 97, 97, 97, 97, 97, 97, 97, 97, 858, 67, 67, 1965, 67, 97, 97, 97, 97, 0, 0, 0, 97, 97, 97, 97, 0, 97, 97, 1719, 97, 97, 97, 97, 97, 97, 0, 0, 0, 45, 45, 45, 45, 1382, 45, 1383, 45, 45, 45, 159, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1563, 45, 45, 45, 45, 45, 67, 261, 67, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 341, 97, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 97, 1099, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1333, 97, 1230, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 67, 1992, 67, 1993, 67, 67, 67, 97, 97, 45, 45, 160, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1665, 45, 45, 45, 45, 45, 131427, 357, 0, 0, 0, 362, 0, 365, 28809, 367, 139, 45, 45, 45, 45, 45, 684, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 412, 45, 45, 45, 416, 45, 45, 45, 440, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, 1990, 67, 1991, 67, 67, 67, 67, 67, 67, 67, 97, 97, 1707, 97, 97, 97, 97, 97, 97, 501, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1691, 67, 67, 67, 67, 67, 526, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1030, 67, 1032, 67, 67, 67, 67, 598, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1632, 0, 921, 29315, 923, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1404, 45, 45, 45, 45, 45, 45, 45, 45, 45, 425, 45, 45, 45, 45, 45, 45, 67, 67, 67, 67, 67, 25398, 0, 13112, 0, 54074, 0, 0, 1093, 0, 0, 0, 0, 0, 97, 1609, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1369, 97, 97, 97, 1372, 97, 97, 67, 67, 266, 67, 67, 67, 67, 0, 24850, 12564, 0, 0, 0, 0, 28809, 53531, 97, 346, 97, 97, 97, 97, 0, 40976, 0, 18, 18, 24, 24, 27, 27, 27, 665, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1677, 45, 45, 45, 45, 67, 45, 45, 954, 45, 956, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1545, 45, 45, 45, 45, 45, 45, 45, 45, 45, 448, 45, 45, 45, 45, 67, 456, 67, 67, 67, 67, 67, 1270, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1069, 67, 67, 67, 67, 67, 67, 97, 97, 97, 1350, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1524, 97, 97, 97, 97, 97, 97, 97, 1376, 0, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 1559, 1561, 45, 45, 45, 1564, 45, 1566, 1567, 45, 67, 67, 67, 67, 67, 1573, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 1247, 67, 67, 67, 67, 67, 1252, 97, 1725, 97, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1628, 97, 1630, 0, 0, 94242, 0, 0, 0, 2211840, 0, 1118208, 0, 0, 0, 0, 2158592, 2158731, 2158592, 2158592, 2158592, 3117056, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3018752, 2158592, 3043328, 2158592, 2158592, 2158592, 2158592, 3080192, 2158592, 2158592, 3112960, 2158592, 2158592, 2158592, 2158592, 2158592, 2158878, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2605056, 2158592, 2158592, 2207744, 0, 542, 0, 544, 0, 0, 2166784, 0, 0, 0, 550, 0, 0, 2158592, 2158592, 2686976, 2158592, 2715648, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2867200, 2158592, 2904064, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 0, 94242, 0, 0, 0, 2211840, 0, 0, 1130496, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 3186688, 2158592, 0, 0, 139, 0, 0, 0, 139, 0, 2367488, 2207744, 0, 0, 0, 0, 176128, 0, 2166784, 0, 0, 0, 0, 0, 286, 2158592, 2158592, 3170304, 3174400, 2158592, 0, 0, 0, 2158592, 2158592, 2158592, 2158592, 2158592, 2424832, 2158592, 2158592, 2158592, 1508, 2158592, 2908160, 2158592, 2158592, 2158592, 2977792, 2158592, 2158592, 2158592, 2158592, 3039232, 2158592, 2158592, 2158592, 2158592, 2158592, 2158592, 3158016, 67, 24850, 24850, 12564, 12564, 0, 0, 0, 0, 0, 53531, 53531, 0, 286, 97, 97, 97, 97, 97, 1144, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 1149, 97, 97, 97, 97, 1154, 57889, 0, 0, 0, 0, 550, 0, 97, 97, 97, 97, 97, 97, 97, 97, 97, 561, 97, 97, 97, 97, 97, 97, 576, 97, 97, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 139264, 0, 0, 139264, 0, 921, 29315, 0, 0, 926, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 719, 720, 45, 45, 45, 45, 45, 45, 45, 45, 685, 45, 45, 45, 45, 45, 45, 45, 45, 45, 942, 45, 45, 946, 45, 45, 45, 950, 45, 45, 0, 2146304, 2146304, 0, 0, 0, 0, 2224128, 2224128, 2224128, 2232320, 2232320, 2232320, 2232320, 0, 0, 1301, 0, 0, 0, 0, 0, 1307, 0, 0, 0, 0, 0, 1313, 0, 0, 0, 0, 0, 0, 0, 97, 97, 1318, 97, 97, 97, 97, 97, 97, 1795, 97, 97, 45, 45, 45, 45, 45, 45, 45, 446, 45, 45, 45, 45, 45, 45, 67, 67, 2158592, 2146304, 0, 0, 0, 0, 0, 0, 0, 2211840, 0, 0, 0, 0, 2158592, 0, 921, 29315, 0, 924, 0, 0, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1000, 45, 45, 45, 45, 67, 67 +]; + +XQueryTokenizer.EXPECTED = +[ 290, 300, 304, 353, 296, 309, 305, 319, 315, 324, 328, 352, 354, 334, 338, 330, 320, 345, 349, 293, 358, 362, 341, 366, 312, 370, 374, 378, 382, 386, 390, 394, 398, 737, 402, 634, 439, 604, 634, 634, 634, 634, 408, 634, 634, 634, 404, 634, 634, 634, 457, 634, 634, 963, 634, 634, 413, 634, 634, 634, 634, 634, 634, 634, 663, 418, 422, 903, 902, 426, 431, 548, 634, 437, 521, 919, 443, 615, 409, 449, 455, 624, 731, 751, 634, 461, 465, 672, 470, 469, 474, 481, 485, 477, 489, 493, 629, 542, 497, 505, 603, 602, 991, 648, 510, 804, 634, 515, 958, 526, 525, 530, 768, 634, 546, 552, 711, 710, 593, 558, 562, 618, 566, 570, 574, 578, 582, 586, 590, 608, 612, 660, 822, 821, 634, 622, 596, 444, 628, 533, 724, 633, 640, 653, 647, 652, 536, 1008, 451, 450, 445, 657, 670, 676, 685, 689, 693, 697, 701, 704, 707, 715, 719, 798, 815, 634, 723, 762, 996, 634, 728, 969, 730, 735, 908, 634, 741, 679, 889, 511, 747, 634, 750, 755, 499, 666, 499, 501, 759, 772, 776, 780, 634, 787, 784, 797, 802, 809, 808, 427, 814, 1006, 517, 634, 519, 853, 634, 813, 850, 793, 634, 819, 826, 833, 832, 837, 843, 847, 857, 861, 863, 867, 871, 875, 879, 883, 643, 887, 539, 980, 979, 634, 893, 944, 634, 900, 896, 634, 907, 933, 506, 912, 917, 828, 433, 636, 635, 554, 961, 923, 930, 927, 937, 941, 634, 634, 634, 974, 948, 952, 985, 913, 968, 967, 743, 634, 973, 839, 634, 978, 599, 634, 984, 989, 765, 444, 995, 1000, 634, 1003, 790, 955, 1012, 681, 634, 634, 634, 634, 634, 414, 1016, 1020, 1024, 1085, 1027, 1090, 1090, 1046, 1080, 1137, 1108, 1215, 1049, 1032, 1039, 1085, 1085, 1085, 1085, 1058, 1062, 1068, 1085, 1086, 1090, 1090, 1091, 1072, 1064, 1107, 1090, 1090, 1090, 1118, 1123, 1138, 1078, 1074, 1084, 1085, 1085, 1085, 1087, 1090, 1062, 1052, 1060, 1114, 1062, 1104, 1085, 1085, 1090, 1090, 1028, 1122, 1063, 1128, 1139, 1127, 1158, 1085, 1085, 1151, 1090, 1090, 1090, 1095, 1090, 1132, 1073, 1136, 1143, 1061, 1150, 1085, 1155, 1098, 1101, 1146, 1162, 1169, 1101, 1185, 1151, 1090, 1110, 1173, 1054, 1087, 1109, 1177, 1165, 1089, 1204, 1184, 1107, 1189, 1193, 1088, 1197, 1180, 1201, 1208, 1042, 1212, 1219, 1223, 1227, 1231, 1235, 1245, 1777, 1527, 1686, 1686, 1238, 1686, 1254, 1686, 1686, 1686, 1294, 1669, 1686, 1686, 1686, 1322, 1625, 1534, 1268, 1624, 1275, 1281, 1443, 1292, 1300, 1686, 1686, 1686, 1350, 1826, 1306, 1686, 1686, 1240, 2032, 1317, 1321, 1686, 1686, 1253, 1686, 1326, 1686, 1686, 1686, 1418, 1709, 1446, 1686, 1686, 1686, 1492, 1686, 1295, 1447, 1686, 1686, 1258, 1686, 1736, 1686, 1686, 1520, 1355, 1686, 1288, 1348, 1361, 1686, 1359, 1686, 1364, 1498, 1368, 1302, 1362, 1381, 1389, 1395, 1486, 1686, 1371, 1377, 1370, 1686, 1375, 1382, 1384, 1402, 1408, 1385, 1383, 1619, 1413, 1423, 1428, 1433, 1686, 1686, 1270, 1686, 1338, 1686, 1440, 1686, 1686, 1686, 1499, 1465, 1686, 1686, 1686, 1639, 1473, 1884, 1686, 1686, 1293, 1864, 1686, 1686, 1296, 1321, 1483, 1686, 1686, 1686, 1646, 1686, 1748, 1496, 1686, 1418, 1675, 1686, 1418, 1702, 1686, 1418, 1981, 1686, 1429, 1409, 1427, 1504, 1692, 1686, 1686, 1313, 1448, 1651, 1508, 1686, 1686, 1340, 1686, 1903, 1686, 1686, 1435, 1513, 1686, 1283, 1287, 1519, 1686, 1524, 1363, 1568, 1938, 1539, 1566, 1579, 1479, 1533, 1538, 1553, 1544, 1552, 1557, 1563, 1574, 1557, 1583, 1589, 1590, 1759, 1594, 1603, 1607, 1611, 1686, 1436, 1514, 1686, 1434, 1656, 1686, 1434, 1680, 1686, 1453, 1686, 1686, 1686, 1559, 1617, 1686, 1770, 1418, 1623, 1769, 1629, 1686, 1515, 1335, 1686, 1285, 1686, 1671, 1921, 1650, 1686, 1686, 1344, 1308, 1666, 1686, 1686, 1686, 1659, 1685, 1686, 1686, 1686, 1686, 1241, 1686, 1686, 1844, 1691, 1686, 1630, 1977, 1970, 1362, 1686, 1686, 1686, 1693, 1698, 1686, 1686, 1686, 1697, 1686, 1764, 1715, 1686, 1634, 1638, 1686, 1599, 1585, 1686, 1271, 1686, 1269, 1686, 1721, 1686, 1686, 1354, 1686, 1801, 1686, 1799, 1686, 1640, 1686, 1686, 1461, 1686, 1686, 1732, 1686, 1944, 1686, 1740, 1686, 1746, 1415, 1396, 1686, 1598, 1547, 1417, 1597, 1416, 1577, 1546, 1397, 1577, 1547, 1548, 1570, 1398, 1753, 1686, 1652, 1509, 1686, 1686, 1686, 1757, 1686, 1419, 1686, 1763, 1418, 1768, 1781, 1686, 1686, 1686, 1705, 1686, 2048, 1792, 1686, 1686, 1686, 1735, 1686, 1797, 1686, 1686, 1404, 1686, 1639, 1815, 1686, 1686, 1418, 2017, 1820, 1686, 1686, 1803, 1686, 1686, 1686, 1736, 1489, 1686, 1686, 1825, 1338, 1260, 1263, 1686, 1686, 1785, 1686, 1686, 1728, 1686, 1686, 1749, 1497, 1830, 1830, 1262, 1248, 1261, 1329, 1260, 1264, 1329, 1248, 1249, 1259, 1540, 1849, 1842, 1686, 1686, 1835, 1686, 1686, 1816, 1686, 1686, 1831, 1882, 1848, 1686, 1686, 1686, 1774, 2071, 1854, 1686, 1686, 1469, 1884, 1686, 1821, 1859, 1686, 1686, 1350, 1883, 1686, 1686, 1686, 1781, 1391, 1875, 1686, 1686, 1613, 1644, 1686, 1686, 1889, 1686, 1686, 1662, 1884, 1686, 1885, 1890, 1686, 1686, 1686, 1894, 1686, 1686, 1678, 1686, 1907, 1686, 1686, 1529, 1914, 1686, 1838, 1686, 1686, 1881, 1686, 1686, 1872, 1876, 1836, 1919, 1686, 1837, 1692, 1910, 1686, 1925, 1928, 1742, 1686, 1811, 1811, 1930, 1810, 1929, 1935, 1928, 1900, 1942, 1867, 1868, 1931, 1035, 1788, 1948, 1952, 1956, 1960, 1964, 1686, 1976, 1686, 1686, 1686, 2065, 1686, 1992, 2037, 1686, 1686, 1998, 2009, 1972, 2002, 1686, 1686, 1686, 2077, 1300, 2023, 1686, 1686, 1686, 1807, 2031, 1686, 1686, 1686, 1860, 1500, 2032, 1686, 1686, 1686, 2083, 1686, 2036, 1686, 1277, 1276, 2042, 1877, 1686, 1686, 2041, 1686, 1686, 2027, 2037, 2012, 1686, 2012, 1855, 1850, 1686, 2046, 1686, 1686, 2054, 1996, 1686, 1897, 1309, 2059, 2052, 1686, 2058, 1686, 1686, 2081, 1686, 1717, 1477, 1686, 1331, 1686, 1686, 1687, 1686, 1860, 1681, 1686, 1686, 1686, 1966, 1724, 1686, 1686, 1686, 1984, 2015, 1686, 1686, 1686, 1988, 1686, 2063, 1686, 1686, 1686, 2005, 1686, 1727, 1686, 1686, 1711, 1457, 2069, 1686, 1686, 1686, 2019, 2075, 1686, 1686, 1915, 1686, 1686, 1793, 1874, 1686, 1686, 1491, 1362, 1449, 1686, 1686, 1460, 2098, 2087, 2091, 2095, 2184, 2102, 2113, 2780, 2117, 2134, 2142, 2281, 2146, 2146, 2146, 2304, 2296, 2181, 2639, 2591, 2872, 2592, 2873, 2313, 2195, 2200, 2281, 2146, 2273, 2226, 2204, 2152, 2219, 2276, 2167, 2177, 2276, 2235, 2276, 2276, 2230, 2281, 2276, 2296, 2276, 2293, 2276, 2276, 2276, 2276, 2234, 2276, 2311, 2314, 2210, 2199, 2217, 2222, 2276, 2276, 2276, 2240, 2276, 2294, 2276, 2276, 2173, 2276, 2198, 2281, 2281, 2281, 2281, 2282, 2146, 2146, 2146, 2146, 2205, 2146, 2204, 2248, 2276, 2235, 2276, 2297, 2276, 2276, 2276, 2277, 2256, 2281, 2283, 2146, 2146, 2146, 2275, 2276, 2295, 2276, 2276, 2293, 2146, 2304, 2264, 2269, 2221, 2276, 2276, 2276, 2293, 2295, 2276, 2276, 2276, 2295, 2263, 2205, 2268, 2220, 2172, 2276, 2276, 2276, 2296, 2276, 2276, 2296, 2294, 2276, 2276, 2278, 2281, 2281, 2280, 2281, 2281, 2281, 2283, 2206, 2223, 2276, 2276, 2279, 2281, 2281, 2146, 2273, 2276, 2276, 2281, 2281, 2281, 2276, 2292, 2276, 2298, 2225, 2276, 2298, 2169, 2224, 2292, 2298, 2171, 2229, 2281, 2281, 2171, 2236, 2281, 2281, 2281, 2146, 2275, 2225, 2292, 2299, 2276, 2229, 2281, 2146, 2276, 2290, 2297, 2283, 2146, 2146, 2274, 2224, 2227, 2298, 2225, 2297, 2276, 2230, 2170, 2230, 2282, 2146, 2147, 2151, 2156, 2288, 2276, 2230, 2303, 2308, 2236, 2284, 2228, 2318, 2318, 2318, 2326, 2335, 2339, 2343, 2349, 2416, 2693, 2357, 2592, 2109, 2592, 2592, 2162, 2943, 2823, 2646, 2592, 2361, 2592, 2122, 2592, 2592, 2122, 2470, 2592, 2592, 2592, 2109, 2107, 2592, 2592, 2592, 2123, 2592, 2592, 2592, 2125, 2592, 2413, 2592, 2592, 2592, 2127, 2592, 2592, 2414, 2592, 2592, 2592, 2130, 2952, 2592, 2594, 2592, 2592, 2212, 2609, 2252, 2592, 2592, 2592, 2446, 2434, 2592, 2592, 2592, 2212, 2446, 2450, 2456, 2431, 2435, 2592, 2592, 2243, 2478, 2448, 2439, 2946, 2592, 2592, 2592, 2368, 2809, 2813, 2450, 2441, 2212, 2812, 2449, 2440, 2947, 2592, 2592, 2592, 2345, 2451, 2457, 2948, 2592, 2124, 2592, 2592, 2650, 2823, 2449, 2455, 2946, 2592, 2128, 2592, 2592, 2649, 2952, 2592, 2810, 2448, 2461, 2991, 2467, 2592, 2592, 2329, 2817, 2474, 2990, 2466, 2592, 2592, 2373, 2447, 2992, 2469, 2592, 2592, 2592, 2373, 2447, 2477, 2468, 2592, 2592, 2353, 2469, 2592, 2495, 2592, 2592, 2415, 2483, 2592, 2415, 2496, 2592, 2592, 2352, 2592, 2592, 2352, 2352, 2469, 2592, 2592, 2363, 2331, 2494, 2592, 2592, 2592, 2375, 2592, 2375, 2415, 2504, 2592, 2592, 2367, 2372, 2503, 2592, 2592, 2592, 2389, 2418, 2415, 2592, 2592, 2373, 2592, 2592, 2592, 2593, 2732, 2417, 2415, 2592, 2417, 2520, 2592, 2592, 2592, 2390, 2521, 2521, 2592, 2592, 2592, 2401, 2599, 2585, 2526, 2531, 2120, 2592, 2212, 2426, 2450, 2463, 2948, 2592, 2592, 2592, 2213, 2389, 2527, 2532, 2121, 2542, 2551, 2105, 2592, 2213, 2592, 2592, 2592, 2558, 2538, 2544, 2553, 2557, 2537, 2543, 2552, 2421, 2572, 2576, 2546, 2543, 2547, 2592, 2592, 2373, 2615, 2575, 2545, 2105, 2592, 2244, 2479, 2592, 2129, 2592, 2592, 2628, 2690, 2469, 2562, 2566, 2592, 2592, 2592, 2415, 2928, 2934, 2401, 2570, 2574, 2564, 2572, 2585, 2590, 2592, 2592, 2585, 2965, 2592, 2592, 2592, 2445, 2251, 2592, 2592, 2592, 2474, 2592, 2609, 2892, 2592, 2362, 2592, 2592, 2138, 2851, 2159, 2592, 2592, 2592, 2509, 2888, 2892, 2592, 2592, 2592, 2490, 2418, 2891, 2592, 2592, 2376, 2592, 2592, 2374, 2592, 2889, 2388, 2592, 2373, 2373, 2890, 2592, 2592, 2387, 2592, 2887, 2505, 2892, 2592, 2373, 2610, 2388, 2592, 2592, 2376, 2373, 2592, 2887, 2891, 2592, 2374, 2592, 2592, 2608, 2159, 2614, 2620, 2592, 2592, 2394, 2594, 2887, 2399, 2592, 2887, 2397, 2508, 2374, 2507, 2592, 2375, 2592, 2592, 2592, 2595, 2508, 2506, 2592, 2506, 2505, 2505, 2592, 2507, 2637, 2505, 2592, 2592, 2401, 2661, 2592, 2643, 2592, 2592, 2417, 2592, 2655, 2592, 2592, 2592, 2510, 2414, 2656, 2592, 2592, 2592, 2516, 2592, 2593, 2660, 2665, 2880, 2592, 2592, 2592, 2522, 2767, 2666, 2881, 2592, 2592, 2420, 2571, 2696, 2592, 2592, 2592, 2580, 2572, 2686, 2632, 2698, 2592, 2383, 2514, 2592, 2163, 2932, 2465, 2685, 2631, 2697, 2592, 2388, 2592, 2592, 2212, 2604, 2671, 2632, 2678, 2592, 2401, 2405, 2409, 2592, 2592, 2592, 2679, 2592, 2592, 2592, 2592, 2108, 2677, 2591, 2592, 2592, 2592, 2419, 2592, 2683, 2187, 2191, 2469, 2671, 2189, 2467, 2592, 2401, 2629, 2633, 2702, 2468, 2592, 2592, 2421, 2536, 2703, 2469, 2592, 2592, 2422, 2573, 2593, 2672, 2467, 2592, 2402, 2406, 2592, 2402, 2979, 2592, 2592, 2626, 2673, 2467, 2592, 2446, 2259, 2947, 2592, 2377, 2709, 2592, 2592, 2522, 2862, 2713, 2468, 2592, 2592, 2581, 2572, 2562, 2374, 2374, 2592, 2376, 2721, 2724, 2592, 2592, 2624, 2373, 2731, 2592, 2592, 2592, 2626, 2732, 2592, 2592, 2592, 2755, 2656, 2726, 2736, 2741, 2592, 2486, 2593, 2381, 2592, 2727, 2737, 2742, 2715, 2747, 2753, 2592, 2498, 2469, 2873, 2743, 2592, 2592, 2592, 2791, 2759, 2763, 2592, 2592, 2627, 2704, 2592, 2592, 2522, 2789, 2593, 2761, 2753, 2592, 2498, 2863, 2592, 2592, 2767, 2592, 2592, 2592, 2792, 2789, 2592, 2592, 2592, 2803, 2126, 2592, 2592, 2592, 2811, 2122, 2592, 2592, 2592, 2834, 2777, 2592, 2592, 2592, 2848, 2936, 2591, 2489, 2797, 2592, 2592, 2670, 2631, 2490, 2798, 2592, 2592, 2592, 2963, 2807, 2592, 2592, 2592, 2965, 2838, 2592, 2592, 2592, 2975, 2330, 2818, 2829, 2592, 2498, 2939, 2592, 2498, 2592, 2791, 2331, 2819, 2830, 2592, 2592, 2592, 2982, 2834, 2817, 2828, 2106, 2592, 2592, 2592, 2405, 2405, 2817, 2828, 2592, 2592, 2415, 2849, 2842, 2592, 2522, 2773, 2592, 2522, 2868, 2592, 2580, 2600, 2586, 2137, 2850, 2843, 2592, 2592, 2855, 2937, 2844, 2592, 2592, 2592, 2987, 2936, 2591, 2592, 2592, 2684, 2630, 2592, 2856, 2938, 2592, 2592, 2860, 2939, 2592, 2592, 2872, 2592, 2861, 2591, 2592, 2592, 2887, 2616, 2592, 2867, 2592, 2592, 2708, 2592, 2498, 2469, 2498, 2497, 2785, 2773, 2499, 2783, 2770, 2877, 2877, 2877, 2772, 2592, 2592, 2345, 2885, 2592, 2592, 2592, 2715, 2762, 2515, 2896, 2592, 2592, 2715, 2917, 2516, 2897, 2592, 2592, 2592, 2901, 2906, 2911, 2592, 2592, 2956, 2960, 2715, 2902, 2907, 2912, 2593, 2916, 2920, 2820, 2922, 2822, 2592, 2592, 2715, 2927, 2921, 2821, 2106, 2592, 2592, 2974, 2408, 2321, 2821, 2106, 2592, 2592, 2983, 2592, 2593, 2404, 2408, 2592, 2592, 2717, 2749, 2716, 2928, 2322, 2822, 2593, 2926, 2919, 2820, 2934, 2823, 2592, 2592, 2592, 2651, 2824, 2592, 2592, 2592, 2130, 2952, 2592, 2592, 2592, 2592, 2964, 2592, 2592, 2716, 2748, 2592, 2969, 2592, 2592, 2716, 2918, 2368, 2970, 2592, 2592, 2592, 2403, 2407, 2592, 2592, 2787, 2211, 2404, 2409, 2592, 2592, 2802, 2837, 2987, 2592, 2592, 2592, 2809, 2427, 2592, 2793, 2592, 2592, 2809, 2447, 1073741824, 0x80000000, 539754496, 542375936, 402653184, 554434560, 571736064, 545521856, 268451840, 335544320, 268693630, 512, 2048, 256, 1024, 0, 1024, 0, 1073741824, 0x80000000, 0, 0, 0, 8388608, 0, 0, 1073741824, 1073741824, 0, 0x80000000, 537133056, 4194304, 1048576, 268435456, -1073741824, 0, 0, 0, 1048576, 0, 0, 0, 1572864, 0, 0, 0, 4194304, 0, 134217728, 16777216, 0, 0, 32, 64, 98304, 0, 33554432, 8388608, 192, 67108864, 67108864, 67108864, 67108864, 16, 32, 4, 0, 8192, 196608, 196608, 229376, 80, 4096, 524288, 8388608, 0, 0, 32, 128, 256, 24576, 24600, 24576, 24576, 2, 24576, 24576, 24576, 24584, 24592, 24576, 24578, 24576, 24578, 24576, 24576, 16, 512, 2048, 2048, 256, 4096, 32768, 1048576, 4194304, 67108864, 134217728, 268435456, 262144, 134217728, 0, 128, 128, 64, 16384, 16384, 16384, 67108864, 32, 32, 4, 4, 4096, 262144, 134217728, 0, 0, 0, 2, 0, 8192, 131072, 131072, 4096, 4096, 4096, 4096, 24576, 24576, 24576, 8, 8, 24576, 24576, 16384, 16384, 16384, 24576, 24584, 24576, 24576, 24576, 16384, 24576, 536870912, 262144, 0, 0, 32, 2048, 8192, 4, 4096, 4096, 4096, 786432, 8388608, 16777216, 0, 128, 16384, 16384, 16384, 32768, 65536, 2097152, 32, 32, 32, 32, 4, 4, 4, 4, 4, 4096, 67108864, 67108864, 67108864, 24576, 24576, 24576, 24576, 0, 16384, 16384, 16384, 16384, 67108864, 67108864, 8, 67108864, 24576, 8, 8, 8, 24576, 24576, 24576, 24578, 24576, 24576, 24576, 2, 2, 2, 16384, 67108864, 67108864, 67108864, 32, 67108864, 8, 8, 24576, 2048, 0x80000000, 536870912, 262144, 262144, 262144, 67108864, 8, 24576, 16384, 32768, 1048576, 4194304, 25165824, 67108864, 24576, 32770, 2, 4, 112, 512, 98304, 524288, 50, 402653186, 1049090, 1049091, 10, 66, 100925514, 10, 66, 12582914, 0, 0, -1678194207, -1678194207, -1041543218, 0, 32768, 0, 0, 32, 65536, 268435456, 1, 1, 513, 1048577, 0, 12582912, 0, 0, 0, 4, 1792, 0, 0, 0, 7, 29360128, 0, 0, 0, 8, 0, 0, 0, 12, 1, 1, 0, 0, -604102721, -604102721, 4194304, 8388608, 0, 0, 0, 31, 925600, 997981306, 997981306, 997981306, 0, 0, 2048, 8388608, 0, 0, 1, 2, 4, 32, 64, 512, 8192, 0, 0, 0, 245760, 997720064, 0, 0, 0, 32, 0, 0, 0, 3, 12, 16, 32, 8, 112, 3072, 12288, 16384, 32768, 65536, 131072, 7864320, 16777216, 973078528, 0, 0, 65536, 131072, 3670016, 4194304, 16777216, 33554432, 2, 8, 48, 2048, 8192, 16384, 32768, 65536, 131072, 524288, 131072, 524288, 3145728, 4194304, 16777216, 33554432, 65536, 131072, 2097152, 4194304, 16777216, 33554432, 134217728, 268435456, 536870912, 0, 0, 0, 1024, 0, 8, 48, 2048, 8192, 65536, 33554432, 268435456, 536870912, 65536, 268435456, 536870912, 0, 0, 32768, 0, 0, 126, 623104, 65011712, 0, 32, 65536, 536870912, 0, 0, 65536, 524288, 0, 32, 65536, 0, 0, 0, 2048, 0, 0, 0, 15482, 245760, -604102721, 0, 0, 0, 18913, 33062912, 925600, -605028352, 0, 0, 0, 65536, 31, 8096, 131072, 786432, 3145728, 3145728, 12582912, 50331648, 134217728, 268435456, 160, 256, 512, 7168, 131072, 786432, 131072, 786432, 1048576, 2097152, 12582912, 16777216, 268435456, 1073741824, 0x80000000, 12582912, 16777216, 33554432, 268435456, 1073741824, 0x80000000, 3, 12, 16, 160, 256, 7168, 786432, 1048576, 12582912, 16777216, 268435456, 1073741824, 0, 8, 16, 32, 128, 256, 512, 7168, 786432, 1048576, 2097152, 0, 1, 2, 8, 16, 7168, 786432, 1048576, 8388608, 16777216, 16777216, 1073741824, 0, 0, 0, 0, 1, 0, 0, 8, 32, 128, 256, 7168, 8, 32, 0, 3072, 0, 8, 32, 3072, 4096, 524288, 8, 32, 0, 0, 3072, 4096, 0, 2048, 524288, 8388608, 8, 2048, 0, 0, 1, 12, 256, 4096, 32768, 262144, 1048576, 4194304, 67108864, 0, 2048, 0, 2048, 2048, 1073741824, -58805985, -58805985, -58805985, 0, 0, 262144, 0, 0, 32, 4194304, 16777216, 134217728, 4382, 172032, -58982400, 0, 0, 2, 28, 256, 4096, 8192, 8192, 32768, 131072, 262144, 524288, 1, 2, 12, 256, 4096, 0, 0, 4194304, 67108864, 134217728, 805306368, 1073741824, 0, 0, 1, 2, 12, 16, 256, 4096, 1048576, 67108864, 134217728, 268435456, 0, 512, 1048576, 4194304, 201326592, 1879048192, 0, 0, 12, 256, 4096, 134217728, 268435456, 536870912, 12, 256, 268435456, 536870912, 0, 12, 256, 0, 0, 1, 32, 64, 512, 0, 0, 205236961, 205236961, 0, 0, 0, 1, 96, 640, 1, 10976, 229376, 204996608, 0, 640, 2048, 8192, 229376, 1572864, 1572864, 2097152, 201326592, 0, 0, 0, 64, 512, 2048, 229376, 1572864, 201326592, 1572864, 201326592, 0, 0, 1, 4382, 0, 1, 32, 2048, 65536, 131072, 1572864, 201326592, 131072, 1572864, 134217728, 0, 0, 524288, 524288, 0, 0, 0, -68582786, -68582786, -68582786, 0, 0, 2097152, 524288, 0, 524288, 0, 0, 65536, 131072, 1572864, 0, 0, 2, 4, 0, 0, 65011712, -134217728, 0, 0, 0, 0, 2, 4, 120, 512, -268435456, 0, 0, 0, 2, 8, 48, 64, 2048, 8192, 98304, 524288, 2097152, 4194304, 25165824, 33554432, 134217728, 268435456, 0x80000000, 0, 0, 25165824, 33554432, 134217728, 1879048192, 0x80000000, 0, 0, 4, 112, 512, 622592, 65011712, 134217728, -268435456, 16777216, 33554432, 134217728, 1610612736, 0, 0, 0, 64, 98304, 524288, 4194304, 16777216, 33554432, 0, 98304, 524288, 16777216, 33554432, 0, 65536, 524288, 33554432, 536870912, 1073741824, 0, 65536, 524288, 536870912, 1073741824, 0, 0, 65536, 524288, 536870912, 0, 524288, 0, 524288, 524288, 1048576, 2086666240, 0x80000000, 0, -1678194207, 0, 0, 0, 8, 32, 2048, 524288, 8388608, 0, 0, 33062912, 436207616, 0x80000000, 0, 0, 32, 64, 2432, 16384, 32768, 32768, 524288, 3145728, 4194304, 25165824, 25165824, 167772160, 268435456, 0x80000000, 0, 32, 64, 384, 2048, 16384, 32768, 1048576, 2097152, 4194304, 25165824, 32, 64, 128, 256, 2048, 16384, 2048, 16384, 1048576, 4194304, 16777216, 33554432, 134217728, 536870912, 1073741824, 0, 0, 2048, 16384, 4194304, 16777216, 33554432, 134217728, 805306368, 0, 0, 16777216, 134217728, 268435456, 0x80000000, 0, 622592, 622592, 622592, 8807, 8807, 434791, 0, 0, 16777216, 0, 0, 0, 7, 608, 8192, 0, 0, 0, 3, 4, 96, 512, 32, 64, 8192, 0, 0, 16777216, 134217728, 0, 0, 2, 4, 8192, 16384, 65536, 2097152, 33554432, 268435456 +]; + +XQueryTokenizer.TOKEN = +[ + "(0)", + "ModuleDecl", + "Annotation", + "OptionDecl", + "Operator", + "Variable", + "Tag", + "EndTag", + "PragmaContents", + "DirCommentContents", + "DirPIContents", + "CDataSectionContents", + "AttrTest", + "Wildcard", + "EQName", + "IntegerLiteral", + "DecimalLiteral", + "DoubleLiteral", + "PredefinedEntityRef", + "'\"\"'", + "EscapeApos", + "QuotChar", + "AposChar", + "ElementContentChar", + "QuotAttrContentChar", + "AposAttrContentChar", + "NCName", + "QName", + "S", + "CharRef", + "CommentContents", + "DocTag", + "DocCommentContents", + "EOF", + "'!'", + "'\"'", + "'#'", + "'#)'", + "''''", + "'('", + "'(#'", + "'(:'", + "'(:~'", + "')'", + "'*'", + "'*'", + "','", + "'-->'", + "'.'", + "'/'", + "'/>'", + "':'", + "':)'", + "';'", + "''), token: xmlcomment, next: function(stack){ stack.pop(); } } + ], + CData: [ + { name: 'CDataSectionContents', token: cdata }, + { name: n(']]>'), token: cdata, next: function(stack){ stack.pop(); } } + ], + PI: [ + { name: 'DirPIContents', token: pi }, + { name: n('?'), token: pi }, + { name: n('?>'), token: pi, next: function(stack){ stack.pop(); } } + ], + AposString: [ + { name: n('\'\''), token: 'string', next: function(stack){ stack.pop(); } }, + { name: 'PredefinedEntityRef', token: 'constant.language.escape' }, + { name: 'CharRef', token: 'constant.language.escape' }, + { name: 'EscapeApos', token: 'constant.language.escape' }, + { name: 'AposChar', token: 'string' } + ], + QuotString: [ + { name: n('"'), token: 'string', next: function(stack){ stack.pop(); } }, + { name: 'PredefinedEntityRef', token: 'constant.language.escape' }, + { name: 'CharRef', token: 'constant.language.escape' }, + { name: 'EscapeQuot', token: 'constant.language.escape' }, + { name: 'QuotChar', token: 'string' } + ] +}; + +exports.XQueryLexer = function(){ return new Lexer(XQueryTokenizer, Rules); }; +},{"./XQueryTokenizer":"/node_modules/xqlint/lib/lexers/XQueryTokenizer.js","./lexer":"/node_modules/xqlint/lib/lexers/lexer.js"}]},{},["/node_modules/xqlint/lib/lexers/xquery_lexer.js"]); + +}); + +ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +function is(token, type) { + return token.type.lastIndexOf(type + ".xml") > -1; +} + +var XmlBehaviour = function () { + + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { + if (text == '"' || text == "'") { + var quote = text; + var selected = session.doc.getTextRange(editor.getSelectionRange()); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return { + text: quote + selected + quote, + selection: false + }; + } + + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { + return { + text: "", + selection: [1, 1] + }; + } + + if (!token) + token = iterator.stepBackward(); + + if (!token) + return; + + while (is(token, "tag-whitespace") || is(token, "whitespace")) { + token = iterator.stepBackward(); + } + var rightSpace = !rightChar || rightChar.match(/\s/); + if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { + return { + text: quote + quote, + selection: [1, 1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + if (text == '>') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); + if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) + return; + if (is(token, "reference.attribute-value")) + return; + if (is(token, "attribute-value")) { + var firstChar = token.value.charAt(0); + if (firstChar == '"' || firstChar == "'") { + var lastChar = token.value.charAt(token.value.length - 1); + var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; + if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) + return; + } + } + while (!is(token, "tag-name")) { + token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } + } + + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); + if (is(iterator.stepBackward(), "end-tag-open")) + return; + + var element = token.value; + if (tokenRow == position.row) + element = element.substring(0, position.column - tokenColumn); + + if (this.voidElements.hasOwnProperty(element.toLowerCase())) + return; + + return { + text: ">" + "", + selection: [1, 1] + }; + } + }); + + this.add("autoindent", "insertion", function (state, action, editor, session, text) { + if (text == "\n") { + var cursor = editor.getCursorPosition(); + var line = session.getLine(cursor.row); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + var token = iterator.getCurrentToken(); + + if (token && token.type.indexOf("tag-close") !== -1) { + if (token.value == "/>") + return; + while (token && token.type.indexOf("tag-name") === -1) { + token = iterator.stepBackward(); + } + + if (!token) { + return; + } + + var tag = token.value; + var row = iterator.getCurrentTokenRow(); + token = iterator.stepBackward(); + if (!token || token.type.indexOf("end-tag") !== -1) { + return; + } + + if (this.voidElements && !this.voidElements[tag]) { + var nextToken = session.getTokenAt(cursor.row, cursor.column+1); + var line = session.getLine(row); + var nextIndent = this.$getIndent(line); + var indent = nextIndent + session.getTabString(); + + if (nextToken && nextToken.value === "') { + var position = editor.getCursorPosition(); + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken(); + var atCursor = false; + var state = JSON.parse(state).pop(); + if ((token && token.value === '>') || state !== "StartTag") return; + if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ + do { + token = iterator.stepBackward(); + } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); + } else { + atCursor = true; + } + var previous = iterator.stepBackward(); + if (!token || !hasType(token, 'meta.tag') || (previous !== null && previous.value.match('/'))) { + return + } + var tag = token.value.substring(1); + if (atCursor){ + var tag = tag.substring(0, position.column - token.start); + } + + return { + text: '>' + '', + selection: [1, 1] + } + } + }); + + } + oop.inherits(XQueryBehaviour, Behaviour); + + exports.XQueryBehaviour = XQueryBehaviour; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Range = require("../../range").Range; +var BaseFoldMode = require("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/xquery",["require","exports","module","ace/worker/worker_client","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/xquery/xquery_lexer","ace/range","ace/mode/behaviour/xquery","ace/mode/folding/cstyle","ace/anchor"], function(require, exports, module) { +"use strict"; + +var WorkerClient = require("../worker/worker_client").WorkerClient; +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var XQueryLexer = require("./xquery/xquery_lexer").XQueryLexer; +var Range = require("../range").Range; +var XQueryBehaviour = require("./behaviour/xquery").XQueryBehaviour; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; +var Anchor = require("../anchor").Anchor; + +var Mode = function() { + this.$tokenizer = new XQueryLexer(); + this.$behaviour = new XQueryBehaviour(); + this.foldingRules = new CStyleFoldMode(); + this.$highlightRules = new TextHighlightRules(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.completer = { + getCompletions: function(editor, session, pos, prefix, callback) { + if (!session.$worker) + return callback(); + session.$worker.emit("complete", { data: { pos: pos, prefix: prefix } }); + session.$worker.on("complete", function(e){ + callback(null, e.data); + }); + } + }; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + var match = line.match(/\s*(?:then|else|return|[{\(]|<\w+>)\s*$/); + if (match) + indent += tab; + return indent; + }; + + this.checkOutdent = function(state, line, input) { + if (! /^\s+$/.test(line)) + return false; + + return (/^\s*[\}\)]/).test(input); + }; + + this.autoOutdent = function(state, doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*[\}\)])/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.toggleCommentLines = function(state, doc, startRow, endRow) { + var i, line; + var outdent = true; + var re = /^\s*\(:(.*):\)/; + + for (i=startRow; i<= endRow; i++) { + if (!re.test(doc.getLine(i))) { + outdent = false; + break; + } + } + + var range = new Range(0, 0, 0, 0); + for (i=startRow; i<= endRow; i++) { + line = doc.getLine(i); + range.start.row = i; + range.end.row = i; + range.end.column = line.length; + + doc.replace(range, outdent ? line.match(re)[1] : "(:" + line + ":)"); + } + }; + + this.createWorker = function(session) { + + var worker = new WorkerClient(["ace"], "ace/mode/xquery_worker", "XQueryWorker"); + var that = this; + + worker.attachToDocument(session.getDocument()); + + worker.on("ok", function(e) { + session.clearAnnotations(); + }); + + worker.on("markers", function(e) { + session.clearAnnotations(); + that.addMarkers(e.data, session); + }); + + worker.on("highlight", function(tokens) { + that.$tokenizer.tokens = tokens.data.tokens; + that.$tokenizer.lines = session.getDocument().getAllLines(); + + var rows = Object.keys(that.$tokenizer.tokens); + for(var i=0; i < rows.length; i++) { + var row = parseInt(rows[i]); + delete session.bgTokenizer.lines[row]; + delete session.bgTokenizer.states[row]; + session.bgTokenizer.fireUpdateEvent(row, row); + } + }); + + return worker; + }; + + this.removeMarkers = function(session) { + var markers = session.getMarkers(false); + for (var id in markers) { + if (markers[id].clazz.indexOf('language_highlight_') === 0) { + session.removeMarker(id); + } + } + for (var i = 0; i < session.markerAnchors.length; i++) { + session.markerAnchors[i].detach(); + } + session.markerAnchors = []; + }; + + this.addMarkers = function(annos, mySession) { + var _self = this; + + if (!mySession.markerAnchors) mySession.markerAnchors = []; + this.removeMarkers(mySession); + mySession.languageAnnos = []; + annos.forEach(function(anno) { + var anchor = new Anchor(mySession.getDocument(), anno.pos.sl, anno.pos.sc || 0); + mySession.markerAnchors.push(anchor); + var markerId; + var colDiff = anno.pos.ec - anno.pos.sc; + var rowDiff = anno.pos.el - anno.pos.sl; + var gutterAnno = { + guttertext: anno.message, + type: anno.level || "warning", + text: anno.message + }; + + function updateFloat(single) { + if (markerId) + mySession.removeMarker(markerId); + gutterAnno.row = anchor.row; + if (anno.pos.sc !== undefined && anno.pos.ec !== undefined) { + var range = new Range(anno.pos.sl, anno.pos.sc, anno.pos.el, anno.pos.ec); + markerId = mySession.addMarker(range, "language_highlight_" + (anno.type ? anno.type : "default")); + } + if (single) mySession.setAnnotations(mySession.languageAnnos); + } + updateFloat(); + anchor.on("change", function() { + updateFloat(true); + }); + if (anno.message) mySession.languageAnnos.push(gutterAnno); + }); + mySession.setAnnotations(mySession.languageAnnos); + }; + + this.$id = "ace/mode/xquery"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/htdocs/includes/ace/mode-yaml.js b/htdocs/includes/ace/mode-yaml.js new file mode 100644 index 00000000000..8fbc403f126 --- /dev/null +++ b/htdocs/includes/ace/mode-yaml.js @@ -0,0 +1,289 @@ +ace.define("ace/mode/yaml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var YamlHighlightRules = function() { + this.$rules = { + "start" : [ + { + token : "comment", + regex : "#.*$" + }, { + token : "list.markup", + regex : /^(?:-{3}|\.{3})\s*(?=#|$)/ + }, { + token : "list.markup", + regex : /^\s*[\-?](?:$|\s)/ + }, { + token: "constant", + regex: "!![\\w//]+" + }, { + token: "constant.language", + regex: "[&\\*][a-zA-Z0-9-_]+" + }, { + token: ["meta.tag", "keyword"], + regex: /^(\s*\w.*?)(:(?:\s+|$))/ + },{ + token: ["meta.tag", "keyword"], + regex: /(\w+?)(\s*:(?:\s+|$))/ + }, { + token : "keyword.operator", + regex : "<<\\w*:\\w*" + }, { + token : "keyword.operator", + regex : "-\\s*(?=[{])" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + regex : /[|>][-+\d\s]*$/, + onMatch: function(val, state, stack, line) { + var indent = /^\s*/.exec(line)[0]; + if (stack.length < 1) { + stack.push(this.next); + } else { + stack[0] = "mlString"; + } + + if (stack.length < 2) { + stack.push(indent.length); + } + else { + stack[1] = indent.length; + } + return this.token; + }, + next : "mlString" + }, { + token : "string", // single quoted string + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "constant.numeric", // float + regex : /(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)/ + }, { + token : "constant.numeric", // other number + regex : /[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/ + }, { + token : "constant.language.boolean", + regex : "\\b(?:true|false|TRUE|FALSE|True|False|yes|no)\\b" + }, { + token : "paren.lparen", + regex : "[[({]" + }, { + token : "paren.rparen", + regex : "[\\])}]" + } + ], + "mlString" : [ + { + token : "indent", + regex : /^\s*$/ + }, { + token : "indent", + regex : /^\s*/, + onMatch: function(val, state, stack) { + var curIndent = stack[1]; + + if (curIndent >= val.length) { + this.next = "start"; + stack.splice(0); + } + else { + this.next = "mlString"; + } + return this.token; + }, + next : "mlString" + }, { + token : "string", + regex : '.+' + } + ]}; + this.normalizeRules(); + +}; + +oop.inherits(YamlHighlightRules, TextHighlightRules); + +exports.YamlHighlightRules = YamlHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return ""; + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/yaml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/yaml_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var YamlHighlightRules = require("./yaml_highlight_rules").YamlHighlightRules; +var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; +var FoldMode = require("./folding/coffee").FoldMode; + +var Mode = function() { + this.HighlightRules = YamlHighlightRules; + this.$outdent = new MatchingBraceOutdent(); + this.foldingRules = new FoldMode(); + this.$behaviour = this.$defaultBehaviour; +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + + this.$id = "ace/mode/yaml"; +}).call(Mode.prototype); + +exports.Mode = Mode; + +}); diff --git a/htdocs/includes/ace/snippets/abap.js b/htdocs/includes/ace/snippets/abap.js new file mode 100644 index 00000000000..0ef29119029 --- /dev/null +++ b/htdocs/includes/ace/snippets/abap.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/abap",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "abap"; + +}); diff --git a/htdocs/includes/ace/snippets/abc.js b/htdocs/includes/ace/snippets/abc.js new file mode 100644 index 00000000000..17030761574 --- /dev/null +++ b/htdocs/includes/ace/snippets/abc.js @@ -0,0 +1,38 @@ +ace.define("ace/snippets/abc",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "\n\ +snippet zupfnoter.print\n\ + %%%%hn.print {\"startpos\": ${1:pos_y}, \"t\":\"${2:title}\", \"v\":[${3:voices}], \"s\":[[${4:syncvoices}1,2]], \"f\":[${5:flowlines}], \"sf\":[${6:subflowlines}], \"j\":[${7:jumplines}]}\n\ +\n\ +snippet zupfnoter.note\n\ + %%%%hn.note {\"pos\": [${1:pos_x},${2:pos_y}], \"text\": \"${3:text}\", \"style\": \"${4:style}\"}\n\ +\n\ +snippet zupfnoter.annotation\n\ + %%%%hn.annotation {\"id\": \"${1:id}\", \"pos\": [${2:pos}], \"text\": \"${3:text}\"}\n\ +\n\ +snippet zupfnoter.lyrics\n\ + %%%%hn.lyrics {\"pos\": [${1:x_pos},${2:y_pos}]}\n\ +\n\ +snippet zupfnoter.legend\n\ + %%%%hn.legend {\"pos\": [${1:x_pos},${2:y_pos}]}\n\ +\n\ +\n\ +\n\ +snippet zupfnoter.target\n\ + \"^:${1:target}\"\n\ +\n\ +snippet zupfnoter.goto\n\ + \"^@${1:target}@${2:distance}\"\n\ +\n\ +snippet zupfnoter.annotationref\n\ + \"^#${1:target}\"\n\ +\n\ +snippet zupfnoter.annotation\n\ + \"^!${1:text}@${2:x_offset},${3:y_offset}\"\n\ +\n\ +\n\ +"; +exports.scope = "abc"; + +}); diff --git a/htdocs/includes/ace/snippets/actionscript.js b/htdocs/includes/ace/snippets/actionscript.js new file mode 100644 index 00000000000..bc899d16128 --- /dev/null +++ b/htdocs/includes/ace/snippets/actionscript.js @@ -0,0 +1,164 @@ +ace.define("ace/snippets/actionscript",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet main\n\ + package {\n\ + import flash.display.*;\n\ + import flash.Events.*;\n\ + \n\ + public class Main extends Sprite {\n\ + public function Main ( ) {\n\ + trace(\"start\");\n\ + stage.scaleMode = StageScaleMode.NO_SCALE;\n\ + stage.addEventListener(Event.RESIZE, resizeListener);\n\ + }\n\ + \n\ + private function resizeListener (e:Event):void {\n\ + trace(\"The application window changed size!\");\n\ + trace(\"New width: \" + stage.stageWidth);\n\ + trace(\"New height: \" + stage.stageHeight);\n\ + }\n\ + \n\ + }\n\ + \n\ + }\n\ +snippet class\n\ + ${1:public|internal} class ${2:name} ${3:extends } {\n\ + public function $2 ( ) {\n\ + (\"start\");\n\ + }\n\ + }\n\ +snippet all\n\ + package name {\n\ +\n\ + ${1:public|internal|final} class ${2:name} ${3:extends } {\n\ + private|public| static const FOO = \"abc\";\n\ + private|public| static var BAR = \"abc\";\n\ +\n\ + // class initializer - no JIT !! one time setup\n\ + if Cababilities.os == \"Linux|MacOS\" {\n\ + FOO = \"other\";\n\ + }\n\ +\n\ + // constructor:\n\ + public function $2 ( ){\n\ + super2();\n\ + trace(\"start\");\n\ + }\n\ + public function name (a, b...){\n\ + super.name(..);\n\ + lable:break\n\ + }\n\ + }\n\ + }\n\ +\n\ + function A(){\n\ + // A can only be accessed within this file\n\ + }\n\ +snippet switch\n\ + switch(${1}){\n\ + case ${2}:\n\ + ${3}\n\ + break;\n\ + default:\n\ + }\n\ +snippet case\n\ + case ${1}:\n\ + ${2}\n\ + break;\n\ +snippet package\n\ + package ${1:package}{\n\ + ${2}\n\ + }\n\ +snippet wh\n\ + while ${1:cond}{\n\ + ${2}\n\ + }\n\ +snippet do\n\ + do {\n\ + ${2}\n\ + } while (${1:cond})\n\ +snippet while\n\ + while ${1:cond}{\n\ + ${2}\n\ + }\n\ +snippet for enumerate names\n\ + for (${1:var} in ${2:object}){\n\ + ${3}\n\ + }\n\ +snippet for enumerate values\n\ + for each (${1:var} in ${2:object}){\n\ + ${3}\n\ + }\n\ +snippet get_set\n\ + function get ${1:name} {\n\ + return ${2}\n\ + }\n\ + function set $1 (newValue) {\n\ + ${3}\n\ + }\n\ +snippet interface\n\ + interface name {\n\ + function method(${1}):${2:returntype};\n\ + }\n\ +snippet try\n\ + try {\n\ + ${1}\n\ + } catch (error:ErrorType) {\n\ + ${2}\n\ + } finally {\n\ + ${3}\n\ + }\n\ +# For Loop (same as c.snippet)\n\ +snippet for for (..) {..}\n\ + for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {\n\ + ${4:/* code */}\n\ + }\n\ +# Custom For Loop\n\ +snippet forr\n\ + for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {\n\ + ${5:/* code */}\n\ + }\n\ +# If Condition\n\ +snippet if\n\ + if (${1:/* condition */}) {\n\ + ${2:/* code */}\n\ + }\n\ +snippet el\n\ + else {\n\ + ${1}\n\ + }\n\ +# Ternary conditional\n\ +snippet t\n\ + ${1:/* condition */} ? ${2:a} : ${3:b}\n\ +snippet fun\n\ + function ${1:function_name}(${2})${3}\n\ + {\n\ + ${4:/* code */}\n\ + }\n\ +# FlxSprite (usefull when using the flixel library)\n\ +snippet FlxSprite\n\ + package\n\ + {\n\ + import org.flixel.*\n\ +\n\ + public class ${1:ClassName} extends ${2:FlxSprite}\n\ + {\n\ + public function $1(${3: X:Number, Y:Number}):void\n\ + {\n\ + super(X,Y);\n\ + ${4: //code...}\n\ + }\n\ +\n\ + override public function update():void\n\ + {\n\ + super.update();\n\ + ${5: //code...}\n\ + }\n\ + }\n\ + }\n\ +\n\ +"; +exports.scope = "actionscript"; + +}); diff --git a/htdocs/includes/ace/snippets/ada.js b/htdocs/includes/ace/snippets/ada.js new file mode 100644 index 00000000000..656608aaa9e --- /dev/null +++ b/htdocs/includes/ace/snippets/ada.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/ada",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "ada"; + +}); diff --git a/htdocs/includes/ace/snippets/apache_conf.js b/htdocs/includes/ace/snippets/apache_conf.js new file mode 100644 index 00000000000..0f38e54c62b --- /dev/null +++ b/htdocs/includes/ace/snippets/apache_conf.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/apache_conf",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "apache_conf"; + +}); diff --git a/htdocs/includes/ace/snippets/applescript.js b/htdocs/includes/ace/snippets/applescript.js new file mode 100644 index 00000000000..6b59011a368 --- /dev/null +++ b/htdocs/includes/ace/snippets/applescript.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/applescript",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "applescript"; + +}); diff --git a/htdocs/includes/ace/snippets/asciidoc.js b/htdocs/includes/ace/snippets/asciidoc.js new file mode 100644 index 00000000000..ef22c020b5a --- /dev/null +++ b/htdocs/includes/ace/snippets/asciidoc.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/asciidoc",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "asciidoc"; + +}); diff --git a/htdocs/includes/ace/snippets/assembly_x86.js b/htdocs/includes/ace/snippets/assembly_x86.js new file mode 100644 index 00000000000..b3c3cd3dc45 --- /dev/null +++ b/htdocs/includes/ace/snippets/assembly_x86.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/assembly_x86",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "assembly_x86"; + +}); diff --git a/htdocs/includes/ace/snippets/autohotkey.js b/htdocs/includes/ace/snippets/autohotkey.js new file mode 100644 index 00000000000..61c8ad4e793 --- /dev/null +++ b/htdocs/includes/ace/snippets/autohotkey.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/autohotkey",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "autohotkey"; + +}); diff --git a/htdocs/includes/ace/snippets/batchfile.js b/htdocs/includes/ace/snippets/batchfile.js new file mode 100644 index 00000000000..619f57daf53 --- /dev/null +++ b/htdocs/includes/ace/snippets/batchfile.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/batchfile",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "batchfile"; + +}); diff --git a/htdocs/includes/ace/snippets/bro.js b/htdocs/includes/ace/snippets/bro.js new file mode 100644 index 00000000000..2f2e2e12325 --- /dev/null +++ b/htdocs/includes/ace/snippets/bro.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/bro",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/c9search.js b/htdocs/includes/ace/snippets/c9search.js new file mode 100644 index 00000000000..78ea3dabfdc --- /dev/null +++ b/htdocs/includes/ace/snippets/c9search.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/c9search",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "c9search"; + +}); diff --git a/htdocs/includes/ace/snippets/c_cpp.js b/htdocs/includes/ace/snippets/c_cpp.js new file mode 100644 index 00000000000..a232b56f94f --- /dev/null +++ b/htdocs/includes/ace/snippets/c_cpp.js @@ -0,0 +1,138 @@ +ace.define("ace/snippets/c_cpp",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "## STL Collections\n\ +# std::array\n\ +snippet array\n\ + std::array<${1:T}, ${2:N}> ${3};${4}\n\ +# std::vector\n\ +snippet vector\n\ + std::vector<${1:T}> ${2};${3}\n\ +# std::deque\n\ +snippet deque\n\ + std::deque<${1:T}> ${2};${3}\n\ +# std::forward_list\n\ +snippet flist\n\ + std::forward_list<${1:T}> ${2};${3}\n\ +# std::list\n\ +snippet list\n\ + std::list<${1:T}> ${2};${3}\n\ +# std::set\n\ +snippet set\n\ + std::set<${1:T}> ${2};${3}\n\ +# std::map\n\ +snippet map\n\ + std::map<${1:Key}, ${2:T}> ${3};${4}\n\ +# std::multiset\n\ +snippet mset\n\ + std::multiset<${1:T}> ${2};${3}\n\ +# std::multimap\n\ +snippet mmap\n\ + std::multimap<${1:Key}, ${2:T}> ${3};${4}\n\ +# std::unordered_set\n\ +snippet uset\n\ + std::unordered_set<${1:T}> ${2};${3}\n\ +# std::unordered_map\n\ +snippet umap\n\ + std::unordered_map<${1:Key}, ${2:T}> ${3};${4}\n\ +# std::unordered_multiset\n\ +snippet umset\n\ + std::unordered_multiset<${1:T}> ${2};${3}\n\ +# std::unordered_multimap\n\ +snippet ummap\n\ + std::unordered_multimap<${1:Key}, ${2:T}> ${3};${4}\n\ +# std::stack\n\ +snippet stack\n\ + std::stack<${1:T}> ${2};${3}\n\ +# std::queue\n\ +snippet queue\n\ + std::queue<${1:T}> ${2};${3}\n\ +# std::priority_queue\n\ +snippet pqueue\n\ + std::priority_queue<${1:T}> ${2};${3}\n\ +##\n\ +## Access Modifiers\n\ +# private\n\ +snippet pri\n\ + private\n\ +# protected\n\ +snippet pro\n\ + protected\n\ +# public\n\ +snippet pub\n\ + public\n\ +# friend\n\ +snippet fr\n\ + friend\n\ +# mutable\n\ +snippet mu\n\ + mutable\n\ +## \n\ +## Class\n\ +# class\n\ +snippet cl\n\ + class ${1:`Filename('$1', 'name')`} \n\ + {\n\ + public:\n\ + $1(${2});\n\ + ~$1();\n\ +\n\ + private:\n\ + ${3:/* data */}\n\ + };\n\ +# member function implementation\n\ +snippet mfun\n\ + ${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {\n\ + ${5:/* code */}\n\ + }\n\ +# namespace\n\ +snippet ns\n\ + namespace ${1:`Filename('', 'my')`} {\n\ + ${2}\n\ + } /* namespace $1 */\n\ +##\n\ +## Input/Output\n\ +# std::cout\n\ +snippet cout\n\ + std::cout << ${1} << std::endl;${2}\n\ +# std::cin\n\ +snippet cin\n\ + std::cin >> ${1};${2}\n\ +##\n\ +## Iteration\n\ +# for i \n\ +snippet fori\n\ + for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {\n\ + ${4:/* code */}\n\ + }${5}\n\ +\n\ +# foreach\n\ +snippet fore\n\ + for (${1:auto} ${2:i} : ${3:container}) {\n\ + ${4:/* code */}\n\ + }${5}\n\ +# iterator\n\ +snippet iter\n\ + for (${1:std::vector}<${2:type}>::${3:const_iterator} ${4:i} = ${5:container}.begin(); $4 != $5.end(); ++$4) {\n\ + ${6}\n\ + }${7}\n\ +\n\ +# auto iterator\n\ +snippet itera\n\ + for (auto ${1:i} = $1.begin(); $1 != $1.end(); ++$1) {\n\ + ${2:std::cout << *$1 << std::endl;}\n\ + }${3}\n\ +##\n\ +## Lambdas\n\ +# lamda (one line)\n\ +snippet ld\n\ + [${1}](${2}){${3:/* code */}}${4}\n\ +# lambda (multi-line)\n\ +snippet lld\n\ + [${1}](${2}){\n\ + ${3:/* code */}\n\ + }${4}\n\ +"; +exports.scope = "c_cpp"; + +}); diff --git a/htdocs/includes/ace/snippets/cirru.js b/htdocs/includes/ace/snippets/cirru.js new file mode 100644 index 00000000000..02ef1f30f51 --- /dev/null +++ b/htdocs/includes/ace/snippets/cirru.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/cirru",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "cirru"; + +}); diff --git a/htdocs/includes/ace/snippets/clojure.js b/htdocs/includes/ace/snippets/clojure.js new file mode 100644 index 00000000000..49f23cac473 --- /dev/null +++ b/htdocs/includes/ace/snippets/clojure.js @@ -0,0 +1,97 @@ +ace.define("ace/snippets/clojure",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet comm\n\ + (comment\n\ + ${1}\n\ + )\n\ +snippet condp\n\ + (condp ${1:pred} ${2:expr}\n\ + ${3})\n\ +snippet def\n\ + (def ${1})\n\ +snippet defm\n\ + (defmethod ${1:multifn} \"${2:doc-string}\" ${3:dispatch-val} [${4:args}]\n\ + ${5})\n\ +snippet defmm\n\ + (defmulti ${1:name} \"${2:doc-string}\" ${3:dispatch-fn})\n\ +snippet defma\n\ + (defmacro ${1:name} \"${2:doc-string}\" ${3:dispatch-fn})\n\ +snippet defn\n\ + (defn ${1:name} \"${2:doc-string}\" [${3:arg-list}]\n\ + ${4})\n\ +snippet defp\n\ + (defprotocol ${1:name}\n\ + ${2})\n\ +snippet defr\n\ + (defrecord ${1:name} [${2:fields}]\n\ + ${3:protocol}\n\ + ${4})\n\ +snippet deft\n\ + (deftest ${1:name}\n\ + (is (= ${2:assertion})))\n\ + ${3})\n\ +snippet is\n\ + (is (= ${1} ${2}))\n\ +snippet defty\n\ + (deftype ${1:Name} [${2:fields}]\n\ + ${3:Protocol}\n\ + ${4})\n\ +snippet doseq\n\ + (doseq [${1:elem} ${2:coll}]\n\ + ${3})\n\ +snippet fn\n\ + (fn [${1:arg-list}] ${2})\n\ +snippet if\n\ + (if ${1:test-expr}\n\ + ${2:then-expr}\n\ + ${3:else-expr})\n\ +snippet if-let \n\ + (if-let [${1:result} ${2:test-expr}]\n\ + (${3:then-expr} $1)\n\ + (${4:else-expr}))\n\ +snippet imp\n\ + (:import [${1:package}])\n\ + & {:keys [${1:keys}] :or {${2:defaults}}}\n\ +snippet let\n\ + (let [${1:name} ${2:expr}]\n\ + ${3})\n\ +snippet letfn\n\ + (letfn [(${1:name) [${2:args}]\n\ + ${3})])\n\ +snippet map\n\ + (map ${1:func} ${2:coll})\n\ +snippet mapl\n\ + (map #(${1:lambda}) ${2:coll})\n\ +snippet met\n\ + (${1:name} [${2:this} ${3:args}]\n\ + ${4})\n\ +snippet ns\n\ + (ns ${1:name}\n\ + ${2})\n\ +snippet dotimes\n\ + (dotimes [_ 10]\n\ + (time\n\ + (dotimes [_ ${1:times}]\n\ + ${2})))\n\ +snippet pmethod\n\ + (${1:name} [${2:this} ${3:args}])\n\ +snippet refer\n\ + (:refer-clojure :exclude [${1}])\n\ +snippet require\n\ + (:require [${1:namespace} :as [${2}]])\n\ +snippet use\n\ + (:use [${1:namespace} :only [${2}]])\n\ +snippet print\n\ + (println ${1})\n\ +snippet reduce\n\ + (reduce ${1:(fn [p n] ${3})} ${2})\n\ +snippet when\n\ + (when ${1:test} ${2:body})\n\ +snippet when-let\n\ + (when-let [${1:result} ${2:test}]\n\ + ${3:body})\n\ +"; +exports.scope = "clojure"; + +}); diff --git a/htdocs/includes/ace/snippets/cobol.js b/htdocs/includes/ace/snippets/cobol.js new file mode 100644 index 00000000000..760727ce6d5 --- /dev/null +++ b/htdocs/includes/ace/snippets/cobol.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/cobol",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "cobol"; + +}); diff --git a/htdocs/includes/ace/snippets/coffee.js b/htdocs/includes/ace/snippets/coffee.js new file mode 100644 index 00000000000..eb1a76d7fd3 --- /dev/null +++ b/htdocs/includes/ace/snippets/coffee.js @@ -0,0 +1,102 @@ +ace.define("ace/snippets/coffee",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Closure loop\n\ +snippet forindo\n\ + for ${1:name} in ${2:array}\n\ + do ($1) ->\n\ + ${3:// body}\n\ +# Array comprehension\n\ +snippet fora\n\ + for ${1:name} in ${2:array}\n\ + ${3:// body...}\n\ +# Object comprehension\n\ +snippet foro\n\ + for ${1:key}, ${2:value} of ${3:object}\n\ + ${4:// body...}\n\ +# Range comprehension (inclusive)\n\ +snippet forr\n\ + for ${1:name} in [${2:start}..${3:finish}]\n\ + ${4:// body...}\n\ +snippet forrb\n\ + for ${1:name} in [${2:start}..${3:finish}] by ${4:step}\n\ + ${5:// body...}\n\ +# Range comprehension (exclusive)\n\ +snippet forrex\n\ + for ${1:name} in [${2:start}...${3:finish}]\n\ + ${4:// body...}\n\ +snippet forrexb\n\ + for ${1:name} in [${2:start}...${3:finish}] by ${4:step}\n\ + ${5:// body...}\n\ +# Function\n\ +snippet fun\n\ + (${1:args}) ->\n\ + ${2:// body...}\n\ +# Function (bound)\n\ +snippet bfun\n\ + (${1:args}) =>\n\ + ${2:// body...}\n\ +# Class\n\ +snippet cla class ..\n\ + class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ + ${2}\n\ +snippet cla class .. constructor: ..\n\ + class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ + constructor: (${2:args}) ->\n\ + ${3}\n\ +\n\ + ${4}\n\ +snippet cla class .. extends ..\n\ + class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} extends ${2:ParentClass}\n\ + ${3}\n\ +snippet cla class .. extends .. constructor: ..\n\ + class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} extends ${2:ParentClass}\n\ + constructor: (${3:args}) ->\n\ + ${4}\n\ +\n\ + ${5}\n\ +# If\n\ +snippet if\n\ + if ${1:condition}\n\ + ${2:// body...}\n\ +# If __ Else\n\ +snippet ife\n\ + if ${1:condition}\n\ + ${2:// body...}\n\ + else\n\ + ${3:// body...}\n\ +# Else if\n\ +snippet elif\n\ + else if ${1:condition}\n\ + ${2:// body...}\n\ +# Ternary If\n\ +snippet ifte\n\ + if ${1:condition} then ${2:value} else ${3:other}\n\ +# Unless\n\ +snippet unl\n\ + ${1:action} unless ${2:condition}\n\ +# Switch\n\ +snippet swi\n\ + switch ${1:object}\n\ + when ${2:value}\n\ + ${3:// body...}\n\ +\n\ +# Log\n\ +snippet log\n\ + console.log ${1}\n\ +# Try __ Catch\n\ +snippet try\n\ + try\n\ + ${1}\n\ + catch ${2:error}\n\ + ${3}\n\ +# Require\n\ +snippet req\n\ + ${2:$1} = require '${1:sys}'${3}\n\ +# Export\n\ +snippet exp\n\ + ${1:root} = exports ? this\n\ +"; +exports.scope = "coffee"; + +}); diff --git a/htdocs/includes/ace/snippets/coldfusion.js b/htdocs/includes/ace/snippets/coldfusion.js new file mode 100644 index 00000000000..1a91f9670a9 --- /dev/null +++ b/htdocs/includes/ace/snippets/coldfusion.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/coldfusion",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "coldfusion"; + +}); diff --git a/htdocs/includes/ace/snippets/csharp.js b/htdocs/includes/ace/snippets/csharp.js new file mode 100644 index 00000000000..96b9174a3ac --- /dev/null +++ b/htdocs/includes/ace/snippets/csharp.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/csharp",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "csharp"; + +}); diff --git a/htdocs/includes/ace/snippets/css.js b/htdocs/includes/ace/snippets/css.js new file mode 100644 index 00000000000..db5a8c0ac28 --- /dev/null +++ b/htdocs/includes/ace/snippets/css.js @@ -0,0 +1,974 @@ +ace.define("ace/snippets/css",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet .\n\ + ${1} {\n\ + ${2}\n\ + }\n\ +snippet !\n\ + !important\n\ +snippet bdi:m+\n\ + -moz-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\n\ +snippet bdi:m\n\ + -moz-border-image: ${1};\n\ +snippet bdrz:m\n\ + -moz-border-radius: ${1};\n\ +snippet bxsh:m+\n\ + -moz-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\n\ +snippet bxsh:m\n\ + -moz-box-shadow: ${1};\n\ +snippet bdi:w+\n\ + -webkit-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\n\ +snippet bdi:w\n\ + -webkit-border-image: ${1};\n\ +snippet bdrz:w\n\ + -webkit-border-radius: ${1};\n\ +snippet bxsh:w+\n\ + -webkit-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\n\ +snippet bxsh:w\n\ + -webkit-box-shadow: ${1};\n\ +snippet @f\n\ + @font-face {\n\ + font-family: ${1};\n\ + src: url(${2});\n\ + }\n\ +snippet @i\n\ + @import url(${1});\n\ +snippet @m\n\ + @media ${1:print} {\n\ + ${2}\n\ + }\n\ +snippet bg+\n\ + background: #${1:FFF} url(${2}) ${3:0} ${4:0} ${5:no-repeat};\n\ +snippet bga\n\ + background-attachment: ${1};\n\ +snippet bga:f\n\ + background-attachment: fixed;\n\ +snippet bga:s\n\ + background-attachment: scroll;\n\ +snippet bgbk\n\ + background-break: ${1};\n\ +snippet bgbk:bb\n\ + background-break: bounding-box;\n\ +snippet bgbk:c\n\ + background-break: continuous;\n\ +snippet bgbk:eb\n\ + background-break: each-box;\n\ +snippet bgcp\n\ + background-clip: ${1};\n\ +snippet bgcp:bb\n\ + background-clip: border-box;\n\ +snippet bgcp:cb\n\ + background-clip: content-box;\n\ +snippet bgcp:nc\n\ + background-clip: no-clip;\n\ +snippet bgcp:pb\n\ + background-clip: padding-box;\n\ +snippet bgc\n\ + background-color: #${1:FFF};\n\ +snippet bgc:t\n\ + background-color: transparent;\n\ +snippet bgi\n\ + background-image: url(${1});\n\ +snippet bgi:n\n\ + background-image: none;\n\ +snippet bgo\n\ + background-origin: ${1};\n\ +snippet bgo:bb\n\ + background-origin: border-box;\n\ +snippet bgo:cb\n\ + background-origin: content-box;\n\ +snippet bgo:pb\n\ + background-origin: padding-box;\n\ +snippet bgpx\n\ + background-position-x: ${1};\n\ +snippet bgpy\n\ + background-position-y: ${1};\n\ +snippet bgp\n\ + background-position: ${1:0} ${2:0};\n\ +snippet bgr\n\ + background-repeat: ${1};\n\ +snippet bgr:n\n\ + background-repeat: no-repeat;\n\ +snippet bgr:x\n\ + background-repeat: repeat-x;\n\ +snippet bgr:y\n\ + background-repeat: repeat-y;\n\ +snippet bgr:r\n\ + background-repeat: repeat;\n\ +snippet bgz\n\ + background-size: ${1};\n\ +snippet bgz:a\n\ + background-size: auto;\n\ +snippet bgz:ct\n\ + background-size: contain;\n\ +snippet bgz:cv\n\ + background-size: cover;\n\ +snippet bg\n\ + background: ${1};\n\ +snippet bg:ie\n\ + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${2:crop}');\n\ +snippet bg:n\n\ + background: none;\n\ +snippet bd+\n\ + border: ${1:1px} ${2:solid} #${3:000};\n\ +snippet bdb+\n\ + border-bottom: ${1:1px} ${2:solid} #${3:000};\n\ +snippet bdbc\n\ + border-bottom-color: #${1:000};\n\ +snippet bdbi\n\ + border-bottom-image: url(${1});\n\ +snippet bdbi:n\n\ + border-bottom-image: none;\n\ +snippet bdbli\n\ + border-bottom-left-image: url(${1});\n\ +snippet bdbli:c\n\ + border-bottom-left-image: continue;\n\ +snippet bdbli:n\n\ + border-bottom-left-image: none;\n\ +snippet bdblrz\n\ + border-bottom-left-radius: ${1};\n\ +snippet bdbri\n\ + border-bottom-right-image: url(${1});\n\ +snippet bdbri:c\n\ + border-bottom-right-image: continue;\n\ +snippet bdbri:n\n\ + border-bottom-right-image: none;\n\ +snippet bdbrrz\n\ + border-bottom-right-radius: ${1};\n\ +snippet bdbs\n\ + border-bottom-style: ${1};\n\ +snippet bdbs:n\n\ + border-bottom-style: none;\n\ +snippet bdbw\n\ + border-bottom-width: ${1};\n\ +snippet bdb\n\ + border-bottom: ${1};\n\ +snippet bdb:n\n\ + border-bottom: none;\n\ +snippet bdbk\n\ + border-break: ${1};\n\ +snippet bdbk:c\n\ + border-break: close;\n\ +snippet bdcl\n\ + border-collapse: ${1};\n\ +snippet bdcl:c\n\ + border-collapse: collapse;\n\ +snippet bdcl:s\n\ + border-collapse: separate;\n\ +snippet bdc\n\ + border-color: #${1:000};\n\ +snippet bdci\n\ + border-corner-image: url(${1});\n\ +snippet bdci:c\n\ + border-corner-image: continue;\n\ +snippet bdci:n\n\ + border-corner-image: none;\n\ +snippet bdf\n\ + border-fit: ${1};\n\ +snippet bdf:c\n\ + border-fit: clip;\n\ +snippet bdf:of\n\ + border-fit: overwrite;\n\ +snippet bdf:ow\n\ + border-fit: overwrite;\n\ +snippet bdf:r\n\ + border-fit: repeat;\n\ +snippet bdf:sc\n\ + border-fit: scale;\n\ +snippet bdf:sp\n\ + border-fit: space;\n\ +snippet bdf:st\n\ + border-fit: stretch;\n\ +snippet bdi\n\ + border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\n\ +snippet bdi:n\n\ + border-image: none;\n\ +snippet bdl+\n\ + border-left: ${1:1px} ${2:solid} #${3:000};\n\ +snippet bdlc\n\ + border-left-color: #${1:000};\n\ +snippet bdli\n\ + border-left-image: url(${1});\n\ +snippet bdli:n\n\ + border-left-image: none;\n\ +snippet bdls\n\ + border-left-style: ${1};\n\ +snippet bdls:n\n\ + border-left-style: none;\n\ +snippet bdlw\n\ + border-left-width: ${1};\n\ +snippet bdl\n\ + border-left: ${1};\n\ +snippet bdl:n\n\ + border-left: none;\n\ +snippet bdlt\n\ + border-length: ${1};\n\ +snippet bdlt:a\n\ + border-length: auto;\n\ +snippet bdrz\n\ + border-radius: ${1};\n\ +snippet bdr+\n\ + border-right: ${1:1px} ${2:solid} #${3:000};\n\ +snippet bdrc\n\ + border-right-color: #${1:000};\n\ +snippet bdri\n\ + border-right-image: url(${1});\n\ +snippet bdri:n\n\ + border-right-image: none;\n\ +snippet bdrs\n\ + border-right-style: ${1};\n\ +snippet bdrs:n\n\ + border-right-style: none;\n\ +snippet bdrw\n\ + border-right-width: ${1};\n\ +snippet bdr\n\ + border-right: ${1};\n\ +snippet bdr:n\n\ + border-right: none;\n\ +snippet bdsp\n\ + border-spacing: ${1};\n\ +snippet bds\n\ + border-style: ${1};\n\ +snippet bds:ds\n\ + border-style: dashed;\n\ +snippet bds:dtds\n\ + border-style: dot-dash;\n\ +snippet bds:dtdtds\n\ + border-style: dot-dot-dash;\n\ +snippet bds:dt\n\ + border-style: dotted;\n\ +snippet bds:db\n\ + border-style: double;\n\ +snippet bds:g\n\ + border-style: groove;\n\ +snippet bds:h\n\ + border-style: hidden;\n\ +snippet bds:i\n\ + border-style: inset;\n\ +snippet bds:n\n\ + border-style: none;\n\ +snippet bds:o\n\ + border-style: outset;\n\ +snippet bds:r\n\ + border-style: ridge;\n\ +snippet bds:s\n\ + border-style: solid;\n\ +snippet bds:w\n\ + border-style: wave;\n\ +snippet bdt+\n\ + border-top: ${1:1px} ${2:solid} #${3:000};\n\ +snippet bdtc\n\ + border-top-color: #${1:000};\n\ +snippet bdti\n\ + border-top-image: url(${1});\n\ +snippet bdti:n\n\ + border-top-image: none;\n\ +snippet bdtli\n\ + border-top-left-image: url(${1});\n\ +snippet bdtli:c\n\ + border-corner-image: continue;\n\ +snippet bdtli:n\n\ + border-corner-image: none;\n\ +snippet bdtlrz\n\ + border-top-left-radius: ${1};\n\ +snippet bdtri\n\ + border-top-right-image: url(${1});\n\ +snippet bdtri:c\n\ + border-top-right-image: continue;\n\ +snippet bdtri:n\n\ + border-top-right-image: none;\n\ +snippet bdtrrz\n\ + border-top-right-radius: ${1};\n\ +snippet bdts\n\ + border-top-style: ${1};\n\ +snippet bdts:n\n\ + border-top-style: none;\n\ +snippet bdtw\n\ + border-top-width: ${1};\n\ +snippet bdt\n\ + border-top: ${1};\n\ +snippet bdt:n\n\ + border-top: none;\n\ +snippet bdw\n\ + border-width: ${1};\n\ +snippet bd\n\ + border: ${1};\n\ +snippet bd:n\n\ + border: none;\n\ +snippet b\n\ + bottom: ${1};\n\ +snippet b:a\n\ + bottom: auto;\n\ +snippet bxsh+\n\ + box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\n\ +snippet bxsh\n\ + box-shadow: ${1};\n\ +snippet bxsh:n\n\ + box-shadow: none;\n\ +snippet bxz\n\ + box-sizing: ${1};\n\ +snippet bxz:bb\n\ + box-sizing: border-box;\n\ +snippet bxz:cb\n\ + box-sizing: content-box;\n\ +snippet cps\n\ + caption-side: ${1};\n\ +snippet cps:b\n\ + caption-side: bottom;\n\ +snippet cps:t\n\ + caption-side: top;\n\ +snippet cl\n\ + clear: ${1};\n\ +snippet cl:b\n\ + clear: both;\n\ +snippet cl:l\n\ + clear: left;\n\ +snippet cl:n\n\ + clear: none;\n\ +snippet cl:r\n\ + clear: right;\n\ +snippet cp\n\ + clip: ${1};\n\ +snippet cp:a\n\ + clip: auto;\n\ +snippet cp:r\n\ + clip: rect(${1:0} ${2:0} ${3:0} ${4:0});\n\ +snippet c\n\ + color: #${1:000};\n\ +snippet ct\n\ + content: ${1};\n\ +snippet ct:a\n\ + content: attr(${1});\n\ +snippet ct:cq\n\ + content: close-quote;\n\ +snippet ct:c\n\ + content: counter(${1});\n\ +snippet ct:cs\n\ + content: counters(${1});\n\ +snippet ct:ncq\n\ + content: no-close-quote;\n\ +snippet ct:noq\n\ + content: no-open-quote;\n\ +snippet ct:n\n\ + content: normal;\n\ +snippet ct:oq\n\ + content: open-quote;\n\ +snippet coi\n\ + counter-increment: ${1};\n\ +snippet cor\n\ + counter-reset: ${1};\n\ +snippet cur\n\ + cursor: ${1};\n\ +snippet cur:a\n\ + cursor: auto;\n\ +snippet cur:c\n\ + cursor: crosshair;\n\ +snippet cur:d\n\ + cursor: default;\n\ +snippet cur:ha\n\ + cursor: hand;\n\ +snippet cur:he\n\ + cursor: help;\n\ +snippet cur:m\n\ + cursor: move;\n\ +snippet cur:p\n\ + cursor: pointer;\n\ +snippet cur:t\n\ + cursor: text;\n\ +snippet d\n\ + display: ${1};\n\ +snippet d:mib\n\ + display: -moz-inline-box;\n\ +snippet d:mis\n\ + display: -moz-inline-stack;\n\ +snippet d:b\n\ + display: block;\n\ +snippet d:cp\n\ + display: compact;\n\ +snippet d:ib\n\ + display: inline-block;\n\ +snippet d:itb\n\ + display: inline-table;\n\ +snippet d:i\n\ + display: inline;\n\ +snippet d:li\n\ + display: list-item;\n\ +snippet d:n\n\ + display: none;\n\ +snippet d:ri\n\ + display: run-in;\n\ +snippet d:tbcp\n\ + display: table-caption;\n\ +snippet d:tbc\n\ + display: table-cell;\n\ +snippet d:tbclg\n\ + display: table-column-group;\n\ +snippet d:tbcl\n\ + display: table-column;\n\ +snippet d:tbfg\n\ + display: table-footer-group;\n\ +snippet d:tbhg\n\ + display: table-header-group;\n\ +snippet d:tbrg\n\ + display: table-row-group;\n\ +snippet d:tbr\n\ + display: table-row;\n\ +snippet d:tb\n\ + display: table;\n\ +snippet ec\n\ + empty-cells: ${1};\n\ +snippet ec:h\n\ + empty-cells: hide;\n\ +snippet ec:s\n\ + empty-cells: show;\n\ +snippet exp\n\ + expression()\n\ +snippet fl\n\ + float: ${1};\n\ +snippet fl:l\n\ + float: left;\n\ +snippet fl:n\n\ + float: none;\n\ +snippet fl:r\n\ + float: right;\n\ +snippet f+\n\ + font: ${1:1em} ${2:Arial},${3:sans-serif};\n\ +snippet fef\n\ + font-effect: ${1};\n\ +snippet fef:eb\n\ + font-effect: emboss;\n\ +snippet fef:eg\n\ + font-effect: engrave;\n\ +snippet fef:n\n\ + font-effect: none;\n\ +snippet fef:o\n\ + font-effect: outline;\n\ +snippet femp\n\ + font-emphasize-position: ${1};\n\ +snippet femp:a\n\ + font-emphasize-position: after;\n\ +snippet femp:b\n\ + font-emphasize-position: before;\n\ +snippet fems\n\ + font-emphasize-style: ${1};\n\ +snippet fems:ac\n\ + font-emphasize-style: accent;\n\ +snippet fems:c\n\ + font-emphasize-style: circle;\n\ +snippet fems:ds\n\ + font-emphasize-style: disc;\n\ +snippet fems:dt\n\ + font-emphasize-style: dot;\n\ +snippet fems:n\n\ + font-emphasize-style: none;\n\ +snippet fem\n\ + font-emphasize: ${1};\n\ +snippet ff\n\ + font-family: ${1};\n\ +snippet ff:c\n\ + font-family: ${1:'Monotype Corsiva','Comic Sans MS'},cursive;\n\ +snippet ff:f\n\ + font-family: ${1:Capitals,Impact},fantasy;\n\ +snippet ff:m\n\ + font-family: ${1:Monaco,'Courier New'},monospace;\n\ +snippet ff:ss\n\ + font-family: ${1:Helvetica,Arial},sans-serif;\n\ +snippet ff:s\n\ + font-family: ${1:Georgia,'Times New Roman'},serif;\n\ +snippet fza\n\ + font-size-adjust: ${1};\n\ +snippet fza:n\n\ + font-size-adjust: none;\n\ +snippet fz\n\ + font-size: ${1};\n\ +snippet fsm\n\ + font-smooth: ${1};\n\ +snippet fsm:aw\n\ + font-smooth: always;\n\ +snippet fsm:a\n\ + font-smooth: auto;\n\ +snippet fsm:n\n\ + font-smooth: never;\n\ +snippet fst\n\ + font-stretch: ${1};\n\ +snippet fst:c\n\ + font-stretch: condensed;\n\ +snippet fst:e\n\ + font-stretch: expanded;\n\ +snippet fst:ec\n\ + font-stretch: extra-condensed;\n\ +snippet fst:ee\n\ + font-stretch: extra-expanded;\n\ +snippet fst:n\n\ + font-stretch: normal;\n\ +snippet fst:sc\n\ + font-stretch: semi-condensed;\n\ +snippet fst:se\n\ + font-stretch: semi-expanded;\n\ +snippet fst:uc\n\ + font-stretch: ultra-condensed;\n\ +snippet fst:ue\n\ + font-stretch: ultra-expanded;\n\ +snippet fs\n\ + font-style: ${1};\n\ +snippet fs:i\n\ + font-style: italic;\n\ +snippet fs:n\n\ + font-style: normal;\n\ +snippet fs:o\n\ + font-style: oblique;\n\ +snippet fv\n\ + font-variant: ${1};\n\ +snippet fv:n\n\ + font-variant: normal;\n\ +snippet fv:sc\n\ + font-variant: small-caps;\n\ +snippet fw\n\ + font-weight: ${1};\n\ +snippet fw:b\n\ + font-weight: bold;\n\ +snippet fw:br\n\ + font-weight: bolder;\n\ +snippet fw:lr\n\ + font-weight: lighter;\n\ +snippet fw:n\n\ + font-weight: normal;\n\ +snippet f\n\ + font: ${1};\n\ +snippet h\n\ + height: ${1};\n\ +snippet h:a\n\ + height: auto;\n\ +snippet l\n\ + left: ${1};\n\ +snippet l:a\n\ + left: auto;\n\ +snippet lts\n\ + letter-spacing: ${1};\n\ +snippet lh\n\ + line-height: ${1};\n\ +snippet lisi\n\ + list-style-image: url(${1});\n\ +snippet lisi:n\n\ + list-style-image: none;\n\ +snippet lisp\n\ + list-style-position: ${1};\n\ +snippet lisp:i\n\ + list-style-position: inside;\n\ +snippet lisp:o\n\ + list-style-position: outside;\n\ +snippet list\n\ + list-style-type: ${1};\n\ +snippet list:c\n\ + list-style-type: circle;\n\ +snippet list:dclz\n\ + list-style-type: decimal-leading-zero;\n\ +snippet list:dc\n\ + list-style-type: decimal;\n\ +snippet list:d\n\ + list-style-type: disc;\n\ +snippet list:lr\n\ + list-style-type: lower-roman;\n\ +snippet list:n\n\ + list-style-type: none;\n\ +snippet list:s\n\ + list-style-type: square;\n\ +snippet list:ur\n\ + list-style-type: upper-roman;\n\ +snippet lis\n\ + list-style: ${1};\n\ +snippet lis:n\n\ + list-style: none;\n\ +snippet mb\n\ + margin-bottom: ${1};\n\ +snippet mb:a\n\ + margin-bottom: auto;\n\ +snippet ml\n\ + margin-left: ${1};\n\ +snippet ml:a\n\ + margin-left: auto;\n\ +snippet mr\n\ + margin-right: ${1};\n\ +snippet mr:a\n\ + margin-right: auto;\n\ +snippet mt\n\ + margin-top: ${1};\n\ +snippet mt:a\n\ + margin-top: auto;\n\ +snippet m\n\ + margin: ${1};\n\ +snippet m:4\n\ + margin: ${1:0} ${2:0} ${3:0} ${4:0};\n\ +snippet m:3\n\ + margin: ${1:0} ${2:0} ${3:0};\n\ +snippet m:2\n\ + margin: ${1:0} ${2:0};\n\ +snippet m:0\n\ + margin: 0;\n\ +snippet m:a\n\ + margin: auto;\n\ +snippet mah\n\ + max-height: ${1};\n\ +snippet mah:n\n\ + max-height: none;\n\ +snippet maw\n\ + max-width: ${1};\n\ +snippet maw:n\n\ + max-width: none;\n\ +snippet mih\n\ + min-height: ${1};\n\ +snippet miw\n\ + min-width: ${1};\n\ +snippet op\n\ + opacity: ${1};\n\ +snippet op:ie\n\ + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100});\n\ +snippet op:ms\n\ + -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100})';\n\ +snippet orp\n\ + orphans: ${1};\n\ +snippet o+\n\ + outline: ${1:1px} ${2:solid} #${3:000};\n\ +snippet oc\n\ + outline-color: ${1:#000};\n\ +snippet oc:i\n\ + outline-color: invert;\n\ +snippet oo\n\ + outline-offset: ${1};\n\ +snippet os\n\ + outline-style: ${1};\n\ +snippet ow\n\ + outline-width: ${1};\n\ +snippet o\n\ + outline: ${1};\n\ +snippet o:n\n\ + outline: none;\n\ +snippet ovs\n\ + overflow-style: ${1};\n\ +snippet ovs:a\n\ + overflow-style: auto;\n\ +snippet ovs:mq\n\ + overflow-style: marquee;\n\ +snippet ovs:mv\n\ + overflow-style: move;\n\ +snippet ovs:p\n\ + overflow-style: panner;\n\ +snippet ovs:s\n\ + overflow-style: scrollbar;\n\ +snippet ovx\n\ + overflow-x: ${1};\n\ +snippet ovx:a\n\ + overflow-x: auto;\n\ +snippet ovx:h\n\ + overflow-x: hidden;\n\ +snippet ovx:s\n\ + overflow-x: scroll;\n\ +snippet ovx:v\n\ + overflow-x: visible;\n\ +snippet ovy\n\ + overflow-y: ${1};\n\ +snippet ovy:a\n\ + overflow-y: auto;\n\ +snippet ovy:h\n\ + overflow-y: hidden;\n\ +snippet ovy:s\n\ + overflow-y: scroll;\n\ +snippet ovy:v\n\ + overflow-y: visible;\n\ +snippet ov\n\ + overflow: ${1};\n\ +snippet ov:a\n\ + overflow: auto;\n\ +snippet ov:h\n\ + overflow: hidden;\n\ +snippet ov:s\n\ + overflow: scroll;\n\ +snippet ov:v\n\ + overflow: visible;\n\ +snippet pb\n\ + padding-bottom: ${1};\n\ +snippet pl\n\ + padding-left: ${1};\n\ +snippet pr\n\ + padding-right: ${1};\n\ +snippet pt\n\ + padding-top: ${1};\n\ +snippet p\n\ + padding: ${1};\n\ +snippet p:4\n\ + padding: ${1:0} ${2:0} ${3:0} ${4:0};\n\ +snippet p:3\n\ + padding: ${1:0} ${2:0} ${3:0};\n\ +snippet p:2\n\ + padding: ${1:0} ${2:0};\n\ +snippet p:0\n\ + padding: 0;\n\ +snippet pgba\n\ + page-break-after: ${1};\n\ +snippet pgba:aw\n\ + page-break-after: always;\n\ +snippet pgba:a\n\ + page-break-after: auto;\n\ +snippet pgba:l\n\ + page-break-after: left;\n\ +snippet pgba:r\n\ + page-break-after: right;\n\ +snippet pgbb\n\ + page-break-before: ${1};\n\ +snippet pgbb:aw\n\ + page-break-before: always;\n\ +snippet pgbb:a\n\ + page-break-before: auto;\n\ +snippet pgbb:l\n\ + page-break-before: left;\n\ +snippet pgbb:r\n\ + page-break-before: right;\n\ +snippet pgbi\n\ + page-break-inside: ${1};\n\ +snippet pgbi:a\n\ + page-break-inside: auto;\n\ +snippet pgbi:av\n\ + page-break-inside: avoid;\n\ +snippet pos\n\ + position: ${1};\n\ +snippet pos:a\n\ + position: absolute;\n\ +snippet pos:f\n\ + position: fixed;\n\ +snippet pos:r\n\ + position: relative;\n\ +snippet pos:s\n\ + position: static;\n\ +snippet q\n\ + quotes: ${1};\n\ +snippet q:en\n\ + quotes: '\\201C' '\\201D' '\\2018' '\\2019';\n\ +snippet q:n\n\ + quotes: none;\n\ +snippet q:ru\n\ + quotes: '\\00AB' '\\00BB' '\\201E' '\\201C';\n\ +snippet rz\n\ + resize: ${1};\n\ +snippet rz:b\n\ + resize: both;\n\ +snippet rz:h\n\ + resize: horizontal;\n\ +snippet rz:n\n\ + resize: none;\n\ +snippet rz:v\n\ + resize: vertical;\n\ +snippet r\n\ + right: ${1};\n\ +snippet r:a\n\ + right: auto;\n\ +snippet tbl\n\ + table-layout: ${1};\n\ +snippet tbl:a\n\ + table-layout: auto;\n\ +snippet tbl:f\n\ + table-layout: fixed;\n\ +snippet tal\n\ + text-align-last: ${1};\n\ +snippet tal:a\n\ + text-align-last: auto;\n\ +snippet tal:c\n\ + text-align-last: center;\n\ +snippet tal:l\n\ + text-align-last: left;\n\ +snippet tal:r\n\ + text-align-last: right;\n\ +snippet ta\n\ + text-align: ${1};\n\ +snippet ta:c\n\ + text-align: center;\n\ +snippet ta:l\n\ + text-align: left;\n\ +snippet ta:r\n\ + text-align: right;\n\ +snippet td\n\ + text-decoration: ${1};\n\ +snippet td:l\n\ + text-decoration: line-through;\n\ +snippet td:n\n\ + text-decoration: none;\n\ +snippet td:o\n\ + text-decoration: overline;\n\ +snippet td:u\n\ + text-decoration: underline;\n\ +snippet te\n\ + text-emphasis: ${1};\n\ +snippet te:ac\n\ + text-emphasis: accent;\n\ +snippet te:a\n\ + text-emphasis: after;\n\ +snippet te:b\n\ + text-emphasis: before;\n\ +snippet te:c\n\ + text-emphasis: circle;\n\ +snippet te:ds\n\ + text-emphasis: disc;\n\ +snippet te:dt\n\ + text-emphasis: dot;\n\ +snippet te:n\n\ + text-emphasis: none;\n\ +snippet th\n\ + text-height: ${1};\n\ +snippet th:a\n\ + text-height: auto;\n\ +snippet th:f\n\ + text-height: font-size;\n\ +snippet th:m\n\ + text-height: max-size;\n\ +snippet th:t\n\ + text-height: text-size;\n\ +snippet ti\n\ + text-indent: ${1};\n\ +snippet ti:-\n\ + text-indent: -9999px;\n\ +snippet tj\n\ + text-justify: ${1};\n\ +snippet tj:a\n\ + text-justify: auto;\n\ +snippet tj:d\n\ + text-justify: distribute;\n\ +snippet tj:ic\n\ + text-justify: inter-cluster;\n\ +snippet tj:ii\n\ + text-justify: inter-ideograph;\n\ +snippet tj:iw\n\ + text-justify: inter-word;\n\ +snippet tj:k\n\ + text-justify: kashida;\n\ +snippet tj:t\n\ + text-justify: tibetan;\n\ +snippet to+\n\ + text-outline: ${1:0} ${2:0} #${3:000};\n\ +snippet to\n\ + text-outline: ${1};\n\ +snippet to:n\n\ + text-outline: none;\n\ +snippet tr\n\ + text-replace: ${1};\n\ +snippet tr:n\n\ + text-replace: none;\n\ +snippet tsh+\n\ + text-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\n\ +snippet tsh\n\ + text-shadow: ${1};\n\ +snippet tsh:n\n\ + text-shadow: none;\n\ +snippet tt\n\ + text-transform: ${1};\n\ +snippet tt:c\n\ + text-transform: capitalize;\n\ +snippet tt:l\n\ + text-transform: lowercase;\n\ +snippet tt:n\n\ + text-transform: none;\n\ +snippet tt:u\n\ + text-transform: uppercase;\n\ +snippet tw\n\ + text-wrap: ${1};\n\ +snippet tw:no\n\ + text-wrap: none;\n\ +snippet tw:n\n\ + text-wrap: normal;\n\ +snippet tw:s\n\ + text-wrap: suppress;\n\ +snippet tw:u\n\ + text-wrap: unrestricted;\n\ +snippet t\n\ + top: ${1};\n\ +snippet t:a\n\ + top: auto;\n\ +snippet va\n\ + vertical-align: ${1};\n\ +snippet va:bl\n\ + vertical-align: baseline;\n\ +snippet va:b\n\ + vertical-align: bottom;\n\ +snippet va:m\n\ + vertical-align: middle;\n\ +snippet va:sub\n\ + vertical-align: sub;\n\ +snippet va:sup\n\ + vertical-align: super;\n\ +snippet va:tb\n\ + vertical-align: text-bottom;\n\ +snippet va:tt\n\ + vertical-align: text-top;\n\ +snippet va:t\n\ + vertical-align: top;\n\ +snippet v\n\ + visibility: ${1};\n\ +snippet v:c\n\ + visibility: collapse;\n\ +snippet v:h\n\ + visibility: hidden;\n\ +snippet v:v\n\ + visibility: visible;\n\ +snippet whsc\n\ + white-space-collapse: ${1};\n\ +snippet whsc:ba\n\ + white-space-collapse: break-all;\n\ +snippet whsc:bs\n\ + white-space-collapse: break-strict;\n\ +snippet whsc:k\n\ + white-space-collapse: keep-all;\n\ +snippet whsc:l\n\ + white-space-collapse: loose;\n\ +snippet whsc:n\n\ + white-space-collapse: normal;\n\ +snippet whs\n\ + white-space: ${1};\n\ +snippet whs:n\n\ + white-space: normal;\n\ +snippet whs:nw\n\ + white-space: nowrap;\n\ +snippet whs:pl\n\ + white-space: pre-line;\n\ +snippet whs:pw\n\ + white-space: pre-wrap;\n\ +snippet whs:p\n\ + white-space: pre;\n\ +snippet wid\n\ + widows: ${1};\n\ +snippet w\n\ + width: ${1};\n\ +snippet w:a\n\ + width: auto;\n\ +snippet wob\n\ + word-break: ${1};\n\ +snippet wob:ba\n\ + word-break: break-all;\n\ +snippet wob:bs\n\ + word-break: break-strict;\n\ +snippet wob:k\n\ + word-break: keep-all;\n\ +snippet wob:l\n\ + word-break: loose;\n\ +snippet wob:n\n\ + word-break: normal;\n\ +snippet wos\n\ + word-spacing: ${1};\n\ +snippet wow\n\ + word-wrap: ${1};\n\ +snippet wow:no\n\ + word-wrap: none;\n\ +snippet wow:n\n\ + word-wrap: normal;\n\ +snippet wow:s\n\ + word-wrap: suppress;\n\ +snippet wow:u\n\ + word-wrap: unrestricted;\n\ +snippet z\n\ + z-index: ${1};\n\ +snippet z:a\n\ + z-index: auto;\n\ +snippet zoo\n\ + zoom: 1;\n\ +"; +exports.scope = "css"; + +}); diff --git a/htdocs/includes/ace/snippets/curly.js b/htdocs/includes/ace/snippets/curly.js new file mode 100644 index 00000000000..1b2b68734c5 --- /dev/null +++ b/htdocs/includes/ace/snippets/curly.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/curly",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "curly"; + +}); diff --git a/htdocs/includes/ace/snippets/d.js b/htdocs/includes/ace/snippets/d.js new file mode 100644 index 00000000000..729741cc25c --- /dev/null +++ b/htdocs/includes/ace/snippets/d.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/d",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "d"; + +}); diff --git a/htdocs/includes/ace/snippets/dart.js b/htdocs/includes/ace/snippets/dart.js new file mode 100644 index 00000000000..e96cc5d26e2 --- /dev/null +++ b/htdocs/includes/ace/snippets/dart.js @@ -0,0 +1,90 @@ +ace.define("ace/snippets/dart",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet lib\n\ + library ${1};\n\ + ${2}\n\ +snippet im\n\ + import '${1}';\n\ + ${2}\n\ +snippet pa\n\ + part '${1}';\n\ + ${2}\n\ +snippet pao\n\ + part of ${1};\n\ + ${2}\n\ +snippet main\n\ + void main() {\n\ + ${1:/* code */}\n\ + }\n\ +snippet st\n\ + static ${1}\n\ +snippet fi\n\ + final ${1}\n\ +snippet re\n\ + return ${1}\n\ +snippet br\n\ + break;\n\ +snippet th\n\ + throw ${1}\n\ +snippet cl\n\ + class ${1:`Filename(\"\", \"untitled\")`} ${2}\n\ +snippet imp\n\ + implements ${1}\n\ +snippet ext\n\ + extends ${1}\n\ +snippet if\n\ + if (${1:true}) {\n\ + ${2}\n\ + }\n\ +snippet ife\n\ + if (${1:true}) {\n\ + ${2}\n\ + } else {\n\ + ${3}\n\ + }\n\ +snippet el\n\ + else\n\ +snippet sw\n\ + switch (${1}) {\n\ + ${2}\n\ + }\n\ +snippet cs\n\ + case ${1}:\n\ + ${2}\n\ +snippet de\n\ + default:\n\ + ${1}\n\ +snippet for\n\ + for (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) {\n\ + ${4:$1[$2]}\n\ + }\n\ +snippet fore\n\ + for (final ${2:item} in ${1:itemList}) {\n\ + ${3:/* code */}\n\ + }\n\ +snippet wh\n\ + while (${1:/* condition */}) {\n\ + ${2:/* code */}\n\ + }\n\ +snippet dowh\n\ + do {\n\ + ${2:/* code */}\n\ + } while (${1:/* condition */});\n\ +snippet as\n\ + assert(${1:/* condition */});\n\ +snippet try\n\ + try {\n\ + ${2}\n\ + } catch (${1:Exception e}) {\n\ + }\n\ +snippet tryf\n\ + try {\n\ + ${2}\n\ + } catch (${1:Exception e}) {\n\ + } finally {\n\ + }\n\ +"; +exports.scope = "dart"; + +}); diff --git a/htdocs/includes/ace/snippets/diff.js b/htdocs/includes/ace/snippets/diff.js new file mode 100644 index 00000000000..8fe075ecf9b --- /dev/null +++ b/htdocs/includes/ace/snippets/diff.js @@ -0,0 +1,18 @@ +ace.define("ace/snippets/diff",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# DEP-3 (http://dep.debian.net/deps/dep3/) style patch header\n\ +snippet header DEP-3 style header\n\ + Description: ${1}\n\ + Origin: ${2:vendor|upstream|other}, ${3:url of the original patch}\n\ + Bug: ${4:url in upstream bugtracker}\n\ + Forwarded: ${5:no|not-needed|url}\n\ + Author: ${6:`g:snips_author`}\n\ + Reviewed-by: ${7:name and email}\n\ + Last-Update: ${8:`strftime(\"%Y-%m-%d\")`}\n\ + Applied-Upstream: ${9:upstream version|url|commit}\n\ +\n\ +"; +exports.scope = "diff"; + +}); diff --git a/htdocs/includes/ace/snippets/django.js b/htdocs/includes/ace/snippets/django.js new file mode 100644 index 00000000000..c1dacbed824 --- /dev/null +++ b/htdocs/includes/ace/snippets/django.js @@ -0,0 +1,115 @@ +ace.define("ace/snippets/django",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Model Fields\n\ +\n\ +# Note: Optional arguments are using defaults that match what Django will use\n\ +# as a default, e.g. with max_length fields. Doing this as a form of self\n\ +# documentation and to make it easy to know whether you should override the\n\ +# default or not.\n\ +\n\ +# Note: Optional arguments that are booleans will use the opposite since you\n\ +# can either not specify them, or override them, e.g. auto_now_add=False.\n\ +\n\ +snippet auto\n\ + ${1:FIELDNAME} = models.AutoField(${2})\n\ +snippet bool\n\ + ${1:FIELDNAME} = models.BooleanField(${2:default=True})\n\ +snippet char\n\ + ${1:FIELDNAME} = models.CharField(max_length=${2}${3:, blank=True})\n\ +snippet comma\n\ + ${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=${2}${3:, blank=True})\n\ +snippet date\n\ + ${1:FIELDNAME} = models.DateField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True})\n\ +snippet datetime\n\ + ${1:FIELDNAME} = models.DateTimeField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True})\n\ +snippet decimal\n\ + ${1:FIELDNAME} = models.DecimalField(max_digits=${2}, decimal_places=${3})\n\ +snippet email\n\ + ${1:FIELDNAME} = models.EmailField(max_length=${2:75}${3:, blank=True})\n\ +snippet file\n\ + ${1:FIELDNAME} = models.FileField(upload_to=${2:path/for/upload}${3:, max_length=100})\n\ +snippet filepath\n\ + ${1:FIELDNAME} = models.FilePathField(path=${2:\"/abs/path/to/dir\"}${3:, max_length=100}${4:, match=\"*.ext\"}${5:, recursive=True}${6:, blank=True, })\n\ +snippet float\n\ + ${1:FIELDNAME} = models.FloatField(${2})\n\ +snippet image\n\ + ${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${4:, max_length=100})\n\ +snippet int\n\ + ${1:FIELDNAME} = models.IntegerField(${2})\n\ +snippet ip\n\ + ${1:FIELDNAME} = models.IPAddressField(${2})\n\ +snippet nullbool\n\ + ${1:FIELDNAME} = models.NullBooleanField(${2})\n\ +snippet posint\n\ + ${1:FIELDNAME} = models.PositiveIntegerField(${2})\n\ +snippet possmallint\n\ + ${1:FIELDNAME} = models.PositiveSmallIntegerField(${2})\n\ +snippet slug\n\ + ${1:FIELDNAME} = models.SlugField(max_length=${2:50}${3:, blank=True})\n\ +snippet smallint\n\ + ${1:FIELDNAME} = models.SmallIntegerField(${2})\n\ +snippet text\n\ + ${1:FIELDNAME} = models.TextField(${2:blank=True})\n\ +snippet time\n\ + ${1:FIELDNAME} = models.TimeField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True})\n\ +snippet url\n\ + ${1:FIELDNAME} = models.URLField(${2:verify_exists=False}${3:, max_length=200}${4:, blank=True})\n\ +snippet xml\n\ + ${1:FIELDNAME} = models.XMLField(schema_path=${2:None}${3:, blank=True})\n\ +# Relational Fields\n\ +snippet fk\n\ + ${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, to_field=''})\n\ +snippet m2m\n\ + ${1:FIELDNAME} = models.ManyToManyField(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, symmetrical=False}${6:, through=''}${7:, db_table=''})\n\ +snippet o2o\n\ + ${1:FIELDNAME} = models.OneToOneField(${2:OtherModel}${3:, parent_link=True}${4:, related_name=''}${5:, limit_choices_to=}${6:, to_field=''})\n\ +\n\ +# Code Skeletons\n\ +\n\ +snippet form\n\ + class ${1:FormName}(forms.Form):\n\ + \"\"\"${2:docstring}\"\"\"\n\ + ${3}\n\ +\n\ +snippet model\n\ + class ${1:ModelName}(models.Model):\n\ + \"\"\"${2:docstring}\"\"\"\n\ + ${3}\n\ + \n\ + class Meta:\n\ + ${4}\n\ + \n\ + def __unicode__(self):\n\ + ${5}\n\ + \n\ + def save(self, force_insert=False, force_update=False):\n\ + ${6}\n\ + \n\ + @models.permalink\n\ + def get_absolute_url(self):\n\ + return ('${7:view_or_url_name}' ${8})\n\ +\n\ +snippet modeladmin\n\ + class ${1:ModelName}Admin(admin.ModelAdmin):\n\ + ${2}\n\ + \n\ + admin.site.register($1, $1Admin)\n\ + \n\ +snippet tabularinline\n\ + class ${1:ModelName}Inline(admin.TabularInline):\n\ + model = $1\n\ +\n\ +snippet stackedinline\n\ + class ${1:ModelName}Inline(admin.StackedInline):\n\ + model = $1\n\ +\n\ +snippet r2r\n\ + return render_to_response('${1:template.html}', {\n\ + ${2}\n\ + }${3:, context_instance=RequestContext(request)}\n\ + )\n\ +"; +exports.scope = "django"; + +}); diff --git a/htdocs/includes/ace/snippets/dockerfile.js b/htdocs/includes/ace/snippets/dockerfile.js new file mode 100644 index 00000000000..981cee8ab6d --- /dev/null +++ b/htdocs/includes/ace/snippets/dockerfile.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/dockerfile",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "dockerfile"; + +}); diff --git a/htdocs/includes/ace/snippets/dot.js b/htdocs/includes/ace/snippets/dot.js new file mode 100644 index 00000000000..3a09fc7727c --- /dev/null +++ b/htdocs/includes/ace/snippets/dot.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/dot",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "dot"; + +}); diff --git a/htdocs/includes/ace/snippets/drools.js b/htdocs/includes/ace/snippets/drools.js new file mode 100644 index 00000000000..a8dd859a404 --- /dev/null +++ b/htdocs/includes/ace/snippets/drools.js @@ -0,0 +1,26 @@ +ace.define("ace/snippets/drools",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "\n\ +snippet rule\n\ + rule \"${1?:rule_name}\"\n\ + when\n\ + ${2:// when...} \n\ + then\n\ + ${3:// then...}\n\ + end\n\ +\n\ +snippet query\n\ + query ${1?:query_name}\n\ + ${2:// find} \n\ + end\n\ + \n\ +snippet declare\n\ + declare ${1?:type_name}\n\ + ${2:// attributes} \n\ + end\n\ +\n\ +"; +exports.scope = "drools"; + +}); diff --git a/htdocs/includes/ace/snippets/eiffel.js b/htdocs/includes/ace/snippets/eiffel.js new file mode 100644 index 00000000000..25672785c5a --- /dev/null +++ b/htdocs/includes/ace/snippets/eiffel.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/eiffel",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "eiffel"; + +}); diff --git a/htdocs/includes/ace/snippets/ejs.js b/htdocs/includes/ace/snippets/ejs.js new file mode 100644 index 00000000000..fd38fa09dce --- /dev/null +++ b/htdocs/includes/ace/snippets/ejs.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/ejs",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "ejs"; + +}); diff --git a/htdocs/includes/ace/snippets/elixir.js b/htdocs/includes/ace/snippets/elixir.js new file mode 100644 index 00000000000..d9326275222 --- /dev/null +++ b/htdocs/includes/ace/snippets/elixir.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/elixir",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/elm.js b/htdocs/includes/ace/snippets/elm.js new file mode 100644 index 00000000000..a9d06b59bc5 --- /dev/null +++ b/htdocs/includes/ace/snippets/elm.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/elm",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "elm"; + +}); diff --git a/htdocs/includes/ace/snippets/erlang.js b/htdocs/includes/ace/snippets/erlang.js new file mode 100644 index 00000000000..d04ee117e34 --- /dev/null +++ b/htdocs/includes/ace/snippets/erlang.js @@ -0,0 +1,167 @@ +ace.define("ace/snippets/erlang",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# module and export all\n\ +snippet mod\n\ + -module(${1:`Filename('', 'my')`}).\n\ + \n\ + -compile([export_all]).\n\ + \n\ + start() ->\n\ + ${2}\n\ + \n\ + stop() ->\n\ + ok.\n\ +# define directive\n\ +snippet def\n\ + -define(${1:macro}, ${2:body}).${3}\n\ +# export directive\n\ +snippet exp\n\ + -export([${1:function}/${2:arity}]).\n\ +# include directive\n\ +snippet inc\n\ + -include(\"${1:file}\").${2}\n\ +# behavior directive\n\ +snippet beh\n\ + -behaviour(${1:behaviour}).${2}\n\ +# if expression\n\ +snippet if\n\ + if\n\ + ${1:guard} ->\n\ + ${2:body}\n\ + end\n\ +# case expression\n\ +snippet case\n\ + case ${1:expression} of\n\ + ${2:pattern} ->\n\ + ${3:body};\n\ + end\n\ +# anonymous function\n\ +snippet fun\n\ + fun (${1:Parameters}) -> ${2:body} end${3}\n\ +# try...catch\n\ +snippet try\n\ + try\n\ + ${1}\n\ + catch\n\ + ${2:_:_} -> ${3:got_some_exception}\n\ + end\n\ +# record directive\n\ +snippet rec\n\ + -record(${1:record}, {\n\ + ${2:field}=${3:value}}).${4}\n\ +# todo comment\n\ +snippet todo\n\ + %% TODO: ${1}\n\ +## Snippets below (starting with '%') are in EDoc format.\n\ +## See http://www.erlang.org/doc/apps/edoc/chapter.html#id56887 for more details\n\ +# doc comment\n\ +snippet %d\n\ + %% @doc ${1}\n\ +# end of doc comment\n\ +snippet %e\n\ + %% @end\n\ +# specification comment\n\ +snippet %s\n\ + %% @spec ${1}\n\ +# private function marker\n\ +snippet %p\n\ + %% @private\n\ +# OTP application\n\ +snippet application\n\ + -module(${1:`Filename('', 'my')`}).\n\ +\n\ + -behaviour(application).\n\ +\n\ + -export([start/2, stop/1]).\n\ +\n\ + start(_Type, _StartArgs) ->\n\ + case ${2:root_supervisor}:start_link() of\n\ + {ok, Pid} ->\n\ + {ok, Pid};\n\ + Other ->\n\ + {error, Other}\n\ + end.\n\ +\n\ + stop(_State) ->\n\ + ok. \n\ +# OTP supervisor\n\ +snippet supervisor\n\ + -module(${1:`Filename('', 'my')`}).\n\ +\n\ + -behaviour(supervisor).\n\ +\n\ + %% API\n\ + -export([start_link/0]).\n\ +\n\ + %% Supervisor callbacks\n\ + -export([init/1]).\n\ +\n\ + -define(SERVER, ?MODULE).\n\ +\n\ + start_link() ->\n\ + supervisor:start_link({local, ?SERVER}, ?MODULE, []).\n\ +\n\ + init([]) ->\n\ + Server = {${2:my_server}, {$2, start_link, []},\n\ + permanent, 2000, worker, [$2]},\n\ + Children = [Server],\n\ + RestartStrategy = {one_for_one, 0, 1},\n\ + {ok, {RestartStrategy, Children}}.\n\ +# OTP gen_server\n\ +snippet gen_server\n\ + -module(${1:`Filename('', 'my')`}).\n\ +\n\ + -behaviour(gen_server).\n\ +\n\ + %% API\n\ + -export([\n\ + start_link/0\n\ + ]).\n\ +\n\ + %% gen_server callbacks\n\ + -export([init/1, handle_call/3, handle_cast/2, handle_info/2,\n\ + terminate/2, code_change/3]).\n\ +\n\ + -define(SERVER, ?MODULE).\n\ +\n\ + -record(state, {}).\n\ +\n\ + %%%===================================================================\n\ + %%% API\n\ + %%%===================================================================\n\ +\n\ + start_link() ->\n\ + gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).\n\ +\n\ + %%%===================================================================\n\ + %%% gen_server callbacks\n\ + %%%===================================================================\n\ +\n\ + init([]) ->\n\ + {ok, #state{}}.\n\ +\n\ + handle_call(_Request, _From, State) ->\n\ + Reply = ok,\n\ + {reply, Reply, State}.\n\ +\n\ + handle_cast(_Msg, State) ->\n\ + {noreply, State}.\n\ +\n\ + handle_info(_Info, State) ->\n\ + {noreply, State}.\n\ +\n\ + terminate(_Reason, _State) ->\n\ + ok.\n\ +\n\ + code_change(_OldVsn, State, _Extra) ->\n\ + {ok, State}.\n\ +\n\ + %%%===================================================================\n\ + %%% Internal functions\n\ + %%%===================================================================\n\ +\n\ +"; +exports.scope = "erlang"; + +}); diff --git a/htdocs/includes/ace/snippets/forth.js b/htdocs/includes/ace/snippets/forth.js new file mode 100644 index 00000000000..afb1f8a44ea --- /dev/null +++ b/htdocs/includes/ace/snippets/forth.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/forth",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "forth"; + +}); diff --git a/htdocs/includes/ace/snippets/fortran.js b/htdocs/includes/ace/snippets/fortran.js new file mode 100644 index 00000000000..b4605929bcb --- /dev/null +++ b/htdocs/includes/ace/snippets/fortran.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/fortran",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "fortran"; + +}); diff --git a/htdocs/includes/ace/snippets/ftl.js b/htdocs/includes/ace/snippets/ftl.js new file mode 100644 index 00000000000..3b53ad417a6 --- /dev/null +++ b/htdocs/includes/ace/snippets/ftl.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/ftl",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "ftl"; + +}); diff --git a/htdocs/includes/ace/snippets/gcode.js b/htdocs/includes/ace/snippets/gcode.js new file mode 100644 index 00000000000..0ed4a102777 --- /dev/null +++ b/htdocs/includes/ace/snippets/gcode.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/gcode",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "gcode"; + +}); diff --git a/htdocs/includes/ace/snippets/gherkin.js b/htdocs/includes/ace/snippets/gherkin.js new file mode 100644 index 00000000000..2044647138d --- /dev/null +++ b/htdocs/includes/ace/snippets/gherkin.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/gherkin",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "gherkin"; + +}); diff --git a/htdocs/includes/ace/snippets/gitignore.js b/htdocs/includes/ace/snippets/gitignore.js new file mode 100644 index 00000000000..6da54aa5b2e --- /dev/null +++ b/htdocs/includes/ace/snippets/gitignore.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/gitignore",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "gitignore"; + +}); diff --git a/htdocs/includes/ace/snippets/glsl.js b/htdocs/includes/ace/snippets/glsl.js new file mode 100644 index 00000000000..bb8e40d8460 --- /dev/null +++ b/htdocs/includes/ace/snippets/glsl.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/glsl",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "glsl"; + +}); diff --git a/htdocs/includes/ace/snippets/gobstones.js b/htdocs/includes/ace/snippets/gobstones.js new file mode 100644 index 00000000000..4e36e5319c1 --- /dev/null +++ b/htdocs/includes/ace/snippets/gobstones.js @@ -0,0 +1,41 @@ +ace.define("ace/snippets/gobstones",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Procedure\n\ +snippet proc\n\ + procedure ${1?:name}(${2:argument}) {\n\ + ${3:// body...}\n\ + }\n\ +\n\ +# Function\n\ +snippet fun\n\ + function ${1?:name}(${2:argument}) {\n\ + return ${3:// body...}\n\ + }\n\ +\n\ +# Repeat\n\ +snippet rep\n\ + repeat ${1?:times} {\n\ + ${2:// body...}\n\ + }\n\ +\n\ +# For\n\ +snippet for\n\ + foreach ${1?:e} in ${2?:list} {\n\ + ${3:// body...} \n\ + }\n\ +\n\ +# If\n\ +snippet if\n\ + if (${1?:condition}) {\n\ + ${3:// body...} \n\ + }\n\ +\n\ +# While\n\ + while (${1?:condition}) {\n\ + ${2:// body...} \n\ + }\n\ +"; +exports.scope = "gobstones"; + +}); diff --git a/htdocs/includes/ace/snippets/golang.js b/htdocs/includes/ace/snippets/golang.js new file mode 100644 index 00000000000..0a2411d5373 --- /dev/null +++ b/htdocs/includes/ace/snippets/golang.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/golang",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "golang"; + +}); diff --git a/htdocs/includes/ace/snippets/graphqlschema.js b/htdocs/includes/ace/snippets/graphqlschema.js new file mode 100644 index 00000000000..6b1e49f9421 --- /dev/null +++ b/htdocs/includes/ace/snippets/graphqlschema.js @@ -0,0 +1,39 @@ +ace.define("ace/snippets/graphqlschema",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Type Snippet\n\ +trigger type\n\ +snippet type\n\ + type ${1:type_name} {\n\ + ${2:type_siblings}\n\ + }\n\ +\n\ +# Input Snippet\n\ +trigger input\n\ +snippet input\n\ + input ${1:input_name} {\n\ + ${2:input_siblings}\n\ + }\n\ +\n\ +# Interface Snippet\n\ +trigger interface\n\ +snippet interface\n\ + interface ${1:interface_name} {\n\ + ${2:interface_siblings}\n\ + }\n\ +\n\ +# Interface Snippet\n\ +trigger union\n\ +snippet union\n\ + union ${1:union_name} = ${2:type} | ${3: type}\n\ +\n\ +# Enum Snippet\n\ +trigger enum\n\ +snippet enum\n\ + enum ${1:enum_name} {\n\ + ${2:enum_siblings}\n\ + }\n\ +"; +exports.scope = "graphqlschema"; + +}); diff --git a/htdocs/includes/ace/snippets/groovy.js b/htdocs/includes/ace/snippets/groovy.js new file mode 100644 index 00000000000..ddeab2c8175 --- /dev/null +++ b/htdocs/includes/ace/snippets/groovy.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/groovy",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "groovy"; + +}); diff --git a/htdocs/includes/ace/snippets/haml.js b/htdocs/includes/ace/snippets/haml.js new file mode 100644 index 00000000000..2d1c68aa217 --- /dev/null +++ b/htdocs/includes/ace/snippets/haml.js @@ -0,0 +1,27 @@ +ace.define("ace/snippets/haml",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet t\n\ + %table\n\ + %tr\n\ + %th\n\ + ${1:headers}\n\ + %tr\n\ + %td\n\ + ${2:headers}\n\ +snippet ul\n\ + %ul\n\ + %li\n\ + ${1:item}\n\ + %li\n\ +snippet =rp\n\ + = render :partial => '${1:partial}'\n\ +snippet =rpl\n\ + = render :partial => '${1:partial}', :locals => {}\n\ +snippet =rpc\n\ + = render :partial => '${1:partial}', :collection => @$1\n\ +\n\ +"; +exports.scope = "haml"; + +}); diff --git a/htdocs/includes/ace/snippets/handlebars.js b/htdocs/includes/ace/snippets/handlebars.js new file mode 100644 index 00000000000..1764b754cc9 --- /dev/null +++ b/htdocs/includes/ace/snippets/handlebars.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/handlebars",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "handlebars"; + +}); diff --git a/htdocs/includes/ace/snippets/haskell.js b/htdocs/includes/ace/snippets/haskell.js new file mode 100644 index 00000000000..2bd8b5afd91 --- /dev/null +++ b/htdocs/includes/ace/snippets/haskell.js @@ -0,0 +1,89 @@ +ace.define("ace/snippets/haskell",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet lang\n\ + {-# LANGUAGE ${1:OverloadedStrings} #-}\n\ +snippet info\n\ + -- |\n\ + -- Module : ${1:Module.Namespace}\n\ + -- Copyright : ${2:Author} ${3:2011-2012}\n\ + -- License : ${4:BSD3}\n\ + --\n\ + -- Maintainer : ${5:email@something.com}\n\ + -- Stability : ${6:experimental}\n\ + -- Portability : ${7:unknown}\n\ + --\n\ + -- ${8:Description}\n\ + --\n\ +snippet import\n\ + import ${1:Data.Text}\n\ +snippet import2\n\ + import ${1:Data.Text} (${2:head})\n\ +snippet importq\n\ + import qualified ${1:Data.Text} as ${2:T}\n\ +snippet inst\n\ + instance ${1:Monoid} ${2:Type} where\n\ + ${3}\n\ +snippet type\n\ + type ${1:Type} = ${2:Type}\n\ +snippet data\n\ + data ${1:Type} = ${2:$1} ${3:Int}\n\ +snippet newtype\n\ + newtype ${1:Type} = ${2:$1} ${3:Int}\n\ +snippet class\n\ + class ${1:Class} a where\n\ + ${2}\n\ +snippet module\n\ + module `substitute(substitute(expand('%:r'), '[/\\\\]','.','g'),'^\\%(\\l*\\.\\)\\?','','')` (\n\ + ) where\n\ + `expand('%') =~ 'Main' ? \"\\n\\nmain = do\\n print \\\"hello world\\\"\" : \"\"`\n\ +\n\ +snippet const\n\ + ${1:name} :: ${2:a}\n\ + $1 = ${3:undefined}\n\ +snippet fn\n\ + ${1:fn} :: ${2:a} -> ${3:a}\n\ + $1 ${4} = ${5:undefined}\n\ +snippet fn2\n\ + ${1:fn} :: ${2:a} -> ${3:a} -> ${4:a}\n\ + $1 ${5} = ${6:undefined}\n\ +snippet ap\n\ + ${1:map} ${2:fn} ${3:list}\n\ +snippet do\n\ + do\n\ + \n\ +snippet λ\n\ + \\${1:x} -> ${2}\n\ +snippet \\\n\ + \\${1:x} -> ${2}\n\ +snippet <-\n\ + ${1:a} <- ${2:m a}\n\ +snippet ←\n\ + ${1:a} <- ${2:m a}\n\ +snippet ->\n\ + ${1:m a} -> ${2:a}\n\ +snippet →\n\ + ${1:m a} -> ${2:a}\n\ +snippet tup\n\ + (${1:a}, ${2:b})\n\ +snippet tup2\n\ + (${1:a}, ${2:b}, ${3:c})\n\ +snippet tup3\n\ + (${1:a}, ${2:b}, ${3:c}, ${4:d})\n\ +snippet rec\n\ + ${1:Record} { ${2:recFieldA} = ${3:undefined}\n\ + , ${4:recFieldB} = ${5:undefined}\n\ + }\n\ +snippet case\n\ + case ${1:something} of\n\ + ${2} -> ${3}\n\ +snippet let\n\ + let ${1} = ${2}\n\ + in ${3}\n\ +snippet where\n\ + where\n\ + ${1:fn} = ${2:undefined}\n\ +"; +exports.scope = "haskell"; + +}); diff --git a/htdocs/includes/ace/snippets/haskell_cabal.js b/htdocs/includes/ace/snippets/haskell_cabal.js new file mode 100644 index 00000000000..56d6e875e0e --- /dev/null +++ b/htdocs/includes/ace/snippets/haskell_cabal.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/haskell_cabal",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "haskell_cabal"; + +}); diff --git a/htdocs/includes/ace/snippets/haxe.js b/htdocs/includes/ace/snippets/haxe.js new file mode 100644 index 00000000000..3769547132a --- /dev/null +++ b/htdocs/includes/ace/snippets/haxe.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/haxe",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "haxe"; + +}); diff --git a/htdocs/includes/ace/snippets/hjson.js b/htdocs/includes/ace/snippets/hjson.js new file mode 100644 index 00000000000..b31e556360d --- /dev/null +++ b/htdocs/includes/ace/snippets/hjson.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/hjson",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/html.js b/htdocs/includes/ace/snippets/html.js new file mode 100644 index 00000000000..5b29fd50b5f --- /dev/null +++ b/htdocs/includes/ace/snippets/html.js @@ -0,0 +1,835 @@ +ace.define("ace/snippets/html",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Some useful Unicode entities\n\ +# Non-Breaking Space\n\ +snippet nbs\n\ +  \n\ +# ←\n\ +snippet left\n\ + ←\n\ +# →\n\ +snippet right\n\ + →\n\ +# ↑\n\ +snippet up\n\ + ↑\n\ +# ↓\n\ +snippet down\n\ + ↓\n\ +# ↩\n\ +snippet return\n\ + ↩\n\ +# ⇤\n\ +snippet backtab\n\ + ⇤\n\ +# ⇥\n\ +snippet tab\n\ + ⇥\n\ +# ⇧\n\ +snippet shift\n\ + ⇧\n\ +# ⌃\n\ +snippet ctrl\n\ + ⌃\n\ +# ⌅\n\ +snippet enter\n\ + ⌅\n\ +# ⌘\n\ +snippet cmd\n\ + ⌘\n\ +# ⌥\n\ +snippet option\n\ + ⌥\n\ +# ⌦\n\ +snippet delete\n\ + ⌦\n\ +# ⌫\n\ +snippet backspace\n\ + ⌫\n\ +# ⎋\n\ +snippet esc\n\ + ⎋\n\ +# Generic Doctype\n\ +snippet doctype HTML 4.01 Strict\n\ + \n\ +snippet doctype HTML 4.01 Transitional\n\ + \n\ +snippet doctype HTML 5\n\ + \n\ +snippet doctype XHTML 1.0 Frameset\n\ + \n\ +snippet doctype XHTML 1.0 Strict\n\ + \n\ +snippet doctype XHTML 1.0 Transitional\n\ + \n\ +snippet doctype XHTML 1.1\n\ + \n\ +# HTML Doctype 4.01 Strict\n\ +snippet docts\n\ + \n\ +# HTML Doctype 4.01 Transitional\n\ +snippet doct\n\ + \n\ +# HTML Doctype 5\n\ +snippet doct5\n\ + \n\ +# XHTML Doctype 1.0 Frameset\n\ +snippet docxf\n\ + \n\ +# XHTML Doctype 1.0 Strict\n\ +snippet docxs\n\ + \n\ +# XHTML Doctype 1.0 Transitional\n\ +snippet docxt\n\ + \n\ +# XHTML Doctype 1.1\n\ +snippet docx\n\ + \n\ +# Attributes\n\ +snippet attr\n\ + ${1:attribute}=\"${2:property}\"\n\ +snippet attr+\n\ + ${1:attribute}=\"${2:property}\" attr+${3}\n\ +snippet .\n\ + class=\"${1}\"${2}\n\ +snippet #\n\ + id=\"${1}\"${2}\n\ +snippet alt\n\ + alt=\"${1}\"${2}\n\ +snippet charset\n\ + charset=\"${1:utf-8}\"${2}\n\ +snippet data\n\ + data-${1}=\"${2:$1}\"${3}\n\ +snippet for\n\ + for=\"${1}\"${2}\n\ +snippet height\n\ + height=\"${1}\"${2}\n\ +snippet href\n\ + href=\"${1:#}\"${2}\n\ +snippet lang\n\ + lang=\"${1:en}\"${2}\n\ +snippet media\n\ + media=\"${1}\"${2}\n\ +snippet name\n\ + name=\"${1}\"${2}\n\ +snippet rel\n\ + rel=\"${1}\"${2}\n\ +snippet scope\n\ + scope=\"${1:row}\"${2}\n\ +snippet src\n\ + src=\"${1}\"${2}\n\ +snippet title=\n\ + title=\"${1}\"${2}\n\ +snippet type\n\ + type=\"${1}\"${2}\n\ +snippet value\n\ + value=\"${1}\"${2}\n\ +snippet width\n\ + width=\"${1}\"${2}\n\ +# Elements\n\ +snippet a\n\ + ${2:$1}\n\ +snippet a.\n\ + ${3:$1}\n\ +snippet a#\n\ + ${3:$1}\n\ +snippet a:ext\n\ + ${2:$1}\n\ +snippet a:mail\n\ + ${3:email me}\n\ +snippet abbr\n\ + ${2}\n\ +snippet address\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet area\n\ + \"${4}\"\n\ +snippet area+\n\ + \"${4}\"\n\ + area+${5}\n\ +snippet area:c\n\ + \"${3}\"\n\ +snippet area:d\n\ + \"${3}\"\n\ +snippet area:p\n\ + \"${3}\"\n\ +snippet area:r\n\ + \"${3}\"\n\ +snippet article\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet article.\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet article#\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet aside\n\ + \n\ +snippet aside.\n\ + \n\ +snippet aside#\n\ + \n\ +snippet audio\n\ + \n\ +snippet b\n\ + ${1}\n\ +snippet base\n\ + \n\ +snippet bdi\n\ + ${1}\n\ +snippet bdo\n\ + ${2}\n\ +snippet bdo:l\n\ + ${1}\n\ +snippet bdo:r\n\ + ${1}\n\ +snippet blockquote\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet body\n\ + \n\ + ${1}\n\ + \n\ +snippet br\n\ +
        ${1}\n\ +snippet button\n\ + \n\ +snippet button.\n\ + \n\ +snippet button#\n\ + \n\ +snippet button:s\n\ + \n\ +snippet button:r\n\ + \n\ +snippet canvas\n\ + \n\ + ${1}\n\ + \n\ +snippet caption\n\ + ${1}\n\ +snippet cite\n\ + ${1}\n\ +snippet code\n\ + ${1}\n\ +snippet col\n\ + ${1}\n\ +snippet col+\n\ + \n\ + col+${1}\n\ +snippet colgroup\n\ + \n\ + ${1}\n\ + \n\ +snippet colgroup+\n\ + \n\ + \n\ + col+${1}\n\ + \n\ +snippet command\n\ + \n\ +snippet command:c\n\ + \n\ +snippet command:r\n\ + \n\ +snippet datagrid\n\ + \n\ + ${1}\n\ + \n\ +snippet datalist\n\ + \n\ + ${1}\n\ + \n\ +snippet datatemplate\n\ + \n\ + ${1}\n\ + \n\ +snippet dd\n\ +
        ${1}
        \n\ +snippet dd.\n\ +
        ${2}
        \n\ +snippet dd#\n\ +
        ${2}
        \n\ +snippet del\n\ + ${1}\n\ +snippet details\n\ +
        ${1}
        \n\ +snippet dfn\n\ + ${1}\n\ +snippet dialog\n\ + \n\ + ${1}\n\ + \n\ +snippet div\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet div.\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet div#\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet dl\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet dl.\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet dl#\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet dl+\n\ +
        \n\ +
        ${1}
        \n\ +
        ${2}
        \n\ + dt+${3}\n\ +
        \n\ +snippet dt\n\ +
        ${1}
        \n\ +snippet dt.\n\ +
        ${2}
        \n\ +snippet dt#\n\ +
        ${2}
        \n\ +snippet dt+\n\ +
        ${1}
        \n\ +
        ${2}
        \n\ + dt+${3}\n\ +snippet em\n\ + ${1}\n\ +snippet embed\n\ + \n\ +snippet fieldset\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet fieldset.\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet fieldset#\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet fieldset+\n\ +
        \n\ + ${1}\n\ + ${2}\n\ +
        \n\ + fieldset+${3}\n\ +snippet figcaption\n\ +
        ${1}
        \n\ +snippet figure\n\ +
        ${1}
        \n\ +snippet footer\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet footer.\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet footer#\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet form\n\ +
        \n\ + ${3}\n\ +
        \n\ +snippet form.\n\ +
        \n\ + ${4}\n\ +
        \n\ +snippet form#\n\ +
        \n\ + ${4}\n\ +
        \n\ +snippet h1\n\ +

        ${1}

        \n\ +snippet h1.\n\ +

        ${2}

        \n\ +snippet h1#\n\ +

        ${2}

        \n\ +snippet h2\n\ +

        ${1}

        \n\ +snippet h2.\n\ +

        ${2}

        \n\ +snippet h2#\n\ +

        ${2}

        \n\ +snippet h3\n\ +

        ${1}

        \n\ +snippet h3.\n\ +

        ${2}

        \n\ +snippet h3#\n\ +

        ${2}

        \n\ +snippet h4\n\ +

        ${1}

        \n\ +snippet h4.\n\ +

        ${2}

        \n\ +snippet h4#\n\ +

        ${2}

        \n\ +snippet h5\n\ +
        ${1}
        \n\ +snippet h5.\n\ +
        ${2}
        \n\ +snippet h5#\n\ +
        ${2}
        \n\ +snippet h6\n\ +
        ${1}
        \n\ +snippet h6.\n\ +
        ${2}
        \n\ +snippet h6#\n\ +
        ${2}
        \n\ +snippet head\n\ + \n\ + \n\ +\n\ + ${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}\n\ + ${2}\n\ + \n\ +snippet header\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet header.\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet header#\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet hgroup\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet hgroup.\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet hr\n\ +
        ${1}\n\ +snippet html\n\ + \n\ + ${1}\n\ + \n\ +snippet xhtml\n\ + \n\ + ${1}\n\ + \n\ +snippet html5\n\ + \n\ + \n\ + \n\ + \n\ + ${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}\n\ + ${2:meta}\n\ + \n\ + \n\ + ${3:body}\n\ + \n\ + \n\ +snippet i\n\ + ${1}\n\ +snippet iframe\n\ + ${2}\n\ +snippet iframe.\n\ + ${3}\n\ +snippet iframe#\n\ + ${3}\n\ +snippet img\n\ + \"${2}\"${3}\n\ +snippet img.\n\ + \"${3}\"${4}\n\ +snippet img#\n\ + \"${3}\"${4}\n\ +snippet input\n\ + ${5}\n\ +snippet input.\n\ + ${6}\n\ +snippet input:text\n\ + ${4}\n\ +snippet input:submit\n\ + ${4}\n\ +snippet input:hidden\n\ + ${4}\n\ +snippet input:button\n\ + ${4}\n\ +snippet input:image\n\ + ${5}\n\ +snippet input:checkbox\n\ + ${3}\n\ +snippet input:radio\n\ + ${3}\n\ +snippet input:color\n\ + ${4}\n\ +snippet input:date\n\ + ${4}\n\ +snippet input:datetime\n\ + ${4}\n\ +snippet input:datetime-local\n\ + ${4}\n\ +snippet input:email\n\ + ${4}\n\ +snippet input:file\n\ + ${4}\n\ +snippet input:month\n\ + ${4}\n\ +snippet input:number\n\ + ${4}\n\ +snippet input:password\n\ + ${4}\n\ +snippet input:range\n\ + ${4}\n\ +snippet input:reset\n\ + ${4}\n\ +snippet input:search\n\ + ${4}\n\ +snippet input:time\n\ + ${4}\n\ +snippet input:url\n\ + ${4}\n\ +snippet input:week\n\ + ${4}\n\ +snippet ins\n\ + ${1}\n\ +snippet kbd\n\ + ${1}\n\ +snippet keygen\n\ + ${1}\n\ +snippet label\n\ + \n\ +snippet label:i\n\ + \n\ + ${7}\n\ +snippet label:s\n\ + \n\ + \n\ +snippet legend\n\ + ${1}\n\ +snippet legend+\n\ + ${1}\n\ +snippet li\n\ +
      • ${1}
      • \n\ +snippet li.\n\ +
      • ${2}
      • \n\ +snippet li+\n\ +
      • ${1}
      • \n\ + li+${2}\n\ +snippet lia\n\ +
      • ${1}
      • \n\ +snippet lia+\n\ +
      • ${1}
      • \n\ + lia+${3}\n\ +snippet link\n\ + ${5}\n\ +snippet link:atom\n\ + ${2}\n\ +snippet link:css\n\ + ${4}\n\ +snippet link:favicon\n\ + ${2}\n\ +snippet link:rss\n\ + ${2}\n\ +snippet link:touch\n\ + ${2}\n\ +snippet map\n\ + \n\ + ${2}\n\ + \n\ +snippet map.\n\ + \n\ + ${3}\n\ + \n\ +snippet map#\n\ + \n\ + ${3}\n\ + \n\ +snippet map+\n\ + \n\ + \"${5}\"${6}\n\ + ${7}\n\ +snippet mark\n\ + ${1}\n\ +snippet menu\n\ + \n\ + ${1}\n\ + \n\ +snippet menu:c\n\ + \n\ + ${1}\n\ + \n\ +snippet menu:t\n\ + \n\ + ${1}\n\ + \n\ +snippet meta\n\ + ${3}\n\ +snippet meta:compat\n\ + ${3}\n\ +snippet meta:refresh\n\ + ${3}\n\ +snippet meta:utf\n\ + ${3}\n\ +snippet meter\n\ + ${1}\n\ +snippet nav\n\ + \n\ +snippet nav.\n\ + \n\ +snippet nav#\n\ + \n\ +snippet noscript\n\ + \n\ +snippet object\n\ + \n\ + ${3}\n\ + ${4}\n\ +# Embed QT Movie\n\ +snippet movie\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + ${6}\n\ +snippet ol\n\ +
          \n\ + ${1}\n\ +
        \n\ +snippet ol.\n\ +
          \n\ + ${2}\n\ +
        \n\ +snippet ol#\n\ +
          \n\ + ${2}\n\ +
        \n\ +snippet ol+\n\ +
          \n\ +
        1. ${1}
        2. \n\ + li+${2}\n\ +
        \n\ +snippet opt\n\ + \n\ +snippet opt+\n\ + \n\ + opt+${3}\n\ +snippet optt\n\ + \n\ +snippet optgroup\n\ + \n\ + \n\ + opt+${3}\n\ + \n\ +snippet output\n\ + ${1}\n\ +snippet p\n\ +

        ${1}

        \n\ +snippet param\n\ + ${3}\n\ +snippet pre\n\ +
        \n\
        +		${1}\n\
        +	
        \n\ +snippet progress\n\ + ${1}\n\ +snippet q\n\ + ${1}\n\ +snippet rp\n\ + ${1}\n\ +snippet rt\n\ + ${1}\n\ +snippet ruby\n\ + \n\ + ${1}\n\ + \n\ +snippet s\n\ + ${1}\n\ +snippet samp\n\ + \n\ + ${1}\n\ + \n\ +snippet script\n\ + \n\ +snippet scriptsrc\n\ + \n\ +snippet section\n\ +
        \n\ + ${1}\n\ +
        \n\ +snippet section.\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet section#\n\ +
        \n\ + ${2}\n\ +
        \n\ +snippet select\n\ + \n\ +snippet select.\n\ + \n\ +snippet select+\n\ + \n\ +snippet small\n\ + ${1}\n\ +snippet source\n\ + \n\ +snippet span\n\ + ${1}\n\ +snippet strong\n\ + ${1}\n\ +snippet style\n\ + \n\ +snippet sub\n\ + ${1}\n\ +snippet summary\n\ + \n\ + ${1}\n\ + \n\ +snippet sup\n\ + ${1}\n\ +snippet table\n\ + \n\ + ${2}\n\ +
        \n\ +snippet table.\n\ + \n\ + ${3}\n\ +
        \n\ +snippet table#\n\ + \n\ + ${3}\n\ +
        \n\ +snippet tbody\n\ + \n\ + ${1}\n\ + \n\ +snippet td\n\ + ${1}\n\ +snippet td.\n\ + ${2}\n\ +snippet td#\n\ + ${2}\n\ +snippet td+\n\ + ${1}\n\ + td+${2}\n\ +snippet textarea\n\ + ${6}\n\ +snippet tfoot\n\ + \n\ + ${1}\n\ + \n\ +snippet th\n\ + ${1}\n\ +snippet th.\n\ + ${2}\n\ +snippet th#\n\ + ${2}\n\ +snippet th+\n\ + ${1}\n\ + th+${2}\n\ +snippet thead\n\ + \n\ + ${1}\n\ + \n\ +snippet time\n\ + \n\ +snippet title\n\ + ${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}\n\ +snippet tr\n\ + \n\ + ${1}\n\ + \n\ +snippet tr+\n\ + \n\ + ${1}\n\ + td+${2}\n\ + \n\ +snippet track\n\ + ${5}${6}\n\ +snippet ul\n\ +
          \n\ + ${1}\n\ +
        \n\ +snippet ul.\n\ +
          \n\ + ${2}\n\ +
        \n\ +snippet ul#\n\ +
          \n\ + ${2}\n\ +
        \n\ +snippet ul+\n\ +
          \n\ +
        • ${1}
        • \n\ + li+${2}\n\ +
        \n\ +snippet var\n\ + ${1}\n\ +snippet video\n\ + ${8}\n\ +snippet wbr\n\ + ${1}\n\ +"; +exports.scope = "html"; + +}); diff --git a/htdocs/includes/ace/snippets/html_elixir.js b/htdocs/includes/ace/snippets/html_elixir.js new file mode 100644 index 00000000000..66d9eb384de --- /dev/null +++ b/htdocs/includes/ace/snippets/html_elixir.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/html_elixir",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "html_elixir"; + +}); diff --git a/htdocs/includes/ace/snippets/html_ruby.js b/htdocs/includes/ace/snippets/html_ruby.js new file mode 100644 index 00000000000..83676f79234 --- /dev/null +++ b/htdocs/includes/ace/snippets/html_ruby.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/html_ruby",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "html_ruby"; + +}); diff --git a/htdocs/includes/ace/snippets/ini.js b/htdocs/includes/ace/snippets/ini.js new file mode 100644 index 00000000000..ad9bf52ff6d --- /dev/null +++ b/htdocs/includes/ace/snippets/ini.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/ini",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "ini"; + +}); diff --git a/htdocs/includes/ace/snippets/io.js b/htdocs/includes/ace/snippets/io.js new file mode 100644 index 00000000000..431002b41ab --- /dev/null +++ b/htdocs/includes/ace/snippets/io.js @@ -0,0 +1,69 @@ +ace.define("ace/snippets/io",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippets = [ + { + "content": "assertEquals(${1:expected}, ${2:expr})", + "name": "assertEquals", + "scope": "io", + "tabTrigger": "ae" + }, + { + "content": "${1:${2:newValue} := ${3:Object} }clone do(\n\t$0\n)", + "name": "clone do", + "scope": "io", + "tabTrigger": "cdo" + }, + { + "content": "docSlot(\"${1:slotName}\", \"${2:documentation}\")", + "name": "docSlot", + "scope": "io", + "tabTrigger": "ds" + }, + { + "content": "(${1:header,}\n\t${2:body}\n)$0", + "keyEquivalent": "@(", + "name": "Indented Bracketed Line", + "scope": "io", + "tabTrigger": "(" + }, + { + "content": "\n\t$0\n", + "keyEquivalent": "\r", + "name": "Special: Return Inside Empty Parenthesis", + "scope": "io meta.empty-parenthesis.io, io meta.comma-parenthesis.io" + }, + { + "content": "${1:methodName} := method(${2:args,}\n\t$0\n)", + "name": "method", + "scope": "io", + "tabTrigger": "m" + }, + { + "content": "newSlot(\"${1:slotName}\", ${2:defaultValue}, \"${3:docString}\")$0", + "name": "newSlot", + "scope": "io", + "tabTrigger": "ns" + }, + { + "content": "${1:name} := Object clone do(\n\t$0\n)", + "name": "Object clone do", + "scope": "io", + "tabTrigger": "ocdo" + }, + { + "content": "test${1:SomeFeature} := method(\n\t$0\n)", + "name": "testMethod", + "scope": "io", + "tabTrigger": "ts" + }, + { + "content": "${1:Something}Test := ${2:UnitTest} clone do(\n\t$0\n)", + "name": "UnitTest", + "scope": "io", + "tabTrigger": "ut" + } +]; +exports.scope = "io"; + +}); diff --git a/htdocs/includes/ace/snippets/jack.js b/htdocs/includes/ace/snippets/jack.js new file mode 100644 index 00000000000..eca7f2937b8 --- /dev/null +++ b/htdocs/includes/ace/snippets/jack.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/jack",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "jack"; + +}); diff --git a/htdocs/includes/ace/snippets/jade.js b/htdocs/includes/ace/snippets/jade.js new file mode 100644 index 00000000000..f516d0c040a --- /dev/null +++ b/htdocs/includes/ace/snippets/jade.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/jade",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "jade"; + +}); diff --git a/htdocs/includes/ace/snippets/java.js b/htdocs/includes/ace/snippets/java.js new file mode 100644 index 00000000000..1bc92acad0e --- /dev/null +++ b/htdocs/includes/ace/snippets/java.js @@ -0,0 +1,247 @@ +ace.define("ace/snippets/java",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "## Access Modifiers\n\ +snippet po\n\ + protected\n\ +snippet pu\n\ + public\n\ +snippet pr\n\ + private\n\ +##\n\ +## Annotations\n\ +snippet before\n\ + @Before\n\ + static void ${1:intercept}(${2:args}) { ${3} }\n\ +snippet mm\n\ + @ManyToMany\n\ + ${1}\n\ +snippet mo\n\ + @ManyToOne\n\ + ${1}\n\ +snippet om\n\ + @OneToMany${1:(cascade=CascadeType.ALL)}\n\ + ${2}\n\ +snippet oo\n\ + @OneToOne\n\ + ${1}\n\ +##\n\ +## Basic Java packages and import\n\ +snippet im\n\ + import\n\ +snippet j.b\n\ + java.beans.\n\ +snippet j.i\n\ + java.io.\n\ +snippet j.m\n\ + java.math.\n\ +snippet j.n\n\ + java.net.\n\ +snippet j.u\n\ + java.util.\n\ +##\n\ +## Class\n\ +snippet cl\n\ + class ${1:`Filename(\"\", \"untitled\")`} ${2}\n\ +snippet in\n\ + interface ${1:`Filename(\"\", \"untitled\")`} ${2:extends Parent}${3}\n\ +snippet tc\n\ + public class ${1:`Filename()`} extends ${2:TestCase}\n\ +##\n\ +## Class Enhancements\n\ +snippet ext\n\ + extends \n\ +snippet imp\n\ + implements\n\ +##\n\ +## Comments\n\ +snippet /*\n\ + /*\n\ + * ${1}\n\ + */\n\ +##\n\ +## Constants\n\ +snippet co\n\ + static public final ${1:String} ${2:var} = ${3};${4}\n\ +snippet cos\n\ + static public final String ${1:var} = \"${2}\";${3}\n\ +##\n\ +## Control Statements\n\ +snippet case\n\ + case ${1}:\n\ + ${2}\n\ +snippet def\n\ + default:\n\ + ${2}\n\ +snippet el\n\ + else\n\ +snippet elif\n\ + else if (${1}) ${2}\n\ +snippet if\n\ + if (${1}) ${2}\n\ +snippet sw\n\ + switch (${1}) {\n\ + ${2}\n\ + }\n\ +##\n\ +## Create a Method\n\ +snippet m\n\ + ${1:void} ${2:method}(${3}) ${4:throws }${5}\n\ +##\n\ +## Create a Variable\n\ +snippet v\n\ + ${1:String} ${2:var}${3: = null}${4};${5}\n\ +##\n\ +## Enhancements to Methods, variables, classes, etc.\n\ +snippet ab\n\ + abstract\n\ +snippet fi\n\ + final\n\ +snippet st\n\ + static\n\ +snippet sy\n\ + synchronized\n\ +##\n\ +## Error Methods\n\ +snippet err\n\ + System.err.print(\"${1:Message}\");\n\ +snippet errf\n\ + System.err.printf(\"${1:Message}\", ${2:exception});\n\ +snippet errln\n\ + System.err.println(\"${1:Message}\");\n\ +##\n\ +## Exception Handling\n\ +snippet as\n\ + assert ${1:test} : \"${2:Failure message}\";${3}\n\ +snippet ca\n\ + catch(${1:Exception} ${2:e}) ${3}\n\ +snippet thr\n\ + throw\n\ +snippet ths\n\ + throws\n\ +snippet try\n\ + try {\n\ + ${3}\n\ + } catch(${1:Exception} ${2:e}) {\n\ + }\n\ +snippet tryf\n\ + try {\n\ + ${3}\n\ + } catch(${1:Exception} ${2:e}) {\n\ + } finally {\n\ + }\n\ +##\n\ +## Find Methods\n\ +snippet findall\n\ + List<${1:listName}> ${2:items} = ${1}.findAll();${3}\n\ +snippet findbyid\n\ + ${1:var} ${2:item} = ${1}.findById(${3});${4}\n\ +##\n\ +## Javadocs\n\ +snippet /**\n\ + /**\n\ + * ${1}\n\ + */\n\ +snippet @au\n\ + @author `system(\"grep \\`id -un\\` /etc/passwd | cut -d \\\":\\\" -f5 | cut -d \\\",\\\" -f1\")`\n\ +snippet @br\n\ + @brief ${1:Description}\n\ +snippet @fi\n\ + @file ${1:`Filename()`}.java\n\ +snippet @pa\n\ + @param ${1:param}\n\ +snippet @re\n\ + @return ${1:param}\n\ +##\n\ +## Logger Methods\n\ +snippet debug\n\ + Logger.debug(${1:param});${2}\n\ +snippet error\n\ + Logger.error(${1:param});${2}\n\ +snippet info\n\ + Logger.info(${1:param});${2}\n\ +snippet warn\n\ + Logger.warn(${1:param});${2}\n\ +##\n\ +## Loops\n\ +snippet enfor\n\ + for (${1} : ${2}) ${3}\n\ +snippet for\n\ + for (${1}; ${2}; ${3}) ${4}\n\ +snippet wh\n\ + while (${1}) ${2}\n\ +##\n\ +## Main method\n\ +snippet main\n\ + public static void main (String[] args) {\n\ + ${1:/* code */}\n\ + }\n\ +##\n\ +## Print Methods\n\ +snippet print\n\ + System.out.print(\"${1:Message}\");\n\ +snippet printf\n\ + System.out.printf(\"${1:Message}\", ${2:args});\n\ +snippet println\n\ + System.out.println(${1});\n\ +##\n\ +## Render Methods\n\ +snippet ren\n\ + render(${1:param});${2}\n\ +snippet rena\n\ + renderArgs.put(\"${1}\", ${2});${3}\n\ +snippet renb\n\ + renderBinary(${1:param});${2}\n\ +snippet renj\n\ + renderJSON(${1:param});${2}\n\ +snippet renx\n\ + renderXml(${1:param});${2}\n\ +##\n\ +## Setter and Getter Methods\n\ +snippet set\n\ + ${1:public} void set${3:}(${2:String} ${4:}){\n\ + this.$4 = $4;\n\ + }\n\ +snippet get\n\ + ${1:public} ${2:String} get${3:}(){\n\ + return this.${4:};\n\ + }\n\ +##\n\ +## Terminate Methods or Loops\n\ +snippet re\n\ + return\n\ +snippet br\n\ + break;\n\ +##\n\ +## Test Methods\n\ +snippet t\n\ + public void test${1:Name}() throws Exception {\n\ + ${2}\n\ + }\n\ +snippet test\n\ + @Test\n\ + public void test${1:Name}() throws Exception {\n\ + ${2}\n\ + }\n\ +##\n\ +## Utils\n\ +snippet Sc\n\ + Scanner\n\ +##\n\ +## Miscellaneous\n\ +snippet action\n\ + public static void ${1:index}(${2:args}) { ${3} }\n\ +snippet rnf\n\ + notFound(${1:param});${2}\n\ +snippet rnfin\n\ + notFoundIfNull(${1:param});${2}\n\ +snippet rr\n\ + redirect(${1:param});${2}\n\ +snippet ru\n\ + unauthorized(${1:param});${2}\n\ +snippet unless\n\ + (unless=${1:param});${2}\n\ +"; +exports.scope = "java"; + +}); diff --git a/htdocs/includes/ace/snippets/javascript.js b/htdocs/includes/ace/snippets/javascript.js new file mode 100644 index 00000000000..f3f998ad636 --- /dev/null +++ b/htdocs/includes/ace/snippets/javascript.js @@ -0,0 +1,202 @@ +ace.define("ace/snippets/javascript",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Prototype\n\ +snippet proto\n\ + ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n\ + ${4:// body...}\n\ + };\n\ +# Function\n\ +snippet fun\n\ + function ${1?:function_name}(${2:argument}) {\n\ + ${3:// body...}\n\ + }\n\ +# Anonymous Function\n\ +regex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\n\ +snippet f\n\ + function${M1?: ${1:functionName}}($2) {\n\ + ${0:$TM_SELECTED_TEXT}\n\ + }${M2?;}${M3?,}${M4?)}\n\ +# Immediate function\n\ +trigger \\(?f\\(\n\ +endTrigger \\)?\n\ +snippet f(\n\ + (function(${1}) {\n\ + ${0:${TM_SELECTED_TEXT:/* code */}}\n\ + }(${1}));\n\ +# if\n\ +snippet if\n\ + if (${1:true}) {\n\ + ${0}\n\ + }\n\ +# if ... else\n\ +snippet ife\n\ + if (${1:true}) {\n\ + ${2}\n\ + } else {\n\ + ${0}\n\ + }\n\ +# tertiary conditional\n\ +snippet ter\n\ + ${1:/* condition */} ? ${2:a} : ${3:b}\n\ +# switch\n\ +snippet switch\n\ + switch (${1:expression}) {\n\ + case '${3:case}':\n\ + ${4:// code}\n\ + break;\n\ + ${5}\n\ + default:\n\ + ${2:// code}\n\ + }\n\ +# case\n\ +snippet case\n\ + case '${1:case}':\n\ + ${2:// code}\n\ + break;\n\ + ${3}\n\ +\n\ +# while (...) {...}\n\ +snippet wh\n\ + while (${1:/* condition */}) {\n\ + ${0:/* code */}\n\ + }\n\ +# try\n\ +snippet try\n\ + try {\n\ + ${0:/* code */}\n\ + } catch (e) {}\n\ +# do...while\n\ +snippet do\n\ + do {\n\ + ${2:/* code */}\n\ + } while (${1:/* condition */});\n\ +# Object Method\n\ +snippet :f\n\ +regex /([,{[])|^\\s*/:f/\n\ + ${1:method_name}: function(${2:attribute}) {\n\ + ${0}\n\ + }${3:,}\n\ +# setTimeout function\n\ +snippet setTimeout\n\ +regex /\\b/st|timeout|setTimeo?u?t?/\n\ + setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n\ +# Get Elements\n\ +snippet gett\n\ + getElementsBy${1:TagName}('${2}')${3}\n\ +# Get Element\n\ +snippet get\n\ + getElementBy${1:Id}('${2}')${3}\n\ +# console.log (Firebug)\n\ +snippet cl\n\ + console.log(${1});\n\ +# return\n\ +snippet ret\n\ + return ${1:result}\n\ +# for (property in object ) { ... }\n\ +snippet fori\n\ + for (var ${1:prop} in ${2:Things}) {\n\ + ${0:$2[$1]}\n\ + }\n\ +# hasOwnProperty\n\ +snippet has\n\ + hasOwnProperty(${1})\n\ +# docstring\n\ +snippet /**\n\ + /**\n\ + * ${1:description}\n\ + *\n\ + */\n\ +snippet @par\n\ +regex /^\\s*\\*\\s*/@(para?m?)?/\n\ + @param {${1:type}} ${2:name} ${3:description}\n\ +snippet @ret\n\ + @return {${1:type}} ${2:description}\n\ +# JSON.parse\n\ +snippet jsonp\n\ + JSON.parse(${1:jstr});\n\ +# JSON.stringify\n\ +snippet jsons\n\ + JSON.stringify(${1:object});\n\ +# self-defining function\n\ +snippet sdf\n\ + var ${1:function_name} = function(${2:argument}) {\n\ + ${3:// initial code ...}\n\ +\n\ + $1 = function($2) {\n\ + ${4:// main code}\n\ + };\n\ + }\n\ +# singleton\n\ +snippet sing\n\ + function ${1:Singleton} (${2:argument}) {\n\ + // the cached instance\n\ + var instance;\n\ +\n\ + // rewrite the constructor\n\ + $1 = function $1($2) {\n\ + return instance;\n\ + };\n\ + \n\ + // carry over the prototype properties\n\ + $1.prototype = this;\n\ +\n\ + // the instance\n\ + instance = new $1();\n\ +\n\ + // reset the constructor pointer\n\ + instance.constructor = $1;\n\ +\n\ + ${3:// code ...}\n\ +\n\ + return instance;\n\ + }\n\ +# class\n\ +snippet class\n\ +regex /^\\s*/clas{0,2}/\n\ + var ${1:class} = function(${20}) {\n\ + $40$0\n\ + };\n\ + \n\ + (function() {\n\ + ${60:this.prop = \"\"}\n\ + }).call(${1:class}.prototype);\n\ + \n\ + exports.${1:class} = ${1:class};\n\ +# \n\ +snippet for-\n\ + for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n\ + ${0:${2:Things}[${1:i}];}\n\ + }\n\ +# for (...) {...}\n\ +snippet for\n\ + for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n\ + ${3:$2[$1]}$0\n\ + }\n\ +# for (...) {...} (Improved Native For-Loop)\n\ +snippet forr\n\ + for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n\ + ${3:$2[$1]}$0\n\ + }\n\ +\n\ +\n\ +#modules\n\ +snippet def\n\ + define(function(require, exports, module) {\n\ + \"use strict\";\n\ + var ${1/.*\\///} = require(\"${1}\");\n\ + \n\ + $TM_SELECTED_TEXT\n\ + });\n\ +snippet req\n\ +guard ^\\s*\n\ + var ${1/.*\\///} = require(\"${1}\");\n\ + $0\n\ +snippet requ\n\ +guard ^\\s*\n\ + var ${1/.*\\/(.)/\\u$1/} = require(\"${1}\").${1/.*\\/(.)/\\u$1/};\n\ + $0\n\ +"; +exports.scope = "javascript"; + +}); diff --git a/htdocs/includes/ace/snippets/json.js b/htdocs/includes/ace/snippets/json.js new file mode 100644 index 00000000000..cc02e651367 --- /dev/null +++ b/htdocs/includes/ace/snippets/json.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/json",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "json"; + +}); diff --git a/htdocs/includes/ace/snippets/jsoniq.js b/htdocs/includes/ace/snippets/jsoniq.js new file mode 100644 index 00000000000..9c5eaf61379 --- /dev/null +++ b/htdocs/includes/ace/snippets/jsoniq.js @@ -0,0 +1,68 @@ +ace.define("ace/snippets/jsoniq",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet for\n\ + for $${1:item} in ${2:expr}\n\ +snippet return\n\ + return ${1:expr}\n\ +snippet import\n\ + import module namespace ${1:ns} = \"${2:http://www.example.com/}\";\n\ +snippet some\n\ + some $${1:varname} in ${2:expr} satisfies ${3:expr}\n\ +snippet every\n\ + every $${1:varname} in ${2:expr} satisfies ${3:expr}\n\ +snippet if\n\ + if(${1:true}) then ${2:expr} else ${3:true}\n\ +snippet switch\n\ + switch(${1:\"foo\"})\n\ + case ${2:\"foo\"}\n\ + return ${3:true}\n\ + default return ${4:false}\n\ +snippet try\n\ + try { ${1:expr} } catch ${2:*} { ${3:expr} }\n\ +snippet tumbling\n\ + for tumbling window $${1:varname} in ${2:expr}\n\ + start at $${3:start} when ${4:expr}\n\ + end at $${5:end} when ${6:expr}\n\ + return ${7:expr}\n\ +snippet sliding\n\ + for sliding window $${1:varname} in ${2:expr}\n\ + start at $${3:start} when ${4:expr}\n\ + end at $${5:end} when ${6:expr}\n\ + return ${7:expr}\n\ +snippet let\n\ + let $${1:varname} := ${2:expr}\n\ +snippet group\n\ + group by $${1:varname} := ${2:expr}\n\ +snippet order\n\ + order by ${1:expr} ${2:descending}\n\ +snippet stable\n\ + stable order by ${1:expr}\n\ +snippet count\n\ + count $${1:varname}\n\ +snippet ordered\n\ + ordered { ${1:expr} }\n\ +snippet unordered\n\ + unordered { ${1:expr} }\n\ +snippet treat \n\ + treat as ${1:expr}\n\ +snippet castable\n\ + castable as ${1:atomicType}\n\ +snippet cast\n\ + cast as ${1:atomicType}\n\ +snippet typeswitch\n\ + typeswitch(${1:expr})\n\ + case ${2:type} return ${3:expr}\n\ + default return ${4:expr}\n\ +snippet var\n\ + declare variable $${1:varname} := ${2:expr};\n\ +snippet fn\n\ + declare function ${1:ns}:${2:name}(){\n\ + ${3:expr}\n\ + };\n\ +snippet module\n\ + module namespace ${1:ns} = \"${2:http://www.example.com}\";\n\ +"; +exports.scope = "jsoniq"; + +}); diff --git a/htdocs/includes/ace/snippets/jsp.js b/htdocs/includes/ace/snippets/jsp.js new file mode 100644 index 00000000000..6428e5be570 --- /dev/null +++ b/htdocs/includes/ace/snippets/jsp.js @@ -0,0 +1,106 @@ +ace.define("ace/snippets/jsp",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet @page\n\ + <%@page contentType=\"text/html\" pageEncoding=\"UTF-8\"%>\n\ +snippet jstl\n\ + <%@ taglib uri=\"http://java.sun.com/jsp/jstl/core\" prefix=\"c\" %>\n\ + <%@ taglib uri=\"http://java.sun.com/jsp/jstl/functions\" prefix=\"fn\" %>\n\ +snippet jstl:c\n\ + <%@ taglib uri=\"http://java.sun.com/jsp/jstl/core\" prefix=\"c\" %>\n\ +snippet jstl:fn\n\ + <%@ taglib uri=\"http://java.sun.com/jsp/jstl/functions\" prefix=\"fn\" %>\n\ +snippet cpath\n\ + ${pageContext.request.contextPath}\n\ +snippet cout\n\ + \n\ +snippet cset\n\ + \n\ +snippet cremove\n\ + \n\ +snippet ccatch\n\ + \n\ +snippet cif\n\ + \n\ + ${2}\n\ + \n\ +snippet cchoose\n\ + \n\ + ${1}\n\ + \n\ +snippet cwhen\n\ + \n\ + ${2}\n\ + \n\ +snippet cother\n\ + \n\ + ${1}\n\ + \n\ +snippet cfore\n\ + \n\ + ${4:}\n\ + \n\ +snippet cfort\n\ + ${2:item1,item2,item3}\n\ + \n\ + ${5:}\n\ + \n\ +snippet cparam\n\ + \n\ +snippet cparam+\n\ + \n\ + cparam+${3}\n\ +snippet cimport\n\ + \n\ +snippet cimport+\n\ + \n\ + \n\ + cparam+${4}\n\ + \n\ +snippet curl\n\ + \n\ + ${3}\n\ +snippet curl+\n\ + \n\ + \n\ + cparam+${6}\n\ + \n\ + ${3}\n\ +snippet credirect\n\ + \n\ +snippet contains\n\ + ${fn:contains(${1:string}, ${2:substr})}\n\ +snippet contains:i\n\ + ${fn:containsIgnoreCase(${1:string}, ${2:substr})}\n\ +snippet endswith\n\ + ${fn:endsWith(${1:string}, ${2:suffix})}\n\ +snippet escape\n\ + ${fn:escapeXml(${1:string})}\n\ +snippet indexof\n\ + ${fn:indexOf(${1:string}, ${2:substr})}\n\ +snippet join\n\ + ${fn:join(${1:collection}, ${2:delims})}\n\ +snippet length\n\ + ${fn:length(${1:collection_or_string})}\n\ +snippet replace\n\ + ${fn:replace(${1:string}, ${2:substr}, ${3:replace})}\n\ +snippet split\n\ + ${fn:split(${1:string}, ${2:delims})}\n\ +snippet startswith\n\ + ${fn:startsWith(${1:string}, ${2:prefix})}\n\ +snippet substr\n\ + ${fn:substring(${1:string}, ${2:begin}, ${3:end})}\n\ +snippet substr:a\n\ + ${fn:substringAfter(${1:string}, ${2:substr})}\n\ +snippet substr:b\n\ + ${fn:substringBefore(${1:string}, ${2:substr})}\n\ +snippet lc\n\ + ${fn:toLowerCase(${1:string})}\n\ +snippet uc\n\ + ${fn:toUpperCase(${1:string})}\n\ +snippet trim\n\ + ${fn:trim(${1:string})}\n\ +"; +exports.scope = "jsp"; + +}); diff --git a/htdocs/includes/ace/snippets/jsx.js b/htdocs/includes/ace/snippets/jsx.js new file mode 100644 index 00000000000..9f39a9431d5 --- /dev/null +++ b/htdocs/includes/ace/snippets/jsx.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/jsx",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "jsx"; + +}); diff --git a/htdocs/includes/ace/snippets/julia.js b/htdocs/includes/ace/snippets/julia.js new file mode 100644 index 00000000000..e81370f75da --- /dev/null +++ b/htdocs/includes/ace/snippets/julia.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/julia",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "julia"; + +}); diff --git a/htdocs/includes/ace/snippets/kotlin.js b/htdocs/includes/ace/snippets/kotlin.js new file mode 100644 index 00000000000..d78bd46332b --- /dev/null +++ b/htdocs/includes/ace/snippets/kotlin.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/kotlin",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/latex.js b/htdocs/includes/ace/snippets/latex.js new file mode 100644 index 00000000000..e6fe7612498 --- /dev/null +++ b/htdocs/includes/ace/snippets/latex.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/latex",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "latex"; + +}); diff --git a/htdocs/includes/ace/snippets/lean.js b/htdocs/includes/ace/snippets/lean.js new file mode 100644 index 00000000000..cff1657099a --- /dev/null +++ b/htdocs/includes/ace/snippets/lean.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/lean",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "lean"; + +}); diff --git a/htdocs/includes/ace/snippets/less.js b/htdocs/includes/ace/snippets/less.js new file mode 100644 index 00000000000..148aa0cd3d5 --- /dev/null +++ b/htdocs/includes/ace/snippets/less.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/less",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "less"; + +}); diff --git a/htdocs/includes/ace/snippets/liquid.js b/htdocs/includes/ace/snippets/liquid.js new file mode 100644 index 00000000000..c7f708dc628 --- /dev/null +++ b/htdocs/includes/ace/snippets/liquid.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/liquid",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "liquid"; + +}); diff --git a/htdocs/includes/ace/snippets/lisp.js b/htdocs/includes/ace/snippets/lisp.js new file mode 100644 index 00000000000..410b807fd3a --- /dev/null +++ b/htdocs/includes/ace/snippets/lisp.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/lisp",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "lisp"; + +}); diff --git a/htdocs/includes/ace/snippets/live_script.js b/htdocs/includes/ace/snippets/live_script.js new file mode 100644 index 00000000000..80a9da89393 --- /dev/null +++ b/htdocs/includes/ace/snippets/live_script.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/live_script",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/livescript.js b/htdocs/includes/ace/snippets/livescript.js new file mode 100644 index 00000000000..37ea1c14af4 --- /dev/null +++ b/htdocs/includes/ace/snippets/livescript.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/livescript",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "livescript"; + +}); diff --git a/htdocs/includes/ace/snippets/logiql.js b/htdocs/includes/ace/snippets/logiql.js new file mode 100644 index 00000000000..77943f3a99d --- /dev/null +++ b/htdocs/includes/ace/snippets/logiql.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/logiql",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "logiql"; + +}); diff --git a/htdocs/includes/ace/snippets/lsl.js b/htdocs/includes/ace/snippets/lsl.js new file mode 100644 index 00000000000..717a5cf32c8 --- /dev/null +++ b/htdocs/includes/ace/snippets/lsl.js @@ -0,0 +1,1239 @@ +ace.define("ace/snippets/lsl",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet @\n\ + @${1:label};\n\ +snippet CAMERA_ACTIVE\n\ + CAMERA_ACTIVE, ${1:integer isActive}, $0\n\ +snippet CAMERA_BEHINDNESS_ANGLE\n\ + CAMERA_BEHINDNESS_ANGLE, ${1:float degrees}, $0\n\ +snippet CAMERA_BEHINDNESS_LAG\n\ + CAMERA_BEHINDNESS_LAG, ${1:float seconds}, $0\n\ +snippet CAMERA_DISTANCE\n\ + CAMERA_DISTANCE, ${1:float meters}, $0\n\ +snippet CAMERA_FOCUS\n\ + CAMERA_FOCUS, ${1:vector position}, $0\n\ +snippet CAMERA_FOCUS_LAG\n\ + CAMERA_FOCUS_LAG, ${1:float seconds}, $0\n\ +snippet CAMERA_FOCUS_LOCKED\n\ + CAMERA_FOCUS_LOCKED, ${1:integer isLocked}, $0\n\ +snippet CAMERA_FOCUS_OFFSET\n\ + CAMERA_FOCUS_OFFSET, ${1:vector meters}, $0\n\ +snippet CAMERA_FOCUS_THRESHOLD\n\ + CAMERA_FOCUS_THRESHOLD, ${1:float meters}, $0\n\ +snippet CAMERA_PITCH\n\ + CAMERA_PITCH, ${1:float degrees}, $0\n\ +snippet CAMERA_POSITION\n\ + CAMERA_POSITION, ${1:vector position}, $0\n\ +snippet CAMERA_POSITION_LAG\n\ + CAMERA_POSITION_LAG, ${1:float seconds}, $0\n\ +snippet CAMERA_POSITION_LOCKED\n\ + CAMERA_POSITION_LOCKED, ${1:integer isLocked}, $0\n\ +snippet CAMERA_POSITION_THRESHOLD\n\ + CAMERA_POSITION_THRESHOLD, ${1:float meters}, $0\n\ +snippet CHARACTER_AVOIDANCE_MODE\n\ + CHARACTER_AVOIDANCE_MODE, ${1:integer flags}, $0\n\ +snippet CHARACTER_DESIRED_SPEED\n\ + CHARACTER_DESIRED_SPEED, ${1:float speed}, $0\n\ +snippet CHARACTER_DESIRED_TURN_SPEED\n\ + CHARACTER_DESIRED_TURN_SPEED, ${1:float speed}, $0\n\ +snippet CHARACTER_LENGTH\n\ + CHARACTER_LENGTH, ${1:float length}, $0\n\ +snippet CHARACTER_MAX_TURN_RADIUS\n\ + CHARACTER_MAX_TURN_RADIUS, ${1:float radius}, $0\n\ +snippet CHARACTER_ORIENTATION\n\ + CHARACTER_ORIENTATION, ${1:integer orientation}, $0\n\ +snippet CHARACTER_RADIUS\n\ + CHARACTER_RADIUS, ${1:float radius}, $0\n\ +snippet CHARACTER_STAY_WITHIN_PARCEL\n\ + CHARACTER_STAY_WITHIN_PARCEL, ${1:boolean stay}, $0\n\ +snippet CHARACTER_TYPE\n\ + CHARACTER_TYPE, ${1:integer type}, $0\n\ +snippet HTTP_BODY_MAXLENGTH\n\ + HTTP_BODY_MAXLENGTH, ${1:integer length}, $0\n\ +snippet HTTP_CUSTOM_HEADER\n\ + HTTP_CUSTOM_HEADER, ${1:string name}, ${2:string value}, $0\n\ +snippet HTTP_METHOD\n\ + HTTP_METHOD, ${1:string method}, $0\n\ +snippet HTTP_MIMETYPE\n\ + HTTP_MIMETYPE, ${1:string mimeType}, $0\n\ +snippet HTTP_PRAGMA_NO_CACHE\n\ + HTTP_PRAGMA_NO_CACHE, ${1:integer send_header}, $0\n\ +snippet HTTP_VERBOSE_THROTTLE\n\ + HTTP_VERBOSE_THROTTLE, ${1:integer noisy}, $0\n\ +snippet HTTP_VERIFY_CERT\n\ + HTTP_VERIFY_CERT, ${1:integer verify}, $0\n\ +snippet RC_DATA_FLAGS\n\ + RC_DATA_FLAGS, ${1:integer flags}, $0\n\ +snippet RC_DETECT_PHANTOM\n\ + RC_DETECT_PHANTOM, ${1:integer dectedPhantom}, $0\n\ +snippet RC_MAX_HITS\n\ + RC_MAX_HITS, ${1:integer maxHits}, $0\n\ +snippet RC_REJECT_TYPES\n\ + RC_REJECT_TYPES, ${1:integer filterMask}, $0\n\ +snippet at_rot_target\n\ + at_rot_target(${1:integer handle}, ${2:rotation targetrot}, ${3:rotation ourrot})\n\ + {\n\ + $0\n\ + }\n\ +snippet at_target\n\ + at_target(${1:integer tnum}, ${2:vector targetpos}, ${3:vector ourpos})\n\ + {\n\ + $0\n\ + }\n\ +snippet attach\n\ + attach(${1:key id})\n\ + {\n\ + $0\n\ + }\n\ +snippet changed\n\ + changed(${1:integer change})\n\ + {\n\ + $0\n\ + }\n\ +snippet collision\n\ + collision(${1:integer index})\n\ + {\n\ + $0\n\ + }\n\ +snippet collision_end\n\ + collision_end(${1:integer index})\n\ + {\n\ + $0\n\ + }\n\ +snippet collision_start\n\ + collision_start(${1:integer index})\n\ + {\n\ + $0\n\ + }\n\ +snippet control\n\ + control(${1:key id}, ${2:integer level}, ${3:integer edge})\n\ + {\n\ + $0\n\ + }\n\ +snippet dataserver\n\ + dataserver(${1:key query_id}, ${2:string data})\n\ + {\n\ + $0\n\ + }\n\ +snippet do\n\ + do\n\ + {\n\ + $0\n\ + }\n\ + while (${1:condition});\n\ +snippet else\n\ + else\n\ + {\n\ + $0\n\ + }\n\ +snippet email\n\ + email(${1:string time}, ${2:string address}, ${3:string subject}, ${4:string message}, ${5:integer num_left})\n\ + {\n\ + $0\n\ + }\n\ +snippet experience_permissions\n\ + experience_permissions(${1:key agent_id})\n\ + {\n\ + $0\n\ + }\n\ +snippet experience_permissions_denied\n\ + experience_permissions_denied(${1:key agent_id}, ${2:integer reason})\n\ + {\n\ + $0\n\ + }\n\ +snippet for\n\ + for (${1:start}; ${3:condition}; ${3:step})\n\ + {\n\ + $0\n\ + }\n\ +snippet http_request\n\ + http_request(${1:key request_id}, ${2:string method}, ${3:string body})\n\ + {\n\ + $0\n\ + }\n\ +snippet http_response\n\ + http_response(${1:key request_id}, ${2:integer status}, ${3:list metadata}, ${4:string body})\n\ + {\n\ + $0\n\ + }\n\ +snippet if\n\ + if (${1:condition})\n\ + {\n\ + $0\n\ + }\n\ +snippet jump\n\ + jump ${1:label};\n\ +snippet land_collision\n\ + land_collision(${1:vector pos})\n\ + {\n\ + $0\n\ + }\n\ +snippet land_collision_end\n\ + land_collision_end(${1:vector pos})\n\ + {\n\ + $0\n\ + }\n\ +snippet land_collision_start\n\ + land_collision_start(${1:vector pos})\n\ + {\n\ + $0\n\ + }\n\ +snippet link_message\n\ + link_message(${1:integer sender_num}, ${2:integer num}, ${3:string str}, ${4:key id})\n\ + {\n\ + $0\n\ + }\n\ +snippet listen\n\ + listen(${1:integer channel}, ${2:string name}, ${3:key id}, ${4:string message})\n\ + {\n\ + $0\n\ + }\n\ +snippet llAbs\n\ + llAbs(${1:integer val})\n\ +snippet llAcos\n\ + llAcos(${1:float val})\n\ +snippet llAddToLandBanList\n\ + llAddToLandBanList(${1:key agent}, ${2:float hours});\n\ + $0\n\ +snippet llAddToLandPassList\n\ + llAddToLandPassList(${1:key agent}, ${2:float hours});\n\ + $0\n\ +snippet llAdjustSoundVolume\n\ + llAdjustSoundVolume(${1:float volume});\n\ + $0\n\ +snippet llAgentInExperience\n\ + llAgentInExperience(${1:key agent})\n\ +snippet llAllowInventoryDrop\n\ + llAllowInventoryDrop(${1:integer add});\n\ + $0\n\ +snippet llAngleBetween\n\ + llAngleBetween(${1:rotation a}, ${2:rotation b})\n\ +snippet llApplyImpulse\n\ + llApplyImpulse(${1:vector force}, ${2:integer local});\n\ + $0\n\ +snippet llApplyRotationalImpulse\n\ + llApplyRotationalImpulse(${1:vector force}, ${2:integer local});\n\ + $0\n\ +snippet llAsin\n\ + llAsin(${1:float val})\n\ +snippet llAtan2\n\ + llAtan2(${1:float y}, ${2:float x})\n\ +snippet llAttachToAvatar\n\ + llAttachToAvatar(${1:integer attach_point});\n\ + $0\n\ +snippet llAttachToAvatarTemp\n\ + llAttachToAvatarTemp(${1:integer attach_point});\n\ + $0\n\ +snippet llAvatarOnLinkSitTarget\n\ + llAvatarOnLinkSitTarget(${1:integer link})\n\ +snippet llAvatarOnSitTarget\n\ + llAvatarOnSitTarget()\n\ +snippet llAxes2Rot\n\ + llAxes2Rot(${1:vector fwd}, ${2:vector left}, ${3:vector up})\n\ +snippet llAxisAngle2Rot\n\ + llAxisAngle2Rot(${1:vector axis}, ${2:float angle})\n\ +snippet llBase64ToInteger\n\ + llBase64ToInteger(${1:string str})\n\ +snippet llBase64ToString\n\ + llBase64ToString(${1:string str})\n\ +snippet llBreakAllLinks\n\ + llBreakAllLinks();\n\ + $0\n\ +snippet llBreakLink\n\ + llBreakLink(${1:integer link});\n\ + $0\n\ +snippet llCastRay\n\ + llCastRay(${1:vector start}, ${2:vector end}, ${3:list options});\n\ + $0\n\ +snippet llCeil\n\ + llCeil(${1:float val})\n\ +snippet llClearCameraParams\n\ + llClearCameraParams();\n\ + $0\n\ +snippet llClearLinkMedia\n\ + llClearLinkMedia(${1:integer link}, ${2:integer face});\n\ + $0\n\ +snippet llClearPrimMedia\n\ + llClearPrimMedia(${1:integer face});\n\ + $0\n\ +snippet llCloseRemoteDataChannel\n\ + llCloseRemoteDataChannel(${1:key channel});\n\ + $0\n\ +snippet llCollisionFilter\n\ + llCollisionFilter(${1:string name}, ${2:key id}, ${3:integer accept});\n\ + $0\n\ +snippet llCollisionSound\n\ + llCollisionSound(${1:string impact_sound}, ${2:float impact_volume});\n\ + $0\n\ +snippet llCos\n\ + llCos(${1:float theta})\n\ +snippet llCreateCharacter\n\ + llCreateCharacter(${1:list options});\n\ + $0\n\ +snippet llCreateKeyValue\n\ + llCreateKeyValue(${1:string k})\n\ +snippet llCreateLink\n\ + llCreateLink(${1:key target}, ${2:integer parent});\n\ + $0\n\ +snippet llCSV2List\n\ + llCSV2List(${1:string src})\n\ +snippet llDataSizeKeyValue\n\ + llDataSizeKeyValue()\n\ +snippet llDeleteCharacter\n\ + llDeleteCharacter();\n\ + $0\n\ +snippet llDeleteKeyValue\n\ + llDeleteKeyValue(${1:string k})\n\ +snippet llDeleteSubList\n\ + llDeleteSubList(${1:list src}, ${2:integer start}, ${3:integer end})\n\ +snippet llDeleteSubString\n\ + llDeleteSubString(${1:string src}, ${2:integer start}, ${3:integer end})\n\ +snippet llDetachFromAvatar\n\ + llDetachFromAvatar();\n\ + $0\n\ +snippet llDetectedGrab\n\ + llDetectedGrab(${1:integer number})\n\ +snippet llDetectedGroup\n\ + llDetectedGroup(${1:integer number})\n\ +snippet llDetectedKey\n\ + llDetectedKey(${1:integer number})\n\ +snippet llDetectedLinkNumber\n\ + llDetectedLinkNumber(${1:integer number})\n\ +snippet llDetectedName\n\ + llDetectedName(${1:integer number})\n\ +snippet llDetectedOwner\n\ + llDetectedOwner(${1:integer number})\n\ +snippet llDetectedPos\n\ + llDetectedPosl(${1:integer number})\n\ +snippet llDetectedRot\n\ + llDetectedRot(${1:integer number})\n\ +snippet llDetectedTouchBinormal\n\ + llDetectedTouchBinormal(${1:integer number})\n\ +snippet llDetectedTouchFace\n\ + llDetectedTouchFace(${1:integer number})\n\ +snippet llDetectedTouchNormal\n\ + llDetectedTouchNormal(${1:integer number})\n\ +snippet llDetectedTouchPos\n\ + llDetectedTouchPos(${1:integer number})\n\ +snippet llDetectedTouchST\n\ + llDetectedTouchST(${1:integer number})\n\ +snippet llDetectedTouchUV\n\ + llDetectedTouchUV(${1:integer number})\n\ +snippet llDetectedType\n\ + llDetectedType(${1:integer number})\n\ +snippet llDetectedVel\n\ + llDetectedVel(${1:integer number})\n\ +snippet llDialog\n\ + llDialog(${1:key agent}, ${2:string message}, ${3:list buttons}, ${4:integer channel});\n\ + $0\n\ +snippet llDie\n\ + llDie();\n\ + $0\n\ +snippet llDumpList2String\n\ + llDumpList2String(${1:list src}, ${2:string separator})\n\ +snippet llEdgeOfWorld\n\ + llEdgeOfWorld(${1:vector pos}, ${2:vector dir})\n\ +snippet llEjectFromLand\n\ + llEjectFromLand(${1:key agent});\n\ + $0\n\ +snippet llEmail\n\ + llEmail(${1:string address}, ${2:string subject}, ${3:string message});\n\ + $0\n\ +snippet llEscapeURL\n\ + llEscapeURL(${1:string url})\n\ +snippet llEuler2Rot\n\ + llEuler2Rot(${1:vector v})\n\ +snippet llExecCharacterCmd\n\ + llExecCharacterCmd(${1:integer command}, ${2:list options});\n\ + $0\n\ +snippet llEvade\n\ + llEvade(${1:key target}, ${2:list options});\n\ + $0\n\ +snippet llFabs\n\ + llFabs(${1:float val})\n\ +snippet llFleeFrom\n\ + llFleeFrom(${1:vector position}, ${2:float distance}, ${3:list options});\n\ + $0\n\ +snippet llFloor\n\ + llFloor(${1:float val})\n\ +snippet llForceMouselook\n\ + llForceMouselook(${1:integer mouselook});\n\ + $0\n\ +snippet llFrand\n\ + llFrand(${1:float mag})\n\ +snippet llGenerateKey\n\ + llGenerateKey()\n\ +snippet llGetAccel\n\ + llGetAccel()\n\ +snippet llGetAgentInfo\n\ + llGetAgentInfo(${1:key id})\n\ +snippet llGetAgentLanguage\n\ + llGetAgentLanguage(${1:key agent})\n\ +snippet llGetAgentList\n\ + llGetAgentList(${1:integer scope}, ${2:list options})\n\ +snippet llGetAgentSize\n\ + llGetAgentSize(${1:key agent})\n\ +snippet llGetAlpha\n\ + llGetAlpha(${1:integer face})\n\ +snippet llGetAndResetTime\n\ + llGetAndResetTime()\n\ +snippet llGetAnimation\n\ + llGetAnimation(${1:key id})\n\ +snippet llGetAnimationList\n\ + llGetAnimationList(${1:key agent})\n\ +snippet llGetAnimationOverride\n\ + llGetAnimationOverride(${1:string anim_state})\n\ +snippet llGetAttached\n\ + llGetAttached()\n\ +snippet llGetAttachedList\n\ + llGetAttachedList(${1:key id})\n\ +snippet llGetBoundingBox\n\ + llGetBoundingBox(${1:key object})\n\ +snippet llGetCameraPos\n\ + llGetCameraPos()\n\ +snippet llGetCameraRot\n\ + llGetCameraRot()\n\ +snippet llGetCenterOfMass\n\ + llGetCenterOfMass()\n\ +snippet llGetClosestNavPoint\n\ + llGetClosestNavPoint(${1:vector point}, ${2:list options})\n\ +snippet llGetColor\n\ + llGetColor(${1:integer face})\n\ +snippet llGetCreator\n\ + llGetCreator()\n\ +snippet llGetDate\n\ + llGetDate()\n\ +snippet llGetDisplayName\n\ + llGetDisplayName(${1:key id})\n\ +snippet llGetEnergy\n\ + llGetEnergy()\n\ +snippet llGetEnv\n\ + llGetEnv(${1:string name})\n\ +snippet llGetExperienceDetails\n\ + llGetExperienceDetails(${1:key experience_id})\n\ +snippet llGetExperienceErrorMessage\n\ + llGetExperienceErrorMessage(${1:integer error})\n\ +snippet llGetForce\n\ + llGetForce()\n\ +snippet llGetFreeMemory\n\ + llGetFreeMemory()\n\ +snippet llGetFreeURLs\n\ + llGetFreeURLs()\n\ +snippet llGetGeometricCenter\n\ + llGetGeometricCenter()\n\ +snippet llGetGMTclock\n\ + llGetGMTclock()\n\ +snippet llGetHTTPHeader\n\ + llGetHTTPHeader(${1:key request_id}, ${2:string header})\n\ +snippet llGetInventoryCreator\n\ + llGetInventoryCreator(${1:string item})\n\ +snippet llGetInventoryKey\n\ + llGetInventoryKey(${1:string name})\n\ +snippet llGetInventoryName\n\ + llGetInventoryName(${1:integer type}, ${2:integer number})\n\ +snippet llGetInventoryNumber\n\ + llGetInventoryNumber(${1:integer type})\n\ +snippet llGetInventoryPermMask\n\ + llGetInventoryPermMask(${1:string item}, ${2:integer mask})\n\ +snippet llGetInventoryType\n\ + llGetInventoryType(${1:string name})\n\ +snippet llGetKey\n\ + llGetKey()\n\ +snippet llGetLandOwnerAt\n\ + llGetLandOwnerAt(${1:vector pos})\n\ +snippet llGetLinkKey\n\ + llGetLinkKey(${1:integer link})\n\ +snippet llGetLinkMedia\n\ + llGetLinkMedia(${1:integer link}, ${2:integer face}, ${3:list params})\n\ +snippet llGetLinkName\n\ + llGetLinkName(${1:integer link})\n\ +snippet llGetLinkNumber\n\ + llGetLinkNumber()\n\ +snippet llGetLinkNumberOfSides\n\ + llGetLinkNumberOfSides(${1:integer link})\n\ +snippet llGetLinkPrimitiveParams\n\ + llGetLinkPrimitiveParams(${1:integer link}, ${2:list params})\n\ +snippet llGetListEntryType\n\ + llGetListEntryType(${1:list src}, ${2:integer index})\n\ +snippet llGetListLength\n\ + llGetListLength(${1:list src})\n\ +snippet llGetLocalPos\n\ + llGetLocalPos()\n\ +snippet llGetLocalRot\n\ + llGetLocalRot()\n\ +snippet llGetMass\n\ + llGetMass()\n\ +snippet llGetMassMKS\n\ + llGetMassMKS()\n\ +snippet llGetMaxScaleFactor\n\ + llGetMaxScaleFactor()\n\ +snippet llGetMemoryLimit\n\ + llGetMemoryLimit()\n\ +snippet llGetMinScaleFactor\n\ + llGetMinScaleFactor()\n\ +snippet llGetNextEmail\n\ + llGetNextEmail(${1:string address}, ${2:string subject});\n\ + $0\n\ +snippet llGetNotecardLine\n\ + llGetNotecardLine(${1:string name}, ${2:integer line})\n\ +snippet llGetNumberOfNotecardLines\n\ + llGetNumberOfNotecardLines(${1:string name})\n\ +snippet llGetNumberOfPrims\n\ + llGetNumberOfPrims()\n\ +snippet llGetNumberOfSides\n\ + llGetNumberOfSides()\n\ +snippet llGetObjectDesc\n\ + llGetObjectDesc()\n\ +snippet llGetObjectDetails\n\ + llGetObjectDetails(${1:key id}, ${2:list params})\n\ +snippet llGetObjectMass\n\ + llGetObjectMass(${1:key id})\n\ +snippet llGetObjectName\n\ + llGetObjectName()\n\ +snippet llGetObjectPermMask\n\ + llGetObjectPermMask(${1:integer mask})\n\ +snippet llGetObjectPrimCount\n\ + llGetObjectPrimCount(${1:key prim})\n\ +snippet llGetOmega\n\ + llGetOmega()\n\ +snippet llGetOwner\n\ + llGetOwner()\n\ +snippet llGetOwnerKey\n\ + llGetOwnerKey(${1:key id})\n\ +snippet llGetParcelDetails\n\ + llGetParcelDetails(${1:vector pos}, ${2:list params})\n\ +snippet llGetParcelFlags\n\ + llGetParcelFlags(${1:vector pos})\n\ +snippet llGetParcelMaxPrims\n\ + llGetParcelMaxPrims(${1:vector pos}, ${2:integer sim_wide})\n\ +snippet llGetParcelMusicURL\n\ + llGetParcelMusicURL()\n\ +snippet llGetParcelPrimCount\n\ + llGetParcelPrimCount(${1:vector pos}, ${2:integer category}, ${3:integer sim_wide})\n\ +snippet llGetParcelPrimOwners\n\ + llGetParcelPrimOwners(${1:vector pos})\n\ +snippet llGetPermissions\n\ + llGetPermissions()\n\ +snippet llGetPermissionsKey\n\ + llGetPermissionsKey()\n\ +snippet llGetPhysicsMaterial\n\ + llGetPhysicsMaterial()\n\ +snippet llGetPos\n\ + llGetPos()\n\ +snippet llGetPrimitiveParams\n\ + llGetPrimitiveParams(${1:list params})\n\ +snippet llGetPrimMediaParams\n\ + llGetPrimMediaParams(${1:integer face}, ${2:list params})\n\ +snippet llGetRegionAgentCount\n\ + llGetRegionAgentCount()\n\ +snippet llGetRegionCorner\n\ + llGetRegionCorner()\n\ +snippet llGetRegionFlags\n\ + llGetRegionFlags()\n\ +snippet llGetRegionFPS\n\ + llGetRegionFPS()\n\ +snippet llGetRegionName\n\ + llGetRegionName()\n\ +snippet llGetRegionTimeDilation\n\ + llGetRegionTimeDilation()\n\ +snippet llGetRootPosition\n\ + llGetRootPosition()\n\ +snippet llGetRootRotation\n\ + llGetRootRotation()\n\ +snippet llGetRot\n\ + llGetRot()\n\ +snippet llGetScale\n\ + llGetScale()\n\ +snippet llGetScriptName\n\ + llGetScriptName()\n\ +snippet llGetScriptState\n\ + llGetScriptState(${1:string script})\n\ +snippet llGetSimStats\n\ + llGetSimStats(${1:integer stat_type})\n\ +snippet llGetSimulatorHostname\n\ + llGetSimulatorHostname()\n\ +snippet llGetSPMaxMemory\n\ + llGetSPMaxMemory()\n\ +snippet llGetStartParameter\n\ + llGetStartParameter()\n\ +snippet llGetStaticPath\n\ + llGetStaticPath(${1:vector start}, ${2:vector end}, ${3:float radius}, ${4:list params})\n\ +snippet llGetStatus\n\ + llGetStatus(${1:integer status})\n\ +snippet llGetSubString\n\ + llGetSubString(${1:string src}, ${2:integer start}, ${3:integer end})\n\ +snippet llGetSunDirection\n\ + llGetSunDirection()\n\ +snippet llGetTexture\n\ + llGetTexture(${1:integer face})\n\ +snippet llGetTextureOffset\n\ + llGetTextureOffset(${1:integer face})\n\ +snippet llGetTextureRot\n\ + llGetTextureRot(${1:integer face})\n\ +snippet llGetTextureScale\n\ + llGetTextureScale(${1:integer face})\n\ +snippet llGetTime\n\ + llGetTime()\n\ +snippet llGetTimeOfDay\n\ + llGetTimeOfDay()\n\ +snippet llGetTimestamp\n\ + llGetTimestamp()\n\ +snippet llGetTorque\n\ + llGetTorque()\n\ +snippet llGetUnixTime\n\ + llGetUnixTime()\n\ +snippet llGetUsedMemory\n\ + llGetUsedMemory()\n\ +snippet llGetUsername\n\ + llGetUsername(${1:key id})\n\ +snippet llGetVel\n\ + llGetVel()\n\ +snippet llGetWallclock\n\ + llGetWallclock()\n\ +snippet llGiveInventory\n\ + llGiveInventory(${1:key destination}, ${2:string inventory});\n\ + $0\n\ +snippet llGiveInventoryList\n\ + llGiveInventoryList(${1:key target}, ${2:string folder}, ${3:list inventory});\n\ + $0\n\ +snippet llGiveMoney\n\ + llGiveMoney(${1:key destination}, ${2:integer amount})\n\ +snippet llGround\n\ + llGround(${1:vector offset})\n\ +snippet llGroundContour\n\ + llGroundContour(${1:vector offset})\n\ +snippet llGroundNormal\n\ + llGroundNormal(${1:vector offset})\n\ +snippet llGroundRepel\n\ + llGroundRepel(${1:float height}, ${2:integer water}, ${3:float tau});\n\ + $0\n\ +snippet llGroundSlope\n\ + llGroundSlope(${1:vector offset})\n\ +snippet llHTTPRequest\n\ + llHTTPRequest(${1:string url}, ${2:list parameters}, ${3:string body})\n\ +snippet llHTTPResponse\n\ + llHTTPResponse(${1:key request_id}, ${2:integer status}, ${3:string body});\n\ + $0\n\ +snippet llInsertString\n\ + llInsertString(${1:string dst}, ${2:integer pos}, ${3:string src})\n\ +snippet llInstantMessage\n\ + llInstantMessage(${1:key user}, ${2:string message});\n\ + $0\n\ +snippet llIntegerToBase64\n\ + llIntegerToBase64(${1:integer number})\n\ +snippet llJson2List\n\ + llJson2List(${1:string json})\n\ +snippet llJsonGetValue\n\ + llJsonGetValue(${1:string json}, ${2:list specifiers})\n\ +snippet llJsonSetValue\n\ + llJsonSetValue(${1:string json}, ${2:list specifiers}, ${3:string newValue})\n\ +snippet llJsonValueType\n\ + llJsonValueType(${1:string json}, ${2:list specifiers})\n\ +snippet llKey2Name\n\ + llKey2Name(${1:key id})\n\ +snippet llKeyCountKeyValue\n\ + llKeyCountKeyValue()\n\ +snippet llKeysKeyValue\n\ + llKeysKeyValue(${1:integer first}, ${2:integer count})\n\ +snippet llLinkParticleSystem\n\ + llLinkParticleSystem(${1:integer link}, ${2:list rules});\n\ + $0\n\ +snippet llLinkSitTarget\n\ + llLinkSitTarget(${1:integer link}, ${2:vector offset}, ${3:rotation rot});\n\ + $0\n\ +snippet llList2CSV\n\ + llList2CSV(${1:list src})\n\ +snippet llList2Float\n\ + llList2Float(${1:list src}, ${2:integer index})\n\ +snippet llList2Integer\n\ + llList2Integer(${1:list src}, ${2:integer index})\n\ +snippet llList2Json\n\ + llList2Json(${1:string type}, ${2:list values})\n\ +snippet llList2Key\n\ + llList2Key(${1:list src}, ${2:integer index})\n\ +snippet llList2List\n\ + llList2List(${1:list src}, ${2:integer start}, ${3:integer end})\n\ +snippet llList2ListStrided\n\ + llList2ListStrided(${1:list src}, ${2:integer start}, ${3:integer end}, ${4:integer stride})\n\ +snippet llList2Rot\n\ + llList2Rot(${1:list src}, ${2:integer index})\n\ +snippet llList2String\n\ + llList2String(${1:list src}, ${2:integer index})\n\ +snippet llList2Vector\n\ + llList2Vector(${1:list src}, ${2:integer index})\n\ +snippet llListen\n\ + llListen(${1:integer channel}, ${2:string name}, ${3:key id}, ${4:string msg})\n\ +snippet llListenControl\n\ + llListenControl(${1:integer handle}, ${2:integer active});\n\ + $0\n\ +snippet llListenRemove\n\ + llListenRemove(${1:integer handle});\n\ + $0\n\ +snippet llListFindList\n\ + llListFindList(${1:list src}, ${2:list test})\n\ +snippet llListInsertList\n\ + llListInsertList(${1:list dest}, ${2:list src}, ${3:integer start})\n\ +snippet llListRandomize\n\ + llListRandomize(${1:list src}, ${2:integer stride})\n\ +snippet llListReplaceList\n\ + llListReplaceList(${1:list dest}, ${2:list src}, ${3:integer start}, ${4:integer end})\n\ +snippet llListSort\n\ + llListSort(${1:list src}, ${2:integer stride}, ${3:integer ascending})\n\ +snippet llListStatistics\n\ + llListStatistics(${1:integer operation}, ${2:list src})\n\ +snippet llLoadURL\n\ + llLoadURL(${1:key agent}, ${2:string message}, ${3:string url});\n\ + $0\n\ +snippet llLog\n\ + llLog(${1:float val})\n\ +snippet llLog10\n\ + llLog10(${1:float val})\n\ +snippet llLookAt\n\ + llLookAt(${1:vector target}, ${2:float strength}, ${3:float damping});\n\ + $0\n\ +snippet llLoopSound\n\ + llLoopSound(${1:string sound}, ${2:float volume});\n\ + $0\n\ +snippet llLoopSoundMaster\n\ + llLoopSoundMaster(${1:string sound}, ${2:float volume});\n\ + $0\n\ +snippet llLoopSoundSlave\n\ + llLoopSoundSlave(${1:string sound}, ${2:float volume});\n\ + $0\n\ +snippet llManageEstateAccess\n\ + llManageEstateAccess(${1:integer action}, ${2:key agent})\n\ +snippet llMapDestination\n\ + llMapDestination(${1:string simname}, ${2:vector pos}, ${3:vector look_at});\n\ + $0\n\ +snippet llMD5String\n\ + llMD5String(${1:string src}, ${2:integer nonce})\n\ +snippet llMessageLinked\n\ + llMessageLinked(${1:integer link}, ${2:integer num}, ${3:string str}, ${4:key id});\n\ + $0\n\ +snippet llMinEventDelay\n\ + llMinEventDelay(${1:float delay});\n\ + $0\n\ +snippet llModifyLand\n\ + llModifyLand(${1:integer action}, ${2:integer brush});\n\ + $0\n\ +snippet llModPow\n\ + llModPow(${1:integer a}, ${2:integer b}, ${3:integer c})\n\ +snippet llMoveToTarget\n\ + llMoveToTarget(${1:vector target}, ${2:float tau});\n\ + $0\n\ +snippet llNavigateTo\n\ + llNavigateTo(${1:vector pos}, ${2:list options});\n\ + $0\n\ +snippet llOffsetTexture\n\ + llOffsetTexture(${1:float u}, ${2:float v}, ${3:integer face});\n\ + $0\n\ +snippet llOpenRemoteDataChannel\n\ + llOpenRemoteDataChannel();\n\ + $0\n\ +snippet llOverMyLand\n\ + llOverMyLand(${1:key id})\n\ +snippet llOwnerSay\n\ + llOwnerSay(${1:string msg});\n\ + $0\n\ +snippet llParcelMediaCommandList\n\ + llParcelMediaCommandList(${1:list commandList});\n\ + $0\n\ +snippet llParcelMediaQuery\n\ + llParcelMediaQuery(${1:list query})\n\ +snippet llParseString2List\n\ + llParseString2List(${1:string src}, ${2:list separators}, ${3:list spacers})\n\ +snippet llParseStringKeepNulls\n\ + llParseStringKeepNulls(${1:string src}, ${2:list separators}, ${3:list spacers})\n\ +snippet llParticleSystem\n\ + llParticleSystem(${1:list rules});\n\ + $0\n\ +snippet llPassCollisions\n\ + llPassCollisions(${1:integer pass});\n\ + $0\n\ +snippet llPassTouches\n\ + llPassTouches(${1:integer pass});\n\ + $0\n\ +snippet llPatrolPoints\n\ + llPatrolPoints(${1:list patrolPoints}, ${2:list options});\n\ + $0\n\ +snippet llPlaySound\n\ + llPlaySound(${1:string sound}, ${2:float volume});\n\ + $0\n\ +snippet llPlaySoundSlave\n\ + llPlaySoundSlave(${1:string sound}, ${2:float volume});\n\ + $0\n\ +snippet llPow\n\ + llPow(${1:float base}, ${2:float exponent})\n\ +snippet llPreloadSound\n\ + llPreloadSound(${1:string sound});\n\ + $0\n\ +snippet llPursue\n\ + llPursue(${1:key target}, ${2:list options});\n\ + $0\n\ +snippet llPushObject\n\ + llPushObject(${1:key target}, ${2:vector impulse}, ${3:vector ang_impulse}, ${4:integer local});\n\ + $0\n\ +snippet llReadKeyValue\n\ + llReadKeyValue(${1:string k})\n\ +snippet llRegionSay\n\ + llRegionSay(${1:integer channel}, ${2:string msg});\n\ + $0\n\ +snippet llRegionSayTo\n\ + llRegionSayTo(${1:key target}, ${2:integer channel}, ${3:string msg});\n\ + $0\n\ +snippet llReleaseControls\n\ + llReleaseControls();\n\ + $0\n\ +snippet llReleaseURL\n\ + llReleaseURL(${1:string url});\n\ + $0\n\ +snippet llRemoteDataReply\n\ + llRemoteDataReply(${1:key channel}, ${2:key message_id}, ${3:string sdata}, ${4:integer idata});\n\ + $0\n\ +snippet llRemoteLoadScriptPin\n\ + llRemoteLoadScriptPin(${1:key target}, ${2:string name}, ${3:integer pin}, ${4:integer running}, ${5:integer start_param});\n\ + $0\n\ +snippet llRemoveFromLandBanList\n\ + llRemoveFromLandBanList(${1:key agent});\n\ + $0\n\ +snippet llRemoveFromLandPassList\n\ + llRemoveFromLandPassList(${1:key agent});\n\ + $0\n\ +snippet llRemoveInventory\n\ + llRemoveInventory(${1:string item});\n\ + $0\n\ +snippet llRemoveVehicleFlags\n\ + llRemoveVehicleFlags(${1:integer flags});\n\ + $0\n\ +snippet llRequestAgentData\n\ + llRequestAgentData(${1:key id}, ${2:integer data})\n\ +snippet llRequestDisplayName\n\ + llRequestDisplayName(${1:key id})\n\ +snippet llRequestExperiencePermissions\n\ + llRequestExperiencePermissions(${1:key agent}, ${2:string name})\n\ +snippet llRequestInventoryData\n\ + llRequestInventoryData(${1:string name})\n\ +snippet llRequestPermissions\n\ + llRequestPermissions(${1:key agent}, ${2:integer permissions})\n\ +snippet llRequestSecureURL\n\ + llRequestSecureURL()\n\ +snippet llRequestSimulatorData\n\ + llRequestSimulatorData(${1:string region}, ${2:integer data})\n\ +snippet llRequestURL\n\ + llRequestURL()\n\ +snippet llRequestUsername\n\ + llRequestUsername(${1:key id})\n\ +snippet llResetAnimationOverride\n\ + llResetAnimationOverride(${1:string anim_state});\n\ + $0\n\ +snippet llResetLandBanList\n\ + llResetLandBanList();\n\ + $0\n\ +snippet llResetLandPassList\n\ + llResetLandPassList();\n\ + $0\n\ +snippet llResetOtherScript\n\ + llResetOtherScript(${1:string name});\n\ + $0\n\ +snippet llResetScript\n\ + llResetScript();\n\ + $0\n\ +snippet llResetTime\n\ + llResetTime();\n\ + $0\n\ +snippet llReturnObjectsByID\n\ + llReturnObjectsByID(${1:list objects})\n\ +snippet llReturnObjectsByOwner\n\ + llReturnObjectsByOwner(${1:key owner}, ${2:integer scope})\n\ +snippet llRezAtRoot\n\ + llRezAtRoot(${1:string inventory}, ${2:vector position}, ${3:vector velocity}, ${4:rotation rot}, ${5:integer param});\n\ + $0\n\ +snippet llRezObject\n\ + llRezObject(${1:string inventory}, ${2:vector pos}, ${3:vector vel}, ${4:rotation rot}, ${5:integer param});\n\ + $0\n\ +snippet llRot2Angle\n\ + llRot2Angle(${1:rotation rot})\n\ +snippet llRot2Axis\n\ + llRot2Axis(${1:rotation rot})\n\ +snippet llRot2Euler\n\ + llRot2Euler(${1:rotation quat})\n\ +snippet llRot2Fwd\n\ + llRot2Fwd(${1:rotation q})\n\ +snippet llRot2Left\n\ + llRot2Left(${1:rotation q})\n\ +snippet llRot2Up\n\ + llRot2Up(${1:rotation q})\n\ +snippet llRotateTexture\n\ + llRotateTexture(${1:float angle}, ${2:integer face});\n\ + $0\n\ +snippet llRotBetween\n\ + llRotBetween(${1:vector start}, ${2:vector end})\n\ +snippet llRotLookAt\n\ + llRotLookAt(${1:rotation target_direction}, ${2:float strength}, ${3:float damping});\n\ + $0\n\ +snippet llRotTarget\n\ + llRotTarget(${1:rotation rot}, ${2:float error})\n\ +snippet llRotTargetRemove\n\ + llRotTargetRemove(${1:integer handle});\n\ + $0\n\ +snippet llRound\n\ + llRound(${1:float val})\n\ +snippet llSameGroup\n\ + llSameGroup(${1:key group})\n\ +snippet llSay\n\ + llSay(${1:integer channel}, ${2:string msg});\n\ + $0\n\ +snippet llScaleByFactor\n\ + llScaleByFactor(${1:float scaling_factor})\n\ +snippet llScaleTexture\n\ + llScaleTexture(${1:float u}, ${2:float v}, ${3:integer face});\n\ + $0\n\ +snippet llScriptDanger\n\ + llScriptDanger(${1:vector pos})\n\ +snippet llScriptProfiler\n\ + llScriptProfiler(${1:integer flags});\n\ + $0\n\ +snippet llSendRemoteData\n\ + llSendRemoteData(${1:key channel}, ${2:string dest}, ${3:integer idata}, ${4:string sdata})\n\ +snippet llSensor\n\ + llSensor(${1:string name}, ${2:key id}, ${3:integer type}, ${4:float range}, ${5:float arc});\n\ + $0\n\ +snippet llSensorRepeat\n\ + llSensorRepeat(${1:string name}, ${2:key id}, ${3:integer type}, ${4:float range}, ${5:float arc}, ${6:float rate});\n\ + $0\n\ +snippet llSetAlpha\n\ + llSetAlpha(${1:float alpha}, ${2:integer face});\n\ + $0\n\ +snippet llSetAngularVelocity\n\ + llSetAngularVelocity(${1:vector force}, ${2:integer local});\n\ + $0\n\ +snippet llSetAnimationOverride\n\ + llSetAnimationOverride(${1:string anim_state}, ${2:string anim})\n\ +snippet llSetBuoyancy\n\ + llSetBuoyancy(${1:float buoyancy});\n\ + $0\n\ +snippet llSetCameraAtOffset\n\ + llSetCameraAtOffset(${1:vector offset});\n\ + $0\n\ +snippet llSetCameraEyeOffset\n\ + llSetCameraEyeOffset(${1:vector offset});\n\ + $0\n\ +snippet llSetCameraParams\n\ + llSetCameraParams(${1:list rules});\n\ + $0\n\ +snippet llSetClickAction\n\ + llSetClickAction(${1:integer action});\n\ + $0\n\ +snippet llSetColor\n\ + llSetColor(${1:vector color}, ${2:integer face});\n\ + $0\n\ +snippet llSetContentType\n\ + llSetContentType(${1:key request_id}, ${2:integer content_type});\n\ + $0\n\ +snippet llSetDamage\n\ + llSetDamage(${1:float damage});\n\ + $0\n\ +snippet llSetForce\n\ + llSetForce(${1:vector force}, ${2:integer local});\n\ + $0\n\ +snippet llSetForceAndTorque\n\ + llSetForceAndTorque(${1:vector force}, ${2:vector torque}, ${3:integer local});\n\ + $0\n\ +snippet llSetHoverHeight\n\ + llSetHoverHeight(${1:float height}, ${2:integer water}, ${3:float tau});\n\ + $0\n\ +snippet llSetKeyframedMotion\n\ + llSetKeyframedMotion(${1:list keyframes}, ${2:list options});\n\ + $0\n\ +snippet llSetLinkAlpha\n\ + llSetLinkAlpha(${1:integer link}, ${2:float alpha}, ${3:integer face});\n\ + $0\n\ +snippet llSetLinkCamera\n\ + llSetLinkCamera(${1:integer link}, ${2:vector eye}, ${3:vector at});\n\ + $0\n\ +snippet llSetLinkColor\n\ + llSetLinkColor(${1:integer link}, ${2:vector color}, ${3:integer face});\n\ + $0\n\ +snippet llSetLinkMedia\n\ + llSetLinkMedia(${1:integer link}, ${2:integer face}, ${3:list params});\n\ + $0\n\ +snippet llSetLinkPrimitiveParams\n\ + llSetLinkPrimitiveParams(${1:integer link}, ${2:list rules});\n\ + $0\n\ +snippet llSetLinkPrimitiveParamsFast\n\ + llSetLinkPrimitiveParamsFast(${1:integer link}, ${2:list rules});\n\ + $0\n\ +snippet llSetLinkTexture\n\ + llSetLinkTexture(${1:integer link}, ${2:string texture}, ${3:integer face});\n\ + $0\n\ +snippet llSetLinkTextureAnim\n\ + llSetLinkTextureAnim(${1:integer link}, ${2:integer mode}, ${3:integer face}, ${4:integer sizex}, ${5:integer sizey}, ${6:float start}, ${7:float length}, ${8:float rate});\n\ + $0\n\ +snippet llSetLocalRot\n\ + llSetLocalRot(${1:rotation rot});\n\ + $0\n\ +snippet llSetMemoryLimit\n\ + llSetMemoryLimit(${1:integer limit})\n\ +snippet llSetObjectDesc\n\ + llSetObjectDesc(${1:string description});\n\ + $0\n\ +snippet llSetObjectName\n\ + llSetObjectName(${1:string name});\n\ + $0\n\ +snippet llSetParcelMusicURL\n\ + llSetParcelMusicURL(${1:string url});\n\ + $0\n\ +snippet llSetPayPrice\n\ + llSetPayPrice(${1:integer price}, [${2:integer price_button_a}, ${3:integer price_button_b}, ${4:integer price_button_c}, ${5:integer price_button_d}]);\n\ + $0\n\ +snippet llSetPhysicsMaterial\n\ + llSetPhysicsMaterial(${1:integer mask}, ${2:float gravity_multiplier}, ${3:float restitution}, ${4:float friction}, ${5:float density});\n\ + $0\n\ +snippet llSetPos\n\ + llSetPos(${1:vector pos});\n\ + $0\n\ +snippet llSetPrimitiveParams\n\ + llSetPrimitiveParams(${1:list rules});\n\ + $0\n\ +snippet llSetPrimMediaParams\n\ + llSetPrimMediaParams(${1:integer face}, ${2:list params});\n\ + $0\n\ +snippet llSetRegionPos\n\ + llSetRegionPos(${1:vector position})\n\ +snippet llSetRemoteScriptAccessPin\n\ + llSetRemoteScriptAccessPin(${1:integer pin});\n\ + $0\n\ +snippet llSetRot\n\ + llSetRot(${1:rotation rot});\n\ + $0\n\ +snippet llSetScale\n\ + llSetScale(${1:vector size});\n\ + $0\n\ +snippet llSetScriptState\n\ + llSetScriptState(${1:string name}, ${2:integer run});\n\ + $0\n\ +snippet llSetSitText\n\ + llSetSitText(${1:string text});\n\ + $0\n\ +snippet llSetSoundQueueing\n\ + llSetSoundQueueing(${1:integer queue});\n\ + $0\n\ +snippet llSetSoundRadius\n\ + llSetSoundRadius(${1:float radius});\n\ + $0\n\ +snippet llSetStatus\n\ + llSetStatus(${1:integer status}, ${2:integer value});\n\ + $0\n\ +snippet llSetText\n\ + llSetText(${1:string text}, ${2:vector color}, ${3:float alpha});\n\ + $0\n\ +snippet llSetTexture\n\ + llSetTexture(${1:string texture}, ${2:integer face});\n\ + $0\n\ +snippet llSetTextureAnim\n\ + llSetTextureAnim(${1:integer mode}, ${2:integer face}, ${3:integer sizex}, ${4:integer sizey}, ${5:float start}, ${6:float length}, ${7:float rate});\n\ + $0\n\ +snippet llSetTimerEvent\n\ + llSetTimerEvent(${1:float sec});\n\ + $0\n\ +snippet llSetTorque\n\ + llSetTorque(${1:vector torque}, ${2:integer local});\n\ + $0\n\ +snippet llSetTouchText\n\ + llSetTouchText(${1:string text});\n\ + $0\n\ +snippet llSetVehicleFlags\n\ + llSetVehicleFlags(${1:integer flags});\n\ + $0\n\ +snippet llSetVehicleFloatParam\n\ + llSetVehicleFloatParam(${1:integer param}, ${2:float value});\n\ + $0\n\ +snippet llSetVehicleRotationParam\n\ + llSetVehicleRotationParam(${1:integer param}, ${2:rotation rot});\n\ + $0\n\ +snippet llSetVehicleType\n\ + llSetVehicleType(${1:integer type});\n\ + $0\n\ +snippet llSetVehicleVectorParam\n\ + llSetVehicleVectorParam(${1:integer param}, ${2:vector vec});\n\ + $0\n\ +snippet llSetVelocity\n\ + llSetVelocity(${1:vector force}, ${2:integer local});\n\ + $0\n\ +snippet llSHA1String\n\ + llSHA1String(${1:string src})\n\ +snippet llShout\n\ + llShout(${1:integer channel}, ${2:string msg});\n\ + $0\n\ +snippet llSin\n\ + llSin(${1:float theta})\n\ +snippet llSitTarget\n\ + llSitTarget(${1:vector offset}, ${2:rotation rot});\n\ + $0\n\ +snippet llSleep\n\ + llSleep(${1:float sec});\n\ + $0\n\ +snippet llSqrt\n\ + llSqrt(${1:float val})\n\ +snippet llStartAnimation\n\ + llStartAnimation(${1:string anim});\n\ + $0\n\ +snippet llStopAnimation\n\ + llStopAnimation(${1:string anim});\n\ + $0\n\ +snippet llStopHover\n\ + llStopHover();\n\ + $0\n\ +snippet llStopLookAt\n\ + llStopLookAt();\n\ + $0\n\ +snippet llStopMoveToTarget\n\ + llStopMoveToTarget();\n\ + $0\n\ +snippet llStopSound\n\ + llStopSound();\n\ + $0\n\ +snippet llStringLength\n\ + llStringLength(${1:string str})\n\ +snippet llStringToBase64\n\ + llStringToBase64(${1:string str})\n\ +snippet llStringTrim\n\ + llStringTrim(${1:string src}, ${2:integer type})\n\ +snippet llSubStringIndex\n\ + llSubStringIndex(${1:string source}, ${2:string pattern})\n\ +snippet llTakeControls\n\ + llTakeControls(${1:integer controls}, ${2:integer accept}, ${3:integer pass_on});\n\ + $0\n\ +snippet llTan\n\ + llTan(${1:float theta})\n\ +snippet llTarget\n\ + llTarget(${1:vector position}, ${2:float range})\n\ +snippet llTargetOmega\n\ + llTargetOmega(${1:vector axis}, ${2:float spinrate}, ${3:float gain});\n\ + $0\n\ +snippet llTargetRemove\n\ + llTargetRemove(${1:integer handle});\n\ + $0\n\ +snippet llTeleportAgent\n\ + llTeleportAgent(${1:key agent}, ${2:string landmark}, ${3:vector position}, ${4:vector look_at});\n\ + $0\n\ +snippet llTeleportAgentGlobalCoords\n\ + llTeleportAgentGlobalCoords(${1:key agent}, ${2:vector global_coordinates}, ${3:vector region_coordinates}, ${4:vector look_at});\n\ + $0\n\ +snippet llTeleportAgentHome\n\ + llTeleportAgentHome(${1:key agent});\n\ + $0\n\ +snippet llTextBox\n\ + llTextBox(${1:key agent}, ${2:string message}, ${3:integer channel});\n\ + $0\n\ +snippet llToLower\n\ + llToLower(${1:string src})\n\ +snippet llToUpper\n\ + llToUpper(${1:string src})\n\ +snippet llTransferLindenDollars\n\ + llTransferLindenDollars(${1:key destination}, ${2:integer amount})\n\ +snippet llTriggerSound\n\ + llTriggerSound(${1:string sound}, ${2:float volume});\n\ + $0\n\ +snippet llTriggerSoundLimited\n\ + llTriggerSoundLimited(${1:string sound}, ${2:float volume}, ${3:vector top_north_east}, ${4:vector bottom_south_west});\n\ + $0\n\ +snippet llUnescapeURL\n\ + llUnescapeURL(${1:string url})\n\ +snippet llUnSit\n\ + llUnSit(${1:key id});\n\ + $0\n\ +snippet llUpdateCharacter\n\ + llUpdateCharacter(${1:list options})\n\ +snippet llUpdateKeyValue\n\ + llUpdateKeyValue(${1:string k}, ${2:string v}, ${3:integer checked}, ${4:string ov})\n\ +snippet llVecDist\n\ + llVecDist(${1:vector vec_a}, ${2:vector vec_b})\n\ +snippet llVecMag\n\ + llVecMag(${1:vector vec})\n\ +snippet llVecNorm\n\ + llVecNorm(${1:vector vec})\n\ +snippet llVolumeDetect\n\ + llVolumeDetect(${1:integer detect});\n\ + $0\n\ +snippet llWanderWithin\n\ + llWanderWithin(${1:vector origin}, ${2:vector dist}, ${3:list options});\n\ + $0\n\ +snippet llWater\n\ + llWater(${1:vector offset});\n\ + $0\n\ +snippet llWhisper\n\ + llWhisper(${1:integer channel}, ${2:string msg});\n\ + $0\n\ +snippet llWind\n\ + llWind(${1:vector offset});\n\ + $0\n\ +snippet llXorBase64\n\ + llXorBase64(${1:string str1}, ${2:string str2})\n\ +snippet money\n\ + money(${1:key id}, ${2:integer amount})\n\ + {\n\ + $0\n\ + }\n\ +snippet object_rez\n\ + object_rez(${1:key id})\n\ + {\n\ + $0\n\ + }\n\ +snippet on_rez\n\ + on_rez(${1:integer start_param})\n\ + {\n\ + $0\n\ + }\n\ +snippet path_update\n\ + path_update(${1:integer type}, ${2:list reserved})\n\ + {\n\ + $0\n\ + }\n\ +snippet remote_data\n\ + remote_data(${1:integer event_type}, ${2:key channel}, ${3:key message_id}, ${4:string sender}, ${5:integer idata}, ${6:string sdata})\n\ + {\n\ + $0\n\ + }\n\ +snippet run_time_permissions\n\ + run_time_permissions(${1:integer perm})\n\ + {\n\ + $0\n\ + }\n\ +snippet sensor\n\ + sensor(${1:integer index})\n\ + {\n\ + $0\n\ + }\n\ +snippet state\n\ + state ${1:name}\n\ +snippet touch\n\ + touch(${1:integer index})\n\ + {\n\ + $0\n\ + }\n\ +snippet touch_end\n\ + touch_end(${1:integer index})\n\ + {\n\ + $0\n\ + }\n\ +snippet touch_start\n\ + touch_start(${1:integer index})\n\ + {\n\ + $0\n\ + }\n\ +snippet transaction_result\n\ + transaction_result(${1:key id}, ${2:integer success}, ${3:string data})\n\ + {\n\ + $0\n\ + }\n\ +snippet while\n\ + while (${1:condition})\n\ + {\n\ + $0\n\ + }\n\ +"; +exports.scope = "lsl"; + +}); diff --git a/htdocs/includes/ace/snippets/lua.js b/htdocs/includes/ace/snippets/lua.js new file mode 100644 index 00000000000..c369b648ff8 --- /dev/null +++ b/htdocs/includes/ace/snippets/lua.js @@ -0,0 +1,28 @@ +ace.define("ace/snippets/lua",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet #!\n\ + #!/usr/bin/env lua\n\ + $1\n\ +snippet local\n\ + local ${1:x} = ${2:1}\n\ +snippet fun\n\ + function ${1:fname}(${2:...})\n\ + ${3:-- body}\n\ + end\n\ +snippet for\n\ + for ${1:i}=${2:1},${3:10} do\n\ + ${4:print(i)}\n\ + end\n\ +snippet forp\n\ + for ${1:i},${2:v} in pairs(${3:table_name}) do\n\ + ${4:-- body}\n\ + end\n\ +snippet fori\n\ + for ${1:i},${2:v} in ipairs(${3:table_name}) do\n\ + ${4:-- body}\n\ + end\n\ +"; +exports.scope = "lua"; + +}); diff --git a/htdocs/includes/ace/snippets/luapage.js b/htdocs/includes/ace/snippets/luapage.js new file mode 100644 index 00000000000..f1bcf0919d0 --- /dev/null +++ b/htdocs/includes/ace/snippets/luapage.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/luapage",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "luapage"; + +}); diff --git a/htdocs/includes/ace/snippets/lucene.js b/htdocs/includes/ace/snippets/lucene.js new file mode 100644 index 00000000000..8795919e42e --- /dev/null +++ b/htdocs/includes/ace/snippets/lucene.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/lucene",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "lucene"; + +}); diff --git a/htdocs/includes/ace/snippets/makefile.js b/htdocs/includes/ace/snippets/makefile.js new file mode 100644 index 00000000000..6c02e0d657a --- /dev/null +++ b/htdocs/includes/ace/snippets/makefile.js @@ -0,0 +1,11 @@ +ace.define("ace/snippets/makefile",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet ifeq\n\ + ifeq (${1:cond0},${2:cond1})\n\ + ${3:code}\n\ + endif\n\ +"; +exports.scope = "makefile"; + +}); diff --git a/htdocs/includes/ace/snippets/markdown.js b/htdocs/includes/ace/snippets/markdown.js new file mode 100644 index 00000000000..d05f16b9693 --- /dev/null +++ b/htdocs/includes/ace/snippets/markdown.js @@ -0,0 +1,95 @@ +ace.define("ace/snippets/markdown",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Markdown\n\ +\n\ +# Includes octopress (http://octopress.org/) snippets\n\ +\n\ +snippet [\n\ + [${1:text}](http://${2:address} \"${3:title}\")\n\ +snippet [*\n\ + [${1:link}](${2:`@*`} \"${3:title}\")${4}\n\ +\n\ +snippet [:\n\ + [${1:id}]: http://${2:url} \"${3:title}\"\n\ +snippet [:*\n\ + [${1:id}]: ${2:`@*`} \"${3:title}\"\n\ +\n\ +snippet ![\n\ + ![${1:alttext}](${2:/images/image.jpg} \"${3:title}\")\n\ +snippet ![*\n\ + ![${1:alt}](${2:`@*`} \"${3:title}\")${4}\n\ +\n\ +snippet ![:\n\ + ![${1:id}]: ${2:url} \"${3:title}\"\n\ +snippet ![:*\n\ + ![${1:id}]: ${2:`@*`} \"${3:title}\"\n\ +\n\ +snippet ===\n\ +regex /^/=+/=*//\n\ + ${PREV_LINE/./=/g}\n\ + \n\ + ${0}\n\ +snippet ---\n\ +regex /^/-+/-*//\n\ + ${PREV_LINE/./-/g}\n\ + \n\ + ${0}\n\ +snippet blockquote\n\ + {% blockquote %}\n\ + ${1:quote}\n\ + {% endblockquote %}\n\ +\n\ +snippet blockquote-author\n\ + {% blockquote ${1:author}, ${2:title} %}\n\ + ${3:quote}\n\ + {% endblockquote %}\n\ +\n\ +snippet blockquote-link\n\ + {% blockquote ${1:author} ${2:URL} ${3:link_text} %}\n\ + ${4:quote}\n\ + {% endblockquote %}\n\ +\n\ +snippet bt-codeblock-short\n\ + ```\n\ + ${1:code_snippet}\n\ + ```\n\ +\n\ +snippet bt-codeblock-full\n\ + ``` ${1:language} ${2:title} ${3:URL} ${4:link_text}\n\ + ${5:code_snippet}\n\ + ```\n\ +\n\ +snippet codeblock-short\n\ + {% codeblock %}\n\ + ${1:code_snippet}\n\ + {% endcodeblock %}\n\ +\n\ +snippet codeblock-full\n\ + {% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %}\n\ + ${5:code_snippet}\n\ + {% endcodeblock %}\n\ +\n\ +snippet gist-full\n\ + {% gist ${1:gist_id} ${2:filename} %}\n\ +\n\ +snippet gist-short\n\ + {% gist ${1:gist_id} %}\n\ +\n\ +snippet img\n\ + {% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${6:alt_text} %}\n\ +\n\ +snippet youtube\n\ + {% youtube ${1:video_id} %}\n\ +\n\ +# The quote should appear only once in the text. It is inherently part of it.\n\ +# See http://octopress.org/docs/plugins/pullquote/ for more info.\n\ +\n\ +snippet pullquote\n\ + {% pullquote %}\n\ + ${1:text} {\" ${2:quote} \"} ${3:text}\n\ + {% endpullquote %}\n\ +"; +exports.scope = "markdown"; + +}); diff --git a/htdocs/includes/ace/snippets/mask.js b/htdocs/includes/ace/snippets/mask.js new file mode 100644 index 00000000000..2811ad2a090 --- /dev/null +++ b/htdocs/includes/ace/snippets/mask.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/mask",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "mask"; + +}); diff --git a/htdocs/includes/ace/snippets/matlab.js b/htdocs/includes/ace/snippets/matlab.js new file mode 100644 index 00000000000..ce298c3f519 --- /dev/null +++ b/htdocs/includes/ace/snippets/matlab.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/matlab",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "matlab"; + +}); diff --git a/htdocs/includes/ace/snippets/maze.js b/htdocs/includes/ace/snippets/maze.js new file mode 100644 index 00000000000..c12d5668d27 --- /dev/null +++ b/htdocs/includes/ace/snippets/maze.js @@ -0,0 +1,16 @@ +ace.define("ace/snippets/maze",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet >\n\ +description assignment\n\ +scope maze\n\ + -> ${1}= ${2}\n\ +\n\ +snippet >\n\ +description if\n\ +scope maze\n\ + -> IF ${2:**} THEN %${3:L} ELSE %${4:R}\n\ +"; +exports.scope = "maze"; + +}); diff --git a/htdocs/includes/ace/snippets/mel.js b/htdocs/includes/ace/snippets/mel.js new file mode 100644 index 00000000000..537cc25b1d8 --- /dev/null +++ b/htdocs/includes/ace/snippets/mel.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/mel",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "mel"; + +}); diff --git a/htdocs/includes/ace/snippets/mips_assembler.js b/htdocs/includes/ace/snippets/mips_assembler.js new file mode 100644 index 00000000000..08fbb817226 --- /dev/null +++ b/htdocs/includes/ace/snippets/mips_assembler.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/mips_assembler",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "mips_assembler"; + +}); diff --git a/htdocs/includes/ace/snippets/mipsassembler.js b/htdocs/includes/ace/snippets/mipsassembler.js new file mode 100644 index 00000000000..3e997aa8bde --- /dev/null +++ b/htdocs/includes/ace/snippets/mipsassembler.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/mipsassembler",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/mushcode.js b/htdocs/includes/ace/snippets/mushcode.js new file mode 100644 index 00000000000..1f0fe24e328 --- /dev/null +++ b/htdocs/includes/ace/snippets/mushcode.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/mushcode",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "mushcode"; + +}); diff --git a/htdocs/includes/ace/snippets/mysql.js b/htdocs/includes/ace/snippets/mysql.js new file mode 100644 index 00000000000..bfb3a42c7ba --- /dev/null +++ b/htdocs/includes/ace/snippets/mysql.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/mysql",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "mysql"; + +}); diff --git a/htdocs/includes/ace/snippets/nix.js b/htdocs/includes/ace/snippets/nix.js new file mode 100644 index 00000000000..4fb6e7043c2 --- /dev/null +++ b/htdocs/includes/ace/snippets/nix.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/nix",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "nix"; + +}); diff --git a/htdocs/includes/ace/snippets/nsis.js b/htdocs/includes/ace/snippets/nsis.js new file mode 100644 index 00000000000..81b5726da2f --- /dev/null +++ b/htdocs/includes/ace/snippets/nsis.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/nsis",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/objectivec.js b/htdocs/includes/ace/snippets/objectivec.js new file mode 100644 index 00000000000..f93e6ae99a1 --- /dev/null +++ b/htdocs/includes/ace/snippets/objectivec.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/objectivec",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "objectivec"; + +}); diff --git a/htdocs/includes/ace/snippets/ocaml.js b/htdocs/includes/ace/snippets/ocaml.js new file mode 100644 index 00000000000..06e0940dbe6 --- /dev/null +++ b/htdocs/includes/ace/snippets/ocaml.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/ocaml",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "ocaml"; + +}); diff --git a/htdocs/includes/ace/snippets/pascal.js b/htdocs/includes/ace/snippets/pascal.js new file mode 100644 index 00000000000..70aa2ee781e --- /dev/null +++ b/htdocs/includes/ace/snippets/pascal.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/pascal",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "pascal"; + +}); diff --git a/htdocs/includes/ace/snippets/perl.js b/htdocs/includes/ace/snippets/perl.js new file mode 100644 index 00000000000..9f818432cac --- /dev/null +++ b/htdocs/includes/ace/snippets/perl.js @@ -0,0 +1,354 @@ +ace.define("ace/snippets/perl",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# #!/usr/bin/perl\n\ +snippet #!\n\ + #!/usr/bin/env perl\n\ +\n\ +# Hash Pointer\n\ +snippet .\n\ + =>\n\ +# Function\n\ +snippet sub\n\ + sub ${1:function_name} {\n\ + ${2:#body ...}\n\ + }\n\ +# Conditional\n\ +snippet if\n\ + if (${1}) {\n\ + ${2:# body...}\n\ + }\n\ +# Conditional if..else\n\ +snippet ife\n\ + if (${1}) {\n\ + ${2:# body...}\n\ + }\n\ + else {\n\ + ${3:# else...}\n\ + }\n\ +# Conditional if..elsif..else\n\ +snippet ifee\n\ + if (${1}) {\n\ + ${2:# body...}\n\ + }\n\ + elsif (${3}) {\n\ + ${4:# elsif...}\n\ + }\n\ + else {\n\ + ${5:# else...}\n\ + }\n\ +# Conditional One-line\n\ +snippet xif\n\ + ${1:expression} if ${2:condition};${3}\n\ +# Unless conditional\n\ +snippet unless\n\ + unless (${1}) {\n\ + ${2:# body...}\n\ + }\n\ +# Unless conditional One-line\n\ +snippet xunless\n\ + ${1:expression} unless ${2:condition};${3}\n\ +# Try/Except\n\ +snippet eval\n\ + local $@;\n\ + eval {\n\ + ${1:# do something risky...}\n\ + };\n\ + if (my $e = $@) {\n\ + ${2:# handle failure...}\n\ + }\n\ +# While Loop\n\ +snippet wh\n\ + while (${1}) {\n\ + ${2:# body...}\n\ + }\n\ +# While Loop One-line\n\ +snippet xwh\n\ + ${1:expression} while ${2:condition};${3}\n\ +# C-style For Loop\n\ +snippet cfor\n\ + for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) {\n\ + ${4:# body...}\n\ + }\n\ +# For loop one-line\n\ +snippet xfor\n\ + ${1:expression} for @${2:array};${3}\n\ +# Foreach Loop\n\ +snippet for\n\ + foreach my $${1:x} (@${2:array}) {\n\ + ${3:# body...}\n\ + }\n\ +# Foreach Loop One-line\n\ +snippet fore\n\ + ${1:expression} foreach @${2:array};${3}\n\ +# Package\n\ +snippet package\n\ + package ${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`};\n\ +\n\ + ${2}\n\ +\n\ + 1;\n\ +\n\ + __END__\n\ +# Package syntax perl >= 5.14\n\ +snippet packagev514\n\ + package ${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`} ${2:0.99};\n\ +\n\ + ${3}\n\ +\n\ + 1;\n\ +\n\ + __END__\n\ +#moose\n\ +snippet moose\n\ + use Moose;\n\ + use namespace::autoclean;\n\ + ${1:#}BEGIN {extends '${2:ParentClass}'};\n\ +\n\ + ${3}\n\ +# parent\n\ +snippet parent\n\ + use parent qw(${1:Parent Class});\n\ +# Read File\n\ +snippet slurp\n\ + my $${1:var} = do { local $/; open my $file, '<', \"${2:file}\"; <$file> };\n\ + ${3}\n\ +# strict warnings\n\ +snippet strwar\n\ + use strict;\n\ + use warnings;\n\ +# older versioning with perlcritic bypass\n\ +snippet vers\n\ + ## no critic\n\ + our $VERSION = '${1:version}';\n\ + eval $VERSION;\n\ + ## use critic\n\ +# new 'switch' like feature\n\ +snippet switch\n\ + use feature 'switch';\n\ +\n\ +# Anonymous subroutine\n\ +snippet asub\n\ + sub {\n\ + ${1:# body }\n\ + }\n\ +\n\ +\n\ +\n\ +# Begin block\n\ +snippet begin\n\ + BEGIN {\n\ + ${1:# begin body}\n\ + }\n\ +\n\ +# call package function with some parameter\n\ +snippet pkgmv\n\ + __PACKAGE__->${1:package_method}(${2:var})\n\ +\n\ +# call package function without a parameter\n\ +snippet pkgm\n\ + __PACKAGE__->${1:package_method}()\n\ +\n\ +# call package \"get_\" function without a parameter\n\ +snippet pkget\n\ + __PACKAGE__->get_${1:package_method}()\n\ +\n\ +# call package function with a parameter\n\ +snippet pkgetv\n\ + __PACKAGE__->get_${1:package_method}(${2:var})\n\ +\n\ +# complex regex\n\ +snippet qrx\n\ + qr/\n\ + ${1:regex}\n\ + /xms\n\ +\n\ +#simpler regex\n\ +snippet qr/\n\ + qr/${1:regex}/x\n\ +\n\ +#given\n\ +snippet given\n\ + given ($${1:var}) {\n\ + ${2:# cases}\n\ + ${3:# default}\n\ + }\n\ +\n\ +# switch-like case\n\ +snippet when\n\ + when (${1:case}) {\n\ + ${2:# body}\n\ + }\n\ +\n\ +# hash slice\n\ +snippet hslice\n\ + @{ ${1:hash} }{ ${2:array} }\n\ +\n\ +\n\ +# map\n\ +snippet map\n\ + map { ${2: body } } ${1: @array } ;\n\ +\n\ +\n\ +\n\ +# Pod stub\n\ +snippet ppod\n\ + =head1 NAME\n\ +\n\ + ${1:ClassName} - ${2:ShortDesc}\n\ +\n\ + =head1 SYNOPSIS\n\ +\n\ + use $1;\n\ +\n\ + ${3:# synopsis...}\n\ +\n\ + =head1 DESCRIPTION\n\ +\n\ + ${4:# longer description...}\n\ +\n\ +\n\ + =head1 INTERFACE\n\ +\n\ +\n\ + =head1 DEPENDENCIES\n\ +\n\ +\n\ + =head1 SEE ALSO\n\ +\n\ +\n\ +# Heading for a subroutine stub\n\ +snippet psub\n\ + =head2 ${1:MethodName}\n\ +\n\ + ${2:Summary....}\n\ +\n\ +# Heading for inline subroutine pod\n\ +snippet psubi\n\ + =head2 ${1:MethodName}\n\ +\n\ + ${2:Summary...}\n\ +\n\ +\n\ + =cut\n\ +# inline documented subroutine\n\ +snippet subpod\n\ + =head2 $1\n\ +\n\ + Summary of $1\n\ +\n\ + =cut\n\ +\n\ + sub ${1:subroutine_name} {\n\ + ${2:# body...}\n\ + }\n\ +# Subroutine signature\n\ +snippet parg\n\ + =over 2\n\ +\n\ + =item\n\ + Arguments\n\ +\n\ +\n\ + =over 3\n\ +\n\ + =item\n\ + C<${1:DataStructure}>\n\ +\n\ + ${2:Sample}\n\ +\n\ +\n\ + =back\n\ +\n\ +\n\ + =item\n\ + Return\n\ +\n\ + =over 3\n\ +\n\ +\n\ + =item\n\ + C<${3:...return data}>\n\ +\n\ +\n\ + =back\n\ +\n\ +\n\ + =back\n\ +\n\ +\n\ +\n\ +# Moose has\n\ +snippet has\n\ + has ${1:attribute} => (\n\ + is => '${2:ro|rw}',\n\ + isa => '${3:Str|Int|HashRef|ArrayRef|etc}',\n\ + default => sub {\n\ + ${4:defaultvalue}\n\ + },\n\ + ${5:# other attributes}\n\ + );\n\ +\n\ +\n\ +# override\n\ +snippet override\n\ + override ${1:attribute} => sub {\n\ + ${2:# my $self = shift;};\n\ + ${3:# my ($self, $args) = @_;};\n\ + };\n\ +\n\ +\n\ +# use test classes\n\ +snippet tuse\n\ + use Test::More;\n\ + use Test::Deep; # (); # uncomment to stop prototype errors\n\ + use Test::Exception;\n\ +\n\ +# local test lib\n\ +snippet tlib\n\ + use lib qw{ ./t/lib };\n\ +\n\ +#test methods\n\ +snippet tmeths\n\ + $ENV{TEST_METHOD} = '${1:regex}';\n\ +\n\ +# runtestclass\n\ +snippet trunner\n\ + use ${1:test_class};\n\ + $1->runtests();\n\ +\n\ +# Test::Class-style test\n\ +snippet tsub\n\ + sub t${1:number}_${2:test_case} :Test(${3:num_of_tests}) {\n\ + my $self = shift;\n\ + ${4:# body}\n\ +\n\ + }\n\ +\n\ +# Test::Routine-style test\n\ +snippet trsub\n\ + test ${1:test_name} => { description => '${2:Description of test.}'} => sub {\n\ + my ($self) = @_;\n\ + ${3:# test code}\n\ + };\n\ +\n\ +#prep test method\n\ +snippet tprep\n\ + sub prep${1:number}_${2:test_case} :Test(startup) {\n\ + my $self = shift;\n\ + ${4:# body}\n\ + }\n\ +\n\ +# cause failures to print stack trace\n\ +snippet debug_trace\n\ + use Carp; # 'verbose';\n\ + # cloak \"die\"\n\ + # warn \"warning\"\n\ + $SIG{'__DIE__'} = sub {\n\ + require Carp; Carp::confess\n\ + };\n\ +\n\ +"; +exports.scope = "perl"; + +}); diff --git a/htdocs/includes/ace/snippets/pgsql.js b/htdocs/includes/ace/snippets/pgsql.js new file mode 100644 index 00000000000..5914fe1db90 --- /dev/null +++ b/htdocs/includes/ace/snippets/pgsql.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/pgsql",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "pgsql"; + +}); diff --git a/htdocs/includes/ace/snippets/php.js b/htdocs/includes/ace/snippets/php.js new file mode 100644 index 00000000000..a99ab6e09b2 --- /dev/null +++ b/htdocs/includes/ace/snippets/php.js @@ -0,0 +1,384 @@ +ace.define("ace/snippets/php",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet \n\ +# this one is for php5.4\n\ +snippet \n\ +snippet ns\n\ + namespace ${1:Foo\\Bar\\Baz};\n\ + ${2}\n\ +snippet use\n\ + use ${1:Foo\\Bar\\Baz};\n\ + ${2}\n\ +snippet c\n\ + ${1:abstract }class ${2:$FILENAME}\n\ + {\n\ + ${3}\n\ + }\n\ +snippet i\n\ + interface ${1:$FILENAME}\n\ + {\n\ + ${2}\n\ + }\n\ +snippet t.\n\ + $this->${1}\n\ +snippet f\n\ + function ${1:foo}(${2:array }${3:$bar})\n\ + {\n\ + ${4}\n\ + }\n\ +# method\n\ +snippet m\n\ + ${1:abstract }${2:protected}${3: static} function ${4:foo}(${5:array }${6:$bar})\n\ + {\n\ + ${7}\n\ + }\n\ +# setter method\n\ +snippet sm \n\ + /**\n\ + * Sets the value of ${1:foo}\n\ + *\n\ + * @param ${2:$1} $$1 ${3:description}\n\ + *\n\ + * @return ${4:$FILENAME}\n\ + */\n\ + ${5:public} function set${6:$2}(${7:$2 }$$1)\n\ + {\n\ + $this->${8:$1} = $$1;\n\ + return $this;\n\ + }${9}\n\ +# getter method\n\ +snippet gm\n\ + /**\n\ + * Gets the value of ${1:foo}\n\ + *\n\ + * @return ${2:$1}\n\ + */\n\ + ${3:public} function get${4:$2}()\n\ + {\n\ + return $this->${5:$1};\n\ + }${6}\n\ +#setter\n\ +snippet $s\n\ + ${1:$foo}->set${2:Bar}(${3});\n\ +#getter\n\ +snippet $g\n\ + ${1:$foo}->get${2:Bar}();\n\ +\n\ +# Tertiary conditional\n\ +snippet =?:\n\ + $${1:foo} = ${2:true} ? ${3:a} : ${4};\n\ +snippet ?:\n\ + ${1:true} ? ${2:a} : ${3}\n\ +\n\ +snippet C\n\ + $_COOKIE['${1:variable}']${2}\n\ +snippet E\n\ + $_ENV['${1:variable}']${2}\n\ +snippet F\n\ + $_FILES['${1:variable}']${2}\n\ +snippet G\n\ + $_GET['${1:variable}']${2}\n\ +snippet P\n\ + $_POST['${1:variable}']${2}\n\ +snippet R\n\ + $_REQUEST['${1:variable}']${2}\n\ +snippet S\n\ + $_SERVER['${1:variable}']${2}\n\ +snippet SS\n\ + $_SESSION['${1:variable}']${2}\n\ + \n\ +# the following are old ones\n\ +snippet inc\n\ + include '${1:file}';${2}\n\ +snippet inc1\n\ + include_once '${1:file}';${2}\n\ +snippet req\n\ + require '${1:file}';${2}\n\ +snippet req1\n\ + require_once '${1:file}';${2}\n\ +# Start Docblock\n\ +snippet /*\n\ + /**\n\ + * ${1}\n\ + */\n\ +# Class - post doc\n\ +snippet doc_cp\n\ + /**\n\ + * ${1:undocumented class}\n\ + *\n\ + * @package ${2:default}\n\ + * @subpackage ${3:default}\n\ + * @author ${4:`g:snips_author`}\n\ + */${5}\n\ +# Class Variable - post doc\n\ +snippet doc_vp\n\ + /**\n\ + * ${1:undocumented class variable}\n\ + *\n\ + * @var ${2:string}\n\ + */${3}\n\ +# Class Variable\n\ +snippet doc_v\n\ + /**\n\ + * ${3:undocumented class variable}\n\ + *\n\ + * @var ${4:string}\n\ + */\n\ + ${1:var} $${2};${5}\n\ +# Class\n\ +snippet doc_c\n\ + /**\n\ + * ${3:undocumented class}\n\ + *\n\ + * @package ${4:default}\n\ + * @subpackage ${5:default}\n\ + * @author ${6:`g:snips_author`}\n\ + */\n\ + ${1:}class ${2:}\n\ + {\n\ + ${7}\n\ + } // END $1class $2\n\ +# Constant Definition - post doc\n\ +snippet doc_dp\n\ + /**\n\ + * ${1:undocumented constant}\n\ + */${2}\n\ +# Constant Definition\n\ +snippet doc_d\n\ + /**\n\ + * ${3:undocumented constant}\n\ + */\n\ + define(${1}, ${2});${4}\n\ +# Function - post doc\n\ +snippet doc_fp\n\ + /**\n\ + * ${1:undocumented function}\n\ + *\n\ + * @return ${2:void}\n\ + * @author ${3:`g:snips_author`}\n\ + */${4}\n\ +# Function signature\n\ +snippet doc_s\n\ + /**\n\ + * ${4:undocumented function}\n\ + *\n\ + * @return ${5:void}\n\ + * @author ${6:`g:snips_author`}\n\ + */\n\ + ${1}function ${2}(${3});${7}\n\ +# Function\n\ +snippet doc_f\n\ + /**\n\ + * ${4:undocumented function}\n\ + *\n\ + * @return ${5:void}\n\ + * @author ${6:`g:snips_author`}\n\ + */\n\ + ${1}function ${2}(${3})\n\ + {${7}\n\ + }\n\ +# Header\n\ +snippet doc_h\n\ + /**\n\ + * ${1}\n\ + *\n\ + * @author ${2:`g:snips_author`}\n\ + * @version ${3:$Id$}\n\ + * @copyright ${4:$2}, `strftime('%d %B, %Y')`\n\ + * @package ${5:default}\n\ + */\n\ + \n\ +# Interface\n\ +snippet interface\n\ + /**\n\ + * ${2:undocumented class}\n\ + *\n\ + * @package ${3:default}\n\ + * @author ${4:`g:snips_author`}\n\ + */\n\ + interface ${1:$FILENAME}\n\ + {\n\ + ${5}\n\ + }\n\ +# class ...\n\ +snippet class\n\ + /**\n\ + * ${1}\n\ + */\n\ + class ${2:$FILENAME}\n\ + {\n\ + ${3}\n\ + /**\n\ + * ${4}\n\ + */\n\ + ${5:public} function ${6:__construct}(${7:argument})\n\ + {\n\ + ${8:// code...}\n\ + }\n\ + }\n\ +# define(...)\n\ +snippet def\n\ + define('${1}'${2});${3}\n\ +# defined(...)\n\ +snippet def?\n\ + ${1}defined('${2}')${3}\n\ +snippet wh\n\ + while (${1:/* condition */}) {\n\ + ${2:// code...}\n\ + }\n\ +# do ... while\n\ +snippet do\n\ + do {\n\ + ${2:// code... }\n\ + } while (${1:/* condition */});\n\ +snippet if\n\ + if (${1:/* condition */}) {\n\ + ${2:// code...}\n\ + }\n\ +snippet ifil\n\ + \n\ + ${2:}\n\ + \n\ +snippet ife\n\ + if (${1:/* condition */}) {\n\ + ${2:// code...}\n\ + } else {\n\ + ${3:// code...}\n\ + }\n\ + ${4}\n\ +snippet ifeil\n\ + \n\ + ${2:}\n\ + \n\ + ${3:}\n\ + \n\ + ${4}\n\ +snippet else\n\ + else {\n\ + ${1:// code...}\n\ + }\n\ +snippet elseif\n\ + elseif (${1:/* condition */}) {\n\ + ${2:// code...}\n\ + }\n\ +snippet switch\n\ + switch ($${1:variable}) {\n\ + case '${2:value}':\n\ + ${3:// code...}\n\ + break;\n\ + ${5}\n\ + default:\n\ + ${4:// code...}\n\ + break;\n\ + }\n\ +snippet case\n\ + case '${1:value}':\n\ + ${2:// code...}\n\ + break;${3}\n\ +snippet for\n\ + for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {\n\ + ${4: // code...}\n\ + }\n\ +snippet foreach\n\ + foreach ($${1:variable} as $${2:value}) {\n\ + ${3:// code...}\n\ + }\n\ +snippet foreachil\n\ + \n\ + ${3:}\n\ + \n\ +snippet foreachk\n\ + foreach ($${1:variable} as $${2:key} => $${3:value}) {\n\ + ${4:// code...}\n\ + }\n\ +snippet foreachkil\n\ + $${3:value}): ?>\n\ + ${4:}\n\ + \n\ +# $... = array (...)\n\ +snippet array\n\ + $${1:arrayName} = array('${2}' => ${3});${4}\n\ +snippet try\n\ + try {\n\ + ${2}\n\ + } catch (${1:Exception} $e) {\n\ + }\n\ +# lambda with closure\n\ +snippet lambda\n\ + ${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) {\n\ + ${4}\n\ + };\n\ +# pre_dump();\n\ +snippet pd\n\ + echo '
        '; var_dump(${1}); echo '
        ';\n\ +# pre_dump(); die();\n\ +snippet pdd\n\ + echo '
        '; var_dump(${1}); echo '
        '; die(${2:});\n\ +snippet vd\n\ + var_dump(${1});\n\ +snippet vdd\n\ + var_dump(${1}); die(${2:});\n\ +snippet http_redirect\n\ + header (\"HTTP/1.1 301 Moved Permanently\"); \n\ + header (\"Location: \".URL); \n\ + exit();\n\ +# Getters & Setters\n\ +snippet gs\n\ + /**\n\ + * Gets the value of ${1:foo}\n\ + *\n\ + * @return ${2:$1}\n\ + */\n\ + public function get${3:$2}()\n\ + {\n\ + return $this->${4:$1};\n\ + }\n\ +\n\ + /**\n\ + * Sets the value of $1\n\ + *\n\ + * @param $2 $$1 ${5:description}\n\ + *\n\ + * @return ${6:$FILENAME}\n\ + */\n\ + public function set$3(${7:$2 }$$1)\n\ + {\n\ + $this->$4 = $$1;\n\ + return $this;\n\ + }${8}\n\ +# anotation, get, and set, useful for doctrine\n\ +snippet ags\n\ + /**\n\ + * ${1:description}\n\ + * \n\ + * @${7}\n\ + */\n\ + ${2:protected} $${3:foo};\n\ +\n\ + public function get${4:$3}()\n\ + {\n\ + return $this->$3;\n\ + }\n\ +\n\ + public function set$4(${5:$4 }$${6:$3})\n\ + {\n\ + $this->$3 = $$6;\n\ + return $this;\n\ + }\n\ +snippet rett\n\ + return true;\n\ +snippet retf\n\ + return false;\n\ +"; +exports.scope = "php"; + +}); diff --git a/htdocs/includes/ace/snippets/pig.js b/htdocs/includes/ace/snippets/pig.js new file mode 100644 index 00000000000..479a03bc937 --- /dev/null +++ b/htdocs/includes/ace/snippets/pig.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/pig",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "pig"; + +}); diff --git a/htdocs/includes/ace/snippets/plain_text.js b/htdocs/includes/ace/snippets/plain_text.js new file mode 100644 index 00000000000..24223a66255 --- /dev/null +++ b/htdocs/includes/ace/snippets/plain_text.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/plain_text",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "plain_text"; + +}); diff --git a/htdocs/includes/ace/snippets/powershell.js b/htdocs/includes/ace/snippets/powershell.js new file mode 100644 index 00000000000..a8e7310a15a --- /dev/null +++ b/htdocs/includes/ace/snippets/powershell.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/powershell",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "powershell"; + +}); diff --git a/htdocs/includes/ace/snippets/praat.js b/htdocs/includes/ace/snippets/praat.js new file mode 100644 index 00000000000..dcf6826774c --- /dev/null +++ b/htdocs/includes/ace/snippets/praat.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/praat",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "praat"; + +}); diff --git a/htdocs/includes/ace/snippets/prolog.js b/htdocs/includes/ace/snippets/prolog.js new file mode 100644 index 00000000000..2d63cb83aa7 --- /dev/null +++ b/htdocs/includes/ace/snippets/prolog.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/prolog",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "prolog"; + +}); diff --git a/htdocs/includes/ace/snippets/properties.js b/htdocs/includes/ace/snippets/properties.js new file mode 100644 index 00000000000..44c1ada78e8 --- /dev/null +++ b/htdocs/includes/ace/snippets/properties.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/properties",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "properties"; + +}); diff --git a/htdocs/includes/ace/snippets/protobuf.js b/htdocs/includes/ace/snippets/protobuf.js new file mode 100644 index 00000000000..d00d57afd1d --- /dev/null +++ b/htdocs/includes/ace/snippets/protobuf.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/protobuf",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = ""; +exports.scope = "protobuf"; + +}); diff --git a/htdocs/includes/ace/snippets/python.js b/htdocs/includes/ace/snippets/python.js new file mode 100644 index 00000000000..182b34067e7 --- /dev/null +++ b/htdocs/includes/ace/snippets/python.js @@ -0,0 +1,165 @@ +ace.define("ace/snippets/python",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet #!\n\ + #!/usr/bin/env python\n\ +snippet imp\n\ + import ${1:module}\n\ +snippet from\n\ + from ${1:package} import ${2:module}\n\ +# Module Docstring\n\ +snippet docs\n\ + '''\n\ + File: ${1:FILENAME:file_name}\n\ + Author: ${2:author}\n\ + Description: ${3}\n\ + '''\n\ +snippet wh\n\ + while ${1:condition}:\n\ + ${2:# TODO: write code...}\n\ +# dowh - does the same as do...while in other languages\n\ +snippet dowh\n\ + while True:\n\ + ${1:# TODO: write code...}\n\ + if ${2:condition}:\n\ + break\n\ +snippet with\n\ + with ${1:expr} as ${2:var}:\n\ + ${3:# TODO: write code...}\n\ +# New Class\n\ +snippet cl\n\ + class ${1:ClassName}(${2:object}):\n\ + \"\"\"${3:docstring for $1}\"\"\"\n\ + def __init__(self, ${4:arg}):\n\ + ${5:super($1, self).__init__()}\n\ + self.$4 = $4\n\ + ${6}\n\ +# New Function\n\ +snippet def\n\ + def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):\n\ + \"\"\"${3:docstring for $1}\"\"\"\n\ + ${4:# TODO: write code...}\n\ +snippet deff\n\ + def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):\n\ + ${3:# TODO: write code...}\n\ +# New Method\n\ +snippet defs\n\ + def ${1:mname}(self, ${2:arg}):\n\ + ${3:# TODO: write code...}\n\ +# New Property\n\ +snippet property\n\ + def ${1:foo}():\n\ + doc = \"${2:The $1 property.}\"\n\ + def fget(self):\n\ + ${3:return self._$1}\n\ + def fset(self, value):\n\ + ${4:self._$1 = value}\n\ +# Ifs\n\ +snippet if\n\ + if ${1:condition}:\n\ + ${2:# TODO: write code...}\n\ +snippet el\n\ + else:\n\ + ${1:# TODO: write code...}\n\ +snippet ei\n\ + elif ${1:condition}:\n\ + ${2:# TODO: write code...}\n\ +# For\n\ +snippet for\n\ + for ${1:item} in ${2:items}:\n\ + ${3:# TODO: write code...}\n\ +# Encodes\n\ +snippet cutf8\n\ + # -*- coding: utf-8 -*-\n\ +snippet clatin1\n\ + # -*- coding: latin-1 -*-\n\ +snippet cascii\n\ + # -*- coding: ascii -*-\n\ +# Lambda\n\ +snippet ld\n\ + ${1:var} = lambda ${2:vars} : ${3:action}\n\ +snippet .\n\ + self.\n\ +snippet try Try/Except\n\ + try:\n\ + ${1:# TODO: write code...}\n\ + except ${2:Exception}, ${3:e}:\n\ + ${4:raise $3}\n\ +snippet try Try/Except/Else\n\ + try:\n\ + ${1:# TODO: write code...}\n\ + except ${2:Exception}, ${3:e}:\n\ + ${4:raise $3}\n\ + else:\n\ + ${5:# TODO: write code...}\n\ +snippet try Try/Except/Finally\n\ + try:\n\ + ${1:# TODO: write code...}\n\ + except ${2:Exception}, ${3:e}:\n\ + ${4:raise $3}\n\ + finally:\n\ + ${5:# TODO: write code...}\n\ +snippet try Try/Except/Else/Finally\n\ + try:\n\ + ${1:# TODO: write code...}\n\ + except ${2:Exception}, ${3:e}:\n\ + ${4:raise $3}\n\ + else:\n\ + ${5:# TODO: write code...}\n\ + finally:\n\ + ${6:# TODO: write code...}\n\ +# if __name__ == '__main__':\n\ +snippet ifmain\n\ + if __name__ == '__main__':\n\ + ${1:main()}\n\ +# __magic__\n\ +snippet _\n\ + __${1:init}__${2}\n\ +# python debugger (pdb)\n\ +snippet pdb\n\ + import pdb; pdb.set_trace()\n\ +# ipython debugger (ipdb)\n\ +snippet ipdb\n\ + import ipdb; ipdb.set_trace()\n\ +# ipython debugger (pdbbb)\n\ +snippet pdbbb\n\ + import pdbpp; pdbpp.set_trace()\n\ +snippet pprint\n\ + import pprint; pprint.pprint(${1})${2}\n\ +snippet \"\n\ + \"\"\"\n\ + ${1:doc}\n\ + \"\"\"\n\ +# test function/method\n\ +snippet test\n\ + def test_${1:description}(${2:self}):\n\ + ${3:# TODO: write code...}\n\ +# test case\n\ +snippet testcase\n\ + class ${1:ExampleCase}(unittest.TestCase):\n\ + \n\ + def test_${2:description}(self):\n\ + ${3:# TODO: write code...}\n\ +snippet fut\n\ + from __future__ import ${1}\n\ +#getopt\n\ +snippet getopt\n\ + try:\n\ + # Short option syntax: \"hv:\"\n\ + # Long option syntax: \"help\" or \"verbose=\"\n\ + opts, args = getopt.getopt(sys.argv[1:], \"${1:short_options}\", [${2:long_options}])\n\ + \n\ + except getopt.GetoptError, err:\n\ + # Print debug info\n\ + print str(err)\n\ + ${3:error_action}\n\ +\n\ + for option, argument in opts:\n\ + if option in (\"-h\", \"--help\"):\n\ + ${4}\n\ + elif option in (\"-v\", \"--verbose\"):\n\ + verbose = argument\n\ +"; +exports.scope = "python"; + +}); diff --git a/htdocs/includes/ace/snippets/r.js b/htdocs/includes/ace/snippets/r.js new file mode 100644 index 00000000000..24c02a0c6a7 --- /dev/null +++ b/htdocs/includes/ace/snippets/r.js @@ -0,0 +1,128 @@ +ace.define("ace/snippets/r",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet #!\n\ + #!/usr/bin/env Rscript\n\ +\n\ +# includes\n\ +snippet lib\n\ + library(${1:package})\n\ +snippet req\n\ + require(${1:package})\n\ +snippet source\n\ + source('${1:file}')\n\ +\n\ +# conditionals\n\ +snippet if\n\ + if (${1:condition}) {\n\ + ${2:code}\n\ + }\n\ +snippet el\n\ + else {\n\ + ${1:code}\n\ + }\n\ +snippet ei\n\ + else if (${1:condition}) {\n\ + ${2:code}\n\ + }\n\ +\n\ +# functions\n\ +snippet fun\n\ + ${1:name} = function (${2:variables}) {\n\ + ${3:code}\n\ + }\n\ +snippet ret\n\ + return(${1:code})\n\ +\n\ +# dataframes, lists, etc\n\ +snippet df\n\ + ${1:name}[${2:rows}, ${3:cols}]\n\ +snippet c\n\ + c(${1:items})\n\ +snippet li\n\ + list(${1:items})\n\ +snippet mat\n\ + matrix(${1:data}, nrow=${2:rows}, ncol=${3:cols})\n\ +\n\ +# apply functions\n\ +snippet apply\n\ + apply(${1:array}, ${2:margin}, ${3:function})\n\ +snippet lapply\n\ + lapply(${1:list}, ${2:function})\n\ +snippet sapply\n\ + sapply(${1:list}, ${2:function})\n\ +snippet vapply\n\ + vapply(${1:list}, ${2:function}, ${3:type})\n\ +snippet mapply\n\ + mapply(${1:function}, ${2:...})\n\ +snippet tapply\n\ + tapply(${1:vector}, ${2:index}, ${3:function})\n\ +snippet rapply\n\ + rapply(${1:list}, ${2:function})\n\ +\n\ +# plyr functions\n\ +snippet dd\n\ + ddply(${1:frame}, ${2:variables}, ${3:function})\n\ +snippet dl\n\ + dlply(${1:frame}, ${2:variables}, ${3:function})\n\ +snippet da\n\ + daply(${1:frame}, ${2:variables}, ${3:function})\n\ +snippet d_\n\ + d_ply(${1:frame}, ${2:variables}, ${3:function})\n\ +\n\ +snippet ad\n\ + adply(${1:array}, ${2:margin}, ${3:function})\n\ +snippet al\n\ + alply(${1:array}, ${2:margin}, ${3:function})\n\ +snippet aa\n\ + aaply(${1:array}, ${2:margin}, ${3:function})\n\ +snippet a_\n\ + a_ply(${1:array}, ${2:margin}, ${3:function})\n\ +\n\ +snippet ld\n\ + ldply(${1:list}, ${2:function})\n\ +snippet ll\n\ + llply(${1:list}, ${2:function})\n\ +snippet la\n\ + laply(${1:list}, ${2:function})\n\ +snippet l_\n\ + l_ply(${1:list}, ${2:function})\n\ +\n\ +snippet md\n\ + mdply(${1:matrix}, ${2:function})\n\ +snippet ml\n\ + mlply(${1:matrix}, ${2:function})\n\ +snippet ma\n\ + maply(${1:matrix}, ${2:function})\n\ +snippet m_\n\ + m_ply(${1:matrix}, ${2:function})\n\ +\n\ +# plot functions\n\ +snippet pl\n\ + plot(${1:x}, ${2:y})\n\ +snippet ggp\n\ + ggplot(${1:data}, aes(${2:aesthetics}))\n\ +snippet img\n\ + ${1:(jpeg,bmp,png,tiff)}(filename=\"${2:filename}\", width=${3}, height=${4}, unit=\"${5}\")\n\ + ${6:plot}\n\ + dev.off()\n\ +\n\ +# statistical test functions\n\ +snippet fis\n\ + fisher.test(${1:x}, ${2:y})\n\ +snippet chi\n\ + chisq.test(${1:x}, ${2:y})\n\ +snippet tt\n\ + t.test(${1:x}, ${2:y})\n\ +snippet wil\n\ + wilcox.test(${1:x}, ${2:y})\n\ +snippet cor\n\ + cor.test(${1:x}, ${2:y})\n\ +snippet fte\n\ + var.test(${1:x}, ${2:y})\n\ +snippet kvt \n\ + kv.test(${1:x}, ${2:y})\n\ +"; +exports.scope = "r"; + +}); diff --git a/htdocs/includes/ace/snippets/razor.js b/htdocs/includes/ace/snippets/razor.js new file mode 100644 index 00000000000..78fdf8c3eca --- /dev/null +++ b/htdocs/includes/ace/snippets/razor.js @@ -0,0 +1,10 @@ +ace.define("ace/snippets/razor",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet if\n\ +(${1} == ${2}) {\n\ + ${3}\n\ +}"; +exports.scope = "razor"; + +}); diff --git a/htdocs/includes/ace/snippets/rdoc.js b/htdocs/includes/ace/snippets/rdoc.js new file mode 100644 index 00000000000..956de47aa29 --- /dev/null +++ b/htdocs/includes/ace/snippets/rdoc.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/rdoc",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "rdoc"; + +}); diff --git a/htdocs/includes/ace/snippets/rhtml.js b/htdocs/includes/ace/snippets/rhtml.js new file mode 100644 index 00000000000..e62ce87f741 --- /dev/null +++ b/htdocs/includes/ace/snippets/rhtml.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/rhtml",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "rhtml"; + +}); diff --git a/htdocs/includes/ace/snippets/rst.js b/htdocs/includes/ace/snippets/rst.js new file mode 100644 index 00000000000..db6c960f63d --- /dev/null +++ b/htdocs/includes/ace/snippets/rst.js @@ -0,0 +1,29 @@ +ace.define("ace/snippets/rst",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# rst\n\ +\n\ +snippet :\n\ + :${1:field name}: ${2:field body}\n\ +snippet *\n\ + *${1:Emphasis}*\n\ +snippet **\n\ + **${1:Strong emphasis}**\n\ +snippet _\n\ + \\`${1:hyperlink-name}\\`_\n\ + .. _\\`$1\\`: ${2:link-block}\n\ +snippet =\n\ + ${1:Title}\n\ + =====${2:=}\n\ + ${3}\n\ +snippet -\n\ + ${1:Title}\n\ + -----${2:-}\n\ + ${3}\n\ +snippet cont:\n\ + .. contents::\n\ + \n\ +"; +exports.scope = "rst"; + +}); diff --git a/htdocs/includes/ace/snippets/ruby.js b/htdocs/includes/ace/snippets/ruby.js new file mode 100644 index 00000000000..18bc409f47d --- /dev/null +++ b/htdocs/includes/ace/snippets/ruby.js @@ -0,0 +1,935 @@ +ace.define("ace/snippets/ruby",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "########################################\n\ +# Ruby snippets - for Rails, see below #\n\ +########################################\n\ +\n\ +# encoding for Ruby 1.9\n\ +snippet enc\n\ + # encoding: utf-8\n\ +\n\ +# #!/usr/bin/env ruby\n\ +snippet #!\n\ + #!/usr/bin/env ruby\n\ + # encoding: utf-8\n\ +\n\ +# New Block\n\ +snippet =b\n\ + =begin rdoc\n\ + ${1}\n\ + =end\n\ +snippet y\n\ + :yields: ${1:arguments}\n\ +snippet rb\n\ + #!/usr/bin/env ruby -wKU\n\ +snippet beg\n\ + begin\n\ + ${3}\n\ + rescue ${1:Exception} => ${2:e}\n\ + end\n\ +\n\ +snippet req require\n\ + require \"${1}\"${2}\n\ +snippet #\n\ + # =>\n\ +snippet end\n\ + __END__\n\ +snippet case\n\ + case ${1:object}\n\ + when ${2:condition}\n\ + ${3}\n\ + end\n\ +snippet when\n\ + when ${1:condition}\n\ + ${2}\n\ +snippet def\n\ + def ${1:method_name}\n\ + ${2}\n\ + end\n\ +snippet deft\n\ + def test_${1:case_name}\n\ + ${2}\n\ + end\n\ +snippet if\n\ + if ${1:condition}\n\ + ${2}\n\ + end\n\ +snippet ife\n\ + if ${1:condition}\n\ + ${2}\n\ + else\n\ + ${3}\n\ + end\n\ +snippet elsif\n\ + elsif ${1:condition}\n\ + ${2}\n\ +snippet unless\n\ + unless ${1:condition}\n\ + ${2}\n\ + end\n\ +snippet while\n\ + while ${1:condition}\n\ + ${2}\n\ + end\n\ +snippet for\n\ + for ${1:e} in ${2:c}\n\ + ${3}\n\ + end\n\ +snippet until\n\ + until ${1:condition}\n\ + ${2}\n\ + end\n\ +snippet cla class .. end\n\ + class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ + ${2}\n\ + end\n\ +snippet cla class .. initialize .. end\n\ + class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ + def initialize(${2:args})\n\ + ${3}\n\ + end\n\ + end\n\ +snippet cla class .. < ParentClass .. initialize .. end\n\ + class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} < ${2:ParentClass}\n\ + def initialize(${3:args})\n\ + ${4}\n\ + end\n\ + end\n\ +snippet cla ClassName = Struct .. do .. end\n\ + ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} = Struct.new(:${2:attr_names}) do\n\ + def ${3:method_name}\n\ + ${4}\n\ + end\n\ + end\n\ +snippet cla class BlankSlate .. initialize .. end\n\ + class ${1:BlankSlate}\n\ + instance_methods.each { |meth| undef_method(meth) unless meth =~ /\\A__/ }\n\ + end\n\ +snippet cla class << self .. end\n\ + class << ${1:self}\n\ + ${2}\n\ + end\n\ +# class .. < DelegateClass .. initialize .. end\n\ +snippet cla-\n\ + class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} < DelegateClass(${2:ParentClass})\n\ + def initialize(${3:args})\n\ + super(${4:del_obj})\n\ +\n\ + ${5}\n\ + end\n\ + end\n\ +snippet mod module .. end\n\ + module ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ + ${2}\n\ + end\n\ +snippet mod module .. module_function .. end\n\ + module ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ + module_function\n\ +\n\ + ${2}\n\ + end\n\ +snippet mod module .. ClassMethods .. end\n\ + module ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\ + module ClassMethods\n\ + ${2}\n\ + end\n\ +\n\ + module InstanceMethods\n\ +\n\ + end\n\ +\n\ + def self.included(receiver)\n\ + receiver.extend ClassMethods\n\ + receiver.send :include, InstanceMethods\n\ + end\n\ + end\n\ +# attr_reader\n\ +snippet r\n\ + attr_reader :${1:attr_names}\n\ +# attr_writer\n\ +snippet w\n\ + attr_writer :${1:attr_names}\n\ +# attr_accessor\n\ +snippet rw\n\ + attr_accessor :${1:attr_names}\n\ +snippet atp\n\ + attr_protected :${1:attr_names}\n\ +snippet ata\n\ + attr_accessible :${1:attr_names}\n\ +# include Enumerable\n\ +snippet Enum\n\ + include Enumerable\n\ +\n\ + def each(&block)\n\ + ${1}\n\ + end\n\ +# include Comparable\n\ +snippet Comp\n\ + include Comparable\n\ +\n\ + def <=>(other)\n\ + ${1}\n\ + end\n\ +# extend Forwardable\n\ +snippet Forw-\n\ + extend Forwardable\n\ +# def self\n\ +snippet defs\n\ + def self.${1:class_method_name}\n\ + ${2}\n\ + end\n\ +# def method_missing\n\ +snippet defmm\n\ + def method_missing(meth, *args, &blk)\n\ + ${1}\n\ + end\n\ +snippet defd\n\ + def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name}\n\ +snippet defds\n\ + def_delegators :${1:@del_obj}, :${2:del_methods}\n\ +snippet am\n\ + alias_method :${1:new_name}, :${2:old_name}\n\ +snippet app\n\ + if __FILE__ == $PROGRAM_NAME\n\ + ${1}\n\ + end\n\ +# usage_if()\n\ +snippet usai\n\ + if ARGV.${1}\n\ + abort \"Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}\"${3}\n\ + end\n\ +# usage_unless()\n\ +snippet usau\n\ + unless ARGV.${1}\n\ + abort \"Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}\"${3}\n\ + end\n\ +snippet array\n\ + Array.new(${1:10}) { |${2:i}| ${3} }\n\ +snippet hash\n\ + Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${3} }\n\ +snippet file File.foreach() { |line| .. }\n\ + File.foreach(${1:\"path/to/file\"}) { |${2:line}| ${3} }\n\ +snippet file File.read()\n\ + File.read(${1:\"path/to/file\"})${2}\n\ +snippet Dir Dir.global() { |file| .. }\n\ + Dir.glob(${1:\"dir/glob/*\"}) { |${2:file}| ${3} }\n\ +snippet Dir Dir[\"..\"]\n\ + Dir[${1:\"glob/**/*.rb\"}]${2}\n\ +snippet dir\n\ + Filename.dirname(__FILE__)\n\ +snippet deli\n\ + delete_if { |${1:e}| ${2} }\n\ +snippet fil\n\ + fill(${1:range}) { |${2:i}| ${3} }\n\ +# flatten_once()\n\ +snippet flao\n\ + inject(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2)}${3}\n\ +snippet zip\n\ + zip(${1:enums}) { |${2:row}| ${3} }\n\ +# downto(0) { |n| .. }\n\ +snippet dow\n\ + downto(${1:0}) { |${2:n}| ${3} }\n\ +snippet ste\n\ + step(${1:2}) { |${2:n}| ${3} }\n\ +snippet tim\n\ + times { |${1:n}| ${2} }\n\ +snippet upt\n\ + upto(${1:1.0/0.0}) { |${2:n}| ${3} }\n\ +snippet loo\n\ + loop { ${1} }\n\ +snippet ea\n\ + each { |${1:e}| ${2} }\n\ +snippet ead\n\ + each do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet eab\n\ + each_byte { |${1:byte}| ${2} }\n\ +snippet eac- each_char { |chr| .. }\n\ + each_char { |${1:chr}| ${2} }\n\ +snippet eac- each_cons(..) { |group| .. }\n\ + each_cons(${1:2}) { |${2:group}| ${3} }\n\ +snippet eai\n\ + each_index { |${1:i}| ${2} }\n\ +snippet eaid\n\ + each_index do |${1:i}|\n\ + ${2}\n\ + end\n\ +snippet eak\n\ + each_key { |${1:key}| ${2} }\n\ +snippet eakd\n\ + each_key do |${1:key}|\n\ + ${2}\n\ + end\n\ +snippet eal\n\ + each_line { |${1:line}| ${2} }\n\ +snippet eald\n\ + each_line do |${1:line}|\n\ + ${2}\n\ + end\n\ +snippet eap\n\ + each_pair { |${1:name}, ${2:val}| ${3} }\n\ +snippet eapd\n\ + each_pair do |${1:name}, ${2:val}|\n\ + ${3}\n\ + end\n\ +snippet eas-\n\ + each_slice(${1:2}) { |${2:group}| ${3} }\n\ +snippet easd-\n\ + each_slice(${1:2}) do |${2:group}|\n\ + ${3}\n\ + end\n\ +snippet eav\n\ + each_value { |${1:val}| ${2} }\n\ +snippet eavd\n\ + each_value do |${1:val}|\n\ + ${2}\n\ + end\n\ +snippet eawi\n\ + each_with_index { |${1:e}, ${2:i}| ${3} }\n\ +snippet eawid\n\ + each_with_index do |${1:e},${2:i}|\n\ + ${3}\n\ + end\n\ +snippet reve\n\ + reverse_each { |${1:e}| ${2} }\n\ +snippet reved\n\ + reverse_each do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet inj\n\ + inject(${1:init}) { |${2:mem}, ${3:var}| ${4} }\n\ +snippet injd\n\ + inject(${1:init}) do |${2:mem}, ${3:var}|\n\ + ${4}\n\ + end\n\ +snippet map\n\ + map { |${1:e}| ${2} }\n\ +snippet mapd\n\ + map do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet mapwi-\n\ + enum_with_index.map { |${1:e}, ${2:i}| ${3} }\n\ +snippet sor\n\ + sort { |a, b| ${1} }\n\ +snippet sorb\n\ + sort_by { |${1:e}| ${2} }\n\ +snippet ran\n\ + sort_by { rand }\n\ +snippet all\n\ + all? { |${1:e}| ${2} }\n\ +snippet any\n\ + any? { |${1:e}| ${2} }\n\ +snippet cl\n\ + classify { |${1:e}| ${2} }\n\ +snippet col\n\ + collect { |${1:e}| ${2} }\n\ +snippet cold\n\ + collect do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet det\n\ + detect { |${1:e}| ${2} }\n\ +snippet detd\n\ + detect do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet fet\n\ + fetch(${1:name}) { |${2:key}| ${3} }\n\ +snippet fin\n\ + find { |${1:e}| ${2} }\n\ +snippet find\n\ + find do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet fina\n\ + find_all { |${1:e}| ${2} }\n\ +snippet finad\n\ + find_all do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet gre\n\ + grep(${1:/pattern/}) { |${2:match}| ${3} }\n\ +snippet sub\n\ + ${1:g}sub(${2:/pattern/}) { |${3:match}| ${4} }\n\ +snippet sca\n\ + scan(${1:/pattern/}) { |${2:match}| ${3} }\n\ +snippet scad\n\ + scan(${1:/pattern/}) do |${2:match}|\n\ + ${3}\n\ + end\n\ +snippet max\n\ + max { |a, b| ${1} }\n\ +snippet min\n\ + min { |a, b| ${1} }\n\ +snippet par\n\ + partition { |${1:e}| ${2} }\n\ +snippet pard\n\ + partition do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet rej\n\ + reject { |${1:e}| ${2} }\n\ +snippet rejd\n\ + reject do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet sel\n\ + select { |${1:e}| ${2} }\n\ +snippet seld\n\ + select do |${1:e}|\n\ + ${2}\n\ + end\n\ +snippet lam\n\ + lambda { |${1:args}| ${2} }\n\ +snippet doo\n\ + do\n\ + ${1}\n\ + end\n\ +snippet dov\n\ + do |${1:variable}|\n\ + ${2}\n\ + end\n\ +snippet :\n\ + :${1:key} => ${2:\"value\"}${3}\n\ +snippet ope\n\ + open(${1:\"path/or/url/or/pipe\"}, \"${2:w}\") { |${3:io}| ${4} }\n\ +# path_from_here()\n\ +snippet fpath\n\ + File.join(File.dirname(__FILE__), *%2[${1:rel path here}])${2}\n\ +# unix_filter {}\n\ +snippet unif\n\ + ARGF.each_line${1} do |${2:line}|\n\ + ${3}\n\ + end\n\ +# option_parse {}\n\ +snippet optp\n\ + require \"optparse\"\n\ +\n\ + options = {${1:default => \"args\"}}\n\ +\n\ + ARGV.options do |opts|\n\ + opts.banner = \"Usage: #{File.basename($PROGRAM_NAME)}\n\ +snippet opt\n\ + opts.on( \"-${1:o}\", \"--${2:long-option-name}\", ${3:String},\n\ + \"${4:Option description.}\") do |${5:opt}|\n\ + ${6}\n\ + end\n\ +snippet tc\n\ + require \"test/unit\"\n\ +\n\ + require \"${1:library_file_name}\"\n\ +\n\ + class Test${2:$1} < Test::Unit::TestCase\n\ + def test_${3:case_name}\n\ + ${4}\n\ + end\n\ + end\n\ +snippet ts\n\ + require \"test/unit\"\n\ +\n\ + require \"tc_${1:test_case_file}\"\n\ + require \"tc_${2:test_case_file}\"${3}\n\ +snippet as\n\ + assert ${1:test}, \"${2:Failure message.}\"${3}\n\ +snippet ase\n\ + assert_equal ${1:expected}, ${2:actual}${3}\n\ +snippet asne\n\ + assert_not_equal ${1:unexpected}, ${2:actual}${3}\n\ +snippet asid\n\ + assert_in_delta ${1:expected_float}, ${2:actual_float}, ${3:2 ** -20}${4}\n\ +snippet asio\n\ + assert_instance_of ${1:ExpectedClass}, ${2:actual_instance}${3}\n\ +snippet asko\n\ + assert_kind_of ${1:ExpectedKind}, ${2:actual_instance}${3}\n\ +snippet asn\n\ + assert_nil ${1:instance}${2}\n\ +snippet asnn\n\ + assert_not_nil ${1:instance}${2}\n\ +snippet asm\n\ + assert_match /${1:expected_pattern}/, ${2:actual_string}${3}\n\ +snippet asnm\n\ + assert_no_match /${1:unexpected_pattern}/, ${2:actual_string}${3}\n\ +snippet aso\n\ + assert_operator ${1:left}, :${2:operator}, ${3:right}${4}\n\ +snippet asr\n\ + assert_raise ${1:Exception} { ${2} }\n\ +snippet asrd\n\ + assert_raise ${1:Exception} do\n\ + ${2}\n\ + end\n\ +snippet asnr\n\ + assert_nothing_raised ${1:Exception} { ${2} }\n\ +snippet asnrd\n\ + assert_nothing_raised ${1:Exception} do\n\ + ${2}\n\ + end\n\ +snippet asrt\n\ + assert_respond_to ${1:object}, :${2:method}${3}\n\ +snippet ass assert_same(..)\n\ + assert_same ${1:expected}, ${2:actual}${3}\n\ +snippet ass assert_send(..)\n\ + assert_send [${1:object}, :${2:message}, ${3:args}]${4}\n\ +snippet asns\n\ + assert_not_same ${1:unexpected}, ${2:actual}${3}\n\ +snippet ast\n\ + assert_throws :${1:expected} { ${2} }\n\ +snippet astd\n\ + assert_throws :${1:expected} do\n\ + ${2}\n\ + end\n\ +snippet asnt\n\ + assert_nothing_thrown { ${1} }\n\ +snippet asntd\n\ + assert_nothing_thrown do\n\ + ${1}\n\ + end\n\ +snippet fl\n\ + flunk \"${1:Failure message.}\"${2}\n\ +# Benchmark.bmbm do .. end\n\ +snippet bm-\n\ + TESTS = ${1:10_000}\n\ + Benchmark.bmbm do |results|\n\ + ${2}\n\ + end\n\ +snippet rep\n\ + results.report(\"${1:name}:\") { TESTS.times { ${2} }}\n\ +# Marshal.dump(.., file)\n\ +snippet Md\n\ + File.open(${1:\"path/to/file.dump\"}, \"wb\") { |${2:file}| Marshal.dump(${3:obj}, $2) }${4}\n\ +# Mashal.load(obj)\n\ +snippet Ml\n\ + File.open(${1:\"path/to/file.dump\"}, \"rb\") { |${2:file}| Marshal.load($2) }${3}\n\ +# deep_copy(..)\n\ +snippet deec\n\ + Marshal.load(Marshal.dump(${1:obj_to_copy}))${2}\n\ +snippet Pn-\n\ + PStore.new(${1:\"file_name.pstore\"})${2}\n\ +snippet tra\n\ + transaction(${1:true}) { ${2} }\n\ +# xmlread(..)\n\ +snippet xml-\n\ + REXML::Document.new(File.read(${1:\"path/to/file\"}))${2}\n\ +# xpath(..) { .. }\n\ +snippet xpa\n\ + elements.each(${1:\"//Xpath\"}) do |${2:node}|\n\ + ${3}\n\ + end\n\ +# class_from_name()\n\ +snippet clafn\n\ + split(\"::\").inject(Object) { |par, const| par.const_get(const) }\n\ +# singleton_class()\n\ +snippet sinc\n\ + class << self; self end\n\ +snippet nam\n\ + namespace :${1:`Filename()`} do\n\ + ${2}\n\ + end\n\ +snippet tas\n\ + desc \"${1:Task description}\"\n\ + task :${2:task_name => [:dependent, :tasks]} do\n\ + ${3}\n\ + end\n\ +# block\n\ +snippet b\n\ + { |${1:var}| ${2} }\n\ +snippet begin\n\ + begin\n\ + raise 'A test exception.'\n\ + rescue Exception => e\n\ + puts e.message\n\ + puts e.backtrace.inspect\n\ + else\n\ + # other exception\n\ + ensure\n\ + # always executed\n\ + end\n\ +\n\ +#debugging\n\ +snippet debug\n\ + require 'ruby-debug'; debugger; true;\n\ +snippet pry\n\ + require 'pry'; binding.pry\n\ +\n\ +#############################################\n\ +# Rails snippets - for pure Ruby, see above #\n\ +#############################################\n\ +snippet art\n\ + assert_redirected_to ${1::action => \"${2:index}\"}\n\ +snippet artnp\n\ + assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1}, ${4:@$2})\n\ +snippet artnpp\n\ + assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1})\n\ +snippet artp\n\ + assert_redirected_to ${1:model}_path(${2:@$1})\n\ +snippet artpp\n\ + assert_redirected_to ${1:model}s_path\n\ +snippet asd\n\ + assert_difference \"${1:Model}.${2:count}\", $1 do\n\ + ${3}\n\ + end\n\ +snippet asnd\n\ + assert_no_difference \"${1:Model}.${2:count}\" do\n\ + ${3}\n\ + end\n\ +snippet asre\n\ + assert_response :${1:success}, @response.body${2}\n\ +snippet asrj\n\ + assert_rjs :${1:replace}, \"${2:dom id}\"\n\ +snippet ass assert_select(..)\n\ + assert_select '${1:path}', :${2:text} => '${3:inner_html' ${4:do}\n\ +snippet bf\n\ + before_filter :${1:method}\n\ +snippet bt\n\ + belongs_to :${1:association}\n\ +snippet crw\n\ + cattr_accessor :${1:attr_names}\n\ +snippet defcreate\n\ + def create\n\ + @${1:model_class_name} = ${2:ModelClassName}.new(params[:$1])\n\ +\n\ + respond_to do |wants|\n\ + if @$1.save\n\ + flash[:notice] = '$2 was successfully created.'\n\ + wants.html { redirect_to(@$1) }\n\ + wants.xml { render :xml => @$1, :status => :created, :location => @$1 }\n\ + else\n\ + wants.html { render :action => \"new\" }\n\ + wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity }\n\ + end\n\ + end\n\ + end${3}\n\ +snippet defdestroy\n\ + def destroy\n\ + @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])\n\ + @$1.destroy\n\ +\n\ + respond_to do |wants|\n\ + wants.html { redirect_to($1s_url) }\n\ + wants.xml { head :ok }\n\ + end\n\ + end${3}\n\ +snippet defedit\n\ + def edit\n\ + @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])\n\ + end\n\ +snippet defindex\n\ + def index\n\ + @${1:model_class_name} = ${2:ModelClassName}.all\n\ +\n\ + respond_to do |wants|\n\ + wants.html # index.html.erb\n\ + wants.xml { render :xml => @$1s }\n\ + end\n\ + end${3}\n\ +snippet defnew\n\ + def new\n\ + @${1:model_class_name} = ${2:ModelClassName}.new\n\ +\n\ + respond_to do |wants|\n\ + wants.html # new.html.erb\n\ + wants.xml { render :xml => @$1 }\n\ + end\n\ + end${3}\n\ +snippet defshow\n\ + def show\n\ + @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])\n\ +\n\ + respond_to do |wants|\n\ + wants.html # show.html.erb\n\ + wants.xml { render :xml => @$1 }\n\ + end\n\ + end${3}\n\ +snippet defupdate\n\ + def update\n\ + @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])\n\ +\n\ + respond_to do |wants|\n\ + if @$1.update_attributes(params[:$1])\n\ + flash[:notice] = '$2 was successfully updated.'\n\ + wants.html { redirect_to(@$1) }\n\ + wants.xml { head :ok }\n\ + else\n\ + wants.html { render :action => \"edit\" }\n\ + wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity }\n\ + end\n\ + end\n\ + end${3}\n\ +snippet flash\n\ + flash[:${1:notice}] = \"${2}\"\n\ +snippet habtm\n\ + has_and_belongs_to_many :${1:object}, :join_table => \"${2:table_name}\", :foreign_key => \"${3}_id\"${4}\n\ +snippet hm\n\ + has_many :${1:object}\n\ +snippet hmd\n\ + has_many :${1:other}s, :class_name => \"${2:$1}\", :foreign_key => \"${3:$1}_id\", :dependent => :destroy${4}\n\ +snippet hmt\n\ + has_many :${1:object}, :through => :${2:object}\n\ +snippet ho\n\ + has_one :${1:object}\n\ +snippet i18\n\ + I18n.t('${1:type.key}')${2}\n\ +snippet ist\n\ + <%= image_submit_tag(\"${1:agree.png}\", :id => \"${2:id}\"${3} %>\n\ +snippet log\n\ + Rails.logger.${1:debug} ${2}\n\ +snippet log2\n\ + RAILS_DEFAULT_LOGGER.${1:debug} ${2}\n\ +snippet logd\n\ + logger.debug { \"${1:message}\" }${2}\n\ +snippet loge\n\ + logger.error { \"${1:message}\" }${2}\n\ +snippet logf\n\ + logger.fatal { \"${1:message}\" }${2}\n\ +snippet logi\n\ + logger.info { \"${1:message}\" }${2}\n\ +snippet logw\n\ + logger.warn { \"${1:message}\" }${2}\n\ +snippet mapc\n\ + ${1:map}.${2:connect} '${3:controller/:action/:id}'\n\ +snippet mapca\n\ + ${1:map}.catch_all \"*${2:anything}\", :controller => \"${3:default}\", :action => \"${4:error}\"${5}\n\ +snippet mapr\n\ + ${1:map}.resource :${2:resource}\n\ +snippet maprs\n\ + ${1:map}.resources :${2:resource}\n\ +snippet mapwo\n\ + ${1:map}.with_options :${2:controller} => '${3:thing}' do |$3|\n\ + ${4}\n\ + end\n\ +snippet mbs\n\ + before_save :${1:method}\n\ +snippet mcht\n\ + change_table :${1:table_name} do |t|\n\ + ${2}\n\ + end\n\ +snippet mp\n\ + map(&:${1:id})\n\ +snippet mrw\n\ + mattr_accessor :${1:attr_names}\n\ +snippet oa\n\ + order(\"${1:field}\")\n\ +snippet od\n\ + order(\"${1:field} DESC\")\n\ +snippet pa\n\ + params[:${1:id}]${2}\n\ +snippet ra\n\ + render :action => \"${1:action}\"\n\ +snippet ral\n\ + render :action => \"${1:action}\", :layout => \"${2:layoutname}\"\n\ +snippet rest\n\ + respond_to do |wants|\n\ + wants.${1:html} { ${2} }\n\ + end\n\ +snippet rf\n\ + render :file => \"${1:filepath}\"\n\ +snippet rfu\n\ + render :file => \"${1:filepath}\", :use_full_path => ${2:false}\n\ +snippet ri\n\ + render :inline => \"${1:<%= 'hello' %>}\"\n\ +snippet ril\n\ + render :inline => \"${1:<%= 'hello' %>}\", :locals => { ${2::name} => \"${3:value}\"${4} }\n\ +snippet rit\n\ + render :inline => \"${1:<%= 'hello' %>}\", :type => ${2::rxml}\n\ +snippet rjson\n\ + render :json => ${1:text to render}\n\ +snippet rl\n\ + render :layout => \"${1:layoutname}\"\n\ +snippet rn\n\ + render :nothing => ${1:true}\n\ +snippet rns\n\ + render :nothing => ${1:true}, :status => ${2:401}\n\ +snippet rp\n\ + render :partial => \"${1:item}\"\n\ +snippet rpc\n\ + render :partial => \"${1:item}\", :collection => ${2:@$1s}\n\ +snippet rpl\n\ + render :partial => \"${1:item}\", :locals => { :${2:$1} => ${3:@$1}\n\ +snippet rpo\n\ + render :partial => \"${1:item}\", :object => ${2:@$1}\n\ +snippet rps\n\ + render :partial => \"${1:item}\", :status => ${2:500}\n\ +snippet rt\n\ + render :text => \"${1:text to render}\"\n\ +snippet rtl\n\ + render :text => \"${1:text to render}\", :layout => \"${2:layoutname}\"\n\ +snippet rtlt\n\ + render :text => \"${1:text to render}\", :layout => ${2:true}\n\ +snippet rts\n\ + render :text => \"${1:text to render}\", :status => ${2:401}\n\ +snippet ru\n\ + render :update do |${1:page}|\n\ + $1.${2}\n\ + end\n\ +snippet rxml\n\ + render :xml => ${1:text to render}\n\ +snippet sc\n\ + scope :${1:name}, :where(:@${2:field} => ${3:value})\n\ +snippet sl\n\ + scope :${1:name}, lambda do |${2:value}|\n\ + where(\"${3:field = ?}\", ${4:bind var})\n\ + end\n\ +snippet sha1\n\ + Digest::SHA1.hexdigest(${1:string})\n\ +snippet sweeper\n\ + class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper\n\ + observe $1\n\ +\n\ + def after_save(${2:model_class_name})\n\ + expire_cache($2)\n\ + end\n\ +\n\ + def after_destroy($2)\n\ + expire_cache($2)\n\ + end\n\ +\n\ + def expire_cache($2)\n\ + expire_page\n\ + end\n\ + end\n\ +snippet tcb\n\ + t.boolean :${1:title}\n\ + ${2}\n\ +snippet tcbi\n\ + t.binary :${1:title}, :limit => ${2:2}.megabytes\n\ + ${3}\n\ +snippet tcd\n\ + t.decimal :${1:title}, :precision => ${2:10}, :scale => ${3:2}\n\ + ${4}\n\ +snippet tcda\n\ + t.date :${1:title}\n\ + ${2}\n\ +snippet tcdt\n\ + t.datetime :${1:title}\n\ + ${2}\n\ +snippet tcf\n\ + t.float :${1:title}\n\ + ${2}\n\ +snippet tch\n\ + t.change :${1:name}, :${2:string}, :${3:limit} => ${4:80}\n\ + ${5}\n\ +snippet tci\n\ + t.integer :${1:title}\n\ + ${2}\n\ +snippet tcl\n\ + t.integer :lock_version, :null => false, :default => 0\n\ + ${1}\n\ +snippet tcr\n\ + t.references :${1:taggable}, :polymorphic => { :default => '${2:Photo}' }\n\ + ${3}\n\ +snippet tcs\n\ + t.string :${1:title}\n\ + ${2}\n\ +snippet tct\n\ + t.text :${1:title}\n\ + ${2}\n\ +snippet tcti\n\ + t.time :${1:title}\n\ + ${2}\n\ +snippet tcts\n\ + t.timestamp :${1:title}\n\ + ${2}\n\ +snippet tctss\n\ + t.timestamps\n\ + ${1}\n\ +snippet va\n\ + validates_associated :${1:attribute}\n\ +snippet vao\n\ + validates_acceptance_of :${1:terms}\n\ +snippet vc\n\ + validates_confirmation_of :${1:attribute}\n\ +snippet ve\n\ + validates_exclusion_of :${1:attribute}, :in => ${2:%w( mov avi )}\n\ +snippet vf\n\ + validates_format_of :${1:attribute}, :with => /${2:regex}/\n\ +snippet vi\n\ + validates_inclusion_of :${1:attribute}, :in => %w(${2: mov avi })\n\ +snippet vl\n\ + validates_length_of :${1:attribute}, :within => ${2:3}..${3:20}\n\ +snippet vn\n\ + validates_numericality_of :${1:attribute}\n\ +snippet vpo\n\ + validates_presence_of :${1:attribute}\n\ +snippet vu\n\ + validates_uniqueness_of :${1:attribute}\n\ +snippet wants\n\ + wants.${1:js|xml|html} { ${2} }\n\ +snippet wc\n\ + where(${1:\"conditions\"}${2:, bind_var})\n\ +snippet wh\n\ + where(${1:field} => ${2:value})\n\ +snippet xdelete\n\ + xhr :delete, :${1:destroy}, :id => ${2:1}${3}\n\ +snippet xget\n\ + xhr :get, :${1:show}, :id => ${2:1}${3}\n\ +snippet xpost\n\ + xhr :post, :${1:create}, :${2:object} => { ${3} }\n\ +snippet xput\n\ + xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { ${4} }${5}\n\ +snippet test\n\ + test \"should ${1:do something}\" do\n\ + ${2}\n\ + end\n\ +#migrations\n\ +snippet mac\n\ + add_column :${1:table_name}, :${2:column_name}, :${3:data_type}\n\ +snippet mrc\n\ + remove_column :${1:table_name}, :${2:column_name}\n\ +snippet mrnc\n\ + rename_column :${1:table_name}, :${2:old_column_name}, :${3:new_column_name}\n\ +snippet mcc\n\ + change_column :${1:table}, :${2:column}, :${3:type}\n\ +snippet mccc\n\ + t.column :${1:title}, :${2:string}\n\ +snippet mct\n\ + create_table :${1:table_name} do |t|\n\ + t.column :${2:name}, :${3:type}\n\ + end\n\ +snippet migration\n\ + class ${1:class_name} < ActiveRecord::Migration\n\ + def self.up\n\ + ${2}\n\ + end\n\ +\n\ + def self.down\n\ + end\n\ + end\n\ +\n\ +snippet trc\n\ + t.remove :${1:column}\n\ +snippet tre\n\ + t.rename :${1:old_column_name}, :${2:new_column_name}\n\ + ${3}\n\ +snippet tref\n\ + t.references :${1:model}\n\ +\n\ +#rspec\n\ +snippet it\n\ + it \"${1:spec_name}\" do\n\ + ${2}\n\ + end\n\ +snippet itp\n\ + it \"${1:spec_name}\"\n\ + ${2}\n\ +snippet desc\n\ + describe ${1:class_name} do\n\ + ${2}\n\ + end\n\ +snippet cont\n\ + context \"${1:message}\" do\n\ + ${2}\n\ + end\n\ +snippet bef\n\ + before :${1:each} do\n\ + ${2}\n\ + end\n\ +snippet aft\n\ + after :${1:each} do\n\ + ${2}\n\ + end\n\ +"; +exports.scope = "ruby"; + +}); diff --git a/htdocs/includes/ace/snippets/rust.js b/htdocs/includes/ace/snippets/rust.js new file mode 100644 index 00000000000..0411c63e152 --- /dev/null +++ b/htdocs/includes/ace/snippets/rust.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/rust",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "rust"; + +}); diff --git a/htdocs/includes/ace/snippets/sass.js b/htdocs/includes/ace/snippets/sass.js new file mode 100644 index 00000000000..b9adc9d8c36 --- /dev/null +++ b/htdocs/includes/ace/snippets/sass.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/sass",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "sass"; + +}); diff --git a/htdocs/includes/ace/snippets/scad.js b/htdocs/includes/ace/snippets/scad.js new file mode 100644 index 00000000000..998a98ac67d --- /dev/null +++ b/htdocs/includes/ace/snippets/scad.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/scad",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "scad"; + +}); diff --git a/htdocs/includes/ace/snippets/scala.js b/htdocs/includes/ace/snippets/scala.js new file mode 100644 index 00000000000..4051d988833 --- /dev/null +++ b/htdocs/includes/ace/snippets/scala.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/scala",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "scala"; + +}); diff --git a/htdocs/includes/ace/snippets/scheme.js b/htdocs/includes/ace/snippets/scheme.js new file mode 100644 index 00000000000..202d0741506 --- /dev/null +++ b/htdocs/includes/ace/snippets/scheme.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/scheme",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "scheme"; + +}); diff --git a/htdocs/includes/ace/snippets/scss.js b/htdocs/includes/ace/snippets/scss.js new file mode 100644 index 00000000000..fbd98f74cae --- /dev/null +++ b/htdocs/includes/ace/snippets/scss.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/scss",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "scss"; + +}); diff --git a/htdocs/includes/ace/snippets/sh.js b/htdocs/includes/ace/snippets/sh.js new file mode 100644 index 00000000000..0f1f6d8e124 --- /dev/null +++ b/htdocs/includes/ace/snippets/sh.js @@ -0,0 +1,90 @@ +ace.define("ace/snippets/sh",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Shebang. Executing bash via /usr/bin/env makes scripts more portable.\n\ +snippet #!\n\ + #!/usr/bin/env bash\n\ + \n\ +snippet if\n\ + if [[ ${1:condition} ]]; then\n\ + ${2:#statements}\n\ + fi\n\ +snippet elif\n\ + elif [[ ${1:condition} ]]; then\n\ + ${2:#statements}\n\ +snippet for\n\ + for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do\n\ + ${3:#statements}\n\ + done\n\ +snippet fori\n\ + for ${1:needle} in ${2:haystack} ; do\n\ + ${3:#statements}\n\ + done\n\ +snippet wh\n\ + while [[ ${1:condition} ]]; do\n\ + ${2:#statements}\n\ + done\n\ +snippet until\n\ + until [[ ${1:condition} ]]; do\n\ + ${2:#statements}\n\ + done\n\ +snippet case\n\ + case ${1:word} in\n\ + ${2:pattern})\n\ + ${3};;\n\ + esac\n\ +snippet go \n\ + while getopts '${1:o}' ${2:opts} \n\ + do \n\ + case $$2 in\n\ + ${3:o0})\n\ + ${4:#staments};;\n\ + esac\n\ + done\n\ +# Set SCRIPT_DIR variable to directory script is located.\n\ +snippet sdir\n\ + SCRIPT_DIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\ +# getopt\n\ +snippet getopt\n\ + __ScriptVersion=\"${1:version}\"\n\ +\n\ + #=== FUNCTION ================================================================\n\ + # NAME: usage\n\ + # DESCRIPTION: Display usage information.\n\ + #===============================================================================\n\ + function usage ()\n\ + {\n\ + cat <<- EOT\n\ +\n\ + Usage : $${0:0} [options] [--] \n\ +\n\ + Options: \n\ + -h|help Display this message\n\ + -v|version Display script version\n\ +\n\ + EOT\n\ + } # ---------- end of function usage ----------\n\ +\n\ + #-----------------------------------------------------------------------\n\ + # Handle command line arguments\n\ + #-----------------------------------------------------------------------\n\ +\n\ + while getopts \":hv\" opt\n\ + do\n\ + case $opt in\n\ +\n\ + h|help ) usage; exit 0 ;;\n\ +\n\ + v|version ) echo \"$${0:0} -- Version $__ScriptVersion\"; exit 0 ;;\n\ +\n\ + \\? ) echo -e \"\\n Option does not exist : $OPTARG\\n\"\n\ + usage; exit 1 ;;\n\ +\n\ + esac # --- end of case ---\n\ + done\n\ + shift $(($OPTIND-1))\n\ +\n\ +"; +exports.scope = "sh"; + +}); diff --git a/htdocs/includes/ace/snippets/sjs.js b/htdocs/includes/ace/snippets/sjs.js new file mode 100644 index 00000000000..cf39a34ecd6 --- /dev/null +++ b/htdocs/includes/ace/snippets/sjs.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/sjs",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "sjs"; + +}); diff --git a/htdocs/includes/ace/snippets/smarty.js b/htdocs/includes/ace/snippets/smarty.js new file mode 100644 index 00000000000..47319a25992 --- /dev/null +++ b/htdocs/includes/ace/snippets/smarty.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/smarty",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "smarty"; + +}); diff --git a/htdocs/includes/ace/snippets/snippets.js b/htdocs/includes/ace/snippets/snippets.js new file mode 100644 index 00000000000..b81605ccdfe --- /dev/null +++ b/htdocs/includes/ace/snippets/snippets.js @@ -0,0 +1,16 @@ +ace.define("ace/snippets/snippets",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# snippets for making snippets :)\n\ +snippet snip\n\ + snippet ${1:trigger}\n\ + ${2}\n\ +snippet msnip\n\ + snippet ${1:trigger} ${2:description}\n\ + ${3}\n\ +snippet v\n\ + {VISUAL}\n\ +"; +exports.scope = "snippets"; + +}); diff --git a/htdocs/includes/ace/snippets/soy_template.js b/htdocs/includes/ace/snippets/soy_template.js new file mode 100644 index 00000000000..908f5fdf65e --- /dev/null +++ b/htdocs/includes/ace/snippets/soy_template.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/soy_template",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "soy_template"; + +}); diff --git a/htdocs/includes/ace/snippets/space.js b/htdocs/includes/ace/snippets/space.js new file mode 100644 index 00000000000..302b84e00be --- /dev/null +++ b/htdocs/includes/ace/snippets/space.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/space",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "space"; + +}); diff --git a/htdocs/includes/ace/snippets/sparql.js b/htdocs/includes/ace/snippets/sparql.js new file mode 100644 index 00000000000..2c87bbfe950 --- /dev/null +++ b/htdocs/includes/ace/snippets/sparql.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/sparql",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/sql.js b/htdocs/includes/ace/snippets/sql.js new file mode 100644 index 00000000000..1822126ba78 --- /dev/null +++ b/htdocs/includes/ace/snippets/sql.js @@ -0,0 +1,33 @@ +ace.define("ace/snippets/sql",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet tbl\n\ + create table ${1:table} (\n\ + ${2:columns}\n\ + );\n\ +snippet col\n\ + ${1:name} ${2:type} ${3:default ''} ${4:not null}\n\ +snippet ccol\n\ + ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null}\n\ +snippet ncol\n\ + ${1:name} number ${3:default 0} ${4:not null}\n\ +snippet dcol\n\ + ${1:name} date ${3:default sysdate} ${4:not null}\n\ +snippet ind\n\ + create index ${3:$1_$2} on ${1:table}(${2:column});\n\ +snippet uind\n\ + create unique index ${1:name} on ${2:table}(${3:column});\n\ +snippet tblcom\n\ + comment on table ${1:table} is '${2:comment}';\n\ +snippet colcom\n\ + comment on column ${1:table}.${2:column} is '${3:comment}';\n\ +snippet addcol\n\ + alter table ${1:table} add (${2:column} ${3:type});\n\ +snippet seq\n\ + create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1};\n\ +snippet s*\n\ + select * from ${1:table}\n\ +"; +exports.scope = "sql"; + +}); diff --git a/htdocs/includes/ace/snippets/sqlserver.js b/htdocs/includes/ace/snippets/sqlserver.js new file mode 100644 index 00000000000..7dfa2d0493b --- /dev/null +++ b/htdocs/includes/ace/snippets/sqlserver.js @@ -0,0 +1,76 @@ +ace.define("ace/snippets/sqlserver",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# ISNULL\n\ +snippet isnull\n\ + ISNULL(${1:check_expression}, ${2:replacement_value})\n\ +# FORMAT\n\ +snippet format\n\ + FORMAT(${1:value}, ${2:format})\n\ +# CAST\n\ +snippet cast\n\ + CAST(${1:expression} AS ${2:data_type})\n\ +# CONVERT\n\ +snippet convert\n\ + CONVERT(${1:data_type}, ${2:expression})\n\ +# DATEPART\n\ +snippet datepart\n\ + DATEPART(${1:datepart}, ${2:date})\n\ +# DATEDIFF\n\ +snippet datediff\n\ + DATEDIFF(${1:datepart}, ${2:startdate}, ${3:enddate})\n\ +# DATEADD\n\ +snippet dateadd\n\ + DATEADD(${1:datepart}, ${2:number}, ${3:date})\n\ +# DATEFROMPARTS \n\ +snippet datefromparts\n\ + DATEFROMPARTS(${1:year}, ${2:month}, ${3:day})\n\ +# OBJECT_DEFINITION\n\ +snippet objectdef\n\ + SELECT OBJECT_DEFINITION(OBJECT_ID('${1:sys.server_permissions /*object name*/}'))\n\ +# STUFF XML\n\ +snippet stuffxml\n\ + STUFF((SELECT ', ' + ${1:ColumnName}\n\ + FROM ${2:TableName}\n\ + WHERE ${3:WhereClause}\n\ + FOR XML PATH('')), 1, 1, '') AS ${4:Alias}\n\ + ${5:/*https://msdn.microsoft.com/en-us/library/ms188043.aspx*/}\n\ +# Create Procedure\n\ +snippet createproc\n\ + -- =============================================\n\ + -- Author: ${1:Author}\n\ + -- Create date: ${2:Date}\n\ + -- Description: ${3:Description}\n\ + -- =============================================\n\ + CREATE PROCEDURE ${4:Procedure_Name}\n\ + ${5:/*Add the parameters for the stored procedure here*/}\n\ + AS\n\ + BEGIN\n\ + -- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.\n\ + SET NOCOUNT ON;\n\ + \n\ + ${6:/*Add the T-SQL statements to compute the return value here*/}\n\ + \n\ + END\n\ + GO\n\ +# Create Scalar Function\n\ +snippet createfn\n\ + -- =============================================\n\ + -- Author: ${1:Author}\n\ + -- Create date: ${2:Date}\n\ + -- Description: ${3:Description}\n\ + -- =============================================\n\ + CREATE FUNCTION ${4:Scalar_Function_Name}\n\ + -- Add the parameters for the function here\n\ + RETURNS ${5:Function_Data_Type}\n\ + AS\n\ + BEGIN\n\ + DECLARE @Result ${5:Function_Data_Type}\n\ + \n\ + ${6:/*Add the T-SQL statements to compute the return value here*/}\n\ + \n\ + END\n\ + GO"; +exports.scope = "sqlserver"; + +}); diff --git a/htdocs/includes/ace/snippets/stylus.js b/htdocs/includes/ace/snippets/stylus.js new file mode 100644 index 00000000000..5f700bae337 --- /dev/null +++ b/htdocs/includes/ace/snippets/stylus.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/stylus",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "stylus"; + +}); diff --git a/htdocs/includes/ace/snippets/svg.js b/htdocs/includes/ace/snippets/svg.js new file mode 100644 index 00000000000..69a3408ec96 --- /dev/null +++ b/htdocs/includes/ace/snippets/svg.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/svg",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "svg"; + +}); diff --git a/htdocs/includes/ace/snippets/swift.js b/htdocs/includes/ace/snippets/swift.js new file mode 100644 index 00000000000..55226ba0cc7 --- /dev/null +++ b/htdocs/includes/ace/snippets/swift.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/swift",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "swift"; + +}); diff --git a/htdocs/includes/ace/snippets/swig.js b/htdocs/includes/ace/snippets/swig.js new file mode 100644 index 00000000000..1eee033478a --- /dev/null +++ b/htdocs/includes/ace/snippets/swig.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/swig",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "swig"; + +}); diff --git a/htdocs/includes/ace/snippets/tcl.js b/htdocs/includes/ace/snippets/tcl.js new file mode 100644 index 00000000000..4d116da8296 --- /dev/null +++ b/htdocs/includes/ace/snippets/tcl.js @@ -0,0 +1,99 @@ +ace.define("ace/snippets/tcl",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# #!/usr/bin/env tclsh\n\ +snippet #!\n\ + #!/usr/bin/env tclsh\n\ + \n\ +# Process\n\ +snippet pro\n\ + proc ${1:function_name} {${2:args}} {\n\ + ${3:#body ...}\n\ + }\n\ +#xif\n\ +snippet xif\n\ + ${1:expr}? ${2:true} : ${3:false}\n\ +# Conditional\n\ +snippet if\n\ + if {${1}} {\n\ + ${2:# body...}\n\ + }\n\ +# Conditional if..else\n\ +snippet ife\n\ + if {${1}} {\n\ + ${2:# body...}\n\ + } else {\n\ + ${3:# else...}\n\ + }\n\ +# Conditional if..elsif..else\n\ +snippet ifee\n\ + if {${1}} {\n\ + ${2:# body...}\n\ + } elseif {${3}} {\n\ + ${4:# elsif...}\n\ + } else {\n\ + ${5:# else...}\n\ + }\n\ +# If catch then\n\ +snippet ifc\n\ + if { [catch {${1:#do something...}} ${2:err}] } {\n\ + ${3:# handle failure...}\n\ + }\n\ +# Catch\n\ +snippet catch\n\ + catch {${1}} ${2:err} ${3:options}\n\ +# While Loop\n\ +snippet wh\n\ + while {${1}} {\n\ + ${2:# body...}\n\ + }\n\ +# For Loop\n\ +snippet for\n\ + for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} {\n\ + ${4:# body...}\n\ + }\n\ +# Foreach Loop\n\ +snippet fore\n\ + foreach ${1:x} {${2:#list}} {\n\ + ${3:# body...}\n\ + }\n\ +# after ms script...\n\ +snippet af\n\ + after ${1:ms} ${2:#do something}\n\ +# after cancel id\n\ +snippet afc\n\ + after cancel ${1:id or script}\n\ +# after idle\n\ +snippet afi\n\ + after idle ${1:script}\n\ +# after info id\n\ +snippet afin\n\ + after info ${1:id}\n\ +# Expr\n\ +snippet exp\n\ + expr {${1:#expression here}}\n\ +# Switch\n\ +snippet sw\n\ + switch ${1:var} {\n\ + ${3:pattern 1} {\n\ + ${4:#do something}\n\ + }\n\ + default {\n\ + ${2:#do something}\n\ + }\n\ + }\n\ +# Case\n\ +snippet ca\n\ + ${1:pattern} {\n\ + ${2:#do something}\n\ + }${3}\n\ +# Namespace eval\n\ +snippet ns\n\ + namespace eval ${1:path} {${2:#script...}}\n\ +# Namespace current\n\ +snippet nsc\n\ + namespace current\n\ +"; +exports.scope = "tcl"; + +}); diff --git a/htdocs/includes/ace/snippets/tex.js b/htdocs/includes/ace/snippets/tex.js new file mode 100644 index 00000000000..2bd3f1034c9 --- /dev/null +++ b/htdocs/includes/ace/snippets/tex.js @@ -0,0 +1,197 @@ +ace.define("ace/snippets/tex",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "#PREAMBLE\n\ +#newcommand\n\ +snippet nc\n\ + \\newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}}${4}\n\ +#usepackage\n\ +snippet up\n\ + \\usepackage[${1:[options}]{${2:package}}\n\ +#newunicodechar\n\ +snippet nuc\n\ + \\newunicodechar{${1}}{${2:\\ensuremath}${3:tex-substitute}}}\n\ +#DeclareMathOperator\n\ +snippet dmo\n\ + \\DeclareMathOperator{${1}}{${2}}\n\ +\n\ +#DOCUMENT\n\ +# \\begin{}...\\end{}\n\ +snippet begin\n\ + \\begin{${1:env}}\n\ + ${2}\n\ + \\end{$1}\n\ +# Tabular\n\ +snippet tab\n\ + \\begin{${1:tabular}}{${2:c}}\n\ + ${3}\n\ + \\end{$1}\n\ +snippet thm\n\ + \\begin[${1:author}]{${2:thm}}\n\ + ${3}\n\ + \\end{$1}\n\ +snippet center\n\ + \\begin{center}\n\ + ${1}\n\ + \\end{center}\n\ +# Align(ed)\n\ +snippet ali\n\ + \\begin{align${1:ed}}\n\ + ${2}\n\ + \\end{align$1}\n\ +# Gather(ed)\n\ +snippet gat\n\ + \\begin{gather${1:ed}}\n\ + ${2}\n\ + \\end{gather$1}\n\ +# Equation\n\ +snippet eq\n\ + \\begin{equation}\n\ + ${1}\n\ + \\end{equation}\n\ +# Equation\n\ +snippet eq*\n\ + \\begin{equation*}\n\ + ${1}\n\ + \\end{equation*}\n\ +# Unnumbered Equation\n\ +snippet \\\n\ + \\[\n\ + ${1}\n\ + \\]\n\ +# Enumerate\n\ +snippet enum\n\ + \\begin{enumerate}\n\ + \\item ${1}\n\ + \\end{enumerate}\n\ +# Itemize\n\ +snippet itemize\n\ + \\begin{itemize}\n\ + \\item ${1}\n\ + \\end{itemize}\n\ +# Description\n\ +snippet desc\n\ + \\begin{description}\n\ + \\item[${1}] ${2}\n\ + \\end{description}\n\ +# Matrix\n\ +snippet mat\n\ + \\begin{${1:p/b/v/V/B/small}matrix}\n\ + ${2}\n\ + \\end{$1matrix}\n\ +# Cases\n\ +snippet cas\n\ + \\begin{cases}\n\ + ${1:equation}, &\\text{ if }${2:case}\\\\\n\ + ${3}\n\ + \\end{cases}\n\ +# Split\n\ +snippet spl\n\ + \\begin{split}\n\ + ${1}\n\ + \\end{split}\n\ +# Part\n\ +snippet part\n\ + \\part{${1:part name}} % (fold)\n\ + \\label{prt:${2:$1}}\n\ + ${3}\n\ + % part $2 (end)\n\ +# Chapter\n\ +snippet cha\n\ + \\chapter{${1:chapter name}}\n\ + \\label{cha:${2:$1}}\n\ + ${3}\n\ +# Section\n\ +snippet sec\n\ + \\section{${1:section name}}\n\ + \\label{sec:${2:$1}}\n\ + ${3}\n\ +# Sub Section\n\ +snippet sub\n\ + \\subsection{${1:subsection name}}\n\ + \\label{sub:${2:$1}}\n\ + ${3}\n\ +# Sub Sub Section\n\ +snippet subs\n\ + \\subsubsection{${1:subsubsection name}}\n\ + \\label{ssub:${2:$1}}\n\ + ${3}\n\ +# Paragraph\n\ +snippet par\n\ + \\paragraph{${1:paragraph name}}\n\ + \\label{par:${2:$1}}\n\ + ${3}\n\ +# Sub Paragraph\n\ +snippet subp\n\ + \\subparagraph{${1:subparagraph name}}\n\ + \\label{subp:${2:$1}}\n\ + ${3}\n\ +#References\n\ +snippet itd\n\ + \\item[${1:description}] ${2:item}\n\ +snippet figure\n\ + ${1:Figure}~\\ref{${2:fig:}}${3}\n\ +snippet table\n\ + ${1:Table}~\\ref{${2:tab:}}${3}\n\ +snippet listing\n\ + ${1:Listing}~\\ref{${2:list}}${3}\n\ +snippet section\n\ + ${1:Section}~\\ref{${2:sec:}}${3}\n\ +snippet page\n\ + ${1:page}~\\pageref{${2}}${3}\n\ +snippet index\n\ + \\index{${1:index}}${2}\n\ +#Citations\n\ +snippet cite\n\ + \\cite[${1}]{${2}}${3}\n\ +snippet fcite\n\ + \\footcite[${1}]{${2}}${3}\n\ +#Formating text: italic, bold, underline, small capital, emphase ..\n\ +snippet it\n\ + \\textit{${1:text}}\n\ +snippet bf\n\ + \\textbf{${1:text}}\n\ +snippet under\n\ + \\underline{${1:text}}\n\ +snippet emp\n\ + \\emph{${1:text}}\n\ +snippet sc\n\ + \\textsc{${1:text}}\n\ +#Choosing font\n\ +snippet sf\n\ + \\textsf{${1:text}}\n\ +snippet rm\n\ + \\textrm{${1:text}}\n\ +snippet tt\n\ + \\texttt{${1:text}}\n\ +#misc\n\ +snippet ft\n\ + \\footnote{${1:text}}\n\ +snippet fig\n\ + \\begin{figure}\n\ + \\begin{center}\n\ + \\includegraphics[scale=${1}]{Figures/${2}}\n\ + \\end{center}\n\ + \\caption{${3}}\n\ + \\label{fig:${4}}\n\ + \\end{figure}\n\ +snippet tikz\n\ + \\begin{figure}\n\ + \\begin{center}\n\ + \\begin{tikzpicture}[scale=${1:1}]\n\ + ${2}\n\ + \\end{tikzpicture}\n\ + \\end{center}\n\ + \\caption{${3}}\n\ + \\label{fig:${4}}\n\ + \\end{figure}\n\ +#math\n\ +snippet stackrel\n\ + \\stackrel{${1:above}}{${2:below}} ${3}\n\ +snippet frac\n\ + \\frac{${1:num}}{${2:denom}}\n\ +snippet sum\n\ + \\sum^{${1:n}}_{${2:i=1}}{${3}}"; +exports.scope = "tex"; + +}); diff --git a/htdocs/includes/ace/snippets/text.js b/htdocs/includes/ace/snippets/text.js new file mode 100644 index 00000000000..57b897bf67d --- /dev/null +++ b/htdocs/includes/ace/snippets/text.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/text",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "text"; + +}); diff --git a/htdocs/includes/ace/snippets/textile.js b/htdocs/includes/ace/snippets/textile.js new file mode 100644 index 00000000000..a6fd711efa5 --- /dev/null +++ b/htdocs/includes/ace/snippets/textile.js @@ -0,0 +1,37 @@ +ace.define("ace/snippets/textile",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# Jekyll post header\n\ +snippet header\n\ + ---\n\ + title: ${1:title}\n\ + layout: post\n\ + date: ${2:date} ${3:hour:minute:second} -05:00\n\ + ---\n\ +\n\ +# Image\n\ +snippet img\n\ + !${1:url}(${2:title}):${3:link}!\n\ +\n\ +# Table\n\ +snippet |\n\ + |${1}|${2}\n\ +\n\ +# Link\n\ +snippet link\n\ + \"${1:link text}\":${2:url}\n\ +\n\ +# Acronym\n\ +snippet (\n\ + (${1:Expand acronym})${2}\n\ +\n\ +# Footnote\n\ +snippet fn\n\ + [${1:ref number}] ${3}\n\ +\n\ + fn$1. ${2:footnote}\n\ + \n\ +"; +exports.scope = "textile"; + +}); diff --git a/htdocs/includes/ace/snippets/toml.js b/htdocs/includes/ace/snippets/toml.js new file mode 100644 index 00000000000..0c1a857bb1a --- /dev/null +++ b/htdocs/includes/ace/snippets/toml.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/toml",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "toml"; + +}); diff --git a/htdocs/includes/ace/snippets/tsx.js b/htdocs/includes/ace/snippets/tsx.js new file mode 100644 index 00000000000..7946297ead3 --- /dev/null +++ b/htdocs/includes/ace/snippets/tsx.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/tsx",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "tsx"; + +}); diff --git a/htdocs/includes/ace/snippets/turtle.js b/htdocs/includes/ace/snippets/turtle.js new file mode 100644 index 00000000000..5e104b22f22 --- /dev/null +++ b/htdocs/includes/ace/snippets/turtle.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/turtle",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/twig.js b/htdocs/includes/ace/snippets/twig.js new file mode 100644 index 00000000000..ccc6073cfda --- /dev/null +++ b/htdocs/includes/ace/snippets/twig.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/twig",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "twig"; + +}); diff --git a/htdocs/includes/ace/snippets/typescript.js b/htdocs/includes/ace/snippets/typescript.js new file mode 100644 index 00000000000..5f6217d01b1 --- /dev/null +++ b/htdocs/includes/ace/snippets/typescript.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/typescript",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "typescript"; + +}); diff --git a/htdocs/includes/ace/snippets/vala.js b/htdocs/includes/ace/snippets/vala.js new file mode 100644 index 00000000000..3b493422e7d --- /dev/null +++ b/htdocs/includes/ace/snippets/vala.js @@ -0,0 +1,193 @@ +ace.define("ace/snippets/vala",["require","exports","module"], function(require, exports, module) { +"use strict"; +exports.snippets = [ + { + "content": "case ${1:condition}:\n\t$0\n\tbreak;\n", + "name": "case", + "scope": "vala", + "tabTrigger": "case" + }, + { + "content": "/**\n * ${6}\n */\n${1:public} class ${2:MethodName}${3: : GLib.Object} {\n\n\t/**\n\t * ${7}\n\t */\n\tpublic ${2}(${4}) {\n\t\t${5}\n\t}\n\n\t$0\n}", + "name": "class", + "scope": "vala", + "tabTrigger": "class" + }, + { + "content": "(${1}) => {\n\t${0}\n}\n", + "name": "closure", + "scope": "vala", + "tabTrigger": "=>" + }, + { + "content": "/*\n * $0\n */", + "name": "Comment (multiline)", + "scope": "vala", + "tabTrigger": "/*" + }, + { + "content": "Console.WriteLine($1);\n$0", + "name": "Console.WriteLine (writeline)", + "scope": "vala", + "tabTrigger": "writeline" + }, + { + "content": "[DBus(name = \"$0\")]", + "name": "DBus annotation", + "scope": "vala", + "tabTrigger": "[DBus" + }, + { + "content": "delegate ${1:void} ${2:DelegateName}($0);", + "name": "delegate", + "scope": "vala", + "tabTrigger": "delegate" + }, + { + "content": "do {\n\t$0\n} while ($1);\n", + "name": "do while", + "scope": "vala", + "tabTrigger": "dowhile" + }, + { + "content": "/**\n * $0\n */", + "name": "DocBlock", + "scope": "vala", + "tabTrigger": "/**" + }, + { + "content": "else if ($1) {\n\t$0\n}\n", + "name": "else if (elseif)", + "scope": "vala", + "tabTrigger": "elseif" + }, + { + "content": "else {\n\t$0\n}", + "name": "else", + "scope": "vala", + "tabTrigger": "else" + }, + { + "content": "enum {$1:EnumName} {\n\t$0\n}", + "name": "enum", + "scope": "vala", + "tabTrigger": "enum" + }, + { + "content": "public errordomain ${1:Error} {\n\t$0\n}", + "name": "error domain", + "scope": "vala", + "tabTrigger": "errordomain" + }, + { + "content": "for ($1;$2;$3) {\n\t$0\n}", + "name": "for", + "scope": "vala", + "tabTrigger": "for" + }, + { + "content": "foreach ($1 in $2) {\n\t$0\n}", + "name": "foreach", + "scope": "vala", + "tabTrigger": "foreach" + }, + { + "content": "Gee.ArrayList<${1:G}>($0);", + "name": "Gee.ArrayList", + "scope": "vala", + "tabTrigger": "ArrayList" + }, + { + "content": "Gee.HashMap<${1:K},${2:V}>($0);", + "name": "Gee.HashMap", + "scope": "vala", + "tabTrigger": "HashMap" + }, + { + "content": "Gee.HashSet<${1:G}>($0);", + "name": "Gee.HashSet", + "scope": "vala", + "tabTrigger": "HashSet" + }, + { + "content": "if ($1) {\n\t$0\n}", + "name": "if", + "scope": "vala", + "tabTrigger": "if" + }, + { + "content": "interface ${1:InterfaceName}{$2: : SuperInterface} {\n\t$0\n}", + "name": "interface", + "scope": "vala", + "tabTrigger": "interface" + }, + { + "content": "public static int main(string [] argv) {\n\t${0}\n\treturn 0;\n}", + "name": "Main function", + "scope": "vala", + "tabTrigger": "main" + }, + { + "content": "namespace $1 {\n\t$0\n}\n", + "name": "namespace (ns)", + "scope": "vala", + "tabTrigger": "ns" + }, + { + "content": "stdout.printf($0);", + "name": "printf", + "scope": "vala", + "tabTrigger": "printf" + }, + { + "content": "${1:public} ${2:Type} ${3:Name} {\n\tset {\n\t\t$0\n\t}\n\tget {\n\n\t}\n}", + "name": "property (prop)", + "scope": "vala", + "tabTrigger": "prop" + }, + { + "content": "${1:public} ${2:Type} ${3:Name} {\n\tget {\n\t\t$0\n\t}\n}", + "name": "read-only property (roprop)", + "scope": "vala", + "tabTrigger": "roprop" + }, + { + "content": "@\"${1:\\$var}\"", + "name": "String template (@)", + "scope": "vala", + "tabTrigger": "@" + }, + { + "content": "struct ${1:StructName} {\n\t$0\n}", + "name": "struct", + "scope": "vala", + "tabTrigger": "struct" + }, + { + "content": "switch ($1) {\n\t$0\n}", + "name": "switch", + "scope": "vala", + "tabTrigger": "switch" + }, + { + "content": "try {\n\t$2\n} catch (${1:Error} e) {\n\t$0\n}", + "name": "try/catch", + "scope": "vala", + "tabTrigger": "try" + }, + { + "content": "\"\"\"$0\"\"\";", + "name": "Verbatim string (\"\"\")", + "scope": "vala", + "tabTrigger": "verbatim" + }, + { + "content": "while ($1) {\n\t$0\n}", + "name": "while", + "scope": "vala", + "tabTrigger": "while" + } +]; +exports.scope = ""; + +}); diff --git a/htdocs/includes/ace/snippets/vbscript.js b/htdocs/includes/ace/snippets/vbscript.js new file mode 100644 index 00000000000..38ca68fb2c4 --- /dev/null +++ b/htdocs/includes/ace/snippets/vbscript.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/vbscript",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "vbscript"; + +}); diff --git a/htdocs/includes/ace/snippets/velocity.js b/htdocs/includes/ace/snippets/velocity.js new file mode 100644 index 00000000000..e2b12a45e36 --- /dev/null +++ b/htdocs/includes/ace/snippets/velocity.js @@ -0,0 +1,36 @@ +ace.define("ace/snippets/velocity",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "# macro\n\ +snippet #macro\n\ + #macro ( ${1:macroName} ${2:\\$var1, [\\$var2, ...]} )\n\ + ${3:## macro code}\n\ + #end\n\ +# foreach\n\ +snippet #foreach\n\ + #foreach ( ${1:\\$item} in ${2:\\$collection} )\n\ + ${3:## foreach code}\n\ + #end\n\ +# if\n\ +snippet #if\n\ + #if ( ${1:true} )\n\ + ${0}\n\ + #end\n\ +# if ... else\n\ +snippet #ife\n\ + #if ( ${1:true} )\n\ + ${2}\n\ + #else\n\ + ${0}\n\ + #end\n\ +#import\n\ +snippet #import\n\ + #import ( \"${1:path/to/velocity/format}\" )\n\ +# set\n\ +snippet #set\n\ + #set ( $${1:var} = ${0} )\n\ +"; +exports.scope = "velocity"; +exports.includeScopes = ["html", "javascript", "css"]; + +}); diff --git a/htdocs/includes/ace/snippets/verilog.js b/htdocs/includes/ace/snippets/verilog.js new file mode 100644 index 00000000000..8103ff6f262 --- /dev/null +++ b/htdocs/includes/ace/snippets/verilog.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/verilog",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "verilog"; + +}); diff --git a/htdocs/includes/ace/snippets/vhdl.js b/htdocs/includes/ace/snippets/vhdl.js new file mode 100644 index 00000000000..10d8ca09ce8 --- /dev/null +++ b/htdocs/includes/ace/snippets/vhdl.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/vhdl",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "vhdl"; + +}); diff --git a/htdocs/includes/ace/snippets/wollok.js b/htdocs/includes/ace/snippets/wollok.js new file mode 100644 index 00000000000..31e62118d29 --- /dev/null +++ b/htdocs/includes/ace/snippets/wollok.js @@ -0,0 +1,91 @@ +ace.define("ace/snippets/wollok",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "##\n\ +## Basic Java packages and import\n\ +snippet im\n\ + import\n\ +snippet w.l\n\ + wollok.lang\n\ +snippet w.i\n\ + wollok.lib\n\ +\n\ +## Class and object\n\ +snippet cl\n\ + class ${1:`Filename(\"\", \"untitled\")`} ${2}\n\ +snippet obj\n\ + object ${1:`Filename(\"\", \"untitled\")`} ${2:inherits Parent}${3}\n\ +snippet te\n\ + test ${1:`Filename(\"\", \"untitled\")`}\n\ +\n\ +##\n\ +## Enhancements\n\ +snippet inh\n\ + inherits\n\ +\n\ +##\n\ +## Comments\n\ +snippet /*\n\ + /*\n\ + * ${1}\n\ + */\n\ +\n\ +##\n\ +## Control Statements\n\ +snippet el\n\ + else\n\ +snippet if\n\ + if (${1}) ${2}\n\ +\n\ +##\n\ +## Create a Method\n\ +snippet m\n\ + method ${1:method}(${2}) ${5}\n\ +\n\ +## \n\ +## Tests\n\ +snippet as\n\ + assert.equals(${1:expected}, ${2:actual})\n\ +\n\ +##\n\ +## Exceptions\n\ +snippet ca\n\ + catch ${1:e} : (${2:Exception} ) ${3}\n\ +snippet thr\n\ + throw\n\ +snippet try\n\ + try {\n\ + ${3}\n\ + } catch ${1:e} : ${2:Exception} {\n\ + }\n\ +\n\ +##\n\ +## Javadocs\n\ +snippet /**\n\ + /**\n\ + * ${1}\n\ + */\n\ +\n\ +##\n\ +## Print Methods\n\ +snippet print\n\ + console.println(\"${1:Message}\")\n\ +\n\ +##\n\ +## Setter and Getter Methods\n\ +snippet set\n\ + method set${1:}(${2:}) {\n\ + $1 = $2\n\ + }\n\ +snippet get\n\ + method get${1:}() {\n\ + return ${1:};\n\ + }\n\ +\n\ +##\n\ +## Terminate Methods or Loops\n\ +snippet re\n\ + return"; +exports.scope = "wollok"; + +}); diff --git a/htdocs/includes/ace/snippets/xml.js b/htdocs/includes/ace/snippets/xml.js new file mode 100644 index 00000000000..ee4b688a7c3 --- /dev/null +++ b/htdocs/includes/ace/snippets/xml.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/xml",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "xml"; + +}); diff --git a/htdocs/includes/ace/snippets/xquery.js b/htdocs/includes/ace/snippets/xquery.js new file mode 100644 index 00000000000..c880abcf17c --- /dev/null +++ b/htdocs/includes/ace/snippets/xquery.js @@ -0,0 +1,68 @@ +ace.define("ace/snippets/xquery",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText = "snippet for\n\ + for $${1:item} in ${2:expr}\n\ +snippet return\n\ + return ${1:expr}\n\ +snippet import\n\ + import module namespace ${1:ns} = \"${2:http://www.example.com/}\";\n\ +snippet some\n\ + some $${1:varname} in ${2:expr} satisfies ${3:expr}\n\ +snippet every\n\ + every $${1:varname} in ${2:expr} satisfies ${3:expr}\n\ +snippet if\n\ + if(${1:true}) then ${2:expr} else ${3:true}\n\ +snippet switch\n\ + switch(${1:\"foo\"})\n\ + case ${2:\"foo\"}\n\ + return ${3:true}\n\ + default return ${4:false}\n\ +snippet try\n\ + try { ${1:expr} } catch ${2:*} { ${3:expr} }\n\ +snippet tumbling\n\ + for tumbling window $${1:varname} in ${2:expr}\n\ + start at $${3:start} when ${4:expr}\n\ + end at $${5:end} when ${6:expr}\n\ + return ${7:expr}\n\ +snippet sliding\n\ + for sliding window $${1:varname} in ${2:expr}\n\ + start at $${3:start} when ${4:expr}\n\ + end at $${5:end} when ${6:expr}\n\ + return ${7:expr}\n\ +snippet let\n\ + let $${1:varname} := ${2:expr}\n\ +snippet group\n\ + group by $${1:varname} := ${2:expr}\n\ +snippet order\n\ + order by ${1:expr} ${2:descending}\n\ +snippet stable\n\ + stable order by ${1:expr}\n\ +snippet count\n\ + count $${1:varname}\n\ +snippet ordered\n\ + ordered { ${1:expr} }\n\ +snippet unordered\n\ + unordered { ${1:expr} }\n\ +snippet treat \n\ + treat as ${1:expr}\n\ +snippet castable\n\ + castable as ${1:atomicType}\n\ +snippet cast\n\ + cast as ${1:atomicType}\n\ +snippet typeswitch\n\ + typeswitch(${1:expr})\n\ + case ${2:type} return ${3:expr}\n\ + default return ${4:expr}\n\ +snippet var\n\ + declare variable $${1:varname} := ${2:expr};\n\ +snippet fn\n\ + declare function ${1:ns}:${2:name}(){\n\ + ${3:expr}\n\ + };\n\ +snippet module\n\ + module namespace ${1:ns} = \"${2:http://www.example.com}\";\n\ +"; +exports.scope = "xquery"; + +}); diff --git a/htdocs/includes/ace/snippets/yaml.js b/htdocs/includes/ace/snippets/yaml.js new file mode 100644 index 00000000000..1adceabee15 --- /dev/null +++ b/htdocs/includes/ace/snippets/yaml.js @@ -0,0 +1,7 @@ +ace.define("ace/snippets/yaml",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.snippetText =undefined; +exports.scope = "yaml"; + +}); diff --git a/htdocs/includes/ace/theme-ambiance.js b/htdocs/includes/ace/theme-ambiance.js new file mode 100644 index 00000000000..1e53ecd9695 --- /dev/null +++ b/htdocs/includes/ace/theme-ambiance.js @@ -0,0 +1,182 @@ +ace.define("ace/theme/ambiance",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-ambiance"; +exports.cssText = ".ace-ambiance .ace_gutter {\ +background-color: #3d3d3d;\ +background-image: -moz-linear-gradient(left, #3D3D3D, #333);\ +background-image: -ms-linear-gradient(left, #3D3D3D, #333);\ +background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#3D3D3D), to(#333));\ +background-image: -webkit-linear-gradient(left, #3D3D3D, #333);\ +background-image: -o-linear-gradient(left, #3D3D3D, #333);\ +background-image: linear-gradient(left, #3D3D3D, #333);\ +background-repeat: repeat-x;\ +border-right: 1px solid #4d4d4d;\ +text-shadow: 0px 1px 1px #4d4d4d;\ +color: #222;\ +}\ +.ace-ambiance .ace_gutter-layer {\ +background: repeat left top;\ +}\ +.ace-ambiance .ace_gutter-active-line {\ +background-color: #3F3F3F;\ +}\ +.ace-ambiance .ace_fold-widget {\ +text-align: center;\ +}\ +.ace-ambiance .ace_fold-widget:hover {\ +color: #777;\ +}\ +.ace-ambiance .ace_fold-widget.ace_start,\ +.ace-ambiance .ace_fold-widget.ace_end,\ +.ace-ambiance .ace_fold-widget.ace_closed{\ +background: none;\ +border: none;\ +box-shadow: none;\ +}\ +.ace-ambiance .ace_fold-widget.ace_start:after {\ +content: '▾'\ +}\ +.ace-ambiance .ace_fold-widget.ace_end:after {\ +content: '▴'\ +}\ +.ace-ambiance .ace_fold-widget.ace_closed:after {\ +content: '‣'\ +}\ +.ace-ambiance .ace_print-margin {\ +border-left: 1px dotted #2D2D2D;\ +right: 0;\ +background: #262626;\ +}\ +.ace-ambiance .ace_scroller {\ +-webkit-box-shadow: inset 0 0 10px black;\ +-moz-box-shadow: inset 0 0 10px black;\ +-o-box-shadow: inset 0 0 10px black;\ +box-shadow: inset 0 0 10px black;\ +}\ +.ace-ambiance {\ +color: #E6E1DC;\ +background-color: #202020;\ +}\ +.ace-ambiance .ace_cursor {\ +border-left: 1px solid #7991E8;\ +}\ +.ace-ambiance .ace_overwrite-cursors .ace_cursor {\ +border: 1px solid #FFE300;\ +background: #766B13;\ +}\ +.ace-ambiance.normal-mode .ace_cursor-layer {\ +z-index: 0;\ +}\ +.ace-ambiance .ace_marker-layer .ace_selection {\ +background: rgba(221, 240, 255, 0.20);\ +}\ +.ace-ambiance .ace_marker-layer .ace_selected-word {\ +border-radius: 4px;\ +border: 8px solid #3f475d;\ +box-shadow: 0 0 4px black;\ +}\ +.ace-ambiance .ace_marker-layer .ace_step {\ +background: rgb(198, 219, 174);\ +}\ +.ace-ambiance .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(255, 255, 255, 0.25);\ +}\ +.ace-ambiance .ace_marker-layer .ace_active-line {\ +background: rgba(255, 255, 255, 0.031);\ +}\ +.ace-ambiance .ace_invisible {\ +color: #333;\ +}\ +.ace-ambiance .ace_paren {\ +color: #24C2C7;\ +}\ +.ace-ambiance .ace_keyword {\ +color: #cda869;\ +}\ +.ace-ambiance .ace_keyword.ace_operator {\ +color: #fa8d6a;\ +}\ +.ace-ambiance .ace_punctuation.ace_operator {\ +color: #fa8d6a;\ +}\ +.ace-ambiance .ace_identifier {\ +}\ +.ace-ambiance .ace-statement {\ +color: #cda869;\ +}\ +.ace-ambiance .ace_constant {\ +color: #CF7EA9;\ +}\ +.ace-ambiance .ace_constant.ace_language {\ +color: #CF7EA9;\ +}\ +.ace-ambiance .ace_constant.ace_library {\ +}\ +.ace-ambiance .ace_constant.ace_numeric {\ +color: #78CF8A;\ +}\ +.ace-ambiance .ace_invalid {\ +text-decoration: underline;\ +}\ +.ace-ambiance .ace_invalid.ace_illegal {\ +color:#F8F8F8;\ +background-color: rgba(86, 45, 86, 0.75);\ +}\ +.ace-ambiance .ace_invalid,\ +.ace-ambiance .ace_deprecated {\ +text-decoration: underline;\ +font-style: italic;\ +color: #D2A8A1;\ +}\ +.ace-ambiance .ace_support {\ +color: #9B859D;\ +}\ +.ace-ambiance .ace_support.ace_function {\ +color: #DAD085;\ +}\ +.ace-ambiance .ace_function.ace_buildin {\ +color: #9b859d;\ +}\ +.ace-ambiance .ace_string {\ +color: #8f9d6a;\ +}\ +.ace-ambiance .ace_string.ace_regexp {\ +color: #DAD085;\ +}\ +.ace-ambiance .ace_comment {\ +font-style: italic;\ +color: #555;\ +}\ +.ace-ambiance .ace_comment.ace_doc {\ +}\ +.ace-ambiance .ace_comment.ace_doc.ace_tag {\ +color: #666;\ +font-style: normal;\ +}\ +.ace-ambiance .ace_definition,\ +.ace-ambiance .ace_type {\ +color: #aac6e3;\ +}\ +.ace-ambiance .ace_variable {\ +color: #9999cc;\ +}\ +.ace-ambiance .ace_variable.ace_language {\ +color: #9b859d;\ +}\ +.ace-ambiance .ace_xml-pe {\ +color: #494949;\ +}\ +.ace-ambiance .ace_gutter-layer,\ +.ace-ambiance .ace_text-layer {\ +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\");\ +}\ +.ace-ambiance .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQUFD4z6Crq/sfAAuYAuYl+7lfAAAAAElFTkSuQmCC\") right repeat-y;\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); + +}); diff --git a/htdocs/includes/ace/theme-chaos.js b/htdocs/includes/ace/theme-chaos.js new file mode 100644 index 00000000000..97ec7fbdc7c --- /dev/null +++ b/htdocs/includes/ace/theme-chaos.js @@ -0,0 +1,156 @@ +ace.define("ace/theme/chaos",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-chaos"; +exports.cssText = ".ace-chaos .ace_gutter {\ +background: #141414;\ +color: #595959;\ +border-right: 1px solid #282828;\ +}\ +.ace-chaos .ace_gutter-cell.ace_warning {\ +background-image: none;\ +background: #FC0;\ +border-left: none;\ +padding-left: 0;\ +color: #000;\ +}\ +.ace-chaos .ace_gutter-cell.ace_error {\ +background-position: -6px center;\ +background-image: none;\ +background: #F10;\ +border-left: none;\ +padding-left: 0;\ +color: #000;\ +}\ +.ace-chaos .ace_print-margin {\ +border-left: 1px solid #555;\ +right: 0;\ +background: #1D1D1D;\ +}\ +.ace-chaos {\ +background-color: #161616;\ +color: #E6E1DC;\ +}\ +.ace-chaos .ace_cursor {\ +border-left: 2px solid #FFFFFF;\ +}\ +.ace-chaos .ace_cursor.ace_overwrite {\ +border-left: 0px;\ +border-bottom: 1px solid #FFFFFF;\ +}\ +.ace-chaos .ace_marker-layer .ace_selection {\ +background: #494836;\ +}\ +.ace-chaos .ace_marker-layer .ace_step {\ +background: rgb(198, 219, 174);\ +}\ +.ace-chaos .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #FCE94F;\ +}\ +.ace-chaos .ace_marker-layer .ace_active-line {\ +background: #333;\ +}\ +.ace-chaos .ace_gutter-active-line {\ +background-color: #222;\ +}\ +.ace-chaos .ace_invisible {\ +color: #404040;\ +}\ +.ace-chaos .ace_keyword {\ +color:#00698F;\ +}\ +.ace-chaos .ace_keyword.ace_operator {\ +color:#FF308F;\ +}\ +.ace-chaos .ace_constant {\ +color:#1EDAFB;\ +}\ +.ace-chaos .ace_constant.ace_language {\ +color:#FDC251;\ +}\ +.ace-chaos .ace_constant.ace_library {\ +color:#8DFF0A;\ +}\ +.ace-chaos .ace_constant.ace_numeric {\ +color:#58C554;\ +}\ +.ace-chaos .ace_invalid {\ +color:#FFFFFF;\ +background-color:#990000;\ +}\ +.ace-chaos .ace_invalid.ace_deprecated {\ +color:#FFFFFF;\ +background-color:#990000;\ +}\ +.ace-chaos .ace_support {\ +color: #999;\ +}\ +.ace-chaos .ace_support.ace_function {\ +color:#00AEEF;\ +}\ +.ace-chaos .ace_function {\ +color:#00AEEF;\ +}\ +.ace-chaos .ace_string {\ +color:#58C554;\ +}\ +.ace-chaos .ace_comment {\ +color:#555;\ +font-style:italic;\ +padding-bottom: 0px;\ +}\ +.ace-chaos .ace_variable {\ +color:#997744;\ +}\ +.ace-chaos .ace_meta.ace_tag {\ +color:#BE53E6;\ +}\ +.ace-chaos .ace_entity.ace_other.ace_attribute-name {\ +color:#FFFF89;\ +}\ +.ace-chaos .ace_markup.ace_underline {\ +text-decoration: underline;\ +}\ +.ace-chaos .ace_fold-widget {\ +text-align: center;\ +}\ +.ace-chaos .ace_fold-widget:hover {\ +color: #777;\ +}\ +.ace-chaos .ace_fold-widget.ace_start,\ +.ace-chaos .ace_fold-widget.ace_end,\ +.ace-chaos .ace_fold-widget.ace_closed{\ +background: none;\ +border: none;\ +box-shadow: none;\ +}\ +.ace-chaos .ace_fold-widget.ace_start:after {\ +content: '▾'\ +}\ +.ace-chaos .ace_fold-widget.ace_end:after {\ +content: '▴'\ +}\ +.ace-chaos .ace_fold-widget.ace_closed:after {\ +content: '‣'\ +}\ +.ace-chaos .ace_indent-guide {\ +border-right:1px dotted #333;\ +margin-right:-1px;\ +}\ +.ace-chaos .ace_fold { \ +background: #222; \ +border-radius: 3px; \ +color: #7AF; \ +border: none; \ +}\ +.ace-chaos .ace_fold:hover {\ +background: #CCC; \ +color: #000;\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); + +}); diff --git a/htdocs/includes/ace/theme-chrome.js b/htdocs/includes/ace/theme-chrome.js new file mode 100644 index 00000000000..83742aa4642 --- /dev/null +++ b/htdocs/includes/ace/theme-chrome.js @@ -0,0 +1,128 @@ +ace.define("ace/theme/chrome",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-chrome"; +exports.cssText = ".ace-chrome .ace_gutter {\ +background: #ebebeb;\ +color: #333;\ +overflow : hidden;\ +}\ +.ace-chrome .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-chrome {\ +background-color: #FFFFFF;\ +color: black;\ +}\ +.ace-chrome .ace_cursor {\ +color: black;\ +}\ +.ace-chrome .ace_invisible {\ +color: rgb(191, 191, 191);\ +}\ +.ace-chrome .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-chrome .ace_constant.ace_language {\ +color: rgb(88, 92, 246);\ +}\ +.ace-chrome .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-chrome .ace_invalid {\ +background-color: rgb(153, 0, 0);\ +color: white;\ +}\ +.ace-chrome .ace_fold {\ +}\ +.ace-chrome .ace_support.ace_function {\ +color: rgb(60, 76, 114);\ +}\ +.ace-chrome .ace_support.ace_constant {\ +color: rgb(6, 150, 14);\ +}\ +.ace-chrome .ace_support.ace_type,\ +.ace-chrome .ace_support.ace_class\ +.ace-chrome .ace_support.ace_other {\ +color: rgb(109, 121, 222);\ +}\ +.ace-chrome .ace_variable.ace_parameter {\ +font-style:italic;\ +color:#FD971F;\ +}\ +.ace-chrome .ace_keyword.ace_operator {\ +color: rgb(104, 118, 135);\ +}\ +.ace-chrome .ace_comment {\ +color: #236e24;\ +}\ +.ace-chrome .ace_comment.ace_doc {\ +color: #236e24;\ +}\ +.ace-chrome .ace_comment.ace_doc.ace_tag {\ +color: #236e24;\ +}\ +.ace-chrome .ace_constant.ace_numeric {\ +color: rgb(0, 0, 205);\ +}\ +.ace-chrome .ace_variable {\ +color: rgb(49, 132, 149);\ +}\ +.ace-chrome .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-chrome .ace_entity.ace_name.ace_function {\ +color: #0000A2;\ +}\ +.ace-chrome .ace_heading {\ +color: rgb(12, 7, 255);\ +}\ +.ace-chrome .ace_list {\ +color:rgb(185, 6, 144);\ +}\ +.ace-chrome .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-chrome .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-chrome .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-chrome .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-chrome .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.07);\ +}\ +.ace-chrome .ace_gutter-active-line {\ +background-color : #dcdcdc;\ +}\ +.ace-chrome .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-chrome .ace_storage,\ +.ace-chrome .ace_keyword,\ +.ace-chrome .ace_meta.ace_tag {\ +color: rgb(147, 15, 128);\ +}\ +.ace-chrome .ace_string.ace_regex {\ +color: rgb(255, 0, 0)\ +}\ +.ace-chrome .ace_string {\ +color: #1A1AA6;\ +}\ +.ace-chrome .ace_entity.ace_other.ace_attribute-name {\ +color: #994409;\ +}\ +.ace-chrome .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-clouds.js b/htdocs/includes/ace/theme-clouds.js new file mode 100644 index 00000000000..83d0d14d593 --- /dev/null +++ b/htdocs/includes/ace/theme-clouds.js @@ -0,0 +1,95 @@ +ace.define("ace/theme/clouds",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-clouds"; +exports.cssText = ".ace-clouds .ace_gutter {\ +background: #ebebeb;\ +color: #333\ +}\ +.ace-clouds .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8\ +}\ +.ace-clouds {\ +background-color: #FFFFFF;\ +color: #000000\ +}\ +.ace-clouds .ace_cursor {\ +color: #000000\ +}\ +.ace-clouds .ace_marker-layer .ace_selection {\ +background: #BDD5FC\ +}\ +.ace-clouds.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #FFFFFF;\ +}\ +.ace-clouds .ace_marker-layer .ace_step {\ +background: rgb(255, 255, 0)\ +}\ +.ace-clouds .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #BFBFBF\ +}\ +.ace-clouds .ace_marker-layer .ace_active-line {\ +background: #FFFBD1\ +}\ +.ace-clouds .ace_gutter-active-line {\ +background-color : #dcdcdc\ +}\ +.ace-clouds .ace_marker-layer .ace_selected-word {\ +border: 1px solid #BDD5FC\ +}\ +.ace-clouds .ace_invisible {\ +color: #BFBFBF\ +}\ +.ace-clouds .ace_keyword,\ +.ace-clouds .ace_meta,\ +.ace-clouds .ace_support.ace_constant.ace_property-value {\ +color: #AF956F\ +}\ +.ace-clouds .ace_keyword.ace_operator {\ +color: #484848\ +}\ +.ace-clouds .ace_keyword.ace_other.ace_unit {\ +color: #96DC5F\ +}\ +.ace-clouds .ace_constant.ace_language {\ +color: #39946A\ +}\ +.ace-clouds .ace_constant.ace_numeric {\ +color: #46A609\ +}\ +.ace-clouds .ace_constant.ace_character.ace_entity {\ +color: #BF78CC\ +}\ +.ace-clouds .ace_invalid {\ +background-color: #FF002A\ +}\ +.ace-clouds .ace_fold {\ +background-color: #AF956F;\ +border-color: #000000\ +}\ +.ace-clouds .ace_storage,\ +.ace-clouds .ace_support.ace_class,\ +.ace-clouds .ace_support.ace_function,\ +.ace-clouds .ace_support.ace_other,\ +.ace-clouds .ace_support.ace_type {\ +color: #C52727\ +}\ +.ace-clouds .ace_string {\ +color: #5D90CD\ +}\ +.ace-clouds .ace_comment {\ +color: #BCC8BA\ +}\ +.ace-clouds .ace_entity.ace_name.ace_tag,\ +.ace-clouds .ace_entity.ace_other.ace_attribute-name {\ +color: #606060\ +}\ +.ace-clouds .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-clouds_midnight.js b/htdocs/includes/ace/theme-clouds_midnight.js new file mode 100644 index 00000000000..275e9f296a1 --- /dev/null +++ b/htdocs/includes/ace/theme-clouds_midnight.js @@ -0,0 +1,96 @@ +ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-clouds-midnight"; +exports.cssText = ".ace-clouds-midnight .ace_gutter {\ +background: #232323;\ +color: #929292\ +}\ +.ace-clouds-midnight .ace_print-margin {\ +width: 1px;\ +background: #232323\ +}\ +.ace-clouds-midnight {\ +background-color: #191919;\ +color: #929292\ +}\ +.ace-clouds-midnight .ace_cursor {\ +color: #7DA5DC\ +}\ +.ace-clouds-midnight .ace_marker-layer .ace_selection {\ +background: #000000\ +}\ +.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #191919;\ +}\ +.ace-clouds-midnight .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-clouds-midnight .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #BFBFBF\ +}\ +.ace-clouds-midnight .ace_marker-layer .ace_active-line {\ +background: rgba(215, 215, 215, 0.031)\ +}\ +.ace-clouds-midnight .ace_gutter-active-line {\ +background-color: rgba(215, 215, 215, 0.031)\ +}\ +.ace-clouds-midnight .ace_marker-layer .ace_selected-word {\ +border: 1px solid #000000\ +}\ +.ace-clouds-midnight .ace_invisible {\ +color: #666\ +}\ +.ace-clouds-midnight .ace_keyword,\ +.ace-clouds-midnight .ace_meta,\ +.ace-clouds-midnight .ace_support.ace_constant.ace_property-value {\ +color: #927C5D\ +}\ +.ace-clouds-midnight .ace_keyword.ace_operator {\ +color: #4B4B4B\ +}\ +.ace-clouds-midnight .ace_keyword.ace_other.ace_unit {\ +color: #366F1A\ +}\ +.ace-clouds-midnight .ace_constant.ace_language {\ +color: #39946A\ +}\ +.ace-clouds-midnight .ace_constant.ace_numeric {\ +color: #46A609\ +}\ +.ace-clouds-midnight .ace_constant.ace_character.ace_entity {\ +color: #A165AC\ +}\ +.ace-clouds-midnight .ace_invalid {\ +color: #FFFFFF;\ +background-color: #E92E2E\ +}\ +.ace-clouds-midnight .ace_fold {\ +background-color: #927C5D;\ +border-color: #929292\ +}\ +.ace-clouds-midnight .ace_storage,\ +.ace-clouds-midnight .ace_support.ace_class,\ +.ace-clouds-midnight .ace_support.ace_function,\ +.ace-clouds-midnight .ace_support.ace_other,\ +.ace-clouds-midnight .ace_support.ace_type {\ +color: #E92E2E\ +}\ +.ace-clouds-midnight .ace_string {\ +color: #5D90CD\ +}\ +.ace-clouds-midnight .ace_comment {\ +color: #3C403B\ +}\ +.ace-clouds-midnight .ace_entity.ace_name.ace_tag,\ +.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {\ +color: #606060\ +}\ +.ace-clouds-midnight .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-cobalt.js b/htdocs/includes/ace/theme-cobalt.js new file mode 100644 index 00000000000..c5b6f267c26 --- /dev/null +++ b/htdocs/includes/ace/theme-cobalt.js @@ -0,0 +1,113 @@ +ace.define("ace/theme/cobalt",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-cobalt"; +exports.cssText = ".ace-cobalt .ace_gutter {\ +background: #011e3a;\ +color: rgb(128,145,160)\ +}\ +.ace-cobalt .ace_print-margin {\ +width: 1px;\ +background: #555555\ +}\ +.ace-cobalt {\ +background-color: #002240;\ +color: #FFFFFF\ +}\ +.ace-cobalt .ace_cursor {\ +color: #FFFFFF\ +}\ +.ace-cobalt .ace_marker-layer .ace_selection {\ +background: rgba(179, 101, 57, 0.75)\ +}\ +.ace-cobalt.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #002240;\ +}\ +.ace-cobalt .ace_marker-layer .ace_step {\ +background: rgb(127, 111, 19)\ +}\ +.ace-cobalt .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(255, 255, 255, 0.15)\ +}\ +.ace-cobalt .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.35)\ +}\ +.ace-cobalt .ace_gutter-active-line {\ +background-color: rgba(0, 0, 0, 0.35)\ +}\ +.ace-cobalt .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(179, 101, 57, 0.75)\ +}\ +.ace-cobalt .ace_invisible {\ +color: rgba(255, 255, 255, 0.15)\ +}\ +.ace-cobalt .ace_keyword,\ +.ace-cobalt .ace_meta {\ +color: #FF9D00\ +}\ +.ace-cobalt .ace_constant,\ +.ace-cobalt .ace_constant.ace_character,\ +.ace-cobalt .ace_constant.ace_character.ace_escape,\ +.ace-cobalt .ace_constant.ace_other {\ +color: #FF628C\ +}\ +.ace-cobalt .ace_invalid {\ +color: #F8F8F8;\ +background-color: #800F00\ +}\ +.ace-cobalt .ace_support {\ +color: #80FFBB\ +}\ +.ace-cobalt .ace_support.ace_constant {\ +color: #EB939A\ +}\ +.ace-cobalt .ace_fold {\ +background-color: #FF9D00;\ +border-color: #FFFFFF\ +}\ +.ace-cobalt .ace_support.ace_function {\ +color: #FFB054\ +}\ +.ace-cobalt .ace_storage {\ +color: #FFEE80\ +}\ +.ace-cobalt .ace_entity {\ +color: #FFDD00\ +}\ +.ace-cobalt .ace_string {\ +color: #3AD900\ +}\ +.ace-cobalt .ace_string.ace_regexp {\ +color: #80FFC2\ +}\ +.ace-cobalt .ace_comment {\ +font-style: italic;\ +color: #0088FF\ +}\ +.ace-cobalt .ace_heading,\ +.ace-cobalt .ace_markup.ace_heading {\ +color: #C8E4FD;\ +background-color: #001221\ +}\ +.ace-cobalt .ace_list,\ +.ace-cobalt .ace_markup.ace_list {\ +background-color: #130D26\ +}\ +.ace-cobalt .ace_variable {\ +color: #CCCCCC\ +}\ +.ace-cobalt .ace_variable.ace_language {\ +color: #FF80E1\ +}\ +.ace-cobalt .ace_meta.ace_tag {\ +color: #9EFFFF\ +}\ +.ace-cobalt .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-crimson_editor.js b/htdocs/includes/ace/theme-crimson_editor.js new file mode 100644 index 00000000000..a18855252b3 --- /dev/null +++ b/htdocs/includes/ace/theme-crimson_editor.js @@ -0,0 +1,118 @@ +ace.define("ace/theme/crimson_editor",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +exports.isDark = false; +exports.cssText = ".ace-crimson-editor .ace_gutter {\ +background: #ebebeb;\ +color: #333;\ +overflow : hidden;\ +}\ +.ace-crimson-editor .ace_gutter-layer {\ +width: 100%;\ +text-align: right;\ +}\ +.ace-crimson-editor .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-crimson-editor {\ +background-color: #FFFFFF;\ +color: rgb(64, 64, 64);\ +}\ +.ace-crimson-editor .ace_cursor {\ +color: black;\ +}\ +.ace-crimson-editor .ace_invisible {\ +color: rgb(191, 191, 191);\ +}\ +.ace-crimson-editor .ace_identifier {\ +color: black;\ +}\ +.ace-crimson-editor .ace_keyword {\ +color: blue;\ +}\ +.ace-crimson-editor .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-crimson-editor .ace_constant.ace_language {\ +color: rgb(255, 156, 0);\ +}\ +.ace-crimson-editor .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-crimson-editor .ace_invalid {\ +text-decoration: line-through;\ +color: rgb(224, 0, 0);\ +}\ +.ace-crimson-editor .ace_fold {\ +}\ +.ace-crimson-editor .ace_support.ace_function {\ +color: rgb(192, 0, 0);\ +}\ +.ace-crimson-editor .ace_support.ace_constant {\ +color: rgb(6, 150, 14);\ +}\ +.ace-crimson-editor .ace_support.ace_type,\ +.ace-crimson-editor .ace_support.ace_class {\ +color: rgb(109, 121, 222);\ +}\ +.ace-crimson-editor .ace_keyword.ace_operator {\ +color: rgb(49, 132, 149);\ +}\ +.ace-crimson-editor .ace_string {\ +color: rgb(128, 0, 128);\ +}\ +.ace-crimson-editor .ace_comment {\ +color: rgb(76, 136, 107);\ +}\ +.ace-crimson-editor .ace_comment.ace_doc {\ +color: rgb(0, 102, 255);\ +}\ +.ace-crimson-editor .ace_comment.ace_doc.ace_tag {\ +color: rgb(128, 159, 191);\ +}\ +.ace-crimson-editor .ace_constant.ace_numeric {\ +color: rgb(0, 0, 64);\ +}\ +.ace-crimson-editor .ace_variable {\ +color: rgb(0, 64, 128);\ +}\ +.ace-crimson-editor .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-crimson-editor .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-crimson-editor .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-crimson-editor .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-crimson-editor .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-crimson-editor .ace_marker-layer .ace_active-line {\ +background: rgb(232, 242, 254);\ +}\ +.ace-crimson-editor .ace_gutter-active-line {\ +background-color : #dcdcdc;\ +}\ +.ace-crimson-editor .ace_meta.ace_tag {\ +color:rgb(28, 2, 255);\ +}\ +.ace-crimson-editor .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-crimson-editor .ace_string.ace_regex {\ +color: rgb(192, 0, 192);\ +}\ +.ace-crimson-editor .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}"; + +exports.cssClass = "ace-crimson-editor"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-dawn.js b/htdocs/includes/ace/theme-dawn.js new file mode 100644 index 00000000000..f3c15c92ecb --- /dev/null +++ b/htdocs/includes/ace/theme-dawn.js @@ -0,0 +1,108 @@ +ace.define("ace/theme/dawn",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-dawn"; +exports.cssText = ".ace-dawn .ace_gutter {\ +background: #ebebeb;\ +color: #333\ +}\ +.ace-dawn .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8\ +}\ +.ace-dawn {\ +background-color: #F9F9F9;\ +color: #080808\ +}\ +.ace-dawn .ace_cursor {\ +color: #000000\ +}\ +.ace-dawn .ace_marker-layer .ace_selection {\ +background: rgba(39, 95, 255, 0.30)\ +}\ +.ace-dawn.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #F9F9F9;\ +}\ +.ace-dawn .ace_marker-layer .ace_step {\ +background: rgb(255, 255, 0)\ +}\ +.ace-dawn .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(75, 75, 126, 0.50)\ +}\ +.ace-dawn .ace_marker-layer .ace_active-line {\ +background: rgba(36, 99, 180, 0.12)\ +}\ +.ace-dawn .ace_gutter-active-line {\ +background-color : #dcdcdc\ +}\ +.ace-dawn .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(39, 95, 255, 0.30)\ +}\ +.ace-dawn .ace_invisible {\ +color: rgba(75, 75, 126, 0.50)\ +}\ +.ace-dawn .ace_keyword,\ +.ace-dawn .ace_meta {\ +color: #794938\ +}\ +.ace-dawn .ace_constant,\ +.ace-dawn .ace_constant.ace_character,\ +.ace-dawn .ace_constant.ace_character.ace_escape,\ +.ace-dawn .ace_constant.ace_other {\ +color: #811F24\ +}\ +.ace-dawn .ace_invalid.ace_illegal {\ +text-decoration: underline;\ +font-style: italic;\ +color: #F8F8F8;\ +background-color: #B52A1D\ +}\ +.ace-dawn .ace_invalid.ace_deprecated {\ +text-decoration: underline;\ +font-style: italic;\ +color: #B52A1D\ +}\ +.ace-dawn .ace_support {\ +color: #691C97\ +}\ +.ace-dawn .ace_support.ace_constant {\ +color: #B4371F\ +}\ +.ace-dawn .ace_fold {\ +background-color: #794938;\ +border-color: #080808\ +}\ +.ace-dawn .ace_list,\ +.ace-dawn .ace_markup.ace_list,\ +.ace-dawn .ace_support.ace_function {\ +color: #693A17\ +}\ +.ace-dawn .ace_storage {\ +font-style: italic;\ +color: #A71D5D\ +}\ +.ace-dawn .ace_string {\ +color: #0B6125\ +}\ +.ace-dawn .ace_string.ace_regexp {\ +color: #CF5628\ +}\ +.ace-dawn .ace_comment {\ +font-style: italic;\ +color: #5A525F\ +}\ +.ace-dawn .ace_heading,\ +.ace-dawn .ace_markup.ace_heading {\ +color: #19356D\ +}\ +.ace-dawn .ace_variable {\ +color: #234A97\ +}\ +.ace-dawn .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-dreamweaver.js b/htdocs/includes/ace/theme-dreamweaver.js new file mode 100644 index 00000000000..632b1ea9b00 --- /dev/null +++ b/htdocs/includes/ace/theme-dreamweaver.js @@ -0,0 +1,141 @@ +ace.define("ace/theme/dreamweaver",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +exports.isDark = false; +exports.cssClass = "ace-dreamweaver"; +exports.cssText = ".ace-dreamweaver .ace_gutter {\ +background: #e8e8e8;\ +color: #333;\ +}\ +.ace-dreamweaver .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-dreamweaver {\ +background-color: #FFFFFF;\ +color: black;\ +}\ +.ace-dreamweaver .ace_fold {\ +background-color: #757AD8;\ +}\ +.ace-dreamweaver .ace_cursor {\ +color: black;\ +}\ +.ace-dreamweaver .ace_invisible {\ +color: rgb(191, 191, 191);\ +}\ +.ace-dreamweaver .ace_storage,\ +.ace-dreamweaver .ace_keyword {\ +color: blue;\ +}\ +.ace-dreamweaver .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-dreamweaver .ace_constant.ace_language {\ +color: rgb(88, 92, 246);\ +}\ +.ace-dreamweaver .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-dreamweaver .ace_invalid {\ +background-color: rgb(153, 0, 0);\ +color: white;\ +}\ +.ace-dreamweaver .ace_support.ace_function {\ +color: rgb(60, 76, 114);\ +}\ +.ace-dreamweaver .ace_support.ace_constant {\ +color: rgb(6, 150, 14);\ +}\ +.ace-dreamweaver .ace_support.ace_type,\ +.ace-dreamweaver .ace_support.ace_class {\ +color: #009;\ +}\ +.ace-dreamweaver .ace_support.ace_php_tag {\ +color: #f00;\ +}\ +.ace-dreamweaver .ace_keyword.ace_operator {\ +color: rgb(104, 118, 135);\ +}\ +.ace-dreamweaver .ace_string {\ +color: #00F;\ +}\ +.ace-dreamweaver .ace_comment {\ +color: rgb(76, 136, 107);\ +}\ +.ace-dreamweaver .ace_comment.ace_doc {\ +color: rgb(0, 102, 255);\ +}\ +.ace-dreamweaver .ace_comment.ace_doc.ace_tag {\ +color: rgb(128, 159, 191);\ +}\ +.ace-dreamweaver .ace_constant.ace_numeric {\ +color: rgb(0, 0, 205);\ +}\ +.ace-dreamweaver .ace_variable {\ +color: #06F\ +}\ +.ace-dreamweaver .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-dreamweaver .ace_entity.ace_name.ace_function {\ +color: #00F;\ +}\ +.ace-dreamweaver .ace_heading {\ +color: rgb(12, 7, 255);\ +}\ +.ace-dreamweaver .ace_list {\ +color:rgb(185, 6, 144);\ +}\ +.ace-dreamweaver .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-dreamweaver .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-dreamweaver .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-dreamweaver .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-dreamweaver .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.07);\ +}\ +.ace-dreamweaver .ace_gutter-active-line {\ +background-color : #DCDCDC;\ +}\ +.ace-dreamweaver .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-dreamweaver .ace_meta.ace_tag {\ +color:#009;\ +}\ +.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {\ +color:#060;\ +}\ +.ace-dreamweaver .ace_meta.ace_tag.ace_form {\ +color:#F90;\ +}\ +.ace-dreamweaver .ace_meta.ace_tag.ace_image {\ +color:#909;\ +}\ +.ace-dreamweaver .ace_meta.ace_tag.ace_script {\ +color:#900;\ +}\ +.ace-dreamweaver .ace_meta.ace_tag.ace_style {\ +color:#909;\ +}\ +.ace-dreamweaver .ace_meta.ace_tag.ace_table {\ +color:#099;\ +}\ +.ace-dreamweaver .ace_string.ace_regex {\ +color: rgb(255, 0, 0)\ +}\ +.ace-dreamweaver .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-eclipse.js b/htdocs/includes/ace/theme-eclipse.js new file mode 100644 index 00000000000..63aa334cf3b --- /dev/null +++ b/htdocs/includes/ace/theme-eclipse.js @@ -0,0 +1,98 @@ +ace.define("ace/theme/eclipse",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +exports.isDark = false; +exports.cssText = ".ace-eclipse .ace_gutter {\ +background: #ebebeb;\ +border-right: 1px solid rgb(159, 159, 159);\ +color: rgb(136, 136, 136);\ +}\ +.ace-eclipse .ace_print-margin {\ +width: 1px;\ +background: #ebebeb;\ +}\ +.ace-eclipse {\ +background-color: #FFFFFF;\ +color: black;\ +}\ +.ace-eclipse .ace_fold {\ +background-color: rgb(60, 76, 114);\ +}\ +.ace-eclipse .ace_cursor {\ +color: black;\ +}\ +.ace-eclipse .ace_storage,\ +.ace-eclipse .ace_keyword,\ +.ace-eclipse .ace_variable {\ +color: rgb(127, 0, 85);\ +}\ +.ace-eclipse .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-eclipse .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-eclipse .ace_function {\ +color: rgb(60, 76, 114);\ +}\ +.ace-eclipse .ace_string {\ +color: rgb(42, 0, 255);\ +}\ +.ace-eclipse .ace_comment {\ +color: rgb(113, 150, 130);\ +}\ +.ace-eclipse .ace_comment.ace_doc {\ +color: rgb(63, 95, 191);\ +}\ +.ace-eclipse .ace_comment.ace_doc.ace_tag {\ +color: rgb(127, 159, 191);\ +}\ +.ace-eclipse .ace_constant.ace_numeric {\ +color: darkblue;\ +}\ +.ace-eclipse .ace_tag {\ +color: rgb(25, 118, 116);\ +}\ +.ace-eclipse .ace_type {\ +color: rgb(127, 0, 127);\ +}\ +.ace-eclipse .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-eclipse .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-eclipse .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-eclipse .ace_meta.ace_tag {\ +color:rgb(25, 118, 116);\ +}\ +.ace-eclipse .ace_invisible {\ +color: #ddd;\ +}\ +.ace-eclipse .ace_entity.ace_other.ace_attribute-name {\ +color:rgb(127, 0, 127);\ +}\ +.ace-eclipse .ace_marker-layer .ace_step {\ +background: rgb(255, 255, 0);\ +}\ +.ace-eclipse .ace_active-line {\ +background: rgb(232, 242, 254);\ +}\ +.ace-eclipse .ace_gutter-active-line {\ +background-color : #DADADA;\ +}\ +.ace-eclipse .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgb(181, 213, 255);\ +}\ +.ace-eclipse .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}"; + +exports.cssClass = "ace-eclipse"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-github.js b/htdocs/includes/ace/theme-github.js new file mode 100644 index 00000000000..d19512c6ed7 --- /dev/null +++ b/htdocs/includes/ace/theme-github.js @@ -0,0 +1,103 @@ +ace.define("ace/theme/github",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-github"; +exports.cssText = "\ +.ace-github .ace_gutter {\ +background: #e8e8e8;\ +color: #AAA;\ +}\ +.ace-github {\ +background: #fff;\ +color: #000;\ +}\ +.ace-github .ace_keyword {\ +font-weight: bold;\ +}\ +.ace-github .ace_string {\ +color: #D14;\ +}\ +.ace-github .ace_variable.ace_class {\ +color: teal;\ +}\ +.ace-github .ace_constant.ace_numeric {\ +color: #099;\ +}\ +.ace-github .ace_constant.ace_buildin {\ +color: #0086B3;\ +}\ +.ace-github .ace_support.ace_function {\ +color: #0086B3;\ +}\ +.ace-github .ace_comment {\ +color: #998;\ +font-style: italic;\ +}\ +.ace-github .ace_variable.ace_language {\ +color: #0086B3;\ +}\ +.ace-github .ace_paren {\ +font-weight: bold;\ +}\ +.ace-github .ace_boolean {\ +font-weight: bold;\ +}\ +.ace-github .ace_string.ace_regexp {\ +color: #009926;\ +font-weight: normal;\ +}\ +.ace-github .ace_variable.ace_instance {\ +color: teal;\ +}\ +.ace-github .ace_constant.ace_language {\ +font-weight: bold;\ +}\ +.ace-github .ace_cursor {\ +color: black;\ +}\ +.ace-github.ace_focus .ace_marker-layer .ace_active-line {\ +background: rgb(255, 255, 204);\ +}\ +.ace-github .ace_marker-layer .ace_active-line {\ +background: rgb(245, 245, 245);\ +}\ +.ace-github .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-github.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px white;\ +}\ +.ace-github.ace_nobold .ace_line > span {\ +font-weight: normal !important;\ +}\ +.ace-github .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-github .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-github .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-github .ace_gutter-active-line {\ +background-color : rgba(0, 0, 0, 0.07);\ +}\ +.ace-github .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-github .ace_invisible {\ +color: #BFBFBF\ +}\ +.ace-github .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-github .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}"; + + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-gob.js b/htdocs/includes/ace/theme-gob.js new file mode 100644 index 00000000000..9023fba6863 --- /dev/null +++ b/htdocs/includes/ace/theme-gob.js @@ -0,0 +1,112 @@ +ace.define("ace/theme/gob",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-gob"; +exports.cssText = ".ace-gob .ace_gutter {\ +background: #0B1818;\ +color: #03EE03\ +}\ +.ace-gob .ace_print-margin {\ +width: 1px;\ +background: #131313\ +}\ +.ace-gob {\ +background-color: #0B0B0B;\ +color: #00FF00\ +}\ +.ace-gob .ace_cursor {\ +border-color: rgba(16, 248, 255, 0.90);\ +background-color: rgba(16, 240, 248, 0.70);\ +opacity: 0.4;\ +}\ +.ace-gob .ace_marker-layer .ace_selection {\ +background: rgba(221, 240, 255, 0.20)\ +}\ +.ace-gob.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #141414;\ +}\ +.ace-gob .ace_marker-layer .ace_step {\ +background: rgb(16, 128, 0)\ +}\ +.ace-gob .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(64, 255, 255, 0.25)\ +}\ +.ace-gob .ace_marker-layer .ace_active-line {\ +background: rgba(255, 255, 255, 0.04)\ +}\ +.ace-gob .ace_gutter-active-line {\ +background-color: rgba(255, 255, 255, 0.04)\ +}\ +.ace-gob .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(192, 240, 255, 0.20)\ +}\ +.ace-gob .ace_invisible {\ +color: rgba(255, 255, 255, 0.25)\ +}\ +.ace-gob .ace_keyword,\ +.ace-gob .ace_meta {\ +color: #10D8E8\ +}\ +.ace-gob .ace_constant,\ +.ace-gob .ace_constant.ace_character,\ +.ace-gob .ace_constant.ace_character.ace_escape,\ +.ace-gob .ace_constant.ace_other,\ +.ace-gob .ace_heading,\ +.ace-gob .ace_markup.ace_heading,\ +.ace-gob .ace_support.ace_constant {\ +color: #10F0A0\ +}\ +.ace-gob .ace_invalid.ace_illegal {\ +color: #F8F8F8;\ +background-color: rgba(86, 45, 86, 0.75)\ +}\ +.ace-gob .ace_invalid.ace_deprecated {\ +text-decoration: underline;\ +font-style: italic;\ +color: #20F8C0\ +}\ +.ace-gob .ace_support {\ +color: #20E8B0\ +}\ +.ace-gob .ace_fold {\ +background-color: #50B8B8;\ +border-color: #70F8F8\ +}\ +.ace-gob .ace_support.ace_function {\ +color: #00F800\ +}\ +.ace-gob .ace_list,\ +.ace-gob .ace_markup.ace_list,\ +.ace-gob .ace_storage {\ +color: #10FF98\ +}\ +.ace-gob .ace_entity.ace_name.ace_function,\ +.ace-gob .ace_meta.ace_tag,\ +.ace-gob .ace_variable {\ +color: #00F868\ +}\ +.ace-gob .ace_string {\ +color: #10F060\ +}\ +.ace-gob .ace_string.ace_regexp {\ +color: #20F090;\ +}\ +.ace-gob .ace_comment {\ +font-style: italic;\ +color: #00E060;\ +}\ +.ace-gob .ace_variable {\ +color: #00F888;\ +}\ +.ace-gob .ace_xml-pe {\ +color: #488858;\ +}\ +.ace-gob .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-gruvbox.js b/htdocs/includes/ace/theme-gruvbox.js new file mode 100644 index 00000000000..133ca6410a4 --- /dev/null +++ b/htdocs/includes/ace/theme-gruvbox.js @@ -0,0 +1,82 @@ +ace.define("ace/theme/gruvbox",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-gruvbox"; +exports.cssText = ".ace-gruvbox .ace_gutter-active-line {\ +background-color: #3C3836;\ +}\ +.ace-gruvbox {\ +color: #EBDAB4;\ +background-color: #1D2021;\ +}\ +.ace-gruvbox .ace_invisible {\ +color: #504945;\ +}\ +.ace-gruvbox .ace_marker-layer .ace_selection {\ +background: rgba(179, 101, 57, 0.75)\ +}\ +.ace-gruvbox.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #002240;\ +}\ +.ace-gruvbox .ace_keyword {\ +color: #8ec07c;\ +}\ +.ace-gruvbox .ace_comment {\ +font-style: italic;\ +color: #928375;\ +}\ +.ace-gruvbox .ace-statement {\ +color: red;\ +}\ +.ace-gruvbox .ace_variable {\ +color: #84A598;\ +}\ +.ace-gruvbox .ace_variable.ace_language {\ +color: #D2879B;\ +}\ +.ace-gruvbox .ace_constant {\ +color: #C2859A;\ +}\ +.ace-gruvbox .ace_constant.ace_language {\ +color: #C2859A;\ +}\ +.ace-gruvbox .ace_constant.ace_numeric {\ +color: #C2859A;\ +}\ +.ace-gruvbox .ace_string {\ +color: #B8BA37;\ +}\ +.ace-gruvbox .ace_support {\ +color: #F9BC41;\ +}\ +.ace-gruvbox .ace_support.ace_function {\ +color: #F84B3C;\ +}\ +.ace-gruvbox .ace_storage {\ +color: #8FBF7F;\ +}\ +.ace-gruvbox .ace_keyword.ace_operator {\ +color: #EBDAB4;\ +}\ +.ace-gruvbox .ace_punctuation.ace_operator {\ +color: yellow;\ +}\ +.ace-gruvbox .ace_marker-layer .ace_active-line {\ +background: #3C3836;\ +}\ +.ace-gruvbox .ace_marker-layer .ace_selected-word {\ +border-radius: 4px;\ +border: 8px solid #3f475d;\ +}\ +.ace-gruvbox .ace_print-margin {\ +width: 5px;\ +background: #3C3836;\ +}\ +.ace-gruvbox .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQUFD4z6Crq/sfAAuYAuYl+7lfAAAAAElFTkSuQmCC\") right repeat-y;\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); + +}); diff --git a/htdocs/includes/ace/theme-idle_fingers.js b/htdocs/includes/ace/theme-idle_fingers.js new file mode 100644 index 00000000000..7fcf1cbdb47 --- /dev/null +++ b/htdocs/includes/ace/theme-idle_fingers.js @@ -0,0 +1,96 @@ +ace.define("ace/theme/idle_fingers",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-idle-fingers"; +exports.cssText = ".ace-idle-fingers .ace_gutter {\ +background: #3b3b3b;\ +color: rgb(153,153,153)\ +}\ +.ace-idle-fingers .ace_print-margin {\ +width: 1px;\ +background: #3b3b3b\ +}\ +.ace-idle-fingers {\ +background-color: #323232;\ +color: #FFFFFF\ +}\ +.ace-idle-fingers .ace_cursor {\ +color: #91FF00\ +}\ +.ace-idle-fingers .ace_marker-layer .ace_selection {\ +background: rgba(90, 100, 126, 0.88)\ +}\ +.ace-idle-fingers.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #323232;\ +}\ +.ace-idle-fingers .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-idle-fingers .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #404040\ +}\ +.ace-idle-fingers .ace_marker-layer .ace_active-line {\ +background: #353637\ +}\ +.ace-idle-fingers .ace_gutter-active-line {\ +background-color: #353637\ +}\ +.ace-idle-fingers .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(90, 100, 126, 0.88)\ +}\ +.ace-idle-fingers .ace_invisible {\ +color: #404040\ +}\ +.ace-idle-fingers .ace_keyword,\ +.ace-idle-fingers .ace_meta {\ +color: #CC7833\ +}\ +.ace-idle-fingers .ace_constant,\ +.ace-idle-fingers .ace_constant.ace_character,\ +.ace-idle-fingers .ace_constant.ace_character.ace_escape,\ +.ace-idle-fingers .ace_constant.ace_other,\ +.ace-idle-fingers .ace_support.ace_constant {\ +color: #6C99BB\ +}\ +.ace-idle-fingers .ace_invalid {\ +color: #FFFFFF;\ +background-color: #FF0000\ +}\ +.ace-idle-fingers .ace_fold {\ +background-color: #CC7833;\ +border-color: #FFFFFF\ +}\ +.ace-idle-fingers .ace_support.ace_function {\ +color: #B83426\ +}\ +.ace-idle-fingers .ace_variable.ace_parameter {\ +font-style: italic\ +}\ +.ace-idle-fingers .ace_string {\ +color: #A5C261\ +}\ +.ace-idle-fingers .ace_string.ace_regexp {\ +color: #CCCC33\ +}\ +.ace-idle-fingers .ace_comment {\ +font-style: italic;\ +color: #BC9458\ +}\ +.ace-idle-fingers .ace_meta.ace_tag {\ +color: #FFE5BB\ +}\ +.ace-idle-fingers .ace_entity.ace_name {\ +color: #FFC66D\ +}\ +.ace-idle-fingers .ace_collab.ace_user1 {\ +color: #323232;\ +background-color: #FFF980\ +}\ +.ace-idle-fingers .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjLyZYiPj/8PAAreAwAI1+g0AAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-iplastic.js b/htdocs/includes/ace/theme-iplastic.js new file mode 100644 index 00000000000..593aa00edb8 --- /dev/null +++ b/htdocs/includes/ace/theme-iplastic.js @@ -0,0 +1,121 @@ +ace.define("ace/theme/iplastic",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-iplastic"; +exports.cssText = ".ace-iplastic .ace_gutter {\ +background: #dddddd;\ +color: #666666\ +}\ +.ace-iplastic .ace_print-margin {\ +width: 1px;\ +background: #bbbbbb\ +}\ +.ace-iplastic {\ +background-color: #eeeeee;\ +color: #333333\ +}\ +.ace-iplastic .ace_cursor {\ +color: #333\ +}\ +.ace-iplastic .ace_marker-layer .ace_selection {\ +background: #BAD6FD;\ +}\ +.ace-iplastic.ace_multiselect .ace_selection.ace_start {\ +border-radius: 4px\ +}\ +.ace-iplastic .ace_marker-layer .ace_step {\ +background: #444444\ +}\ +.ace-iplastic .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #49483E;\ +background: #FFF799\ +}\ +.ace-iplastic .ace_marker-layer .ace_active-line {\ +background: #e5e5e5\ +}\ +.ace-iplastic .ace_gutter-active-line {\ +background-color: #eeeeee\ +}\ +.ace-iplastic .ace_marker-layer .ace_selected-word {\ +border: 1px solid #555555;\ +border-radius:4px\ +}\ +.ace-iplastic .ace_invisible {\ +color: #999999\ +}\ +.ace-iplastic .ace_entity.ace_name.ace_tag,\ +.ace-iplastic .ace_keyword,\ +.ace-iplastic .ace_meta.ace_tag,\ +.ace-iplastic .ace_storage {\ +color: #0000FF\ +}\ +.ace-iplastic .ace_punctuation,\ +.ace-iplastic .ace_punctuation.ace_tag {\ +color: #000\ +}\ +.ace-iplastic .ace_constant {\ +color: #333333;\ +font-weight: 700\ +}\ +.ace-iplastic .ace_constant.ace_character,\ +.ace-iplastic .ace_constant.ace_language,\ +.ace-iplastic .ace_constant.ace_numeric,\ +.ace-iplastic .ace_constant.ace_other {\ +color: #0066FF;\ +font-weight: 700\ +}\ +.ace-iplastic .ace_constant.ace_numeric{\ +font-weight: 100\ +}\ +.ace-iplastic .ace_invalid {\ +color: #F8F8F0;\ +background-color: #F92672\ +}\ +.ace-iplastic .ace_invalid.ace_deprecated {\ +color: #F8F8F0;\ +background-color: #AE81FF\ +}\ +.ace-iplastic .ace_support.ace_constant,\ +.ace-iplastic .ace_support.ace_function {\ +color: #333333;\ +font-weight: 700\ +}\ +.ace-iplastic .ace_fold {\ +background-color: #464646;\ +border-color: #F8F8F2\ +}\ +.ace-iplastic .ace_storage.ace_type,\ +.ace-iplastic .ace_support.ace_class,\ +.ace-iplastic .ace_support.ace_type {\ +color: #3333fc;\ +font-weight: 700\ +}\ +.ace-iplastic .ace_entity.ace_name.ace_function,\ +.ace-iplastic .ace_entity.ace_other,\ +.ace-iplastic .ace_entity.ace_other.ace_attribute-name,\ +.ace-iplastic .ace_variable {\ +color: #3366cc;\ +font-style: italic\ +}\ +.ace-iplastic .ace_variable.ace_parameter {\ +font-style: italic;\ +color: #2469E0\ +}\ +.ace-iplastic .ace_string {\ +color: #a55f03\ +}\ +.ace-iplastic .ace_comment {\ +color: #777777;\ +font-style: italic\ +}\ +.ace-iplastic .ace_fold-widget {\ +background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==);\ +}\ +.ace-iplastic .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAABlJREFUeNpi+P//PwMzMzPzfwAAAAD//wMAGRsECSML/RIAAAAASUVORK5CYII=) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-katzenmilch.js b/htdocs/includes/ace/theme-katzenmilch.js new file mode 100644 index 00000000000..f65ce4a81cd --- /dev/null +++ b/htdocs/includes/ace/theme-katzenmilch.js @@ -0,0 +1,121 @@ +ace.define("ace/theme/katzenmilch",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-katzenmilch"; +exports.cssText = ".ace-katzenmilch .ace_gutter,\ +.ace-katzenmilch .ace_gutter {\ +background: #e8e8e8;\ +color: #333\ +}\ +.ace-katzenmilch .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8\ +}\ +.ace-katzenmilch {\ +background-color: #f3f2f3;\ +color: rgba(15, 0, 9, 1.0)\ +}\ +.ace-katzenmilch .ace_cursor {\ +border-left: 2px solid #100011\ +}\ +.ace-katzenmilch .ace_overwrite-cursors .ace_cursor {\ +border-left: 0px;\ +border-bottom: 1px solid #100011\ +}\ +.ace-katzenmilch .ace_marker-layer .ace_selection {\ +background: rgba(100, 5, 208, 0.27)\ +}\ +.ace-katzenmilch.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #f3f2f3;\ +}\ +.ace-katzenmilch .ace_marker-layer .ace_step {\ +background: rgb(198, 219, 174)\ +}\ +.ace-katzenmilch .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(0, 0, 0, 0.33);\ +}\ +.ace-katzenmilch .ace_marker-layer .ace_active-line {\ +background: rgb(232, 242, 254)\ +}\ +.ace-katzenmilch .ace_gutter-active-line {\ +background-color: rgb(232, 242, 254)\ +}\ +.ace-katzenmilch .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(100, 5, 208, 0.27)\ +}\ +.ace-katzenmilch .ace_invisible {\ +color: #BFBFBF\ +}\ +.ace-katzenmilch .ace_fold {\ +background-color: rgba(2, 95, 73, 0.97);\ +border-color: rgba(15, 0, 9, 1.0)\ +}\ +.ace-katzenmilch .ace_keyword {\ +color: #674Aa8;\ +rbackground-color: rgba(163, 170, 216, 0.055)\ +}\ +.ace-katzenmilch .ace_constant.ace_language {\ +color: #7D7e52;\ +rbackground-color: rgba(189, 190, 130, 0.059)\ +}\ +.ace-katzenmilch .ace_constant.ace_numeric {\ +color: rgba(79, 130, 123, 0.93);\ +rbackground-color: rgba(119, 194, 187, 0.059)\ +}\ +.ace-katzenmilch .ace_constant.ace_character,\ +.ace-katzenmilch .ace_constant.ace_other {\ +color: rgba(2, 95, 105, 1.0);\ +rbackground-color: rgba(127, 34, 153, 0.063)\ +}\ +.ace-katzenmilch .ace_support.ace_function {\ +color: #9D7e62;\ +rbackground-color: rgba(189, 190, 130, 0.039)\ +}\ +.ace-katzenmilch .ace_support.ace_class {\ +color: rgba(239, 106, 167, 1.0);\ +rbackground-color: rgba(239, 106, 167, 0.063)\ +}\ +.ace-katzenmilch .ace_storage {\ +color: rgba(123, 92, 191, 1.0);\ +rbackground-color: rgba(139, 93, 223, 0.051)\ +}\ +.ace-katzenmilch .ace_invalid {\ +color: #DFDFD5;\ +rbackground-color: #CC1B27\ +}\ +.ace-katzenmilch .ace_string {\ +color: #5a5f9b;\ +rbackground-color: rgba(170, 175, 219, 0.035)\ +}\ +.ace-katzenmilch .ace_comment {\ +font-style: italic;\ +color: rgba(64, 79, 80, 0.67);\ +rbackground-color: rgba(95, 15, 255, 0.0078)\ +}\ +.ace-katzenmilch .ace_entity.ace_name.ace_function,\ +.ace-katzenmilch .ace_variable {\ +color: rgba(2, 95, 73, 0.97);\ +rbackground-color: rgba(34, 255, 73, 0.12)\ +}\ +.ace-katzenmilch .ace_variable.ace_language {\ +color: #316fcf;\ +rbackground-color: rgba(58, 175, 255, 0.039)\ +}\ +.ace-katzenmilch .ace_variable.ace_parameter {\ +font-style: italic;\ +color: rgba(51, 150, 159, 0.87);\ +rbackground-color: rgba(5, 214, 249, 0.043)\ +}\ +.ace-katzenmilch .ace_entity.ace_other.ace_attribute-name {\ +color: rgba(73, 70, 194, 0.93);\ +rbackground-color: rgba(73, 134, 194, 0.035)\ +}\ +.ace-katzenmilch .ace_entity.ace_name.ace_tag {\ +color: #3976a2;\ +rbackground-color: rgba(73, 166, 210, 0.039)\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-kr_theme.js b/htdocs/includes/ace/theme-kr_theme.js new file mode 100644 index 00000000000..8818b33e76f --- /dev/null +++ b/htdocs/includes/ace/theme-kr_theme.js @@ -0,0 +1,104 @@ +ace.define("ace/theme/kr_theme",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-kr-theme"; +exports.cssText = ".ace-kr-theme .ace_gutter {\ +background: #1c1917;\ +color: #FCFFE0\ +}\ +.ace-kr-theme .ace_print-margin {\ +width: 1px;\ +background: #1c1917\ +}\ +.ace-kr-theme {\ +background-color: #0B0A09;\ +color: #FCFFE0\ +}\ +.ace-kr-theme .ace_cursor {\ +color: #FF9900\ +}\ +.ace-kr-theme .ace_marker-layer .ace_selection {\ +background: rgba(170, 0, 255, 0.45)\ +}\ +.ace-kr-theme.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #0B0A09;\ +}\ +.ace-kr-theme .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-kr-theme .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(255, 177, 111, 0.32)\ +}\ +.ace-kr-theme .ace_marker-layer .ace_active-line {\ +background: #38403D\ +}\ +.ace-kr-theme .ace_gutter-active-line {\ +background-color : #38403D\ +}\ +.ace-kr-theme .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(170, 0, 255, 0.45)\ +}\ +.ace-kr-theme .ace_invisible {\ +color: rgba(255, 177, 111, 0.32)\ +}\ +.ace-kr-theme .ace_keyword,\ +.ace-kr-theme .ace_meta {\ +color: #949C8B\ +}\ +.ace-kr-theme .ace_constant,\ +.ace-kr-theme .ace_constant.ace_character,\ +.ace-kr-theme .ace_constant.ace_character.ace_escape,\ +.ace-kr-theme .ace_constant.ace_other {\ +color: rgba(210, 117, 24, 0.76)\ +}\ +.ace-kr-theme .ace_invalid {\ +color: #F8F8F8;\ +background-color: #A41300\ +}\ +.ace-kr-theme .ace_support {\ +color: #9FC28A\ +}\ +.ace-kr-theme .ace_support.ace_constant {\ +color: #C27E66\ +}\ +.ace-kr-theme .ace_fold {\ +background-color: #949C8B;\ +border-color: #FCFFE0\ +}\ +.ace-kr-theme .ace_support.ace_function {\ +color: #85873A\ +}\ +.ace-kr-theme .ace_storage {\ +color: #FFEE80\ +}\ +.ace-kr-theme .ace_string {\ +color: rgba(164, 161, 181, 0.8)\ +}\ +.ace-kr-theme .ace_string.ace_regexp {\ +color: rgba(125, 255, 192, 0.65)\ +}\ +.ace-kr-theme .ace_comment {\ +font-style: italic;\ +color: #706D5B\ +}\ +.ace-kr-theme .ace_variable {\ +color: #D1A796\ +}\ +.ace-kr-theme .ace_list,\ +.ace-kr-theme .ace_markup.ace_list {\ +background-color: #0F0040\ +}\ +.ace-kr-theme .ace_variable.ace_language {\ +color: #FF80E1\ +}\ +.ace-kr-theme .ace_meta.ace_tag {\ +color: #BABD9C\ +}\ +.ace-kr-theme .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-kuroir.js b/htdocs/includes/ace/theme-kuroir.js new file mode 100644 index 00000000000..30e0a8bb386 --- /dev/null +++ b/htdocs/includes/ace/theme-kuroir.js @@ -0,0 +1,61 @@ +ace.define("ace/theme/kuroir",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-kuroir"; +exports.cssText = "\ +.ace-kuroir .ace_gutter {\ +background: #e8e8e8;\ +color: #333;\ +}\ +.ace-kuroir .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-kuroir {\ +background-color: #E8E9E8;\ +color: #363636;\ +}\ +.ace-kuroir .ace_cursor {\ +color: #202020;\ +}\ +.ace-kuroir .ace_marker-layer .ace_selection {\ +background: rgba(245, 170, 0, 0.57);\ +}\ +.ace-kuroir.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #E8E9E8;\ +}\ +.ace-kuroir .ace_marker-layer .ace_step {\ +background: rgb(198, 219, 174);\ +}\ +.ace-kuroir .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(0, 0, 0, 0.29);\ +}\ +.ace-kuroir .ace_marker-layer .ace_active-line {\ +background: rgba(203, 220, 47, 0.22);\ +}\ +.ace-kuroir .ace_gutter-active-line {\ +background-color: rgba(203, 220, 47, 0.22);\ +}\ +.ace-kuroir .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(245, 170, 0, 0.57);\ +}\ +.ace-kuroir .ace_invisible {\ +color: #BFBFBF\ +}\ +.ace-kuroir .ace_fold {\ +border-color: #363636;\ +}\ +.ace-kuroir .ace_constant{color:#CD6839;}.ace-kuroir .ace_constant.ace_numeric{color:#9A5925;}.ace-kuroir .ace_support{color:#104E8B;}.ace-kuroir .ace_support.ace_function{color:#005273;}.ace-kuroir .ace_support.ace_constant{color:#CF6A4C;}.ace-kuroir .ace_storage{color:#A52A2A;}.ace-kuroir .ace_invalid.ace_illegal{color:#FD1224;\ +background-color:rgba(255, 6, 0, 0.15);}.ace-kuroir .ace_invalid.ace_deprecated{text-decoration:underline;\ +font-style:italic;\ +color:#FD1732;\ +background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00;\ +background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91);\ +background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D;\ +background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-merbivore.js b/htdocs/includes/ace/theme-merbivore.js new file mode 100644 index 00000000000..fc0a72f1ccd --- /dev/null +++ b/htdocs/includes/ace/theme-merbivore.js @@ -0,0 +1,95 @@ +ace.define("ace/theme/merbivore",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-merbivore"; +exports.cssText = ".ace-merbivore .ace_gutter {\ +background: #202020;\ +color: #E6E1DC\ +}\ +.ace-merbivore .ace_print-margin {\ +width: 1px;\ +background: #555651\ +}\ +.ace-merbivore {\ +background-color: #161616;\ +color: #E6E1DC\ +}\ +.ace-merbivore .ace_cursor {\ +color: #FFFFFF\ +}\ +.ace-merbivore .ace_marker-layer .ace_selection {\ +background: #454545\ +}\ +.ace-merbivore.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #161616;\ +}\ +.ace-merbivore .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-merbivore .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #404040\ +}\ +.ace-merbivore .ace_marker-layer .ace_active-line {\ +background: #333435\ +}\ +.ace-merbivore .ace_gutter-active-line {\ +background-color: #333435\ +}\ +.ace-merbivore .ace_marker-layer .ace_selected-word {\ +border: 1px solid #454545\ +}\ +.ace-merbivore .ace_invisible {\ +color: #404040\ +}\ +.ace-merbivore .ace_entity.ace_name.ace_tag,\ +.ace-merbivore .ace_keyword,\ +.ace-merbivore .ace_meta,\ +.ace-merbivore .ace_meta.ace_tag,\ +.ace-merbivore .ace_storage,\ +.ace-merbivore .ace_support.ace_function {\ +color: #FC6F09\ +}\ +.ace-merbivore .ace_constant,\ +.ace-merbivore .ace_constant.ace_character,\ +.ace-merbivore .ace_constant.ace_character.ace_escape,\ +.ace-merbivore .ace_constant.ace_other,\ +.ace-merbivore .ace_support.ace_type {\ +color: #1EDAFB\ +}\ +.ace-merbivore .ace_constant.ace_character.ace_escape {\ +color: #519F50\ +}\ +.ace-merbivore .ace_constant.ace_language {\ +color: #FDC251\ +}\ +.ace-merbivore .ace_constant.ace_library,\ +.ace-merbivore .ace_string,\ +.ace-merbivore .ace_support.ace_constant {\ +color: #8DFF0A\ +}\ +.ace-merbivore .ace_constant.ace_numeric {\ +color: #58C554\ +}\ +.ace-merbivore .ace_invalid {\ +color: #FFFFFF;\ +background-color: #990000\ +}\ +.ace-merbivore .ace_fold {\ +background-color: #FC6F09;\ +border-color: #E6E1DC\ +}\ +.ace-merbivore .ace_comment {\ +font-style: italic;\ +color: #AD2EA4\ +}\ +.ace-merbivore .ace_entity.ace_other.ace_attribute-name {\ +color: #FFFF89\ +}\ +.ace-merbivore .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQFxf3ZXB1df0PAAdsAmERTkEHAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-merbivore_soft.js b/htdocs/includes/ace/theme-merbivore_soft.js new file mode 100644 index 00000000000..eff24646514 --- /dev/null +++ b/htdocs/includes/ace/theme-merbivore_soft.js @@ -0,0 +1,96 @@ +ace.define("ace/theme/merbivore_soft",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-merbivore-soft"; +exports.cssText = ".ace-merbivore-soft .ace_gutter {\ +background: #262424;\ +color: #E6E1DC\ +}\ +.ace-merbivore-soft .ace_print-margin {\ +width: 1px;\ +background: #262424\ +}\ +.ace-merbivore-soft {\ +background-color: #1C1C1C;\ +color: #E6E1DC\ +}\ +.ace-merbivore-soft .ace_cursor {\ +color: #FFFFFF\ +}\ +.ace-merbivore-soft .ace_marker-layer .ace_selection {\ +background: #494949\ +}\ +.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #1C1C1C;\ +}\ +.ace-merbivore-soft .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-merbivore-soft .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #404040\ +}\ +.ace-merbivore-soft .ace_marker-layer .ace_active-line {\ +background: #333435\ +}\ +.ace-merbivore-soft .ace_gutter-active-line {\ +background-color: #333435\ +}\ +.ace-merbivore-soft .ace_marker-layer .ace_selected-word {\ +border: 1px solid #494949\ +}\ +.ace-merbivore-soft .ace_invisible {\ +color: #404040\ +}\ +.ace-merbivore-soft .ace_entity.ace_name.ace_tag,\ +.ace-merbivore-soft .ace_keyword,\ +.ace-merbivore-soft .ace_meta,\ +.ace-merbivore-soft .ace_meta.ace_tag,\ +.ace-merbivore-soft .ace_storage {\ +color: #FC803A\ +}\ +.ace-merbivore-soft .ace_constant,\ +.ace-merbivore-soft .ace_constant.ace_character,\ +.ace-merbivore-soft .ace_constant.ace_character.ace_escape,\ +.ace-merbivore-soft .ace_constant.ace_other,\ +.ace-merbivore-soft .ace_support.ace_type {\ +color: #68C1D8\ +}\ +.ace-merbivore-soft .ace_constant.ace_character.ace_escape {\ +color: #B3E5B4\ +}\ +.ace-merbivore-soft .ace_constant.ace_language {\ +color: #E1C582\ +}\ +.ace-merbivore-soft .ace_constant.ace_library,\ +.ace-merbivore-soft .ace_string,\ +.ace-merbivore-soft .ace_support.ace_constant {\ +color: #8EC65F\ +}\ +.ace-merbivore-soft .ace_constant.ace_numeric {\ +color: #7FC578\ +}\ +.ace-merbivore-soft .ace_invalid,\ +.ace-merbivore-soft .ace_invalid.ace_deprecated {\ +color: #FFFFFF;\ +background-color: #FE3838\ +}\ +.ace-merbivore-soft .ace_fold {\ +background-color: #FC803A;\ +border-color: #E6E1DC\ +}\ +.ace-merbivore-soft .ace_comment,\ +.ace-merbivore-soft .ace_meta {\ +font-style: italic;\ +color: #AC4BB8\ +}\ +.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {\ +color: #EAF1A3\ +}\ +.ace-merbivore-soft .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkpLyZfD09PwPAAfYAnaStpHRAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-mono_industrial.js b/htdocs/includes/ace/theme-mono_industrial.js new file mode 100644 index 00000000000..0ece0309cb4 --- /dev/null +++ b/htdocs/includes/ace/theme-mono_industrial.js @@ -0,0 +1,107 @@ +ace.define("ace/theme/mono_industrial",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-mono-industrial"; +exports.cssText = ".ace-mono-industrial .ace_gutter {\ +background: #1d2521;\ +color: #C5C9C9\ +}\ +.ace-mono-industrial .ace_print-margin {\ +width: 1px;\ +background: #555651\ +}\ +.ace-mono-industrial {\ +background-color: #222C28;\ +color: #FFFFFF\ +}\ +.ace-mono-industrial .ace_cursor {\ +color: #FFFFFF\ +}\ +.ace-mono-industrial .ace_marker-layer .ace_selection {\ +background: rgba(145, 153, 148, 0.40)\ +}\ +.ace-mono-industrial.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #222C28;\ +}\ +.ace-mono-industrial .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-mono-industrial .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(102, 108, 104, 0.50)\ +}\ +.ace-mono-industrial .ace_marker-layer .ace_active-line {\ +background: rgba(12, 13, 12, 0.25)\ +}\ +.ace-mono-industrial .ace_gutter-active-line {\ +background-color: rgba(12, 13, 12, 0.25)\ +}\ +.ace-mono-industrial .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(145, 153, 148, 0.40)\ +}\ +.ace-mono-industrial .ace_invisible {\ +color: rgba(102, 108, 104, 0.50)\ +}\ +.ace-mono-industrial .ace_string {\ +background-color: #151C19;\ +color: #FFFFFF\ +}\ +.ace-mono-industrial .ace_keyword,\ +.ace-mono-industrial .ace_meta {\ +color: #A39E64\ +}\ +.ace-mono-industrial .ace_constant,\ +.ace-mono-industrial .ace_constant.ace_character,\ +.ace-mono-industrial .ace_constant.ace_character.ace_escape,\ +.ace-mono-industrial .ace_constant.ace_numeric,\ +.ace-mono-industrial .ace_constant.ace_other {\ +color: #E98800\ +}\ +.ace-mono-industrial .ace_entity.ace_name.ace_function,\ +.ace-mono-industrial .ace_keyword.ace_operator,\ +.ace-mono-industrial .ace_variable {\ +color: #A8B3AB\ +}\ +.ace-mono-industrial .ace_invalid {\ +color: #FFFFFF;\ +background-color: rgba(153, 0, 0, 0.68)\ +}\ +.ace-mono-industrial .ace_support.ace_constant {\ +color: #C87500\ +}\ +.ace-mono-industrial .ace_fold {\ +background-color: #A8B3AB;\ +border-color: #FFFFFF\ +}\ +.ace-mono-industrial .ace_support.ace_function {\ +color: #588E60\ +}\ +.ace-mono-industrial .ace_entity.ace_name,\ +.ace-mono-industrial .ace_support.ace_class,\ +.ace-mono-industrial .ace_support.ace_type {\ +color: #5778B6\ +}\ +.ace-mono-industrial .ace_storage {\ +color: #C23B00\ +}\ +.ace-mono-industrial .ace_variable.ace_language,\ +.ace-mono-industrial .ace_variable.ace_parameter {\ +color: #648BD2\ +}\ +.ace-mono-industrial .ace_comment {\ +color: #666C68;\ +background-color: #151C19\ +}\ +.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {\ +color: #909993\ +}\ +.ace-mono-industrial .ace_entity.ace_name.ace_tag {\ +color: #A65EFF\ +}\ +.ace-mono-industrial .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-monokai.js b/htdocs/includes/ace/theme-monokai.js new file mode 100644 index 00000000000..322c2fa88d8 --- /dev/null +++ b/htdocs/includes/ace/theme-monokai.js @@ -0,0 +1,105 @@ +ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-monokai"; +exports.cssText = ".ace-monokai .ace_gutter {\ +background: #2F3129;\ +color: #8F908A\ +}\ +.ace-monokai .ace_print-margin {\ +width: 1px;\ +background: #555651\ +}\ +.ace-monokai {\ +background-color: #272822;\ +color: #F8F8F2\ +}\ +.ace-monokai .ace_cursor {\ +color: #F8F8F0\ +}\ +.ace-monokai .ace_marker-layer .ace_selection {\ +background: #49483E\ +}\ +.ace-monokai.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #272822;\ +}\ +.ace-monokai .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-monokai .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #49483E\ +}\ +.ace-monokai .ace_marker-layer .ace_active-line {\ +background: #202020\ +}\ +.ace-monokai .ace_gutter-active-line {\ +background-color: #272727\ +}\ +.ace-monokai .ace_marker-layer .ace_selected-word {\ +border: 1px solid #49483E\ +}\ +.ace-monokai .ace_invisible {\ +color: #52524d\ +}\ +.ace-monokai .ace_entity.ace_name.ace_tag,\ +.ace-monokai .ace_keyword,\ +.ace-monokai .ace_meta.ace_tag,\ +.ace-monokai .ace_storage {\ +color: #F92672\ +}\ +.ace-monokai .ace_punctuation,\ +.ace-monokai .ace_punctuation.ace_tag {\ +color: #fff\ +}\ +.ace-monokai .ace_constant.ace_character,\ +.ace-monokai .ace_constant.ace_language,\ +.ace-monokai .ace_constant.ace_numeric,\ +.ace-monokai .ace_constant.ace_other {\ +color: #AE81FF\ +}\ +.ace-monokai .ace_invalid {\ +color: #F8F8F0;\ +background-color: #F92672\ +}\ +.ace-monokai .ace_invalid.ace_deprecated {\ +color: #F8F8F0;\ +background-color: #AE81FF\ +}\ +.ace-monokai .ace_support.ace_constant,\ +.ace-monokai .ace_support.ace_function {\ +color: #66D9EF\ +}\ +.ace-monokai .ace_fold {\ +background-color: #A6E22E;\ +border-color: #F8F8F2\ +}\ +.ace-monokai .ace_storage.ace_type,\ +.ace-monokai .ace_support.ace_class,\ +.ace-monokai .ace_support.ace_type {\ +font-style: italic;\ +color: #66D9EF\ +}\ +.ace-monokai .ace_entity.ace_name.ace_function,\ +.ace-monokai .ace_entity.ace_other,\ +.ace-monokai .ace_entity.ace_other.ace_attribute-name,\ +.ace-monokai .ace_variable {\ +color: #A6E22E\ +}\ +.ace-monokai .ace_variable.ace_parameter {\ +font-style: italic;\ +color: #FD971F\ +}\ +.ace-monokai .ace_string {\ +color: #E6DB74\ +}\ +.ace-monokai .ace_comment {\ +color: #75715E\ +}\ +.ace-monokai .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-pastel_on_dark.js b/htdocs/includes/ace/theme-pastel_on_dark.js new file mode 100644 index 00000000000..2631ae00353 --- /dev/null +++ b/htdocs/includes/ace/theme-pastel_on_dark.js @@ -0,0 +1,108 @@ +ace.define("ace/theme/pastel_on_dark",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-pastel-on-dark"; +exports.cssText = ".ace-pastel-on-dark .ace_gutter {\ +background: #353030;\ +color: #8F938F\ +}\ +.ace-pastel-on-dark .ace_print-margin {\ +width: 1px;\ +background: #353030\ +}\ +.ace-pastel-on-dark {\ +background-color: #2C2828;\ +color: #8F938F\ +}\ +.ace-pastel-on-dark .ace_cursor {\ +color: #A7A7A7\ +}\ +.ace-pastel-on-dark .ace_marker-layer .ace_selection {\ +background: rgba(221, 240, 255, 0.20)\ +}\ +.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #2C2828;\ +}\ +.ace-pastel-on-dark .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-pastel-on-dark .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(255, 255, 255, 0.25)\ +}\ +.ace-pastel-on-dark .ace_marker-layer .ace_active-line {\ +background: rgba(255, 255, 255, 0.031)\ +}\ +.ace-pastel-on-dark .ace_gutter-active-line {\ +background-color: rgba(255, 255, 255, 0.031)\ +}\ +.ace-pastel-on-dark .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(221, 240, 255, 0.20)\ +}\ +.ace-pastel-on-dark .ace_invisible {\ +color: rgba(255, 255, 255, 0.25)\ +}\ +.ace-pastel-on-dark .ace_keyword,\ +.ace-pastel-on-dark .ace_meta {\ +color: #757aD8\ +}\ +.ace-pastel-on-dark .ace_constant,\ +.ace-pastel-on-dark .ace_constant.ace_character,\ +.ace-pastel-on-dark .ace_constant.ace_character.ace_escape,\ +.ace-pastel-on-dark .ace_constant.ace_other {\ +color: #4FB7C5\ +}\ +.ace-pastel-on-dark .ace_keyword.ace_operator {\ +color: #797878\ +}\ +.ace-pastel-on-dark .ace_constant.ace_character {\ +color: #AFA472\ +}\ +.ace-pastel-on-dark .ace_constant.ace_language {\ +color: #DE8E30\ +}\ +.ace-pastel-on-dark .ace_constant.ace_numeric {\ +color: #CCCCCC\ +}\ +.ace-pastel-on-dark .ace_invalid,\ +.ace-pastel-on-dark .ace_invalid.ace_illegal {\ +color: #F8F8F8;\ +background-color: rgba(86, 45, 86, 0.75)\ +}\ +.ace-pastel-on-dark .ace_invalid.ace_deprecated {\ +text-decoration: underline;\ +font-style: italic;\ +color: #D2A8A1\ +}\ +.ace-pastel-on-dark .ace_fold {\ +background-color: #757aD8;\ +border-color: #8F938F\ +}\ +.ace-pastel-on-dark .ace_support.ace_function {\ +color: #AEB2F8\ +}\ +.ace-pastel-on-dark .ace_string {\ +color: #66A968\ +}\ +.ace-pastel-on-dark .ace_string.ace_regexp {\ +color: #E9C062\ +}\ +.ace-pastel-on-dark .ace_comment {\ +color: #A6C6FF\ +}\ +.ace-pastel-on-dark .ace_variable {\ +color: #BEBF55\ +}\ +.ace-pastel-on-dark .ace_variable.ace_language {\ +color: #C1C144\ +}\ +.ace-pastel-on-dark .ace_xml-pe {\ +color: #494949\ +}\ +.ace-pastel-on-dark .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYIiPj/8PAARgAh2NTMh8AAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-solarized_dark.js b/htdocs/includes/ace/theme-solarized_dark.js new file mode 100644 index 00000000000..d1acdb46add --- /dev/null +++ b/htdocs/includes/ace/theme-solarized_dark.js @@ -0,0 +1,88 @@ +ace.define("ace/theme/solarized_dark",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-solarized-dark"; +exports.cssText = ".ace-solarized-dark .ace_gutter {\ +background: #01313f;\ +color: #d0edf7\ +}\ +.ace-solarized-dark .ace_print-margin {\ +width: 1px;\ +background: #33555E\ +}\ +.ace-solarized-dark {\ +background-color: #002B36;\ +color: #93A1A1\ +}\ +.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,\ +.ace-solarized-dark .ace_storage {\ +color: #93A1A1\ +}\ +.ace-solarized-dark .ace_cursor,\ +.ace-solarized-dark .ace_string.ace_regexp {\ +color: #D30102\ +}\ +.ace-solarized-dark .ace_marker-layer .ace_active-line,\ +.ace-solarized-dark .ace_marker-layer .ace_selection {\ +background: rgba(255, 255, 255, 0.1)\ +}\ +.ace-solarized-dark.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #002B36;\ +}\ +.ace-solarized-dark .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-solarized-dark .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(147, 161, 161, 0.50)\ +}\ +.ace-solarized-dark .ace_gutter-active-line {\ +background-color: #0d3440\ +}\ +.ace-solarized-dark .ace_marker-layer .ace_selected-word {\ +border: 1px solid #073642\ +}\ +.ace-solarized-dark .ace_invisible {\ +color: rgba(147, 161, 161, 0.50)\ +}\ +.ace-solarized-dark .ace_keyword,\ +.ace-solarized-dark .ace_meta,\ +.ace-solarized-dark .ace_support.ace_class,\ +.ace-solarized-dark .ace_support.ace_type {\ +color: #859900\ +}\ +.ace-solarized-dark .ace_constant.ace_character,\ +.ace-solarized-dark .ace_constant.ace_other {\ +color: #CB4B16\ +}\ +.ace-solarized-dark .ace_constant.ace_language {\ +color: #B58900\ +}\ +.ace-solarized-dark .ace_constant.ace_numeric {\ +color: #D33682\ +}\ +.ace-solarized-dark .ace_fold {\ +background-color: #268BD2;\ +border-color: #93A1A1\ +}\ +.ace-solarized-dark .ace_entity.ace_name.ace_function,\ +.ace-solarized-dark .ace_entity.ace_name.ace_tag,\ +.ace-solarized-dark .ace_support.ace_function,\ +.ace-solarized-dark .ace_variable,\ +.ace-solarized-dark .ace_variable.ace_language {\ +color: #268BD2\ +}\ +.ace-solarized-dark .ace_string {\ +color: #2AA198\ +}\ +.ace-solarized-dark .ace_comment {\ +font-style: italic;\ +color: #657B83\ +}\ +.ace-solarized-dark .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-solarized_light.js b/htdocs/includes/ace/theme-solarized_light.js new file mode 100644 index 00000000000..f0c078ae5d7 --- /dev/null +++ b/htdocs/includes/ace/theme-solarized_light.js @@ -0,0 +1,91 @@ +ace.define("ace/theme/solarized_light",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-solarized-light"; +exports.cssText = ".ace-solarized-light .ace_gutter {\ +background: #fbf1d3;\ +color: #333\ +}\ +.ace-solarized-light .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8\ +}\ +.ace-solarized-light {\ +background-color: #FDF6E3;\ +color: #586E75\ +}\ +.ace-solarized-light .ace_cursor {\ +color: #000000\ +}\ +.ace-solarized-light .ace_marker-layer .ace_selection {\ +background: rgba(7, 54, 67, 0.09)\ +}\ +.ace-solarized-light.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #FDF6E3;\ +}\ +.ace-solarized-light .ace_marker-layer .ace_step {\ +background: rgb(255, 255, 0)\ +}\ +.ace-solarized-light .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(147, 161, 161, 0.50)\ +}\ +.ace-solarized-light .ace_marker-layer .ace_active-line {\ +background: #EEE8D5\ +}\ +.ace-solarized-light .ace_gutter-active-line {\ +background-color : #EDE5C1\ +}\ +.ace-solarized-light .ace_marker-layer .ace_selected-word {\ +border: 1px solid #073642\ +}\ +.ace-solarized-light .ace_invisible {\ +color: rgba(147, 161, 161, 0.50)\ +}\ +.ace-solarized-light .ace_keyword,\ +.ace-solarized-light .ace_meta,\ +.ace-solarized-light .ace_support.ace_class,\ +.ace-solarized-light .ace_support.ace_type {\ +color: #859900\ +}\ +.ace-solarized-light .ace_constant.ace_character,\ +.ace-solarized-light .ace_constant.ace_other {\ +color: #CB4B16\ +}\ +.ace-solarized-light .ace_constant.ace_language {\ +color: #B58900\ +}\ +.ace-solarized-light .ace_constant.ace_numeric {\ +color: #D33682\ +}\ +.ace-solarized-light .ace_fold {\ +background-color: #268BD2;\ +border-color: #586E75\ +}\ +.ace-solarized-light .ace_entity.ace_name.ace_function,\ +.ace-solarized-light .ace_entity.ace_name.ace_tag,\ +.ace-solarized-light .ace_support.ace_function,\ +.ace-solarized-light .ace_variable,\ +.ace-solarized-light .ace_variable.ace_language {\ +color: #268BD2\ +}\ +.ace-solarized-light .ace_storage {\ +color: #073642\ +}\ +.ace-solarized-light .ace_string {\ +color: #2AA198\ +}\ +.ace-solarized-light .ace_string.ace_regexp {\ +color: #D30102\ +}\ +.ace-solarized-light .ace_comment,\ +.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {\ +color: #93A1A1\ +}\ +.ace-solarized-light .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-sqlserver.js b/htdocs/includes/ace/theme-sqlserver.js new file mode 100644 index 00000000000..91f34f6c40a --- /dev/null +++ b/htdocs/includes/ace/theme-sqlserver.js @@ -0,0 +1,138 @@ +ace.define("ace/theme/sqlserver",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-sqlserver"; +exports.cssText = ".ace-sqlserver .ace_gutter {\ +background: #ebebeb;\ +color: #333;\ +overflow: hidden;\ +}\ +.ace-sqlserver .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-sqlserver {\ +background-color: #FFFFFF;\ +color: black;\ +}\ +.ace-sqlserver .ace_identifier {\ +color: black;\ +}\ +.ace-sqlserver .ace_keyword {\ +color: #0000FF;\ +}\ +.ace-sqlserver .ace_numeric {\ +color: black;\ +}\ +.ace-sqlserver .ace_storage {\ +color: #11B7BE;\ +}\ +.ace-sqlserver .ace_keyword.ace_operator,\ +.ace-sqlserver .ace_lparen,\ +.ace-sqlserver .ace_rparen,\ +.ace-sqlserver .ace_punctuation {\ +color: #808080;\ +}\ +.ace-sqlserver .ace_set.ace_statement {\ +color: #0000FF;\ +text-decoration: underline;\ +}\ +.ace-sqlserver .ace_cursor {\ +color: black;\ +}\ +.ace-sqlserver .ace_invisible {\ +color: rgb(191, 191, 191);\ +}\ +.ace-sqlserver .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-sqlserver .ace_constant.ace_language {\ +color: #979797;\ +}\ +.ace-sqlserver .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-sqlserver .ace_invalid {\ +background-color: rgb(153, 0, 0);\ +color: white;\ +}\ +.ace-sqlserver .ace_support.ace_function {\ +color: #FF00FF;\ +}\ +.ace-sqlserver .ace_support.ace_constant {\ +color: rgb(6, 150, 14);\ +}\ +.ace-sqlserver .ace_class {\ +color: #008080;\ +}\ +.ace-sqlserver .ace_support.ace_other {\ +color: #6D79DE;\ +}\ +.ace-sqlserver .ace_variable.ace_parameter {\ +font-style: italic;\ +color: #FD971F;\ +}\ +.ace-sqlserver .ace_comment {\ +color: #008000;\ +}\ +.ace-sqlserver .ace_constant.ace_numeric {\ +color: black;\ +}\ +.ace-sqlserver .ace_variable {\ +color: rgb(49, 132, 149);\ +}\ +.ace-sqlserver .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-sqlserver .ace_support.ace_storedprocedure {\ +color: #800000;\ +}\ +.ace-sqlserver .ace_heading {\ +color: rgb(12, 7, 255);\ +}\ +.ace-sqlserver .ace_list {\ +color: rgb(185, 6, 144);\ +}\ +.ace-sqlserver .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-sqlserver .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-sqlserver .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-sqlserver .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-sqlserver .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.07);\ +}\ +.ace-sqlserver .ace_gutter-active-line {\ +background-color: #dcdcdc;\ +}\ +.ace-sqlserver .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-sqlserver .ace_meta.ace_tag {\ +color: #0000FF;\ +}\ +.ace-sqlserver .ace_string.ace_regex {\ +color: #FF0000;\ +}\ +.ace-sqlserver .ace_string {\ +color: #FF0000;\ +}\ +.ace-sqlserver .ace_entity.ace_other.ace_attribute-name {\ +color: #994409;\ +}\ +.ace-sqlserver .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-terminal.js b/htdocs/includes/ace/theme-terminal.js new file mode 100644 index 00000000000..def9e69b77f --- /dev/null +++ b/htdocs/includes/ace/theme-terminal.js @@ -0,0 +1,114 @@ +ace.define("ace/theme/terminal",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-terminal-theme"; +exports.cssText = ".ace-terminal-theme .ace_gutter {\ +background: #1a0005;\ +color: steelblue\ +}\ +.ace-terminal-theme .ace_print-margin {\ +width: 1px;\ +background: #1a1a1a\ +}\ +.ace-terminal-theme {\ +background-color: black;\ +color: #DEDEDE\ +}\ +.ace-terminal-theme .ace_cursor {\ +color: #9F9F9F\ +}\ +.ace-terminal-theme .ace_marker-layer .ace_selection {\ +background: #424242\ +}\ +.ace-terminal-theme.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px black;\ +}\ +.ace-terminal-theme .ace_marker-layer .ace_step {\ +background: rgb(0, 0, 0)\ +}\ +.ace-terminal-theme .ace_marker-layer .ace_bracket {\ +background: #090;\ +}\ +.ace-terminal-theme .ace_marker-layer .ace_bracket-start {\ +background: #090;\ +}\ +.ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #900\ +}\ +.ace-terminal-theme .ace_marker-layer .ace_active-line {\ +background: #2A2A2A\ +}\ +.ace-terminal-theme .ace_gutter-active-line {\ +background-color: #2A112A\ +}\ +.ace-terminal-theme .ace_marker-layer .ace_selected-word {\ +border: 1px solid #424242\ +}\ +.ace-terminal-theme .ace_invisible {\ +color: #343434\ +}\ +.ace-terminal-theme .ace_keyword,\ +.ace-terminal-theme .ace_meta,\ +.ace-terminal-theme .ace_storage,\ +.ace-terminal-theme .ace_storage.ace_type,\ +.ace-terminal-theme .ace_support.ace_type {\ +color: tomato\ +}\ +.ace-terminal-theme .ace_keyword.ace_operator {\ +color: deeppink\ +}\ +.ace-terminal-theme .ace_constant.ace_character,\ +.ace-terminal-theme .ace_constant.ace_language,\ +.ace-terminal-theme .ace_constant.ace_numeric,\ +.ace-terminal-theme .ace_keyword.ace_other.ace_unit,\ +.ace-terminal-theme .ace_support.ace_constant,\ +.ace-terminal-theme .ace_variable.ace_parameter {\ +color: #E78C45\ +}\ +.ace-terminal-theme .ace_constant.ace_other {\ +color: gold\ +}\ +.ace-terminal-theme .ace_invalid {\ +color: yellow;\ +background-color: red\ +}\ +.ace-terminal-theme .ace_invalid.ace_deprecated {\ +color: #CED2CF;\ +background-color: #B798BF\ +}\ +.ace-terminal-theme .ace_fold {\ +background-color: #7AA6DA;\ +border-color: #DEDEDE\ +}\ +.ace-terminal-theme .ace_entity.ace_name.ace_function,\ +.ace-terminal-theme .ace_support.ace_function,\ +.ace-terminal-theme .ace_variable {\ +color: #7AA6DA\ +}\ +.ace-terminal-theme .ace_support.ace_class,\ +.ace-terminal-theme .ace_support.ace_type {\ +color: #E7C547\ +}\ +.ace-terminal-theme .ace_heading,\ +.ace-terminal-theme .ace_string {\ +color: #B9CA4A\ +}\ +.ace-terminal-theme .ace_entity.ace_name.ace_tag,\ +.ace-terminal-theme .ace_entity.ace_other.ace_attribute-name,\ +.ace-terminal-theme .ace_meta.ace_tag,\ +.ace-terminal-theme .ace_string.ace_regexp,\ +.ace-terminal-theme .ace_variable {\ +color: #D54E53\ +}\ +.ace-terminal-theme .ace_comment {\ +color: orangered\ +}\ +.ace-terminal-theme .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLBWV/8PAAK4AYnhiq+xAAAAAElFTkSuQmCC) right repeat-y;\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-textmate.js b/htdocs/includes/ace/theme-textmate.js new file mode 100644 index 00000000000..0033edae2c6 --- /dev/null +++ b/htdocs/includes/ace/theme-textmate.js @@ -0,0 +1,129 @@ +ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) { +"use strict"; + +exports.isDark = false; +exports.cssClass = "ace-tm"; +exports.cssText = ".ace-tm .ace_gutter {\ +background: #f0f0f0;\ +color: #333;\ +}\ +.ace-tm .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8;\ +}\ +.ace-tm .ace_fold {\ +background-color: #6B72E6;\ +}\ +.ace-tm {\ +background-color: #FFFFFF;\ +color: black;\ +}\ +.ace-tm .ace_cursor {\ +color: black;\ +}\ +.ace-tm .ace_invisible {\ +color: rgb(191, 191, 191);\ +}\ +.ace-tm .ace_storage,\ +.ace-tm .ace_keyword {\ +color: blue;\ +}\ +.ace-tm .ace_constant {\ +color: rgb(197, 6, 11);\ +}\ +.ace-tm .ace_constant.ace_buildin {\ +color: rgb(88, 72, 246);\ +}\ +.ace-tm .ace_constant.ace_language {\ +color: rgb(88, 92, 246);\ +}\ +.ace-tm .ace_constant.ace_library {\ +color: rgb(6, 150, 14);\ +}\ +.ace-tm .ace_invalid {\ +background-color: rgba(255, 0, 0, 0.1);\ +color: red;\ +}\ +.ace-tm .ace_support.ace_function {\ +color: rgb(60, 76, 114);\ +}\ +.ace-tm .ace_support.ace_constant {\ +color: rgb(6, 150, 14);\ +}\ +.ace-tm .ace_support.ace_type,\ +.ace-tm .ace_support.ace_class {\ +color: rgb(109, 121, 222);\ +}\ +.ace-tm .ace_keyword.ace_operator {\ +color: rgb(104, 118, 135);\ +}\ +.ace-tm .ace_string {\ +color: rgb(3, 106, 7);\ +}\ +.ace-tm .ace_comment {\ +color: rgb(76, 136, 107);\ +}\ +.ace-tm .ace_comment.ace_doc {\ +color: rgb(0, 102, 255);\ +}\ +.ace-tm .ace_comment.ace_doc.ace_tag {\ +color: rgb(128, 159, 191);\ +}\ +.ace-tm .ace_constant.ace_numeric {\ +color: rgb(0, 0, 205);\ +}\ +.ace-tm .ace_variable {\ +color: rgb(49, 132, 149);\ +}\ +.ace-tm .ace_xml-pe {\ +color: rgb(104, 104, 91);\ +}\ +.ace-tm .ace_entity.ace_name.ace_function {\ +color: #0000A2;\ +}\ +.ace-tm .ace_heading {\ +color: rgb(12, 7, 255);\ +}\ +.ace-tm .ace_list {\ +color:rgb(185, 6, 144);\ +}\ +.ace-tm .ace_meta.ace_tag {\ +color:rgb(0, 22, 142);\ +}\ +.ace-tm .ace_string.ace_regex {\ +color: rgb(255, 0, 0)\ +}\ +.ace-tm .ace_marker-layer .ace_selection {\ +background: rgb(181, 213, 255);\ +}\ +.ace-tm.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px white;\ +}\ +.ace-tm .ace_marker-layer .ace_step {\ +background: rgb(252, 255, 0);\ +}\ +.ace-tm .ace_marker-layer .ace_stack {\ +background: rgb(164, 229, 101);\ +}\ +.ace-tm .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgb(192, 192, 192);\ +}\ +.ace-tm .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.07);\ +}\ +.ace-tm .ace_gutter-active-line {\ +background-color : #dcdcdc;\ +}\ +.ace-tm .ace_marker-layer .ace_selected-word {\ +background: rgb(250, 250, 255);\ +border: 1px solid rgb(200, 200, 250);\ +}\ +.ace-tm .ace_indent-guide {\ +background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ +}\ +"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-tomorrow.js b/htdocs/includes/ace/theme-tomorrow.js new file mode 100644 index 00000000000..4661be11221 --- /dev/null +++ b/htdocs/includes/ace/theme-tomorrow.js @@ -0,0 +1,108 @@ +ace.define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-tomorrow"; +exports.cssText = ".ace-tomorrow .ace_gutter {\ +background: #f6f6f6;\ +color: #4D4D4C\ +}\ +.ace-tomorrow .ace_print-margin {\ +width: 1px;\ +background: #f6f6f6\ +}\ +.ace-tomorrow {\ +background-color: #FFFFFF;\ +color: #4D4D4C\ +}\ +.ace-tomorrow .ace_cursor {\ +color: #AEAFAD\ +}\ +.ace-tomorrow .ace_marker-layer .ace_selection {\ +background: #D6D6D6\ +}\ +.ace-tomorrow.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #FFFFFF;\ +}\ +.ace-tomorrow .ace_marker-layer .ace_step {\ +background: rgb(255, 255, 0)\ +}\ +.ace-tomorrow .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #D1D1D1\ +}\ +.ace-tomorrow .ace_marker-layer .ace_active-line {\ +background: #EFEFEF\ +}\ +.ace-tomorrow .ace_gutter-active-line {\ +background-color : #dcdcdc\ +}\ +.ace-tomorrow .ace_marker-layer .ace_selected-word {\ +border: 1px solid #D6D6D6\ +}\ +.ace-tomorrow .ace_invisible {\ +color: #D1D1D1\ +}\ +.ace-tomorrow .ace_keyword,\ +.ace-tomorrow .ace_meta,\ +.ace-tomorrow .ace_storage,\ +.ace-tomorrow .ace_storage.ace_type,\ +.ace-tomorrow .ace_support.ace_type {\ +color: #8959A8\ +}\ +.ace-tomorrow .ace_keyword.ace_operator {\ +color: #3E999F\ +}\ +.ace-tomorrow .ace_constant.ace_character,\ +.ace-tomorrow .ace_constant.ace_language,\ +.ace-tomorrow .ace_constant.ace_numeric,\ +.ace-tomorrow .ace_keyword.ace_other.ace_unit,\ +.ace-tomorrow .ace_support.ace_constant,\ +.ace-tomorrow .ace_variable.ace_parameter {\ +color: #F5871F\ +}\ +.ace-tomorrow .ace_constant.ace_other {\ +color: #666969\ +}\ +.ace-tomorrow .ace_invalid {\ +color: #FFFFFF;\ +background-color: #C82829\ +}\ +.ace-tomorrow .ace_invalid.ace_deprecated {\ +color: #FFFFFF;\ +background-color: #8959A8\ +}\ +.ace-tomorrow .ace_fold {\ +background-color: #4271AE;\ +border-color: #4D4D4C\ +}\ +.ace-tomorrow .ace_entity.ace_name.ace_function,\ +.ace-tomorrow .ace_support.ace_function,\ +.ace-tomorrow .ace_variable {\ +color: #4271AE\ +}\ +.ace-tomorrow .ace_support.ace_class,\ +.ace-tomorrow .ace_support.ace_type {\ +color: #C99E00\ +}\ +.ace-tomorrow .ace_heading,\ +.ace-tomorrow .ace_markup.ace_heading,\ +.ace-tomorrow .ace_string {\ +color: #718C00\ +}\ +.ace-tomorrow .ace_entity.ace_name.ace_tag,\ +.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,\ +.ace-tomorrow .ace_meta.ace_tag,\ +.ace-tomorrow .ace_string.ace_regexp,\ +.ace-tomorrow .ace_variable {\ +color: #C82829\ +}\ +.ace-tomorrow .ace_comment {\ +color: #8E908C\ +}\ +.ace-tomorrow .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-tomorrow_night.js b/htdocs/includes/ace/theme-tomorrow_night.js new file mode 100644 index 00000000000..53e1f39a414 --- /dev/null +++ b/htdocs/includes/ace/theme-tomorrow_night.js @@ -0,0 +1,108 @@ +ace.define("ace/theme/tomorrow_night",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-tomorrow-night"; +exports.cssText = ".ace-tomorrow-night .ace_gutter {\ +background: #25282c;\ +color: #C5C8C6\ +}\ +.ace-tomorrow-night .ace_print-margin {\ +width: 1px;\ +background: #25282c\ +}\ +.ace-tomorrow-night {\ +background-color: #1D1F21;\ +color: #C5C8C6\ +}\ +.ace-tomorrow-night .ace_cursor {\ +color: #AEAFAD\ +}\ +.ace-tomorrow-night .ace_marker-layer .ace_selection {\ +background: #373B41\ +}\ +.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #1D1F21;\ +}\ +.ace-tomorrow-night .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-tomorrow-night .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #4B4E55\ +}\ +.ace-tomorrow-night .ace_marker-layer .ace_active-line {\ +background: #282A2E\ +}\ +.ace-tomorrow-night .ace_gutter-active-line {\ +background-color: #282A2E\ +}\ +.ace-tomorrow-night .ace_marker-layer .ace_selected-word {\ +border: 1px solid #373B41\ +}\ +.ace-tomorrow-night .ace_invisible {\ +color: #4B4E55\ +}\ +.ace-tomorrow-night .ace_keyword,\ +.ace-tomorrow-night .ace_meta,\ +.ace-tomorrow-night .ace_storage,\ +.ace-tomorrow-night .ace_storage.ace_type,\ +.ace-tomorrow-night .ace_support.ace_type {\ +color: #B294BB\ +}\ +.ace-tomorrow-night .ace_keyword.ace_operator {\ +color: #8ABEB7\ +}\ +.ace-tomorrow-night .ace_constant.ace_character,\ +.ace-tomorrow-night .ace_constant.ace_language,\ +.ace-tomorrow-night .ace_constant.ace_numeric,\ +.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,\ +.ace-tomorrow-night .ace_support.ace_constant,\ +.ace-tomorrow-night .ace_variable.ace_parameter {\ +color: #DE935F\ +}\ +.ace-tomorrow-night .ace_constant.ace_other {\ +color: #CED1CF\ +}\ +.ace-tomorrow-night .ace_invalid {\ +color: #CED2CF;\ +background-color: #DF5F5F\ +}\ +.ace-tomorrow-night .ace_invalid.ace_deprecated {\ +color: #CED2CF;\ +background-color: #B798BF\ +}\ +.ace-tomorrow-night .ace_fold {\ +background-color: #81A2BE;\ +border-color: #C5C8C6\ +}\ +.ace-tomorrow-night .ace_entity.ace_name.ace_function,\ +.ace-tomorrow-night .ace_support.ace_function,\ +.ace-tomorrow-night .ace_variable {\ +color: #81A2BE\ +}\ +.ace-tomorrow-night .ace_support.ace_class,\ +.ace-tomorrow-night .ace_support.ace_type {\ +color: #F0C674\ +}\ +.ace-tomorrow-night .ace_heading,\ +.ace-tomorrow-night .ace_markup.ace_heading,\ +.ace-tomorrow-night .ace_string {\ +color: #B5BD68\ +}\ +.ace-tomorrow-night .ace_entity.ace_name.ace_tag,\ +.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,\ +.ace-tomorrow-night .ace_meta.ace_tag,\ +.ace-tomorrow-night .ace_string.ace_regexp,\ +.ace-tomorrow-night .ace_variable {\ +color: #CC6666\ +}\ +.ace-tomorrow-night .ace_comment {\ +color: #969896\ +}\ +.ace-tomorrow-night .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-tomorrow_night_blue.js b/htdocs/includes/ace/theme-tomorrow_night_blue.js new file mode 100644 index 00000000000..956e221ec9b --- /dev/null +++ b/htdocs/includes/ace/theme-tomorrow_night_blue.js @@ -0,0 +1,106 @@ +ace.define("ace/theme/tomorrow_night_blue",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-tomorrow-night-blue"; +exports.cssText = ".ace-tomorrow-night-blue .ace_gutter {\ +background: #00204b;\ +color: #7388b5\ +}\ +.ace-tomorrow-night-blue .ace_print-margin {\ +width: 1px;\ +background: #00204b\ +}\ +.ace-tomorrow-night-blue {\ +background-color: #002451;\ +color: #FFFFFF\ +}\ +.ace-tomorrow-night-blue .ace_constant.ace_other,\ +.ace-tomorrow-night-blue .ace_cursor {\ +color: #FFFFFF\ +}\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\ +background: #003F8E\ +}\ +.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #002451;\ +}\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\ +background: rgb(127, 111, 19)\ +}\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #404F7D\ +}\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line {\ +background: #00346E\ +}\ +.ace-tomorrow-night-blue .ace_gutter-active-line {\ +background-color: #022040\ +}\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_selected-word {\ +border: 1px solid #003F8E\ +}\ +.ace-tomorrow-night-blue .ace_invisible {\ +color: #404F7D\ +}\ +.ace-tomorrow-night-blue .ace_keyword,\ +.ace-tomorrow-night-blue .ace_meta,\ +.ace-tomorrow-night-blue .ace_storage,\ +.ace-tomorrow-night-blue .ace_storage.ace_type,\ +.ace-tomorrow-night-blue .ace_support.ace_type {\ +color: #EBBBFF\ +}\ +.ace-tomorrow-night-blue .ace_keyword.ace_operator {\ +color: #99FFFF\ +}\ +.ace-tomorrow-night-blue .ace_constant.ace_character,\ +.ace-tomorrow-night-blue .ace_constant.ace_language,\ +.ace-tomorrow-night-blue .ace_constant.ace_numeric,\ +.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,\ +.ace-tomorrow-night-blue .ace_support.ace_constant,\ +.ace-tomorrow-night-blue .ace_variable.ace_parameter {\ +color: #FFC58F\ +}\ +.ace-tomorrow-night-blue .ace_invalid {\ +color: #FFFFFF;\ +background-color: #F99DA5\ +}\ +.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {\ +color: #FFFFFF;\ +background-color: #EBBBFF\ +}\ +.ace-tomorrow-night-blue .ace_fold {\ +background-color: #BBDAFF;\ +border-color: #FFFFFF\ +}\ +.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,\ +.ace-tomorrow-night-blue .ace_support.ace_function,\ +.ace-tomorrow-night-blue .ace_variable {\ +color: #BBDAFF\ +}\ +.ace-tomorrow-night-blue .ace_support.ace_class,\ +.ace-tomorrow-night-blue .ace_support.ace_type {\ +color: #FFEEAD\ +}\ +.ace-tomorrow-night-blue .ace_heading,\ +.ace-tomorrow-night-blue .ace_markup.ace_heading,\ +.ace-tomorrow-night-blue .ace_string {\ +color: #D1F1A9\ +}\ +.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,\ +.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,\ +.ace-tomorrow-night-blue .ace_meta.ace_tag,\ +.ace-tomorrow-night-blue .ace_string.ace_regexp,\ +.ace-tomorrow-night-blue .ace_variable {\ +color: #FF9DA4\ +}\ +.ace-tomorrow-night-blue .ace_comment {\ +color: #7285B7\ +}\ +.ace-tomorrow-night-blue .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-tomorrow_night_bright.js b/htdocs/includes/ace/theme-tomorrow_night_bright.js new file mode 100644 index 00000000000..8514a0d6997 --- /dev/null +++ b/htdocs/includes/ace/theme-tomorrow_night_bright.js @@ -0,0 +1,121 @@ +ace.define("ace/theme/tomorrow_night_bright",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-tomorrow-night-bright"; +exports.cssText = ".ace-tomorrow-night-bright .ace_gutter {\ +background: #1a1a1a;\ +color: #DEDEDE\ +}\ +.ace-tomorrow-night-bright .ace_print-margin {\ +width: 1px;\ +background: #1a1a1a\ +}\ +.ace-tomorrow-night-bright {\ +background-color: #000000;\ +color: #DEDEDE\ +}\ +.ace-tomorrow-night-bright .ace_cursor {\ +color: #9F9F9F\ +}\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {\ +background: #424242\ +}\ +.ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #000000;\ +}\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #888888\ +}\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_highlight {\ +border: 1px solid rgb(110, 119, 0);\ +border-bottom: 0;\ +box-shadow: inset 0 -1px rgb(110, 119, 0);\ +margin: -1px 0 0 -1px;\ +background: rgba(255, 235, 0, 0.1)\ +}\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_active-line {\ +background: #2A2A2A\ +}\ +.ace-tomorrow-night-bright .ace_gutter-active-line {\ +background-color: #2A2A2A\ +}\ +.ace-tomorrow-night-bright .ace_stack {\ +background-color: rgb(66, 90, 44)\ +}\ +.ace-tomorrow-night-bright .ace_marker-layer .ace_selected-word {\ +border: 1px solid #888888\ +}\ +.ace-tomorrow-night-bright .ace_invisible {\ +color: #343434\ +}\ +.ace-tomorrow-night-bright .ace_keyword,\ +.ace-tomorrow-night-bright .ace_meta,\ +.ace-tomorrow-night-bright .ace_storage,\ +.ace-tomorrow-night-bright .ace_storage.ace_type,\ +.ace-tomorrow-night-bright .ace_support.ace_type {\ +color: #C397D8\ +}\ +.ace-tomorrow-night-bright .ace_keyword.ace_operator {\ +color: #70C0B1\ +}\ +.ace-tomorrow-night-bright .ace_constant.ace_character,\ +.ace-tomorrow-night-bright .ace_constant.ace_language,\ +.ace-tomorrow-night-bright .ace_constant.ace_numeric,\ +.ace-tomorrow-night-bright .ace_keyword.ace_other.ace_unit,\ +.ace-tomorrow-night-bright .ace_support.ace_constant,\ +.ace-tomorrow-night-bright .ace_variable.ace_parameter {\ +color: #E78C45\ +}\ +.ace-tomorrow-night-bright .ace_constant.ace_other {\ +color: #EEEEEE\ +}\ +.ace-tomorrow-night-bright .ace_invalid {\ +color: #CED2CF;\ +background-color: #DF5F5F\ +}\ +.ace-tomorrow-night-bright .ace_invalid.ace_deprecated {\ +color: #CED2CF;\ +background-color: #B798BF\ +}\ +.ace-tomorrow-night-bright .ace_fold {\ +background-color: #7AA6DA;\ +border-color: #DEDEDE\ +}\ +.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function,\ +.ace-tomorrow-night-bright .ace_support.ace_function,\ +.ace-tomorrow-night-bright .ace_variable {\ +color: #7AA6DA\ +}\ +.ace-tomorrow-night-bright .ace_support.ace_class,\ +.ace-tomorrow-night-bright .ace_support.ace_type {\ +color: #E7C547\ +}\ +.ace-tomorrow-night-bright .ace_heading,\ +.ace-tomorrow-night-bright .ace_markup.ace_heading,\ +.ace-tomorrow-night-bright .ace_string {\ +color: #B9CA4A\ +}\ +.ace-tomorrow-night-bright .ace_entity.ace_name.ace_tag,\ +.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name,\ +.ace-tomorrow-night-bright .ace_meta.ace_tag,\ +.ace-tomorrow-night-bright .ace_string.ace_regexp,\ +.ace-tomorrow-night-bright .ace_variable {\ +color: #D54E53\ +}\ +.ace-tomorrow-night-bright .ace_comment {\ +color: #969896\ +}\ +.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword {\ +color: #C2C280\ +}\ +.ace-tomorrow-night-bright .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-tomorrow_night_eighties.js b/htdocs/includes/ace/theme-tomorrow_night_eighties.js new file mode 100644 index 00000000000..3665e3f7dc7 --- /dev/null +++ b/htdocs/includes/ace/theme-tomorrow_night_eighties.js @@ -0,0 +1,108 @@ +ace.define("ace/theme/tomorrow_night_eighties",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-tomorrow-night-eighties"; +exports.cssText = ".ace-tomorrow-night-eighties .ace_gutter {\ +background: #272727;\ +color: #CCC\ +}\ +.ace-tomorrow-night-eighties .ace_print-margin {\ +width: 1px;\ +background: #272727\ +}\ +.ace-tomorrow-night-eighties {\ +background-color: #2D2D2D;\ +color: #CCCCCC\ +}\ +.ace-tomorrow-night-eighties .ace_constant.ace_other,\ +.ace-tomorrow-night-eighties .ace_cursor {\ +color: #CCCCCC\ +}\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {\ +background: #515151\ +}\ +.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #2D2D2D;\ +}\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #6A6A6A\ +}\ +.ace-tomorrow-night-bright .ace_stack {\ +background: rgb(66, 90, 44)\ +}\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_active-line {\ +background: #393939\ +}\ +.ace-tomorrow-night-eighties .ace_gutter-active-line {\ +background-color: #393939\ +}\ +.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected-word {\ +border: 1px solid #515151\ +}\ +.ace-tomorrow-night-eighties .ace_invisible {\ +color: #6A6A6A\ +}\ +.ace-tomorrow-night-eighties .ace_keyword,\ +.ace-tomorrow-night-eighties .ace_meta,\ +.ace-tomorrow-night-eighties .ace_storage,\ +.ace-tomorrow-night-eighties .ace_storage.ace_type,\ +.ace-tomorrow-night-eighties .ace_support.ace_type {\ +color: #CC99CC\ +}\ +.ace-tomorrow-night-eighties .ace_keyword.ace_operator {\ +color: #66CCCC\ +}\ +.ace-tomorrow-night-eighties .ace_constant.ace_character,\ +.ace-tomorrow-night-eighties .ace_constant.ace_language,\ +.ace-tomorrow-night-eighties .ace_constant.ace_numeric,\ +.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit,\ +.ace-tomorrow-night-eighties .ace_support.ace_constant,\ +.ace-tomorrow-night-eighties .ace_variable.ace_parameter {\ +color: #F99157\ +}\ +.ace-tomorrow-night-eighties .ace_invalid {\ +color: #CDCDCD;\ +background-color: #F2777A\ +}\ +.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {\ +color: #CDCDCD;\ +background-color: #CC99CC\ +}\ +.ace-tomorrow-night-eighties .ace_fold {\ +background-color: #6699CC;\ +border-color: #CCCCCC\ +}\ +.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function,\ +.ace-tomorrow-night-eighties .ace_support.ace_function,\ +.ace-tomorrow-night-eighties .ace_variable {\ +color: #6699CC\ +}\ +.ace-tomorrow-night-eighties .ace_support.ace_class,\ +.ace-tomorrow-night-eighties .ace_support.ace_type {\ +color: #FFCC66\ +}\ +.ace-tomorrow-night-eighties .ace_heading,\ +.ace-tomorrow-night-eighties .ace_markup.ace_heading,\ +.ace-tomorrow-night-eighties .ace_string {\ +color: #99CC99\ +}\ +.ace-tomorrow-night-eighties .ace_comment {\ +color: #999999\ +}\ +.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag,\ +.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name,\ +.ace-tomorrow-night-eighties .ace_meta.ace_tag,\ +.ace-tomorrow-night-eighties .ace_variable {\ +color: #F2777A\ +}\ +.ace-tomorrow-night-eighties .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-twilight.js b/htdocs/includes/ace/theme-twilight.js new file mode 100644 index 00000000000..48ec030981e --- /dev/null +++ b/htdocs/includes/ace/theme-twilight.js @@ -0,0 +1,109 @@ +ace.define("ace/theme/twilight",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-twilight"; +exports.cssText = ".ace-twilight .ace_gutter {\ +background: #232323;\ +color: #E2E2E2\ +}\ +.ace-twilight .ace_print-margin {\ +width: 1px;\ +background: #232323\ +}\ +.ace-twilight {\ +background-color: #141414;\ +color: #F8F8F8\ +}\ +.ace-twilight .ace_cursor {\ +color: #A7A7A7\ +}\ +.ace-twilight .ace_marker-layer .ace_selection {\ +background: rgba(221, 240, 255, 0.20)\ +}\ +.ace-twilight.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #141414;\ +}\ +.ace-twilight .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-twilight .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid rgba(255, 255, 255, 0.25)\ +}\ +.ace-twilight .ace_marker-layer .ace_active-line {\ +background: rgba(255, 255, 255, 0.031)\ +}\ +.ace-twilight .ace_gutter-active-line {\ +background-color: rgba(255, 255, 255, 0.031)\ +}\ +.ace-twilight .ace_marker-layer .ace_selected-word {\ +border: 1px solid rgba(221, 240, 255, 0.20)\ +}\ +.ace-twilight .ace_invisible {\ +color: rgba(255, 255, 255, 0.25)\ +}\ +.ace-twilight .ace_keyword,\ +.ace-twilight .ace_meta {\ +color: #CDA869\ +}\ +.ace-twilight .ace_constant,\ +.ace-twilight .ace_constant.ace_character,\ +.ace-twilight .ace_constant.ace_character.ace_escape,\ +.ace-twilight .ace_constant.ace_other,\ +.ace-twilight .ace_heading,\ +.ace-twilight .ace_markup.ace_heading,\ +.ace-twilight .ace_support.ace_constant {\ +color: #CF6A4C\ +}\ +.ace-twilight .ace_invalid.ace_illegal {\ +color: #F8F8F8;\ +background-color: rgba(86, 45, 86, 0.75)\ +}\ +.ace-twilight .ace_invalid.ace_deprecated {\ +text-decoration: underline;\ +font-style: italic;\ +color: #D2A8A1\ +}\ +.ace-twilight .ace_support {\ +color: #9B859D\ +}\ +.ace-twilight .ace_fold {\ +background-color: #AC885B;\ +border-color: #F8F8F8\ +}\ +.ace-twilight .ace_support.ace_function {\ +color: #DAD085\ +}\ +.ace-twilight .ace_list,\ +.ace-twilight .ace_markup.ace_list,\ +.ace-twilight .ace_storage {\ +color: #F9EE98\ +}\ +.ace-twilight .ace_entity.ace_name.ace_function,\ +.ace-twilight .ace_meta.ace_tag,\ +.ace-twilight .ace_variable {\ +color: #AC885B\ +}\ +.ace-twilight .ace_string {\ +color: #8F9D6A\ +}\ +.ace-twilight .ace_string.ace_regexp {\ +color: #E9C062\ +}\ +.ace-twilight .ace_comment {\ +font-style: italic;\ +color: #5F5A60\ +}\ +.ace-twilight .ace_variable {\ +color: #7587A6\ +}\ +.ace-twilight .ace_xml-pe {\ +color: #494949\ +}\ +.ace-twilight .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-vibrant_ink.js b/htdocs/includes/ace/theme-vibrant_ink.js new file mode 100644 index 00000000000..db926c70524 --- /dev/null +++ b/htdocs/includes/ace/theme-vibrant_ink.js @@ -0,0 +1,94 @@ +ace.define("ace/theme/vibrant_ink",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = true; +exports.cssClass = "ace-vibrant-ink"; +exports.cssText = ".ace-vibrant-ink .ace_gutter {\ +background: #1a1a1a;\ +color: #BEBEBE\ +}\ +.ace-vibrant-ink .ace_print-margin {\ +width: 1px;\ +background: #1a1a1a\ +}\ +.ace-vibrant-ink {\ +background-color: #0F0F0F;\ +color: #FFFFFF\ +}\ +.ace-vibrant-ink .ace_cursor {\ +color: #FFFFFF\ +}\ +.ace-vibrant-ink .ace_marker-layer .ace_selection {\ +background: #6699CC\ +}\ +.ace-vibrant-ink.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #0F0F0F;\ +}\ +.ace-vibrant-ink .ace_marker-layer .ace_step {\ +background: rgb(102, 82, 0)\ +}\ +.ace-vibrant-ink .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #404040\ +}\ +.ace-vibrant-ink .ace_marker-layer .ace_active-line {\ +background: #333333\ +}\ +.ace-vibrant-ink .ace_gutter-active-line {\ +background-color: #333333\ +}\ +.ace-vibrant-ink .ace_marker-layer .ace_selected-word {\ +border: 1px solid #6699CC\ +}\ +.ace-vibrant-ink .ace_invisible {\ +color: #404040\ +}\ +.ace-vibrant-ink .ace_keyword,\ +.ace-vibrant-ink .ace_meta {\ +color: #FF6600\ +}\ +.ace-vibrant-ink .ace_constant,\ +.ace-vibrant-ink .ace_constant.ace_character,\ +.ace-vibrant-ink .ace_constant.ace_character.ace_escape,\ +.ace-vibrant-ink .ace_constant.ace_other {\ +color: #339999\ +}\ +.ace-vibrant-ink .ace_constant.ace_numeric {\ +color: #99CC99\ +}\ +.ace-vibrant-ink .ace_invalid,\ +.ace-vibrant-ink .ace_invalid.ace_deprecated {\ +color: #CCFF33;\ +background-color: #000000\ +}\ +.ace-vibrant-ink .ace_fold {\ +background-color: #FFCC00;\ +border-color: #FFFFFF\ +}\ +.ace-vibrant-ink .ace_entity.ace_name.ace_function,\ +.ace-vibrant-ink .ace_support.ace_function,\ +.ace-vibrant-ink .ace_variable {\ +color: #FFCC00\ +}\ +.ace-vibrant-ink .ace_variable.ace_parameter {\ +font-style: italic\ +}\ +.ace-vibrant-ink .ace_string {\ +color: #66FF00\ +}\ +.ace-vibrant-ink .ace_string.ace_regexp {\ +color: #44B4CC\ +}\ +.ace-vibrant-ink .ace_comment {\ +color: #9933CC\ +}\ +.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {\ +font-style: italic;\ +color: #99CC99\ +}\ +.ace-vibrant-ink .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/theme-xcode.js b/htdocs/includes/ace/theme-xcode.js new file mode 100644 index 00000000000..3604a170295 --- /dev/null +++ b/htdocs/includes/ace/theme-xcode.js @@ -0,0 +1,88 @@ +ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"], function(require, exports, module) { + +exports.isDark = false; +exports.cssClass = "ace-xcode"; +exports.cssText = "\ +.ace-xcode .ace_gutter {\ +background: #e8e8e8;\ +color: #333\ +}\ +.ace-xcode .ace_print-margin {\ +width: 1px;\ +background: #e8e8e8\ +}\ +.ace-xcode {\ +background-color: #FFFFFF;\ +color: #000000\ +}\ +.ace-xcode .ace_cursor {\ +color: #000000\ +}\ +.ace-xcode .ace_marker-layer .ace_selection {\ +background: #B5D5FF\ +}\ +.ace-xcode.ace_multiselect .ace_selection.ace_start {\ +box-shadow: 0 0 3px 0px #FFFFFF;\ +}\ +.ace-xcode .ace_marker-layer .ace_step {\ +background: rgb(198, 219, 174)\ +}\ +.ace-xcode .ace_marker-layer .ace_bracket {\ +margin: -1px 0 0 -1px;\ +border: 1px solid #BFBFBF\ +}\ +.ace-xcode .ace_marker-layer .ace_active-line {\ +background: rgba(0, 0, 0, 0.071)\ +}\ +.ace-xcode .ace_gutter-active-line {\ +background-color: rgba(0, 0, 0, 0.071)\ +}\ +.ace-xcode .ace_marker-layer .ace_selected-word {\ +border: 1px solid #B5D5FF\ +}\ +.ace-xcode .ace_constant.ace_language,\ +.ace-xcode .ace_keyword,\ +.ace-xcode .ace_meta,\ +.ace-xcode .ace_variable.ace_language {\ +color: #C800A4\ +}\ +.ace-xcode .ace_invisible {\ +color: #BFBFBF\ +}\ +.ace-xcode .ace_constant.ace_character,\ +.ace-xcode .ace_constant.ace_other {\ +color: #275A5E\ +}\ +.ace-xcode .ace_constant.ace_numeric {\ +color: #3A00DC\ +}\ +.ace-xcode .ace_entity.ace_other.ace_attribute-name,\ +.ace-xcode .ace_support.ace_constant,\ +.ace-xcode .ace_support.ace_function {\ +color: #450084\ +}\ +.ace-xcode .ace_fold {\ +background-color: #C800A4;\ +border-color: #000000\ +}\ +.ace-xcode .ace_entity.ace_name.ace_tag,\ +.ace-xcode .ace_support.ace_class,\ +.ace-xcode .ace_support.ace_type {\ +color: #790EAD\ +}\ +.ace-xcode .ace_storage {\ +color: #C900A4\ +}\ +.ace-xcode .ace_string {\ +color: #DF0002\ +}\ +.ace-xcode .ace_comment {\ +color: #008E00\ +}\ +.ace-xcode .ace_indent-guide {\ +background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y\ +}"; + +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass); +}); diff --git a/htdocs/includes/ace/worker-coffee.js b/htdocs/includes/ace/worker-coffee.js new file mode 100644 index 00000000000..7fca2604922 --- /dev/null +++ b/htdocs/includes/ace/worker-coffee.js @@ -0,0 +1,2157 @@ +"no use strict"; +;(function(window) { +if (typeof window.window != "undefined" && window.document) + return; +if (window.require && window.define) + return; + +if (!window.console) { + window.console = function() { + var msgs = Array.prototype.slice.call(arguments, 0); + postMessage({type: "log", data: msgs}); + }; + window.console.error = + window.console.warn = + window.console.log = + window.console.trace = window.console; +} +window.window = window; +window.ace = window; + +window.onerror = function(message, file, line, col, err) { + postMessage({type: "error", data: { + message: message, + data: err.data, + file: file, + line: line, + col: col, + stack: err.stack + }}); +}; + +window.normalizeModule = function(parentId, moduleName) { + // normalize plugin requires + if (moduleName.indexOf("!") !== -1) { + var chunks = moduleName.split("!"); + return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); + } + // normalize relative requires + if (moduleName.charAt(0) == ".") { + var base = parentId.split("/").slice(0, -1).join("/"); + moduleName = (base ? base + "/" : "") + moduleName; + + while (moduleName.indexOf(".") !== -1 && previous != moduleName) { + var previous = moduleName; + moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + } + } + + return moduleName; +}; + +window.require = function require(parentId, id) { + if (!id) { + id = parentId; + parentId = null; + } + if (!id.charAt) + throw new Error("worker.js require() accepts only (parentId, id) as arguments"); + + id = window.normalizeModule(parentId, id); + + var module = window.require.modules[id]; + if (module) { + if (!module.initialized) { + module.initialized = true; + module.exports = module.factory().exports; + } + return module.exports; + } + + if (!window.require.tlns) + return console.log("unable to load " + id); + + var path = resolveModuleId(id, window.require.tlns); + if (path.slice(-3) != ".js") path += ".js"; + + window.require.id = id; + window.require.modules[id] = {}; // prevent infinite loop on broken modules + importScripts(path); + return window.require(parentId, id); +}; +function resolveModuleId(id, paths) { + var testPath = id, tail = ""; + while (testPath) { + var alias = paths[testPath]; + if (typeof alias == "string") { + return alias + tail; + } else if (alias) { + return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name); + } else if (alias === false) { + return ""; + } + var i = testPath.lastIndexOf("/"); + if (i === -1) break; + tail = testPath.substr(i) + tail; + testPath = testPath.slice(0, i); + } + return id; +} +window.require.modules = {}; +window.require.tlns = {}; + +window.define = function(id, deps, factory) { + if (arguments.length == 2) { + factory = deps; + if (typeof id != "string") { + deps = id; + id = window.require.id; + } + } else if (arguments.length == 1) { + factory = id; + deps = []; + id = window.require.id; + } + + if (typeof factory != "function") { + window.require.modules[id] = { + exports: factory, + initialized: true + }; + return; + } + + if (!deps.length) + // If there is no dependencies, we inject "require", "exports" and + // "module" as dependencies, to provide CommonJS compatibility. + deps = ["require", "exports", "module"]; + + var req = function(childId) { + return window.require(id, childId); + }; + + window.require.modules[id] = { + exports: {}, + factory: function() { + var module = this; + var returnExports = factory.apply(this, deps.map(function(dep) { + switch (dep) { + // Because "require", "exports" and "module" aren't actual + // dependencies, we must handle them seperately. + case "require": return req; + case "exports": return module.exports; + case "module": return module; + // But for all other dependencies, we can just go ahead and + // require them. + default: return req(dep); + } + })); + if (returnExports) + module.exports = returnExports; + return module; + } + }; +}; +window.define.amd = {}; +require.tlns = {}; +window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { + for (var i in topLevelNamespaces) + require.tlns[i] = topLevelNamespaces[i]; +}; + +window.initSender = function initSender() { + + var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; + var oop = window.require("ace/lib/oop"); + + var Sender = function() {}; + + (function() { + + oop.implement(this, EventEmitter); + + this.callback = function(data, callbackId) { + postMessage({ + type: "call", + id: callbackId, + data: data + }); + }; + + this.emit = function(name, data) { + postMessage({ + type: "event", + name: name, + data: data + }); + }; + + }).call(Sender.prototype); + + return new Sender(); +}; + +var main = window.main = null; +var sender = window.sender = null; + +window.onmessage = function(e) { + var msg = e.data; + if (msg.event && sender) { + sender._signal(msg.event, msg.data); + } + else if (msg.command) { + if (main[msg.command]) + main[msg.command].apply(main, msg.args); + else if (window[msg.command]) + window[msg.command].apply(window, msg.args); + else + throw new Error("Unknown command:" + msg.command); + } + else if (msg.init) { + window.initBaseUrls(msg.tlns); + require("ace/lib/es5-shim"); + sender = window.sender = window.initSender(); + var clazz = require(msg.module)[msg.classname]; + main = window.main = new clazz(sender); + } +}; +})(this); + +ace.define("ace/lib/oop",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.inherits = function(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); +}; + +exports.mixin = function(obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + return obj; +}; + +exports.implement = function(proto, mixin) { + exports.mixin(proto, mixin); +}; + +}); + +ace.define("ace/range",["require","exports","module"], function(require, exports, module) { +"use strict"; +var comparePoints = function(p1, p2) { + return p1.row - p2.row || p1.column - p2.column; +}; +var Range = function(startRow, startColumn, endRow, endColumn) { + this.start = { + row: startRow, + column: startColumn + }; + + this.end = { + row: endRow, + column: endColumn + }; +}; + +(function() { + this.isEqual = function(range) { + return this.start.row === range.start.row && + this.end.row === range.end.row && + this.start.column === range.start.column && + this.end.column === range.end.column; + }; + this.toString = function() { + return ("Range: [" + this.start.row + "/" + this.start.column + + "] -> [" + this.end.row + "/" + this.end.column + "]"); + }; + + this.contains = function(row, column) { + return this.compare(row, column) == 0; + }; + this.compareRange = function(range) { + var cmp, + end = range.end, + start = range.start; + + cmp = this.compare(end.row, end.column); + if (cmp == 1) { + cmp = this.compare(start.row, start.column); + if (cmp == 1) { + return 2; + } else if (cmp == 0) { + return 1; + } else { + return 0; + } + } else if (cmp == -1) { + return -2; + } else { + cmp = this.compare(start.row, start.column); + if (cmp == -1) { + return -1; + } else if (cmp == 1) { + return 42; + } else { + return 0; + } + } + }; + this.comparePoint = function(p) { + return this.compare(p.row, p.column); + }; + this.containsRange = function(range) { + return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; + }; + this.intersects = function(range) { + var cmp = this.compareRange(range); + return (cmp == -1 || cmp == 0 || cmp == 1); + }; + this.isEnd = function(row, column) { + return this.end.row == row && this.end.column == column; + }; + this.isStart = function(row, column) { + return this.start.row == row && this.start.column == column; + }; + this.setStart = function(row, column) { + if (typeof row == "object") { + this.start.column = row.column; + this.start.row = row.row; + } else { + this.start.row = row; + this.start.column = column; + } + }; + this.setEnd = function(row, column) { + if (typeof row == "object") { + this.end.column = row.column; + this.end.row = row.row; + } else { + this.end.row = row; + this.end.column = column; + } + }; + this.inside = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column) || this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideStart = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideEnd = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.compare = function(row, column) { + if (!this.isMultiLine()) { + if (row === this.start.row) { + return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); + } + } + + if (row < this.start.row) + return -1; + + if (row > this.end.row) + return 1; + + if (this.start.row === row) + return column >= this.start.column ? 0 : -1; + + if (this.end.row === row) + return column <= this.end.column ? 0 : 1; + + return 0; + }; + this.compareStart = function(row, column) { + if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.compareEnd = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else { + return this.compare(row, column); + } + }; + this.compareInside = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.clipRows = function(firstRow, lastRow) { + if (this.end.row > lastRow) + var end = {row: lastRow + 1, column: 0}; + else if (this.end.row < firstRow) + var end = {row: firstRow, column: 0}; + + if (this.start.row > lastRow) + var start = {row: lastRow + 1, column: 0}; + else if (this.start.row < firstRow) + var start = {row: firstRow, column: 0}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + this.extend = function(row, column) { + var cmp = this.compare(row, column); + + if (cmp == 0) + return this; + else if (cmp == -1) + var start = {row: row, column: column}; + else + var end = {row: row, column: column}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + + this.isEmpty = function() { + return (this.start.row === this.end.row && this.start.column === this.end.column); + }; + this.isMultiLine = function() { + return (this.start.row !== this.end.row); + }; + this.clone = function() { + return Range.fromPoints(this.start, this.end); + }; + this.collapseRows = function() { + if (this.end.column == 0) + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) + else + return new Range(this.start.row, 0, this.end.row, 0) + }; + this.toScreenRange = function(session) { + var screenPosStart = session.documentToScreenPosition(this.start); + var screenPosEnd = session.documentToScreenPosition(this.end); + + return new Range( + screenPosStart.row, screenPosStart.column, + screenPosEnd.row, screenPosEnd.column + ); + }; + this.moveBy = function(row, column) { + this.start.row += row; + this.start.column += column; + this.end.row += row; + this.end.column += column; + }; + +}).call(Range.prototype); +Range.fromPoints = function(start, end) { + return new Range(start.row, start.column, end.row, end.column); +}; +Range.comparePoints = comparePoints; + +Range.comparePoints = function(p1, p2) { + return p1.row - p2.row || p1.column - p2.column; +}; + + +exports.Range = Range; +}); + +ace.define("ace/apply_delta",["require","exports","module"], function(require, exports, module) { +"use strict"; + +function throwDeltaError(delta, errorText){ + console.log("Invalid Delta:", delta); + throw "Invalid Delta: " + errorText; +} + +function positionInDocument(docLines, position) { + return position.row >= 0 && position.row < docLines.length && + position.column >= 0 && position.column <= docLines[position.row].length; +} + +function validateDelta(docLines, delta) { + if (delta.action != "insert" && delta.action != "remove") + throwDeltaError(delta, "delta.action must be 'insert' or 'remove'"); + if (!(delta.lines instanceof Array)) + throwDeltaError(delta, "delta.lines must be an Array"); + if (!delta.start || !delta.end) + throwDeltaError(delta, "delta.start/end must be an present"); + var start = delta.start; + if (!positionInDocument(docLines, delta.start)) + throwDeltaError(delta, "delta.start must be contained in document"); + var end = delta.end; + if (delta.action == "remove" && !positionInDocument(docLines, end)) + throwDeltaError(delta, "delta.end must contained in document for 'remove' actions"); + var numRangeRows = end.row - start.row; + var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0)); + if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars) + throwDeltaError(delta, "delta.range must match delta lines"); +} + +exports.applyDelta = function(docLines, delta, doNotValidate) { + + var row = delta.start.row; + var startColumn = delta.start.column; + var line = docLines[row] || ""; + switch (delta.action) { + case "insert": + var lines = delta.lines; + if (lines.length === 1) { + docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn); + } else { + var args = [row, 1].concat(delta.lines); + docLines.splice.apply(docLines, args); + docLines[row] = line.substring(0, startColumn) + docLines[row]; + docLines[row + delta.lines.length - 1] += line.substring(startColumn); + } + break; + case "remove": + var endColumn = delta.end.column; + var endRow = delta.end.row; + if (row === endRow) { + docLines[row] = line.substring(0, startColumn) + line.substring(endColumn); + } else { + docLines.splice( + row, endRow - row + 1, + line.substring(0, startColumn) + docLines[endRow].substring(endColumn) + ); + } + break; + } +} +}); + +ace.define("ace/lib/event_emitter",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var EventEmitter = {}; +var stopPropagation = function() { this.propagationStopped = true; }; +var preventDefault = function() { this.defaultPrevented = true; }; + +EventEmitter._emit = +EventEmitter._dispatchEvent = function(eventName, e) { + this._eventRegistry || (this._eventRegistry = {}); + this._defaultHandlers || (this._defaultHandlers = {}); + + var listeners = this._eventRegistry[eventName] || []; + var defaultHandler = this._defaultHandlers[eventName]; + if (!listeners.length && !defaultHandler) + return; + + if (typeof e != "object" || !e) + e = {}; + + if (!e.type) + e.type = eventName; + if (!e.stopPropagation) + e.stopPropagation = stopPropagation; + if (!e.preventDefault) + e.preventDefault = preventDefault; + + listeners = listeners.slice(); + for (var i=0; i this.row) + return; + + var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight); + this.setPosition(point.row, point.column, true); + }; + + function $pointsInOrder(point1, point2, equalPointsInOrder) { + var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column; + return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter); + } + + function $getTransformedPoint(delta, point, moveIfEqual) { + var deltaIsInsert = delta.action == "insert"; + var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row); + var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column); + var deltaStart = delta.start; + var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range. + if ($pointsInOrder(point, deltaStart, moveIfEqual)) { + return { + row: point.row, + column: point.column + }; + } + if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) { + return { + row: point.row + deltaRowShift, + column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0) + }; + } + + return { + row: deltaStart.row, + column: deltaStart.column + }; + } + this.setPosition = function(row, column, noClip) { + var pos; + if (noClip) { + pos = { + row: row, + column: column + }; + } else { + pos = this.$clipPositionToDocument(row, column); + } + + if (this.row == pos.row && this.column == pos.column) + return; + + var old = { + row: this.row, + column: this.column + }; + + this.row = pos.row; + this.column = pos.column; + this._signal("change", { + old: old, + value: pos + }); + }; + this.detach = function() { + this.document.removeEventListener("change", this.$onChange); + }; + this.attach = function(doc) { + this.document = doc || this.document; + this.document.on("change", this.$onChange); + }; + this.$clipPositionToDocument = function(row, column) { + var pos = {}; + + if (row >= this.document.getLength()) { + pos.row = Math.max(0, this.document.getLength() - 1); + pos.column = this.document.getLine(pos.row).length; + } + else if (row < 0) { + pos.row = 0; + pos.column = 0; + } + else { + pos.row = row; + pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); + } + + if (column < 0) + pos.column = 0; + + return pos; + }; + +}).call(Anchor.prototype); + +}); + +ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var applyDelta = require("./apply_delta").applyDelta; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var Range = require("./range").Range; +var Anchor = require("./anchor").Anchor; + +var Document = function(textOrLines) { + this.$lines = [""]; + if (textOrLines.length === 0) { + this.$lines = [""]; + } else if (Array.isArray(textOrLines)) { + this.insertMergedLines({row: 0, column: 0}, textOrLines); + } else { + this.insert({row: 0, column:0}, textOrLines); + } +}; + +(function() { + + oop.implement(this, EventEmitter); + this.setValue = function(text) { + var len = this.getLength() - 1; + this.remove(new Range(0, 0, len, this.getLine(len).length)); + this.insert({row: 0, column: 0}, text); + }; + this.getValue = function() { + return this.getAllLines().join(this.getNewLineCharacter()); + }; + this.createAnchor = function(row, column) { + return new Anchor(this, row, column); + }; + if ("aaa".split(/a/).length === 0) { + this.$split = function(text) { + return text.replace(/\r\n|\r/g, "\n").split("\n"); + }; + } else { + this.$split = function(text) { + return text.split(/\r\n|\r|\n/); + }; + } + + + this.$detectNewLine = function(text) { + var match = text.match(/^.*?(\r\n|\r|\n)/m); + this.$autoNewLine = match ? match[1] : "\n"; + this._signal("changeNewLineMode"); + }; + this.getNewLineCharacter = function() { + switch (this.$newLineMode) { + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine || "\n"; + } + }; + + this.$autoNewLine = ""; + this.$newLineMode = "auto"; + this.setNewLineMode = function(newLineMode) { + if (this.$newLineMode === newLineMode) + return; + + this.$newLineMode = newLineMode; + this._signal("changeNewLineMode"); + }; + this.getNewLineMode = function() { + return this.$newLineMode; + }; + this.isNewLine = function(text) { + return (text == "\r\n" || text == "\r" || text == "\n"); + }; + this.getLine = function(row) { + return this.$lines[row] || ""; + }; + this.getLines = function(firstRow, lastRow) { + return this.$lines.slice(firstRow, lastRow + 1); + }; + this.getAllLines = function() { + return this.getLines(0, this.getLength()); + }; + this.getLength = function() { + return this.$lines.length; + }; + this.getTextRange = function(range) { + return this.getLinesForRange(range).join(this.getNewLineCharacter()); + }; + this.getLinesForRange = function(range) { + var lines; + if (range.start.row === range.end.row) { + lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)]; + } else { + lines = this.getLines(range.start.row, range.end.row); + lines[0] = (lines[0] || "").substring(range.start.column); + var l = lines.length - 1; + if (range.end.row - range.start.row == l) + lines[l] = lines[l].substring(0, range.end.column); + } + return lines; + }; + this.insertLines = function(row, lines) { + console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."); + return this.insertFullLines(row, lines); + }; + this.removeLines = function(firstRow, lastRow) { + console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."); + return this.removeFullLines(firstRow, lastRow); + }; + this.insertNewLine = function(position) { + console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."); + return this.insertMergedLines(position, ["", ""]); + }; + this.insert = function(position, text) { + if (this.getLength() <= 1) + this.$detectNewLine(text); + + return this.insertMergedLines(position, this.$split(text)); + }; + this.insertInLine = function(position, text) { + var start = this.clippedPos(position.row, position.column); + var end = this.pos(position.row, position.column + text.length); + + this.applyDelta({ + start: start, + end: end, + action: "insert", + lines: [text] + }, true); + + return this.clonePos(end); + }; + + this.clippedPos = function(row, column) { + var length = this.getLength(); + if (row === undefined) { + row = length; + } else if (row < 0) { + row = 0; + } else if (row >= length) { + row = length - 1; + column = undefined; + } + var line = this.getLine(row); + if (column == undefined) + column = line.length; + column = Math.min(Math.max(column, 0), line.length); + return {row: row, column: column}; + }; + + this.clonePos = function(pos) { + return {row: pos.row, column: pos.column}; + }; + + this.pos = function(row, column) { + return {row: row, column: column}; + }; + + this.$clipPosition = function(position) { + var length = this.getLength(); + if (position.row >= length) { + position.row = Math.max(0, length - 1); + position.column = this.getLine(length - 1).length; + } else { + position.row = Math.max(0, position.row); + position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length); + } + return position; + }; + this.insertFullLines = function(row, lines) { + row = Math.min(Math.max(row, 0), this.getLength()); + var column = 0; + if (row < this.getLength()) { + lines = lines.concat([""]); + column = 0; + } else { + lines = [""].concat(lines); + row--; + column = this.$lines[row].length; + } + this.insertMergedLines({row: row, column: column}, lines); + }; + this.insertMergedLines = function(position, lines) { + var start = this.clippedPos(position.row, position.column); + var end = { + row: start.row + lines.length - 1, + column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length + }; + + this.applyDelta({ + start: start, + end: end, + action: "insert", + lines: lines + }); + + return this.clonePos(end); + }; + this.remove = function(range) { + var start = this.clippedPos(range.start.row, range.start.column); + var end = this.clippedPos(range.end.row, range.end.column); + this.applyDelta({ + start: start, + end: end, + action: "remove", + lines: this.getLinesForRange({start: start, end: end}) + }); + return this.clonePos(start); + }; + this.removeInLine = function(row, startColumn, endColumn) { + var start = this.clippedPos(row, startColumn); + var end = this.clippedPos(row, endColumn); + + this.applyDelta({ + start: start, + end: end, + action: "remove", + lines: this.getLinesForRange({start: start, end: end}) + }, true); + + return this.clonePos(start); + }; + this.removeFullLines = function(firstRow, lastRow) { + firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1); + lastRow = Math.min(Math.max(0, lastRow ), this.getLength() - 1); + var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0; + var deleteLastNewLine = lastRow < this.getLength() - 1; + var startRow = ( deleteFirstNewLine ? firstRow - 1 : firstRow ); + var startCol = ( deleteFirstNewLine ? this.getLine(startRow).length : 0 ); + var endRow = ( deleteLastNewLine ? lastRow + 1 : lastRow ); + var endCol = ( deleteLastNewLine ? 0 : this.getLine(endRow).length ); + var range = new Range(startRow, startCol, endRow, endCol); + var deletedLines = this.$lines.slice(firstRow, lastRow + 1); + + this.applyDelta({ + start: range.start, + end: range.end, + action: "remove", + lines: this.getLinesForRange(range) + }); + return deletedLines; + }; + this.removeNewLine = function(row) { + if (row < this.getLength() - 1 && row >= 0) { + this.applyDelta({ + start: this.pos(row, this.getLine(row).length), + end: this.pos(row + 1, 0), + action: "remove", + lines: ["", ""] + }); + } + }; + this.replace = function(range, text) { + if (!(range instanceof Range)) + range = Range.fromPoints(range.start, range.end); + if (text.length === 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + + this.remove(range); + var end; + if (text) { + end = this.insert(range.start, text); + } + else { + end = range.start; + } + + return end; + }; + this.applyDeltas = function(deltas) { + for (var i=0; i=0; i--) { + this.revertDelta(deltas[i]); + } + }; + this.applyDelta = function(delta, doNotValidate) { + var isInsert = delta.action == "insert"; + if (isInsert ? delta.lines.length <= 1 && !delta.lines[0] + : !Range.comparePoints(delta.start, delta.end)) { + return; + } + + if (isInsert && delta.lines.length > 20000) + this.$splitAndapplyLargeDelta(delta, 20000); + applyDelta(this.$lines, delta, doNotValidate); + this._signal("change", delta); + }; + + this.$splitAndapplyLargeDelta = function(delta, MAX) { + var lines = delta.lines; + var l = lines.length; + var row = delta.start.row; + var column = delta.start.column; + var from = 0, to = 0; + do { + from = to; + to += MAX - 1; + var chunk = lines.slice(from, to); + if (to > l) { + delta.lines = chunk; + delta.start.row = row + from; + delta.start.column = column; + break; + } + chunk.push(""); + this.applyDelta({ + start: this.pos(row + from, column), + end: this.pos(row + to, column = 0), + action: delta.action, + lines: chunk + }, true); + } while(true); + }; + this.revertDelta = function(delta) { + this.applyDelta({ + start: this.clonePos(delta.start), + end: this.clonePos(delta.end), + action: (delta.action == "insert" ? "remove" : "insert"), + lines: delta.lines.slice() + }); + }; + this.indexToPosition = function(index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return {row: i, column: index + lines[i].length + newlineLength}; + } + return {row: l-1, column: lines[l-1].length}; + }; + this.positionToIndex = function(pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + + return index + pos.column; + }; + +}).call(Document.prototype); + +exports.Document = Document; +}); + +ace.define("ace/lib/lang",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.last = function(a) { + return a[a.length - 1]; +}; + +exports.stringReverse = function(string) { + return string.split("").reverse().join(""); +}; + +exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + + if (count >>= 1) + string += string; + } + return result; +}; + +var trimBeginRegexp = /^\s\s*/; +var trimEndRegexp = /\s\s*$/; + +exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); +}; + +exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); +}; + +exports.copyObject = function(obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; +}; + +exports.copyArray = function(array){ + var copy = []; + for (var i=0, l=array.length; i0;)1&t&&(n+=e),t>>>=1,e+=e;return n},e.compact=function(e){var t,n,i,r;for(r=[],t=0,i=e.length;i>t;t++)n=e[t],n&&r.push(n);return r},e.count=function(e,t){var n,i;if(n=i=0,!t.length)return 1/0;for(;i=1+e.indexOf(t,i);)n++;return n},e.merge=function(e,t){return n(n({},e),t)},n=e.extend=function(e,t){var n,i;for(n in t)i=t[n],e[n]=i;return e},e.flatten=i=function(e){var t,n,r,s;for(n=[],r=0,s=e.length;s>r;r++)t=e[r],t instanceof Array?n=n.concat(i(t)):n.push(t);return n},e.del=function(e,t){var n;return n=e[t],delete e[t],n},e.some=null!=(r=Array.prototype.some)?r:function(e){var t,n,i;for(n=0,i=this.length;i>n;n++)if(t=this[n],e(t))return!0;return!1},e.invertLiterate=function(e){var t,n,i;return i=!0,n=function(){var n,r,s,o;for(s=e.split("\n"),o=[],n=0,r=s.length;r>n;n++)t=s[n],i&&/^([ ]{4}|[ ]{0,3}\t)/.test(t)?o.push(t):(i=/^\s*$/.test(t))?o.push(t):o.push("# "+t);return o}(),n.join("\n")},t=function(e,t){return t?{first_line:e.first_line,first_column:e.first_column,last_line:t.last_line,last_column:t.last_column}:e},e.addLocationDataFn=function(e,n){return function(i){return"object"==typeof i&&i.updateLocationDataIfMissing&&i.updateLocationDataIfMissing(t(e,n)),i}},e.locationDataToString=function(e){var t;return"2"in e&&"first_line"in e[2]?t=e[2]:"first_line"in e&&(t=e),t?t.first_line+1+":"+(t.first_column+1)+"-"+(t.last_line+1+":"+(t.last_column+1)):"No location data"},e.baseFileName=function(e,t,n){var i,r;return null==t&&(t=!1),null==n&&(n=!1),r=n?/\\|\//:/\//,i=e.split(r),e=i[i.length-1],t&&e.indexOf(".")>=0?(i=e.split("."),i.pop(),"coffee"===i[i.length-1]&&i.length>1&&i.pop(),i.join(".")):e},e.isCoffee=function(e){return/\.((lit)?coffee|coffee\.md)$/.test(e)},e.isLiterate=function(e){return/\.(litcoffee|coffee\.md)$/.test(e)},e.throwSyntaxError=function(e,t){var n;throw n=new SyntaxError(e),n.location=t,n.toString=o,n.stack=""+n,n},e.updateSyntaxError=function(e,t,n){return e.toString===o&&(e.code||(e.code=t),e.filename||(e.filename=n),e.stack=""+e),e},o=function(){var e,t,n,i,r,o,a,c,h,l,u,p,d,f,m;return this.code&&this.location?(u=this.location,a=u.first_line,o=u.first_column,h=u.last_line,c=u.last_column,null==h&&(h=a),null==c&&(c=o),r=this.filename||"[stdin]",e=this.code.split("\n")[a],m=o,i=a===h?c+1:e.length,l=e.slice(0,m).replace(/[^\s]/g," ")+s("^",i-m),"undefined"!=typeof process&&null!==process&&(n=(null!=(p=process.stdout)?p.isTTY:void 0)&&!(null!=(d=process.env)?d.NODE_DISABLE_COLORS:void 0)),(null!=(f=this.colorful)?f:n)&&(t=function(e){return""+e+""},e=e.slice(0,m)+t(e.slice(m,i))+e.slice(i),l=t(l)),r+":"+(a+1)+":"+(o+1)+": error: "+this.message+"\n"+e+"\n"+l):Error.prototype.toString.call(this)},e.nameWhitespaceCharacter=function(e){switch(e){case" ":return"space";case"\n":return"newline";case"\r":return"carriage return";case" ":return"tab";default:return e}}}.call(this),t.exports}(),_dereq_["./rewriter"]=function(){var e={},t={exports:e};return function(){var t,n,i,r,s,o,a,c,h,l,u,p,d,f,m,g,v,y,b,k=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1},w=[].slice;for(f=function(e,t,n){var i;return i=[e,t],i.generated=!0,n&&(i.origin=n),i},e.Rewriter=function(){function e(){}return e.prototype.rewrite=function(e){return this.tokens=e,this.removeLeadingNewlines(),this.closeOpenCalls(),this.closeOpenIndexes(),this.normalizeLines(),this.tagPostfixConditionals(),this.addImplicitBracesAndParens(),this.addLocationDataToGeneratedTokens(),this.tokens},e.prototype.scanTokens=function(e){var t,n,i;for(i=this.tokens,t=0;n=i[t];)t+=e.call(this,n,t,i);return!0},e.prototype.detectEnd=function(e,t,n){var i,o,a,c,h;for(h=this.tokens,i=0;c=h[e];){if(0===i&&t.call(this,c,e))return n.call(this,c,e);if(!c||0>i)return n.call(this,c,e-1);o=c[0],k.call(s,o)>=0?i+=1:(a=c[0],k.call(r,a)>=0&&(i-=1)),e+=1}return e-1},e.prototype.removeLeadingNewlines=function(){var e,t,n,i,r;for(i=this.tokens,e=t=0,n=i.length;n>t&&(r=i[e][0],"TERMINATOR"===r);e=++t);return e?this.tokens.splice(0,e):void 0},e.prototype.closeOpenCalls=function(){var e,t;return t=function(e,t){var n;return")"===(n=e[0])||"CALL_END"===n||"OUTDENT"===e[0]&&")"===this.tag(t-1)},e=function(e,t){return this.tokens["OUTDENT"===e[0]?t-1:t][0]="CALL_END"},this.scanTokens(function(n,i){return"CALL_START"===n[0]&&this.detectEnd(i+1,t,e),1})},e.prototype.closeOpenIndexes=function(){var e,t;return t=function(e){var t;return"]"===(t=e[0])||"INDEX_END"===t},e=function(e){return e[0]="INDEX_END"},this.scanTokens(function(n,i){return"INDEX_START"===n[0]&&this.detectEnd(i+1,t,e),1})},e.prototype.indexOfTag=function(){var e,t,n,i,r,s,o;for(t=arguments[0],r=arguments.length>=2?w.call(arguments,1):[],e=0,n=i=0,s=r.length;s>=0?s>i:i>s;n=s>=0?++i:--i){for(;"HERECOMMENT"===this.tag(t+n+e);)e+=2;if(null!=r[n]&&("string"==typeof r[n]&&(r[n]=[r[n]]),o=this.tag(t+n+e),0>k.call(r[n],o)))return-1}return t+n+e-1},e.prototype.looksObjectish=function(e){var t,n;return this.indexOfTag(e,"@",null,":")>-1||this.indexOfTag(e,null,":")>-1?!0:(n=this.indexOfTag(e,s),n>-1&&(t=null,this.detectEnd(n+1,function(e){var t;return t=e[0],k.call(r,t)>=0},function(e,n){return t=n}),":"===this.tag(t+1))?!0:!1)},e.prototype.findTagsBackwards=function(e,t){var n,i,o,a,c,h,l;for(n=[];e>=0&&(n.length||(a=this.tag(e),0>k.call(t,a)&&(c=this.tag(e),0>k.call(s,c)||this.tokens[e].generated)&&(h=this.tag(e),0>k.call(u,h))));)i=this.tag(e),k.call(r,i)>=0&&n.push(this.tag(e)),o=this.tag(e),k.call(s,o)>=0&&n.length&&n.pop(),e-=1;return l=this.tag(e),k.call(t,l)>=0},e.prototype.addImplicitBracesAndParens=function(){var e,t;return e=[],t=null,this.scanTokens(function(i,l,p){var d,m,g,v,y,b,w,T,C,E,F,N,L,x,S,D,R,A,I,_,O,$,j,M,B,V,P,U;if(U=i[0],F=(N=l>0?p[l-1]:[])[0],C=(p.length-1>l?p[l+1]:[])[0],j=function(){return e[e.length-1]},M=l,g=function(e){return l-M+e},v=function(){var e,t;return null!=(e=j())?null!=(t=e[2])?t.ours:void 0:void 0},y=function(){var e;return v()&&"("===(null!=(e=j())?e[0]:void 0)},w=function(){var e;return v()&&"{"===(null!=(e=j())?e[0]:void 0)},b=function(){var e;return v&&"CONTROL"===(null!=(e=j())?e[0]:void 0)},B=function(t){var n;return n=null!=t?t:l,e.push(["(",n,{ours:!0}]),p.splice(n,0,f("CALL_START","(")),null==t?l+=1:void 0},d=function(){return e.pop(),p.splice(l,0,f("CALL_END",")",["","end of input",i[2]])),l+=1},V=function(t,n){var r,s;return null==n&&(n=!0),r=null!=t?t:l,e.push(["{",r,{sameLine:!0,startsLine:n,ours:!0}]),s=new String("{"),s.generated=!0,p.splice(r,0,f("{",s,i)),null==t?l+=1:void 0},m=function(t){return t=null!=t?t:l,e.pop(),p.splice(t,0,f("}","}",i)),l+=1},y()&&("IF"===U||"TRY"===U||"FINALLY"===U||"CATCH"===U||"CLASS"===U||"SWITCH"===U))return e.push(["CONTROL",l,{ours:!0}]),g(1);if("INDENT"===U&&v()){if("=>"!==F&&"->"!==F&&"["!==F&&"("!==F&&","!==F&&"{"!==F&&"TRY"!==F&&"ELSE"!==F&&"="!==F)for(;y();)d();return b()&&e.pop(),e.push([U,l]),g(1)}if(k.call(s,U)>=0)return e.push([U,l]),g(1);if(k.call(r,U)>=0){for(;v();)y()?d():w()?m():e.pop();t=e.pop()}if((k.call(c,U)>=0&&i.spaced||"?"===U&&l>0&&!p[l-1].spaced)&&(k.call(o,C)>=0||k.call(h,C)>=0&&!(null!=(L=p[l+1])?L.spaced:void 0)&&!(null!=(x=p[l+1])?x.newLine:void 0)))return"?"===U&&(U=i[0]="FUNC_EXIST"),B(l+1),g(2);if(k.call(c,U)>=0&&this.indexOfTag(l+1,"INDENT")>-1&&this.looksObjectish(l+2)&&!this.findTagsBackwards(l,["CLASS","EXTENDS","IF","CATCH","SWITCH","LEADING_WHEN","FOR","WHILE","UNTIL"]))return B(l+1),e.push(["INDENT",l+2]),g(3);if(":"===U){for(I=function(){var e;switch(!1){case e=this.tag(l-1),0>k.call(r,e):return t[1];case"@"!==this.tag(l-2):return l-2;default:return l-1}}.call(this);"HERECOMMENT"===this.tag(I-2);)I-=2;return this.insideForDeclaration="FOR"===C,P=0===I||(S=this.tag(I-1),k.call(u,S)>=0)||p[I-1].newLine,j()&&(D=j(),$=D[0],O=D[1],("{"===$||"INDENT"===$&&"{"===this.tag(O-1))&&(P||","===this.tag(I-1)||"{"===this.tag(I-1)))?g(1):(V(I,!!P),g(2))}if(w()&&k.call(u,U)>=0&&(j()[2].sameLine=!1),T="OUTDENT"===F||N.newLine,k.call(a,U)>=0||k.call(n,U)>=0&&T)for(;v();)if(R=j(),$=R[0],O=R[1],A=R[2],_=A.sameLine,P=A.startsLine,y()&&","!==F)d();else if(w()&&!this.insideForDeclaration&&_&&"TERMINATOR"!==U&&":"!==F)m();else{if(!w()||"TERMINATOR"!==U||","===F||P&&this.looksObjectish(l+1))break;if("HERECOMMENT"===C)return g(1);m()}if(!(","!==U||this.looksObjectish(l+1)||!w()||this.insideForDeclaration||"TERMINATOR"===C&&this.looksObjectish(l+2)))for(E="OUTDENT"===C?1:0;w();)m(l+E);return g(1)})},e.prototype.addLocationDataToGeneratedTokens=function(){return this.scanTokens(function(e,t,n){var i,r,s,o,a,c;return e[2]?1:e.generated||e.explicit?("{"===e[0]&&(s=null!=(a=n[t+1])?a[2]:void 0)?(r=s.first_line,i=s.first_column):(o=null!=(c=n[t-1])?c[2]:void 0)?(r=o.last_line,i=o.last_column):r=i=0,e[2]={first_line:r,first_column:i,last_line:r,last_column:i},1):1})},e.prototype.normalizeLines=function(){var e,t,r,s,o;return o=r=s=null,t=function(e,t){var r,s,a,c;return";"!==e[1]&&(r=e[0],k.call(p,r)>=0)&&!("TERMINATOR"===e[0]&&(s=this.tag(t+1),k.call(i,s)>=0))&&!("ELSE"===e[0]&&"THEN"!==o)&&!!("CATCH"!==(a=e[0])&&"FINALLY"!==a||"->"!==o&&"=>"!==o)||(c=e[0],k.call(n,c)>=0&&this.tokens[t-1].newLine)},e=function(e,t){return this.tokens.splice(","===this.tag(t-1)?t-1:t,0,s)},this.scanTokens(function(n,a,c){var h,l,u,p,f,m;if(m=n[0],"TERMINATOR"===m){if("ELSE"===this.tag(a+1)&&"OUTDENT"!==this.tag(a-1))return c.splice.apply(c,[a,1].concat(w.call(this.indentation()))),1;if(u=this.tag(a+1),k.call(i,u)>=0)return c.splice(a,1),0}if("CATCH"===m)for(h=l=1;2>=l;h=++l)if("OUTDENT"===(p=this.tag(a+h))||"TERMINATOR"===p||"FINALLY"===p)return c.splice.apply(c,[a+h,0].concat(w.call(this.indentation()))),2+h;return k.call(d,m)>=0&&"INDENT"!==this.tag(a+1)&&("ELSE"!==m||"IF"!==this.tag(a+1))?(o=m,f=this.indentation(c[a]),r=f[0],s=f[1],"THEN"===o&&(r.fromThen=!0),c.splice(a+1,0,r),this.detectEnd(a+2,t,e),"THEN"===m&&c.splice(a,1),1):1})},e.prototype.tagPostfixConditionals=function(){var e,t,n;return n=null,t=function(e,t){var n,i;return i=e[0],n=this.tokens[t-1][0],"TERMINATOR"===i||"INDENT"===i&&0>k.call(d,n)},e=function(e){return"INDENT"!==e[0]||e.generated&&!e.fromThen?n[0]="POST_"+n[0]:void 0},this.scanTokens(function(i,r){return"IF"!==i[0]?1:(n=i,this.detectEnd(r+1,t,e),1)})},e.prototype.indentation=function(e){var t,n;return t=["INDENT",2],n=["OUTDENT",2],e?(t.generated=n.generated=!0,t.origin=n.origin=e):t.explicit=n.explicit=!0,[t,n]},e.prototype.generate=f,e.prototype.tag=function(e){var t;return null!=(t=this.tokens[e])?t[0]:void 0},e}(),t=[["(",")"],["[","]"],["{","}"],["INDENT","OUTDENT"],["CALL_START","CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"],["STRING_START","STRING_END"],["REGEX_START","REGEX_END"]],e.INVERSES=l={},s=[],r=[],m=0,v=t.length;v>m;m++)y=t[m],g=y[0],b=y[1],s.push(l[b]=g),r.push(l[g]=b);i=["CATCH","THEN","ELSE","FINALLY"].concat(r),c=["IDENTIFIER","SUPER",")","CALL_END","]","INDEX_END","@","THIS"],o=["IDENTIFIER","NUMBER","STRING","STRING_START","JS","REGEX","REGEX_START","NEW","PARAM_START","CLASS","IF","TRY","SWITCH","THIS","BOOL","NULL","UNDEFINED","UNARY","YIELD","UNARY_MATH","SUPER","THROW","@","->","=>","[","(","{","--","++"],h=["+","-"],a=["POST_IF","FOR","WHILE","UNTIL","WHEN","BY","LOOP","TERMINATOR"],d=["ELSE","->","=>","TRY","FINALLY","THEN"],p=["TERMINATOR","CATCH","FINALLY","ELSE","OUTDENT","LEADING_WHEN"],u=["TERMINATOR","INDENT","OUTDENT"],n=[".","?.","::","?::"]}.call(this),t.exports}(),_dereq_["./lexer"]=function(){var e={},t={exports:e};return function(){var t,n,i,r,s,o,a,c,h,l,u,p,d,f,m,g,v,y,b,k,w,T,C,E,F,N,L,x,S,D,R,A,I,_,O,$,j,M,B,V,P,U,G,H,q,X,W,Y,K,z,J,Q,Z,et,tt,nt,it,rt,st,ot,at,ct,ht,lt,ut=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};ot=_dereq_("./rewriter"),P=ot.Rewriter,w=ot.INVERSES,at=_dereq_("./helpers"),nt=at.count,ht=at.starts,tt=at.compact,ct=at.repeat,it=at.invertLiterate,st=at.locationDataToString,lt=at.throwSyntaxError,e.Lexer=S=function(){function e(){}return e.prototype.tokenize=function(e,t){var n,i,r,s;for(null==t&&(t={}),this.literate=t.literate,this.indent=0,this.baseIndent=0,this.indebt=0,this.outdebt=0,this.indents=[],this.ends=[],this.tokens=[],this.chunkLine=t.line||0,this.chunkColumn=t.column||0,e=this.clean(e),r=0;this.chunk=e.slice(r);)if(n=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.stringToken()||this.numberToken()||this.regexToken()||this.jsToken()||this.literalToken(),s=this.getLineAndColumnFromChunk(n),this.chunkLine=s[0],this.chunkColumn=s[1],r+=n,t.untilBalanced&&0===this.ends.length)return{tokens:this.tokens,index:r};return this.closeIndentation(),(i=this.ends.pop())&&this.error("missing "+i.tag,i.origin[2]),t.rewrite===!1?this.tokens:(new P).rewrite(this.tokens)},e.prototype.clean=function(e){return e.charCodeAt(0)===t&&(e=e.slice(1)),e=e.replace(/\r/g,"").replace(z,""),et.test(e)&&(e="\n"+e,this.chunkLine--),this.literate&&(e=it(e)),e},e.prototype.identifierToken=function(){var e,t,n,i,r,c,h,l,u,p,d,f,m,g,y,b;return(l=v.exec(this.chunk))?(h=l[0],r=l[1],t=l[2],c=r.length,u=void 0,"own"===r&&"FOR"===this.tag()?(this.token("OWN",r),r.length):"from"===r&&"YIELD"===this.tag()?(this.token("FROM",r),r.length):(d=this.tokens,p=d[d.length-1],i=t||null!=p&&("."===(f=p[0])||"?."===f||"::"===f||"?::"===f||!p.spaced&&"@"===p[0]),y="IDENTIFIER",!i&&(ut.call(E,r)>=0||ut.call(a,r)>=0)&&(y=r.toUpperCase(),"WHEN"===y&&(m=this.tag(),ut.call(N,m)>=0)?y="LEADING_WHEN":"FOR"===y?this.seenFor=!0:"UNLESS"===y?y="IF":ut.call(J,y)>=0?y="UNARY":ut.call(B,y)>=0&&("INSTANCEOF"!==y&&this.seenFor?(y="FOR"+y,this.seenFor=!1):(y="RELATION","!"===this.value()&&(u=this.tokens.pop(),r="!"+r)))),ut.call(C,r)>=0&&(i?(y="IDENTIFIER",r=new String(r),r.reserved=!0):ut.call(V,r)>=0&&this.error("reserved word '"+r+"'",{length:r.length})),i||(ut.call(s,r)>=0&&(e=r,r=o[r]),y=function(){switch(r){case"!":return"UNARY";case"==":case"!=":return"COMPARE";case"&&":case"||":return"LOGIC";case"true":case"false":return"BOOL";case"break":case"continue":return"STATEMENT";default:return y}}()),b=this.token(y,r,0,c),e&&(b.origin=[y,e,b[2]]),b.variable=!i,u&&(g=[u[2].first_line,u[2].first_column],b[2].first_line=g[0],b[2].first_column=g[1]),t&&(n=h.lastIndexOf(":"),this.token(":",":",n,t.length)),h.length)):0},e.prototype.numberToken=function(){var e,t,n,i,r;return(n=I.exec(this.chunk))?(i=n[0],t=i.length,/^0[BOX]/.test(i)?this.error("radix prefix in '"+i+"' must be lowercase",{offset:1}):/E/.test(i)&&!/^0x/.test(i)?this.error("exponential notation in '"+i+"' must be indicated with a lowercase 'e'",{offset:i.indexOf("E")}):/^0\d*[89]/.test(i)?this.error("decimal literal '"+i+"' must not be prefixed with '0'",{length:t}):/^0\d+/.test(i)&&this.error("octal literal '"+i+"' must be prefixed with '0o'",{length:t}),(r=/^0o([0-7]+)/.exec(i))&&(i="0x"+parseInt(r[1],8).toString(16)),(e=/^0b([01]+)/.exec(i))&&(i="0x"+parseInt(e[1],2).toString(16)),this.token("NUMBER",i,0,t),t):0},e.prototype.stringToken=function(){var e,t,n,i,r,s,o,a,c,h,l,u,m,g,v,y;if(l=(Y.exec(this.chunk)||[])[0],!l)return 0;if(g=function(){switch(l){case"'":return W;case'"':return q;case"'''":return f;case'"""':return p}}(),s=3===l.length,u=this.matchWithInterpolations(g,l),y=u.tokens,r=u.index,e=y.length-1,n=l.charAt(0),s){for(a=null,i=function(){var e,t,n;for(n=[],o=e=0,t=y.length;t>e;o=++e)v=y[o],"NEOSTRING"===v[0]&&n.push(v[1]);return n}().join("#{}");h=d.exec(i);)t=h[1],(null===a||(m=t.length)>0&&a.length>m)&&(a=t);a&&(c=RegExp("^"+a,"gm")),this.mergeInterpolationTokens(y,{delimiter:n},function(t){return function(n,i){return n=t.formatString(n),0===i&&(n=n.replace(F,"")),i===e&&(n=n.replace(K,"")),c&&(n=n.replace(c,"")),n}}(this))}else this.mergeInterpolationTokens(y,{delimiter:n},function(t){return function(n,i){return n=t.formatString(n),n=n.replace(G,function(t,r){return 0===i&&0===r||i===e&&r+t.length===n.length?"":" "})}}(this));return r},e.prototype.commentToken=function(){var e,t,n;return(n=this.chunk.match(c))?(e=n[0],t=n[1],t&&((n=u.exec(e))&&this.error("block comments cannot contain "+n[0],{offset:n.index,length:n[0].length}),t.indexOf("\n")>=0&&(t=t.replace(RegExp("\\n"+ct(" ",this.indent),"g"),"\n")),this.token("HERECOMMENT",t,0,e.length)),e.length):0},e.prototype.jsToken=function(){var e,t;return"`"===this.chunk.charAt(0)&&(e=T.exec(this.chunk))?(this.token("JS",(t=e[0]).slice(1,-1),0,t.length),t.length):0},e.prototype.regexToken=function(){var e,t,n,r,s,o,a,c,h,l,u,p,d;switch(!1){case!(o=M.exec(this.chunk)):this.error("regular expressions cannot begin with "+o[2],{offset:o.index+o[1].length});break;case!(o=this.matchWithInterpolations(m,"///")):d=o.tokens,s=o.index;break;case!(o=$.exec(this.chunk)):if(p=o[0],e=o[1],t=o[2],this.validateEscapes(e,{isRegex:!0,offsetInChunk:1}),s=p.length,h=this.tokens,c=h[h.length-1],c)if(c.spaced&&(l=c[0],ut.call(i,l)>=0)){if(!t||O.test(p))return 0}else if(u=c[0],ut.call(A,u)>=0)return 0;t||this.error("missing / (unclosed regex)");break;default:return 0}switch(r=j.exec(this.chunk.slice(s))[0],n=s+r.length,a=this.makeToken("REGEX",null,0,n),!1){case!!Z.test(r):this.error("invalid regular expression flags "+r,{offset:s,length:r.length});break;case!(p||1===d.length):null==e&&(e=this.formatHeregex(d[0][1])),this.token("REGEX",""+this.makeDelimitedLiteral(e,{delimiter:"/"})+r,0,n,a);break;default:this.token("REGEX_START","(",0,0,a),this.token("IDENTIFIER","RegExp",0,0),this.token("CALL_START","(",0,0),this.mergeInterpolationTokens(d,{delimiter:'"',"double":!0},this.formatHeregex),r&&(this.token(",",",",s,0),this.token("STRING",'"'+r+'"',s,r.length)),this.token(")",")",n,0),this.token("REGEX_END",")",n,0)}return n},e.prototype.lineToken=function(){var e,t,n,i,r;if(!(n=R.exec(this.chunk)))return 0;if(t=n[0],this.seenFor=!1,r=t.length-1-t.lastIndexOf("\n"),i=this.unfinished(),r-this.indebt===this.indent)return i?this.suppressNewlines():this.newlineToken(0),t.length;if(r>this.indent){if(i)return this.indebt=r-this.indent,this.suppressNewlines(),t.length;if(!this.tokens.length)return this.baseIndent=this.indent=r,t.length;e=r-this.indent+this.outdebt,this.token("INDENT",e,t.length-r,r),this.indents.push(e),this.ends.push({tag:"OUTDENT"}),this.outdebt=this.indebt=0,this.indent=r}else this.baseIndent>r?this.error("missing indentation",{offset:t.length}):(this.indebt=0,this.outdentToken(this.indent-r,i,t.length));return t.length},e.prototype.outdentToken=function(e,t,n){var i,r,s,o;for(i=this.indent-e;e>0;)s=this.indents[this.indents.length-1],s?s===this.outdebt?(e-=this.outdebt,this.outdebt=0):this.outdebt>s?(this.outdebt-=s,e-=s):(r=this.indents.pop()+this.outdebt,n&&(o=this.chunk[n],ut.call(y,o)>=0)&&(i-=r-e,e=r),this.outdebt=0,this.pair("OUTDENT"),this.token("OUTDENT",e,0,n),e-=r):e=0;for(r&&(this.outdebt-=e);";"===this.value();)this.tokens.pop();return"TERMINATOR"===this.tag()||t||this.token("TERMINATOR","\n",n,0),this.indent=i,this},e.prototype.whitespaceToken=function(){var e,t,n,i;return(e=et.exec(this.chunk))||(t="\n"===this.chunk.charAt(0))?(i=this.tokens,n=i[i.length-1],n&&(n[e?"spaced":"newLine"]=!0),e?e[0].length:0):0},e.prototype.newlineToken=function(e){for(;";"===this.value();)this.tokens.pop();return"TERMINATOR"!==this.tag()&&this.token("TERMINATOR","\n",e,0),this},e.prototype.suppressNewlines=function(){return"\\"===this.value()&&this.tokens.pop(),this},e.prototype.literalToken=function(){var e,t,n,s,o,a,c,u,p,d;if((e=_.exec(this.chunk))?(d=e[0],r.test(d)&&this.tagParameters()):d=this.chunk.charAt(0),u=d,n=this.tokens,t=n[n.length-1],"="===d&&t&&(!t[1].reserved&&(s=t[1],ut.call(C,s)>=0)&&(t.origin&&(t=t.origin),this.error("reserved word '"+t[1]+"' can't be assigned",t[2])),"||"===(o=t[1])||"&&"===o))return t[0]="COMPOUND_ASSIGN",t[1]+="=",d.length;if(";"===d)this.seenFor=!1,u="TERMINATOR";else if(ut.call(D,d)>=0)u="MATH";else if(ut.call(h,d)>=0)u="COMPARE";else if(ut.call(l,d)>=0)u="COMPOUND_ASSIGN";else if(ut.call(J,d)>=0)u="UNARY";else if(ut.call(Q,d)>=0)u="UNARY_MATH";else if(ut.call(U,d)>=0)u="SHIFT";else if(ut.call(x,d)>=0||"?"===d&&(null!=t?t.spaced:void 0))u="LOGIC";else if(t&&!t.spaced)if("("===d&&(a=t[0],ut.call(i,a)>=0))"?"===t[0]&&(t[0]="FUNC_EXIST"),u="CALL_START";else if("["===d&&(c=t[0],ut.call(b,c)>=0))switch(u="INDEX_START",t[0]){case"?":t[0]="INDEX_SOAK"}switch(p=this.makeToken(u,d),d){case"(":case"{":case"[":this.ends.push({tag:w[d],origin:p});break;case")":case"}":case"]":this.pair(d)}return this.tokens.push(p),d.length},e.prototype.tagParameters=function(){var e,t,n,i;if(")"!==this.tag())return this;for(t=[],i=this.tokens,e=i.length,i[--e][0]="PARAM_END";n=i[--e];)switch(n[0]){case")":t.push(n);break;case"(":case"CALL_START":if(!t.length)return"("===n[0]?(n[0]="PARAM_START",this):this;t.pop()}return this},e.prototype.closeIndentation=function(){return this.outdentToken(this.indent)},e.prototype.matchWithInterpolations=function(t,n){var i,r,s,o,a,c,h,l,u,p,d,f,m,g,v;if(v=[],l=n.length,this.chunk.slice(0,l)!==n)return null;for(m=this.chunk.slice(l);;){if(g=t.exec(m)[0],this.validateEscapes(g,{isRegex:"/"===n.charAt(0),offsetInChunk:l}),v.push(this.makeToken("NEOSTRING",g,l)),m=m.slice(g.length),l+=g.length,"#{"!==m.slice(0,2))break;p=this.getLineAndColumnFromChunk(l+1),c=p[0],r=p[1],d=(new e).tokenize(m.slice(1),{line:c,column:r,untilBalanced:!0}),h=d.tokens,o=d.index,o+=1,u=h[0],i=h[h.length-1],u[0]=u[1]="(",i[0]=i[1]=")",i.origin=["","end of interpolation",i[2]],"TERMINATOR"===(null!=(f=h[1])?f[0]:void 0)&&h.splice(1,1),v.push(["TOKENS",h]),m=m.slice(o),l+=o}return m.slice(0,n.length)!==n&&this.error("missing "+n,{length:n.length}),s=v[0],a=v[v.length-1],s[2].first_column-=n.length,a[2].last_column+=n.length,0===a[1].length&&(a[2].last_column-=1),{tokens:v,index:l+n.length}},e.prototype.mergeInterpolationTokens=function(e,t,n){var i,r,s,o,a,c,h,l,u,p,d,f,m,g,v,y;for(e.length>1&&(u=this.token("STRING_START","(",0,0)),s=this.tokens.length,o=a=0,h=e.length;h>a;o=++a){switch(g=e[o],m=g[0],y=g[1],m){case"TOKENS":if(2===y.length)continue;l=y[0],v=y;break;case"NEOSTRING":if(i=n(g[1],o),0===i.length){if(0!==o)continue;r=this.tokens.length}2===o&&null!=r&&this.tokens.splice(r,2),g[0]="STRING",g[1]=this.makeDelimitedLiteral(i,t),l=g,v=[g]}this.tokens.length>s&&(p=this.token("+","+"),p[2]={first_line:l[2].first_line,first_column:l[2].first_column,last_line:l[2].first_line,last_column:l[2].first_column}),(d=this.tokens).push.apply(d,v)}return u?(c=e[e.length-1],u.origin=["STRING",null,{first_line:u[2].first_line,first_column:u[2].first_column,last_line:c[2].last_line,last_column:c[2].last_column}],f=this.token("STRING_END",")"),f[2]={first_line:c[2].last_line,first_column:c[2].last_column,last_line:c[2].last_line,last_column:c[2].last_column}):void 0},e.prototype.pair=function(e){var t,n,i,r,s;return i=this.ends,n=i[i.length-1],e!==(s=null!=n?n.tag:void 0)?("OUTDENT"!==s&&this.error("unmatched "+e),r=this.indents,t=r[r.length-1],this.outdentToken(t,!0),this.pair(e)):this.ends.pop()},e.prototype.getLineAndColumnFromChunk=function(e){var t,n,i,r,s;return 0===e?[this.chunkLine,this.chunkColumn]:(s=e>=this.chunk.length?this.chunk:this.chunk.slice(0,+(e-1)+1||9e9),i=nt(s,"\n"),t=this.chunkColumn,i>0?(r=s.split("\n"),n=r[r.length-1],t=n.length):t+=s.length,[this.chunkLine+i,t])},e.prototype.makeToken=function(e,t,n,i){var r,s,o,a,c;return null==n&&(n=0),null==i&&(i=t.length),s={},o=this.getLineAndColumnFromChunk(n),s.first_line=o[0],s.first_column=o[1],r=Math.max(0,i-1),a=this.getLineAndColumnFromChunk(n+r),s.last_line=a[0],s.last_column=a[1],c=[e,t,s]},e.prototype.token=function(e,t,n,i,r){var s;return s=this.makeToken(e,t,n,i),r&&(s.origin=r),this.tokens.push(s),s},e.prototype.tag=function(){var e,t;return e=this.tokens,t=e[e.length-1],null!=t?t[0]:void 0},e.prototype.value=function(){var e,t;return e=this.tokens,t=e[e.length-1],null!=t?t[1]:void 0},e.prototype.unfinished=function(){var e;return L.test(this.chunk)||"\\"===(e=this.tag())||"."===e||"?."===e||"?::"===e||"UNARY"===e||"MATH"===e||"UNARY_MATH"===e||"+"===e||"-"===e||"YIELD"===e||"**"===e||"SHIFT"===e||"RELATION"===e||"COMPARE"===e||"LOGIC"===e||"THROW"===e||"EXTENDS"===e},e.prototype.formatString=function(e){return e.replace(X,"$1")},e.prototype.formatHeregex=function(e){return e.replace(g,"$1$2")},e.prototype.validateEscapes=function(e,t){var n,i,r,s,o,a,c,h;return null==t&&(t={}),s=k.exec(e),!s||(s[0],n=s[1],a=s[2],i=s[3],h=s[4],t.isRegex&&a&&"0"!==a.charAt(0))?void 0:(o=a?"octal escape sequences are not allowed":"invalid escape sequence",r="\\"+(a||i||h),this.error(o+" "+r,{offset:(null!=(c=t.offsetInChunk)?c:0)+s.index+n.length,length:r.length}))},e.prototype.makeDelimitedLiteral=function(e,t){var n;return null==t&&(t={}),""===e&&"/"===t.delimiter&&(e="(?:)"),n=RegExp("(\\\\\\\\)|(\\\\0(?=[1-7]))|\\\\?("+t.delimiter+")|\\\\?(?:(\\n)|(\\r)|(\\u2028)|(\\u2029))|(\\\\.)","g"),e=e.replace(n,function(e,n,i,r,s,o,a,c,h){switch(!1){case!n:return t.double?n+n:n;case!i:return"\\x00";case!r:return"\\"+r;case!s:return"\\n";case!o:return"\\r";case!a:return"\\u2028";case!c:return"\\u2029";case!h:return t.double?"\\"+h:h}}),""+t.delimiter+e+t.delimiter},e.prototype.error=function(e,t){var n,i,r,s,o,a;return null==t&&(t={}),r="first_line"in t?t:(o=this.getLineAndColumnFromChunk(null!=(s=t.offset)?s:0),i=o[0],n=o[1],o,{first_line:i,first_column:n,last_column:n+(null!=(a=t.length)?a:1)-1}),lt(e,r)},e}(),E=["true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","yield","if","else","switch","for","while","do","try","catch","finally","class","extends","super"],a=["undefined","then","unless","until","loop","of","by","when"],o={and:"&&",or:"||",is:"==",isnt:"!=",not:"!",yes:"true",no:"false",on:"true",off:"false"},s=function(){var e;e=[];for(rt in o)e.push(rt);return e}(),a=a.concat(s),V=["case","default","function","var","void","with","const","let","enum","export","import","native","implements","interface","package","private","protected","public","static"],H=["arguments","eval","yield*"],C=E.concat(V).concat(H),e.RESERVED=V.concat(E).concat(a).concat(H),e.STRICT_PROSCRIBED=H,t=65279,v=/^(?!\d)((?:(?!\s)[$\w\x7f-\uffff])+)([^\n\S]*:(?!:))?/,I=/^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i,_=/^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?(\.|::)|\.{2,3})/,et=/^[^\n\S]+/,c=/^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/,r=/^[-=]>/,R=/^(?:\n[^\n\S]*)+/,T=/^`[^\\`]*(?:\\.[^\\`]*)*`/,Y=/^(?:'''|"""|'|")/,W=/^(?:[^\\']|\\[\s\S])*/,q=/^(?:[^\\"#]|\\[\s\S]|\#(?!\{))*/,f=/^(?:[^\\']|\\[\s\S]|'(?!''))*/,p=/^(?:[^\\"#]|\\[\s\S]|"(?!"")|\#(?!\{))*/,X=/((?:\\\\)+)|\\[^\S\n]*\n\s*/g,G=/\s*\n\s*/g,d=/\n+([^\n\S]*)(?=\S)/g,$=/^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)?/,j=/^\w*/,Z=/^(?!.*(.).*\1)[imgy]*$/,m=/^(?:[^\\\/#]|\\[\s\S]|\/(?!\/\/)|\#(?!\{))*/,g=/((?:\\\\)+)|\\(\s)|\s+(?:#.*)?/g,M=/^(\/|\/{3}\s*)(\*)/,O=/^\/=?\s/,u=/\*\//,L=/^\s*(?:,|\??\.(?![.\d])|::)/,k=/((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7]|[1-7])|(x(?![\da-fA-F]{2}).{0,2})|(u(?![\da-fA-F]{4}).{0,4}))/,F=/^[^\n\S]*\n/,K=/\n[^\n\S]*$/,z=/\s+$/,l=["-=","+=","/=","*=","%=","||=","&&=","?=","<<=",">>=",">>>=","&=","^=","|=","**=","//=","%%="],J=["NEW","TYPEOF","DELETE","DO"],Q=["!","~"],x=["&&","||","&","|","^"],U=["<<",">>",">>>"],h=["==","!=","<",">","<=",">="],D=["*","/","%","//","%%"],B=["IN","OF","INSTANCEOF"],n=["TRUE","FALSE"],i=["IDENTIFIER",")","]","?","@","THIS","SUPER"],b=i.concat(["NUMBER","STRING","STRING_END","REGEX","REGEX_END","BOOL","NULL","UNDEFINED","}","::"]),A=b.concat(["++","--"]),N=["INDENT","OUTDENT","TERMINATOR"],y=[")","}","]"]}.call(this),t.exports}(),_dereq_["./parser"]=function(){var e={},t={exports:e},n=function(){function e(){this.yy={}}var t=function(e,t,n,i){for(n=n||{},i=e.length;i--;n[e[i]]=t);return n},n=[1,20],i=[1,75],r=[1,71],s=[1,76],o=[1,77],a=[1,73],c=[1,74],h=[1,50],l=[1,52],u=[1,53],p=[1,54],d=[1,55],f=[1,45],m=[1,46],g=[1,27],v=[1,60],y=[1,61],b=[1,70],k=[1,43],w=[1,26],T=[1,58],C=[1,59],E=[1,57],F=[1,38],N=[1,44],L=[1,56],x=[1,65],S=[1,66],D=[1,67],R=[1,68],A=[1,42],I=[1,64],_=[1,29],O=[1,30],$=[1,31],j=[1,32],M=[1,33],B=[1,34],V=[1,35],P=[1,78],U=[1,6,26,34,108],G=[1,88],H=[1,81],q=[1,80],X=[1,79],W=[1,82],Y=[1,83],K=[1,84],z=[1,85],J=[1,86],Q=[1,87],Z=[1,91],et=[1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,135,136,141,142,143,144,145,146,147],tt=[1,97],nt=[1,98],it=[1,99],rt=[1,100],st=[1,102],ot=[1,103],at=[1,96],ct=[2,112],ht=[1,6,25,26,34,55,60,63,72,73,74,75,77,79,80,84,90,91,92,97,99,108,110,111,112,116,117,132,135,136,141,142,143,144,145,146,147],lt=[2,79],ut=[1,108],pt=[2,58],dt=[1,112],ft=[1,117],mt=[1,118],gt=[1,120],vt=[1,6,25,26,34,46,55,60,63,72,73,74,75,77,79,80,84,90,91,92,97,99,108,110,111,112,116,117,132,135,136,141,142,143,144,145,146,147],yt=[2,76],bt=[1,6,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,135,136,141,142,143,144,145,146,147],kt=[1,155],wt=[1,157],Tt=[1,152],Ct=[1,6,25,26,34,46,55,60,63,72,73,74,75,77,79,80,84,86,90,91,92,97,99,108,110,111,112,116,117,132,135,136,139,140,141,142,143,144,145,146,147,148],Et=[2,95],Ft=[1,6,25,26,34,49,55,60,63,72,73,74,75,77,79,80,84,90,91,92,97,99,108,110,111,112,116,117,132,135,136,141,142,143,144,145,146,147],Nt=[1,6,25,26,34,46,49,55,60,63,72,73,74,75,77,79,80,84,86,90,91,92,97,99,108,110,111,112,116,117,123,124,132,135,136,139,140,141,142,143,144,145,146,147,148],Lt=[1,206],xt=[1,205],St=[1,6,25,26,34,38,55,60,63,72,73,74,75,77,79,80,84,90,91,92,97,99,108,110,111,112,116,117,132,135,136,141,142,143,144,145,146,147],Dt=[2,56],Rt=[1,216],At=[6,25,26,55,60],It=[6,25,26,46,55,60,63],_t=[1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,135,136,142,144,145,146,147],Ot=[1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132],$t=[72,73,74,75,77,80,90,91],jt=[1,235],Mt=[2,133],Bt=[1,6,25,26,34,46,55,60,63,72,73,74,75,77,79,80,84,90,91,92,97,99,108,110,111,112,116,117,123,124,132,135,136,141,142,143,144,145,146,147],Vt=[1,244],Pt=[6,25,26,60,92,97],Ut=[1,6,25,26,34,55,60,63,79,84,92,97,99,108,117,132],Gt=[1,6,25,26,34,55,60,63,79,84,92,97,99,108,111,117,132],Ht=[123,124],qt=[60,123,124],Xt=[1,255],Wt=[6,25,26,60,84],Yt=[6,25,26,49,60,84],Kt=[1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,135,136,144,145,146,147],zt=[11,28,30,32,33,36,37,40,41,42,43,44,51,52,53,57,58,79,82,85,89,94,95,96,102,106,107,110,112,114,116,125,131,133,134,135,136,137,139,140],Jt=[2,122],Qt=[6,25,26],Zt=[2,57],en=[1,268],tn=[1,269],nn=[1,6,25,26,34,55,60,63,79,84,92,97,99,104,105,108,110,111,112,116,117,127,129,132,135,136,141,142,143,144,145,146,147],rn=[26,127,129],sn=[1,6,26,34,55,60,63,79,84,92,97,99,108,111,117,132],on=[2,71],an=[1,291],cn=[1,292],hn=[1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,127,132,135,136,141,142,143,144,145,146,147],ln=[1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,112,116,117,132],un=[1,303],pn=[1,304],dn=[6,25,26,60],fn=[1,6,25,26,34,55,60,63,79,84,92,97,99,104,108,110,111,112,116,117,132,135,136,141,142,143,144,145,146,147],mn=[25,60],gn={trace:function(){},yy:{},symbols_:{error:2,Root:3,Body:4,Line:5,TERMINATOR:6,Expression:7,Statement:8,Return:9,Comment:10,STATEMENT:11,Value:12,Invocation:13,Code:14,Operation:15,Assign:16,If:17,Try:18,While:19,For:20,Switch:21,Class:22,Throw:23,Block:24,INDENT:25,OUTDENT:26,Identifier:27,IDENTIFIER:28,AlphaNumeric:29,NUMBER:30,String:31,STRING:32,STRING_START:33,STRING_END:34,Regex:35,REGEX:36,REGEX_START:37,REGEX_END:38,Literal:39,JS:40,DEBUGGER:41,UNDEFINED:42,NULL:43,BOOL:44,Assignable:45,"=":46,AssignObj:47,ObjAssignable:48,":":49,ThisProperty:50,RETURN:51,HERECOMMENT:52,PARAM_START:53,ParamList:54,PARAM_END:55,FuncGlyph:56,"->":57,"=>":58,OptComma:59,",":60,Param:61,ParamVar:62,"...":63,Array:64,Object:65,Splat:66,SimpleAssignable:67,Accessor:68,Parenthetical:69,Range:70,This:71,".":72,"?.":73,"::":74,"?::":75,Index:76,INDEX_START:77,IndexValue:78,INDEX_END:79,INDEX_SOAK:80,Slice:81,"{":82,AssignList:83,"}":84,CLASS:85,EXTENDS:86,OptFuncExist:87,Arguments:88,SUPER:89,FUNC_EXIST:90,CALL_START:91,CALL_END:92,ArgList:93,THIS:94,"@":95,"[":96,"]":97,RangeDots:98,"..":99,Arg:100,SimpleArgs:101,TRY:102,Catch:103,FINALLY:104,CATCH:105,THROW:106,"(":107,")":108,WhileSource:109,WHILE:110,WHEN:111,UNTIL:112,Loop:113,LOOP:114,ForBody:115,FOR:116,BY:117,ForStart:118,ForSource:119,ForVariables:120,OWN:121,ForValue:122,FORIN:123,FOROF:124,SWITCH:125,Whens:126,ELSE:127,When:128,LEADING_WHEN:129,IfBlock:130,IF:131,POST_IF:132,UNARY:133,UNARY_MATH:134,"-":135,"+":136,YIELD:137,FROM:138,"--":139,"++":140,"?":141,MATH:142,"**":143,SHIFT:144,COMPARE:145,LOGIC:146,RELATION:147,COMPOUND_ASSIGN:148,$accept:0,$end:1},terminals_:{2:"error",6:"TERMINATOR",11:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",32:"STRING",33:"STRING_START",34:"STRING_END",36:"REGEX",37:"REGEX_START",38:"REGEX_END",40:"JS",41:"DEBUGGER",42:"UNDEFINED",43:"NULL",44:"BOOL",46:"=",49:":",51:"RETURN",52:"HERECOMMENT",53:"PARAM_START",55:"PARAM_END",57:"->",58:"=>",60:",",63:"...",72:".",73:"?.",74:"::",75:"?::",77:"INDEX_START",79:"INDEX_END",80:"INDEX_SOAK",82:"{",84:"}",85:"CLASS",86:"EXTENDS",89:"SUPER",90:"FUNC_EXIST",91:"CALL_START",92:"CALL_END",94:"THIS",95:"@",96:"[",97:"]",99:"..",102:"TRY",104:"FINALLY",105:"CATCH",106:"THROW",107:"(",108:")",110:"WHILE",111:"WHEN",112:"UNTIL",114:"LOOP",116:"FOR",117:"BY",121:"OWN",123:"FORIN",124:"FOROF",125:"SWITCH",127:"ELSE",129:"LEADING_WHEN",131:"IF",132:"POST_IF",133:"UNARY",134:"UNARY_MATH",135:"-",136:"+",137:"YIELD",138:"FROM",139:"--",140:"++",141:"?",142:"MATH",143:"**",144:"SHIFT",145:"COMPARE",146:"LOGIC",147:"RELATION",148:"COMPOUND_ASSIGN"},productions_:[0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[24,2],[24,3],[27,1],[29,1],[29,1],[31,1],[31,3],[35,1],[35,3],[39,1],[39,1],[39,1],[39,1],[39,1],[39,1],[39,1],[16,3],[16,4],[16,5],[47,1],[47,3],[47,5],[47,1],[48,1],[48,1],[48,1],[9,2],[9,1],[10,1],[14,5],[14,2],[56,1],[56,1],[59,0],[59,1],[54,0],[54,1],[54,3],[54,4],[54,6],[61,1],[61,2],[61,3],[61,1],[62,1],[62,1],[62,1],[62,1],[66,2],[67,1],[67,2],[67,2],[67,1],[45,1],[45,1],[45,1],[12,1],[12,1],[12,1],[12,1],[12,1],[68,2],[68,2],[68,2],[68,2],[68,1],[68,1],[76,3],[76,2],[78,1],[78,1],[65,4],[83,0],[83,1],[83,3],[83,4],[83,6],[22,1],[22,2],[22,3],[22,4],[22,2],[22,3],[22,4],[22,5],[13,3],[13,3],[13,1],[13,2],[87,0],[87,1],[88,2],[88,4],[71,1],[71,1],[50,2],[64,2],[64,4],[98,1],[98,1],[70,5],[81,3],[81,2],[81,2],[81,1],[93,1],[93,3],[93,4],[93,4],[93,6],[100,1],[100,1],[100,1],[101,1],[101,3],[18,2],[18,3],[18,4],[18,5],[103,3],[103,3],[103,2],[23,2],[69,3],[69,5],[109,2],[109,4],[109,2],[109,4],[19,2],[19,2],[19,2],[19,1],[113,2],[113,2],[20,2],[20,2],[20,2],[115,2],[115,4],[115,2],[118,2],[118,3],[122,1],[122,1],[122,1],[122,1],[120,1],[120,3],[119,2],[119,2],[119,4],[119,4],[119,4],[119,6],[119,6],[21,5],[21,7],[21,4],[21,6],[126,1],[126,2],[128,3],[128,4],[130,3],[130,5],[17,1],[17,3],[17,3],[17,3],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,3],[15,2],[15,2],[15,2],[15,2],[15,2],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,5],[15,4],[15,3]],performAction:function(e,t,n,i,r,s,o){var a=s.length-1; +switch(r){case 1:return this.$=i.addLocationDataFn(o[a],o[a])(new i.Block);case 2:return this.$=s[a];case 3:this.$=i.addLocationDataFn(o[a],o[a])(i.Block.wrap([s[a]]));break;case 4:this.$=i.addLocationDataFn(o[a-2],o[a])(s[a-2].push(s[a]));break;case 5:this.$=s[a-1];break;case 6:case 7:case 8:case 9:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 27:case 32:case 34:case 45:case 46:case 47:case 48:case 56:case 57:case 67:case 68:case 69:case 70:case 75:case 76:case 79:case 83:case 89:case 133:case 134:case 136:case 166:case 167:case 183:case 189:this.$=s[a];break;case 10:case 25:case 26:case 28:case 30:case 33:case 35:this.$=i.addLocationDataFn(o[a],o[a])(new i.Literal(s[a]));break;case 23:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Block);break;case 24:case 31:case 90:this.$=i.addLocationDataFn(o[a-2],o[a])(s[a-1]);break;case 29:case 146:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Parens(s[a-1]));break;case 36:this.$=i.addLocationDataFn(o[a],o[a])(new i.Undefined);break;case 37:this.$=i.addLocationDataFn(o[a],o[a])(new i.Null);break;case 38:this.$=i.addLocationDataFn(o[a],o[a])(new i.Bool(s[a]));break;case 39:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Assign(s[a-2],s[a]));break;case 40:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Assign(s[a-3],s[a]));break;case 41:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Assign(s[a-4],s[a-1]));break;case 42:case 72:case 77:case 78:case 80:case 81:case 82:case 168:case 169:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(s[a]));break;case 43:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Assign(i.addLocationDataFn(o[a-2])(new i.Value(s[a-2])),s[a],"object"));break;case 44:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Assign(i.addLocationDataFn(o[a-4])(new i.Value(s[a-4])),s[a-1],"object"));break;case 49:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Return(s[a]));break;case 50:this.$=i.addLocationDataFn(o[a],o[a])(new i.Return);break;case 51:this.$=i.addLocationDataFn(o[a],o[a])(new i.Comment(s[a]));break;case 52:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Code(s[a-3],s[a],s[a-1]));break;case 53:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Code([],s[a],s[a-1]));break;case 54:this.$=i.addLocationDataFn(o[a],o[a])("func");break;case 55:this.$=i.addLocationDataFn(o[a],o[a])("boundfunc");break;case 58:case 95:this.$=i.addLocationDataFn(o[a],o[a])([]);break;case 59:case 96:case 128:case 170:this.$=i.addLocationDataFn(o[a],o[a])([s[a]]);break;case 60:case 97:case 129:this.$=i.addLocationDataFn(o[a-2],o[a])(s[a-2].concat(s[a]));break;case 61:case 98:case 130:this.$=i.addLocationDataFn(o[a-3],o[a])(s[a-3].concat(s[a]));break;case 62:case 99:case 132:this.$=i.addLocationDataFn(o[a-5],o[a])(s[a-5].concat(s[a-2]));break;case 63:this.$=i.addLocationDataFn(o[a],o[a])(new i.Param(s[a]));break;case 64:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Param(s[a-1],null,!0));break;case 65:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Param(s[a-2],s[a]));break;case 66:case 135:this.$=i.addLocationDataFn(o[a],o[a])(new i.Expansion);break;case 71:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Splat(s[a-1]));break;case 73:this.$=i.addLocationDataFn(o[a-1],o[a])(s[a-1].add(s[a]));break;case 74:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Value(s[a-1],[].concat(s[a])));break;case 84:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Access(s[a]));break;case 85:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Access(s[a],"soak"));break;case 86:this.$=i.addLocationDataFn(o[a-1],o[a])([i.addLocationDataFn(o[a-1])(new i.Access(new i.Literal("prototype"))),i.addLocationDataFn(o[a])(new i.Access(s[a]))]);break;case 87:this.$=i.addLocationDataFn(o[a-1],o[a])([i.addLocationDataFn(o[a-1])(new i.Access(new i.Literal("prototype"),"soak")),i.addLocationDataFn(o[a])(new i.Access(s[a]))]);break;case 88:this.$=i.addLocationDataFn(o[a],o[a])(new i.Access(new i.Literal("prototype")));break;case 91:this.$=i.addLocationDataFn(o[a-1],o[a])(i.extend(s[a],{soak:!0}));break;case 92:this.$=i.addLocationDataFn(o[a],o[a])(new i.Index(s[a]));break;case 93:this.$=i.addLocationDataFn(o[a],o[a])(new i.Slice(s[a]));break;case 94:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Obj(s[a-2],s[a-3].generated));break;case 100:this.$=i.addLocationDataFn(o[a],o[a])(new i.Class);break;case 101:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Class(null,null,s[a]));break;case 102:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Class(null,s[a]));break;case 103:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Class(null,s[a-1],s[a]));break;case 104:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Class(s[a]));break;case 105:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Class(s[a-1],null,s[a]));break;case 106:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Class(s[a-2],s[a]));break;case 107:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Class(s[a-3],s[a-1],s[a]));break;case 108:case 109:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Call(s[a-2],s[a],s[a-1]));break;case 110:this.$=i.addLocationDataFn(o[a],o[a])(new i.Call("super",[new i.Splat(new i.Literal("arguments"))]));break;case 111:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Call("super",s[a]));break;case 112:this.$=i.addLocationDataFn(o[a],o[a])(!1);break;case 113:this.$=i.addLocationDataFn(o[a],o[a])(!0);break;case 114:this.$=i.addLocationDataFn(o[a-1],o[a])([]);break;case 115:case 131:this.$=i.addLocationDataFn(o[a-3],o[a])(s[a-2]);break;case 116:case 117:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(new i.Literal("this")));break;case 118:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Value(i.addLocationDataFn(o[a-1])(new i.Literal("this")),[i.addLocationDataFn(o[a])(new i.Access(s[a]))],"this"));break;case 119:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Arr([]));break;case 120:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Arr(s[a-2]));break;case 121:this.$=i.addLocationDataFn(o[a],o[a])("inclusive");break;case 122:this.$=i.addLocationDataFn(o[a],o[a])("exclusive");break;case 123:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Range(s[a-3],s[a-1],s[a-2]));break;case 124:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Range(s[a-2],s[a],s[a-1]));break;case 125:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Range(s[a-1],null,s[a]));break;case 126:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Range(null,s[a],s[a-1]));break;case 127:this.$=i.addLocationDataFn(o[a],o[a])(new i.Range(null,null,s[a]));break;case 137:this.$=i.addLocationDataFn(o[a-2],o[a])([].concat(s[a-2],s[a]));break;case 138:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Try(s[a]));break;case 139:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Try(s[a-1],s[a][0],s[a][1]));break;case 140:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Try(s[a-2],null,null,s[a]));break;case 141:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Try(s[a-3],s[a-2][0],s[a-2][1],s[a]));break;case 142:this.$=i.addLocationDataFn(o[a-2],o[a])([s[a-1],s[a]]);break;case 143:this.$=i.addLocationDataFn(o[a-2],o[a])([i.addLocationDataFn(o[a-1])(new i.Value(s[a-1])),s[a]]);break;case 144:this.$=i.addLocationDataFn(o[a-1],o[a])([null,s[a]]);break;case 145:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Throw(s[a]));break;case 147:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Parens(s[a-2]));break;case 148:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.While(s[a]));break;case 149:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.While(s[a-2],{guard:s[a]}));break;case 150:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.While(s[a],{invert:!0}));break;case 151:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.While(s[a-2],{invert:!0,guard:s[a]}));break;case 152:this.$=i.addLocationDataFn(o[a-1],o[a])(s[a-1].addBody(s[a]));break;case 153:case 154:this.$=i.addLocationDataFn(o[a-1],o[a])(s[a].addBody(i.addLocationDataFn(o[a-1])(i.Block.wrap([s[a-1]]))));break;case 155:this.$=i.addLocationDataFn(o[a],o[a])(s[a]);break;case 156:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.While(i.addLocationDataFn(o[a-1])(new i.Literal("true"))).addBody(s[a]));break;case 157:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.While(i.addLocationDataFn(o[a-1])(new i.Literal("true"))).addBody(i.addLocationDataFn(o[a])(i.Block.wrap([s[a]]))));break;case 158:case 159:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.For(s[a-1],s[a]));break;case 160:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.For(s[a],s[a-1]));break;case 161:this.$=i.addLocationDataFn(o[a-1],o[a])({source:i.addLocationDataFn(o[a])(new i.Value(s[a]))});break;case 162:this.$=i.addLocationDataFn(o[a-3],o[a])({source:i.addLocationDataFn(o[a-2])(new i.Value(s[a-2])),step:s[a]});break;case 163:this.$=i.addLocationDataFn(o[a-1],o[a])(function(){return s[a].own=s[a-1].own,s[a].name=s[a-1][0],s[a].index=s[a-1][1],s[a]}());break;case 164:this.$=i.addLocationDataFn(o[a-1],o[a])(s[a]);break;case 165:this.$=i.addLocationDataFn(o[a-2],o[a])(function(){return s[a].own=!0,s[a]}());break;case 171:this.$=i.addLocationDataFn(o[a-2],o[a])([s[a-2],s[a]]);break;case 172:this.$=i.addLocationDataFn(o[a-1],o[a])({source:s[a]});break;case 173:this.$=i.addLocationDataFn(o[a-1],o[a])({source:s[a],object:!0});break;case 174:this.$=i.addLocationDataFn(o[a-3],o[a])({source:s[a-2],guard:s[a]});break;case 175:this.$=i.addLocationDataFn(o[a-3],o[a])({source:s[a-2],guard:s[a],object:!0});break;case 176:this.$=i.addLocationDataFn(o[a-3],o[a])({source:s[a-2],step:s[a]});break;case 177:this.$=i.addLocationDataFn(o[a-5],o[a])({source:s[a-4],guard:s[a-2],step:s[a]});break;case 178:this.$=i.addLocationDataFn(o[a-5],o[a])({source:s[a-4],step:s[a-2],guard:s[a]});break;case 179:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Switch(s[a-3],s[a-1]));break;case 180:this.$=i.addLocationDataFn(o[a-6],o[a])(new i.Switch(s[a-5],s[a-3],s[a-1]));break;case 181:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Switch(null,s[a-1]));break;case 182:this.$=i.addLocationDataFn(o[a-5],o[a])(new i.Switch(null,s[a-3],s[a-1]));break;case 184:this.$=i.addLocationDataFn(o[a-1],o[a])(s[a-1].concat(s[a]));break;case 185:this.$=i.addLocationDataFn(o[a-2],o[a])([[s[a-1],s[a]]]);break;case 186:this.$=i.addLocationDataFn(o[a-3],o[a])([[s[a-2],s[a-1]]]);break;case 187:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.If(s[a-1],s[a],{type:s[a-2]}));break;case 188:this.$=i.addLocationDataFn(o[a-4],o[a])(s[a-4].addElse(i.addLocationDataFn(o[a-2],o[a])(new i.If(s[a-1],s[a],{type:s[a-2]}))));break;case 190:this.$=i.addLocationDataFn(o[a-2],o[a])(s[a-2].addElse(s[a]));break;case 191:case 192:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.If(s[a],i.addLocationDataFn(o[a-2])(i.Block.wrap([s[a-2]])),{type:s[a-1],statement:!0}));break;case 193:case 194:case 197:case 198:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op(s[a-1],s[a]));break;case 195:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("-",s[a]));break;case 196:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("+",s[a]));break;case 199:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op(s[a-2].concat(s[a-1]),s[a]));break;case 200:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("--",s[a]));break;case 201:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("++",s[a]));break;case 202:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("--",s[a-1],null,!0));break;case 203:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("++",s[a-1],null,!0));break;case 204:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Existence(s[a-1]));break;case 205:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op("+",s[a-2],s[a]));break;case 206:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op("-",s[a-2],s[a]));break;case 207:case 208:case 209:case 210:case 211:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op(s[a-1],s[a-2],s[a]));break;case 212:this.$=i.addLocationDataFn(o[a-2],o[a])(function(){return"!"===s[a-1].charAt(0)?new i.Op(s[a-1].slice(1),s[a-2],s[a]).invert():new i.Op(s[a-1],s[a-2],s[a])}());break;case 213:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Assign(s[a-2],s[a],s[a-1]));break;case 214:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Assign(s[a-4],s[a-1],s[a-3]));break;case 215:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Assign(s[a-3],s[a],s[a-2]));break;case 216:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Extends(s[a-2],s[a]))}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{1:[3]},{1:[2,2],6:P},t(U,[2,3]),t(U,[2,6],{118:69,109:89,115:90,110:x,112:S,116:R,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(U,[2,7],{118:69,109:92,115:93,110:x,112:S,116:R,132:Z}),t(et,[2,11],{87:94,68:95,76:101,72:tt,73:nt,74:it,75:rt,77:st,80:ot,90:at,91:ct}),t(et,[2,12],{76:101,87:104,68:105,72:tt,73:nt,74:it,75:rt,77:st,80:ot,90:at,91:ct}),t(et,[2,13]),t(et,[2,14]),t(et,[2,15]),t(et,[2,16]),t(et,[2,17]),t(et,[2,18]),t(et,[2,19]),t(et,[2,20]),t(et,[2,21]),t(et,[2,22]),t(et,[2,8]),t(et,[2,9]),t(et,[2,10]),t(ht,lt,{46:[1,106]}),t(ht,[2,80]),t(ht,[2,81]),t(ht,[2,82]),t(ht,[2,83]),t([1,6,25,26,34,38,55,60,63,72,73,74,75,77,79,80,84,90,92,97,99,108,110,111,112,116,117,132,135,136,141,142,143,144,145,146,147],[2,110],{88:107,91:ut}),t([6,25,55,60],pt,{54:109,61:110,62:111,27:113,50:114,64:115,65:116,28:i,63:dt,82:b,95:ft,96:mt}),{24:119,25:gt},{7:121,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:123,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:124,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:125,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:127,8:126,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,138:[1,128],139:B,140:V},{12:130,13:131,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:132,50:63,64:47,65:48,67:129,69:23,70:24,71:25,82:b,89:w,94:T,95:C,96:E,107:L},{12:130,13:131,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:132,50:63,64:47,65:48,67:133,69:23,70:24,71:25,82:b,89:w,94:T,95:C,96:E,107:L},t(vt,yt,{86:[1,137],139:[1,134],140:[1,135],148:[1,136]}),t(et,[2,189],{127:[1,138]}),{24:139,25:gt},{24:140,25:gt},t(et,[2,155]),{24:141,25:gt},{7:142,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(bt,[2,100],{39:22,69:23,70:24,71:25,64:47,65:48,29:49,35:51,27:62,50:63,31:72,12:130,13:131,45:132,24:144,67:146,25:gt,28:i,30:r,32:s,33:o,36:a,37:c,40:h,41:l,42:u,43:p,44:d,82:b,86:[1,145],89:w,94:T,95:C,96:E,107:L}),{7:147,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,141,142,143,144,145,146,147],[2,50],{12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,9:18,10:19,45:21,39:22,69:23,70:24,71:25,56:28,67:36,130:37,109:39,113:40,115:41,64:47,65:48,29:49,35:51,27:62,50:63,118:69,31:72,8:122,7:148,11:n,28:i,30:r,32:s,33:o,36:a,37:c,40:h,41:l,42:u,43:p,44:d,51:f,52:m,53:g,57:v,58:y,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,114:D,125:A,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V}),t(et,[2,51]),t(vt,[2,77]),t(vt,[2,78]),t(ht,[2,32]),t(ht,[2,33]),t(ht,[2,34]),t(ht,[2,35]),t(ht,[2,36]),t(ht,[2,37]),t(ht,[2,38]),{4:149,5:3,7:4,8:5,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,150],27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:151,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:kt,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,63:wt,64:47,65:48,66:156,67:36,69:23,70:24,71:25,82:b,85:k,89:w,93:153,94:T,95:C,96:E,97:Tt,100:154,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(ht,[2,116]),t(ht,[2,117],{27:158,28:i}),{25:[2,54]},{25:[2,55]},t(Ct,[2,72]),t(Ct,[2,75]),{7:159,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:160,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:161,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:163,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:162,25:gt,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{27:168,28:i,50:169,64:170,65:171,70:164,82:b,95:ft,96:E,120:165,121:[1,166],122:167},{119:172,123:[1,173],124:[1,174]},t([6,25,60,84],Et,{31:72,83:175,47:176,48:177,10:178,27:179,29:180,50:181,28:i,30:r,32:s,33:o,52:m,95:ft}),t(Ft,[2,26]),t(Ft,[2,27]),t(ht,[2,30]),{12:130,13:182,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:132,50:63,64:47,65:48,67:183,69:23,70:24,71:25,82:b,89:w,94:T,95:C,96:E,107:L},t(Nt,[2,25]),t(Ft,[2,28]),{4:184,5:3,7:4,8:5,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(U,[2,5],{7:4,8:5,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,9:18,10:19,45:21,39:22,69:23,70:24,71:25,56:28,67:36,130:37,109:39,113:40,115:41,64:47,65:48,29:49,35:51,27:62,50:63,118:69,31:72,5:185,11:n,28:i,30:r,32:s,33:o,36:a,37:c,40:h,41:l,42:u,43:p,44:d,51:f,52:m,53:g,57:v,58:y,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,110:x,112:S,114:D,116:R,125:A,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V}),t(et,[2,204]),{7:186,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:187,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:188,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:189,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:190,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:191,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:192,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:193,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:194,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(et,[2,154]),t(et,[2,159]),{7:195,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(et,[2,153]),t(et,[2,158]),{88:196,91:ut},t(Ct,[2,73]),{91:[2,113]},{27:197,28:i},{27:198,28:i},t(Ct,[2,88],{27:199,28:i}),{27:200,28:i},t(Ct,[2,89]),{7:202,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,63:Lt,64:47,65:48,67:36,69:23,70:24,71:25,78:201,81:203,82:b,85:k,89:w,94:T,95:C,96:E,98:204,99:xt,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{76:207,77:st,80:ot},{88:208,91:ut},t(Ct,[2,74]),{6:[1,210],7:209,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,211],27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(St,[2,111]),{7:214,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:kt,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,63:wt,64:47,65:48,66:156,67:36,69:23,70:24,71:25,82:b,85:k,89:w,92:[1,212],93:213,94:T,95:C,96:E,100:154,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t([6,25],Dt,{59:217,55:[1,215],60:Rt}),t(At,[2,59]),t(At,[2,63],{46:[1,219],63:[1,218]}),t(At,[2,66]),t(It,[2,67]),t(It,[2,68]),t(It,[2,69]),t(It,[2,70]),{27:158,28:i},{7:214,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:kt,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,63:wt,64:47,65:48,66:156,67:36,69:23,70:24,71:25,82:b,85:k,89:w,93:153,94:T,95:C,96:E,97:Tt,100:154,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(et,[2,53]),{4:221,5:3,7:4,8:5,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[1,220],27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,135,136,142,143,144,145,146,147],[2,193],{118:69,109:89,115:90,141:X}),{109:92,110:x,112:S,115:93,116:R,118:69,132:Z},t(_t,[2,194],{118:69,109:89,115:90,141:X,143:Y}),t(_t,[2,195],{118:69,109:89,115:90,141:X,143:Y}),t(_t,[2,196],{118:69,109:89,115:90,141:X,143:Y}),t(et,[2,197],{118:69,109:92,115:93}),t(Ot,[2,198],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{7:222,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(et,[2,200],{72:yt,73:yt,74:yt,75:yt,77:yt,80:yt,90:yt,91:yt}),{68:95,72:tt,73:nt,74:it,75:rt,76:101,77:st,80:ot,87:94,90:at,91:ct},{68:105,72:tt,73:nt,74:it,75:rt,76:101,77:st,80:ot,87:104,90:at,91:ct},t($t,lt),t(et,[2,201],{72:yt,73:yt,74:yt,75:yt,77:yt,80:yt,90:yt,91:yt}),t(et,[2,202]),t(et,[2,203]),{6:[1,225],7:223,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,224],27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:226,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{24:227,25:gt,131:[1,228]},t(et,[2,138],{103:229,104:[1,230],105:[1,231]}),t(et,[2,152]),t(et,[2,160]),{25:[1,232],109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},{126:233,128:234,129:jt},t(et,[2,101]),{7:236,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(bt,[2,104],{24:237,25:gt,72:yt,73:yt,74:yt,75:yt,77:yt,80:yt,90:yt,91:yt,86:[1,238]}),t(Ot,[2,145],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Ot,[2,49],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{6:P,108:[1,239]},{4:240,5:3,7:4,8:5,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t([6,25,60,97],Mt,{118:69,109:89,115:90,98:241,63:[1,242],99:xt,110:x,112:S,116:R,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Bt,[2,119]),t([6,25,97],Dt,{59:243,60:Vt}),t(Pt,[2,128]),{7:214,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:kt,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,63:wt,64:47,65:48,66:156,67:36,69:23,70:24,71:25,82:b,85:k,89:w,93:245,94:T,95:C,96:E,100:154,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(Pt,[2,134]),t(Pt,[2,135]),t(Nt,[2,118]),{24:246,25:gt,109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},t(Ut,[2,148],{118:69,109:89,115:90,110:x,111:[1,247],112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Ut,[2,150],{118:69,109:89,115:90,110:x,111:[1,248],112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(et,[2,156]),t(Gt,[2,157],{118:69,109:89,115:90,110:x,112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,132,135,136,141,142,143,144,145,146,147],[2,161],{117:[1,249]}),t(Ht,[2,164]),{27:168,28:i,50:169,64:170,65:171,82:b,95:ft,96:mt,120:250,122:167},t(Ht,[2,170],{60:[1,251]}),t(qt,[2,166]),t(qt,[2,167]),t(qt,[2,168]),t(qt,[2,169]),t(et,[2,163]),{7:252,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:253,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t([6,25,84],Dt,{59:254,60:Xt}),t(Wt,[2,96]),t(Wt,[2,42],{49:[1,256]}),t(Wt,[2,45]),t(Yt,[2,46]),t(Yt,[2,47]),t(Yt,[2,48]),{38:[1,257],68:105,72:tt,73:nt,74:it,75:rt,76:101,77:st,80:ot,87:104,90:at,91:ct},t($t,yt),{6:P,34:[1,258]},t(U,[2,4]),t(Kt,[2,205],{118:69,109:89,115:90,141:X,142:W,143:Y}),t(Kt,[2,206],{118:69,109:89,115:90,141:X,142:W,143:Y}),t(_t,[2,207],{118:69,109:89,115:90,141:X,143:Y}),t(_t,[2,208],{118:69,109:89,115:90,141:X,143:Y}),t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,144,145,146,147],[2,209],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y}),t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,145,146],[2,210],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,147:Q}),t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,146],[2,211],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,147:Q}),t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,117,132,145,146,147],[2,212],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K}),t(Gt,[2,192],{118:69,109:89,115:90,110:x,112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Gt,[2,191],{118:69,109:89,115:90,110:x,112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(St,[2,108]),t(Ct,[2,84]),t(Ct,[2,85]),t(Ct,[2,86]),t(Ct,[2,87]),{79:[1,259]},{63:Lt,79:[2,92],98:260,99:xt,109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},{79:[2,93]},{7:261,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,79:[2,127],82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(zt,[2,121]),t(zt,Jt),t(Ct,[2,91]),t(St,[2,109]),t(Ot,[2,39],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{7:262,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:263,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(St,[2,114]),t([6,25,92],Dt,{59:264,60:Vt}),t(Pt,Mt,{118:69,109:89,115:90,63:[1,265],110:x,112:S,116:R,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{56:266,57:v,58:y},t(Qt,Zt,{62:111,27:113,50:114,64:115,65:116,61:267,28:i,63:dt,82:b,95:ft,96:mt}),{6:en,25:tn},t(At,[2,64]),{7:270,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(nn,[2,23]),{6:P,26:[1,271]},t(Ot,[2,199],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Ot,[2,213],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{7:272,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:273,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(Ot,[2,216],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(et,[2,190]),{7:274,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(et,[2,139],{104:[1,275]}),{24:276,25:gt},{24:279,25:gt,27:277,28:i,65:278,82:b},{126:280,128:234,129:jt},{26:[1,281],127:[1,282],128:283,129:jt},t(rn,[2,183]),{7:285,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,101:284,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(sn,[2,102],{118:69,109:89,115:90,24:286,25:gt,110:x,112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(et,[2,105]),{7:287,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(ht,[2,146]),{6:P,26:[1,288]},{7:289,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t([11,28,30,32,33,36,37,40,41,42,43,44,51,52,53,57,58,82,85,89,94,95,96,102,106,107,110,112,114,116,125,131,133,134,135,136,137,139,140],Jt,{6:on,25:on,60:on,97:on}),{6:an,25:cn,97:[1,290]},t([6,25,26,92,97],Zt,{12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,9:18,10:19,45:21,39:22,69:23,70:24,71:25,56:28,67:36,130:37,109:39,113:40,115:41,64:47,65:48,29:49,35:51,27:62,50:63,118:69,31:72,8:122,66:156,7:214,100:293,11:n,28:i,30:r,32:s,33:o,36:a,37:c,40:h,41:l,42:u,43:p,44:d,51:f,52:m,53:g,57:v,58:y,63:wt,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,110:x,112:S,114:D,116:R,125:A,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V}),t(Qt,Dt,{59:294,60:Vt}),t(hn,[2,187]),{7:295,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:296,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:297,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(Ht,[2,165]),{27:168,28:i,50:169,64:170,65:171,82:b,95:ft,96:mt,122:298},t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,112,116,132],[2,172],{118:69,109:89,115:90,111:[1,299],117:[1,300],135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(ln,[2,173],{118:69,109:89,115:90,111:[1,301],135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{6:un,25:pn,84:[1,302]},t([6,25,26,84],Zt,{31:72,48:177,10:178,27:179,29:180,50:181,47:305,28:i,30:r,32:s,33:o,52:m,95:ft}),{7:306,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,307],27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(ht,[2,31]),t(Ft,[2,29]),t(Ct,[2,90]),{7:308,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,79:[2,125],82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{79:[2,126],109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},t(Ot,[2,40],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{26:[1,309],109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},{6:an,25:cn,92:[1,310]},t(Pt,on),{24:311,25:gt},t(At,[2,60]),{27:113,28:i,50:114,61:312,62:111,63:dt,64:115,65:116,82:b,95:ft,96:mt},t(dn,pt,{61:110,62:111,27:113,50:114,64:115,65:116,54:313,28:i,63:dt,82:b,95:ft,96:mt}),t(At,[2,65],{118:69,109:89,115:90,110:x,112:S,116:R,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(nn,[2,24]),{26:[1,314],109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},t(Ot,[2,215],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{24:315,25:gt,109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},{24:316,25:gt},t(et,[2,140]),{24:317,25:gt},{24:318,25:gt},t(fn,[2,144]),{26:[1,319],127:[1,320],128:283,129:jt},t(et,[2,181]),{24:321,25:gt},t(rn,[2,184]),{24:322,25:gt,60:[1,323]},t(mn,[2,136],{118:69,109:89,115:90,110:x,112:S,116:R,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(et,[2,103]),t(sn,[2,106],{118:69,109:89,115:90,24:324,25:gt,110:x,112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{108:[1,325]},{97:[1,326],109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},t(Bt,[2,120]),{7:214,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,63:wt,64:47,65:48,66:156,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,100:327,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:214,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:kt,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,63:wt,64:47,65:48,66:156,67:36,69:23,70:24,71:25,82:b,85:k,89:w,93:328,94:T,95:C,96:E,100:154,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(Pt,[2,129]),{6:an,25:cn,26:[1,329]},t(Gt,[2,149],{118:69,109:89,115:90,110:x,112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Gt,[2,151],{118:69,109:89,115:90,110:x,112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Gt,[2,162],{118:69,109:89,115:90,110:x,112:S,116:R,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Ht,[2,171]),{7:330,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:331,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:332,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(Bt,[2,94]),{10:178,27:179,28:i,29:180,30:r,31:72,32:s,33:o,47:333,48:177,50:181,52:m,95:ft},t(dn,Et,{31:72,47:176,48:177,10:178,27:179,29:180,50:181,83:334,28:i,30:r,32:s,33:o,52:m,95:ft}),t(Wt,[2,97]),t(Wt,[2,43],{118:69,109:89,115:90,110:x,112:S,116:R,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{7:335,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{79:[2,124],109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},t(et,[2,41]),t(St,[2,115]),t(et,[2,52]),t(At,[2,61]),t(Qt,Dt,{59:336,60:Rt}),t(et,[2,214]),t(hn,[2,188]),t(et,[2,141]),t(fn,[2,142]),t(fn,[2,143]),t(et,[2,179]),{24:337,25:gt},{26:[1,338]},t(rn,[2,185],{6:[1,339]}),{7:340,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},t(et,[2,107]),t(ht,[2,147]),t(ht,[2,123]),t(Pt,[2,130]),t(Qt,Dt,{59:341,60:Vt}),t(Pt,[2,131]),t([1,6,25,26,34,55,60,63,79,84,92,97,99,108,110,111,112,116,132],[2,174],{118:69,109:89,115:90,117:[1,342],135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(ln,[2,176],{118:69,109:89,115:90,111:[1,343],135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Ot,[2,175],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Wt,[2,98]),t(Qt,Dt,{59:344,60:Xt}),{26:[1,345],109:89,110:x,112:S,115:90,116:R,118:69,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q},{6:en,25:tn,26:[1,346]},{26:[1,347]},t(et,[2,182]),t(rn,[2,186]),t(mn,[2,137],{118:69,109:89,115:90,110:x,112:S,116:R,132:G,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),{6:an,25:cn,26:[1,348]},{7:349,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{7:350,8:122,9:18,10:19,11:n,12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:62,28:i,29:49,30:r,31:72,32:s,33:o,35:51,36:a,37:c,39:22,40:h,41:l,42:u,43:p,44:d,45:21,50:63,51:f,52:m,53:g,56:28,57:v,58:y,64:47,65:48,67:36,69:23,70:24,71:25,82:b,85:k,89:w,94:T,95:C,96:E,102:F,106:N,107:L,109:39,110:x,112:S,113:40,114:D,115:41,116:R,118:69,125:A,130:37,131:I,133:_,134:O,135:$,136:j,137:M,139:B,140:V},{6:un,25:pn,26:[1,351]},t(Wt,[2,44]),t(At,[2,62]),t(et,[2,180]),t(Pt,[2,132]),t(Ot,[2,177],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Ot,[2,178],{118:69,109:89,115:90,135:H,136:q,141:X,142:W,143:Y,144:K,145:z,146:J,147:Q}),t(Wt,[2,99])],defaultActions:{60:[2,54],61:[2,55],96:[2,113],203:[2,93]},parseError:function(e,t){if(!t.recoverable)throw Error(e); +this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||p,"number"!=typeof e&&(e=n.symbols_[e]||e),e}var n=this,i=[0],r=[null],s=[],o=this.table,a="",c=0,h=0,l=0,u=2,p=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),m={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(m.yy[g]=this.yy[g]);f.setInput(e,m.yy),m.yy.lexer=f,m.yy.parser=this,f.yylloc===void 0&&(f.yylloc={});var v=f.yylloc;s.push(v);var y=f.options&&f.options.ranges;this.parseError="function"==typeof m.yy.parseError?m.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,k,w,T,C,E,F,N,L,x={};;){if(w=i[i.length-1],this.defaultActions[w]?T=this.defaultActions[w]:((null===b||b===void 0)&&(b=t()),T=o[w]&&o[w][b]),T===void 0||!T.length||!T[0]){var S="";L=[];for(E in o[w])this.terminals_[E]&&E>u&&L.push("'"+this.terminals_[E]+"'");S=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(c+1)+": Unexpected "+(b==p?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:v,expected:L})}if(T[0]instanceof Array&&T.length>1)throw Error("Parse Error: multiple actions possible at state: "+w+", token: "+b);switch(T[0]){case 1:i.push(b),r.push(f.yytext),s.push(f.yylloc),i.push(T[1]),b=null,k?(b=k,k=null):(h=f.yyleng,a=f.yytext,c=f.yylineno,v=f.yylloc,l>0&&l--);break;case 2:if(F=this.productions_[T[1]][1],x.$=r[r.length-F],x._$={first_line:s[s.length-(F||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(F||1)].first_column,last_column:s[s.length-1].last_column},y&&(x._$.range=[s[s.length-(F||1)].range[0],s[s.length-1].range[1]]),C=this.performAction.apply(x,[a,h,c,m.yy,T[1],r,s].concat(d)),C!==void 0)return C;F&&(i=i.slice(0,2*-1*F),r=r.slice(0,-1*F),s=s.slice(0,-1*F)),i.push(this.productions_[T[1]][0]),r.push(x.$),s.push(x._$),N=o[i[i.length-2]][i[i.length-1]],i.push(N);break;case 3:return!0}}return!0}};return e.prototype=gn,gn.Parser=e,new e}();return _dereq_!==void 0&&e!==void 0&&(e.parser=n,e.Parser=n.Parser,e.parse=function(){return n.parse.apply(n,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var n=_dereq_("fs").readFileSync(_dereq_("path").normalize(t[1]),"utf8");return e.parser.parse(n)},t!==void 0&&_dereq_.main===t&&e.main(process.argv.slice(1))),t.exports}(),_dereq_["./scope"]=function(){var e={},t={exports:e};return function(){var t,n=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};e.Scope=t=function(){function e(e,t,n,i){var r,s;this.parent=e,this.expressions=t,this.method=n,this.referencedVars=i,this.variables=[{name:"arguments",type:"arguments"}],this.positions={},this.parent||(this.utilities={}),this.root=null!=(r=null!=(s=this.parent)?s.root:void 0)?r:this}return e.prototype.add=function(e,t,n){return this.shared&&!n?this.parent.add(e,t,n):Object.prototype.hasOwnProperty.call(this.positions,e)?this.variables[this.positions[e]].type=t:this.positions[e]=this.variables.push({name:e,type:t})-1},e.prototype.namedMethod=function(){var e;return(null!=(e=this.method)?e.name:void 0)||!this.parent?this.method:this.parent.namedMethod()},e.prototype.find=function(e){return this.check(e)?!0:(this.add(e,"var"),!1)},e.prototype.parameter=function(e){return this.shared&&this.parent.check(e,!0)?void 0:this.add(e,"param")},e.prototype.check=function(e){var t;return!!(this.type(e)||(null!=(t=this.parent)?t.check(e):void 0))},e.prototype.temporary=function(e,t,n){return null==n&&(n=!1),n?(t+parseInt(e,36)).toString(36).replace(/\d/g,"a"):e+(t||"")},e.prototype.type=function(e){var t,n,i,r;for(i=this.variables,t=0,n=i.length;n>t;t++)if(r=i[t],r.name===e)return r.type;return null},e.prototype.freeVariable=function(e,t){var i,r,s;for(null==t&&(t={}),i=0;;){if(s=this.temporary(e,i,t.single),!(this.check(s)||n.call(this.root.referencedVars,s)>=0))break;i++}return(null!=(r=t.reserve)?r:!0)&&this.add(s,"var",!0),s},e.prototype.assign=function(e,t){return this.add(e,{value:t,assigned:!0},!0),this.hasAssignments=!0},e.prototype.hasDeclarations=function(){return!!this.declaredVariables().length},e.prototype.declaredVariables=function(){var e;return function(){var t,n,i,r;for(i=this.variables,r=[],t=0,n=i.length;n>t;t++)e=i[t],"var"===e.type&&r.push(e.name);return r}.call(this).sort()},e.prototype.assignedVariables=function(){var e,t,n,i,r;for(n=this.variables,i=[],e=0,t=n.length;t>e;e++)r=n[e],r.type.assigned&&i.push(r.name+" = "+r.type.value);return i},e}()}.call(this),t.exports}(),_dereq_["./nodes"]=function(){var e={},t={exports:e};return function(){var t,n,i,r,s,o,a,c,h,l,u,p,d,f,m,g,v,y,b,k,w,T,C,E,F,N,L,x,S,D,R,A,I,_,O,$,j,M,B,V,P,U,G,H,q,X,W,Y,K,z,J,Q,Z,et,tt,nt,it,rt,st,ot,at,ct,ht,lt,ut,pt,dt,ft,mt,gt,vt,yt,bt,kt=function(e,t){function n(){this.constructor=e}for(var i in t)wt.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},wt={}.hasOwnProperty,Tt=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1},Ct=[].slice;Error.stackTraceLimit=1/0,P=_dereq_("./scope").Scope,dt=_dereq_("./lexer"),$=dt.RESERVED,V=dt.STRICT_PROSCRIBED,ft=_dereq_("./helpers"),et=ft.compact,rt=ft.flatten,it=ft.extend,lt=ft.merge,tt=ft.del,gt=ft.starts,nt=ft.ends,mt=ft.some,Z=ft.addLocationDataFn,ht=ft.locationDataToString,vt=ft.throwSyntaxError,e.extend=it,e.addLocationDataFn=Z,Q=function(){return!0},D=function(){return!1},X=function(){return this},S=function(){return this.negated=!this.negated,this},e.CodeFragment=h=function(){function e(e,t){var n;this.code=""+t,this.locationData=null!=e?e.locationData:void 0,this.type=(null!=e?null!=(n=e.constructor)?n.name:void 0:void 0)||"unknown"}return e.prototype.toString=function(){return""+this.code+(this.locationData?": "+ht(this.locationData):"")},e}(),st=function(e){var t;return function(){var n,i,r;for(r=[],n=0,i=e.length;i>n;n++)t=e[n],r.push(t.code);return r}().join("")},e.Base=r=function(){function e(){}return e.prototype.compile=function(e,t){return st(this.compileToFragments(e,t))},e.prototype.compileToFragments=function(e,t){var n;return e=it({},e),t&&(e.level=t),n=this.unfoldSoak(e)||this,n.tab=e.indent,e.level!==L&&n.isStatement(e)?n.compileClosure(e):n.compileNode(e)},e.prototype.compileClosure=function(e){var n,i,r,a,h,l,u;return(a=this.jumps())&&a.error("cannot use a pure statement in an expression"),e.sharedScope=!0,r=new c([],s.wrap([this])),n=[],((i=this.contains(at))||this.contains(ct))&&(n=[new x("this")],i?(h="apply",n.push(new x("arguments"))):h="call",r=new z(r,[new t(new x(h))])),l=new o(r,n).compileNode(e),(r.isGenerator||(null!=(u=r.base)?u.isGenerator:void 0))&&(l.unshift(this.makeCode("(yield* ")),l.push(this.makeCode(")"))),l},e.prototype.cache=function(e,t,n){var r,s,o;return r=null!=n?n(this):this.isComplex(),r?(s=new x(e.scope.freeVariable("ref")),o=new i(s,this),t?[o.compileToFragments(e,t),[this.makeCode(s.value)]]:[o,s]):(s=t?this.compileToFragments(e,t):this,[s,s])},e.prototype.cacheToCodeFragments=function(e){return[st(e[0]),st(e[1])]},e.prototype.makeReturn=function(e){var t;return t=this.unwrapAll(),e?new o(new x(e+".push"),[t]):new M(t)},e.prototype.contains=function(e){var t;return t=void 0,this.traverseChildren(!1,function(n){return e(n)?(t=n,!1):void 0}),t},e.prototype.lastNonComment=function(e){var t;for(t=e.length;t--;)if(!(e[t]instanceof l))return e[t];return null},e.prototype.toString=function(e,t){var n;return null==e&&(e=""),null==t&&(t=this.constructor.name),n="\n"+e+t,this.soak&&(n+="?"),this.eachChild(function(t){return n+=t.toString(e+q)}),n},e.prototype.eachChild=function(e){var t,n,i,r,s,o,a,c;if(!this.children)return this;for(a=this.children,i=0,s=a.length;s>i;i++)if(t=a[i],this[t])for(c=rt([this[t]]),r=0,o=c.length;o>r;r++)if(n=c[r],e(n)===!1)return this;return this},e.prototype.traverseChildren=function(e,t){return this.eachChild(function(n){var i;return i=t(n),i!==!1?n.traverseChildren(e,t):void 0})},e.prototype.invert=function(){return new I("!",this)},e.prototype.unwrapAll=function(){var e;for(e=this;e!==(e=e.unwrap()););return e},e.prototype.children=[],e.prototype.isStatement=D,e.prototype.jumps=D,e.prototype.isComplex=Q,e.prototype.isChainable=D,e.prototype.isAssignable=D,e.prototype.unwrap=X,e.prototype.unfoldSoak=D,e.prototype.assigns=D,e.prototype.updateLocationDataIfMissing=function(e){return this.locationData?this:(this.locationData=e,this.eachChild(function(t){return t.updateLocationDataIfMissing(e)}))},e.prototype.error=function(e){return vt(e,this.locationData)},e.prototype.makeCode=function(e){return new h(this,e)},e.prototype.wrapInBraces=function(e){return[].concat(this.makeCode("("),e,this.makeCode(")"))},e.prototype.joinFragmentArrays=function(e,t){var n,i,r,s,o;for(n=[],r=s=0,o=e.length;o>s;r=++s)i=e[r],r&&n.push(this.makeCode(t)),n=n.concat(i);return n},e}(),e.Block=s=function(e){function t(e){this.expressions=et(rt(e||[]))}return kt(t,e),t.prototype.children=["expressions"],t.prototype.push=function(e){return this.expressions.push(e),this},t.prototype.pop=function(){return this.expressions.pop()},t.prototype.unshift=function(e){return this.expressions.unshift(e),this},t.prototype.unwrap=function(){return 1===this.expressions.length?this.expressions[0]:this},t.prototype.isEmpty=function(){return!this.expressions.length},t.prototype.isStatement=function(e){var t,n,i,r;for(r=this.expressions,n=0,i=r.length;i>n;n++)if(t=r[n],t.isStatement(e))return!0;return!1},t.prototype.jumps=function(e){var t,n,i,r,s;for(s=this.expressions,n=0,r=s.length;r>n;n++)if(t=s[n],i=t.jumps(e))return i},t.prototype.makeReturn=function(e){var t,n;for(n=this.expressions.length;n--;)if(t=this.expressions[n],!(t instanceof l)){this.expressions[n]=t.makeReturn(e),t instanceof M&&!t.expression&&this.expressions.splice(n,1);break}return this},t.prototype.compileToFragments=function(e,n){return null==e&&(e={}),e.scope?t.__super__.compileToFragments.call(this,e,n):this.compileRoot(e)},t.prototype.compileNode=function(e){var n,i,r,s,o,a,c,h,l;for(this.tab=e.indent,l=e.level===L,i=[],h=this.expressions,s=o=0,a=h.length;a>o;s=++o)c=h[s],c=c.unwrapAll(),c=c.unfoldSoak(e)||c,c instanceof t?i.push(c.compileNode(e)):l?(c.front=!0,r=c.compileToFragments(e),c.isStatement(e)||(r.unshift(this.makeCode(""+this.tab)),r.push(this.makeCode(";"))),i.push(r)):i.push(c.compileToFragments(e,E));return l?this.spaced?[].concat(this.joinFragmentArrays(i,"\n\n"),this.makeCode("\n")):this.joinFragmentArrays(i,"\n"):(n=i.length?this.joinFragmentArrays(i,", "):[this.makeCode("void 0")],i.length>1&&e.level>=E?this.wrapInBraces(n):n)},t.prototype.compileRoot=function(e){var t,n,i,r,s,o,a,c,h,u,p;for(e.indent=e.bare?"":q,e.level=L,this.spaced=!0,e.scope=new P(null,this,null,null!=(h=e.referencedVars)?h:[]),u=e.locals||[],r=0,s=u.length;s>r;r++)o=u[r],e.scope.parameter(o);return a=[],e.bare||(c=function(){var e,n,r,s;for(r=this.expressions,s=[],i=e=0,n=r.length;n>e&&(t=r[i],t.unwrap()instanceof l);i=++e)s.push(t);return s}.call(this),p=this.expressions.slice(c.length),this.expressions=c,c.length&&(a=this.compileNode(lt(e,{indent:""})),a.push(this.makeCode("\n"))),this.expressions=p),n=this.compileWithDeclarations(e),e.bare?n:[].concat(a,this.makeCode("(function() {\n"),n,this.makeCode("\n}).call(this);\n"))},t.prototype.compileWithDeclarations=function(e){var t,n,i,r,s,o,a,c,h,u,p,d,f,m;for(r=[],c=[],h=this.expressions,s=o=0,a=h.length;a>o&&(i=h[s],i=i.unwrap(),i instanceof l||i instanceof x);s=++o);return e=lt(e,{level:L}),s&&(d=this.expressions.splice(s,9e9),u=[this.spaced,!1],m=u[0],this.spaced=u[1],p=[this.compileNode(e),m],r=p[0],this.spaced=p[1],this.expressions=d),c=this.compileNode(e),f=e.scope,f.expressions===this&&(n=e.scope.hasDeclarations(),t=f.hasAssignments,n||t?(s&&r.push(this.makeCode("\n")),r.push(this.makeCode(this.tab+"var ")),n&&r.push(this.makeCode(f.declaredVariables().join(", "))),t&&(n&&r.push(this.makeCode(",\n"+(this.tab+q))),r.push(this.makeCode(f.assignedVariables().join(",\n"+(this.tab+q))))),r.push(this.makeCode(";\n"+(this.spaced?"\n":"")))):r.length&&c.length&&r.push(this.makeCode("\n"))),r.concat(c)},t.wrap=function(e){return 1===e.length&&e[0]instanceof t?e[0]:new t(e)},t}(r),e.Literal=x=function(e){function t(e){this.value=e}return kt(t,e),t.prototype.makeReturn=function(){return this.isStatement()?this:t.__super__.makeReturn.apply(this,arguments)},t.prototype.isAssignable=function(){return g.test(this.value)},t.prototype.isStatement=function(){var e;return"break"===(e=this.value)||"continue"===e||"debugger"===e},t.prototype.isComplex=D,t.prototype.assigns=function(e){return e===this.value},t.prototype.jumps=function(e){return"break"!==this.value||(null!=e?e.loop:void 0)||(null!=e?e.block:void 0)?"continue"!==this.value||(null!=e?e.loop:void 0)?void 0:this:this},t.prototype.compileNode=function(e){var t,n,i;return n="this"===this.value?(null!=(i=e.scope.method)?i.bound:void 0)?e.scope.method.context:this.value:this.value.reserved?'"'+this.value+'"':this.value,t=this.isStatement()?""+this.tab+n+";":n,[this.makeCode(t)]},t.prototype.toString=function(){return' "'+this.value+'"'},t}(r),e.Undefined=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return kt(t,e),t.prototype.isAssignable=D,t.prototype.isComplex=D,t.prototype.compileNode=function(e){return[this.makeCode(e.level>=T?"(void 0)":"void 0")]},t}(r),e.Null=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return kt(t,e),t.prototype.isAssignable=D,t.prototype.isComplex=D,t.prototype.compileNode=function(){return[this.makeCode("null")]},t}(r),e.Bool=function(e){function t(e){this.val=e}return kt(t,e),t.prototype.isAssignable=D,t.prototype.isComplex=D,t.prototype.compileNode=function(){return[this.makeCode(this.val)]},t}(r),e.Return=M=function(e){function t(e){this.expression=e}return kt(t,e),t.prototype.children=["expression"],t.prototype.isStatement=Q,t.prototype.makeReturn=X,t.prototype.jumps=X,t.prototype.compileToFragments=function(e,n){var i,r;return i=null!=(r=this.expression)?r.makeReturn():void 0,!i||i instanceof t?t.__super__.compileToFragments.call(this,e,n):i.compileToFragments(e,n)},t.prototype.compileNode=function(e){var t,n,i;return t=[],n=null!=(i=this.expression)?"function"==typeof i.isYieldReturn?i.isYieldReturn():void 0:void 0,n||t.push(this.makeCode(this.tab+("return"+(this.expression?" ":"")))),this.expression&&(t=t.concat(this.expression.compileToFragments(e,N))),n||t.push(this.makeCode(";")),t},t}(r),e.Value=z=function(e){function t(e,n,i){return!n&&e instanceof t?e:(this.base=e,this.properties=n||[],i&&(this[i]=!0),this)}return kt(t,e),t.prototype.children=["base","properties"],t.prototype.add=function(e){return this.properties=this.properties.concat(e),this},t.prototype.hasProperties=function(){return!!this.properties.length},t.prototype.bareLiteral=function(e){return!this.properties.length&&this.base instanceof e},t.prototype.isArray=function(){return this.bareLiteral(n)},t.prototype.isRange=function(){return this.bareLiteral(j)},t.prototype.isComplex=function(){return this.hasProperties()||this.base.isComplex()},t.prototype.isAssignable=function(){return this.hasProperties()||this.base.isAssignable()},t.prototype.isSimpleNumber=function(){return this.bareLiteral(x)&&B.test(this.base.value)},t.prototype.isString=function(){return this.bareLiteral(x)&&y.test(this.base.value)},t.prototype.isRegex=function(){return this.bareLiteral(x)&&v.test(this.base.value)},t.prototype.isAtomic=function(){var e,t,n,i;for(i=this.properties.concat(this.base),e=0,t=i.length;t>e;e++)if(n=i[e],n.soak||n instanceof o)return!1;return!0},t.prototype.isNotCallable=function(){return this.isSimpleNumber()||this.isString()||this.isRegex()||this.isArray()||this.isRange()||this.isSplice()||this.isObject()},t.prototype.isStatement=function(e){return!this.properties.length&&this.base.isStatement(e)},t.prototype.assigns=function(e){return!this.properties.length&&this.base.assigns(e)},t.prototype.jumps=function(e){return!this.properties.length&&this.base.jumps(e)},t.prototype.isObject=function(e){return this.properties.length?!1:this.base instanceof A&&(!e||this.base.generated)},t.prototype.isSplice=function(){var e,t;return t=this.properties,e=t[t.length-1],e instanceof U},t.prototype.looksStatic=function(e){var t;return this.base.value===e&&1===this.properties.length&&"prototype"!==(null!=(t=this.properties[0].name)?t.value:void 0)},t.prototype.unwrap=function(){return this.properties.length?this:this.base},t.prototype.cacheReference=function(e){var n,r,s,o,a;return a=this.properties,s=a[a.length-1],2>this.properties.length&&!this.base.isComplex()&&!(null!=s?s.isComplex():void 0)?[this,this]:(n=new t(this.base,this.properties.slice(0,-1)),n.isComplex()&&(r=new x(e.scope.freeVariable("base")),n=new t(new O(new i(r,n)))),s?(s.isComplex()&&(o=new x(e.scope.freeVariable("name")),s=new w(new i(o,s.index)),o=new w(o)),[n.add(s),new t(r||n.base,[o||s])]):[n,r])},t.prototype.compileNode=function(e){var t,n,i,r,s;for(this.base.front=this.front,s=this.properties,t=this.base.compileToFragments(e,s.length?T:null),(this.base instanceof O||s.length)&&B.test(st(t))&&t.push(this.makeCode(".")),n=0,i=s.length;i>n;n++)r=s[n],t.push.apply(t,r.compileToFragments(e));return t},t.prototype.unfoldSoak=function(e){return null!=this.unfoldedSoak?this.unfoldedSoak:this.unfoldedSoak=function(n){return function(){var r,s,o,a,c,h,l,p,d,f;if(o=n.base.unfoldSoak(e))return(p=o.body.properties).push.apply(p,n.properties),o;for(d=n.properties,s=a=0,c=d.length;c>a;s=++a)if(h=d[s],h.soak)return h.soak=!1,r=new t(n.base,n.properties.slice(0,s)),f=new t(n.base,n.properties.slice(s)),r.isComplex()&&(l=new x(e.scope.freeVariable("ref")),r=new O(new i(l,r)),f.base=l),new b(new u(r),f,{soak:!0});return!1}}(this)()},t}(r),e.Comment=l=function(e){function t(e){this.comment=e}return kt(t,e),t.prototype.isStatement=Q,t.prototype.makeReturn=X,t.prototype.compileNode=function(e,t){var n,i;return i=this.comment.replace(/^(\s*)#(?=\s)/gm,"$1 *"),n="/*"+ut(i,this.tab)+(Tt.call(i,"\n")>=0?"\n"+this.tab:"")+" */",(t||e.level)===L&&(n=e.indent+n),[this.makeCode("\n"),this.makeCode(n)]},t}(r),e.Call=o=function(e){function n(e,t,n){this.args=null!=t?t:[],this.soak=n,this.isNew=!1,this.isSuper="super"===e,this.variable=this.isSuper?null:e,e instanceof z&&e.isNotCallable()&&e.error("literal is not a function")}return kt(n,e),n.prototype.children=["variable","args"],n.prototype.newInstance=function(){var e,t;return e=(null!=(t=this.variable)?t.base:void 0)||this.variable,e instanceof n&&!e.isNew?e.newInstance():this.isNew=!0,this},n.prototype.superReference=function(e){var n,r,s,o,a,c,h,l;return a=e.scope.namedMethod(),(null!=a?a.klass:void 0)?(o=a.klass,c=a.name,l=a.variable,o.isComplex()&&(s=new x(e.scope.parent.freeVariable("base")),r=new z(new O(new i(s,o))),l.base=r,l.properties.splice(0,o.properties.length)),(c.isComplex()||c instanceof w&&c.index.isAssignable())&&(h=new x(e.scope.parent.freeVariable("name")),c=new w(new i(h,c.index)),l.properties.pop(),l.properties.push(c)),n=[new t(new x("__super__"))],a["static"]&&n.push(new t(new x("constructor"))),n.push(null!=h?new w(h):c),new z(null!=s?s:o,n).compile(e)):(null!=a?a.ctor:void 0)?a.name+".__super__.constructor":this.error("cannot call super outside of an instance method.")},n.prototype.superThis=function(e){var t;return t=e.scope.method,t&&!t.klass&&t.context||"this"},n.prototype.unfoldSoak=function(e){var t,i,r,s,o,a,c,h,l;if(this.soak){if(this.variable){if(i=yt(e,this,"variable"))return i;c=new z(this.variable).cacheReference(e),s=c[0],l=c[1]}else s=new x(this.superReference(e)),l=new z(s);return l=new n(l,this.args),l.isNew=this.isNew,s=new x("typeof "+s.compile(e)+' === "function"'),new b(s,new z(l),{soak:!0})}for(t=this,a=[];;)if(t.variable instanceof n)a.push(t),t=t.variable;else{if(!(t.variable instanceof z))break;if(a.push(t),!((t=t.variable.base)instanceof n))break}for(h=a.reverse(),r=0,o=h.length;o>r;r++)t=h[r],i&&(t.variable instanceof n?t.variable=i:t.variable.base=i),i=yt(e,t,"variable");return i},n.prototype.compileNode=function(e){var t,n,i,r,s,o,a,c,h,l;if(null!=(h=this.variable)&&(h.front=this.front),r=G.compileSplattedArray(e,this.args,!0),r.length)return this.compileSplat(e,r);for(i=[],l=this.args,n=o=0,a=l.length;a>o;n=++o)t=l[n],n&&i.push(this.makeCode(", ")),i.push.apply(i,t.compileToFragments(e,E));return s=[],this.isSuper?(c=this.superReference(e)+(".call("+this.superThis(e)),i.length&&(c+=", "),s.push(this.makeCode(c))):(this.isNew&&s.push(this.makeCode("new ")),s.push.apply(s,this.variable.compileToFragments(e,T)),s.push(this.makeCode("("))),s.push.apply(s,i),s.push(this.makeCode(")")),s},n.prototype.compileSplat=function(e,t){var n,i,r,s,o,a;return this.isSuper?[].concat(this.makeCode(this.superReference(e)+".apply("+this.superThis(e)+", "),t,this.makeCode(")")):this.isNew?(s=this.tab+q,[].concat(this.makeCode("(function(func, args, ctor) {\n"+s+"ctor.prototype = func.prototype;\n"+s+"var child = new ctor, result = func.apply(child, args);\n"+s+"return Object(result) === result ? result : child;\n"+this.tab+"})("),this.variable.compileToFragments(e,E),this.makeCode(", "),t,this.makeCode(", function(){})"))):(n=[],i=new z(this.variable),(o=i.properties.pop())&&i.isComplex()?(a=e.scope.freeVariable("ref"),n=n.concat(this.makeCode("("+a+" = "),i.compileToFragments(e,E),this.makeCode(")"),o.compileToFragments(e))):(r=i.compileToFragments(e,T),B.test(st(r))&&(r=this.wrapInBraces(r)),o?(a=st(r),r.push.apply(r,o.compileToFragments(e))):a="null",n=n.concat(r)),n=n.concat(this.makeCode(".apply("+a+", "),t,this.makeCode(")")))},n}(r),e.Extends=d=function(e){function t(e,t){this.child=e,this.parent=t}return kt(t,e),t.prototype.children=["child","parent"],t.prototype.compileToFragments=function(e){return new o(new z(new x(bt("extend",e))),[this.child,this.parent]).compileToFragments(e)},t}(r),e.Access=t=function(e){function t(e,t){this.name=e,this.name.asKey=!0,this.soak="soak"===t}return kt(t,e),t.prototype.children=["name"],t.prototype.compileToFragments=function(e){var t;return t=this.name.compileToFragments(e),g.test(st(t))?t.unshift(this.makeCode(".")):(t.unshift(this.makeCode("[")),t.push(this.makeCode("]"))),t},t.prototype.isComplex=D,t}(r),e.Index=w=function(e){function t(e){this.index=e}return kt(t,e),t.prototype.children=["index"],t.prototype.compileToFragments=function(e){return[].concat(this.makeCode("["),this.index.compileToFragments(e,N),this.makeCode("]"))},t.prototype.isComplex=function(){return this.index.isComplex()},t}(r),e.Range=j=function(e){function t(e,t,n){this.from=e,this.to=t,this.exclusive="exclusive"===n,this.equals=this.exclusive?"":"="}return kt(t,e),t.prototype.children=["from","to"],t.prototype.compileVariables=function(e){var t,n,i,r,s,o;return e=lt(e,{top:!0}),t=tt(e,"isComplex"),n=this.cacheToCodeFragments(this.from.cache(e,E,t)),this.fromC=n[0],this.fromVar=n[1],i=this.cacheToCodeFragments(this.to.cache(e,E,t)),this.toC=i[0],this.toVar=i[1],(o=tt(e,"step"))&&(r=this.cacheToCodeFragments(o.cache(e,E,t)),this.step=r[0],this.stepVar=r[1]),s=[this.fromVar.match(R),this.toVar.match(R)],this.fromNum=s[0],this.toNum=s[1],this.stepVar?this.stepNum=this.stepVar.match(R):void 0},t.prototype.compileNode=function(e){var t,n,i,r,s,o,a,c,h,l,u,p,d,f;return this.fromVar||this.compileVariables(e),e.index?(a=this.fromNum&&this.toNum,s=tt(e,"index"),o=tt(e,"name"),h=o&&o!==s,f=s+" = "+this.fromC,this.toC!==this.toVar&&(f+=", "+this.toC),this.step!==this.stepVar&&(f+=", "+this.step),l=[s+" <"+this.equals,s+" >"+this.equals],c=l[0],r=l[1],n=this.stepNum?pt(this.stepNum[0])>0?c+" "+this.toVar:r+" "+this.toVar:a?(u=[pt(this.fromNum[0]),pt(this.toNum[0])],i=u[0],d=u[1],u,d>=i?c+" "+d:r+" "+d):(t=this.stepVar?this.stepVar+" > 0":this.fromVar+" <= "+this.toVar,t+" ? "+c+" "+this.toVar+" : "+r+" "+this.toVar),p=this.stepVar?s+" += "+this.stepVar:a?h?d>=i?"++"+s:"--"+s:d>=i?s+"++":s+"--":h?t+" ? ++"+s+" : --"+s:t+" ? "+s+"++ : "+s+"--",h&&(f=o+" = "+f),h&&(p=o+" = "+p),[this.makeCode(f+"; "+n+"; "+p)]):this.compileArray(e)},t.prototype.compileArray=function(e){var t,n,i,r,s,o,a,c,h,l,u,p,d;return this.fromNum&&this.toNum&&20>=Math.abs(this.fromNum-this.toNum)?(h=function(){p=[];for(var e=l=+this.fromNum,t=+this.toNum;t>=l?t>=e:e>=t;t>=l?e++:e--)p.push(e);return p}.apply(this),this.exclusive&&h.pop(),[this.makeCode("["+h.join(", ")+"]")]):(o=this.tab+q,s=e.scope.freeVariable("i",{single:!0}),u=e.scope.freeVariable("results"),c="\n"+o+u+" = [];",this.fromNum&&this.toNum?(e.index=s,n=st(this.compileNode(e))):(d=s+" = "+this.fromC+(this.toC!==this.toVar?", "+this.toC:""),i=this.fromVar+" <= "+this.toVar,n="var "+d+"; "+i+" ? "+s+" <"+this.equals+" "+this.toVar+" : "+s+" >"+this.equals+" "+this.toVar+"; "+i+" ? "+s+"++ : "+s+"--"),a="{ "+u+".push("+s+"); }\n"+o+"return "+u+";\n"+e.indent,r=function(e){return null!=e?e.contains(at):void 0},(r(this.from)||r(this.to))&&(t=", arguments"),[this.makeCode("(function() {"+c+"\n"+o+"for ("+n+")"+a+"}).apply(this"+(null!=t?t:"")+")")])},t}(r),e.Slice=U=function(e){function t(e){this.range=e,t.__super__.constructor.call(this)}return kt(t,e),t.prototype.children=["range"],t.prototype.compileNode=function(e){var t,n,i,r,s,o,a;return s=this.range,o=s.to,i=s.from,r=i&&i.compileToFragments(e,N)||[this.makeCode("0")],o&&(t=o.compileToFragments(e,N),n=st(t),(this.range.exclusive||-1!==+n)&&(a=", "+(this.range.exclusive?n:B.test(n)?""+(+n+1):(t=o.compileToFragments(e,T),"+"+st(t)+" + 1 || 9e9")))),[this.makeCode(".slice("+st(r)+(a||"")+")")]},t}(r),e.Obj=A=function(e){function n(e,t){this.generated=null!=t?t:!1,this.objects=this.properties=e||[]}return kt(n,e),n.prototype.children=["properties"],n.prototype.compileNode=function(e){var n,r,s,o,a,c,h,u,p,d,f,m,g,v,y,b,k,w,T,C,E;if(T=this.properties,this.generated)for(h=0,g=T.length;g>h;h++)b=T[h],b instanceof z&&b.error("cannot have an implicit value in an implicit object");for(r=p=0,v=T.length;v>p&&(w=T[r],!((w.variable||w).base instanceof O));r=++p);for(s=T.length>r,a=e.indent+=q,m=this.lastNonComment(this.properties),n=[],s&&(k=e.scope.freeVariable("obj"),n.push(this.makeCode("(\n"+a+k+" = "))),n.push(this.makeCode("{"+(0===T.length||0===r?"}":"\n"))),o=f=0,y=T.length;y>f;o=++f)w=T[o],o===r&&(0!==o&&n.push(this.makeCode("\n"+a+"}")),n.push(this.makeCode(",\n"))),u=o===T.length-1||o===r-1?"":w===m||w instanceof l?"\n":",\n",c=w instanceof l?"":a,s&&r>o&&(c+=q),w instanceof i&&w.variable instanceof z&&w.variable.hasProperties()&&w.variable.error("invalid object key"),w instanceof z&&w["this"]&&(w=new i(w.properties[0].name,w,"object")),w instanceof l||(r>o?(w instanceof i||(w=new i(w,w,"object")),(w.variable.base||w.variable).asKey=!0):(w instanceof i?(d=w.variable,E=w.value):(C=w.base.cache(e),d=C[0],E=C[1]),w=new i(new z(new x(k),[new t(d)]),E))),c&&n.push(this.makeCode(c)),n.push.apply(n,w.compileToFragments(e,L)),u&&n.push(this.makeCode(u));return s?n.push(this.makeCode(",\n"+a+k+"\n"+this.tab+")")):0!==T.length&&n.push(this.makeCode("\n"+this.tab+"}")),this.front&&!s?this.wrapInBraces(n):n},n.prototype.assigns=function(e){var t,n,i,r;for(r=this.properties,t=0,n=r.length;n>t;t++)if(i=r[t],i.assigns(e))return!0;return!1},n}(r),e.Arr=n=function(e){function t(e){this.objects=e||[]}return kt(t,e),t.prototype.children=["objects"],t.prototype.compileNode=function(e){var t,n,i,r,s,o,a;if(!this.objects.length)return[this.makeCode("[]")];if(e.indent+=q,t=G.compileSplattedArray(e,this.objects),t.length)return t;for(t=[],n=function(){var t,n,i,r;for(i=this.objects,r=[],t=0,n=i.length;n>t;t++)a=i[t],r.push(a.compileToFragments(e,E));return r}.call(this),r=s=0,o=n.length;o>s;r=++s)i=n[r],r&&t.push(this.makeCode(", ")),t.push.apply(t,i);return st(t).indexOf("\n")>=0?(t.unshift(this.makeCode("[\n"+e.indent)),t.push(this.makeCode("\n"+this.tab+"]"))):(t.unshift(this.makeCode("[")),t.push(this.makeCode("]"))),t},t.prototype.assigns=function(e){var t,n,i,r;for(r=this.objects,t=0,n=r.length;n>t;t++)if(i=r[t],i.assigns(e))return!0;return!1},t}(r),e.Class=a=function(e){function n(e,t,n){this.variable=e,this.parent=t,this.body=null!=n?n:new s,this.boundFuncs=[],this.body.classBody=!0}return kt(n,e),n.prototype.children=["variable","parent","body"],n.prototype.determineName=function(){var e,n,i;return this.variable?(n=this.variable.properties,i=n[n.length-1],e=i?i instanceof t&&i.name.value:this.variable.base.value,Tt.call(V,e)>=0&&this.variable.error("class variable name may not be "+e),e&&(e=g.test(e)&&e)):null},n.prototype.setContext=function(e){return this.body.traverseChildren(!1,function(t){return t.classBody?!1:t instanceof x&&"this"===t.value?t.value=e:t instanceof c&&t.bound?t.context=e:void 0})},n.prototype.addBoundFunctions=function(e){var n,i,r,s,o;for(o=this.boundFuncs,i=0,r=o.length;r>i;i++)n=o[i],s=new z(new x("this"),[new t(n)]).compile(e),this.ctor.body.unshift(new x(s+" = "+bt("bind",e)+"("+s+", this)"))},n.prototype.addProperties=function(e,n,r){var s,o,a,h,l,u;return u=e.base.properties.slice(0),h=function(){var e;for(e=[];o=u.shift();)o instanceof i&&(a=o.variable.base,delete o.context,l=o.value,"constructor"===a.value?(this.ctor&&o.error("cannot define more than one constructor in a class"),l.bound&&o.error("cannot define a constructor as a bound function"),l instanceof c?o=this.ctor=l:(this.externalCtor=r.classScope.freeVariable("class"),o=new i(new x(this.externalCtor),l))):o.variable["this"]?l["static"]=!0:(s=a.isComplex()?new w(a):new t(a),o.variable=new z(new x(n),[new t(new x("prototype")),s]),l instanceof c&&l.bound&&(this.boundFuncs.push(a),l.bound=!1))),e.push(o);return e}.call(this),et(h)},n.prototype.walkBody=function(e,t){return this.traverseChildren(!1,function(r){return function(o){var a,c,h,l,u,p,d;if(a=!0,o instanceof n)return!1;if(o instanceof s){for(d=c=o.expressions,h=l=0,u=d.length;u>l;h=++l)p=d[h],p instanceof i&&p.variable.looksStatic(e)?p.value["static"]=!0:p instanceof z&&p.isObject(!0)&&(a=!1,c[h]=r.addProperties(p,e,t));o.expressions=c=rt(c)}return a&&!(o instanceof n)}}(this))},n.prototype.hoistDirectivePrologue=function(){var e,t,n;for(t=0,e=this.body.expressions;(n=e[t])&&n instanceof l||n instanceof z&&n.isString();)++t;return this.directives=e.splice(0,t)},n.prototype.ensureConstructor=function(e){return this.ctor||(this.ctor=new c,this.externalCtor?this.ctor.body.push(new x(this.externalCtor+".apply(this, arguments)")):this.parent&&this.ctor.body.push(new x(e+".__super__.constructor.apply(this, arguments)")),this.ctor.body.makeReturn(),this.body.expressions.unshift(this.ctor)),this.ctor.ctor=this.ctor.name=e,this.ctor.klass=null,this.ctor.noReturn=!0},n.prototype.compileNode=function(e){var t,n,r,a,h,l,u,p,f;return(a=this.body.jumps())&&a.error("Class bodies cannot contain pure statements"),(n=this.body.contains(at))&&n.error("Class bodies shouldn't reference arguments"),u=this.determineName()||"_Class",u.reserved&&(u="_"+u),l=new x(u),r=new c([],s.wrap([this.body])),t=[],e.classScope=r.makeScope(e.scope),this.hoistDirectivePrologue(),this.setContext(u),this.walkBody(u,e),this.ensureConstructor(u),this.addBoundFunctions(e),this.body.spaced=!0,this.body.expressions.push(l),this.parent&&(f=new x(e.classScope.freeVariable("superClass",{reserve:!1})),this.body.expressions.unshift(new d(l,f)),r.params.push(new _(f)),t.push(this.parent)),(p=this.body.expressions).unshift.apply(p,this.directives),h=new O(new o(r,t)),this.variable&&(h=new i(this.variable,h)),h.compileToFragments(e)},n}(r),e.Assign=i=function(e){function n(e,t,n,i){var r,s,o;this.variable=e,this.value=t,this.context=n,this.param=i&&i.param,this.subpattern=i&&i.subpattern,o=s=this.variable.unwrapAll().value,r=Tt.call(V,o)>=0,r&&"object"!==this.context&&this.variable.error('variable name may not be "'+s+'"')}return kt(n,e),n.prototype.children=["variable","value"],n.prototype.isStatement=function(e){return(null!=e?e.level:void 0)===L&&null!=this.context&&Tt.call(this.context,"?")>=0 +},n.prototype.assigns=function(e){return this["object"===this.context?"value":"variable"].assigns(e)},n.prototype.unfoldSoak=function(e){return yt(e,this,"variable")},n.prototype.compileNode=function(e){var t,n,i,r,s,o,a,h,l,u,p,d,f,m;if(i=this.variable instanceof z){if(this.variable.isArray()||this.variable.isObject())return this.compilePatternMatch(e);if(this.variable.isSplice())return this.compileSplice(e);if("||="===(h=this.context)||"&&="===h||"?="===h)return this.compileConditional(e);if("**="===(l=this.context)||"//="===l||"%%="===l)return this.compileSpecialMath(e)}return this.value instanceof c&&(this.value["static"]?(this.value.klass=this.variable.base,this.value.name=this.variable.properties[0],this.value.variable=this.variable):(null!=(u=this.variable.properties)?u.length:void 0)>=2&&(p=this.variable.properties,o=p.length>=3?Ct.call(p,0,r=p.length-2):(r=0,[]),a=p[r++],s=p[r++],"prototype"===(null!=(d=a.name)?d.value:void 0)&&(this.value.klass=new z(this.variable.base,o),this.value.name=s,this.value.variable=this.variable))),this.context||(m=this.variable.unwrapAll(),m.isAssignable()||this.variable.error('"'+this.variable.compile(e)+'" cannot be assigned'),("function"==typeof m.hasProperties?m.hasProperties():void 0)||(this.param?e.scope.add(m.value,"var"):e.scope.find(m.value))),f=this.value.compileToFragments(e,E),n=this.variable.compileToFragments(e,E),"object"===this.context?n.concat(this.makeCode(": "),f):(t=n.concat(this.makeCode(" "+(this.context||"=")+" "),f),E>=e.level?t:this.wrapInBraces(t))},n.prototype.compilePatternMatch=function(e){var i,r,s,o,a,c,h,l,u,d,f,m,v,y,b,k,T,C,N,S,D,R,A,I,_,j,M,B;if(I=e.level===L,j=this.value,y=this.variable.base.objects,!(b=y.length))return s=j.compileToFragments(e),e.level>=F?this.wrapInBraces(s):s;if(l=this.variable.isObject(),I&&1===b&&!((v=y[0])instanceof G))return v instanceof n?(T=v,C=T.variable,h=C.base,v=T.value):h=l?v["this"]?v.properties[0].name:v:new x(0),i=g.test(h.unwrap().value||0),j=new z(j),j.properties.push(new(i?t:w)(h)),N=v.unwrap().value,Tt.call($,N)>=0&&v.error("assignment to a reserved word: "+v.compile(e)),new n(v,j,null,{param:this.param}).compileToFragments(e,L);for(M=j.compileToFragments(e,E),B=st(M),r=[],o=!1,(!g.test(B)||this.variable.assigns(B))&&(r.push([this.makeCode((k=e.scope.freeVariable("ref"))+" = ")].concat(Ct.call(M))),M=[this.makeCode(k)],B=k),c=d=0,f=y.length;f>d;c=++d){if(v=y[c],h=c,l&&(v instanceof n?(S=v,D=S.variable,h=D.base,v=S.value):v.base instanceof O?(R=new z(v.unwrapAll()).cacheReference(e),v=R[0],h=R[1]):h=v["this"]?v.properties[0].name:v),!o&&v instanceof G)m=v.name.unwrap().value,v=v.unwrap(),_=b+" <= "+B+".length ? "+bt("slice",e)+".call("+B+", "+c,(A=b-c-1)?(u=e.scope.freeVariable("i",{single:!0}),_+=", "+u+" = "+B+".length - "+A+") : ("+u+" = "+c+", [])"):_+=") : []",_=new x(_),o=u+"++";else{if(!o&&v instanceof p){(A=b-c-1)&&(1===A?o=B+".length - 1":(u=e.scope.freeVariable("i",{single:!0}),_=new x(u+" = "+B+".length - "+A),o=u+"++",r.push(_.compileToFragments(e,E))));continue}m=v.unwrap().value,(v instanceof G||v instanceof p)&&v.error("multiple splats/expansions are disallowed in an assignment"),"number"==typeof h?(h=new x(o||h),i=!1):i=l&&g.test(h.unwrap().value||0),_=new z(new x(B),[new(i?t:w)(h)])}null!=m&&Tt.call($,m)>=0&&v.error("assignment to a reserved word: "+v.compile(e)),r.push(new n(v,_,null,{param:this.param,subpattern:!0}).compileToFragments(e,E))}return I||this.subpattern||r.push(M),a=this.joinFragmentArrays(r,", "),E>e.level?a:this.wrapInBraces(a)},n.prototype.compileConditional=function(e){var t,i,r,s;return r=this.variable.cacheReference(e),i=r[0],s=r[1],!i.properties.length&&i.base instanceof x&&"this"!==i.base.value&&!e.scope.check(i.base.value)&&this.variable.error('the variable "'+i.base.value+"\" can't be assigned with "+this.context+" because it has not been declared before"),Tt.call(this.context,"?")>=0?(e.isExistentialEquals=!0,new b(new u(i),s,{type:"if"}).addElse(new n(s,this.value,"=")).compileToFragments(e)):(t=new I(this.context.slice(0,-1),i,new n(s,this.value,"=")).compileToFragments(e),E>=e.level?t:this.wrapInBraces(t))},n.prototype.compileSpecialMath=function(e){var t,i,r;return i=this.variable.cacheReference(e),t=i[0],r=i[1],new n(t,new I(this.context.slice(0,-1),r,this.value)).compileToFragments(e)},n.prototype.compileSplice=function(e){var t,n,i,r,s,o,a,c,h,l,u,p;return a=this.variable.properties.pop().range,i=a.from,l=a.to,n=a.exclusive,o=this.variable.compile(e),i?(c=this.cacheToCodeFragments(i.cache(e,F)),r=c[0],s=c[1]):r=s="0",l?i instanceof z&&i.isSimpleNumber()&&l instanceof z&&l.isSimpleNumber()?(l=l.compile(e)-s,n||(l+=1)):(l=l.compile(e,T)+" - "+s,n||(l+=" + 1")):l="9e9",h=this.value.cache(e,E),u=h[0],p=h[1],t=[].concat(this.makeCode("[].splice.apply("+o+", ["+r+", "+l+"].concat("),u,this.makeCode(")), "),p),e.level>L?this.wrapInBraces(t):t},n}(r),e.Code=c=function(e){function t(e,t,n){this.params=e||[],this.body=t||new s,this.bound="boundfunc"===n,this.isGenerator=!!this.body.contains(function(e){var t;return e instanceof I&&("yield"===(t=e.operator)||"yield*"===t)})}return kt(t,e),t.prototype.children=["params","body"],t.prototype.isStatement=function(){return!!this.ctor},t.prototype.jumps=D,t.prototype.makeScope=function(e){return new P(e,this.body,this)},t.prototype.compileNode=function(e){var r,a,c,h,l,u,d,f,m,g,v,y,k,w,C,E,F,N,L,S,D,R,A,O,$,j,M,B,V,P,U,G,H;if(this.bound&&(null!=(A=e.scope.method)?A.bound:void 0)&&(this.context=e.scope.method.context),this.bound&&!this.context)return this.context="_this",H=new t([new _(new x(this.context))],new s([this])),a=new o(H,[new x("this")]),a.updateLocationDataIfMissing(this.locationData),a.compileNode(e);for(e.scope=tt(e,"classScope")||this.makeScope(e.scope),e.scope.shared=tt(e,"sharedScope"),e.indent+=q,delete e.bare,delete e.isExistentialEquals,L=[],h=[],O=this.params,u=0,m=O.length;m>u;u++)N=O[u],N instanceof p||e.scope.parameter(N.asReference(e));for($=this.params,d=0,g=$.length;g>d;d++)if(N=$[d],N.splat||N instanceof p){for(j=this.params,f=0,v=j.length;v>f;f++)F=j[f],F instanceof p||!F.name.value||e.scope.add(F.name.value,"var",!0);V=new i(new z(new n(function(){var t,n,i,r;for(i=this.params,r=[],n=0,t=i.length;t>n;n++)F=i[n],r.push(F.asReference(e));return r}.call(this))),new z(new x("arguments")));break}for(M=this.params,E=0,y=M.length;y>E;E++)N=M[E],N.isComplex()?(U=R=N.asReference(e),N.value&&(U=new I("?",R,N.value)),h.push(new i(new z(N.name),U,"=",{param:!0}))):(R=N,N.value&&(C=new x(R.name.value+" == null"),U=new i(new z(N.name),N.value,"="),h.push(new b(C,U)))),V||L.push(R);for(G=this.body.isEmpty(),V&&h.unshift(V),h.length&&(B=this.body.expressions).unshift.apply(B,h),l=S=0,k=L.length;k>S;l=++S)F=L[l],L[l]=F.compileToFragments(e),e.scope.parameter(st(L[l]));for(P=[],this.eachParamName(function(e,t){return Tt.call(P,e)>=0&&t.error("multiple parameters named "+e),P.push(e)}),G||this.noReturn||this.body.makeReturn(),c="function",this.isGenerator&&(c+="*"),this.ctor&&(c+=" "+this.name),c+="(",r=[this.makeCode(c)],l=D=0,w=L.length;w>D;l=++D)F=L[l],l&&r.push(this.makeCode(", ")),r.push.apply(r,F);return r.push(this.makeCode(") {")),this.body.isEmpty()||(r=r.concat(this.makeCode("\n"),this.body.compileWithDeclarations(e),this.makeCode("\n"+this.tab))),r.push(this.makeCode("}")),this.ctor?[this.makeCode(this.tab)].concat(Ct.call(r)):this.front||e.level>=T?this.wrapInBraces(r):r},t.prototype.eachParamName=function(e){var t,n,i,r,s;for(r=this.params,s=[],t=0,n=r.length;n>t;t++)i=r[t],s.push(i.eachName(e));return s},t.prototype.traverseChildren=function(e,n){return e?t.__super__.traverseChildren.call(this,e,n):void 0},t}(r),e.Param=_=function(e){function t(e,t,n){var i,r;this.name=e,this.value=t,this.splat=n,r=i=this.name.unwrapAll().value,Tt.call(V,r)>=0&&this.name.error('parameter name "'+i+'" is not allowed')}return kt(t,e),t.prototype.children=["name","value"],t.prototype.compileToFragments=function(e){return this.name.compileToFragments(e,E)},t.prototype.asReference=function(e){var t,n;return this.reference?this.reference:(n=this.name,n["this"]?(t=n.properties[0].name.value,t.reserved&&(t="_"+t),n=new x(e.scope.freeVariable(t))):n.isComplex()&&(n=new x(e.scope.freeVariable("arg"))),n=new z(n),this.splat&&(n=new G(n)),n.updateLocationDataIfMissing(this.locationData),this.reference=n)},t.prototype.isComplex=function(){return this.name.isComplex()},t.prototype.eachName=function(e,t){var n,r,s,o,a,c;if(null==t&&(t=this.name),n=function(t){return e("@"+t.properties[0].name.value,t)},t instanceof x)return e(t.value,t);if(t instanceof z)return n(t);for(c=t.objects,r=0,s=c.length;s>r;r++)a=c[r],a instanceof i?this.eachName(e,a.value.unwrap()):a instanceof G?(o=a.name.unwrap(),e(o.value,o)):a instanceof z?a.isArray()||a.isObject()?this.eachName(e,a.base):a["this"]?n(a):e(a.base.value,a.base):a instanceof p||a.error("illegal parameter "+a.compile())},t}(r),e.Splat=G=function(e){function t(e){this.name=e.compile?e:new x(e)}return kt(t,e),t.prototype.children=["name"],t.prototype.isAssignable=Q,t.prototype.assigns=function(e){return this.name.assigns(e)},t.prototype.compileToFragments=function(e){return this.name.compileToFragments(e)},t.prototype.unwrap=function(){return this.name},t.compileSplattedArray=function(e,n,i){var r,s,o,a,c,h,l,u,p,d,f;for(l=-1;(f=n[++l])&&!(f instanceof t););if(l>=n.length)return[];if(1===n.length)return f=n[0],c=f.compileToFragments(e,E),i?c:[].concat(f.makeCode(bt("slice",e)+".call("),c,f.makeCode(")"));for(r=n.slice(l),h=u=0,d=r.length;d>u;h=++u)f=r[h],o=f.compileToFragments(e,E),r[h]=f instanceof t?[].concat(f.makeCode(bt("slice",e)+".call("),o,f.makeCode(")")):[].concat(f.makeCode("["),o,f.makeCode("]"));return 0===l?(f=n[0],a=f.joinFragmentArrays(r.slice(1),", "),r[0].concat(f.makeCode(".concat("),a,f.makeCode(")"))):(s=function(){var t,i,r,s;for(r=n.slice(0,l),s=[],t=0,i=r.length;i>t;t++)f=r[t],s.push(f.compileToFragments(e,E));return s}(),s=n[0].joinFragmentArrays(s,", "),a=n[l].joinFragmentArrays(r,", "),p=n[n.length-1],[].concat(n[0].makeCode("["),s,n[l].makeCode("].concat("),a,p.makeCode(")")))},t}(r),e.Expansion=p=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return kt(t,e),t.prototype.isComplex=D,t.prototype.compileNode=function(){return this.error("Expansion must be used inside a destructuring assignment or parameter list")},t.prototype.asReference=function(){return this},t.prototype.eachName=function(){},t}(r),e.While=J=function(e){function t(e,t){this.condition=(null!=t?t.invert:void 0)?e.invert():e,this.guard=null!=t?t.guard:void 0}return kt(t,e),t.prototype.children=["condition","guard","body"],t.prototype.isStatement=Q,t.prototype.makeReturn=function(e){return e?t.__super__.makeReturn.apply(this,arguments):(this.returns=!this.jumps({loop:!0}),this)},t.prototype.addBody=function(e){return this.body=e,this},t.prototype.jumps=function(){var e,t,n,i,r;if(e=this.body.expressions,!e.length)return!1;for(t=0,i=e.length;i>t;t++)if(r=e[t],n=r.jumps({loop:!0}))return n;return!1},t.prototype.compileNode=function(e){var t,n,i,r;return e.indent+=q,r="",n=this.body,n.isEmpty()?n=this.makeCode(""):(this.returns&&(n.makeReturn(i=e.scope.freeVariable("results")),r=""+this.tab+i+" = [];\n"),this.guard&&(n.expressions.length>1?n.expressions.unshift(new b(new O(this.guard).invert(),new x("continue"))):this.guard&&(n=s.wrap([new b(this.guard,n)]))),n=[].concat(this.makeCode("\n"),n.compileToFragments(e,L),this.makeCode("\n"+this.tab))),t=[].concat(this.makeCode(r+this.tab+"while ("),this.condition.compileToFragments(e,N),this.makeCode(") {"),n,this.makeCode("}")),this.returns&&t.push(this.makeCode("\n"+this.tab+"return "+i+";")),t},t}(r),e.Op=I=function(e){function n(e,t,n,i){if("in"===e)return new k(t,n);if("do"===e)return this.generateDo(t);if("new"===e){if(t instanceof o&&!t["do"]&&!t.isNew)return t.newInstance();(t instanceof c&&t.bound||t["do"])&&(t=new O(t))}return this.operator=r[e]||e,this.first=t,this.second=n,this.flip=!!i,this}var r,s;return kt(n,e),r={"==":"===","!=":"!==",of:"in",yieldfrom:"yield*"},s={"!==":"===","===":"!=="},n.prototype.children=["first","second"],n.prototype.isSimpleNumber=D,n.prototype.isYield=function(){var e;return"yield"===(e=this.operator)||"yield*"===e},n.prototype.isYieldReturn=function(){return this.isYield()&&this.first instanceof M},n.prototype.isUnary=function(){return!this.second},n.prototype.isComplex=function(){var e;return!(this.isUnary()&&("+"===(e=this.operator)||"-"===e)&&this.first instanceof z&&this.first.isSimpleNumber())},n.prototype.isChainable=function(){var e;return"<"===(e=this.operator)||">"===e||">="===e||"<="===e||"==="===e||"!=="===e},n.prototype.invert=function(){var e,t,i,r,o;if(this.isChainable()&&this.first.isChainable()){for(e=!0,t=this;t&&t.operator;)e&&(e=t.operator in s),t=t.first;if(!e)return new O(this).invert();for(t=this;t&&t.operator;)t.invert=!t.invert,t.operator=s[t.operator],t=t.first;return this}return(r=s[this.operator])?(this.operator=r,this.first.unwrap()instanceof n&&this.first.invert(),this):this.second?new O(this).invert():"!"===this.operator&&(i=this.first.unwrap())instanceof n&&("!"===(o=i.operator)||"in"===o||"instanceof"===o)?i:new n("!",this)},n.prototype.unfoldSoak=function(e){var t;return("++"===(t=this.operator)||"--"===t||"delete"===t)&&yt(e,this,"first")},n.prototype.generateDo=function(e){var t,n,r,s,a,h,l,u;for(h=[],n=e instanceof i&&(l=e.value.unwrap())instanceof c?l:e,u=n.params||[],r=0,s=u.length;s>r;r++)a=u[r],a.value?(h.push(a.value),delete a.value):h.push(a);return t=new o(e,h),t["do"]=!0,t},n.prototype.compileNode=function(e){var t,n,i,r,s,o;if(n=this.isChainable()&&this.first.isChainable(),n||(this.first.front=this.front),"delete"===this.operator&&e.scope.check(this.first.unwrapAll().value)&&this.error("delete operand may not be argument or var"),("--"===(r=this.operator)||"++"===r)&&(s=this.first.unwrapAll().value,Tt.call(V,s)>=0)&&this.error('cannot increment/decrement "'+this.first.unwrapAll().value+'"'),this.isYield())return this.compileYield(e);if(this.isUnary())return this.compileUnary(e);if(n)return this.compileChain(e);switch(this.operator){case"?":return this.compileExistence(e);case"**":return this.compilePower(e);case"//":return this.compileFloorDivision(e);case"%%":return this.compileModulo(e);default:return i=this.first.compileToFragments(e,F),o=this.second.compileToFragments(e,F),t=[].concat(i,this.makeCode(" "+this.operator+" "),o),F>=e.level?t:this.wrapInBraces(t)}},n.prototype.compileChain=function(e){var t,n,i,r;return i=this.first.second.cache(e),this.first.second=i[0],r=i[1],n=this.first.compileToFragments(e,F),t=n.concat(this.makeCode(" "+(this.invert?"&&":"||")+" "),r.compileToFragments(e),this.makeCode(" "+this.operator+" "),this.second.compileToFragments(e,F)),this.wrapInBraces(t)},n.prototype.compileExistence=function(e){var t,n;return this.first.isComplex()?(n=new x(e.scope.freeVariable("ref")),t=new O(new i(n,this.first))):(t=this.first,n=t),new b(new u(t),n,{type:"if"}).addElse(this.second).compileToFragments(e)},n.prototype.compileUnary=function(e){var t,i,r;return i=[],t=this.operator,i.push([this.makeCode(t)]),"!"===t&&this.first instanceof u?(this.first.negated=!this.first.negated,this.first.compileToFragments(e)):e.level>=T?new O(this).compileToFragments(e):(r="+"===t||"-"===t,("new"===t||"typeof"===t||"delete"===t||r&&this.first instanceof n&&this.first.operator===t)&&i.push([this.makeCode(" ")]),(r&&this.first instanceof n||"new"===t&&this.first.isStatement(e))&&(this.first=new O(this.first)),i.push(this.first.compileToFragments(e,F)),this.flip&&i.reverse(),this.joinFragmentArrays(i,""))},n.prototype.compileYield=function(e){var t,n;return n=[],t=this.operator,null==e.scope.parent&&this.error("yield statements must occur within a function generator."),Tt.call(Object.keys(this.first),"expression")>=0&&!(this.first instanceof W)?this.isYieldReturn()?n.push(this.first.compileToFragments(e,L)):null!=this.first.expression&&n.push(this.first.expression.compileToFragments(e,F)):(n.push([this.makeCode("("+t+" ")]),n.push(this.first.compileToFragments(e,F)),n.push([this.makeCode(")")])),this.joinFragmentArrays(n,"")},n.prototype.compilePower=function(e){var n;return n=new z(new x("Math"),[new t(new x("pow"))]),new o(n,[this.first,this.second]).compileToFragments(e)},n.prototype.compileFloorDivision=function(e){var i,r;return r=new z(new x("Math"),[new t(new x("floor"))]),i=new n("/",this.first,this.second),new o(r,[i]).compileToFragments(e)},n.prototype.compileModulo=function(e){var t;return t=new z(new x(bt("modulo",e))),new o(t,[this.first,this.second]).compileToFragments(e)},n.prototype.toString=function(e){return n.__super__.toString.call(this,e,this.constructor.name+" "+this.operator)},n}(r),e.In=k=function(e){function t(e,t){this.object=e,this.array=t}return kt(t,e),t.prototype.children=["object","array"],t.prototype.invert=S,t.prototype.compileNode=function(e){var t,n,i,r,s;if(this.array instanceof z&&this.array.isArray()&&this.array.base.objects.length){for(s=this.array.base.objects,n=0,i=s.length;i>n;n++)if(r=s[n],r instanceof G){t=!0;break}if(!t)return this.compileOrTest(e)}return this.compileLoopTest(e)},t.prototype.compileOrTest=function(e){var t,n,i,r,s,o,a,c,h,l,u,p;for(c=this.object.cache(e,F),u=c[0],a=c[1],h=this.negated?[" !== "," && "]:[" === "," || "],t=h[0],n=h[1],p=[],l=this.array.base.objects,i=s=0,o=l.length;o>s;i=++s)r=l[i],i&&p.push(this.makeCode(n)),p=p.concat(i?a:u,this.makeCode(t),r.compileToFragments(e,T));return F>e.level?p:this.wrapInBraces(p)},t.prototype.compileLoopTest=function(e){var t,n,i,r;return i=this.object.cache(e,E),r=i[0],n=i[1],t=[].concat(this.makeCode(bt("indexOf",e)+".call("),this.array.compileToFragments(e,E),this.makeCode(", "),n,this.makeCode(") "+(this.negated?"< 0":">= 0"))),st(r)===st(n)?t:(t=r.concat(this.makeCode(", "),t),E>e.level?t:this.wrapInBraces(t))},t.prototype.toString=function(e){return t.__super__.toString.call(this,e,this.constructor.name+(this.negated?"!":""))},t}(r),e.Try=Y=function(e){function t(e,t,n,i){this.attempt=e,this.errorVariable=t,this.recovery=n,this.ensure=i}return kt(t,e),t.prototype.children=["attempt","recovery","ensure"],t.prototype.isStatement=Q,t.prototype.jumps=function(e){var t;return this.attempt.jumps(e)||(null!=(t=this.recovery)?t.jumps(e):void 0)},t.prototype.makeReturn=function(e){return this.attempt&&(this.attempt=this.attempt.makeReturn(e)),this.recovery&&(this.recovery=this.recovery.makeReturn(e)),this},t.prototype.compileNode=function(e){var t,n,r,s;return e.indent+=q,s=this.attempt.compileToFragments(e,L),t=this.recovery?(r=new x("_error"),this.errorVariable?this.recovery.unshift(new i(this.errorVariable,r)):void 0,[].concat(this.makeCode(" catch ("),r.compileToFragments(e),this.makeCode(") {\n"),this.recovery.compileToFragments(e,L),this.makeCode("\n"+this.tab+"}"))):this.ensure||this.recovery?[]:[this.makeCode(" catch (_error) {}")],n=this.ensure?[].concat(this.makeCode(" finally {\n"),this.ensure.compileToFragments(e,L),this.makeCode("\n"+this.tab+"}")):[],[].concat(this.makeCode(this.tab+"try {\n"),s,this.makeCode("\n"+this.tab+"}"),t,n)},t}(r),e.Throw=W=function(e){function t(e){this.expression=e}return kt(t,e),t.prototype.children=["expression"],t.prototype.isStatement=Q,t.prototype.jumps=D,t.prototype.makeReturn=X,t.prototype.compileNode=function(e){return[].concat(this.makeCode(this.tab+"throw "),this.expression.compileToFragments(e),this.makeCode(";"))},t}(r),e.Existence=u=function(e){function t(e){this.expression=e}return kt(t,e),t.prototype.children=["expression"],t.prototype.invert=S,t.prototype.compileNode=function(e){var t,n,i,r;return this.expression.front=this.front,i=this.expression.compile(e,F),g.test(i)&&!e.scope.check(i)?(r=this.negated?["===","||"]:["!==","&&"],t=r[0],n=r[1],i="typeof "+i+" "+t+' "undefined" '+n+" "+i+" "+t+" null"):i=i+" "+(this.negated?"==":"!=")+" null",[this.makeCode(C>=e.level?i:"("+i+")")]},t}(r),e.Parens=O=function(e){function t(e){this.body=e}return kt(t,e),t.prototype.children=["body"],t.prototype.unwrap=function(){return this.body},t.prototype.isComplex=function(){return this.body.isComplex()},t.prototype.compileNode=function(e){var t,n,i;return n=this.body.unwrap(),n instanceof z&&n.isAtomic()?(n.front=this.front,n.compileToFragments(e)):(i=n.compileToFragments(e,N),t=F>e.level&&(n instanceof I||n instanceof o||n instanceof f&&n.returns),t?i:this.wrapInBraces(i))},t}(r),e.For=f=function(e){function t(e,t){var n;this.source=t.source,this.guard=t.guard,this.step=t.step,this.name=t.name,this.index=t.index,this.body=s.wrap([e]),this.own=!!t.own,this.object=!!t.object,this.object&&(n=[this.index,this.name],this.name=n[0],this.index=n[1]),this.index instanceof z&&this.index.error("index cannot be a pattern matching expression"),this.range=this.source instanceof z&&this.source.base instanceof j&&!this.source.properties.length,this.pattern=this.name instanceof z,this.range&&this.index&&this.index.error("indexes do not apply to range loops"),this.range&&this.pattern&&this.name.error("cannot pattern match over range loops"),this.own&&!this.object&&this.name.error("cannot use own with for-in"),this.returns=!1}return kt(t,e),t.prototype.children=["body","source","guard","step"],t.prototype.compileNode=function(e){var t,n,r,o,a,c,h,l,u,p,d,f,m,v,y,k,w,T,C,F,N,S,D,A,I,_,$,j,B,V,P,U,G,H;return t=s.wrap([this.body]),D=t.expressions,T=D[D.length-1],(null!=T?T.jumps():void 0)instanceof M&&(this.returns=!1),B=this.range?this.source.base:this.source,j=e.scope,this.pattern||(F=this.name&&this.name.compile(e,E)),v=this.index&&this.index.compile(e,E),F&&!this.pattern&&j.find(F),v&&j.find(v),this.returns&&($=j.freeVariable("results")),y=this.object&&v||j.freeVariable("i",{single:!0}),k=this.range&&F||v||y,w=k!==y?k+" = ":"",this.step&&!this.range&&(A=this.cacheToCodeFragments(this.step.cache(e,E,ot)),V=A[0],U=A[1],P=U.match(R)),this.pattern&&(F=y),H="",d="",h="",f=this.tab+q,this.range?p=B.compileToFragments(lt(e,{index:y,name:F,step:this.step,isComplex:ot})):(G=this.source.compile(e,E),!F&&!this.own||g.test(G)||(h+=""+this.tab+(S=j.freeVariable("ref"))+" = "+G+";\n",G=S),F&&!this.pattern&&(N=F+" = "+G+"["+k+"]"),this.object||(V!==U&&(h+=""+this.tab+V+";\n"),this.step&&P&&(u=0>pt(P[0]))||(C=j.freeVariable("len")),a=""+w+y+" = 0, "+C+" = "+G+".length",c=""+w+y+" = "+G+".length - 1",r=y+" < "+C,o=y+" >= 0",this.step?(P?u&&(r=o,a=c):(r=U+" > 0 ? "+r+" : "+o,a="("+U+" > 0 ? ("+a+") : "+c+")"),m=y+" += "+U):m=""+(k!==y?"++"+y:y+"++"),p=[this.makeCode(a+"; "+r+"; "+w+m)])),this.returns&&(I=""+this.tab+$+" = [];\n",_="\n"+this.tab+"return "+$+";",t.makeReturn($)),this.guard&&(t.expressions.length>1?t.expressions.unshift(new b(new O(this.guard).invert(),new x("continue"))):this.guard&&(t=s.wrap([new b(this.guard,t)]))),this.pattern&&t.expressions.unshift(new i(this.name,new x(G+"["+k+"]"))),l=[].concat(this.makeCode(h),this.pluckDirectCall(e,t)),N&&(H="\n"+f+N+";"),this.object&&(p=[this.makeCode(k+" in "+G)],this.own&&(d="\n"+f+"if (!"+bt("hasProp",e)+".call("+G+", "+k+")) continue;")),n=t.compileToFragments(lt(e,{indent:f}),L),n&&n.length>0&&(n=[].concat(this.makeCode("\n"),n,this.makeCode("\n"))),[].concat(l,this.makeCode(""+(I||"")+this.tab+"for ("),p,this.makeCode(") {"+d+H),n,this.makeCode(this.tab+"}"+(_||"")))},t.prototype.pluckDirectCall=function(e,t){var n,r,s,a,h,l,u,p,d,f,m,g,v,y,b,k;for(r=[],d=t.expressions,h=l=0,u=d.length;u>l;h=++l)s=d[h],s=s.unwrapAll(),s instanceof o&&(k=null!=(f=s.variable)?f.unwrapAll():void 0,(k instanceof c||k instanceof z&&(null!=(m=k.base)?m.unwrapAll():void 0)instanceof c&&1===k.properties.length&&("call"===(g=null!=(v=k.properties[0].name)?v.value:void 0)||"apply"===g))&&(a=(null!=(y=k.base)?y.unwrapAll():void 0)||k,p=new x(e.scope.freeVariable("fn")),n=new z(p),k.base&&(b=[n,k],k.base=b[0],n=b[1]),t.expressions[h]=new o(n,s.args),r=r.concat(this.makeCode(this.tab),new i(p,a).compileToFragments(e,L),this.makeCode(";\n"))));return r},t}(J),e.Switch=H=function(e){function t(e,t,n){this.subject=e,this.cases=t,this.otherwise=n}return kt(t,e),t.prototype.children=["subject","cases","otherwise"],t.prototype.isStatement=Q,t.prototype.jumps=function(e){var t,n,i,r,s,o,a,c;for(null==e&&(e={block:!0}),o=this.cases,i=0,s=o.length;s>i;i++)if(a=o[i],n=a[0],t=a[1],r=t.jumps(e))return r;return null!=(c=this.otherwise)?c.jumps(e):void 0},t.prototype.makeReturn=function(e){var t,n,i,r,o;for(r=this.cases,t=0,n=r.length;n>t;t++)i=r[t],i[1].makeReturn(e);return e&&(this.otherwise||(this.otherwise=new s([new x("void 0")]))),null!=(o=this.otherwise)&&o.makeReturn(e),this},t.prototype.compileNode=function(e){var t,n,i,r,s,o,a,c,h,l,u,p,d,f,m,g;for(c=e.indent+q,h=e.indent=c+q,o=[].concat(this.makeCode(this.tab+"switch ("),this.subject?this.subject.compileToFragments(e,N):this.makeCode("false"),this.makeCode(") {\n")),f=this.cases,a=l=0,p=f.length;p>l;a=++l){for(m=f[a],r=m[0],t=m[1],g=rt([r]),u=0,d=g.length;d>u;u++)i=g[u],this.subject||(i=i.invert()),o=o.concat(this.makeCode(c+"case "),i.compileToFragments(e,N),this.makeCode(":\n"));if((n=t.compileToFragments(e,L)).length>0&&(o=o.concat(n,this.makeCode("\n"))),a===this.cases.length-1&&!this.otherwise)break;s=this.lastNonComment(t.expressions),s instanceof M||s instanceof x&&s.jumps()&&"debugger"!==s.value||o.push(i.makeCode(h+"break;\n"))}return this.otherwise&&this.otherwise.expressions.length&&o.push.apply(o,[this.makeCode(c+"default:\n")].concat(Ct.call(this.otherwise.compileToFragments(e,L)),[this.makeCode("\n")])),o.push(this.makeCode(this.tab+"}")),o},t}(r),e.If=b=function(e){function t(e,t,n){this.body=t,null==n&&(n={}),this.condition="unless"===n.type?e.invert():e,this.elseBody=null,this.isChain=!1,this.soak=n.soak}return kt(t,e),t.prototype.children=["condition","body","elseBody"],t.prototype.bodyNode=function(){var e;return null!=(e=this.body)?e.unwrap():void 0},t.prototype.elseBodyNode=function(){var e;return null!=(e=this.elseBody)?e.unwrap():void 0},t.prototype.addElse=function(e){return this.isChain?this.elseBodyNode().addElse(e):(this.isChain=e instanceof t,this.elseBody=this.ensureBlock(e),this.elseBody.updateLocationDataIfMissing(e.locationData)),this},t.prototype.isStatement=function(e){var t;return(null!=e?e.level:void 0)===L||this.bodyNode().isStatement(e)||(null!=(t=this.elseBodyNode())?t.isStatement(e):void 0)},t.prototype.jumps=function(e){var t;return this.body.jumps(e)||(null!=(t=this.elseBody)?t.jumps(e):void 0)},t.prototype.compileNode=function(e){return this.isStatement(e)?this.compileStatement(e):this.compileExpression(e)},t.prototype.makeReturn=function(e){return e&&(this.elseBody||(this.elseBody=new s([new x("void 0")]))),this.body&&(this.body=new s([this.body.makeReturn(e)])),this.elseBody&&(this.elseBody=new s([this.elseBody.makeReturn(e)])),this},t.prototype.ensureBlock=function(e){return e instanceof s?e:new s([e])},t.prototype.compileStatement=function(e){var n,i,r,s,o,a,c;return r=tt(e,"chainChild"),(o=tt(e,"isExistentialEquals"))?new t(this.condition.invert(),this.elseBodyNode(),{type:"if"}).compileToFragments(e):(c=e.indent+q,s=this.condition.compileToFragments(e,N),i=this.ensureBlock(this.body).compileToFragments(lt(e,{indent:c})),a=[].concat(this.makeCode("if ("),s,this.makeCode(") {\n"),i,this.makeCode("\n"+this.tab+"}")),r||a.unshift(this.makeCode(this.tab)),this.elseBody?(n=a.concat(this.makeCode(" else ")),this.isChain?(e.chainChild=!0,n=n.concat(this.elseBody.unwrap().compileToFragments(e,L))):n=n.concat(this.makeCode("{\n"),this.elseBody.compileToFragments(lt(e,{indent:c}),L),this.makeCode("\n"+this.tab+"}")),n):a)},t.prototype.compileExpression=function(e){var t,n,i,r;return i=this.condition.compileToFragments(e,C),n=this.bodyNode().compileToFragments(e,E),t=this.elseBodyNode()?this.elseBodyNode().compileToFragments(e,E):[this.makeCode("void 0")],r=i.concat(this.makeCode(" ? "),n,this.makeCode(" : "),t),e.level>=C?this.wrapInBraces(r):r},t.prototype.unfoldSoak=function(){return this.soak&&this},t}(r),K={extend:function(e){return"function(child, parent) { for (var key in parent) { if ("+bt("hasProp",e)+".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }"},bind:function(){return"function(fn, me){ return function(){ return fn.apply(me, arguments); }; }"},indexOf:function(){return"[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }"},modulo:function(){return"function(a, b) { return (+a % (b = +b) + b) % b; }"},hasProp:function(){return"{}.hasOwnProperty"},slice:function(){return"[].slice"}},L=1,N=2,E=3,C=4,F=5,T=6,q=" ",g=/^(?!\d)[$\w\x7f-\uffff]+$/,B=/^[+-]?\d+$/,m=/^[+-]?0x[\da-f]+/i,R=/^[+-]?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)$/i,y=/^['"]/,v=/^\//,bt=function(e,t){var n,i;return i=t.scope.root,e in i.utilities?i.utilities[e]:(n=i.freeVariable(e),i.assign(n,K[e](t)),i.utilities[e]=n)},ut=function(e,t){return e=e.replace(/\n/g,"$&"+t),e.replace(/\s+$/,"")},pt=function(e){return null==e?0:e.match(m)?parseInt(e,16):parseFloat(e)},at=function(e){return e instanceof x&&"arguments"===e.value&&!e.asKey},ct=function(e){return e instanceof x&&"this"===e.value&&!e.asKey||e instanceof c&&e.bound||e instanceof o&&e.isSuper},ot=function(e){return e.isComplex()||("function"==typeof e.isAssignable?e.isAssignable():void 0)},yt=function(e,t,n){var i;if(i=t[n].unfoldSoak(e))return t[n]=i.body,i.body=new z(t),i}}.call(this),t.exports}(),_dereq_["./sourcemap"]=function(){var e={},t={exports:e};return function(){var e,n;e=function(){function e(e){this.line=e,this.columns=[]}return e.prototype.add=function(e,t,n){var i,r;return r=t[0],i=t[1],null==n&&(n={}),this.columns[e]&&n.noReplace?void 0:this.columns[e]={line:this.line,column:e,sourceLine:r,sourceColumn:i}},e.prototype.sourceLocation=function(e){for(var t;!((t=this.columns[e])||0>=e);)e--;return t&&[t.sourceLine,t.sourceColumn]},e}(),n=function(){function t(){this.lines=[]}var n,i,r,s;return t.prototype.add=function(t,n,i){var r,s,o,a;return null==i&&(i={}),o=n[0],s=n[1],a=(r=this.lines)[o]||(r[o]=new e(o)),a.add(s,t,i)},t.prototype.sourceLocation=function(e){var t,n,i;for(n=e[0],t=e[1];!((i=this.lines[n])||0>=n);)n--;return i&&i.sourceLocation(t)},t.prototype.generate=function(e,t){var n,i,r,s,o,a,c,h,l,u,p,d,f,m,g,v;for(null==e&&(e={}),null==t&&(t=null),v=0,s=0,a=0,o=0,d=!1,n="",f=this.lines,u=i=0,c=f.length;c>i;u=++i)if(l=f[u])for(m=l.columns,r=0,h=m.length;h>r;r++)if(p=m[r]){for(;p.line>v;)s=0,d=!1,n+=";",v++;d&&(n+=",",d=!1),n+=this.encodeVlq(p.column-s),s=p.column,n+=this.encodeVlq(0),n+=this.encodeVlq(p.sourceLine-a),a=p.sourceLine,n+=this.encodeVlq(p.sourceColumn-o),o=p.sourceColumn,d=!0}return g={version:3,file:e.generatedFile||"",sourceRoot:e.sourceRoot||"",sources:e.sourceFiles||[""],names:[],mappings:n},e.inline&&(g.sourcesContent=[t]),JSON.stringify(g,null,2)},r=5,i=1<e?1:0,a=(Math.abs(e)<<1)+o;a||!t;)n=a&s,a>>=r,a&&(n|=i),t+=this.encodeBase64(n);return t},n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t.prototype.encodeBase64=function(e){return n[e]||function(){throw Error("Cannot Base64 encode value: "+e)}()},t}(),t.exports=n}.call(this),t.exports}(),_dereq_["./coffee-script"]=function(){var e={},t={exports:e};return function(){var t,n,i,r,s,o,a,c,h,l,u,p,d,f,m,g,v,y,b={}.hasOwnProperty,k=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};if(a=_dereq_("fs"),v=_dereq_("vm"),f=_dereq_("path"),t=_dereq_("./lexer").Lexer,d=_dereq_("./parser").parser,h=_dereq_("./helpers"),n=_dereq_("./sourcemap"),e.VERSION="1.9.3",e.FILE_EXTENSIONS=[".coffee",".litcoffee",".coffee.md"],e.helpers=h,y=function(e){return function(t,n){var i;null==n&&(n={});try{return e.call(this,t,n) +}catch(r){if(i=r,"string"!=typeof t)throw i;throw h.updateSyntaxError(i,t,n.filename)}}},e.compile=r=y(function(e,t){var i,r,s,o,a,c,l,u,f,m,g,v,y,b,k;for(v=h.merge,o=h.extend,t=o({},t),t.sourceMap&&(g=new n),k=p.tokenize(e,t),t.referencedVars=function(){var e,t,n;for(n=[],e=0,t=k.length;t>e;e++)b=k[e],b.variable&&n.push(b[1]);return n}(),c=d.parse(k).compileToFragments(t),s=0,t.header&&(s+=1),t.shiftLine&&(s+=1),r=0,f="",u=0,m=c.length;m>u;u++)a=c[u],t.sourceMap&&(a.locationData&&!/^[;\s]*$/.test(a.code)&&g.add([a.locationData.first_line,a.locationData.first_column],[s,r],{noReplace:!0}),y=h.count(a.code,"\n"),s+=y,y?r=a.code.length-(a.code.lastIndexOf("\n")+1):r+=a.code.length),f+=a.code;return t.header&&(l="Generated by CoffeeScript "+this.VERSION,f="// "+l+"\n"+f),t.sourceMap?(i={js:f},i.sourceMap=g,i.v3SourceMap=g.generate(t,e),i):f}),e.tokens=y(function(e,t){return p.tokenize(e,t)}),e.nodes=y(function(e,t){return"string"==typeof e?d.parse(p.tokenize(e,t)):d.parse(e)}),e.run=function(e,t){var n,i,s,o;return null==t&&(t={}),s=_dereq_.main,s.filename=process.argv[1]=t.filename?a.realpathSync(t.filename):".",s.moduleCache&&(s.moduleCache={}),i=t.filename?f.dirname(a.realpathSync(t.filename)):a.realpathSync("."),s.paths=_dereq_("module")._nodeModulePaths(i),(!h.isCoffee(s.filename)||_dereq_.extensions)&&(n=r(e,t),e=null!=(o=n.js)?o:n),s._compile(e,s.filename)},e.eval=function(e,t){var n,i,s,o,a,c,h,l,u,p,d,m,g,y,k,w,T;if(null==t&&(t={}),e=e.trim()){if(o=null!=(m=v.Script.createContext)?m:v.createContext,c=null!=(g=v.isContext)?g:function(){return t.sandbox instanceof o().constructor},o){if(null!=t.sandbox){if(c(t.sandbox))w=t.sandbox;else{w=o(),y=t.sandbox;for(l in y)b.call(y,l)&&(T=y[l],w[l]=T)}w.global=w.root=w.GLOBAL=w}else w=global;if(w.__filename=t.filename||"eval",w.__dirname=f.dirname(w.__filename),w===global&&!w.module&&!w.require){for(n=_dereq_("module"),w.module=i=new n(t.modulename||"eval"),w.require=s=function(e){return n._load(e,i,!0)},i.filename=w.__filename,k=Object.getOwnPropertyNames(_dereq_),a=0,u=k.length;u>a;a++)d=k[a],"paths"!==d&&(s[d]=_dereq_[d]);s.paths=i.paths=n._nodeModulePaths(process.cwd()),s.resolve=function(e){return n._resolveFilename(e,i)}}}p={};for(l in t)b.call(t,l)&&(T=t[l],p[l]=T);return p.bare=!0,h=r(e,p),w===global?v.runInThisContext(h):v.runInContext(h,w)}},e.register=function(){return _dereq_("./register")},_dereq_.extensions)for(m=this.FILE_EXTENSIONS,l=0,u=m.length;u>l;l++)s=m[l],null==(i=_dereq_.extensions)[s]&&(i[s]=function(){throw Error("Use CoffeeScript.register() or require the coffee-script/register module to require "+s+" files.")});e._compileFile=function(e,t){var n,i,s,o;null==t&&(t=!1),s=a.readFileSync(e,"utf8"),o=65279===s.charCodeAt(0)?s.substring(1):s;try{n=r(o,{filename:e,sourceMap:t,literate:h.isLiterate(e)})}catch(c){throw i=c,h.updateSyntaxError(i,o,e)}return n},p=new t,d.lexer={lex:function(){var e,t;return t=d.tokens[this.pos++],t?(e=t[0],this.yytext=t[1],this.yylloc=t[2],d.errorToken=t.origin||t,this.yylineno=this.yylloc.first_line):e="",e},setInput:function(e){return d.tokens=e,this.pos=0},upcomingInput:function(){return""}},d.yy=_dereq_("./nodes"),d.yy.parseError=function(e,t){var n,i,r,s,o,a;return o=t.token,s=d.errorToken,a=d.tokens,i=s[0],r=s[1],n=s[2],r=function(){switch(!1){case s!==a[a.length-1]:return"end of input";case"INDENT"!==i&&"OUTDENT"!==i:return"indentation";case"IDENTIFIER"!==i&&"NUMBER"!==i&&"STRING"!==i&&"STRING_START"!==i&&"REGEX"!==i&&"REGEX_START"!==i:return i.replace(/_START$/,"").toLowerCase();default:return h.nameWhitespaceCharacter(r)}}(),h.throwSyntaxError("unexpected "+r,n)},o=function(e,t){var n,i,r,s,o,a,c,h,l,u,p,d;return s=void 0,r="",e.isNative()?r="native":(e.isEval()?(s=e.getScriptNameOrSourceURL(),s||(r=e.getEvalOrigin()+", ")):s=e.getFileName(),s||(s=""),h=e.getLineNumber(),i=e.getColumnNumber(),u=t(s,h,i),r=u?s+":"+u[0]+":"+u[1]:s+":"+h+":"+i),o=e.getFunctionName(),a=e.isConstructor(),c=!(e.isToplevel()||a),c?(l=e.getMethodName(),d=e.getTypeName(),o?(p=n="",d&&o.indexOf(d)&&(p=d+"."),l&&o.indexOf("."+l)!==o.length-l.length-1&&(n=" [as "+l+"]"),""+p+o+n+" ("+r+")"):d+"."+(l||"")+" ("+r+")"):a?"new "+(o||"")+" ("+r+")":o?o+" ("+r+")":r},g={},c=function(t){var n,i;if(g[t])return g[t];if(i=null!=f?f.extname(t):void 0,!(0>k.call(e.FILE_EXTENSIONS,i)))return n=e._compileFile(t,!0),g[t]=n.sourceMap},Error.prepareStackTrace=function(t,n){var i,r,s;return s=function(e,t,n){var i,r;return r=c(e),r&&(i=r.sourceLocation([t-1,n-1])),i?[i[0]+1,i[1]+1]:null},r=function(){var t,r,a;for(a=[],t=0,r=n.length;r>t&&(i=n[t],i.getFunction()!==e.run);t++)a.push(" at "+o(i,s));return a}(),""+t+"\n"+r.join("\n")+"\n"}}.call(this),t.exports}(),_dereq_["./browser"]=function(){var exports={},module={exports:exports};return function(){var CoffeeScript,compile,runScripts,indexOf=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};CoffeeScript=_dereq_("./coffee-script"),CoffeeScript.require=_dereq_,compile=CoffeeScript.compile,CoffeeScript.eval=function(code,options){return null==options&&(options={}),null==options.bare&&(options.bare=!0),eval(compile(code,options))},CoffeeScript.run=function(e,t){return null==t&&(t={}),t.bare=!0,t.shiftLine=!0,Function(compile(e,t))()},"undefined"!=typeof window&&null!==window&&("undefined"!=typeof btoa&&null!==btoa&&"undefined"!=typeof JSON&&null!==JSON&&"undefined"!=typeof unescape&&null!==unescape&&"undefined"!=typeof encodeURIComponent&&null!==encodeURIComponent&&(compile=function(e,t){var n,i,r;return null==t&&(t={}),t.sourceMap=!0,t.inline=!0,i=CoffeeScript.compile(e,t),n=i.js,r=i.v3SourceMap,n+"\n//# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(r)))+"\n//# sourceURL=coffeescript"}),CoffeeScript.load=function(e,t,n,i){var r;return null==n&&(n={}),null==i&&(i=!1),n.sourceFiles=[e],r=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest,r.open("GET",e,!0),"overrideMimeType"in r&&r.overrideMimeType("text/plain"),r.onreadystatechange=function(){var s,o;if(4===r.readyState){if(0!==(o=r.status)&&200!==o)throw Error("Could not load "+e);if(s=[r.responseText,n],i||CoffeeScript.run.apply(CoffeeScript,s),t)return t(s)}},r.send(null)},runScripts=function(){var e,t,n,i,r,s,o,a,c,h,l;for(l=window.document.getElementsByTagName("script"),t=["text/coffeescript","text/literate-coffeescript"],e=function(){var e,n,i,r;for(r=[],e=0,n=l.length;n>e;e++)c=l[e],i=c.type,indexOf.call(t,i)>=0&&r.push(c);return r}(),s=0,n=function(){var t;return t=e[s],t instanceof Array?(CoffeeScript.run.apply(CoffeeScript,t),s++,n()):void 0},i=function(i,r){var s,o;return s={literate:i.type===t[1]},o=i.src||i.getAttribute("data-src"),o?CoffeeScript.load(o,function(t){return e[r]=t,n()},s,!0):(s.sourceFiles=["embedded"],e[r]=[i.innerHTML,s])},r=o=0,a=e.length;a>o;r=++o)h=e[r],i(h,r);return n()},window.addEventListener?window.addEventListener("DOMContentLoaded",runScripts,!1):window.attachEvent("onload",runScripts))}.call(this),module.exports}(),_dereq_["./coffee-script"]}();"function"==typeof define&&define.amd?define(function(){return CoffeeScript}):root.CoffeeScript=CoffeeScript})(this); +}); + +ace.define("ace/mode/coffee_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/coffee/coffee"], function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var Mirror = require("../worker/mirror").Mirror; +var coffee = require("../mode/coffee/coffee"); + +window.addEventListener = function() {}; + + +var Worker = exports.Worker = function(sender) { + Mirror.call(this, sender); + this.setTimeout(250); +}; + +oop.inherits(Worker, Mirror); + +(function() { + + this.onUpdate = function() { + var value = this.doc.getValue(); + var errors = []; + try { + coffee.compile(value); + } catch(e) { + var loc = e.location; + if (loc) { + errors.push({ + row: loc.first_line, + column: loc.first_column, + endRow: loc.last_line, + endColumn: loc.last_column, + text: e.message, + type: "error" + }); + } + } + this.sender.emit("annotate", errors); + }; + +}).call(Worker.prototype); + +}); + +ace.define("ace/lib/es5-shim",["require","exports","module"], function(require, exports, module) { + +function Empty() {} + +if (!Function.prototype.bind) { + Function.prototype.bind = function bind(that) { // .length is 1 + var target = this; + if (typeof target != "function") { + throw new TypeError("Function.prototype.bind called on incompatible " + target); + } + var args = slice.call(arguments, 1); // for normal call + var bound = function () { + + if (this instanceof bound) { + + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + + } + + }; + if(target.prototype) { + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; +} +var call = Function.prototype.call; +var prototypeOfArray = Array.prototype; +var prototypeOfObject = Object.prototype; +var slice = prototypeOfArray.slice; +var _toString = call.bind(prototypeOfObject.toString); +var owns = call.bind(prototypeOfObject.hasOwnProperty); +var defineGetter; +var defineSetter; +var lookupGetter; +var lookupSetter; +var supportsAccessors; +if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { + defineGetter = call.bind(prototypeOfObject.__defineGetter__); + defineSetter = call.bind(prototypeOfObject.__defineSetter__); + lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); + lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); +} +if ([1,2].splice(0).length != 2) { + if(function() { // test IE < 9 to splice bug - see issue #138 + function makeArray(l) { + var a = new Array(l+2); + a[0] = a[1] = 0; + return a; + } + var array = [], lengthBefore; + + array.splice.apply(array, makeArray(20)); + array.splice.apply(array, makeArray(26)); + + lengthBefore = array.length; //46 + array.splice(5, 0, "XXX"); // add one element + + lengthBefore + 1 == array.length + + if (lengthBefore + 1 == array.length) { + return true;// has right splice implementation without bugs + } + }()) {//IE 6/7 + var array_splice = Array.prototype.splice; + Array.prototype.splice = function(start, deleteCount) { + if (!arguments.length) { + return []; + } else { + return array_splice.apply(this, [ + start === void 0 ? 0 : start, + deleteCount === void 0 ? (this.length - start) : deleteCount + ].concat(slice.call(arguments, 2))) + } + }; + } else {//IE8 + Array.prototype.splice = function(pos, removeCount){ + var length = this.length; + if (pos > 0) { + if (pos > length) + pos = length; + } else if (pos == void 0) { + pos = 0; + } else if (pos < 0) { + pos = Math.max(length + pos, 0); + } + + if (!(pos+removeCount < length)) + removeCount = length - pos; + + var removed = this.slice(pos, pos+removeCount); + var insert = slice.call(arguments, 2); + var add = insert.length; + if (pos === length) { + if (add) { + this.push.apply(this, insert); + } + } else { + var remove = Math.min(removeCount, length - pos); + var tailOldPos = pos + remove; + var tailNewPos = tailOldPos + add - remove; + var tailCount = length - tailOldPos; + var lengthAfterRemove = length - remove; + + if (tailNewPos < tailOldPos) { // case A + for (var i = 0; i < tailCount; ++i) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } else if (tailNewPos > tailOldPos) { // case B + for (i = tailCount; i--; ) { + this[tailNewPos+i] = this[tailOldPos+i]; + } + } // else, add == remove (nothing to do) + + if (add && pos === lengthAfterRemove) { + this.length = lengthAfterRemove; // truncate array + this.push.apply(this, insert); + } else { + this.length = lengthAfterRemove + add; // reserves space + for (i = 0; i < add; ++i) { + this[pos+i] = insert[i]; + } + } + } + return removed; + }; + } +} +if (!Array.isArray) { + Array.isArray = function isArray(obj) { + return _toString(obj) == "[object Array]"; + }; +} +var boxedString = Object("a"), + splitString = boxedString[0] != "a" || !(0 in boxedString); + +if (!Array.prototype.forEach) { + Array.prototype.forEach = function forEach(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + thisp = arguments[1], + i = -1, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(); // TODO message + } + + while (++i < length) { + if (i in self) { + fun.call(thisp, self[i], i, object); + } + } + }; +} +if (!Array.prototype.map) { + Array.prototype.map = function map(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = Array(length), + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) + result[i] = fun.call(thisp, self[i], i, object); + } + return result; + }; +} +if (!Array.prototype.filter) { + Array.prototype.filter = function filter(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + result = [], + value, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self) { + value = self[i]; + if (fun.call(thisp, value, i, object)) { + result.push(value); + } + } + } + return result; + }; +} +if (!Array.prototype.every) { + Array.prototype.every = function every(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && !fun.call(thisp, self[i], i, object)) { + return false; + } + } + return true; + }; +} +if (!Array.prototype.some) { + Array.prototype.some = function some(fun /*, thisp */) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0, + thisp = arguments[1]; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + + for (var i = 0; i < length; i++) { + if (i in self && fun.call(thisp, self[i], i, object)) { + return true; + } + } + return false; + }; +} +if (!Array.prototype.reduce) { + Array.prototype.reduce = function reduce(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduce of empty array with no initial value"); + } + + var i = 0; + var result; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i++]; + break; + } + if (++i >= length) { + throw new TypeError("reduce of empty array with no initial value"); + } + } while (true); + } + + for (; i < length; i++) { + if (i in self) { + result = fun.call(void 0, result, self[i], i, object); + } + } + + return result; + }; +} +if (!Array.prototype.reduceRight) { + Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { + var object = toObject(this), + self = splitString && _toString(this) == "[object String]" ? + this.split("") : + object, + length = self.length >>> 0; + if (_toString(fun) != "[object Function]") { + throw new TypeError(fun + " is not a function"); + } + if (!length && arguments.length == 1) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + + var result, i = length - 1; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i--]; + break; + } + if (--i < 0) { + throw new TypeError("reduceRight of empty array with no initial value"); + } + } while (true); + } + + do { + if (i in this) { + result = fun.call(void 0, result, self[i], i, object); + } + } while (i--); + + return result; + }; +} +if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { + Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + + var i = 0; + if (arguments.length > 1) { + i = toInteger(arguments[1]); + } + i = i >= 0 ? i : Math.max(0, length + i); + for (; i < length; i++) { + if (i in self && self[i] === sought) { + return i; + } + } + return -1; + }; +} +if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { + Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { + var self = splitString && _toString(this) == "[object String]" ? + this.split("") : + toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + var i = length - 1; + if (arguments.length > 1) { + i = Math.min(i, toInteger(arguments[1])); + } + i = i >= 0 ? i : length - Math.abs(i); + for (; i >= 0; i--) { + if (i in self && sought === self[i]) { + return i; + } + } + return -1; + }; +} +if (!Object.getPrototypeOf) { + Object.getPrototypeOf = function getPrototypeOf(object) { + return object.__proto__ || ( + object.constructor ? + object.constructor.prototype : + prototypeOfObject + ); + }; +} +if (!Object.getOwnPropertyDescriptor) { + var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + + "non-object: "; + Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT + object); + if (!owns(object, property)) + return; + + var descriptor, getter, setter; + descriptor = { enumerable: true, configurable: true }; + if (supportsAccessors) { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + + var getter = lookupGetter(object, property); + var setter = lookupSetter(object, property); + object.__proto__ = prototype; + + if (getter || setter) { + if (getter) descriptor.get = getter; + if (setter) descriptor.set = setter; + return descriptor; + } + } + descriptor.value = object[property]; + return descriptor; + }; +} +if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function getOwnPropertyNames(object) { + return Object.keys(object); + }; +} +if (!Object.create) { + var createEmpty; + if (Object.prototype.__proto__ === null) { + createEmpty = function () { + return { "__proto__": null }; + }; + } else { + createEmpty = function () { + var empty = {}; + for (var i in empty) + empty[i] = null; + empty.constructor = + empty.hasOwnProperty = + empty.propertyIsEnumerable = + empty.isPrototypeOf = + empty.toLocaleString = + empty.toString = + empty.valueOf = + empty.__proto__ = null; + return empty; + } + } + + Object.create = function create(prototype, properties) { + var object; + if (prototype === null) { + object = createEmpty(); + } else { + if (typeof prototype != "object") + throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); + var Type = function () {}; + Type.prototype = prototype; + object = new Type(); + object.__proto__ = prototype; + } + if (properties !== void 0) + Object.defineProperties(object, properties); + return object; + }; +} + +function doesDefinePropertyWork(object) { + try { + Object.defineProperty(object, "sentinel", {}); + return "sentinel" in object; + } catch (exception) { + } +} +if (Object.defineProperty) { + var definePropertyWorksOnObject = doesDefinePropertyWork({}); + var definePropertyWorksOnDom = typeof document == "undefined" || + doesDefinePropertyWork(document.createElement("div")); + if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { + var definePropertyFallback = Object.defineProperty; + } +} + +if (!Object.defineProperty || definePropertyFallback) { + var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; + var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " + var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + + "on this javascript engine"; + + Object.defineProperty = function defineProperty(object, property, descriptor) { + if ((typeof object != "object" && typeof object != "function") || object === null) + throw new TypeError(ERR_NON_OBJECT_TARGET + object); + if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) + throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); + if (definePropertyFallback) { + try { + return definePropertyFallback.call(Object, object, property, descriptor); + } catch (exception) { + } + } + if (owns(descriptor, "value")) { + + if (supportsAccessors && (lookupGetter(object, property) || + lookupSetter(object, property))) + { + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + delete object[property]; + object[property] = descriptor.value; + object.__proto__ = prototype; + } else { + object[property] = descriptor.value; + } + } else { + if (!supportsAccessors) + throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); + if (owns(descriptor, "get")) + defineGetter(object, property, descriptor.get); + if (owns(descriptor, "set")) + defineSetter(object, property, descriptor.set); + } + + return object; + }; +} +if (!Object.defineProperties) { + Object.defineProperties = function defineProperties(object, properties) { + for (var property in properties) { + if (owns(properties, property)) + Object.defineProperty(object, property, properties[property]); + } + return object; + }; +} +if (!Object.seal) { + Object.seal = function seal(object) { + return object; + }; +} +if (!Object.freeze) { + Object.freeze = function freeze(object) { + return object; + }; +} +try { + Object.freeze(function () {}); +} catch (exception) { + Object.freeze = (function freeze(freezeObject) { + return function freeze(object) { + if (typeof object == "function") { + return object; + } else { + return freezeObject(object); + } + }; + })(Object.freeze); +} +if (!Object.preventExtensions) { + Object.preventExtensions = function preventExtensions(object) { + return object; + }; +} +if (!Object.isSealed) { + Object.isSealed = function isSealed(object) { + return false; + }; +} +if (!Object.isFrozen) { + Object.isFrozen = function isFrozen(object) { + return false; + }; +} +if (!Object.isExtensible) { + Object.isExtensible = function isExtensible(object) { + if (Object(object) === object) { + throw new TypeError(); // TODO message + } + var name = ''; + while (owns(object, name)) { + name += '?'; + } + object[name] = true; + var returnValue = owns(object, name); + delete object[name]; + return returnValue; + }; +} +if (!Object.keys) { + var hasDontEnumBug = true, + dontEnums = [ + "toString", + "toLocaleString", + "valueOf", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "constructor" + ], + dontEnumsLength = dontEnums.length; + + for (var key in {"toString": null}) { + hasDontEnumBug = false; + } + + Object.keys = function keys(object) { + + if ( + (typeof object != "object" && typeof object != "function") || + object === null + ) { + throw new TypeError("Object.keys called on a non-object"); + } + + var keys = []; + for (var name in object) { + if (owns(object, name)) { + keys.push(name); + } + } + + if (hasDontEnumBug) { + for (var i = 0, ii = dontEnumsLength; i < ii; i++) { + var dontEnum = dontEnums[i]; + if (owns(object, dontEnum)) { + keys.push(dontEnum); + } + } + } + return keys; + }; + +} +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + + "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + + "\u2029\uFEFF"; +if (!String.prototype.trim || ws.trim()) { + ws = "[" + ws + "]"; + var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), + trimEndRegexp = new RegExp(ws + ws + "*$"); + String.prototype.trim = function trim() { + return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); + }; +} + +function toInteger(n) { + n = +n; + if (n !== n) { // isNaN + n = 0; + } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + return n; +} + +function isPrimitive(input) { + var type = typeof input; + return ( + input === null || + type === "undefined" || + type === "boolean" || + type === "number" || + type === "string" + ); +} + +function toPrimitive(input) { + var val, valueOf, toString; + if (isPrimitive(input)) { + return input; + } + valueOf = input.valueOf; + if (typeof valueOf === "function") { + val = valueOf.call(input); + if (isPrimitive(val)) { + return val; + } + } + toString = input.toString; + if (typeof toString === "function") { + val = toString.call(input); + if (isPrimitive(val)) { + return val; + } + } + throw new TypeError(); +} +var toObject = function (o) { + if (o == null) { // this matches both null and undefined + throw new TypeError("can't convert "+o+" to object"); + } + return Object(o); +}; + +}); diff --git a/htdocs/includes/ace/worker-css.js b/htdocs/includes/ace/worker-css.js new file mode 100644 index 00000000000..7bee71a188f --- /dev/null +++ b/htdocs/includes/ace/worker-css.js @@ -0,0 +1,8760 @@ +"no use strict"; +;(function(window) { +if (typeof window.window != "undefined" && window.document) + return; +if (window.require && window.define) + return; + +if (!window.console) { + window.console = function() { + var msgs = Array.prototype.slice.call(arguments, 0); + postMessage({type: "log", data: msgs}); + }; + window.console.error = + window.console.warn = + window.console.log = + window.console.trace = window.console; +} +window.window = window; +window.ace = window; + +window.onerror = function(message, file, line, col, err) { + postMessage({type: "error", data: { + message: message, + data: err.data, + file: file, + line: line, + col: col, + stack: err.stack + }}); +}; + +window.normalizeModule = function(parentId, moduleName) { + // normalize plugin requires + if (moduleName.indexOf("!") !== -1) { + var chunks = moduleName.split("!"); + return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); + } + // normalize relative requires + if (moduleName.charAt(0) == ".") { + var base = parentId.split("/").slice(0, -1).join("/"); + moduleName = (base ? base + "/" : "") + moduleName; + + while (moduleName.indexOf(".") !== -1 && previous != moduleName) { + var previous = moduleName; + moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + } + } + + return moduleName; +}; + +window.require = function require(parentId, id) { + if (!id) { + id = parentId; + parentId = null; + } + if (!id.charAt) + throw new Error("worker.js require() accepts only (parentId, id) as arguments"); + + id = window.normalizeModule(parentId, id); + + var module = window.require.modules[id]; + if (module) { + if (!module.initialized) { + module.initialized = true; + module.exports = module.factory().exports; + } + return module.exports; + } + + if (!window.require.tlns) + return console.log("unable to load " + id); + + var path = resolveModuleId(id, window.require.tlns); + if (path.slice(-3) != ".js") path += ".js"; + + window.require.id = id; + window.require.modules[id] = {}; // prevent infinite loop on broken modules + importScripts(path); + return window.require(parentId, id); +}; +function resolveModuleId(id, paths) { + var testPath = id, tail = ""; + while (testPath) { + var alias = paths[testPath]; + if (typeof alias == "string") { + return alias + tail; + } else if (alias) { + return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name); + } else if (alias === false) { + return ""; + } + var i = testPath.lastIndexOf("/"); + if (i === -1) break; + tail = testPath.substr(i) + tail; + testPath = testPath.slice(0, i); + } + return id; +} +window.require.modules = {}; +window.require.tlns = {}; + +window.define = function(id, deps, factory) { + if (arguments.length == 2) { + factory = deps; + if (typeof id != "string") { + deps = id; + id = window.require.id; + } + } else if (arguments.length == 1) { + factory = id; + deps = []; + id = window.require.id; + } + + if (typeof factory != "function") { + window.require.modules[id] = { + exports: factory, + initialized: true + }; + return; + } + + if (!deps.length) + // If there is no dependencies, we inject "require", "exports" and + // "module" as dependencies, to provide CommonJS compatibility. + deps = ["require", "exports", "module"]; + + var req = function(childId) { + return window.require(id, childId); + }; + + window.require.modules[id] = { + exports: {}, + factory: function() { + var module = this; + var returnExports = factory.apply(this, deps.map(function(dep) { + switch (dep) { + // Because "require", "exports" and "module" aren't actual + // dependencies, we must handle them seperately. + case "require": return req; + case "exports": return module.exports; + case "module": return module; + // But for all other dependencies, we can just go ahead and + // require them. + default: return req(dep); + } + })); + if (returnExports) + module.exports = returnExports; + return module; + } + }; +}; +window.define.amd = {}; +require.tlns = {}; +window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { + for (var i in topLevelNamespaces) + require.tlns[i] = topLevelNamespaces[i]; +}; + +window.initSender = function initSender() { + + var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; + var oop = window.require("ace/lib/oop"); + + var Sender = function() {}; + + (function() { + + oop.implement(this, EventEmitter); + + this.callback = function(data, callbackId) { + postMessage({ + type: "call", + id: callbackId, + data: data + }); + }; + + this.emit = function(name, data) { + postMessage({ + type: "event", + name: name, + data: data + }); + }; + + }).call(Sender.prototype); + + return new Sender(); +}; + +var main = window.main = null; +var sender = window.sender = null; + +window.onmessage = function(e) { + var msg = e.data; + if (msg.event && sender) { + sender._signal(msg.event, msg.data); + } + else if (msg.command) { + if (main[msg.command]) + main[msg.command].apply(main, msg.args); + else if (window[msg.command]) + window[msg.command].apply(window, msg.args); + else + throw new Error("Unknown command:" + msg.command); + } + else if (msg.init) { + window.initBaseUrls(msg.tlns); + require("ace/lib/es5-shim"); + sender = window.sender = window.initSender(); + var clazz = require(msg.module)[msg.classname]; + main = window.main = new clazz(sender); + } +}; +})(this); + +ace.define("ace/lib/oop",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.inherits = function(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); +}; + +exports.mixin = function(obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + return obj; +}; + +exports.implement = function(proto, mixin) { + exports.mixin(proto, mixin); +}; + +}); + +ace.define("ace/lib/lang",["require","exports","module"], function(require, exports, module) { +"use strict"; + +exports.last = function(a) { + return a[a.length - 1]; +}; + +exports.stringReverse = function(string) { + return string.split("").reverse().join(""); +}; + +exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + + if (count >>= 1) + string += string; + } + return result; +}; + +var trimBeginRegexp = /^\s\s*/; +var trimEndRegexp = /\s\s*$/; + +exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); +}; + +exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); +}; + +exports.copyObject = function(obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; +}; + +exports.copyArray = function(array){ + var copy = []; + for (var i=0, l=array.length; i [" + this.end.row + "/" + this.end.column + "]"); + }; + + this.contains = function(row, column) { + return this.compare(row, column) == 0; + }; + this.compareRange = function(range) { + var cmp, + end = range.end, + start = range.start; + + cmp = this.compare(end.row, end.column); + if (cmp == 1) { + cmp = this.compare(start.row, start.column); + if (cmp == 1) { + return 2; + } else if (cmp == 0) { + return 1; + } else { + return 0; + } + } else if (cmp == -1) { + return -2; + } else { + cmp = this.compare(start.row, start.column); + if (cmp == -1) { + return -1; + } else if (cmp == 1) { + return 42; + } else { + return 0; + } + } + }; + this.comparePoint = function(p) { + return this.compare(p.row, p.column); + }; + this.containsRange = function(range) { + return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; + }; + this.intersects = function(range) { + var cmp = this.compareRange(range); + return (cmp == -1 || cmp == 0 || cmp == 1); + }; + this.isEnd = function(row, column) { + return this.end.row == row && this.end.column == column; + }; + this.isStart = function(row, column) { + return this.start.row == row && this.start.column == column; + }; + this.setStart = function(row, column) { + if (typeof row == "object") { + this.start.column = row.column; + this.start.row = row.row; + } else { + this.start.row = row; + this.start.column = column; + } + }; + this.setEnd = function(row, column) { + if (typeof row == "object") { + this.end.column = row.column; + this.end.row = row.row; + } else { + this.end.row = row; + this.end.column = column; + } + }; + this.inside = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column) || this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideStart = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isEnd(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.insideEnd = function(row, column) { + if (this.compare(row, column) == 0) { + if (this.isStart(row, column)) { + return false; + } else { + return true; + } + } + return false; + }; + this.compare = function(row, column) { + if (!this.isMultiLine()) { + if (row === this.start.row) { + return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); + } + } + + if (row < this.start.row) + return -1; + + if (row > this.end.row) + return 1; + + if (this.start.row === row) + return column >= this.start.column ? 0 : -1; + + if (this.end.row === row) + return column <= this.end.column ? 0 : 1; + + return 0; + }; + this.compareStart = function(row, column) { + if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.compareEnd = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else { + return this.compare(row, column); + } + }; + this.compareInside = function(row, column) { + if (this.end.row == row && this.end.column == column) { + return 1; + } else if (this.start.row == row && this.start.column == column) { + return -1; + } else { + return this.compare(row, column); + } + }; + this.clipRows = function(firstRow, lastRow) { + if (this.end.row > lastRow) + var end = {row: lastRow + 1, column: 0}; + else if (this.end.row < firstRow) + var end = {row: firstRow, column: 0}; + + if (this.start.row > lastRow) + var start = {row: lastRow + 1, column: 0}; + else if (this.start.row < firstRow) + var start = {row: firstRow, column: 0}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + this.extend = function(row, column) { + var cmp = this.compare(row, column); + + if (cmp == 0) + return this; + else if (cmp == -1) + var start = {row: row, column: column}; + else + var end = {row: row, column: column}; + + return Range.fromPoints(start || this.start, end || this.end); + }; + + this.isEmpty = function() { + return (this.start.row === this.end.row && this.start.column === this.end.column); + }; + this.isMultiLine = function() { + return (this.start.row !== this.end.row); + }; + this.clone = function() { + return Range.fromPoints(this.start, this.end); + }; + this.collapseRows = function() { + if (this.end.column == 0) + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) + else + return new Range(this.start.row, 0, this.end.row, 0) + }; + this.toScreenRange = function(session) { + var screenPosStart = session.documentToScreenPosition(this.start); + var screenPosEnd = session.documentToScreenPosition(this.end); + + return new Range( + screenPosStart.row, screenPosStart.column, + screenPosEnd.row, screenPosEnd.column + ); + }; + this.moveBy = function(row, column) { + this.start.row += row; + this.start.column += column; + this.end.row += row; + this.end.column += column; + }; + +}).call(Range.prototype); +Range.fromPoints = function(start, end) { + return new Range(start.row, start.column, end.row, end.column); +}; +Range.comparePoints = comparePoints; + +Range.comparePoints = function(p1, p2) { + return p1.row - p2.row || p1.column - p2.column; +}; + + +exports.Range = Range; +}); + +ace.define("ace/apply_delta",["require","exports","module"], function(require, exports, module) { +"use strict"; + +function throwDeltaError(delta, errorText){ + console.log("Invalid Delta:", delta); + throw "Invalid Delta: " + errorText; +} + +function positionInDocument(docLines, position) { + return position.row >= 0 && position.row < docLines.length && + position.column >= 0 && position.column <= docLines[position.row].length; +} + +function validateDelta(docLines, delta) { + if (delta.action != "insert" && delta.action != "remove") + throwDeltaError(delta, "delta.action must be 'insert' or 'remove'"); + if (!(delta.lines instanceof Array)) + throwDeltaError(delta, "delta.lines must be an Array"); + if (!delta.start || !delta.end) + throwDeltaError(delta, "delta.start/end must be an present"); + var start = delta.start; + if (!positionInDocument(docLines, delta.start)) + throwDeltaError(delta, "delta.start must be contained in document"); + var end = delta.end; + if (delta.action == "remove" && !positionInDocument(docLines, end)) + throwDeltaError(delta, "delta.end must contained in document for 'remove' actions"); + var numRangeRows = end.row - start.row; + var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0)); + if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars) + throwDeltaError(delta, "delta.range must match delta lines"); +} + +exports.applyDelta = function(docLines, delta, doNotValidate) { + + var row = delta.start.row; + var startColumn = delta.start.column; + var line = docLines[row] || ""; + switch (delta.action) { + case "insert": + var lines = delta.lines; + if (lines.length === 1) { + docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn); + } else { + var args = [row, 1].concat(delta.lines); + docLines.splice.apply(docLines, args); + docLines[row] = line.substring(0, startColumn) + docLines[row]; + docLines[row + delta.lines.length - 1] += line.substring(startColumn); + } + break; + case "remove": + var endColumn = delta.end.column; + var endRow = delta.end.row; + if (row === endRow) { + docLines[row] = line.substring(0, startColumn) + line.substring(endColumn); + } else { + docLines.splice( + row, endRow - row + 1, + line.substring(0, startColumn) + docLines[endRow].substring(endColumn) + ); + } + break; + } +} +}); + +ace.define("ace/lib/event_emitter",["require","exports","module"], function(require, exports, module) { +"use strict"; + +var EventEmitter = {}; +var stopPropagation = function() { this.propagationStopped = true; }; +var preventDefault = function() { this.defaultPrevented = true; }; + +EventEmitter._emit = +EventEmitter._dispatchEvent = function(eventName, e) { + this._eventRegistry || (this._eventRegistry = {}); + this._defaultHandlers || (this._defaultHandlers = {}); + + var listeners = this._eventRegistry[eventName] || []; + var defaultHandler = this._defaultHandlers[eventName]; + if (!listeners.length && !defaultHandler) + return; + + if (typeof e != "object" || !e) + e = {}; + + if (!e.type) + e.type = eventName; + if (!e.stopPropagation) + e.stopPropagation = stopPropagation; + if (!e.preventDefault) + e.preventDefault = preventDefault; + + listeners = listeners.slice(); + for (var i=0; i this.row) + return; + + var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight); + this.setPosition(point.row, point.column, true); + }; + + function $pointsInOrder(point1, point2, equalPointsInOrder) { + var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column; + return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter); + } + + function $getTransformedPoint(delta, point, moveIfEqual) { + var deltaIsInsert = delta.action == "insert"; + var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row); + var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column); + var deltaStart = delta.start; + var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range. + if ($pointsInOrder(point, deltaStart, moveIfEqual)) { + return { + row: point.row, + column: point.column + }; + } + if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) { + return { + row: point.row + deltaRowShift, + column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0) + }; + } + + return { + row: deltaStart.row, + column: deltaStart.column + }; + } + this.setPosition = function(row, column, noClip) { + var pos; + if (noClip) { + pos = { + row: row, + column: column + }; + } else { + pos = this.$clipPositionToDocument(row, column); + } + + if (this.row == pos.row && this.column == pos.column) + return; + + var old = { + row: this.row, + column: this.column + }; + + this.row = pos.row; + this.column = pos.column; + this._signal("change", { + old: old, + value: pos + }); + }; + this.detach = function() { + this.document.removeEventListener("change", this.$onChange); + }; + this.attach = function(doc) { + this.document = doc || this.document; + this.document.on("change", this.$onChange); + }; + this.$clipPositionToDocument = function(row, column) { + var pos = {}; + + if (row >= this.document.getLength()) { + pos.row = Math.max(0, this.document.getLength() - 1); + pos.column = this.document.getLine(pos.row).length; + } + else if (row < 0) { + pos.row = 0; + pos.column = 0; + } + else { + pos.row = row; + pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); + } + + if (column < 0) + pos.column = 0; + + return pos; + }; + +}).call(Anchor.prototype); + +}); + +ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"], function(require, exports, module) { +"use strict"; + +var oop = require("./lib/oop"); +var applyDelta = require("./apply_delta").applyDelta; +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var Range = require("./range").Range; +var Anchor = require("./anchor").Anchor; + +var Document = function(textOrLines) { + this.$lines = [""]; + if (textOrLines.length === 0) { + this.$lines = [""]; + } else if (Array.isArray(textOrLines)) { + this.insertMergedLines({row: 0, column: 0}, textOrLines); + } else { + this.insert({row: 0, column:0}, textOrLines); + } +}; + +(function() { + + oop.implement(this, EventEmitter); + this.setValue = function(text) { + var len = this.getLength() - 1; + this.remove(new Range(0, 0, len, this.getLine(len).length)); + this.insert({row: 0, column: 0}, text); + }; + this.getValue = function() { + return this.getAllLines().join(this.getNewLineCharacter()); + }; + this.createAnchor = function(row, column) { + return new Anchor(this, row, column); + }; + if ("aaa".split(/a/).length === 0) { + this.$split = function(text) { + return text.replace(/\r\n|\r/g, "\n").split("\n"); + }; + } else { + this.$split = function(text) { + return text.split(/\r\n|\r|\n/); + }; + } + + + this.$detectNewLine = function(text) { + var match = text.match(/^.*?(\r\n|\r|\n)/m); + this.$autoNewLine = match ? match[1] : "\n"; + this._signal("changeNewLineMode"); + }; + this.getNewLineCharacter = function() { + switch (this.$newLineMode) { + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine || "\n"; + } + }; + + this.$autoNewLine = ""; + this.$newLineMode = "auto"; + this.setNewLineMode = function(newLineMode) { + if (this.$newLineMode === newLineMode) + return; + + this.$newLineMode = newLineMode; + this._signal("changeNewLineMode"); + }; + this.getNewLineMode = function() { + return this.$newLineMode; + }; + this.isNewLine = function(text) { + return (text == "\r\n" || text == "\r" || text == "\n"); + }; + this.getLine = function(row) { + return this.$lines[row] || ""; + }; + this.getLines = function(firstRow, lastRow) { + return this.$lines.slice(firstRow, lastRow + 1); + }; + this.getAllLines = function() { + return this.getLines(0, this.getLength()); + }; + this.getLength = function() { + return this.$lines.length; + }; + this.getTextRange = function(range) { + return this.getLinesForRange(range).join(this.getNewLineCharacter()); + }; + this.getLinesForRange = function(range) { + var lines; + if (range.start.row === range.end.row) { + lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)]; + } else { + lines = this.getLines(range.start.row, range.end.row); + lines[0] = (lines[0] || "").substring(range.start.column); + var l = lines.length - 1; + if (range.end.row - range.start.row == l) + lines[l] = lines[l].substring(0, range.end.column); + } + return lines; + }; + this.insertLines = function(row, lines) { + console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."); + return this.insertFullLines(row, lines); + }; + this.removeLines = function(firstRow, lastRow) { + console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."); + return this.removeFullLines(firstRow, lastRow); + }; + this.insertNewLine = function(position) { + console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."); + return this.insertMergedLines(position, ["", ""]); + }; + this.insert = function(position, text) { + if (this.getLength() <= 1) + this.$detectNewLine(text); + + return this.insertMergedLines(position, this.$split(text)); + }; + this.insertInLine = function(position, text) { + var start = this.clippedPos(position.row, position.column); + var end = this.pos(position.row, position.column + text.length); + + this.applyDelta({ + start: start, + end: end, + action: "insert", + lines: [text] + }, true); + + return this.clonePos(end); + }; + + this.clippedPos = function(row, column) { + var length = this.getLength(); + if (row === undefined) { + row = length; + } else if (row < 0) { + row = 0; + } else if (row >= length) { + row = length - 1; + column = undefined; + } + var line = this.getLine(row); + if (column == undefined) + column = line.length; + column = Math.min(Math.max(column, 0), line.length); + return {row: row, column: column}; + }; + + this.clonePos = function(pos) { + return {row: pos.row, column: pos.column}; + }; + + this.pos = function(row, column) { + return {row: row, column: column}; + }; + + this.$clipPosition = function(position) { + var length = this.getLength(); + if (position.row >= length) { + position.row = Math.max(0, length - 1); + position.column = this.getLine(length - 1).length; + } else { + position.row = Math.max(0, position.row); + position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length); + } + return position; + }; + this.insertFullLines = function(row, lines) { + row = Math.min(Math.max(row, 0), this.getLength()); + var column = 0; + if (row < this.getLength()) { + lines = lines.concat([""]); + column = 0; + } else { + lines = [""].concat(lines); + row--; + column = this.$lines[row].length; + } + this.insertMergedLines({row: row, column: column}, lines); + }; + this.insertMergedLines = function(position, lines) { + var start = this.clippedPos(position.row, position.column); + var end = { + row: start.row + lines.length - 1, + column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length + }; + + this.applyDelta({ + start: start, + end: end, + action: "insert", + lines: lines + }); + + return this.clonePos(end); + }; + this.remove = function(range) { + var start = this.clippedPos(range.start.row, range.start.column); + var end = this.clippedPos(range.end.row, range.end.column); + this.applyDelta({ + start: start, + end: end, + action: "remove", + lines: this.getLinesForRange({start: start, end: end}) + }); + return this.clonePos(start); + }; + this.removeInLine = function(row, startColumn, endColumn) { + var start = this.clippedPos(row, startColumn); + var end = this.clippedPos(row, endColumn); + + this.applyDelta({ + start: start, + end: end, + action: "remove", + lines: this.getLinesForRange({start: start, end: end}) + }, true); + + return this.clonePos(start); + }; + this.removeFullLines = function(firstRow, lastRow) { + firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1); + lastRow = Math.min(Math.max(0, lastRow ), this.getLength() - 1); + var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0; + var deleteLastNewLine = lastRow < this.getLength() - 1; + var startRow = ( deleteFirstNewLine ? firstRow - 1 : firstRow ); + var startCol = ( deleteFirstNewLine ? this.getLine(startRow).length : 0 ); + var endRow = ( deleteLastNewLine ? lastRow + 1 : lastRow ); + var endCol = ( deleteLastNewLine ? 0 : this.getLine(endRow).length ); + var range = new Range(startRow, startCol, endRow, endCol); + var deletedLines = this.$lines.slice(firstRow, lastRow + 1); + + this.applyDelta({ + start: range.start, + end: range.end, + action: "remove", + lines: this.getLinesForRange(range) + }); + return deletedLines; + }; + this.removeNewLine = function(row) { + if (row < this.getLength() - 1 && row >= 0) { + this.applyDelta({ + start: this.pos(row, this.getLine(row).length), + end: this.pos(row + 1, 0), + action: "remove", + lines: ["", ""] + }); + } + }; + this.replace = function(range, text) { + if (!(range instanceof Range)) + range = Range.fromPoints(range.start, range.end); + if (text.length === 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + + this.remove(range); + var end; + if (text) { + end = this.insert(range.start, text); + } + else { + end = range.start; + } + + return end; + }; + this.applyDeltas = function(deltas) { + for (var i=0; i=0; i--) { + this.revertDelta(deltas[i]); + } + }; + this.applyDelta = function(delta, doNotValidate) { + var isInsert = delta.action == "insert"; + if (isInsert ? delta.lines.length <= 1 && !delta.lines[0] + : !Range.comparePoints(delta.start, delta.end)) { + return; + } + + if (isInsert && delta.lines.length > 20000) + this.$splitAndapplyLargeDelta(delta, 20000); + applyDelta(this.$lines, delta, doNotValidate); + this._signal("change", delta); + }; + + this.$splitAndapplyLargeDelta = function(delta, MAX) { + var lines = delta.lines; + var l = lines.length; + var row = delta.start.row; + var column = delta.start.column; + var from = 0, to = 0; + do { + from = to; + to += MAX - 1; + var chunk = lines.slice(from, to); + if (to > l) { + delta.lines = chunk; + delta.start.row = row + from; + delta.start.column = column; + break; + } + chunk.push(""); + this.applyDelta({ + start: this.pos(row + from, column), + end: this.pos(row + to, column = 0), + action: delta.action, + lines: chunk + }, true); + } while(true); + }; + this.revertDelta = function(delta) { + this.applyDelta({ + start: this.clonePos(delta.start), + end: this.clonePos(delta.end), + action: (delta.action == "insert" ? "remove" : "insert"), + lines: delta.lines.slice() + }); + }; + this.indexToPosition = function(index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return {row: i, column: index + lines[i].length + newlineLength}; + } + return {row: l-1, column: lines[l-1].length}; + }; + this.positionToIndex = function(pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + + return index + pos.column; + }; + +}).call(Document.prototype); + +exports.Document = Document; +}); + +ace.define("ace/worker/mirror",["require","exports","module","ace/range","ace/document","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var Range = require("../range").Range; +var Document = require("../document").Document; +var lang = require("../lib/lang"); + +var Mirror = exports.Mirror = function(sender) { + this.sender = sender; + var doc = this.doc = new Document(""); + + var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); + + var _self = this; + sender.on("change", function(e) { + var data = e.data; + if (data[0].start) { + doc.applyDeltas(data); + } else { + for (var i = 0; i < data.length; i += 2) { + if (Array.isArray(data[i+1])) { + var d = {action: "insert", start: data[i], lines: data[i+1]}; + } else { + var d = {action: "remove", start: data[i], end: data[i+1]}; + } + doc.applyDelta(d, true); + } + } + if (_self.$timeout) + return deferredUpdate.schedule(_self.$timeout); + _self.onUpdate(); + }); +}; + +(function() { + + this.$timeout = 500; + + this.setTimeout = function(timeout) { + this.$timeout = timeout; + }; + + this.setValue = function(value) { + this.doc.setValue(value); + this.deferredUpdate.schedule(this.$timeout); + }; + + this.getValue = function(callbackId) { + this.sender.callback(this.doc.getValue(), callbackId); + }; + + this.onUpdate = function() { + }; + + this.isPending = function() { + return this.deferredUpdate.isPending(); + }; + +}).call(Mirror.prototype); + +}); + +ace.define("ace/mode/css/csslint",["require","exports","module"], function(require, exports, module) { +var parserlib = {}; +(function(){ +function EventTarget(){ + this._listeners = {}; +} + +EventTarget.prototype = { + constructor: EventTarget, + addListener: function(type, listener){ + if (!this._listeners[type]){ + this._listeners[type] = []; + } + + this._listeners[type].push(listener); + }, + fire: function(event){ + if (typeof event == "string"){ + event = { type: event }; + } + if (typeof event.target != "undefined"){ + event.target = this; + } + + if (typeof event.type == "undefined"){ + throw new Error("Event object missing 'type' property."); + } + + if (this._listeners[event.type]){ + var listeners = this._listeners[event.type].concat(); + for (var i=0, len=listeners.length; i < len; i++){ + listeners[i].call(this, event); + } + } + }, + removeListener: function(type, listener){ + if (this._listeners[type]){ + var listeners = this._listeners[type]; + for (var i=0, len=listeners.length; i < len; i++){ + if (listeners[i] === listener){ + listeners.splice(i, 1); + break; + } + } + + + } + } +}; +function StringReader(text){ + this._input = text.replace(/\n\r?/g, "\n"); + this._line = 1; + this._col = 1; + this._cursor = 0; +} + +StringReader.prototype = { + constructor: StringReader, + getCol: function(){ + return this._col; + }, + getLine: function(){ + return this._line ; + }, + eof: function(){ + return (this._cursor == this._input.length); + }, + peek: function(count){ + var c = null; + count = (typeof count == "undefined" ? 1 : count); + if (this._cursor < this._input.length){ + c = this._input.charAt(this._cursor + count - 1); + } + + return c; + }, + read: function(){ + var c = null; + if (this._cursor < this._input.length){ + if (this._input.charAt(this._cursor) == "\n"){ + this._line++; + this._col=1; + } else { + this._col++; + } + c = this._input.charAt(this._cursor++); + } + + return c; + }, + mark: function(){ + this._bookmark = { + cursor: this._cursor, + line: this._line, + col: this._col + }; + }, + + reset: function(){ + if (this._bookmark){ + this._cursor = this._bookmark.cursor; + this._line = this._bookmark.line; + this._col = this._bookmark.col; + delete this._bookmark; + } + }, + readTo: function(pattern){ + + var buffer = "", + c; + while (buffer.length < pattern.length || buffer.lastIndexOf(pattern) != buffer.length - pattern.length){ + c = this.read(); + if (c){ + buffer += c; + } else { + throw new Error("Expected \"" + pattern + "\" at line " + this._line + ", col " + this._col + "."); + } + } + + return buffer; + + }, + readWhile: function(filter){ + + var buffer = "", + c = this.read(); + + while(c !== null && filter(c)){ + buffer += c; + c = this.read(); + } + + return buffer; + + }, + readMatch: function(matcher){ + + var source = this._input.substring(this._cursor), + value = null; + if (typeof matcher == "string"){ + if (source.indexOf(matcher) === 0){ + value = this.readCount(matcher.length); + } + } else if (matcher instanceof RegExp){ + if (matcher.test(source)){ + value = this.readCount(RegExp.lastMatch.length); + } + } + + return value; + }, + readCount: function(count){ + var buffer = ""; + + while(count--){ + buffer += this.read(); + } + + return buffer; + } + +}; +function SyntaxError(message, line, col){ + this.col = col; + this.line = line; + this.message = message; + +} +SyntaxError.prototype = new Error(); +function SyntaxUnit(text, line, col, type){ + this.col = col; + this.line = line; + this.text = text; + this.type = type; +} +SyntaxUnit.fromToken = function(token){ + return new SyntaxUnit(token.value, token.startLine, token.startCol); +}; + +SyntaxUnit.prototype = { + constructor: SyntaxUnit, + valueOf: function(){ + return this.text; + }, + toString: function(){ + return this.text; + } + +}; +function TokenStreamBase(input, tokenData){ + this._reader = input ? new StringReader(input.toString()) : null; + this._token = null; + this._tokenData = tokenData; + this._lt = []; + this._ltIndex = 0; + + this._ltIndexCache = []; +} +TokenStreamBase.createTokenData = function(tokens){ + + var nameMap = [], + typeMap = {}, + tokenData = tokens.concat([]), + i = 0, + len = tokenData.length+1; + + tokenData.UNKNOWN = -1; + tokenData.unshift({name:"EOF"}); + + for (; i < len; i++){ + nameMap.push(tokenData[i].name); + tokenData[tokenData[i].name] = i; + if (tokenData[i].text){ + typeMap[tokenData[i].text] = i; + } + } + + tokenData.name = function(tt){ + return nameMap[tt]; + }; + + tokenData.type = function(c){ + return typeMap[c]; + }; + + return tokenData; +}; + +TokenStreamBase.prototype = { + constructor: TokenStreamBase, + match: function(tokenTypes, channel){ + if (!(tokenTypes instanceof Array)){ + tokenTypes = [tokenTypes]; + } + + var tt = this.get(channel), + i = 0, + len = tokenTypes.length; + + while(i < len){ + if (tt == tokenTypes[i++]){ + return true; + } + } + this.unget(); + return false; + }, + mustMatch: function(tokenTypes, channel){ + + var token; + if (!(tokenTypes instanceof Array)){ + tokenTypes = [tokenTypes]; + } + + if (!this.match.apply(this, arguments)){ + token = this.LT(1); + throw new SyntaxError("Expected " + this._tokenData[tokenTypes[0]].name + + " at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); + } + }, + advance: function(tokenTypes, channel){ + + while(this.LA(0) !== 0 && !this.match(tokenTypes, channel)){ + this.get(); + } + + return this.LA(0); + }, + get: function(channel){ + + var tokenInfo = this._tokenData, + reader = this._reader, + value, + i =0, + len = tokenInfo.length, + found = false, + token, + info; + if (this._lt.length && this._ltIndex >= 0 && this._ltIndex < this._lt.length){ + + i++; + this._token = this._lt[this._ltIndex++]; + info = tokenInfo[this._token.type]; + while((info.channel !== undefined && channel !== info.channel) && + this._ltIndex < this._lt.length){ + this._token = this._lt[this._ltIndex++]; + info = tokenInfo[this._token.type]; + i++; + } + if ((info.channel === undefined || channel === info.channel) && + this._ltIndex <= this._lt.length){ + this._ltIndexCache.push(i); + return this._token.type; + } + } + token = this._getToken(); + if (token.type > -1 && !tokenInfo[token.type].hide){ + token.channel = tokenInfo[token.type].channel; + this._token = token; + this._lt.push(token); + this._ltIndexCache.push(this._lt.length - this._ltIndex + i); + if (this._lt.length > 5){ + this._lt.shift(); + } + if (this._ltIndexCache.length > 5){ + this._ltIndexCache.shift(); + } + this._ltIndex = this._lt.length; + } + info = tokenInfo[token.type]; + if (info && + (info.hide || + (info.channel !== undefined && channel !== info.channel))){ + return this.get(channel); + } else { + return token.type; + } + }, + LA: function(index){ + var total = index, + tt; + if (index > 0){ + if (index > 5){ + throw new Error("Too much lookahead."); + } + while(total){ + tt = this.get(); + total--; + } + while(total < index){ + this.unget(); + total++; + } + } else if (index < 0){ + + if(this._lt[this._ltIndex+index]){ + tt = this._lt[this._ltIndex+index].type; + } else { + throw new Error("Too much lookbehind."); + } + + } else { + tt = this._token.type; + } + + return tt; + + }, + LT: function(index){ + this.LA(index); + return this._lt[this._ltIndex+index-1]; + }, + peek: function(){ + return this.LA(1); + }, + token: function(){ + return this._token; + }, + tokenName: function(tokenType){ + if (tokenType < 0 || tokenType > this._tokenData.length){ + return "UNKNOWN_TOKEN"; + } else { + return this._tokenData[tokenType].name; + } + }, + tokenType: function(tokenName){ + return this._tokenData[tokenName] || -1; + }, + unget: function(){ + if (this._ltIndexCache.length){ + this._ltIndex -= this._ltIndexCache.pop();//--; + this._token = this._lt[this._ltIndex - 1]; + } else { + throw new Error("Too much lookahead."); + } + } + +}; + + +parserlib.util = { +StringReader: StringReader, +SyntaxError : SyntaxError, +SyntaxUnit : SyntaxUnit, +EventTarget : EventTarget, +TokenStreamBase : TokenStreamBase +}; +})(); +(function(){ +var EventTarget = parserlib.util.EventTarget, +TokenStreamBase = parserlib.util.TokenStreamBase, +StringReader = parserlib.util.StringReader, +SyntaxError = parserlib.util.SyntaxError, +SyntaxUnit = parserlib.util.SyntaxUnit; + +var Colors = { + aliceblue :"#f0f8ff", + antiquewhite :"#faebd7", + aqua :"#00ffff", + aquamarine :"#7fffd4", + azure :"#f0ffff", + beige :"#f5f5dc", + bisque :"#ffe4c4", + black :"#000000", + blanchedalmond :"#ffebcd", + blue :"#0000ff", + blueviolet :"#8a2be2", + brown :"#a52a2a", + burlywood :"#deb887", + cadetblue :"#5f9ea0", + chartreuse :"#7fff00", + chocolate :"#d2691e", + coral :"#ff7f50", + cornflowerblue :"#6495ed", + cornsilk :"#fff8dc", + crimson :"#dc143c", + cyan :"#00ffff", + darkblue :"#00008b", + darkcyan :"#008b8b", + darkgoldenrod :"#b8860b", + darkgray :"#a9a9a9", + darkgrey :"#a9a9a9", + darkgreen :"#006400", + darkkhaki :"#bdb76b", + darkmagenta :"#8b008b", + darkolivegreen :"#556b2f", + darkorange :"#ff8c00", + darkorchid :"#9932cc", + darkred :"#8b0000", + darksalmon :"#e9967a", + darkseagreen :"#8fbc8f", + darkslateblue :"#483d8b", + darkslategray :"#2f4f4f", + darkslategrey :"#2f4f4f", + darkturquoise :"#00ced1", + darkviolet :"#9400d3", + deeppink :"#ff1493", + deepskyblue :"#00bfff", + dimgray :"#696969", + dimgrey :"#696969", + dodgerblue :"#1e90ff", + firebrick :"#b22222", + floralwhite :"#fffaf0", + forestgreen :"#228b22", + fuchsia :"#ff00ff", + gainsboro :"#dcdcdc", + ghostwhite :"#f8f8ff", + gold :"#ffd700", + goldenrod :"#daa520", + gray :"#808080", + grey :"#808080", + green :"#008000", + greenyellow :"#adff2f", + honeydew :"#f0fff0", + hotpink :"#ff69b4", + indianred :"#cd5c5c", + indigo :"#4b0082", + ivory :"#fffff0", + khaki :"#f0e68c", + lavender :"#e6e6fa", + lavenderblush :"#fff0f5", + lawngreen :"#7cfc00", + lemonchiffon :"#fffacd", + lightblue :"#add8e6", + lightcoral :"#f08080", + lightcyan :"#e0ffff", + lightgoldenrodyellow :"#fafad2", + lightgray :"#d3d3d3", + lightgrey :"#d3d3d3", + lightgreen :"#90ee90", + lightpink :"#ffb6c1", + lightsalmon :"#ffa07a", + lightseagreen :"#20b2aa", + lightskyblue :"#87cefa", + lightslategray :"#778899", + lightslategrey :"#778899", + lightsteelblue :"#b0c4de", + lightyellow :"#ffffe0", + lime :"#00ff00", + limegreen :"#32cd32", + linen :"#faf0e6", + magenta :"#ff00ff", + maroon :"#800000", + mediumaquamarine:"#66cdaa", + mediumblue :"#0000cd", + mediumorchid :"#ba55d3", + mediumpurple :"#9370d8", + mediumseagreen :"#3cb371", + mediumslateblue :"#7b68ee", + mediumspringgreen :"#00fa9a", + mediumturquoise :"#48d1cc", + mediumvioletred :"#c71585", + midnightblue :"#191970", + mintcream :"#f5fffa", + mistyrose :"#ffe4e1", + moccasin :"#ffe4b5", + navajowhite :"#ffdead", + navy :"#000080", + oldlace :"#fdf5e6", + olive :"#808000", + olivedrab :"#6b8e23", + orange :"#ffa500", + orangered :"#ff4500", + orchid :"#da70d6", + palegoldenrod :"#eee8aa", + palegreen :"#98fb98", + paleturquoise :"#afeeee", + palevioletred :"#d87093", + papayawhip :"#ffefd5", + peachpuff :"#ffdab9", + peru :"#cd853f", + pink :"#ffc0cb", + plum :"#dda0dd", + powderblue :"#b0e0e6", + purple :"#800080", + red :"#ff0000", + rosybrown :"#bc8f8f", + royalblue :"#4169e1", + saddlebrown :"#8b4513", + salmon :"#fa8072", + sandybrown :"#f4a460", + seagreen :"#2e8b57", + seashell :"#fff5ee", + sienna :"#a0522d", + silver :"#c0c0c0", + skyblue :"#87ceeb", + slateblue :"#6a5acd", + slategray :"#708090", + slategrey :"#708090", + snow :"#fffafa", + springgreen :"#00ff7f", + steelblue :"#4682b4", + tan :"#d2b48c", + teal :"#008080", + thistle :"#d8bfd8", + tomato :"#ff6347", + turquoise :"#40e0d0", + violet :"#ee82ee", + wheat :"#f5deb3", + white :"#ffffff", + whitesmoke :"#f5f5f5", + yellow :"#ffff00", + yellowgreen :"#9acd32", + activeBorder :"Active window border.", + activecaption :"Active window caption.", + appworkspace :"Background color of multiple document interface.", + background :"Desktop background.", + buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.", + buttonhighlight :"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.", + buttonshadow :"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.", + buttontext :"Text on push buttons.", + captiontext :"Text in caption, size box, and scrollbar arrow box.", + graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.", + greytext :"Greyed (disabled) text. This color is set to #000 if the current display driver does not support a solid grey color.", + highlight :"Item(s) selected in a control.", + highlighttext :"Text of item(s) selected in a control.", + inactiveborder :"Inactive window border.", + inactivecaption :"Inactive window caption.", + inactivecaptiontext :"Color of text in an inactive caption.", + infobackground :"Background color for tooltip controls.", + infotext :"Text color for tooltip controls.", + menu :"Menu background.", + menutext :"Text in menus.", + scrollbar :"Scroll bar gray area.", + threeddarkshadow :"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", + threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", + threedhighlight :"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", + threedlightshadow :"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", + threedshadow :"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", + window :"Window background.", + windowframe :"Window frame.", + windowtext :"Text in windows." +}; +function Combinator(text, line, col){ + + SyntaxUnit.call(this, text, line, col, Parser.COMBINATOR_TYPE); + this.type = "unknown"; + if (/^\s+$/.test(text)){ + this.type = "descendant"; + } else if (text == ">"){ + this.type = "child"; + } else if (text == "+"){ + this.type = "adjacent-sibling"; + } else if (text == "~"){ + this.type = "sibling"; + } + +} + +Combinator.prototype = new SyntaxUnit(); +Combinator.prototype.constructor = Combinator; +function MediaFeature(name, value){ + + SyntaxUnit.call(this, "(" + name + (value !== null ? ":" + value : "") + ")", name.startLine, name.startCol, Parser.MEDIA_FEATURE_TYPE); + this.name = name; + this.value = value; +} + +MediaFeature.prototype = new SyntaxUnit(); +MediaFeature.prototype.constructor = MediaFeature; +function MediaQuery(modifier, mediaType, features, line, col){ + + SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType : "") + (mediaType && features.length > 0 ? " and " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE); + this.modifier = modifier; + this.mediaType = mediaType; + this.features = features; + +} + +MediaQuery.prototype = new SyntaxUnit(); +MediaQuery.prototype.constructor = MediaQuery; +function Parser(options){ + EventTarget.call(this); + + + this.options = options || {}; + + this._tokenStream = null; +} +Parser.DEFAULT_TYPE = 0; +Parser.COMBINATOR_TYPE = 1; +Parser.MEDIA_FEATURE_TYPE = 2; +Parser.MEDIA_QUERY_TYPE = 3; +Parser.PROPERTY_NAME_TYPE = 4; +Parser.PROPERTY_VALUE_TYPE = 5; +Parser.PROPERTY_VALUE_PART_TYPE = 6; +Parser.SELECTOR_TYPE = 7; +Parser.SELECTOR_PART_TYPE = 8; +Parser.SELECTOR_SUB_PART_TYPE = 9; + +Parser.prototype = function(){ + + var proto = new EventTarget(), //new prototype + prop, + additions = { + constructor: Parser, + DEFAULT_TYPE : 0, + COMBINATOR_TYPE : 1, + MEDIA_FEATURE_TYPE : 2, + MEDIA_QUERY_TYPE : 3, + PROPERTY_NAME_TYPE : 4, + PROPERTY_VALUE_TYPE : 5, + PROPERTY_VALUE_PART_TYPE : 6, + SELECTOR_TYPE : 7, + SELECTOR_PART_TYPE : 8, + SELECTOR_SUB_PART_TYPE : 9, + + _stylesheet: function(){ + + var tokenStream = this._tokenStream, + charset = null, + count, + token, + tt; + + this.fire("startstylesheet"); + this._charset(); + + this._skipCruft(); + while (tokenStream.peek() == Tokens.IMPORT_SYM){ + this._import(); + this._skipCruft(); + } + while (tokenStream.peek() == Tokens.NAMESPACE_SYM){ + this._namespace(); + this._skipCruft(); + } + tt = tokenStream.peek(); + while(tt > Tokens.EOF){ + + try { + + switch(tt){ + case Tokens.MEDIA_SYM: + this._media(); + this._skipCruft(); + break; + case Tokens.PAGE_SYM: + this._page(); + this._skipCruft(); + break; + case Tokens.FONT_FACE_SYM: + this._font_face(); + this._skipCruft(); + break; + case Tokens.KEYFRAMES_SYM: + this._keyframes(); + this._skipCruft(); + break; + case Tokens.VIEWPORT_SYM: + this._viewport(); + this._skipCruft(); + break; + case Tokens.UNKNOWN_SYM: //unknown @ rule + tokenStream.get(); + if (!this.options.strict){ + this.fire({ + type: "error", + error: null, + message: "Unknown @ rule: " + tokenStream.LT(0).value + ".", + line: tokenStream.LT(0).startLine, + col: tokenStream.LT(0).startCol + }); + count=0; + while (tokenStream.advance([Tokens.LBRACE, Tokens.RBRACE]) == Tokens.LBRACE){ + count++; //keep track of nesting depth + } + + while(count){ + tokenStream.advance([Tokens.RBRACE]); + count--; + } + + } else { + throw new SyntaxError("Unknown @ rule.", tokenStream.LT(0).startLine, tokenStream.LT(0).startCol); + } + break; + case Tokens.S: + this._readWhitespace(); + break; + default: + if(!this._ruleset()){ + switch(tt){ + case Tokens.CHARSET_SYM: + token = tokenStream.LT(1); + this._charset(false); + throw new SyntaxError("@charset not allowed here.", token.startLine, token.startCol); + case Tokens.IMPORT_SYM: + token = tokenStream.LT(1); + this._import(false); + throw new SyntaxError("@import not allowed here.", token.startLine, token.startCol); + case Tokens.NAMESPACE_SYM: + token = tokenStream.LT(1); + this._namespace(false); + throw new SyntaxError("@namespace not allowed here.", token.startLine, token.startCol); + default: + tokenStream.get(); //get the last token + this._unexpectedToken(tokenStream.token()); + } + + } + } + } catch(ex) { + if (ex instanceof SyntaxError && !this.options.strict){ + this.fire({ + type: "error", + error: ex, + message: ex.message, + line: ex.line, + col: ex.col + }); + } else { + throw ex; + } + } + + tt = tokenStream.peek(); + } + + if (tt != Tokens.EOF){ + this._unexpectedToken(tokenStream.token()); + } + + this.fire("endstylesheet"); + }, + + _charset: function(emit){ + var tokenStream = this._tokenStream, + charset, + token, + line, + col; + + if (tokenStream.match(Tokens.CHARSET_SYM)){ + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + + this._readWhitespace(); + tokenStream.mustMatch(Tokens.STRING); + + token = tokenStream.token(); + charset = token.value; + + this._readWhitespace(); + tokenStream.mustMatch(Tokens.SEMICOLON); + + if (emit !== false){ + this.fire({ + type: "charset", + charset:charset, + line: line, + col: col + }); + } + } + }, + + _import: function(emit){ + + var tokenStream = this._tokenStream, + tt, + uri, + importToken, + mediaList = []; + tokenStream.mustMatch(Tokens.IMPORT_SYM); + importToken = tokenStream.token(); + this._readWhitespace(); + + tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); + uri = tokenStream.token().value.replace(/^(?:url\()?["']?([^"']+?)["']?\)?$/, "$1"); + + this._readWhitespace(); + + mediaList = this._media_query_list(); + tokenStream.mustMatch(Tokens.SEMICOLON); + this._readWhitespace(); + + if (emit !== false){ + this.fire({ + type: "import", + uri: uri, + media: mediaList, + line: importToken.startLine, + col: importToken.startCol + }); + } + + }, + + _namespace: function(emit){ + + var tokenStream = this._tokenStream, + line, + col, + prefix, + uri; + tokenStream.mustMatch(Tokens.NAMESPACE_SYM); + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + this._readWhitespace(); + if (tokenStream.match(Tokens.IDENT)){ + prefix = tokenStream.token().value; + this._readWhitespace(); + } + + tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); + uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1"); + + this._readWhitespace(); + tokenStream.mustMatch(Tokens.SEMICOLON); + this._readWhitespace(); + + if (emit !== false){ + this.fire({ + type: "namespace", + prefix: prefix, + uri: uri, + line: line, + col: col + }); + } + + }, + + _media: function(){ + var tokenStream = this._tokenStream, + line, + col, + mediaList;// = []; + tokenStream.mustMatch(Tokens.MEDIA_SYM); + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + + this._readWhitespace(); + + mediaList = this._media_query_list(); + + tokenStream.mustMatch(Tokens.LBRACE); + this._readWhitespace(); + + this.fire({ + type: "startmedia", + media: mediaList, + line: line, + col: col + }); + + while(true) { + if (tokenStream.peek() == Tokens.PAGE_SYM){ + this._page(); + } else if (tokenStream.peek() == Tokens.FONT_FACE_SYM){ + this._font_face(); + } else if (tokenStream.peek() == Tokens.VIEWPORT_SYM){ + this._viewport(); + } else if (!this._ruleset()){ + break; + } + } + + tokenStream.mustMatch(Tokens.RBRACE); + this._readWhitespace(); + + this.fire({ + type: "endmedia", + media: mediaList, + line: line, + col: col + }); + }, + _media_query_list: function(){ + var tokenStream = this._tokenStream, + mediaList = []; + + + this._readWhitespace(); + + if (tokenStream.peek() == Tokens.IDENT || tokenStream.peek() == Tokens.LPAREN){ + mediaList.push(this._media_query()); + } + + while(tokenStream.match(Tokens.COMMA)){ + this._readWhitespace(); + mediaList.push(this._media_query()); + } + + return mediaList; + }, + _media_query: function(){ + var tokenStream = this._tokenStream, + type = null, + ident = null, + token = null, + expressions = []; + + if (tokenStream.match(Tokens.IDENT)){ + ident = tokenStream.token().value.toLowerCase(); + if (ident != "only" && ident != "not"){ + tokenStream.unget(); + ident = null; + } else { + token = tokenStream.token(); + } + } + + this._readWhitespace(); + + if (tokenStream.peek() == Tokens.IDENT){ + type = this._media_type(); + if (token === null){ + token = tokenStream.token(); + } + } else if (tokenStream.peek() == Tokens.LPAREN){ + if (token === null){ + token = tokenStream.LT(1); + } + expressions.push(this._media_expression()); + } + + if (type === null && expressions.length === 0){ + return null; + } else { + this._readWhitespace(); + while (tokenStream.match(Tokens.IDENT)){ + if (tokenStream.token().value.toLowerCase() != "and"){ + this._unexpectedToken(tokenStream.token()); + } + + this._readWhitespace(); + expressions.push(this._media_expression()); + } + } + + return new MediaQuery(ident, type, expressions, token.startLine, token.startCol); + }, + _media_type: function(){ + return this._media_feature(); + }, + _media_expression: function(){ + var tokenStream = this._tokenStream, + feature = null, + token, + expression = null; + + tokenStream.mustMatch(Tokens.LPAREN); + + feature = this._media_feature(); + this._readWhitespace(); + + if (tokenStream.match(Tokens.COLON)){ + this._readWhitespace(); + token = tokenStream.LT(1); + expression = this._expression(); + } + + tokenStream.mustMatch(Tokens.RPAREN); + this._readWhitespace(); + + return new MediaFeature(feature, (expression ? new SyntaxUnit(expression, token.startLine, token.startCol) : null)); + }, + _media_feature: function(){ + var tokenStream = this._tokenStream; + + tokenStream.mustMatch(Tokens.IDENT); + + return SyntaxUnit.fromToken(tokenStream.token()); + }, + _page: function(){ + var tokenStream = this._tokenStream, + line, + col, + identifier = null, + pseudoPage = null; + tokenStream.mustMatch(Tokens.PAGE_SYM); + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + + this._readWhitespace(); + + if (tokenStream.match(Tokens.IDENT)){ + identifier = tokenStream.token().value; + if (identifier.toLowerCase() === "auto"){ + this._unexpectedToken(tokenStream.token()); + } + } + if (tokenStream.peek() == Tokens.COLON){ + pseudoPage = this._pseudo_page(); + } + + this._readWhitespace(); + + this.fire({ + type: "startpage", + id: identifier, + pseudo: pseudoPage, + line: line, + col: col + }); + + this._readDeclarations(true, true); + + this.fire({ + type: "endpage", + id: identifier, + pseudo: pseudoPage, + line: line, + col: col + }); + + }, + _margin: function(){ + var tokenStream = this._tokenStream, + line, + col, + marginSym = this._margin_sym(); + + if (marginSym){ + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + + this.fire({ + type: "startpagemargin", + margin: marginSym, + line: line, + col: col + }); + + this._readDeclarations(true); + + this.fire({ + type: "endpagemargin", + margin: marginSym, + line: line, + col: col + }); + return true; + } else { + return false; + } + }, + _margin_sym: function(){ + + var tokenStream = this._tokenStream; + + if(tokenStream.match([Tokens.TOPLEFTCORNER_SYM, Tokens.TOPLEFT_SYM, + Tokens.TOPCENTER_SYM, Tokens.TOPRIGHT_SYM, Tokens.TOPRIGHTCORNER_SYM, + Tokens.BOTTOMLEFTCORNER_SYM, Tokens.BOTTOMLEFT_SYM, + Tokens.BOTTOMCENTER_SYM, Tokens.BOTTOMRIGHT_SYM, + Tokens.BOTTOMRIGHTCORNER_SYM, Tokens.LEFTTOP_SYM, + Tokens.LEFTMIDDLE_SYM, Tokens.LEFTBOTTOM_SYM, Tokens.RIGHTTOP_SYM, + Tokens.RIGHTMIDDLE_SYM, Tokens.RIGHTBOTTOM_SYM])) + { + return SyntaxUnit.fromToken(tokenStream.token()); + } else { + return null; + } + + }, + + _pseudo_page: function(){ + + var tokenStream = this._tokenStream; + + tokenStream.mustMatch(Tokens.COLON); + tokenStream.mustMatch(Tokens.IDENT); + + return tokenStream.token().value; + }, + + _font_face: function(){ + var tokenStream = this._tokenStream, + line, + col; + tokenStream.mustMatch(Tokens.FONT_FACE_SYM); + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + + this._readWhitespace(); + + this.fire({ + type: "startfontface", + line: line, + col: col + }); + + this._readDeclarations(true); + + this.fire({ + type: "endfontface", + line: line, + col: col + }); + }, + + _viewport: function(){ + var tokenStream = this._tokenStream, + line, + col; + + tokenStream.mustMatch(Tokens.VIEWPORT_SYM); + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + + this._readWhitespace(); + + this.fire({ + type: "startviewport", + line: line, + col: col + }); + + this._readDeclarations(true); + + this.fire({ + type: "endviewport", + line: line, + col: col + }); + + }, + + _operator: function(inFunction){ + + var tokenStream = this._tokenStream, + token = null; + + if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) || + (inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))){ + token = tokenStream.token(); + this._readWhitespace(); + } + return token ? PropertyValuePart.fromToken(token) : null; + + }, + + _combinator: function(){ + + var tokenStream = this._tokenStream, + value = null, + token; + + if(tokenStream.match([Tokens.PLUS, Tokens.GREATER, Tokens.TILDE])){ + token = tokenStream.token(); + value = new Combinator(token.value, token.startLine, token.startCol); + this._readWhitespace(); + } + + return value; + }, + + _unary_operator: function(){ + + var tokenStream = this._tokenStream; + + if (tokenStream.match([Tokens.MINUS, Tokens.PLUS])){ + return tokenStream.token().value; + } else { + return null; + } + }, + + _property: function(){ + + var tokenStream = this._tokenStream, + value = null, + hack = null, + tokenValue, + token, + line, + col; + if (tokenStream.peek() == Tokens.STAR && this.options.starHack){ + tokenStream.get(); + token = tokenStream.token(); + hack = token.value; + line = token.startLine; + col = token.startCol; + } + + if(tokenStream.match(Tokens.IDENT)){ + token = tokenStream.token(); + tokenValue = token.value; + if (tokenValue.charAt(0) == "_" && this.options.underscoreHack){ + hack = "_"; + tokenValue = tokenValue.substring(1); + } + + value = new PropertyName(tokenValue, hack, (line||token.startLine), (col||token.startCol)); + this._readWhitespace(); + } + + return value; + }, + _ruleset: function(){ + + var tokenStream = this._tokenStream, + tt, + selectors; + try { + selectors = this._selectors_group(); + } catch (ex){ + if (ex instanceof SyntaxError && !this.options.strict){ + this.fire({ + type: "error", + error: ex, + message: ex.message, + line: ex.line, + col: ex.col + }); + tt = tokenStream.advance([Tokens.RBRACE]); + if (tt == Tokens.RBRACE){ + } else { + throw ex; + } + + } else { + throw ex; + } + return true; + } + if (selectors){ + + this.fire({ + type: "startrule", + selectors: selectors, + line: selectors[0].line, + col: selectors[0].col + }); + + this._readDeclarations(true); + + this.fire({ + type: "endrule", + selectors: selectors, + line: selectors[0].line, + col: selectors[0].col + }); + + } + + return selectors; + + }, + _selectors_group: function(){ + var tokenStream = this._tokenStream, + selectors = [], + selector; + + selector = this._selector(); + if (selector !== null){ + + selectors.push(selector); + while(tokenStream.match(Tokens.COMMA)){ + this._readWhitespace(); + selector = this._selector(); + if (selector !== null){ + selectors.push(selector); + } else { + this._unexpectedToken(tokenStream.LT(1)); + } + } + } + + return selectors.length ? selectors : null; + }, + _selector: function(){ + + var tokenStream = this._tokenStream, + selector = [], + nextSelector = null, + combinator = null, + ws = null; + nextSelector = this._simple_selector_sequence(); + if (nextSelector === null){ + return null; + } + + selector.push(nextSelector); + + do { + combinator = this._combinator(); + + if (combinator !== null){ + selector.push(combinator); + nextSelector = this._simple_selector_sequence(); + if (nextSelector === null){ + this._unexpectedToken(tokenStream.LT(1)); + } else { + selector.push(nextSelector); + } + } else { + if (this._readWhitespace()){ + ws = new Combinator(tokenStream.token().value, tokenStream.token().startLine, tokenStream.token().startCol); + combinator = this._combinator(); + nextSelector = this._simple_selector_sequence(); + if (nextSelector === null){ + if (combinator !== null){ + this._unexpectedToken(tokenStream.LT(1)); + } + } else { + + if (combinator !== null){ + selector.push(combinator); + } else { + selector.push(ws); + } + + selector.push(nextSelector); + } + } else { + break; + } + + } + } while(true); + + return new Selector(selector, selector[0].line, selector[0].col); + }, + _simple_selector_sequence: function(){ + + var tokenStream = this._tokenStream, + elementName = null, + modifiers = [], + selectorText= "", + components = [ + function(){ + return tokenStream.match(Tokens.HASH) ? + new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : + null; + }, + this._class, + this._attrib, + this._pseudo, + this._negation + ], + i = 0, + len = components.length, + component = null, + found = false, + line, + col; + line = tokenStream.LT(1).startLine; + col = tokenStream.LT(1).startCol; + + elementName = this._type_selector(); + if (!elementName){ + elementName = this._universal(); + } + + if (elementName !== null){ + selectorText += elementName; + } + + while(true){ + if (tokenStream.peek() === Tokens.S){ + break; + } + while(i < len && component === null){ + component = components[i++].call(this); + } + + if (component === null){ + if (selectorText === ""){ + return null; + } else { + break; + } + } else { + i = 0; + modifiers.push(component); + selectorText += component.toString(); + component = null; + } + } + + + return selectorText !== "" ? + new SelectorPart(elementName, modifiers, selectorText, line, col) : + null; + }, + _type_selector: function(){ + + var tokenStream = this._tokenStream, + ns = this._namespace_prefix(), + elementName = this._element_name(); + + if (!elementName){ + if (ns){ + tokenStream.unget(); + if (ns.length > 1){ + tokenStream.unget(); + } + } + + return null; + } else { + if (ns){ + elementName.text = ns + elementName.text; + elementName.col -= ns.length; + } + return elementName; + } + }, + _class: function(){ + + var tokenStream = this._tokenStream, + token; + + if (tokenStream.match(Tokens.DOT)){ + tokenStream.mustMatch(Tokens.IDENT); + token = tokenStream.token(); + return new SelectorSubPart("." + token.value, "class", token.startLine, token.startCol - 1); + } else { + return null; + } + + }, + _element_name: function(){ + + var tokenStream = this._tokenStream, + token; + + if (tokenStream.match(Tokens.IDENT)){ + token = tokenStream.token(); + return new SelectorSubPart(token.value, "elementName", token.startLine, token.startCol); + + } else { + return null; + } + }, + _namespace_prefix: function(){ + var tokenStream = this._tokenStream, + value = ""; + if (tokenStream.LA(1) === Tokens.PIPE || tokenStream.LA(2) === Tokens.PIPE){ + + if(tokenStream.match([Tokens.IDENT, Tokens.STAR])){ + value += tokenStream.token().value; + } + + tokenStream.mustMatch(Tokens.PIPE); + value += "|"; + + } + + return value.length ? value : null; + }, + _universal: function(){ + var tokenStream = this._tokenStream, + value = "", + ns; + + ns = this._namespace_prefix(); + if(ns){ + value += ns; + } + + if(tokenStream.match(Tokens.STAR)){ + value += "*"; + } + + return value.length ? value : null; + + }, + _attrib: function(){ + + var tokenStream = this._tokenStream, + value = null, + ns, + token; + + if (tokenStream.match(Tokens.LBRACKET)){ + token = tokenStream.token(); + value = token.value; + value += this._readWhitespace(); + + ns = this._namespace_prefix(); + + if (ns){ + value += ns; + } + + tokenStream.mustMatch(Tokens.IDENT); + value += tokenStream.token().value; + value += this._readWhitespace(); + + if(tokenStream.match([Tokens.PREFIXMATCH, Tokens.SUFFIXMATCH, Tokens.SUBSTRINGMATCH, + Tokens.EQUALS, Tokens.INCLUDES, Tokens.DASHMATCH])){ + + value += tokenStream.token().value; + value += this._readWhitespace(); + + tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); + value += tokenStream.token().value; + value += this._readWhitespace(); + } + + tokenStream.mustMatch(Tokens.RBRACKET); + + return new SelectorSubPart(value + "]", "attribute", token.startLine, token.startCol); + } else { + return null; + } + }, + _pseudo: function(){ + + var tokenStream = this._tokenStream, + pseudo = null, + colons = ":", + line, + col; + + if (tokenStream.match(Tokens.COLON)){ + + if (tokenStream.match(Tokens.COLON)){ + colons += ":"; + } + + if (tokenStream.match(Tokens.IDENT)){ + pseudo = tokenStream.token().value; + line = tokenStream.token().startLine; + col = tokenStream.token().startCol - colons.length; + } else if (tokenStream.peek() == Tokens.FUNCTION){ + line = tokenStream.LT(1).startLine; + col = tokenStream.LT(1).startCol - colons.length; + pseudo = this._functional_pseudo(); + } + + if (pseudo){ + pseudo = new SelectorSubPart(colons + pseudo, "pseudo", line, col); + } + } + + return pseudo; + }, + _functional_pseudo: function(){ + + var tokenStream = this._tokenStream, + value = null; + + if(tokenStream.match(Tokens.FUNCTION)){ + value = tokenStream.token().value; + value += this._readWhitespace(); + value += this._expression(); + tokenStream.mustMatch(Tokens.RPAREN); + value += ")"; + } + + return value; + }, + _expression: function(){ + + var tokenStream = this._tokenStream, + value = ""; + + while(tokenStream.match([Tokens.PLUS, Tokens.MINUS, Tokens.DIMENSION, + Tokens.NUMBER, Tokens.STRING, Tokens.IDENT, Tokens.LENGTH, + Tokens.FREQ, Tokens.ANGLE, Tokens.TIME, + Tokens.RESOLUTION, Tokens.SLASH])){ + + value += tokenStream.token().value; + value += this._readWhitespace(); + } + + return value.length ? value : null; + + }, + _negation: function(){ + + var tokenStream = this._tokenStream, + line, + col, + value = "", + arg, + subpart = null; + + if (tokenStream.match(Tokens.NOT)){ + value = tokenStream.token().value; + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + value += this._readWhitespace(); + arg = this._negation_arg(); + value += arg; + value += this._readWhitespace(); + tokenStream.match(Tokens.RPAREN); + value += tokenStream.token().value; + + subpart = new SelectorSubPart(value, "not", line, col); + subpart.args.push(arg); + } + + return subpart; + }, + _negation_arg: function(){ + + var tokenStream = this._tokenStream, + args = [ + this._type_selector, + this._universal, + function(){ + return tokenStream.match(Tokens.HASH) ? + new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : + null; + }, + this._class, + this._attrib, + this._pseudo + ], + arg = null, + i = 0, + len = args.length, + elementName, + line, + col, + part; + + line = tokenStream.LT(1).startLine; + col = tokenStream.LT(1).startCol; + + while(i < len && arg === null){ + + arg = args[i].call(this); + i++; + } + if (arg === null){ + this._unexpectedToken(tokenStream.LT(1)); + } + if (arg.type == "elementName"){ + part = new SelectorPart(arg, [], arg.toString(), line, col); + } else { + part = new SelectorPart(null, [arg], arg.toString(), line, col); + } + + return part; + }, + + _declaration: function(){ + + var tokenStream = this._tokenStream, + property = null, + expr = null, + prio = null, + error = null, + invalid = null, + propertyName= ""; + + property = this._property(); + if (property !== null){ + + tokenStream.mustMatch(Tokens.COLON); + this._readWhitespace(); + + expr = this._expr(); + if (!expr || expr.length === 0){ + this._unexpectedToken(tokenStream.LT(1)); + } + + prio = this._prio(); + propertyName = property.toString(); + if (this.options.starHack && property.hack == "*" || + this.options.underscoreHack && property.hack == "_") { + + propertyName = property.text; + } + + try { + this._validateProperty(propertyName, expr); + } catch (ex) { + invalid = ex; + } + + this.fire({ + type: "property", + property: property, + value: expr, + important: prio, + line: property.line, + col: property.col, + invalid: invalid + }); + + return true; + } else { + return false; + } + }, + + _prio: function(){ + + var tokenStream = this._tokenStream, + result = tokenStream.match(Tokens.IMPORTANT_SYM); + + this._readWhitespace(); + return result; + }, + + _expr: function(inFunction){ + + var tokenStream = this._tokenStream, + values = [], + value = null, + operator = null; + + value = this._term(inFunction); + if (value !== null){ + + values.push(value); + + do { + operator = this._operator(inFunction); + if (operator){ + values.push(operator); + } /*else { + values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col)); + valueParts = []; + }*/ + + value = this._term(inFunction); + + if (value === null){ + break; + } else { + values.push(value); + } + } while(true); + } + + return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null; + }, + + _term: function(inFunction){ + + var tokenStream = this._tokenStream, + unary = null, + value = null, + endChar = null, + token, + line, + col; + unary = this._unary_operator(); + if (unary !== null){ + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + } + if (tokenStream.peek() == Tokens.IE_FUNCTION && this.options.ieFilters){ + + value = this._ie_function(); + if (unary === null){ + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + } + } else if (inFunction && tokenStream.match([Tokens.LPAREN, Tokens.LBRACE, Tokens.LBRACKET])){ + + token = tokenStream.token(); + endChar = token.endChar; + value = token.value + this._expr(inFunction).text; + if (unary === null){ + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + } + tokenStream.mustMatch(Tokens.type(endChar)); + value += endChar; + this._readWhitespace(); + } else if (tokenStream.match([Tokens.NUMBER, Tokens.PERCENTAGE, Tokens.LENGTH, + Tokens.ANGLE, Tokens.TIME, + Tokens.FREQ, Tokens.STRING, Tokens.IDENT, Tokens.URI, Tokens.UNICODE_RANGE])){ + + value = tokenStream.token().value; + if (unary === null){ + line = tokenStream.token().startLine; + col = tokenStream.token().startCol; + } + this._readWhitespace(); + } else { + token = this._hexcolor(); + if (token === null){ + if (unary === null){ + line = tokenStream.LT(1).startLine; + col = tokenStream.LT(1).startCol; + } + if (value === null){ + if (tokenStream.LA(3) == Tokens.EQUALS && this.options.ieFilters){ + value = this._ie_function(); + } else { + value = this._function(); + } + } + + } else { + value = token.value; + if (unary === null){ + line = token.startLine; + col = token.startCol; + } + } + + } + + return value !== null ? + new PropertyValuePart(unary !== null ? unary + value : value, line, col) : + null; + + }, + + _function: function(){ + + var tokenStream = this._tokenStream, + functionText = null, + expr = null, + lt; + + if (tokenStream.match(Tokens.FUNCTION)){ + functionText = tokenStream.token().value; + this._readWhitespace(); + expr = this._expr(true); + functionText += expr; + if (this.options.ieFilters && tokenStream.peek() == Tokens.EQUALS){ + do { + + if (this._readWhitespace()){ + functionText += tokenStream.token().value; + } + if (tokenStream.LA(0) == Tokens.COMMA){ + functionText += tokenStream.token().value; + } + + tokenStream.match(Tokens.IDENT); + functionText += tokenStream.token().value; + + tokenStream.match(Tokens.EQUALS); + functionText += tokenStream.token().value; + lt = tokenStream.peek(); + while(lt != Tokens.COMMA && lt != Tokens.S && lt != Tokens.RPAREN){ + tokenStream.get(); + functionText += tokenStream.token().value; + lt = tokenStream.peek(); + } + } while(tokenStream.match([Tokens.COMMA, Tokens.S])); + } + + tokenStream.match(Tokens.RPAREN); + functionText += ")"; + this._readWhitespace(); + } + + return functionText; + }, + + _ie_function: function(){ + + var tokenStream = this._tokenStream, + functionText = null, + expr = null, + lt; + if (tokenStream.match([Tokens.IE_FUNCTION, Tokens.FUNCTION])){ + functionText = tokenStream.token().value; + + do { + + if (this._readWhitespace()){ + functionText += tokenStream.token().value; + } + if (tokenStream.LA(0) == Tokens.COMMA){ + functionText += tokenStream.token().value; + } + + tokenStream.match(Tokens.IDENT); + functionText += tokenStream.token().value; + + tokenStream.match(Tokens.EQUALS); + functionText += tokenStream.token().value; + lt = tokenStream.peek(); + while(lt != Tokens.COMMA && lt != Tokens.S && lt != Tokens.RPAREN){ + tokenStream.get(); + functionText += tokenStream.token().value; + lt = tokenStream.peek(); + } + } while(tokenStream.match([Tokens.COMMA, Tokens.S])); + + tokenStream.match(Tokens.RPAREN); + functionText += ")"; + this._readWhitespace(); + } + + return functionText; + }, + + _hexcolor: function(){ + + var tokenStream = this._tokenStream, + token = null, + color; + + if(tokenStream.match(Tokens.HASH)){ + + token = tokenStream.token(); + color = token.value; + if (!/#[a-f0-9]{3,6}/i.test(color)){ + throw new SyntaxError("Expected a hex color but found '" + color + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); + } + this._readWhitespace(); + } + + return token; + }, + + _keyframes: function(){ + var tokenStream = this._tokenStream, + token, + tt, + name, + prefix = ""; + + tokenStream.mustMatch(Tokens.KEYFRAMES_SYM); + token = tokenStream.token(); + if (/^@\-([^\-]+)\-/.test(token.value)) { + prefix = RegExp.$1; + } + + this._readWhitespace(); + name = this._keyframe_name(); + + this._readWhitespace(); + tokenStream.mustMatch(Tokens.LBRACE); + + this.fire({ + type: "startkeyframes", + name: name, + prefix: prefix, + line: token.startLine, + col: token.startCol + }); + + this._readWhitespace(); + tt = tokenStream.peek(); + while(tt == Tokens.IDENT || tt == Tokens.PERCENTAGE) { + this._keyframe_rule(); + this._readWhitespace(); + tt = tokenStream.peek(); + } + + this.fire({ + type: "endkeyframes", + name: name, + prefix: prefix, + line: token.startLine, + col: token.startCol + }); + + this._readWhitespace(); + tokenStream.mustMatch(Tokens.RBRACE); + + }, + + _keyframe_name: function(){ + var tokenStream = this._tokenStream, + token; + + tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); + return SyntaxUnit.fromToken(tokenStream.token()); + }, + + _keyframe_rule: function(){ + var tokenStream = this._tokenStream, + token, + keyList = this._key_list(); + + this.fire({ + type: "startkeyframerule", + keys: keyList, + line: keyList[0].line, + col: keyList[0].col + }); + + this._readDeclarations(true); + + this.fire({ + type: "endkeyframerule", + keys: keyList, + line: keyList[0].line, + col: keyList[0].col + }); + + }, + + _key_list: function(){ + var tokenStream = this._tokenStream, + token, + key, + keyList = []; + keyList.push(this._key()); + + this._readWhitespace(); + + while(tokenStream.match(Tokens.COMMA)){ + this._readWhitespace(); + keyList.push(this._key()); + this._readWhitespace(); + } + + return keyList; + }, + + _key: function(){ + + var tokenStream = this._tokenStream, + token; + + if (tokenStream.match(Tokens.PERCENTAGE)){ + return SyntaxUnit.fromToken(tokenStream.token()); + } else if (tokenStream.match(Tokens.IDENT)){ + token = tokenStream.token(); + + if (/from|to/i.test(token.value)){ + return SyntaxUnit.fromToken(token); + } + + tokenStream.unget(); + } + this._unexpectedToken(tokenStream.LT(1)); + }, + _skipCruft: function(){ + while(this._tokenStream.match([Tokens.S, Tokens.CDO, Tokens.CDC])){ + } + }, + _readDeclarations: function(checkStart, readMargins){ + var tokenStream = this._tokenStream, + tt; + + + this._readWhitespace(); + + if (checkStart){ + tokenStream.mustMatch(Tokens.LBRACE); + } + + this._readWhitespace(); + + try { + + while(true){ + + if (tokenStream.match(Tokens.SEMICOLON) || (readMargins && this._margin())){ + } else if (this._declaration()){ + if (!tokenStream.match(Tokens.SEMICOLON)){ + break; + } + } else { + break; + } + this._readWhitespace(); + } + + tokenStream.mustMatch(Tokens.RBRACE); + this._readWhitespace(); + + } catch (ex) { + if (ex instanceof SyntaxError && !this.options.strict){ + this.fire({ + type: "error", + error: ex, + message: ex.message, + line: ex.line, + col: ex.col + }); + tt = tokenStream.advance([Tokens.SEMICOLON, Tokens.RBRACE]); + if (tt == Tokens.SEMICOLON){ + this._readDeclarations(false, readMargins); + } else if (tt != Tokens.RBRACE){ + throw ex; + } + + } else { + throw ex; + } + } + + }, + _readWhitespace: function(){ + + var tokenStream = this._tokenStream, + ws = ""; + + while(tokenStream.match(Tokens.S)){ + ws += tokenStream.token().value; + } + + return ws; + }, + _unexpectedToken: function(token){ + throw new SyntaxError("Unexpected token '" + token.value + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); + }, + _verifyEnd: function(){ + if (this._tokenStream.LA(1) != Tokens.EOF){ + this._unexpectedToken(this._tokenStream.LT(1)); + } + }, + _validateProperty: function(property, value){ + Validation.validate(property, value); + }, + + parse: function(input){ + this._tokenStream = new TokenStream(input, Tokens); + this._stylesheet(); + }, + + parseStyleSheet: function(input){ + return this.parse(input); + }, + + parseMediaQuery: function(input){ + this._tokenStream = new TokenStream(input, Tokens); + var result = this._media_query(); + this._verifyEnd(); + return result; + }, + parsePropertyValue: function(input){ + + this._tokenStream = new TokenStream(input, Tokens); + this._readWhitespace(); + + var result = this._expr(); + this._readWhitespace(); + this._verifyEnd(); + return result; + }, + parseRule: function(input){ + this._tokenStream = new TokenStream(input, Tokens); + this._readWhitespace(); + + var result = this._ruleset(); + this._readWhitespace(); + this._verifyEnd(); + return result; + }, + parseSelector: function(input){ + + this._tokenStream = new TokenStream(input, Tokens); + this._readWhitespace(); + + var result = this._selector(); + this._readWhitespace(); + this._verifyEnd(); + return result; + }, + parseStyleAttribute: function(input){ + input += "}"; // for error recovery in _readDeclarations() + this._tokenStream = new TokenStream(input, Tokens); + this._readDeclarations(); + } + }; + for (prop in additions){ + if (additions.hasOwnProperty(prop)){ + proto[prop] = additions[prop]; + } + } + + return proto; +}(); +var Properties = { + "align-items" : "flex-start | flex-end | center | baseline | stretch", + "align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", + "align-self" : "auto | flex-start | flex-end | center | baseline | stretch", + "-webkit-align-items" : "flex-start | flex-end | center | baseline | stretch", + "-webkit-align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", + "-webkit-align-self" : "auto | flex-start | flex-end | center | baseline | stretch", + "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ", + "alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", + "animation" : 1, + "animation-delay" : { multi: "
      '; - - echo ''; - + print '
      '; + print ''; + print ''; + print ''; + + dol_fiche_head(array(), ''); + + print ''."\n"; + foreach($object->fields as $key => $val) + { + if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'import_key'))) continue; + print ''.$langs->trans($val['label']).''; + } + print '
      '."\n"; + + dol_fiche_end(); + + print '
       
      '; + + print '
      '; } -if ($action == 'view' || $action == 'edit' || empty($action)) + + +// Part to edit record +if (($id || $ref) && $action == 'edit') { - $object = new Inventory($db); - $result = $object->fetch($id); - if ($result < 0) dol_print_error($db, $object->error, $object->errors); - - $warehouse = new Entrepot($db); - $warehouse->fetch($object->fk_warehouse); - - - - if($action == 'changePMP') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ApplyNewPMP'), $langs->trans('ConfirmApplyNewPMP', $object->getTitle()), 'confirm_changePMP', array(),'no',1); - } - else if($action == 'flush') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('FlushInventory'),$langs->trans('ConfirmFlushInventory',$object->getTitle()),'confirm_flush',array(),'no',1); - } - else if($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('Delete'),$langs->trans('ConfirmDelete',$object->getTitle()),'confirm_delete',array(),'no',1); - } - else if($action == 'delete_line') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&rowid='.GETPOST('rowid'),$langs->trans('DeleteLine'),$langs->trans('ConfirmDeleteLine',$object->getTitle()),'confirm_delete_line',array(),'no',1); - } - else if($action == 'regulate') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('RegulateStock'),$langs->trans('ConfirmRegulateStock',$object->getTitle()),'confirm_regulate',array(),'no',1); - } - - print dol_get_fiche_head(inventoryPrepareHead($object, $langs->trans('inventoryOfWarehouse', $warehouse->libelle), empty($action) ? '': '&action='.$action)); - - $lines = array(); - card_line($object, $lines, $action); - - print $langs->trans('Ref')." ".$object->ref.'
      '; - print $langs->trans('Date')." ".$object->getDate('date_inventory').'

      '; - - $objectTPL = array( - 'id'=> $object->id - ,'ref'=> $object->ref - ,'date_cre' => $object->getDate('date_cre', 'd/m/Y') - ,'date_maj' => $object->getDate('date_maj', 'd/m/Y H:i') - ,'fk_warehouse' => $object->fk_warehouse - ,'status' => $object->status - ,'entity' => $object->entity - ,'amount' => price( round($object->amount,2) ) - ,'amount_actual'=>price (round($object->amount_actual,2)) - - ); - - $can_validate = !empty($user->rights->stock->validate); - $view_url = dol_buildpath('/product/inventory/card.php', 1); - - $view = array( - 'mode' => $action - ,'url' => dol_buildpath('/product/inventory/card.php', 1) - ,'can_validate' => (int) $user->rights->stock->validate - ,'is_already_validate' => (int) $object->status - ,'token'=>$_SESSION['newtoken'] - ); - - include './tpl/inventory.tpl.php'; + print load_fiche_titre($langs->trans("Inventory")); + + print '
      '; + print ''; + print ''; + print ''; + + dol_fiche_head(); + + print ''."\n"; + // print ''; + // LIST_OF_TD_LABEL_FIELDS_EDIT + print '
      '.$langs->trans("Label").'
      '; + + dol_fiche_end(); + + print '
      '; + print '   '; + print '
      '; + + print '
      '; } + + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) +{ + $res = $object->fetch_optionals($object->id, $extralabels); + + $head = inventory_prepare_head($object); + dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order'); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); + } + + // Confirmation of action xxxx + if ($action == 'xxx') + { + $formquestion=array(); + /* + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); + }*/ + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + } + + if (! $formconfirm) { + $parameters = array('lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; + } + + // Print form confirm + print $formconfirm; + + + + // Object card + // ------------------------------------------------------------ + + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref='
      '; + /* + // Ref bis + $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
      '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
      '.$langs->trans('Project') . ' '; + if ($user->rights->inventory->creer) + { + if ($action != 'classify') + { + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
      '; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
      '; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } + */ + $morehtmlref.='
      '; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
      '; + print '
      '; + print '
      '; + print ''."\n"; + // print ''; + // LIST_OF_TD_LABEL_FIELDS_VIEW + + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
      '.$langs->trans("Label").''.$object->label.'
      '; + print '
      '; + print '
      '; + print '
      '; + print '
      '; + print ''; + + + + print '
      '; + print '
      '; + print '
      '; + print '
      '; + + print '

      '; + + dol_fiche_end(); + + + // Buttons for actions + if ($action != 'presend' && $action != 'editline') { + print '
      '."\n"; + $parameters=array(); + $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + if (empty($reshook)) + { + // Send + print ''."\n"; + + if ($user->rights->inventory->write) + { + print ''."\n"; + } + + if ($user->rights->inventory->delete) + { + print ''."\n"; + } + } + print '
      '."\n"; + } + + + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + if ($action != 'presend') + { + print '
      '; + print ''; // ancre + // Documents + $comref = dol_sanitizeFileName($object->ref); + $relativepath = $comref . '/' . $comref . '.pdf'; + $filedir = $conf->inventory->dir_output . '/' . $comref; + $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; + $genallowed = $user->rights->inventory->creer; + $delallowed = $user->rights->inventory->supprimer; + print $formfile->showdocuments('inventory', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('order')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
      '; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, 'order', $socid, 1); + + print '
      '; + } + + + /* + * Action presend + */ + /* + if ($action == 'presend') + { + $object->fetch_projet(); + + $ref = dol_sanitizeFileName($object->ref); + include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); + $file = $fileparams['fullname']; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->thirdparty->default_lang; + + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('commercial'); + } + + // Build document if it not exists + if (! $file || ! is_readable($file)) { + $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) { + dol_print_error($db, $object->error, $object->errors); + exit(); + } + $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); + $file = $fileparams['fullname']; + } + + print '
      '; + print '
      '; + print '
      '; + print load_fiche_titre($langs->trans('SendOrderByMail')); + + dol_fiche_head(''); + + // Cree l'objet formulaire mail + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); + $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); + + if($formmail->fromtype === 'user'){ + $formmail->fromid = $user->id; + + } + $formmail->trackid='ord'.$object->id; + if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set + { + include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'ord'.$object->id); + } + $formmail->withfrom = 1; + $liste = array(); + foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) + $liste [$key] = $value; + $formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste; + $formmail->withtocc = $liste; + $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; + if (empty($object->ref_client)) { + $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__'); + } else if (! empty($object->ref_client)) { + $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__ (__REFCLIENT__)'); + } + $formmail->withfile = 2; + $formmail->withbody = 1; + $formmail->withdeliveryreceipt = 1; + $formmail->withcancel = 1; + // Tableau des substitutions + $formmail->setSubstitFromObject($object); + $formmail->substit ['__ORDERREF__'] = $object->ref; + + $custcontact = ''; + $contactarr = array(); + $contactarr = $object->liste_contact(- 1, 'external'); + + if (is_array($contactarr) && count($contactarr) > 0) + { + foreach ($contactarr as $contact) + { + if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label + $contactstatic = new Contact($db); + $contactstatic->fetch($contact ['id']); + $custcontact = $contactstatic->getFullName($langs, 1); + } + } + + if (! empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__'] = $custcontact; + } + } + + // Tableau des parametres complementaires + $formmail->param['action'] = 'send'; + $formmail->param['models'] = 'order_send'; + $formmail->param['models_id']=GETPOST('modelmailselected','int'); + $formmail->param['orderid'] = $object->id; + $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; + + // Init list of files + if (GETPOST("mode") == 'init') { + $formmail->clear_attached_files(); + $formmail->add_attached_files($file, basename($file), dol_mimetype($file)); + } + + // Show form + print $formmail->get_form(); + + dol_fiche_end(); + }*/ +} + + // End of page llxFooter(); $db->close(); - - - -function card_line(&$inventory, &$lines, $mode) -{ - global $db,$langs,$user,$conf; - $inventory->amount_actual = 0; - - $TCacheEntrepot = array(); - - foreach ($inventory->Inventorydet as $k => $Inventorydet) - { - $product = & $Inventorydet->product; - $stock = $Inventorydet->qty_stock; - - $pmp = $Inventorydet->pmp; - $pmp_actual = $pmp * $stock; - $inventory->amount_actual+=$pmp_actual; - - $last_pa = $Inventorydet->pa; - $current_pa = $Inventorydet->current_pa; - - $e = new Entrepot($db); - if(!empty($TCacheEntrepot[$Inventorydet->fk_warehouse])) $e = $TCacheEntrepot[$Inventorydet->fk_warehouse]; - elseif($e->fetch($Inventorydet->fk_warehouse) > 0) $TCacheEntrepot[$e->id] = $e; - - $qtytoadd = GETPOST('qty_to_add', 'array'); - $qty = (float) $qtytoadd[$k]; - - $lines[]=array( - 'produit' => $product->getNomUrl(1).' - '.$product->label, - 'entrepot'=>$e->getNomUrl(1), - 'barcode' => $product->barcode, - 'qty' =>($mode == 'edit' ? ' '.img_picto($langs->trans('Add'), 'edit_add').'' : '' ), - 'qty_view' => ($Inventorydet->qty_view ? $Inventorydet->qty_view : 0), - 'qty_stock' => $stock, - 'qty_regulated' => ($Inventorydet->qty_regulated ? $Inventorydet->qty_regulated : 0), - 'action' => ($user->rights->stock->write && $mode=='edit' ? ''.img_picto($langs->trans('inventoryDeleteLine'), 'delete').'' : ''), - 'pmp_stock'=>round($pmp_actual,2), - 'pmp_actual'=> round($pmp * $Inventorydet->qty_view,2), - 'pmp_new'=>(!empty($user->rights->stock->changePMP) && $mode == 'edit' ? ' '.img_picto($langs->trans('Save'), 'bt-save.png@inventory').'' : price($Inventorydet->new_pmp)), - 'pa_stock'=>round($last_pa * $stock,2), - 'pa_actual'=>round($last_pa * $Inventorydet->qty_view,2), - 'current_pa_stock'=>round($current_pa * $stock,2), - 'current_pa_actual'=>round($current_pa * $Inventorydet->qty_view,2), - 'k'=>$k, - 'id'=>$Inventorydet->id - ); - } - -} - - -/* -function _exportCSV(&$inventory) -{ - global $conf; - - header('Content-Type: application/octet-stream'); - header('Content-disposition: attachment; filename=inventory-'. $inventory->getId().'-'.date('Ymd-His').'.csv'); - header('Pragma: no-cache'); - header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); - header('Expires: 0'); - - echo 'Ref;Label;barcode;qty theorique;PMP;dernier PA;'; - if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)) echo 'PA courant;'; - echo 'qty réelle;PMP;dernier PA;'; - if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)) echo 'PA courant;'; - echo 'qty regulée;'."\r\n"; - - foreach ($inventory->Inventorydet as $k => $Inventorydet) - { - $product = & $Inventorydet->product; - $stock = $Inventorydet->qty_stock; - - $pmp = $Inventorydet->pmp; - $pmp_actual = $pmp * $stock; - $inventory->amount_actual+=$pmp_actual; - - $last_pa = $Inventorydet->pa; - $current_pa = $Inventorydet->current_pa; - - if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)) { - $row=array( - 'produit' => $product->ref - ,'label'=>$product->label - ,'barcode' => $product->barcode - ,'qty_stock' => $stock - ,'pmp_stock'=>round($pmp_actual,2) - ,'pa_stock'=>round($last_pa * $stock,2) - ,'current_pa_stock'=>round($current_pa * $stock,2) - ,'qty_view' => $Inventorydet->qty_view ? $Inventorydet->qty_view : 0 - ,'pmp_actual'=>round($pmp * $Inventorydet->qty_view,2) - ,'pa_actual'=>round($last_pa * $Inventorydet->qty_view,2) - ,'current_pa_actual'=>round($current_pa * $Inventorydet->qty_view,2) - ,'qty_regulated' => $Inventorydet->qty_regulated ? $Inventorydet->qty_regulated : 0 - - ); - - } - else{ - $row=array( - 'produit' => $product->ref - ,'label'=>$product->label - ,'barcode' => $product->barcode - ,'qty_stock' => $stock - ,'pmp_stock'=>round($pmp_actual,2) - ,'pa_stock'=>round($last_pa * $stock,2) - ,'qty_view' => $Inventorydet->qty_view ? $Inventorydet->qty_view : 0 - ,'pmp_actual'=>round($pmp * $Inventorydet->qty_view,2) - ,'pa_actual'=>round($last_pa * $Inventorydet->qty_view,2) - - ,'qty_regulated' => $Inventorydet->qty_regulated ? $Inventorydet->qty_regulated : 0 - - ); - - } - - - echo '"'.implode('";"', $row).'"'."\r\n"; - - } - - exit; -} -*/ - -function _footerList($view,$total_pmp,$total_pmp_actual,$total_pa,$total_pa_actual, $total_current_pa,$total_current_pa_actual) -{ - global $conf,$user,$langs; - - if ($view['can_validate'] == 1) { ?> - -   - barcode->enabled)) { ?> -   - - - - global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){ - echo ''.price($total_current_pa).''; - } - ?> -   - - rights->stock->changePMP)) { - echo ' '; - } - ?> - - global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){ - echo ''.price($total_current_pa_actual).''; - } - ?> - -   - -   - - - - - trans('Product'); ?> - trans('Warehouse'); ?> - barcode->enabled)) { ?> - trans('Barcode'); ?> - - - trans('TheoricalQty'); ?> - global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){ - echo ''.$langs->trans('TheoricalValue').''; - } - else { - echo ''.$langs->trans('TheoricalValue').''; - } - - ?> - - - trans('RealQty'); ?> - - - global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)) $colspan++; - if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)) $colspan++; - - echo ''.$langs->trans('RealValue').''; - - ?> - - trans('RegulatedQty'); ?> - - - # - - - - - -   - trans('PMP'); ?> - trans('LastPA'); ?> - global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){ - echo ''.$langs->trans('CurrentPA').''; - } - - ?> -   - trans('PMP'); ?> - rights->stock->changePMP)) { - echo ''.$langs->trans('ColumnNewPMP').''; - } - ?> - trans('LastPA'); ?> - global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){ - echo ''.$langs->trans('CurrentPA').''; - } - - ?> -   - -   - - - +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2014-2016 Juanjo Menent + * Copyright (C) 2015 Florian Henry + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,698 +20,271 @@ */ /** - * \file htdocs/inventory/class/product.class.php - * \ingroup product - * \brief File of class to manage predefined products stock + * \file product/inventory/class/inventory.class.php + * \ingroup inventory + * \brief This file is a CRUD class file for Inventory (Create/Read/Update/Delete) */ - -require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; +//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; +//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** - * Class to manage inventories + * Class for Inventory */ -class Inventory extends CoreObject +class Inventory extends CommonObject { - public $element='inventory'; - public $table_element='inventory'; - public $fk_element='fk_inventory'; - protected $childtables=array('inventorydet'); // To test if we can delete object - protected $isnolinkedbythird = 1; // No field fk_soc - protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - /** - * Warehouse Id - * @var int + * @var string ID to identify managed object */ - public $fk_warehouse; + public $element = 'inventory'; /** - * Entity Id - * @var int + * @var string Name of table without prefix where object is stored */ + public $table_element = 'inventory'; + + /** + * @var array Does this field is linked to a thirdparty ? + */ + protected $isnolinkedbythird = 1; + /** + * @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + */ + protected $ismultientitymanaged = 1; + /** + * @var string String with name of icon for inventory + */ + public $picto = 'inventory'; + + + /** + * 'type' if the field format, 'label' the translation key, 'enabled' is a condition when the filed must be managed, + * 'visible' says if field is visible in list (-1 means not shown by default but can be aded into list to be viewed) + * 'notnull' if not null in database + * 'index' if we want an index in database + * 'position' is the sort order of field + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'comment' is not used. You can store here any text of your choice. + */ + + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array Array with all fields and their property + */ + public $fields=array( + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), + 'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object',), + 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), + 'fk_warehouse' => array('type'=>'integer', 'label'=>'', 'visible'=>1, 'enabled'=>1, 'index'=>1,), + 'date_inventory' => array('type'=>'date', 'label'=>'', 'visible'=>1, 'enabled'=>1,), + 'title' => array('type'=>'varchar(255)', 'label'=>'', 'visible'=>1, 'enabled'=>1,), + 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'index'=>1,), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500,), + 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-1, 'enabled'=>1, 'position'=>500,), + 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), + 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500,), + 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-1, 'enabled'=>1, 'position'=>500,), + 'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValid', 'visible'=>-1, 'enabled'=>1, 'position'=>500,), + 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-1, 'enabled'=>1, 'position'=>1000, 'index'=>1,), + ); + + public $rowid; + public $ref; public $entity; - - /** - * Status - * @var int - */ - public $status; - /** - * Inventory Date - * @var date - */ + public $fk_warehouse; public $date_inventory; - /** - * Inventory Title - * @var string - */ public $title; + public $status; + public $date_creation; + public $date_validation; + public $tms; + public $fk_user_creat; + public $fk_user_modif; + public $fk_user_valid; + public $import_key; + // END MODULEBUILDER PROPERTIES - /** - * Attribute object linked with database - * @var array - */ - protected $fields=array( - 'fk_warehouse'=>array('type'=>'integer','index'=>true) - ,'ref'=>array('type'=>'string','index'=>true) - ,'entity'=>array('type'=>'integer','index'=>true) - ,'status'=>array('type'=>'integer','index'=>true) - ,'date_inventory'=>array('type'=>'date') - ,'title'=>array('type'=>'string') - ); - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct(DoliDB &$db) + + // If this object has a subtable with lines + + /** + * @var int Name of subtable line + */ + //public $table_element_line = 'inventorydet'; + /** + * @var int Field with ID of parent key if this field has a parent + */ + //public $fk_element = 'fk_inventory'; + /** + * @var int Name of subtable class that manage subtable lines + */ + //public $class_element_line = 'Inventoryline'; + /** + * @var array Array of child tables (child tables to delete before deleting a record) + */ + //protected $childtables=array('inventorydet'); + /** + * @var InventoryLine[] Array of subtable lines + */ + //public $lines = array(); + + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) { - global $conf; - - parent::__construct($db); - parent::init(); - - $this->status = 0; - $this->entity = $conf->entity; - $this->errors = array(); - $this->amount = 0; + $this->db = $db; } - /** - * Function to sort children object - */ - public function sortDet() + + /** + * Return a link to the object card (with optionaly the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @return string String with URL + */ + function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='') { - if(!empty($this->Inventorydet)) usort($this->Inventorydet, array('Inventory', 'customSort')); - } + global $db, $conf, $langs; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; - /** - * Get object and children from database - * - * @param int $id Id of object to load - * @param bool $loadChild used to load children from database - * @return int >0 if OK, <0 if KO, 0 if not found - */ - public function fetch($id, $loadChild = true) - { - if(!$loadChild) $this->withChild = false; - - $res = parent::fetch($id, $loadChild); + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - if ($res > 0) - { - $this->sortDet(); - $this->amount = 0; - if(!empty($this->Inventorydet )) - { - foreach($this->Inventorydet as &$det) - { - $this->amount += $det->qty_view * $det->pmp; - } - } - } - - return $res; - } + $result = ''; + $companylink = ''; - /** - * Custom function call by usort - * - * @param Inventorydet $objA first Inventorydet object - * @param Inventorydet $objB second Inventorydet object - * @return int - */ - private function customSort(&$objA, &$objB) - { - $r = strcmp(strtoupper(trim($objA->product->ref)), strtoupper(trim($objB->product->ref))); - - if ($r < 0) $r = -1; - elseif ($r > 0) $r = 1; - else $r = 0; - - return $r; - } + $label = '' . $langs->trans("Inventory") . ''; + $label.= '
      '; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; - /** - * @param User $user user object - * @return int - */ - public function changePMP(User &$user) - { - $error = 0; - $this->db->begin(); + $url = $url = dol_buildpath('/inventory/m_card.php',1).'?id='.$this->id; - if(!empty($this->Inventorydet)) - { - foreach ($this->Inventorydet as $k => &$Inventorydet) - { - if($Inventorydet->new_pmp>0) - { - $Inventorydet->pmp = $Inventorydet->new_pmp; - $Inventorydet->new_pmp = 0; - - $res = $this->db->query('UPDATE '.MAIN_DB_PREFIX.'product as p SET pmp = '.$Inventorydet->pmp.' WHERE rowid = '.$Inventorydet->fk_product ); - if (!$res) - { - $error++; - $this->error = $this->db->lasterror(); - $this->errors[] = $this->db->lasterror(); - } - } - } - } - - $res = parent::update($user); - if (!$res) + $linkclose=''; + if (empty($notooltip)) { - $error++; - $this->error = $this->db->lasterror(); - $this->errors[] = $this->db->lasterror(); - } - - - if (!$error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - - /** - * Function to update object or create or delete if needed - * - * @param User $user user object - * @return < 0 if ko, > 0 if ok - */ - public function update(User &$user) - { - $error = 0; - $this->db->begin(); - - // if we valid the inventory we save the stock at the same time - if ($this->status) - { - $res = $this->regulate(); - if ($res < 0) + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $error++; - $this->error = $this->db->lasterror(); - $this->errors[] = $this->db->lasterror(); + $label=$langs->trans("ShowInventory"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; } + $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } + else $linkclose = ($morecss?' class="'.$morecss.'"':''); + + $linkstart = ''; + $linkend=''; + + if ($withpicto) + { + $result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend); + if ($withpicto != 2) $result.=' '; } - - $res = parent::update($user); - if (!$res) - { - $error++; - $this->error = $this->db->lasterror(); - $this->errors[] = $this->db->lasterror(); - } - - if (!$error) - { - $this->db->commit(); - return $this->id; - } - else - { - $this->db->rollback(); - return -1; - } + $result.= $linkstart . $this->ref . $linkend; + return $result; } - /** - * Function to update current object - * - * @param array $Tab Array of values - * @return int - */ - public function setValues(&$Tab) + /** + * Retourne le libelle du status d'un user (actif, inactif) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->status,$mode); + } + + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto + * @return string Label of status + */ + static function LibStatut($status,$mode=0) { global $langs; - - if (isset($Tab['qty_to_add'])) + + if ($mode == 0) { - foreach ($Tab['qty_to_add'] as $k => $qty) - { - $qty = (float) price2num($qty); - - if ($qty < 0) - { - $this->errors[] = $langs->trans('inventoryErrorQtyAdd'); - return -1; - } - - $product = new Product($this->db); - $product->fetch($this->Inventorydet[$k]->fk_product); - - $this->Inventorydet[$k]->pmp = $product->pmp; - $this->Inventorydet[$k]->qty_view += $qty; - } + $prefix=''; + if ($status == 1) return $langs->trans('Enabled'); + if ($status == 0) return $langs->trans('Disabled'); + } + if ($mode == 1) + { + if ($status == 1) return $langs->trans('Enabled'); + if ($status == 0) return $langs->trans('Disabled'); + } + if ($mode == 2) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + } + if ($mode == 3) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); + } + if ($mode == 4) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + } + if ($mode == 5) + { + if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); + if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + } + if ($mode == 6) + { + if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); + if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); } - - return parent::setValues($Tab); } - /** - * Function to delete all Inventorydet - * - * @param User $user user object - * @return < 0 if ko, > 0 if ok - */ - public function deleteAllLine(User &$user) - { - foreach($this->Inventorydet as &$det) - { - $det->to_delete = true; - } - - $res = $this->update($user); - if ($res > 0) $this->Inventorydet = array(); - else return -1; - } - - /** - * Function to add Inventorydet - * - * @param int $fk_product fk_product of Inventorydet - * @param int $fk_warehouse fk_warehouse target - * @return bool - */ - public function addProduct($fk_product, $fk_warehouse=0) - { - $k = $this->addChild('Inventorydet'); - $det = &$this->Inventorydet[$k]; - - $det->fk_inventory = $this->id; - $det->fk_product = $fk_product; - $det->fk_warehouse = empty($fk_warehouse) ? $this->fk_warehouse : $fk_warehouse; - - $det->load_product(); - - $date = $this->getDate('date_inventory', 'Y-m-d'); - if(empty($date)) $date = $this->getDate('datec', 'Y-m-d'); - $det->setStockDate($date, $fk_warehouse); - - return true; - } - - /** - * Duplication method product to add datem - * Adjust stock in a warehouse for product - * - * @param int $fk_product id of product - * @param int $fk_warehouse id of warehouse - * @param double $nbpiece nb of units - * @param int $movement 0 = add, 1 = remove - * @param string $label Label of stock movement - * @param double $price Unit price HT of product, used to calculate average weighted price (PMP in french). If 0, average weighted price is not changed. - * @param string $inventorycode Inventory code - * @return int <0 if KO, >0 if OK - */ - public function correctStock($fk_product, $fk_warehouse, $nbpiece, $movement, $label='', $price=0, $inventorycode='') + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + public function initAsSpecimen() { - global $conf, $user; - - if ($fk_warehouse) - { - $this->db->begin(); - - require_once DOL_DOCUMENT_ROOT .'/product/stock/class/mouvementstock.class.php'; - - $op[0] = "+".trim($nbpiece); - $op[1] = "-".trim($nbpiece); - - $datem = empty($conf->global->INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT) ? dol_now() : $this->date_inventory; - - $movementstock=new MouvementStock($this->db); - $movementstock->origin = new stdClass(); - $movementstock->origin->element = 'inventory'; - $movementstock->origin->id = $this->id; - $result=$movementstock->_create($user,$fk_product,$fk_warehouse,$op[$movement],$movement,$price,$label,$inventorycode, $datem); - - if ($result >= 0) - { - $this->db->commit(); - return 1; - } - else - { - $this->error=$movementstock->error; - $this->errors=$movementstock->errors; - - $this->db->rollback(); - return -1; - } - } + $this->initAsSpecimenCommon(); } - /** - * Function to regulate stock - * - * @return int - */ - public function regulate() - { - global $langs,$conf; - - if($conf->global->INVENTORY_DISABLE_VIRTUAL) - { - $pdt_virtuel = false; - // Test if virtual product is enabled - if($conf->global->PRODUIT_SOUSPRODUITS) - { - $pdt_virtuel = true; - $conf->global->PRODUIT_SOUSPRODUITS = 0; - } - } - - foreach ($this->Inventorydet as $k => $Inventorydet) - { - $product = new Product($this->db); - $product->fetch($Inventorydet->fk_product); - - if ($Inventorydet->qty_view != $Inventorydet->qty_stock) - { - $Inventorydet->qty_regulated = $Inventorydet->qty_view - $Inventorydet->qty_stock; - $nbpiece = abs($Inventorydet->qty_regulated); - $movement = (int) ($Inventorydet->qty_view < $Inventorydet->qty_stock); // 0 = add ; 1 = remove - - //$href = dol_buildpath('/inventory/inventory.php?id='.$this->id.'&action=view', 1); - - $res = $this->correctStock($product->id, $Inventorydet->fk_warehouse, $nbpiece, $movement, $langs->trans('inventoryMvtStock')); - if ($res < 0) return -1; - } - } - - if($conf->global->INVENTORY_DISABLE_VIRTUAL) - { - // Test if virtual product was enabled before regulate - if($pdt_virtuel) $conf->global->PRODUIT_SOUSPRODUITS = 1; - } - - return 1; - } - - /** - * Get the title - * @return string - */ - public function getTitle() - { - global $langs; - - return !empty($this->title) ? $this->title : $langs->trans('inventoryTitle').' '.$this->id; - } - - - /** - * Return clicable link of object (with eventually picto) - * - * @param int $withpicto Add picto into link - * @return string - */ - public function getNomUrl($withpicto = 1) - { - return ''.($withpicto ? img_picto('','object_list.png','',0).' ' : '').$this->getTitle().''; - } - - /** - * Function to add products by default from warehouse and children - * - * @param int $fk_warehouse id of warehouse - * @param int $fk_category id of category - * @param int $fk_supplier id of supplier - * @param int $only_prods_in_stock only product with stock - * - * @return int - */ - public function addProductsFor($fk_warehouse,$fk_category=0,$fk_supplier=0,$only_prods_in_stock=0) - { - $warehouse = new Entrepot($this->db); - $warehouse->fetch($fk_warehouse); - $TChildWarehouses = array($fk_warehouse); - $warehouse->get_children_warehouses($fk_warehouse, $TChildWarehouses); - - $sql = 'SELECT ps.fk_product, ps.fk_entrepot'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'product_stock ps'; - $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product p ON (p.rowid = ps.fk_product)'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product cp ON (cp.fk_product = p.rowid)'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price pfp ON (pfp.fk_product = p.rowid)'; - $sql.= ' WHERE ps.fk_entrepot IN ('.implode(', ', $TChildWarehouses).')'; - - if ($fk_category>0) $sql.= ' AND cp.fk_categorie='.$fk_category; - if ($fk_supplier>0) $sql.= ' AND pfp.fk_soc = '.$fk_supplier; - if (!empty($only_prods_in_stock)) $sql.= ' AND ps.reel > 0'; - - $sql.=' GROUP BY ps.fk_product, ps.fk_entrepot ORDER BY p.ref ASC,p.label ASC'; - - $res = $this->db->query($sql); - if($res) - { - while($obj = $this->db->fetch_object($res)) - { - $this->addProduct($obj->fk_product, $obj->fk_entrepot); - } - - return 1; - } - else - { - $this->error = $this->db->lasterror(); - $this->errors[] = $this->db->lasterror(); - return -1; - } - } - - /** - * Return clicable link of inventory object - * - * @param int $id id of inventory - * @param int $withpicto Add picto into link - * @return string - */ - static function getLink($id, $withpicto=1) - { - global $langs,$db; - - $inventory = new Inventory($db); - if($inventory->fetch($id, false) > 0) return $inventory->getNomUrl($withpicto); - else return $langs->trans('InventoryUnableToFetchObject'); - } - - /** - * Function to get the sql select of inventory - * - * @param string $type 'All' to get all data - * @return string - */ - static function getSQL($type) - { - global $conf; - - $sql = ''; - if($type == 'All') - { - $sql = 'SELECT i.rowid,i.title, e.label, i.date_inventory, i.fk_warehouse, i.datec, i.tms, i.status'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'inventory i'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot e ON (e.rowid = i.fk_warehouse)'; - $sql.= ' WHERE i.entity IN ('.getEntity('inventory').')'; - } - - return $sql; - } } -class Inventorydet extends CoreObject +/** + * Class InventoryObjectLine + */ +class InventoryObjectLine { - public $element='inventorydet'; - public $table_element='inventorydet'; - protected $isnolinkedbythird = 1; // No field fk_soc - protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - - public $fk_inventory; - public $fk_warehouse; - public $fk_product; - public $entity; - public $qty_view; - public $qty_stock; - public $qty_regulated; - public $pmp; - public $pa; - public $new_pmp; - - protected $fields=array( - 'fk_inventory'=>array('type'=>'int') - ,'fk_warehouse'=>array('type'=>'int') - ,'fk_product'=>array('type'=>'int') - ,'entity'=>array('type'=>'int') - ,'qty_view'=>array('type'=>'float') - ,'qty_stock'=>array('type'=>'float') - ,'qty_regulated'=>array('type'=>'float') - ,'pmp'=>array('type'=>'float') - ,'pa'=>array('type'=>'float') - ,'new_pmp'=>array('type'=>'float') - ); - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct(DoliDB &$db) - { - global $conf; - - parent::__construct($db); - parent::init(); - - $this->entity = $conf->entity; - $this->errors = array(); - - $this->product = null; - $this->current_pa = 0; - } - - /** - * Get object and children from database - * - * @param int $id id of inventorydet object - * @param bool $loadChild load children - * @return int - */ - function fetch($id, $loadChild = true) - { - $res = parent::fetch($id); - $this->load_product(); - $this->fetch_current_pa(); - - return $res; - } - - /** - * Function to get the unit buy price - * - * @return bool - */ - function fetch_current_pa() - { - global $db,$conf; - - if(empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)) return false; - - if($this->pa > 0) - { - $this->current_pa = $this->pa; - } - else - { - dol_include_once('/fourn/class/fournisseur.product.class.php'); - $p= new ProductFournisseur($db); - $p->find_min_price_product_fournisseur($this->fk_product); - - if($p->fourn_qty>0) $this->current_pa = $p->fourn_price / $p->fourn_qty; - } - - return true; - } - - /** - * Function to set pa attribute from date en fk_warehouse - * - * @param date $date date value - * @param int $fk_warehouse fk_warehouse target - */ - function setStockDate($date, $fk_warehouse) - { - list($pmp, $stock) = $this->getPmpStockFromDate($date, $fk_warehouse); - - $this->qty_stock = $stock; - $this->pmp = $pmp; - - $last_pa = 0; - $sql = 'SELECT price FROM '.MAIN_DB_PREFIX.'stock_mouvement'; - $sql.= ' WHERE fk_entrepot = '.$fk_warehouse; - $sql.= ' AND fk_product = '.$this->fk_product; - $sql.= ' AND (origintype=\'order_supplier\' || origintype=\'invoice_supplier\')'; - $sql.= ' AND price > 0'; - $sql.= ' AND datem <= \''.$date.' 23:59:59\''; - $sql.= ' ORDER BY datem DESC LIMIT 1'; - - $res = $this->db->query($sql); - if($res && $obj = $this->db->fetch_object($res)) - { - $last_pa = $obj->price; - } - - $this->pa = $last_pa; - } - - - /** - * Get the last pmp and last stock from date and warehouse - * - * @param date $date date to check - * @param int $fk_warehouse id of warehouse - * @return array - */ - function getPmpStockFromDate($date, $fk_warehouse) - { - $res = $this->product->load_stock(); - - if($res>0) - { - $stock = isset($this->product->stock_warehouse[$fk_warehouse]->real) ? $this->product->stock_warehouse[$fk_warehouse]->real : 0; - $pmp = $this->product->pmp; - } - - //All Stock mouvement between now and inventory date - $sql = 'SELECT value, price'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'stock_mouvement'; - $sql.= ' WHERE fk_product = '.$this->product->id; - $sql.= ' AND fk_entrepot = '.$fk_warehouse; - $sql.= ' AND datem > \''.date('Y-m-d 23:59:59', strtotime($date)).'\''; - $sql.= ' ORDER BY datem DESC'; - - $res = $this->db->query($sql); - - $laststock = $stock; - $lastpmp = $pmp; - - if($res) - { - while($mouvement = $this->db->fetch_object($res)) - { - $price = ($mouvement->price > 0 && $mouvement->value > 0) ? $mouvement->price : $lastpmp; - $stock_value = $laststock * $lastpmp; - $laststock -= $mouvement->value; - $last_stock_value = $stock_value - ($mouvement->value * $price); - $lastpmp = ($laststock != 0) ? $last_stock_value / $laststock : $lastpmp; - } - } - - return array($lastpmp, $laststock); - } - - /** - * Fetch the product linked with the line - * @return void - */ - function load_product() - { - global $db; - - if($this->fk_product>0) - { - $this->product = new Product($db); - $this->product->fetch($this->fk_product); - } - } + /** + * @var int ID + */ + public $id; + /** + * @var mixed Sample line property 1 + */ + public $prop1; + /** + * @var mixed Sample line property 2 + */ + public $prop2; } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index c8d570a6fd7..6f443324f6b 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,119 +17,624 @@ */ /** - * \file htdocs/inventory/list.php - * \ingroup product - * \brief File of class to manage inventory + * \file product/inventory/list.php + * \ingroup inventory + * \brief List page for monmodule */ - -require_once '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/product/inventory/listview.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php'; +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) -$langs->load("stock"); -$langs->load("inventory"); +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); +// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"); +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php"); +if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php"); +if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php"); +if (! $res) die("Include of main fails"); + +require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +dol_include_once('/inventory/class/inventory.class.php'); + +// Load traductions files requiredby by page +$langs->loadLangs(array("inventory","other")); + +$action = GETPOST('action','alpha'); +$massaction = GETPOST('massaction','alpha'); +$show_files = GETPOST('show_files','int'); +$confirm = GETPOST('confirm','alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'inventorylist'; // To manage different context of search + +$id = GETPOST('id','int'); +$backtopage = GETPOST('backtopage','alpha'); +$optioncss = GETPOST('optioncss','alpha'); + +// Load variable for pagination $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0); +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortfield) $sortfield="i.title"; + +// Initialize technical objects +$object=new Inventory($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction=$conf->inventory->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('inventorylist')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('inventory'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + +// Default sort order (if not yet defined by previous GETPOST) +if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. if (! $sortorder) $sortorder="ASC"; -if (empty($user->rights->stock->lire)) accessforbidden(); - - -/* - * Actions - */ - -// None - - -/* - * View - */ - -llxHeader('',$langs->trans('inventoryListTitle'),'',''); - -echo '
      '; - -$inventory = new Inventory($db); -$list = new ListView($db, 'listInventory'); - -$THide = array('label','title'); - -echo $list->render(Inventory::getSQL('All'), array( - 'param' => array( - 'limit' => $limit, - 'offset' => $offset, - 'sortfield' => $sortfield, - 'sortorder'=> $sortorder, - 'page'=>$page - ), - 'limit' => array( - 'nbLine' => $limit, - ), - 'allow-field-select' => true, - 'link'=>array( - 'fk_warehouse'=>''.img_picto('','object_stock.png','',0).' @label@' - ), - 'translate'=>array(), - 'hide'=>$THide, - 'type'=>array( - 'datec'=>'date', - 'tms'=>'datetime', - 'date_inventory'=>'date' - ), - 'list'=>array( - 'title'=>$langs->trans('inventoryListTitle'), - 'messageNothing'=>$langs->trans('inventoryListEmpty'), - 'image' => 'title_products.png' - ), - 'title'=>array( - 'rowid'=>$langs->trans('Title'), - 'date_inventory'=>$langs->trans('InventoryDate'), - 'fk_warehouse'=>$langs->trans('Warehouse'), - 'datec'=>$langs->trans('DateCreation'), - 'tms'=>$langs->trans('DateModification'), - 'status'=>$langs->trans('Status') - ), - 'eval'=>array( - 'status' => '(@val@ ? img_picto("'.$langs->trans("inventoryValidate").'", "statut4") : img_picto("'.$langs->trans("inventoryDraft").'", "statut3"))', - 'rowid'=>'Inventory::getLink(@val@)' - ), - 'position' => array( - 'text-align' => array('status' => 'right') - - ), - 'search'=>array( - 'rowid' => array('search_type' => true, 'table' => array('i'), 'field' => array('title')), - 'date_inventory'=>array('search_type' => 'calendars', 'table' => array('i'), 'field' => array('date_inventory')), - 'status'=>array('search_type' => array(1=>$langs->trans("inventoryValidate"), 0=>$langs->trans("inventoryDraft"))) - ) -)); - - -/*if (!empty($user->rights->stock->create)) +// Protection if external user +$socid=0; +if ($user->societe_id > 0) { - print '
      '; - print ''.$langs->trans('inventoryCreate').''; + //$socid = $user->societe_id; + accessforbidden(); +} + +// Initialize array of search criterias +$search_all=trim(GETPOST("search_all",'alpha')); +$search=array(); +foreach($object->fields as $key => $val) +{ + if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach($object->fields as $key => $val) +{ + if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label']; +} + +// Definition of fields for list +$arrayfields=array(); +foreach($object->fields as $key => $val) +{ + // If $val['visible']==0, then we never show the field + if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); +} +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } +} + + + + +/* + * ACTIONS + * + * Put here all code to do according to value of "$action" parameter + */ + +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + foreach($object->fields as $key => $val) + { + $search[$key]=''; + } + $toselect=''; + $search_array_options=array(); + } + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') + || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + { + $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass='Inventory'; + $objectlabel='Inventory'; + $permtoread = $user->rights->inventory->read; + $permtodelete = $user->rights->inventory->delete; + $uploaddir = $conf->inventory->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + + + +/* + * VIEW + * + * Put here all code to build page + */ + +$form=new Form($db); + +$now=dol_now(); + +//$help_url="EN:Module_Inventory|FR:Module_Inventory_FR|ES:Módulo_Inventory"; +$help_url=''; +$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Inventorys")); + + +// Build and execute select +// -------------------------------------------------------------------- +$sql = 'SELECT '; +foreach($object->fields as $key => $val) +{ + $sql.='t.'.$key.', '; +} +// Add fields from extrafields +foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +$sql=preg_replace('/, $/','', $sql); +$sql.= " FROM ".MAIN_DB_PREFIX."inventory as t"; +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."inventory_extrafields as ef on (t.rowid = ef.fk_object)"; +$sql.= " WHERE t.entity IN (".getEntity('inventory').")"; +foreach($search as $key => $val) +{ + if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:($object->fields[$key]['type'] == 'integer'?1:0))); +} +if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all); +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +$sql.=$db->order($sortfield,$sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + +$sql.= $db->plimit($limit+1, $offset); + +dol_syslog($script_file, LOG_DEBUG); +$resql=$db->query($sql); +if (! $resql) +{ + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + +// Direct jump if only one record found +if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) +{ + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/inventory/inventory_card.php?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url); + +// Example : Adding jquery code +print ''; + +$arrayofselected=is_array($toselect)?$toselect:array(); + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +foreach($search as $key => $val) +{ + $param.= '&search_'.$key.'='.urlencode($search[$key]); +} +if ($optioncss != '') $param.='&optioncss='.$optioncss; +// Add $param from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); +} + +$arrayofmassactions = array( + 'presend'=>$langs->trans("SendByMail"), + 'builddoc'=>$langs->trans("PDFMerge"), +); +if ($user->rights->inventory->delete) $arrayofmassactions['delete']=$langs->trans("Delete"); +if ($massaction == 'presend') $arrayofmassactions=array(); +$massactionbutton=$form->selectMassAction('', $arrayofmassactions); + +print ''; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); + +if ($sall) +{ + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); +} + +$moreforfilter = ''; +$moreforfilter.='
      '; +$moreforfilter.= $langs->trans('MyFilter') . ': '; +$moreforfilter.= '
      '; + +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook +if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; +else $moreforfilter = $hookmanager->resPrint; + +if (! empty($moreforfilter)) +{ + print '
      '; + print $moreforfilter; print '
      '; -}*/ +} -echo ''; +$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; +$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); -llxFooter(''); -$db->close(); \ No newline at end of file +print '
      '; +print ''."\n"; + + +// Fields title search +// -------------------------------------------------------------------- +print ''; +foreach($object->fields as $key => $val) +{ + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if (! empty($arrayfields['t.'.$key]['checked'])) print ''; +} +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } +} +// Fields from hook +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Rest of fields search +foreach($object->fields as $key => $val) +{ + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if (! empty($arrayfields['t.'.$key]['checked'])) print ''; +} +// Action column +print ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +foreach($object->fields as $key => $val) +{ + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; +} +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n"; + } + } +} +// Hook fields +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Rest of fields title +foreach($object->fields as $key => $val) +{ + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; +} +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; +print ''."\n"; + + +// Detect if we need a fetch on each output line +$needToFetchEachLine=0; +foreach ($extrafields->attribute_computed as $key => $val) +{ + if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object +} + + +// Loop on record +// -------------------------------------------------------------------- +$i=0; +$totalarray=array(); +while ($i < min($num, $limit)) +{ + $obj = $db->fetch_object($resql); + if ($obj) + { + // Store properties in $object + $object->id = $obj->rowid; + foreach($object->fields as $key => $val) + { + if (isset($obj->$key)) $object->$key = $obj->$key; + } + + // Show here line of result + print ''; + foreach($object->fields as $key => $val) + { + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print ''; + if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); + elseif ($key == 'ref') print $object->getNomUrl(1); + elseif ($key == 'status') print $object->getLibStatut(3); + else print $obj->$key; + print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey; + $totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey; + } + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Rest of fields + foreach($object->fields as $key => $val) + { + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; + if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print ''; + if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); + elseif ($key == 'status') print $object->getLibStatut(3); + else print $obj->$key; + print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; + + print ''; + } + $i++; +} + +// Show total line +if (isset($totalarray['pos'])) +{ + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if (! empty($totalarray['pos'][$i])) print ''; + else + { + if ($i == 1) + { + if ($num < $limit) print ''; + else print ''; + } + print ''; + } + } + print ''; +} + +// If no record found +if ($num == 0) +{ + $colspan=1; + foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } + print ''; +} + + +$db->free($resql); + +$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
      '; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; +$searchpicto=$form->showFilterButtons(); +print $searchpicto; +print '
      '; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print '
      '.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
      '.$langs->trans("NoRecordFound").'
      '."\n"; +print '
      '."\n"; + +print ''."\n"; + +if ($nbtotalofrecords === '' || $nbtotalofrecords) +{ + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) + { + require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource.=str_replace('&','&',$param); + + $filedir=$diroutputmassaction; + $genallowed=$user->rights->inventory->read; + $delallowed=$user->rights->inventory->read; + + print $formfile->showdocuments('massfilesarea_inventory','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); + } + else + { + print '
      '.$langs->trans("ShowTempMassFilesArea").''; + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/product/inventory/listview.class.php b/htdocs/product/inventory/listview.class.php deleted file mode 100644 index ac5ec68f51a..00000000000 --- a/htdocs/product/inventory/listview.class.php +++ /dev/null @@ -1,1083 +0,0 @@ - - - This program and all files within this directory and sub directory - is free software: you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the - Free Software Foundation, either version 3 of the License, or any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/** - * Class to manage the lists view - */ -class Listview -{ - /** - * Constructor - * - * @param DoliDB $db Database handler - * @param string $id html id - */ - function __construct(&$db, $id) - { - $this->db = &$db; - $this->id = $id; - $this->TTotalTmp=array(); - $this->sql = ''; - $this->form = null; - $this->totalRowToShow=0; - $this->totalRow=0; - - $this->TField=array(); - - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $this->extrafields = new ExtraFields($this->db); - $this->extralabels = $this->extrafields->fetch_name_optionals_label('product'); - $this->search_array_options=$this->extrafields->getOptionalsFromPost($this->extralabels,'','search_'); - } - - /** - * Function to init fields - * - * @param array $TParam array of configuration of list - * @return bool - */ - private function init(&$TParam) - { - global $conf, $langs, $user; - - if(!isset($TParam['hide'])) $TParam['hide']=array(); - if(!isset($TParam['link'])) $TParam['link']=array(); - if(!isset($TParam['type'])) $TParam['type']=array(); - if(!isset($TParam['orderby']['noOrder'])) $TParam['orderby']['noOrder']=array(); - if(!isset($TParam['allow-fields-select'])) $TParam['allow-fields-select'] = 0; - - if(!isset($TParam['list']))$TParam['list']=array(); - $TParam['list'] = array_merge(array( - 'messageNothing'=>$langs->trans('ListMessageNothingToShow') - ,'noheader'=>0 - ,'useBottomPagination'=>0 - ,'image'=>'' - ,'title'=>$langs->trans('List') - ,'orderDown'=>'' - ,'orderUp'=>'' - ,'id'=>$this->id - ,'head_search'=>'' - ,'export'=>array() - ,'view_type'=>'' - ,'massactions'=>array() - ),$TParam['list']); - - if (empty($TParam['limit'])) $TParam['limit'] = array(); - - $page = GETPOST('page'); - if (!empty($page)) $TParam['limit']['page'] = $page; - - $TParam['limit'] = array_merge(array('page'=>0, 'nbLine' => $conf->liste_limit, 'global'=>0), $TParam['limit']); - - if (GETPOST('sortfield')) - { - $TParam['sortfield'] = GETPOST('sortfield'); - $TParam['sortorder'] = GETPOST('sortorder'); - } - - include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - $this->form = new Form($this->db); - } - - - /** - * Function to know if we can search on null value - * @param string $key field name - * @param array $TParam array of configuration - * @return bool - */ - private function getSearchNull($key, &$TParam) - { - return !empty($TParam['search'][$key]['allow_is_null']); - } - - /** - * @param string $key field name - * @param string $TParam array of configuration - * @return array - */ - private function getSearchKey($key, &$TParam) - { - $TPrefixe = array(); - if(!empty($TParam['search'][$key]['table'])) - { - if (!is_array($TParam['search'][$key]['table'])) $TParam['search'][$key]['table'] = array($TParam['search'][$key]['table']); - - foreach ($TParam['search'][$key]['table'] as $prefix_table) - { - $TPrefixe[] = $prefix_table.'.'; - } - } - - $TKey=array(); - if(!empty($TParam['search'][$key]['field'])) - { - if (!is_array($TParam['search'][$key]['field'])) $TParam['search'][$key]['field'] = array($TParam['search'][$key]['field']); - - foreach ($TParam['search'][$key]['field'] as $i => $field) - { - $prefixe = !empty($TPrefixe[$i]) ? $TPrefixe[$i] : $TPrefixe[0]; - $TKey[] = $prefixe. $field ; - } - } - else - { - $TKey[] = $TPrefixe[0].$key; - } - - return $TKey; - } - /** - * @param string $TSQLMore contain some additional sql instructions - * @param string $value date with read format - * @param string $sKey field name - */ - private function addSqlFromTypeDate(&$TSQLMore, &$value, $sKey) - { - if(is_array($value)) - { - $TSQLDate=array(); - if(!empty($value['start'])) - { - $TSQLDate[]=$sKey." >= '".$value['start']."'" ; - } - - if(!empty($value['end'])) - { - $TSQLDate[]=$sKey." <= '".$value['end']."'" ; - } - - if(!empty($TSQLDate)) $TSQLMore[] = implode(' AND ', $TSQLDate); - } - else - { - $TSQLMore[]=$sKey." LIKE '".$value."%'" ; - } - } - - - /** - * @param string $TSQLMore contain some additional sql instructions - * @param string $value value to filter - * @param string $TParam array of configuration - * @param string $sKey field name - * @param string $key reference of sKey to find value into TParam - * @return bool - */ - private function addSqlFromOther(&$TSQLMore, &$value, &$TParam, $sKey, $key) - { - // Do not use empty() function, statut 0 exist - if ($value == '') return false; - elseif($value==-1) return false; - - if(isset($TParam['operator'][$key])) - { - if($TParam['operator'][$key] == '<' || $TParam['operator'][$key] == '>' || $TParam['operator'][$key]=='=') - { - $TSQLMore[] = $sKey . ' ' . $TParam['operator'][$key] . ' "' . $value . '"'; - } - elseif ($TParam['operator'][$key]=='IN') - { - $TSQLMore[] = $sKey . ' ' . $TParam['operator'][$key] . ' (' . $value . ')'; - } - else - { - if(strpos($value,'%')===false) $value = '%'.$value.'%'; - $TSQLMore[]=$sKey." LIKE '".addslashes($value)."'" ; - } - } - else - { - if(strpos($value,'%')===false) $value = '%'.$value.'%'; - $TSQLMore[]=$sKey." LIKE '".addslashes($value)."'" ; - } - - return true; - } - - - /** - * @param string $sql standard select sql - * @param string $TParam array of configuration - * @return string - */ - private function search($sql, &$TParam) - { - if (empty($TParam['no-auto-sql-search']) && !GETPOST("button_removefilter_x") && !GETPOST("button_removefilter.x") && !GETPOST("button_removefilter")) - { - foreach ($TParam['search'] as $field => $info) - { - $TsKey = $this->getSearchKey($field, $TParam); - $TSQLMore = array(); - $allow_is_null = $this->getSearchNull($field,$TParam); - - $fieldname = !empty($info['fieldname']) ? $info['fieldname'] : 'Listview_'.$this->id.'_search_'.$field; - - foreach ($TsKey as $i => &$sKey) - { - $value = GETPOST($fieldname); - $value_null = GETPOST('Listview_'.$this->id.'_search_on_null_'.$field); - - if ($allow_is_null && !empty($value_null)) - { - $TSQLMore[] = $sKey.' IS NULL '; - $value = ''; - } - - if (isset($TParam['type'][$field]) && ($TParam['type'][$field]==='date' || $TParam['type'][$field]==='datetime')) - { - $k = $fieldname; - if ($info['search_type'] === 'calendars') - { - $value = array(); - - $timestart = dol_mktime(0, 0, 0, GETPOST($k.'_startmonth'), GETPOST($k.'_startday'), GETPOST($k.'_startyear')); - if ($timestart) $value['start'] = date('Y-m-d', $timestart); - - $timeend = dol_mktime(23, 59, 59, GETPOST($k.'_endmonth'), GETPOST($k.'_endday'), GETPOST($k.'_endyear')); - if ($timeend) $value['end'] = date('Y-m-d', $timeend); - } - else - { - $time = dol_mktime(12, 0, 0, GETPOST($k.'month'), GETPOST($k.'day'), GETPOST($k.'year')); - if ($time) $value = date('Y-m-d', $time); - } - - if (!empty($value)) $this->addSqlFromTypeDate($TSQLMore, $value, $sKey); - } - else - { - $this->addSqlFromOther($TSQLMore, $value, $TParam, $sKey, $field); - } - } - - if (!empty($TSQLMore)) - { - $sql.=' AND ( '.implode(' OR ',$TSQLMore).' ) '; - } - } - } - - if ($sqlGROUPBY!='') $sql.=' GROUP BY '.$sqlGROUPBY; - - return $sql; - } - - /** - * @param string $sql standard select sql - * @param string $TParam array of configuration - * @return string - */ - public function render($sql, $TParam=array()) - { - global $conf; - - $TField= & $this->TField; - - $this->init($TParam); - - $THeader = $this->initHeader($TParam); - - $sql = $this->search($sql,$TParam); - $sql.= $this->db->order($TParam['sortfield'], $TParam['sortorder']); - - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) - { - $result = $this->db->query($sql); - $this->totalRow = $this->db->num_rows($result); - } - - $this->parse_sql($THeader, $TField, $TParam, $sql); - list($TTotal, $TTotalGroup)=$this->get_total($TField, $TParam); - - return $this->renderList($THeader, $TField, $TTotal, $TTotalGroup, $TParam); - } - - /** - * @param string $THeader the configuration of header - * @param string $TParam array of configuration - * @return array - */ - private function setSearch(&$THeader, &$TParam) - { - global $langs, $form; - - if(empty($TParam['search'])) return array(); - - $TSearch=array(); - - $nb_search_in_bar = 0; - - foreach($THeader as $key => $libelle) - { - if(empty($TSearch[$key]))$TSearch[$key]=''; - } - - $removeFilter = (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")); - foreach($TParam['search'] as $key => $param_search) - { - if ($removeFilter) $value = ''; - - $typeRecherche = (is_array($param_search) && isset($param_search['search_type'])) ? $param_search['search_type'] : $param_search; - - $fieldname = !empty($param_search['fieldname']) ? $param_search['fieldname'] : 'Listview_'.$this->id.'_search_'.$key; - $value = $removeFilter ? '' : GETPOST($fieldname); - - if(is_array($typeRecherche)) - { - $fsearch=$form->selectarray($fieldname, $typeRecherche,$value,1); - } - else if($typeRecherche==='calendar') - { - if (!$removeFilter) $value = GETPOST($fieldname) ? mktime(0,0,0, (int) GETPOST($fieldname.'month'), (int) GETPOST($fieldname.$key.'day'), (int) GETPOST($fieldname.'year') ) : ''; - - $fsearch = $form->select_date($value, $fieldname,0, 0, 1, "", 1, 0, 1); - } - else if($typeRecherche==='calendars') - { - $value_start = $value_end = ''; - if (!$removeFilter) - { - $value_start = GETPOST($fieldname.'_start') ? mktime(0,0,0, (int) GETPOST($fieldname.'_startmonth'), (int) GETPOST($fieldname.'_startday'), (int) GETPOST($fieldname.'_startyear') ) : ''; - $value_end = GETPOST($fieldname.'_end') ? mktime(0,0,0, (int) GETPOST($fieldname.'_endmonth'), (int) GETPOST($fieldname.'_endday'), (int) GETPOST($fieldname.'_endyear') ) : ''; - } - - $fsearch = $form->select_date($value_start,$fieldname.'_start',0, 0, 1, "", 1, 0, 1) - . $form->select_date($value_end, $fieldname.'_end',0, 0, 1, "", 1, 0, 1); - - } - else if(is_string($typeRecherche)) - { - $fsearch=$TParam['search'][$key]; - } - else - { - $fsearch=''; - } - - if(!empty($param_search['allow_is_null'])) - { - $valueNull = GETPOST($fieldname.'search_on_null_'.$key) ? 1 : 0; - $fsearch.=' '.$form->checkbox1('', $fieldname.'search_on_null_'.$key,1, $valueNull,' onclick=" if($(this).is(\':checked\')){ $(this).prev().val(\'\'); }" ').img_help(1, $langs->trans('SearchOnNUllValue')); - } - - if(!empty($THeader[$key])) - { - $TSearch[$key] = $fsearch; - $nb_search_in_bar++; - } - } - - $search_button = ' '.img_search().''; - $search_button .= ' '.img_searchclear().''; - - if($nb_search_in_bar>0) - { - end($TSearch); - list($key,$v) = each($TSearch); - $TSearch[$key].=$search_button; - } - else - { - $TSearch=array(); - } - - return $TSearch; - } - - /** - * Function to analyse and calculate the total from a column - * - * @param string $TField TField - * @param string $TParam TParam - * @return array - */ - private function get_total(&$TField, &$TParam) - { - $TTotal=$TTotalGroup=array(); - - if(!empty($TParam['math']) && !empty($TField[0])) - { - foreach($TField[0] as $field=>$value) - { - $TTotal[$field]=''; - $TTotalGroup[$field] = ''; - } - - foreach($TParam['math'] as $field=>$typeMath) - { - if(is_array($typeMath)) - { - $targetField = $typeMath[1]; - $typeMath = $typeMath[0]; - } - else - { - $targetField = $field; - } - - if($typeMath == 'groupsum') - { - $TTotalGroup[$field] = array('target'=>$targetField, 'values'=> $this->TTotalTmp['@groupsum'][$targetField]); - } - else if($typeMath=='average') - { - $TTotal[$field]=array_sum($this->TTotalTmp[$targetField]) / count($this->TTotalTmp[$targetField]); - } - elseif($typeMath=='count') - { - $TTotal[$field]=count($this->TTotalTmp[$targetField]); - } - else - { - $TTotal[$field]=array_sum($this->TTotalTmp[$targetField]); - } - } - } - - return array($TTotal,$TTotalGroup); - } - - /** - * @return string - */ - /* - private function getJS() - { - $javaScript = ''; - - return $javaScript; - } - */ - - /** - * @param string $TParam TParam - * @param string $TField TField - * @param string $THeader THeader - * @return array - */ - private function setExport(&$TParam, $TField, $THeader) - { - global $langs; - - $Tab=array(); - if(!empty($TParam['export'])) - { - $token = GETPOST('token'); - if(empty($token)) $token = md5($this->id.time().rand(1,9999)); - - $_SESSION['token_list_'.$token] = gzdeflate( serialize( array( - 'title'=>$this->title, - 'sql'=>$this->sql, - 'TBind'=>$this->TBind, - 'TChamps'=>$TField, - 'TEntete'=>$THeader - ))); - - foreach($TParam['export'] as $mode_export) - { - $Tab[] = array( - 'label'=>$langs->trans('Export'.$mode_export), - 'url'=>dol_buildpath('/abricot/downlist.php',1), - 'mode'=>$mode_export, - 'token'=>$token, - 'session_name'=>session_name() - ); - } - - } - - return $Tab; - } - - /** - * @param string $TField TField - * @param string $TTotalGroup TTotalGroup - * @return array - */ - private function addTotalGroup($TField, $TTotalGroup) - { - global $langs; - - $Tab=array(); - $proto_total_line = array(); - $tagbase = $old_tagbase = null; - $addGroupLine = false; - - foreach($TField as $k=>&$line) - { - if(empty($proto_total_line)) - { - foreach($line as $field=>$value) - { - $proto_total_line[$field] = ''; - } - $group_line = $proto_total_line; - } - - $addGroupLine = false; - - $tagbase = ''; - foreach($line as $field=>$value) - { - if(!empty($TTotalGroup[$field])) - { - $tagbase.=$value.'|'; - $group_line[$field] = '
      '.(empty($value) ? $langs->trans('Empty') : $value ).' :
      '; - $group_line[$TTotalGroup[$field]['target']] = '
      '.price($TTotalGroup[$field]['values'][$value]).'
      '; - $addGroupLine = true; - } - } - - if(!is_null($old_tagbase) && $old_tagbase!=$tagbase && $addGroupLine) - { - $Tab[] = $previous_group_line; - } - - $old_tagbase = $tagbase; - $previous_group_line = $group_line; - $group_line = $proto_total_line; - - $Tab[] = $line; - } - - if($addGroupLine) - { - $Tab[] = $previous_group_line; - } - - return $Tab; - } - - /** - * @param string $THeader THeader - * @param string $TField TField - * @param string $TTotal TTotal - * @param string $TTotalGroup TTotalGroup - * @param string $TParam TParam - * @return string - */ - private function renderList(&$THeader, &$TField, &$TTotal, &$TTotalGroup, &$TParam) - { - global $bc,$form; - - $TSearch = $this->setSearch($THeader, $TParam); - $TExport = $this->setExport($TParam, $TField, $THeader); - $TField = $this->addTotalGroup($TField,$TTotalGroup); - - //$out = $this->getJS(); - - $massactionbutton= empty($TParam['list']['massactions']) ? '' : $form->selectMassAction('', $TParam['list']['massactions']); - - $dolibarr_decalage = $this->totalRow > $this->totalRowToShow ? 1 : 0; - ob_start(); - print_barre_liste($TParam['list']['title'], $TParam['limit']['page'], $_SERVER["PHP_SELF"], '&'.$TParam['list']['param_url'], $TParam['sortfield'], $TParam['sortorder'], $massactionbutton, $this->totalRowToShow+$dolibarr_decalage, $this->totalRow, $TParam['list']['image'], 0, '', '', $TParam['limit']['nbLine']); - $out .= ob_get_clean(); - - $classliste='liste'; - if(!empty($TParam['head_search'])) { - $out.='
      '; - $out.=$TParam['head_search']; - $out.='
      '; - - $classliste.=' listwithfilterbefore'; - } - - $out.= '
      '; - $out.= ''; - - if(count($TSearch)>0) - { - $out.=''; - - foreach ($THeader as $field => $head) - { - if ($field === 'selectedfields') - { - $out.= ''; - } - else - { - $moreattrib = 'style="width:'.$head['width'].';text-align:'.$head['text-align'].'"'; - $out .= ''; - } - } - - $out.=''; - } - - $out.= ''; - foreach($THeader as $field => $head) - { - $moreattrib = ''; - $search = ''; - $prefix = ''; - - $label = $head['label']; - - if ($field === 'selectedfields') - { - $moreattrib = 'align="right" '; - $prefix = 'maxwidthsearch '; - - if(!empty($TParam['list']['massactions'])) { - $label.=$form->showCheckAddButtons('checkforselect', 1); - } - - } - - if (empty($head['width'])) $head['width'] = 'auto'; - if (!empty($head['width']) && !empty($head['text-align'])) $moreattrib .= 'style="width:'.$head['width'].';text-align:'.$head['text-align'].'"'; - - if (isset($TParam['search'][$field]['search_type']) && $TParam['search'][$field]['search_type'] !== false) - { - $TsKey = $this->getSearchKey($field, $TParam); - if (!empty($TsKey)) $search = implode(',', $TsKey); - else $search = $field; - } - - $out .= getTitleFieldOfList($label, 0, $_SERVER["PHP_SELF"], $search, '', $moreparam, $moreattrib, $TParam['sortfield'], $TParam['sortorder'], $prefix); - $out .= $head['more']; - } - - //$out .= ''; - $out .= ''; - - $out.=''; - - if(empty($TField)) - { - if (!empty($TParam['list']['messageNothing'])) $out .= ''; - } - else - { - $line_number = 0; - foreach($TField as $fields) - { - if($this->in_view($TParam, $line_number)) - { - $out.=''; - - foreach ($THeader as $field => $head) - { - $value_aff =(isset($fields[$field]) ? $fields[$field] : ' '); - - if ($field === 'selectedfields') - { - $head['text-align']='center'; - if(!empty($TParam['list']['massactions'])) { - $arrayofselected=array(); // TODO get in param - $selected=0; - if (in_array($obj->rowid, $arrayofselected)) $selected=1; - $value_aff.=''; - } - } - - $moreattrib = 'style="width:'.$head['width'].';text-align:'.$head['text-align'].'"'; - $out.=''; - } - - $out.=''; - } - - $line_number++; - } - - $out.=''; - - if (!empty($TParam['list']['haveTotal'])) - { - $out.=''; - - foreach ($THeader as $field => $head) - { - if (isset($TTotal[$field])) - { - $moreattrib = 'style="width:'.$head['width'].';text-align:'.$head['text-align'].'"'; - $out.=''; - } - } - - $out.=''; - } - } - - $out .= '
      --
      '.$TParam['list']['messageNothing'].'
      '.$value_aff.'
      '.price($TTotal[$field]).'
      '; - $out .= '
      '; - - return $out; - } - - /** - * @param string $db Db - * @param string $TField TField - * @param string $TParam TParam - */ - public function renderArray(&$db, $TField, $TParam=array()) - { - $this->typeRender = 'array'; - - $TField=array(); - - $this->init($TParam); - $THeader = $this->initHeader($TParam); - - $this->parse_array($THeader, $TField, $TParam); - list($TTotal, $TTotalGroup)=$this->get_total($TField, $TParam); - - $this->renderList($THeader, $TField, $TTotal, $TTotalGroup, $TParam); - } - - - /** - * @param string $THeader THeader - * @param string $TField TField - * @param string $TParam TParam - * @return bool - */ - private function parse_array(&$THeader, &$TField, &$TParam) - { - $this->totalRow = count($TField); - - $this->THideFlip = array_flip($TParam['hide']); - $this->TTotalTmp=array(); - - if (empty($TField)) return false; - - foreach($TField as $row) - { - $this->set_line($THeader, $TField, $TParam, $row); - } - } - - - private function initHeader(&$TParam) - { - global $user,$conf; - - $THeader = array(); - - $TField=$TFieldVisibility=array(); - foreach ($TParam['title'] as $field => $value) - { - $TField[$field]=true; - } - - $contextpage=md5($_SERVER['PHP_SELF']); - if(!empty($TParam['allow-fields-select'])) - { - $selectedfields = GETPOST('Listview'.$this->id.'_selectedfields'); - - if(!empty($selectedfields)) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $tabparam['MAIN_SELECTEDFIELDS_'.$contextpage] = $selectedfields; - $result=dol_set_user_param($this->db, $conf, $user, $tabparam); - } - - $tmpvar='MAIN_SELECTEDFIELDS_'.$contextpage; - if (! empty($user->conf->{$tmpvar})) - { - $tmparray = explode(',', $user->conf->{$tmpvar}); - $TParam['hide'] = array(); - foreach($TField as $field => $dummy) - { - $label = $TParam['title'][$field]; - if(!in_array($field, $tmparray)) - { - $TParam['hide'][] = $field; - $visible = 0; - } - else - { - // Overrive search from extrafields - // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') - if (isset($this->extralabels[$field])) $TParam['search'][$field] = $this->extrafields->showInputField($field, $this->search_array_options['search_options_'.$field], '', '', 'search_'); - $visible = 1; - } - - $TFieldVisibility[$field] = array( - 'label'=>$label - ,'checked'=>$visible - ); - } - } - else - { - foreach($TField as $field=>$dummy) - { - $label = isset($TParam['title'][$field]) ? $TParam['title'][$field] : $field; - $visible = (!in_array($field, $TParam['hide'])) ? 1 : 0; - $TFieldVisibility[$field]=array( - 'label'=>$label, - 'checked'=>$visible - ); - } - } - - $selectedfields = $this->form->multiSelectArrayWithCheckbox('Listview'.$this->id.'_selectedfields', $TFieldVisibility, $contextpage); // This also change content of $arrayfields_0 - } - - foreach ($TParam['title'] as $field => $label) - { - $visible = (!in_array($field, $TParam['hide'])) ? 1 : 0; - if($visible) - { - $THeader[$field] = array( - 'label'=>$label, - 'order'=>(in_array($field, $TParam['orderby']['noOrder']) ? 0 : 1), - 'width'=>(!empty($TParam['size']['width'][$field]) ? $TParam['size']['width'][$field] : 'auto'), - 'text-align'=>(!empty($TParam['position']['text-align'][$field]) ? $TParam['position']['text-align'][$field] : 'auto'), - 'rank'=>(!empty($TParam['position']['rank'][$field]) ? $TParam['position']['rank'][$field] : 0), - 'more'=>'' - ); - } - } - - uasort($THeader,array('Listview','sortHeaderRank')); - - $THeader['selectedfields']['label']=$selectedfields; - - return $THeader; - } - - public function sortHeaderRank(&$a, &$b) { - if($a['rank']>$b['rank']) return 1; - else if($a['rank']<$b['rank']) return -1; - else return 0; - - } - - /** - * @param string $TParam TParam - * @param string $line_number aaa - * @return bool - */ - private function in_view(&$TParam, $line_number) - { - global $conf; - - if(!empty($_REQUEST['get-all-for-export'])) return true; - - $page_number = !empty($TParam['limit']['page']) ? $TParam['limit']['page'] : 1; - $line_per_page = !empty($TParam['limit']['nbLine']) ? $TParam['limit']['nbLine'] : $conf->liste_limit; - - $start = ($page_number-1) * $line_per_page; - $end = ($page_number* $line_per_page) -1; - - if($line_number>=$start && $line_number<=$end) return true; - else return false; - } - - /** - * Apply function to result and set fields array - * - * @param string $THeader array of headers - * @param string $TField array of fields - * @param string $TParam array of parameters - * @param string $currentLine object containing current sql result - */ - private function set_line(&$THeader, &$TField, &$TParam, $currentLine) - { - global $conf; - - $line_number = count($TField); - - if($this->in_view($TParam,$line_number)) - { - $this->totalRowToShow++; - $row=array(); - $trans = array(); - foreach($currentLine as $kF=>$vF)$trans['@'.$kF.'@'] = addslashes($vF); - - foreach($THeader as $field=>$dummy) - { - $value = isset($currentLine->{$field}) ? $currentLine->{$field}: ''; - - if(is_object($value)) - { - if(get_class($value)=='stdClass') {$value=print_r($value, true);} - else $value=(string) $value; - } - - $trans['@'.$field.'@'] = addslashes($value); - - if(!empty($TParam['math'][$field])) - { - $float_value = (double) strip_tags($value); - $this->TTotalTmp[$field][] = $float_value; - } - - if(!in_array($field,$TParam['hide'])) - { - $row[$field]=$value; - - if(isset($TParam['eval'][$field]) && in_array($field,array_keys($row))) - { - $strToEval = 'return '.strtr( $TParam['eval'][$field], array_merge( $trans, array('@val@'=>addslashes( $row[$field] )) )).';'; - $row[$field] = eval($strToEval); - - } - - if(isset($TParam['type'][$field]) && !isset($TParam['eval'][$field])) - { - if($TParam['type'][$field]=='date' || $TParam['type'][$field]=='datetime' ) - { - - if($row[$field] != '0000-00-00 00:00:00' && $row[$field] != '1000-01-01 00:00:00' && $row[$field] != '0000-00-00' && !empty($row[$field])) - { - if($TParam['type'][$field]=='datetime')$row[$field] = dol_print_date(strtotime($row[$field]),'dayhour'); - else $row[$field] = dol_print_date(strtotime($row[$field]),'day'); - } - else - { - $row[$field] = ''; - } - } - - if($TParam['type'][$field]=='hour') { $row[$field] = date('H:i', strtotime($row[$field])); } - if($TParam['type'][$field]=='money') { $row[$field] = '
      '.price($row[$field],0,'',1,-1,2).'
      '; } - if($TParam['type'][$field]=='number') { $row[$field] = '
      '.price($row[$field]).'
      '; } - if($TParam['type'][$field]=='integer') { $row[$field] = '
      '.((int) $row[$field]).'
      '; } - } - - if(isset($TParam['link'][$field])) - { - if(empty($row[$field]) && $row[$field]!==0 && $row[$field]!=='0')$row[$field]='(vide)'; - $row[$field]= strtr( $TParam['link'][$field], array_merge( $trans, array('@val@'=>$row[$field]))) ; - } - - if(isset($TParam['translate'][$field])) - { - if(isset($TParam['translate'][$field][''])) unset($TParam['translate'][$field]['']); - - $row[$field] = strtr( $row[$field], $TParam['translate'][$field]); - } - } - } - } - else - { - $row = array(); - - foreach($currentLine as $field=>&$value) - { - if(!isset($this->THideFlip[$field])) - { - if(isset($TParam['math'][$field]) && !empty($TParam['math'][$field])) - { - $float_value = (double) strip_tags($value); - $this->TTotalTmp[$field][] = $float_value; - } - - $row[$field] = $value; - } - } - } - - if(!empty($TParam['math'][$field])) - { - foreach($row as $field=>$value) - { - if(!empty($TParam['math'][$field]) && is_array($TParam['math'][$field])) - { - $toField = $TParam['math'][$field][1]; - $float_value = (double) strip_tags($row[$toField]); - $this->TTotalTmp['@groupsum'][$toField][ $row[$field] ] += $float_value; - } - } - } - - $TField[] = $row; - } - - /** - * @param string $sql sql - * @param string $TParam TParam - * @return string - */ - private function limitSQL($sql, &$TParam) - { - if(!empty($TParam['limit']['global']) && strpos($sql,'LIMIT ')===false ) - { - $sql.=' LIMIT '.(int) $TParam['limit']['global']; - } - else if(!empty($TParam['limit'])) $sql.= $this->db->plimit($TParam['limit']['nbLine']+1, $TParam['limit']['page'] * $TParam['limit']['nbLine']); - - - return $sql; - } - - /** - * @param string $THeader THeader - * @param string $TField TField - * @param string $TParam TParam - * @param string $sql sql - */ - private function parse_sql(&$THeader, &$TField, &$TParam, $sql) - { - $this->sql = $this->limitSQL($sql, $TParam); - - $this->TTotalTmp=array(); - $this->THideFlip = array_flip($TParam['hide']); - - $res = $this->db->query($this->sql); - if($res!==false) - { - dol_syslog(get_class($this)."::parse_sql id=".$this->id." sql=".$this->sql, LOG_DEBUG); - - if(empty($this->totalRow))$this->totalRow = $this->db->num_rows($res); - - while($currentLine = $this->db->fetch_object($res)) - { - $this->set_line($THeader, $TField, $TParam, $currentLine); - } - } - else - { - dol_syslog(get_class($this)."::parse_sql id=".$this->id." sql=".$this->sql, LOG_ERR); - } - } - - static function getCachedOjbect($class_name, $fk_object) { - global $db, $TCacheListObject; - - if(!class_exists($class_name)) return false; - - if(empty($TCacheListObject)) $TCacheListObject = array(); - if(empty($TCacheListObject[$class_name])) $TCacheListObject[$class_name] =array(); - - if(empty($TCacheListObject[$class_name][$fk_object])) { - $TCacheListObject[$class_name][$fk_object]= new $class_name($db); - if( $TCacheListObject[$class_name][$fk_object]->fetch($fk_object)<0) { - return false; - } - } - - return $TCacheListObject[$class_name][$fk_object]; - } - -} diff --git a/htdocs/product/list-with-listview.php b/htdocs/product/list-with-listview.php deleted file mode 100644 index 8e4218db227..00000000000 --- a/htdocs/product/list-with-listview.php +++ /dev/null @@ -1,703 +0,0 @@ - - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2012-2016 Marcos García - * Copyright (C) 2013-2016 Juanjo Menent - * Copyright (C) 2013-2015 Raphaël Doursenaud - * Copyright (C) 2013 Jean Heimburger - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Adolfo segura - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016 Ferran Marcet - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/product/list.php - * \ingroup produit - * \brief Page to list products and services - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/inventory/listview.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -if (! empty($conf->categorie->enabled)) - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - -$langs->load("products"); -$langs->load("stocks"); -$langs->load("suppliers"); -$langs->load("companies"); -if (! empty($conf->productbatch->enabled)) $langs->load("productbatch"); - -$action=GETPOST('action','alpha'); -$massaction=GETPOST('massaction','alpha'); -$show_files=GETPOST('show_files','int'); -$confirm=GETPOST('confirm','alpha'); -$toselect = GETPOST('toselect', 'array'); - -$sref=GETPOST("sref"); -$sbarcode=GETPOST("sbarcode"); -$snom=GETPOST("snom"); -$sall=GETPOST("sall"); -$type= (int) GETPOST("type","int"); -$search_sale = GETPOST("search_sale"); -$search_categ = GETPOST("search_categ",'int'); -$tosell = GETPOST("tosell", 'int'); -$tobuy = GETPOST("tobuy", 'int'); -$fourn_id = GETPOST("fourn_id",'int'); -$catid = GETPOST('catid','int'); -$search_tobatch = GETPOST("search_tobatch",'int'); -$search_accountancy_code_sell = GETPOST("search_accountancy_code_sell",'alpha'); -$search_accountancy_code_buy = GETPOST("search_accountancy_code_buy",'alpha'); -$optioncss = GETPOST('optioncss','alpha'); - -//Show/hide child products. Hidden by default -if (!$_POST) { - $search_hidechildproducts = 'on'; -} else { - $search_hidechildproducts = GETPOST('search_hidechildproducts'); -} - -$diroutputmassaction=$conf->product->dir_output . '/temp/massgeneration/'.$user->id; - -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0); -if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortfield) $sortfield="p.ref"; -if (! $sortorder) $sortorder="ASC"; - -// Initialize context for list -$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'productservicelist'; -if ((string) $type == '1') { $contextpage='servicelist'; if ($search_type=='') $search_type='1'; } -if ((string) $type == '0') { $contextpage='productlist'; if ($search_type=='') $search_type='0'; } - -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array($contextpage)); -$extrafields = new ExtraFields($db); -$form=new Form($db); - -// fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('product'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); - -if (empty($action)) $action='list'; - -// Get object canvas (By default, this is not defined, so standard usage of dolibarr) -$canvas=GETPOST("canvas"); -$objcanvas=null; -if (! empty($canvas)) -{ - require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; - $objcanvas = new Canvas($db,$action); - $objcanvas->getCanvas('product','list',$canvas); -} - -// Security check -if ($type=='0') $result=restrictedArea($user,'produit','','','','','',$objcanvas); -else if ($type=='1') $result=restrictedArea($user,'service','','','','','',$objcanvas); -else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas); - -// Define virtualdiffersfromphysical -$virtualdiffersfromphysical=0; -if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) -{ - $virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs. -} - -// List of fields to search into when doing a "search in all" -$fieldstosearchall = array( - 'p.ref'=>"Ref", - 'pfp.ref_fourn'=>"RefSupplier", - 'p.label'=>"ProductLabel", - 'p.description'=>"Description", - "p.note"=>"Note", -); -// multilang -if (! empty($conf->global->MAIN_MULTILANGS)) -{ - $fieldstosearchall['pl.label']='ProductLabelTranslated'; - $fieldstosearchall['pl.description']='ProductDescriptionTranslated'; - $fieldstosearchall['pl.note']='ProductNoteTranslated'; -} -if (! empty($conf->barcode->enabled)) { - $fieldstosearchall['p.barcode']='Gencod'; -} - -if (empty($conf->global->PRODUIT_MULTIPRICES)) -{ - $titlesellprice=$langs->trans("SellingPrice"); - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) - { - $titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer")); - } -} - -// Definition of fields for lists -$arrayfields=array( - 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), - 'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), - 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>($contextpage != 'servicelist'), 'enabled'=>(! empty($conf->barcode->enabled))), - 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))), - 'p.price'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)), - 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))), - 'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'stock_virtual'=>array('label'=>$langs->trans("VirtualStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service' && $virtualdiffersfromphysical)), - 'p.tobatch'=>array('label'=>$langs->trans("ManageLotSerial"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))), - 'p.accountancy_code_sell'=>array('label'=>$langs->trans("ProductAccountancySellCode"), 'checked'=>0), - 'p.accountancy_code_buy'=>array('label'=>$langs->trans("ProductAccountancyBuyCode"), 'checked'=>0), - 'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'p.tosell'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Sell").')', 'checked'=>1, 'position'=>1000), - 'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Buy").')', 'checked'=>1, 'position'=>1000) -); -// Extra fields -if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) -{ - foreach($extrafields->attribute_label as $key => $val) - { - $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key]); - } -} - - - -/* - * Actions - */ - -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } - -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - -if (empty($reshook)) -{ - // Selection of new fields - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - - // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers - { - $sall=""; - $sref=""; - $snom=""; - $sbarcode=""; - $search_categ=0; - $tosell=""; - $tobuy=""; - $search_tobatch=''; - $search_accountancy_code_sell=''; - $search_accountancy_code_buy=''; - $search_array_options=array(); - } - - // Mass actions - $objectclass='Product'; - if ((string) $type == '1') { $objectlabel='Services'; } - if ((string) $type == '0') { $objectlabel='Products'; } - - $permtoread = $user->rights->produit->lire; - $permtodelete = $user->rights->produit->supprimer; - $uploaddir = $conf->product->dir_output; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; -} - - -/* - * View - */ - -$htmlother=new FormOther($db); - -if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) -{ - $objcanvas->assign_values($action); // This must contains code to load data (must call LoadListDatas($limit, $offset, $sortfield, $sortorder)) - $objcanvas->display_canvas($action); // This is code to show template -} -else -{ - $title=$langs->trans("ProductsAndServices"); - - if (isset($type)) - { - if ($type==1) - { - $texte = $langs->trans("Services"); - } - else - { - $texte = $langs->trans("Products"); - } - } - else - { - $texte = $langs->trans("ProductsAndServices"); - } - - $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; - $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; - $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy,'; - $sql.= ' p.datec, p.tms,'; - //$sql.= ' pfp.ref_fourn as ref_supplier, '; - $sql.= ' MIN(pfp.unitprice) as minsellprice'; - if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($type === 0)) { - $sql .= ', pac.rowid prod_comb_id'; - } - // Add fields from extrafields - foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); - // Add fields from hooks - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook - $sql.=$hookmanager->resPrint; - $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)"; - if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; - // multilang - if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang() ."'"; - if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($type === 0)) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; - } - - $sql.= ' WHERE p.entity IN ('.getEntity('product').')'; - if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); - // if the type is not 1, we show all products (type = 0,2,3) - if (dol_strlen($type)) - { - if ($type == 1) $sql.= " AND p.fk_product_type = '1'"; - else $sql.= " AND p.fk_product_type <> '1'"; - } - if ($sref) $sql .= natural_search('p.ref', $sref); - if ($snom) $sql .= natural_search('p.label', $snom); - if ($sbarcode) $sql .= natural_search('p.barcode', $sbarcode); - if (isset($tosell) && dol_strlen($tosell) > 0 && $tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($tosell); - if (isset($tobuy) && dol_strlen($tobuy) > 0 && $tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($tobuy); - if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'"; - if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid; - if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL"; - if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ); - if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL"; - if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id; - if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch); - if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell); - if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); - // Add where from extra fields - - if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($type === 0)) { - $sql .= " AND pac.rowid IS NULL"; - } - - // Add where from extra fields - foreach ($search_array_options as $key => $val) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } - } - // Add where from hooks - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook - $sql.=$hookmanager->resPrint; - $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; - $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; - $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy'; - if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($type === 0)) { - $sql .= ', pac.rowid'; - } - // Add fields from extrafields - foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); - // Add fields from hooks - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook - $sql.=$hookmanager->resPrint; - - // TODO put these functions into product.lib.php if this go from demo to core - /** - * Function return formated sell price - * - * @param int $fk_object rowid of product - * @return string - */ - function list_get_product_sellprice($fk_object) { - global $langs,$conf, $user; - - $object = Listview::getCachedOjbect('Product', $fk_object); - if($object === false) return ''; - - if ($object->status) - { - if ($object->price_base_type == 'TTC') return price($object->price_ttc).' '.$langs->trans("TTC"); - else return price($object->price).' '.$langs->trans("HT"); - } - return ''; - } - - /** - * Function return formated product status sell or buy - * - * @param int $fk_object rowid of product - * @param string $field concerned field status|status_buy - * @param int $type for libstatus - * @return string - */ - function list_get_product_status($fk_object, $field, $type) { - global $conf, $user; - - $object = Listview::getCachedOjbect('Product', $fk_object); - - if($object === false) return ''; - - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - return ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); - } else { - return $object->LibStatut($object->{$field},5,$type); - } - - } - - /** - * Function return formated ref - * - * @param int $fk_object rowid of product - * @return string - */ - function list_get_product_ref($fk_object) { - global $conf, $user; - - $object = Listview::getCachedOjbect('Product', $fk_object); - - if($object === false) return ''; - - return $object->getNomUrl(1,'',24); - } - - /** - * Function return formated extrafield - * - * @param int $fk_object rowid of product - * @param string $key extrafield to output - * @return string - */ - function list_get_product_extrafield($fk_object, $key) { - global $extrafields; - - $object = Listview::getCachedOjbect('Product', $fk_object); - if($object === false) return ''; - - return $extrafields->showOutputField($key, $object->array_options['options_'.$key], '', 1); - } - - /** - * Function return formated virtual stock - * - * @param int $fk_object rowid of product - * @return string - */ - function list_get_product_virtual_stock($fk_object) { - global $langs; - - $object = Listview::getCachedOjbect('Product', $fk_object); - if($object === false) return ''; - - $object->load_stock('nobatch'); - - $out = ''; - if ($object->type != 1) - { - if ($object->seuil_stock_alerte != '' && $object->stock_theorique < (float) $object->seuil_stock_alerte) $out.= img_warning($langs->trans("StockTooLow")).' '; - $out.= (double) $object->stock_theorique; - } - - return $out; - } - - /** - * Function return formated stock - * - * @param int $fk_object rowid of product - * @return string - */ - function list_get_product_stock($fk_object) { - global $langs; - - $object = Listview::getCachedOjbect('Product', $fk_object); - if($object === false) return ''; - - $out = ''; - if ($object->type != 1) - { - if ($object->seuil_stock_alerte != '' && $object->stock_reel< (float) $object->seuil_stock_alerte) $out.= img_warning($langs->trans("StockTooLow")).' '; - $out.= (double) $object->stock_reel; - } - - return $out; - } - /** - * Function return formated min buy price - * - * @param int $fk_object rowid of product - * @return string - */ - function list_get_product_minbuyprice($fk_object) { - global $conf, $user, $langs,$db,$form; - - $out = ''; - - $object = Listview::getCachedOjbect('Product', $fk_object); - if($object === false || empty($object->status_buy) ) return ''; - - $product_fourn =new ProductFournisseur($db); - if ($product_fourn->find_min_price_product_fournisseur($fk_object) > 0) - { - if ($product_fourn->product_fourn_price_id > 0) - { - if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) - { - $htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1); - $out.= $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext); - } - else $out.= price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); - } - } - return $out; - } - - // array of customized field function - $arrayeval = array( - 'tobuy'=>'list_get_product_status(@rowid@, "status_buy",1)' - ,'tosell'=>'list_get_product_status(@rowid@, "status",0)' - ,'ref'=>'list_get_product_ref(@rowid@)' - ,'label'=>'dol_trunc("@val@",40)' - ,'price'=>'list_get_product_sellprice(@rowid@)' - ,'stock_virtual'=>'list_get_product_virtual_stock(@rowid@)' - ,'stock'=>'list_get_product_stock(@rowid@)' - ,'minbuyprice'=>'list_get_product_minbuyprice(@rowid@)' - ); - - // defined list align for field - $arrayalign = array( - 'price'=>'right' - ,'tobuy'=>'right' - ,'tosell'=>'right' - ,'desiredstock'=>'right' - ,'stock'=>'right' - ,'stock_virtual'=>'right' - ,'minbuyprice'=>'right' - ,'datec'=>'center' - ,'tms'=>'center' - ); - - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListMoreFields',$parameters); // Note that $action and $object may have been modified by hook - if($reshook) { - $arrayfields = $hookmanager->resArray; - } - - // init title, hidden field (allowed into selected fields), and position - $arrayhide = $arraytitle = $arrayposition = array(); - foreach($arrayfields as $k=>$data) { - if(!isset($data['enabled']) || $data['enabled']) { - list($t,$f) = explode('.',$k); - if(empty($f))$f = $k; - $arraytitle[$f]=$data['label']; - if(empty($data['checked'])) $arrayhide[] = $f; - $arrayposition[$f] = empty($data['position']) ? 0 : $data['position']; - } - } - - // Extra fields - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key => $val) - { - $arrayalign[$key]=$extrafields->getAlignFlag($key); - $arrayeval[$key] = 'list_get_product_extrafield(@rowid@, "'.$key.'")'; - } - } - // List of mass actions available - $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), - ); - if ($user->rights->produit->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); - if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array(); - - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - $moreforfilter.='
      '; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1); - $moreforfilter.='
      '; - } - - //Show/hide child products. Hidden by default - if (!empty($conf->variants->enabled) && $type === 0) { - $moreforfilter.='
      '; - $moreforfilter.= ''; - $moreforfilter.= ' '; - $moreforfilter.='
      '; - } - - if ($moreforfilter) - { - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - - if(!empty($hookmanager->resPrint)) { - $moreforfilter.=$hookmanager->resPrint; - } - - } - - $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); - if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ); - if ($sref) $param="&sref=".urlencode($sref); - if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($sbarcode) $param.=($sbarcode?"&sbarcode=".urlencode($sbarcode):""); - if ($snom) $param.="&snom=".urlencode($snom); - if ($sall) $param.="&sall=".urlencode($sall); - if ($tosell != '') $param.="&tosell=".urlencode($tosell); - if ($tobuy != '') $param.="&tobuy=".urlencode($tobuy); - if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:""); - if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); - if ($type != '') $param.='&type='.urlencode($type); - if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - if ($search_tobatch) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($search_accountancy_code_sell) $param="&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell); - if ($search_accountancy_code_buy) $param="&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy); - // Add $param from extra fields - foreach ($search_array_options as $key => $val) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); - } - - //var_dump($arraytitle,$arrayhide); - $list=new Listview($db, 'product'); - $listHTML = $list->render($sql,array( - 'list'=>array( - 'title'=>$texte - ,'image'=>'title_products.png' - ,'massactions'=>$arrayofmassactions - ,'param_url'=>$param - ,'messageNothing'=>'' - ) - ,'limit'=>array( - 'nbLine'=>$limit - ) - ,'sortfield'=>$sortfield - ,'sortorder'=>$sortorder - ,'title'=>$arraytitle // column definition title (only defined where abble to show) - ,'position'=>array( - 'text-align'=>$arrayalign - ,'rank'=>$arrayposition - ) - ,'allow-fields-select'=>1 // allow to select hidden fields - ,'head_search'=>$moreforfilter //custom search on head - ,'no-auto-sql-search'=>1 //disabled auto completion sql for search and pager url, use dolibarr style for migration of product list - ,'translate'=>array() - ,'search'=>array( - 'ref'=>array('search_type'=>true, 'table'=>'p', 'fieldname'=>'sref') - ,'label'=>array('search_type'=>true, 'table'=>'p', 'fieldname'=>'snom') - ,'tosell'=>array('search_type'=> array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')), 'fieldname'=>'tosell') - ,'tobuy'=>array('search_type'=> array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')), 'fieldname'=>'tobuy') - ,'barcode'=>array('search_type'=>true, 'table'=>'p', 'fieldname'=>'sbarcode') - ,'accountancy_code_sell'=>array('search_type'=>true, 'table'=>'p', 'fieldname'=>'search_accountancy_code_sell') - ,'accountancy_code_buy'=>array('search_type'=>true, 'table'=>'p', 'fieldname'=>'search_accountancy_code_buy') - ) - ,'type'=>array( - 'datec'=>'datetime' - ,'tms'=>'datetime' - ) - ,'hide'=>$arrayhide - ,'eval'=>$arrayeval - )); - - $num = $list->totalRow; - - $arrayofselected=is_array($toselect)?$toselect:array(); - - if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) - { - $id = $list->TField[0]->rowid; - header("Location: ".DOL_URL_ROOT.'/product/card.php?id='.$id); - exit; - } - - $helpurl=''; - if (isset($type)) - { - if ($type == 0) - { - $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; - } - else if ($type == 1) - { - $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; - } - } - - llxHeader('',$title,$helpurl,''); - - // Displays product removal confirmation - if (GETPOST('delprod')) { - setEventMessages($langs->trans("ProductDeleted", GETPOST('delprod')), null, 'mesgs'); - } - - print '
      '; - if ($optioncss != '') print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - echo $listHTML; - - print '
      '; - -} - - -llxFooter(); -$db->close(); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 8a8eda5b65a..7d2b1a22b68 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -52,14 +52,14 @@ $confirm=GETPOST('confirm','alpha'); $toselect = GETPOST('toselect', 'array'); $sall=GETPOST('sall', 'alphanohtml'); -$sref=GETPOST("sref"); -$sbarcode=GETPOST("sbarcode"); -$snom=GETPOST("snom"); +$search_ref=GETPOST("search_ref"); +$search_barcode=GETPOST("search_barcode"); +$search_label=GETPOST("search_label"); $search_type = GETPOST("search_type",'int'); $search_sale = GETPOST("search_sale"); $search_categ = GETPOST("search_categ",'int'); -$tosell = GETPOST("tosell", 'int'); -$tobuy = GETPOST("tobuy", 'int'); +$search_tosell = GETPOST("search_tosell", 'int'); +$search_tobuy = GETPOST("search_tobuy", 'int'); $fourn_id = GETPOST("fourn_id",'int'); $catid = GETPOST('catid','int'); $search_tobatch = GETPOST("search_tobatch",'int'); @@ -164,6 +164,8 @@ $arrayfields=array( 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))), 'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)), 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))), + 'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))), + 'p.pmp'=>array('label'=>$langs->trans("PMPValueShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))), 'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), @@ -191,8 +193,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -204,15 +206,15 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $sall=""; - $sref=""; - $snom=""; - $sbarcode=""; + $search_ref=""; + $search_label=""; + $search_barcode=""; $search_categ=0; - $tosell=""; - $tobuy=""; + $search_tosell=""; + $search_tobuy=""; $search_tobatch=''; $search_type=''; $search_accountancy_code_sell=''; @@ -266,7 +268,7 @@ else $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy,'; - $sql.= ' p.datec as date_creation, p.tms as date_update,'; + $sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp,'; //$sql.= ' pfp.ref_fourn as ref_supplier, '; $sql.= ' MIN(pfp.unitprice) as minsellprice'; if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { @@ -296,11 +298,11 @@ else if ($search_type == 1) $sql.= " AND p.fk_product_type = 1"; else $sql.= " AND p.fk_product_type <> 1"; } - if ($sref) $sql .= natural_search('p.ref', $sref); - if ($snom) $sql .= natural_search('p.label', $snom); - if ($sbarcode) $sql .= natural_search('p.barcode', $sbarcode); - if (isset($tosell) && dol_strlen($tosell) > 0 && $tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($tosell); - if (isset($tobuy) && dol_strlen($tobuy) > 0 && $tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($tobuy); + if ($search_ref) $sql .= natural_search('p.ref', $search_ref); + if ($search_label) $sql .= natural_search('p.label', $search_label); + if ($search_barcode) $sql .= natural_search('p.barcode', $search_barcode); + if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($search_tosell); + if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($search_tobuy); if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'"; if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL"; @@ -309,7 +311,7 @@ else if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id; if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch); if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell); - if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); + if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); // Add where from extra fields if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { @@ -323,8 +325,9 @@ else $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -335,7 +338,7 @@ else $sql.=$hookmanager->resPrint; $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; - $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy'; + $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy, p.pmp'; if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { $sql .= ', pac.rowid'; } @@ -393,22 +396,22 @@ else $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); - if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ); - if ($sref) $param="&sref=".urlencode($sref); - if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($sbarcode) $param.=($sbarcode?"&sbarcode=".urlencode($sbarcode):""); - if ($snom) $param.="&snom=".urlencode($snom); - if ($sall) $param.="&sall=".urlencode($sall); - if ($tosell != '') $param.="&tosell=".urlencode($tosell); - if ($tobuy != '') $param.="&tobuy=".urlencode($tobuy); - if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:""); - if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); - if ($type != '') $param.='&type='.urlencode($type); - if ($search_type != '') $param.='&search_type='.urlencode($search_type); + if ($sall) $param.="&sall=".urlencode($sall); + if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ); + if ($search_ref) $param="&search_ref=".urlencode($search_ref); + if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier); + if ($search_barcode) $param.=($search_barcode?"&search_barcode=".urlencode($search_barcode):""); + if ($search_label) $param.="&search_label=".urlencode($search_label); + if ($search_tosell != '') $param.="&search_tosell=".urlencode($search_tosell); + if ($search_tobuy != '') $param.="&search_tobuy=".urlencode($search_tobuy); + if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:""); + if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); + if ($type != '') $param.='&type='.urlencode($type); + if ($search_type != '') $param.='&search_type='.urlencode($search_type); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - if ($search_tobatch) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($search_accountancy_code_sell) $param="&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell); - if ($search_accountancy_code_buy) $param="&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy); + if ($search_tobatch) $param="&search_ref_supplier=".urlencode($search_ref_supplier); + if ($search_accountancy_code_sell) $param="&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell); + if ($search_accountancy_code_buy) $param="&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy); // Add $param from extra fields foreach ($search_array_options as $key => $val) { @@ -514,7 +517,7 @@ else if (! empty($arrayfields['p.ref']['checked'])) { print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['pfp.ref_fourn']['checked'])) @@ -526,7 +529,7 @@ else if (! empty($arrayfields['p.label']['checked'])) { print ''; - print ''; + print ''; print ''; } // Type @@ -541,7 +544,7 @@ else if (! empty($arrayfields['p.barcode']['checked'])) { print ''; - print ''; + print ''; print ''; } // Duration @@ -563,6 +566,20 @@ else print ''; print ' '; print ''; + } + // Number buying Price + if (! empty($arrayfields['p.numbuyprice']['checked'])) + { + print ''; + print ' '; + print ''; + } + // WAP + if (! empty($arrayfields['p.pmp']['checked'])) + { + print ''; + print ' '; + print ''; } // Limit for alert if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) @@ -593,7 +610,26 @@ else { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) print ''; + if (! empty($arrayfields["ef.".$key]['checked'])) { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + else + { + // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') + echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_'); + } + print ''; + } } } // Fields from hook @@ -615,13 +651,13 @@ else if (! empty($arrayfields['p.tosell']['checked'])) { print ''; - print $form->selectarray('tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$tosell,1); + print $form->selectarray('search_tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$search_tosell,1); print ''; } if (! empty($arrayfields['p.tobuy']['checked'])) { print ''; - print $form->selectarray('tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$tobuy,1); + print $form->selectarray('search_tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$search_tobuy,1); print ''; } print ''; @@ -640,6 +676,8 @@ else if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.numbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.numbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.pmp']['checked'])) print_liste_field_titre($arrayfields['p.pmp']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) print_liste_field_titre($arrayfields['p.seuil_stock_alerte']['label'], $_SERVER["PHP_SELF"],"p.seuil_stock_alerte","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desiredstock","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder); @@ -656,7 +694,7 @@ else $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -706,6 +744,7 @@ else $product_static->status_buy = $obj->tobuy; $product_static->status = $obj->tosell; $product_static->entity = $obj->entity; + $product_static->pmp = $obj->pmp; if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock { @@ -759,13 +798,13 @@ else if (! empty($arrayfields['p.duration']['checked'])) { print ''; - if (preg_match('/([0-9]+)[a-z]/i',$obj->duration)) + if (preg_match('/([^a-z]+)[a-z]/i',$obj->duration)) { - if (preg_match('/([0-9]+)y/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); - elseif (preg_match('/([0-9]+)m/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); - elseif (preg_match('/([0-9]+)w/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationWeek"); - elseif (preg_match('/([0-9]+)d/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); - //elseif (preg_match('/([0-9]+)h/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationHour"); + if (preg_match('/([^a-z]+)y/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); + elseif (preg_match('/([^a-z]+)m/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); + elseif (preg_match('/([^a-z]+)w/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationWeek"); + elseif (preg_match('/([^a-z]+)d/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); + //elseif (preg_match('/([^a-z]+)h/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationHour"); else print $obj->duration; } print ''; @@ -809,6 +848,29 @@ else if (! $i) $totalarray['nbfield']++; } + // Number of buy prices + if (! empty($arrayfields['p.numbuyprice']['checked'])) + { + print ''; + if ($obj->tobuy) + { + if (count($productFournList = $product_fourn->list_product_fournisseur_price($obj->rowid)) > 0) + { + $htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1, $productFournList); + print $form->textwithpicto(count($productFournList),$htmltext); + } + } + print ''; + } + + // WAP + if (! empty($arrayfields['p.pmp']['checked'])) + { + print ''; + print price($product_static->pmp, 1, $langs); + print ''; + } + // Limit alert if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) { diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 21491eab512..91a8f4f80a4 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -139,10 +139,10 @@ if ($resql) while ($i < $num) { $objp = $db->fetch_object($resql); - + $infoprod[$objp->rowid]=array('type'=>$objp->type, 'ref'=>$objp->ref, 'label'=>$objp->label); $infoprod[$objp->rowid]['nblineproposal']=$objp->c; - + $i++; } $db->free($resql); @@ -159,10 +159,10 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort print ''; print ""; -print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('Type'), $_SERVER["PHP_SELF"], 'p.fk_product_type', '', $param, '', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('Label'), $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('NbOfQtyInProposals'), $_SERVER["PHP_SELF"], 'c', '', $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); +print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'p.fk_product_type', '', $param, '', $sortfield, $sortorder); +print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder); +print_liste_field_titre('NbOfQtyInProposals', $_SERVER["PHP_SELF"], 'c', '', $param, 'align="right"', $sortfield, $sortorder); print "\n"; foreach($infoprod as $prodid => $vals) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 8c86f544dba..b03a8763770 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -33,6 +33,7 @@ */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_expression.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; @@ -88,7 +89,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_soc = ''; } @@ -759,12 +760,8 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; print ''; - $var=True; - for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { - $var = ! $var; - print ''; // Label of price @@ -1174,6 +1171,12 @@ if ($action == 'edit_price' && $object->getRights()->creer) } print ''; print ''; + + $parameters=array('colspan' => 2); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + + $parameters=array('colspan' => 2); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print '
      '.$langs->trans("MinPrice").'
      '; @@ -1244,11 +1247,8 @@ if ($action == 'edit_price' && $object->getRights()->creer) print ''; - $var = false; for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) { - $var = !$var; - print ''; print ''; print $form->textwithpicto($langs->trans('SellingPrice') . ' ' . $i, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); @@ -1389,13 +1389,12 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ $notfirstlineforlevel=array(); - $var = True; $i = 0; while ($i < $num) { $objp = $db->fetch_object($result); - $var = ! $var; - print ''; + + print ''; // Date print "" . dol_print_date($db->jdate($objp->dp), "dayhour") . ""; @@ -1440,7 +1439,9 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ print ''; } } + print '' . ($objp->price_base_type != 'TTC' ? price($objp->price_min) : '') . ''; + print '' . ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : '') . ''; // User @@ -1611,9 +1612,12 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print ''; print ''; + + dol_fiche_head(); + print ''; print ''; - print ''; + print ''; $staticsoc = new Societe($db); $staticsoc->fetch($prodcustprice->fk_soc); print ""; @@ -1625,7 +1629,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; // Price base - print ''; print ''; // Price - print ''; // Update all child soc - print ''; print '
      ' . $langs->trans('ThirdParty') . '' . $langs->trans('ThirdParty') . '" . $staticsoc->getNomUrl(1) . "
      '; + print '
      '; print $langs->trans('PriceBase'); print ''; @@ -1634,7 +1638,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '
      '; + print '
      '; $text = $langs->trans('SellingPrice'); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); print ''; @@ -1663,7 +1667,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '
      '; + print '
      '; print $langs->trans('ForceUpdateChildPriceSoc'); print ''; @@ -1673,7 +1677,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '
      '; - print '
      '; + dol_fiche_end(); + + print '
      '; print ''; print '     '; print ''; @@ -1683,7 +1689,10 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) } elseif ($action == 'showlog_customer_price') { - $filter = array('t.fk_product' => $object->id,'t.fk_soc' => GETPOST('socid', 'int')); + // List of all log of prices by customers + print ''."\n"; + + $filter = array('t.fk_product' => $object->id,'t.fk_soc' => GETPOST('socid', 'int')); // Count total nb of records $nbtotalofrecords = ''; @@ -1710,7 +1719,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) if (count($prodcustprice->lines) > 0) { - print '
      '; print ''; @@ -1723,31 +1731,53 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '' . $langs->trans("VATRate") . ''; print '' . $langs->trans("HT") . ''; print '' . $langs->trans("TTC") . ''; + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '' . $langs->trans("INCT") . ''; print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . ''; print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . ''; print '' . $langs->trans("ChangedBy") . ''; print ' '; print ''; - $var = True; - foreach ($prodcustprice->lines as $line) { - $var = ! $var; - print ''; - // Date - $staticsoc = new Societe($db); - $staticsoc->fetch($line->fk_soc); - - print "" . $staticsoc->getNomUrl(1) . ""; - print "" . dol_print_date($line->datec, "dayhour") . ""; + // Date + $staticsoc = new Societe($db); + $staticsoc->fetch($line->fk_soc); $tva_tx = $line->default_vat_code ? $line->tva_tx.' ('.$line->default_vat_code.')' : $line->tva_tx; - print '' . $langs->trans($line->price_base_type) . ""; + // Line for default price + if ($line->price_base_type=='HT') + { + $pu=$line->price; + } + else + { + $pu=$line->price_ttc; + } + + // Local tax is not saved into table of product. We use value linked to VAT code. + $localtaxarray=getLocalTaxesFromRate($line->tva_tx.($line->default_vat_code?' ('.$line->default_vat_code.')':''), 0, $staticsoc, $mysoc); + // Define part of HT, VAT, TTC + $resultarray=calcul_price_total(1, $pu, 0, $line->tva_tx, 1, 1, 0, $line->price_base_type, $line->recuperableonly, $object->type, $mysoc, $localtaxarray); + // Calcul du total ht sans remise + $total_ht = $resultarray[0]; + $total_vat = $resultarray[1]; + $total_localtax1 = $resultarray[9]; + $total_localtax2 = $resultarray[10]; + $total_ttc = $resultarray[2]; + + print ''; + + print "" . $staticsoc->getNomUrl(1) . ""; + print "" . dol_print_date($line->datec, "dayhour") . ""; + print '' . $langs->trans($line->price_base_type) . ""; print '' . vatrate($tva_tx, true, $line->recuperableonly) . ""; print '' . price($line->price) . ""; print '' . price($line->price_ttc) . ""; + + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '' . price($resultarray[2]) . ''; + print '' . price($line->price_min) . ''; print '' . price($line->price_min_ttc) . ''; @@ -1757,6 +1787,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print $userstatic->getLoginUrl(1); print ''; + print ''; } print ""; } else { @@ -1766,7 +1797,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) else if ($action != 'showlog_default_price' && $action != 'edit_price') { // List of all prices by customers - print ''."\n"; + print ''."\n"; // Count total nb of records $nbtotalofrecords = ''; @@ -1788,24 +1819,14 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - if (count($prodcustprice->lines) > 0 || $search_soc) { + $colspan=8; + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") $colspan++; + print ''; print ''; - print ''; + print ''; // Print the search button print ''; } - $var = False; - + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print ''; + print ''; + print ''; + print ''; + print ''; + print ''; // Line for default price + if ($object->price_base_type=='HT') + { + $pu=$object->price; + } + else + { + $pu=$object->price_ttc; + } + + // Local tax is not saved into table of product. We use value linked to VAT code. + $localtaxarray=getLocalTaxesFromRate($object->tva_tx.($object->default_vat_code?' ('.$object->default_vat_code.')':''), 0, $mysoc, $mysoc); + // Define part of HT, VAT, TTC + $resultarray=calcul_price_total(1, $pu, 0, $object->tva_tx, 1, 1, 0, $object->price_base_type, $object->recuperableonly, $object->type, $mysoc, $localtaxarray); + // Calcul du total ht sans remise + $total_ht = $resultarray[0]; + $total_vat = $resultarray[1]; + $total_localtax1 = $resultarray[9]; + $total_localtax2 = $resultarray[10]; + $total_ttc = $resultarray[2]; + print ''; print ""; print ""; @@ -1827,8 +1879,12 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print vatrate($object->tva_tx, true, $object->recuperableonly); print $object->default_vat_code?' ('.$object->default_vat_code.')':''; print ""; + print '"; print '"; + + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print ''; + print ''; print ''; print ''; - // Date $staticsoc = new Societe($db); $staticsoc->fetch($line->fk_soc); $tva_tx = $line->default_vat_code ? $line->tva_tx.' ('.$line->default_vat_code.')' : $line->tva_tx; + // Line for default price + if ($line->price_base_type=='HT') + { + $pu=$line->price; + } + else + { + $pu=$line->price_ttc; + } + + // Local tax is not saved into table of product. We use value linked to VAT code. + $localtaxarray=getLocalTaxesFromRate($line->tva_tx.($line->default_vat_code?' ('.$line->default_vat_code.')':''), 0, $staticsoc, $mysoc); + // Define part of HT, VAT, TTC + $resultarray=calcul_price_total(1, $pu, 0, $line->tva_tx, 1, 1, 0, $line->price_base_type, $line->recuperableonly, $object->type, $mysoc, $localtaxarray); + // Calcul du total ht sans remise + $total_ht = $resultarray[0]; + $total_vat = $resultarray[1]; + $total_localtax1 = $resultarray[9]; + $total_localtax2 = $resultarray[10]; + $total_ttc = $resultarray[2]; + + print ''; + print ""; print ""; @@ -1871,6 +1945,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '"; print '"; print '"; + + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print ''; + print ''; print ''; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index ffa0544976b..b61b9043d95 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -44,7 +44,7 @@ $sref=GETPOST("sref"); $snom=GETPOST("snom"); $sall=GETPOST('sall', 'alphanohtml'); $type=GETPOST("type","int"); -$sbarcode=GETPOST("sbarcode"); +$search_barcode=GETPOST("search_barcode"); $catid=GETPOST('catid','int'); $toolowstock=GETPOST('toolowstock'); $tosell = GETPOST("tosell"); @@ -86,7 +86,7 @@ if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $sref=""; $snom=""; @@ -135,7 +135,7 @@ if (dol_strlen($type)) } } if ($sref) $sql.= natural_search('p.ref', $ref); -if ($sbarcode) $sql.= natural_search('p.barcode', $sbarcode); +if ($search_barcode) $sql.= natural_search('p.barcode', $search_barcode); if ($snom) $sql.= natural_search('p.label', $snom); if (! empty($tosell)) $sql.= " AND p.tosell = ".$tosell; if (! empty($tobuy)) $sql.= " AND p.tobuy = ".$tobuy; @@ -200,7 +200,7 @@ if ($resql) { print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"").(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); } - + if (! empty($catid)) { print "
      "; @@ -210,7 +210,7 @@ if ($resql) print " > ".$ways[0]."
      \n"; print "

      "; } - + // Filter on categories $moreforfilter=''; if (! empty($conf->categorie->enabled)) @@ -220,11 +220,11 @@ if ($resql) $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ'); $moreforfilter.=''; } - + $moreforfilter.='
      '; $moreforfilter.=$langs->trans("StockTooLow").' '; $moreforfilter.='
      '; - + if (! empty($moreforfilter)) { print '
      '; @@ -234,7 +234,7 @@ if ($resql) print $hookmanager->resPrint; print '
      '; } - + $param=''; if ($tosell) $param.="&tosell=".$tosell; if ($tobuy) $param.="&tobuy=".$tobuy; @@ -242,17 +242,17 @@ if ($resql) if ($fourn_id) $param.="&fourn_id=".$fourn_id; if ($snom) $param.="&snom=".$snom; if ($sref) $param.="&sref=".$sref; - + $formProduct = new FormProduct($db); $formProduct->loadWarehouses(); $warehouses_list = $formProduct->cache_warehouses; $nb_warehouse = count($warehouses_list); $colspan_warehouse = 1; if (! empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) { $colspan_warehouse = $nb_warehouse > 1 ? $nb_warehouse+1 : 1; } - + print '
      '; print '
      ' . $langs->trans("ThirdParty") . '' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VATRate") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '' . $langs->trans("ChangedBy") . ' 
        '; $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -1814,10 +1835,41 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '
      ' . $langs->trans("ThirdParty") . '' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VATRate") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans("INCT") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '' . $langs->trans("ChangedBy") . ' 
      " . $langs->trans("Default") . "" . "' . price($object->price) . "' . price($object->price_ttc) . "' . price($resultarray[2]) . '' . price($object->price_min) . '' . price($object->price_min_ttc) . ''; @@ -1851,19 +1907,37 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) if (count($prodcustprice->lines) > 0) { - $var = false; foreach ($prodcustprice->lines as $line) { - $var = ! $var; - - print '
      " . $staticsoc->getNomUrl(1) . "" . dol_print_date($line->datec, "dayhour") . "' . vatrate($tva_tx, true, $line->recuperableonly) . "' . price($line->price) . "' . price($line->price_ttc) . "' . price($resultarray[2]) . '' . price($line->price_min) . '' . price($line->price_min_ttc) . '
      '; - + // Lignes des champs de filtre print ''; print '"; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); - if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("StockLimit"), $_SERVER["PHP_SELF"], "p.seuil_stock_alerte",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DesiredStock"), $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); + if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("StockLimit", $_SERVER["PHP_SELF"], "p.seuil_stock_alerte",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder); // Details per warehouse if (! empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context) { @@ -297,16 +297,16 @@ if ($resql) foreach($warehouses_list as &$wh) { print_liste_field_titre($wh['label'], '', '','','','align="right"'); } - + } } - if ($virtualdiffersfromphysical) print_liste_field_titre($langs->trans("VirtualStock"),$_SERVER["PHP_SELF"], "",$param,"",'align="right"',$sortfield,$sortorder); + if ($virtualdiffersfromphysical) print_liste_field_titre("VirtualStock",$_SERVER["PHP_SELF"], "",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); - print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre( $langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre( $langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; - + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); @@ -338,22 +338,22 @@ if ($resql) if ($objp->seuil_stock_alerte != '' && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' '; print $objp->stock_physique; print ''; - + // Details per warehouse if (! empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context) { if($nb_warehouse>1) { foreach($warehouses_list as &$wh) { - + print ''; } - } - } - - - + } + } + + + // Virtual stock if ($virtualdiffersfromphysical) { @@ -372,7 +372,7 @@ if ($resql) print "
      '; @@ -284,12 +284,12 @@ if ($resql) // Lignes des titres print "
      '; print empty($product->stock_warehouse[$wh['id']]->real) ? '0' : $product->stock_warehouse[$wh['id']]->real; print '
      "; print '
      '; - + print ''; $db->free($resql); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 1d45e93590c..cf4e889e89e 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -28,6 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; @@ -46,7 +47,7 @@ $sref=GETPOST("sref"); $snom=GETPOST("snom"); $sall=GETPOST('sall', 'alphanohtml'); $type=GETPOST("type","int"); -$sbarcode=GETPOST("sbarcode",'alpha'); +$search_barcode=GETPOST("search_barcode",'alpha'); $search_warehouse=GETPOST('search_warehouse','alpha'); $search_batch=GETPOST('search_batch','alpha'); $catid=GETPOST('catid','int'); @@ -83,7 +84,7 @@ if (! empty($canvas)) * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $sref=""; $snom=""; @@ -115,7 +116,7 @@ $sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desire $sql.= ' ps.fk_entrepot,'; $sql.= ' e.label as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,'; $sql.= ' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,'; -$sql.= ' pl.eatby, pl.sellby,'; +$sql.= ' pl.rowid as lotid, pl.eatby, pl.sellby,'; $sql.= ' SUM(pb.qty) as stock_physique, COUNT(pb.rowid) as nbinbatchtable'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as ps on p.rowid = ps.fk_product'; // Detail for each warehouse @@ -140,7 +141,7 @@ if (dol_strlen($type)) } } if ($sref) $sql.= natural_search("p.ref", $sref); -if ($sbarcode) $sql.= natural_search("p.barcode", $sbarcode); +if ($search_barcode) $sql.= natural_search("p.barcode", $search_barcode); if ($snom) $sql.= natural_search("p.label", $snom); if (! empty($tosell)) $sql.= " AND p.tosell = ".$tosell; if (! empty($tobuy)) $sql.= " AND p.tobuy = ".$tobuy; @@ -157,7 +158,7 @@ $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p. $sql.= " ps.fk_entrepot,"; $sql.= " e.label, e.lieu, e.fk_parent,"; $sql.= " pb.batch, pb.eatby, pb.sellby,"; -$sql.= " pl.eatby, pl.sellby"; +$sql.= " pl.rowid, pl.eatby, pl.sellby"; if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet $sql.= $db->order($sortfield,$sortorder); @@ -232,7 +233,7 @@ if ($resql) $moreforfilter.='
      '; } //$moreforfilter.=$langs->trans("StockTooLow").' '; - + if (! empty($moreforfilter)) { print '
      '; @@ -257,7 +258,7 @@ if ($resql) print '
      '; print ''; - + // Lignes des champs de filtre print ''; print '"; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); - if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Warehouse"), $_SERVER["PHP_SELF"], "e.label",$param,"",'',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("DesiredStock"), $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Batch"), $_SERVER["PHP_SELF"], "pb.batch",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EatByDate"), $_SERVER["PHP_SELF"], "pb.eatby",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("SellByDate"), $_SERVER["PHP_SELF"], "pb.sellby",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); + if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.label",$param,"",'',$sortfield,$sortorder); + //print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder); // TODO Add info of running suppliers/customers orders - //print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder); + //print_liste_field_titre("TheoreticalStock",$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); - print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre( $langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre( $langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; - + $product_static=new Product($db); + $product_lot_static=new Productlot($db); $warehousetmp=new Entrepot($db); while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - + // Multilangs if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active { @@ -335,20 +337,27 @@ if ($resql) $product_static->label = $objp->label; $product_static->type=$objp->fk_product_type; $product_static->entity=$objp->entity; - + + $product_lot_static->batch=$objp->batch; + $product_lot_static->product_id=$objp->rowid; + $product_lot_static->id=$objp->lotid; + $product_lot_static->eatby=$objp->eatby; + $product_lot_static->sellby=$objp->sellby; + + $warehousetmp->id=$objp->fk_entrepot; $warehousetmp->ref=$objp->warehouse_ref; $warehousetmp->label=$objp->warehouse_ref; $warehousetmp->fk_parent=$objp->warehouse_parent; print ''; - + // Ref print ''; - + // Label print ''; @@ -372,7 +381,15 @@ if ($resql) print $warehousetmp->getNomUrl(1); } print ''; - print ''; + + // Lot + print ''; + print ''; print ''; print '
      '; @@ -288,30 +289,31 @@ if ($resql) // Lignes des titres print "
      '; print $product_static->getNomUrl(1,'',16); //if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow")); print ''.$objp->label.''.$objp->batch.''; + if ($product_lot_static->batch) + { + print $product_lot_static->getNomUrl(1); + } + print ''.dol_print_date($db->jdate($objp->eatby), 'day').''.dol_print_date($db->jdate($objp->sellby), 'day').''; @@ -391,18 +408,6 @@ if ($resql) print ''; print ''; - if ($num > $conf->liste_limit) - { - if ($sref || $snom || $sall || GETPOST('search')) - { - print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, ''); - } - else - { - print_barre_liste('', $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"")."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, ''); - } - } - $db->free($resql); } diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 5d419cc880c..5a371554058 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -61,7 +61,7 @@ if (! $sortfield) $sortfield="c.date_commande"; $search_month = GETPOST('search_month', 'aplha'); $search_year = GETPOST('search_year', 'int'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) { +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) { $search_month=''; $search_year=''; } @@ -200,13 +200,13 @@ if ($id > 0 || ! empty($ref)) print '
      '; print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid","",$option,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$option,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$option,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"c.date_commande","",$option,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","",$option,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"c.total_ht","",$option,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"c.fk_statut","",$option,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"c.rowid","",$option,'',$sortfield,$sortorder); + print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","",$option,'',$sortfield,$sortorder); + print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client","",$option,'',$sortfield,$sortorder); + print_liste_field_titre("OrderDate",$_SERVER["PHP_SELF"],"c.date_commande","",$option,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Qty",$_SERVER["PHP_SELF"],"d.qty","",$option,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("AmountHT",$_SERVER["PHP_SELF"],"c.total_ht","",$option,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"c.fk_statut","",$option,'align="right"',$sortfield,$sortorder); print "\n"; if ($num > 0) diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index d63300a3a96..daf2a9c3654 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -67,7 +67,7 @@ if (! $sortfield) $search_month = GETPOST('search_month', 'aplha'); $search_year = GETPOST('search_year', 'int'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) { +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) { $search_month = ''; $search_year = ''; } @@ -210,13 +210,13 @@ if ($id > 0 || ! empty($ref)) { print '
      '; print '
      '; print ''; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid", "", $option, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("SupplierCode"), $_SERVER["PHP_SELF"], "s.code_client", "", $option, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("OrderDate"), $_SERVER["PHP_SELF"], "c.date_commande", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Qty"), $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("AmountHT"), $_SERVER["PHP_SELF"], "c.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "c.rowid", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("SupplierCode", $_SERVER["PHP_SELF"], "s.code_client", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("OrderDate", $_SERVER["PHP_SELF"], "c.date_commande", "", $option, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "c.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "c.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; if ($num > 0) { diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 1f85d25f9f3..f9eed565903 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -163,11 +163,11 @@ if ($id > 0 || ! empty($ref)) print '
      '; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid","","&id=".$product->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&id=".$product->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$product->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.date_contrat","","&id=".$product->id,'align="center"',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"c.amount","","&id=".$product->id,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"c.rowid","","&id=".$product->id,'',$sortfield,$sortorder); + print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","","&id=".$product->id,'',$sortfield,$sortorder); + print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client","","&id=".$product->id,'',$sortfield,$sortorder); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"c.date_contrat","","&id=".$product->id,'align="center"',$sortfield,$sortorder); + //print_liste_field_titre("AmountHT"),$_SERVER["PHP_SELF"],"c.amount","","&id=".$product->id,'align="right"',$sortfield,$sortorder); print_liste_field_titre($staticcontratligne->LibStatut(0,3),$_SERVER["PHP_SELF"],"",'','','width="16"',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre($staticcontratligne->LibStatut(4,3),$_SERVER["PHP_SELF"],"",'','','width="16"',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre($staticcontratligne->LibStatut(5,3),$_SERVER["PHP_SELF"],"",'','','width="16"',$sortfield,$sortorder,'maxwidthsearch '); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index aa3e10d82db..8cdc0efd5c0 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -62,7 +62,7 @@ if (! $sortfield) $sortfield="f.datef"; $search_month = GETPOST('search_month', 'aplha'); $search_year = GETPOST('search_year', 'int'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) { +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) { $search_month=''; $search_year=''; } @@ -145,7 +145,7 @@ if ($id > 0 || ! empty($ref)) elseif ($user->rights->facture->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; - $sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,"; + $sql.= " f.facnumber, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,"; $sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -223,13 +223,13 @@ if ($id > 0 || ! empty($ref)) print '
      '; print '
      '; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$option,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$option,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$option,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","",$option,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","",$option,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$option,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","",$option,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"s.rowid","",$option,'',$sortfield,$sortorder); + print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","",$option,'',$sortfield,$sortorder); + print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client","",$option,'',$sortfield,$sortorder); + print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","",$option,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("Qty",$_SERVER["PHP_SELF"],"d.qty","",$option,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("AmountHT",$_SERVER["PHP_SELF"],"f.total","",$option,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","",$option,'align="right"',$sortfield,$sortorder); print "\n"; if ($num > 0) @@ -239,21 +239,22 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($result); + $invoicestatic->id=$objp->facid; + $invoicestatic->ref=$objp->facnumber; + $societestatic->fetch($objp->socid); + $paiement = $invoicestatic->getSommePaiement(); print ''; print '\n"; - $societestatic->fetch($objp->socid); print ''; print "\n"; print '"; print '\n"; print '\n"; - print ''; + print ''; print "\n"; $i++; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index e9124cd003b..586741496c2 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -63,7 +63,7 @@ if (! $sortfield) $sortfield = "f.datef"; $search_month = GETPOST('search_month', 'aplha'); $search_year = GETPOST('search_year', 'int'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) { +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) { $search_month = ''; $search_year = ''; } @@ -202,13 +202,13 @@ if ($id > 0 || ! empty($ref)) print '
      '; print '
      '; - $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; print $invoicestatic->getNomUrl(1); print "'.$societestatic->getNomUrl(1).'".$objp->code_client."'; print dol_print_date($db->jdate($objp->datef),'day')."'.$objp->qty."'.price($objp->total_ht)."'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).''.$invoicestatic->LibStatut($objp->paye,$objp->statut,5,$paiement,$objp->type).'
      '; print ''; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "s.rowid", "", $option, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("SupplierCode"), $_SERVER["PHP_SELF"], "s.code_client", "", $option, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("DateInvoice"), $_SERVER["PHP_SELF"], "f.datef", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Qty"), $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("AmountHT"), $_SERVER["PHP_SELF"], "f.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "s.rowid", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("SupplierCode", $_SERVER["PHP_SELF"], "s.code_client", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", $option, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "f.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; if ($num > 0) diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index c5caf6c7c2c..a5801c422e0 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -61,7 +61,7 @@ if (! $sortfield) $sortfield = "p.datep"; $search_month = GETPOST('search_month', 'aplha'); $search_year = GETPOST('search_year', 'int'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) { +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) { $search_month = ''; $search_year = ''; } @@ -204,12 +204,12 @@ if ($id > 0 || ! empty($ref)) print '
      '; print '
      '; print ''; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.rowid", "", $option, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("DatePropal"), $_SERVER["PHP_SELF"], "p.datep", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Qty"), $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("AmountHT"), $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.rowid", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("DatePropal", $_SERVER["PHP_SELF"], "p.datep", "", $option, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; if ($num > 0) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index db8a6736688..c95e805c3f5 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -39,7 +39,7 @@ $langs->load("companies"); $langs->load("categories"); $action=GETPOST('action','aZ09'); -$cancel=GETPOST('cancel'); +$cancel=GETPOST('cancel','alpha'); $confirm=GETPOST('confirm'); $sortfield = GETPOST("sortfield",'alpha'); @@ -48,7 +48,7 @@ $id = GETPOST("id",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="DESC"; -$backtopage=GETPOST("backtopage"); +$backtopage=GETPOST('backtopage','alpha'); // Security check $result=restrictedArea($user,'stock'); @@ -429,13 +429,13 @@ else print '
      '; print ""; - print_liste_field_titre($langs->trans("Product"),"", "p.ref","&id=".$id,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),"", "p.label","&id=".$id,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Units"),"", "ps.reel","&id=".$id,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AverageUnitPricePMPShort"),"", "p.pmp","&id=".$id,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EstimatedStockValueShort"),"", "","&id=".$id,"",'align="right"',$sortfield,$sortorder); - if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellPriceMin"),"", "p.price","&id=".$id,"",'align="right"',$sortfield,$sortorder); - if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("EstimatedStockValueSellShort"),"", "","&id=".$id,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Product","", "p.ref","&id=".$id,"","",$sortfield,$sortorder); + print_liste_field_titre("Label","", "p.label","&id=".$id,"","",$sortfield,$sortorder); + print_liste_field_titre("Units","", "ps.reel","&id=".$id,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("AverageUnitPricePMPShort","", "p.pmp","&id=".$id,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("EstimatedStockValueShort","", "","&id=".$id,"",'align="right"',$sortfield,$sortorder); + if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre("SellPriceMin","", "p.price","&id=".$id,"",'align="right"',$sortfield,$sortorder); + if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre("EstimatedStockValueSellShort","", "","&id=".$id,"",'align="right"',$sortfield,$sortorder); if ($user->rights->stock->mouvement->creer) print_liste_field_titre(''); if ($user->rights->stock->creer) print_liste_field_titre(''); print "\n"; diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index f28f3fd00d3..78ea81bd41d 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -43,12 +43,12 @@ class Productlot extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'product_lot'; - + public $picto='barcode'; - + public $isnolinkedbythird = 1; public $ismultientitymanaged = 1; - + /** * @var ProductlotLine[] Lines */ @@ -56,7 +56,7 @@ class Productlot extends CommonObject /** */ - + public $entity; public $fk_product; public $batch; @@ -70,7 +70,7 @@ class Productlot extends CommonObject /** */ - + /** * Constructor @@ -97,7 +97,7 @@ class Productlot extends CommonObject $error = 0; // Clean parameters - + if (isset($this->entity)) { $this->entity = trim($this->entity); } @@ -117,7 +117,7 @@ class Productlot extends CommonObject $this->import_key = trim($this->import_key); } - + // Check parameters // Put here code to add control on parameters values @@ -207,7 +207,7 @@ class Productlot extends CommonObject $sql .= " t.import_key"; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; if ($product_id > 0 && $batch != '') { - $sql .= ' WHERE t.batch = ' . '\'' . $this->db->escape($batch) . '\' AND t.fk_product = ' . $product_id; + $sql .= " WHERE t.batch = '". $this->db->escape($batch) . "' AND t.fk_product = " . $product_id; } else { $sql .= ' WHERE t.rowid = ' . $id; } @@ -221,9 +221,9 @@ class Productlot extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; //$this->ref = $obj->fk_product.'_'.$obj->batch; - + $this->batch = $obj->batch; - + $this->entity = $obj->entity; $this->fk_product = $obj->fk_product; $this->eatby = $this->db->jdate($obj->eatby); @@ -239,7 +239,7 @@ class Productlot extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - $this->fetch_optionals($this->id,$extralabels); + $this->fetch_optionals($this->id,$extralabels); } $this->db->free($resql); @@ -271,7 +271,7 @@ class Productlot extends CommonObject dol_syslog(__METHOD__, LOG_DEBUG); // Clean parameters - + if (isset($this->entity)) { $this->entity = trim($this->entity); } @@ -437,8 +437,8 @@ class Productlot extends CommonObject return - 1; } } - - + + /** * Return label of status of object * @@ -449,7 +449,7 @@ class Productlot extends CommonObject { return $this->LibStatut(0,$mode); } - + /** * Return label of a given status * @@ -460,13 +460,13 @@ class Productlot extends CommonObject function LibStatut($statut,$mode=0) { global $langs; - + //$langs->load('stocks'); return ''; } - - + + /** * Return a link to the a lot card (with optionaly the picto) * Use this->id,this->lastname, this->firstname @@ -498,7 +498,7 @@ class Productlot extends CommonObject { $label.= '
      ' . $langs->trans('SellByDate') . ': ' . dol_print_date($this->sellby, 'day'); } - + $link = 'batch . $linkend; return $result; } - - - /** + + + /** * Initialise object with example values * Id must be 0 if object instance is a specimen * @@ -523,7 +523,7 @@ class Productlot extends CommonObject public function initAsSpecimen() { $this->id = 0; - + $this->entity = ''; $this->fk_product = ''; $this->batch = ''; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index d3de2b6b6e5..d740a2a9d73 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -65,7 +65,7 @@ $fieldstosearchall = array( include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { $search_ref=""; $sall=""; @@ -129,22 +129,22 @@ if ($result) if ($search_label) $param.="&search_label=".$search_label; if ($search_status) $param.="&search_status=".$search_status; if ($sall) $param.="&sall=".$sall; - + print '
      '; print ''; print ''; print ''; print ''; print ''; - + print_barre_liste($langs->trans("ListOfWarehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_generic.png', 0, '', '', $limit); - + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + $moreforfilter=''; print '
      '; @@ -174,14 +174,14 @@ if ($result) print ''; print ''; - + print '
      '; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LocationSummary"),$_SERVER["PHP_SELF"], "e.lieu","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stockqty",'',$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EstimatedStockValue"), $_SERVER["PHP_SELF"], "estimatedvalue",'',$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EstimatedStockValueSell"), $_SERVER["PHP_SELF"], "",'',$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "e.statut",'',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("LocationSummary",$_SERVER["PHP_SELF"], "e.lieu","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stockqty",'',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "estimatedvalue",'',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "",'',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"], "e.statut",'',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -192,12 +192,12 @@ if ($result) while ($i < min($num,$limit)) { $objp = $db->fetch_object($result); - + $warehouse->id = $objp->rowid; $warehouse->label = $objp->ref; $warehouse->lieu = $objp->lieu; $warehouse->fk_parent = $objp->fk_parent; - + print ''; print ''; // Location @@ -225,7 +225,7 @@ if ($result) print "\n"; - + $i++; } @@ -253,7 +253,7 @@ if ($result) print "
      ' . $warehouse->getNomUrl(1) . '
      "; print "
      "; - + print ''; } else diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 2ab78ac735d..1ca2b1b16d1 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -328,9 +328,9 @@ llxHeader('', $title); print load_fiche_titre($langs->trans("MassStockTransferShort")); $titletoadd=$langs->trans("Select"); -$titletoaddnoent=$langs->transnoentitiesnoconv("Select"); $buttonrecord=$langs->trans("RecordMovement"); -$buttonrecordnoent=$langs->trans("RecordMovement"); +$titletoaddnoent=$langs->transnoentitiesnoconv("Select"); +$buttonrecordnoent=$langs->transnoentitiesnoconv("RecordMovement"); print $langs->trans("SelectProductInAndOutWareHouse",$titletoaddnoent,$buttonrecordnoent).'
      '; print '
      '."\n"; @@ -402,7 +402,7 @@ print ''; foreach($listofdata as $key => $val) { - + $productstatic->fetch($val['id_product']); $warehousestatics->fetch($val['id_sw']); @@ -444,7 +444,7 @@ print ''; print ''; // Button to record mass movement -$codemove=GETPOST('codemove'); +$codemove=(isset($_POST["codemove"])?GETPOST("codemove",'alpha'):dol_print_date(dol_now(),'%y%m%d%H%M%S')); $labelmovement=GETPOST("label")?GETPOST('label'):$langs->trans("StockTransfer").' '.dol_print_date($now,'%Y-%m-%d %H:%M'); print ''; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 23df5282435..4b878c03260 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -51,7 +51,7 @@ $id=GETPOST('id','int'); $msid=GETPOST('msid','int'); $product_id=GETPOST("product_id"); $action=GETPOST('action','aZ09'); -$cancel=GETPOST('cancel'); +$cancel=GETPOST('cancel','alpha'); $idproduct = GETPOST('idproduct','int'); $year = GETPOST("year"); $month = GETPOST("month"); @@ -112,8 +112,8 @@ $object = new MouvementStock($db); // To be passed as parameter of executeHooks * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -122,7 +122,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { $year=''; $month=''; @@ -465,8 +465,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -649,12 +650,12 @@ if ($resql) if ($user->rights->stock->mouvement->creer) { - print ''.$langs->trans("StockCorrection").''; + print ''.$langs->trans("CorrectStock").''; } if ($user->rights->stock->mouvement->creer) { - print ''.$langs->trans("StockTransfer").''; + print ''.$langs->trans("TransferStock").''; } print '
      '; @@ -756,20 +757,20 @@ if ($resql) { // Product Ref print ''; } if (! empty($arrayfields['p.label']['checked'])) { // Product label print ''; } // Batch if (! empty($arrayfields['m.batch']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['pl.eatby']['checked'])) { @@ -878,12 +879,12 @@ if ($resql) if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['e.label']['checked'])) print_liste_field_titre($arrayfields['e.label']['label'],$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible + if (! empty($arrayfields['e.label']['checked'])) print_liste_field_titre($arrayfields['e.label']['label'],$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['origin']['checked'])) print_liste_field_titre($arrayfields['origin']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['m.value']['checked'])) print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['m.value']['checked'])) print_liste_field_titre($arrayfields['m.value']['label'],$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -894,7 +895,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 4d1eed9d5e1..01df409361c 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -32,6 +32,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; @@ -50,15 +51,15 @@ $langs->load("stocks"); $langs->load("sendings"); if (! empty($conf->productbatch->enabled)) $langs->load("productbatch"); -$backtopage=GETPOST('backtopage'); +$backtopage=GETPOST('backtopage','alpha'); $action=GETPOST('action','aZ09'); -$cancel=GETPOST('cancel'); +$cancel=GETPOST('cancel','alpha'); $id=GETPOST('id', 'int'); $ref=GETPOST('ref', 'alpha'); $stocklimit = GETPOST('seuil_stock_alerte'); $desiredstock = GETPOST('desiredstock'); -$cancel = GETPOST('cancel'); +$cancel = GETPOST('cancel','alpha'); $fieldid = isset($_GET["ref"])?'ref':'rowid'; $d_eatby=dol_mktime(0, 0, 0, $_POST['eatbymonth'], $_POST['eatbyday'], $_POST['eatbyyear']); $d_sellby=dol_mktime(0, 0, 0, $_POST['sellbymonth'], $_POST['sellbyday'], $_POST['sellbyyear']); @@ -614,7 +615,7 @@ if ($id > 0 || $ref) } // Stock alert threshold - print ''; @@ -655,7 +656,7 @@ if ($id > 0 || $ref) { if ($found) $helpondiff.='
      '; else $found=1; $helpondiff.=$langs->trans("ProductQtyInCustomersOrdersRunning").': '.$object->stats_commande['qty']; - $result=$object->load_stats_commande(0,'0'); + $result=$object->load_stats_commande(0,'0', 1); if ($result < 0) dol_print_error($db,$object->error); $helpondiff.=' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; } @@ -664,7 +665,7 @@ if ($id > 0 || $ref) if (! empty($conf->expedition->enabled)) { if ($found) $helpondiff.='
      '; else $found=1; - $result=$object->load_stats_sending(0,'2'); + $result=$object->load_stats_sending(0,'2', 1); $helpondiff.=$langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty']; } @@ -672,9 +673,9 @@ if ($id > 0 || $ref) if (! empty($conf->fournisseur->enabled)) { if ($found) $helpondiff.='
      '; else $found=1; - $result=$object->load_stats_commande_fournisseur(0,'3,4'); + $result=$object->load_stats_commande_fournisseur(0,'3,4', 1); $helpondiff.=$langs->trans("ProductQtyInSuppliersOrdersRunning").': '.$object->stats_commande_fournisseur['qty']; - $result=$object->load_stats_commande_fournisseur(0,'0,1,2'); + $result=$object->load_stats_commande_fournisseur(0,'0,1,2', 1); if ($result < 0) dol_print_error($db,$object->error); $helpondiff.=' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')'; } @@ -769,13 +770,13 @@ if (empty($reshook)) if ($user->rights->stock->mouvement->creer) { - print ''.$langs->trans("StockCorrection").''; + print ''.$langs->trans("CorrectStock").''; } //if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch()) if ($user->rights->stock->mouvement->creer) { - print ''.$langs->trans("StockTransfer").''; + print ''.$langs->trans("TransferStock").''; } print ''; @@ -823,6 +824,8 @@ $sql.= " AND ps.fk_product = ".$object->id; $sql.= " ORDER BY e.label"; $entrepotstatic=new Entrepot($db); +$product_lot_static=new Productlot($db); + $total=0; $totalvalue=$totalvaluesell=0; @@ -867,6 +870,11 @@ if ($resql) if ($details<0) dol_print_error($db); foreach ($details as $pdluo) { + $product_lot_static->id = $pdluo->lotid; + $product_lot_static->batch = $pdluo->batch; + $product_lot_static->eatby = $pdluo->eatby; + $product_lot_static->sellby = $pdluo->sellby; + if ($action == 'editline' && GETPOST('lineid','int') == $pdluo->id) { //Current line edit print "\n".''; @@ -891,12 +899,14 @@ if ($resql) { print "\n".''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index e26dfdba905..70d907ae5e9 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -45,7 +45,7 @@ $langs->load("productbatch"); // Get parameters $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); -$backtopage = GETPOST('backtopage'); +$backtopage = GETPOST('backtopage','alpha'); $batch = GETPOST('batch','alpha'); $productid = GETPOST('productid','int'); $ref = GETPOST('ref','alpha'); // ref is productid_batch @@ -150,7 +150,7 @@ if (empty($reshook)) // Action to add record if ($action == 'add') { - if (GETPOST('cancel')) + if (GETPOST('cancel','alpha')) { $urltogo=$backtopage?$backtopage:dol_buildpath('/stock/list.php',1); header("Location: ".$urltogo); @@ -198,10 +198,10 @@ if (empty($reshook)) } // Cancel - if ($action == 'update' && GETPOST('cancel')) $action='view'; + if ($action == 'update' && GETPOST('cancel','alpha')) $action='view'; // Action to update record - if ($action == 'update' && ! GETPOST('cancel')) + if ($action == 'update' && ! GETPOST('cancel','alpha')) { $error=0; @@ -284,7 +284,6 @@ if ($action == 'create') print '
      '; - print ''; + print ''; print ''; - print ''; + print ''; print '
      '.$form->editfieldkey("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; + print '
      '.$form->editfieldkey($form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1),'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; print $form->editfieldval("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer,'string'); print '
      '; print img_picto($langs->trans("Tranfer"),'uparrow','class="hideonsmartphone"').' '; - print 'id.'">'.$langs->trans("StockTransfer").''; + print 'id.'">'.$langs->trans("TransferStock").''; // Disabled, because edition of stock content must use the "Correct stock menu". // Do not use this, or data will be wrong (bad tracking of movement label, inventory code, ... //print 'id.'#'.$pdluo->id.'">'; //print img_edit().''.$pdluo->batch.''; + print $product_lot_static->getNomUrl(1); + print ''. dol_print_date($pdluo->eatby,'day') .''. dol_print_date($pdluo->sellby,'day') .''.$pdluo->qty.($pdluo->qty<0?' '.img_warning():'').'
      '."\n"; // print ''; // - print ''; print ''; print ''; print ''; @@ -309,7 +308,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //print load_fiche_titre($langs->trans("Batch")); $head = productlot_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("Batch"), 0, 'barcode'); + dol_fiche_head($head, 'card', $langs->trans("Batch"), -1, 'barcode'); if ($action == 'delete') { diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index ef4a9bf70c9..567d60911ae 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -45,7 +45,7 @@ $langs->load("users"); // Get parameters $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); -$backtopage = GETPOST('backtopage'); +$backtopage = GETPOST('backtopage','alpha'); $myparam = GETPOST('myparam','alpha'); @@ -132,8 +132,8 @@ if (($id > 0 || ! empty($ref)) && $action != 'add') * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -142,7 +142,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_entity=''; $search_product=''; @@ -244,8 +244,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -425,7 +426,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -435,7 +436,7 @@ if ($resql) print $hookmanager->resPrint; if (! empty($arrayfields['t.datec']['checked'])) print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'],$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - //if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder); + //if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($arrayfields['t.status']['label'],$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print ''."\n"; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 59856e35d55..55fe5908c7f 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -92,7 +92,7 @@ if ($mode == 'virtual') $usevirtualstock=1; * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter") || isset($_POST['valid'])) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') || isset($_POST['valid'])) // Both test are required to be compatible with all browsers { $sref = ''; $snom = ''; @@ -487,8 +487,8 @@ $param .= '&fk_supplier=' . $fk_supplier; $param .= '&fk_entrepot=' . $fk_entrepot; $stocklabel = $langs->trans('Stock'); -if ($usevirtualstock == 1) $stocklabel = $langs->trans('VirtualStock'); -if ($usevirtualstock == 0) $stocklabel = $langs->trans('PhysicalStock'); +if ($usevirtualstock == 1) $stocklabel = 'VirtualStock'; +if ($usevirtualstock == 0) $stocklabel = 'PhysicalStock'; print ''. ''. @@ -521,15 +521,15 @@ print ''; // Lines of title print ''; print_liste_field_titre('', $_SERVER["PHP_SELF"], ''); -print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('Label'), $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder); -if (!empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans('Duration'), $_SERVER["PHP_SELF"], 'p.duration', $param, '', 'align="center"', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('DesiredStock'), $_SERVER["PHP_SELF"], 'p.desiredstock', $param, '', 'align="right"', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('StockLimitShort'), $_SERVER["PHP_SELF"], 'p.seuil_stock_alerte', $param, '', 'align="right"', $sortfield, $sortorder); +print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder); +print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder); +if (!empty($conf->service->enabled) && $type == 1) print_liste_field_titre('Duration', $_SERVER["PHP_SELF"], 'p.duration', $param, '', 'align="center"', $sortfield, $sortorder); +print_liste_field_titre('DesiredStock', $_SERVER["PHP_SELF"], 'p.desiredstock', $param, '', 'align="right"', $sortfield, $sortorder); +print_liste_field_titre('StockLimitShort', $_SERVER["PHP_SELF"], 'p.seuil_stock_alerte', $param, '', 'align="right"', $sortfield, $sortorder); print_liste_field_titre($stocklabel, $_SERVER["PHP_SELF"], 'stock_physique', $param, '', 'align="right"', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('Ordered'), $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('StockToBuy'), $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); -print_liste_field_titre($langs->trans('SupplierRef'), $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); +print_liste_field_titre('Ordered', $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); +print_liste_field_titre('StockToBuy', $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); +print_liste_field_titre('SupplierRef', $_SERVER["PHP_SELF"], '', $param, '', 'align="right"', $sortfield, $sortorder); print "\n"; $prod = new Product($db); @@ -579,7 +579,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) }else { $result=$prod->load_stats_commande_fournisseur(0,'1,2,3,4'); } - + $result=$prod->load_stats_reception(0,'4'); //print $prod->stats_commande_fournisseur['qty'].'
      '."\n"; diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index d190c4d704d..694f9cae1ad 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -63,7 +63,7 @@ $offset = $limit * $page; * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { $sall=""; $sref=""; @@ -186,7 +186,7 @@ if ($resql) print ''; print_liste_field_titre( - $langs->trans('Ref'), + 'Ref', $_SERVER['PHP_SELF'], 'cf.ref', '', @@ -196,7 +196,7 @@ if ($resql) $sortorder ); print_liste_field_titre( - $langs->trans('Company'), + 'Company', $_SERVER['PHP_SELF'], 's.nom', '', @@ -206,7 +206,7 @@ if ($resql) $sortorder ); print_liste_field_titre( - $langs->trans('Author'), + 'Author', $_SERVER['PHP_SELF'], 'u.login', '', @@ -216,7 +216,7 @@ if ($resql) $sortorder ); print_liste_field_titre( - $langs->trans('AmountTTC'), + 'AmountTTC', $_SERVER['PHP_SELF'], 'cf.total_ttc', '', @@ -226,7 +226,7 @@ if ($resql) $sortorder ); print_liste_field_titre( - $langs->trans('OrderCreation'), + 'OrderCreation', $_SERVER['PHP_SELF'], 'cf.date_creation', '', @@ -236,7 +236,7 @@ if ($resql) $sortorder ); print_liste_field_titre( - $langs->trans('Status'), + 'Status', $_SERVER['PHP_SELF'], 'cf.fk_statut', '', @@ -246,7 +246,7 @@ if ($resql) $sortorder ); print ''; - + $userstatic = new User($db); while ($i < min($num,$conf->liste_limit)) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 28fd3dfadea..4242121177c 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -15,7 +15,7 @@ * along with this program. If not, see . * * $object must be defined - * $backtopage + * $backtopage */ ?> @@ -50,7 +50,7 @@ print ''."\n"; dol_fiche_head(); - + print ''; print ''; print ''; @@ -93,12 +93,12 @@ print ''; print ''; + print ''; } print ''; // Serial / Eat-by date - if (! empty($conf->productbatch->enabled) && + if (! empty($conf->productbatch->enabled) && (($object->element == 'product' && $object->hasbatch()) || ($object->element == 'stock')) ) @@ -127,19 +127,19 @@ print ''; - print ''; + print ''; print ''; print '
      '.$langs->trans("Label").'
      '.$langs->trans("Fieldentity").'
      '.$langs->trans("Fieldfk_product").'
      '.$langs->trans("Fieldbatch").'
      '.$langs->trans("Fieldfk_user_creat").'
      '.$langs->trans('Project').''; $formproject->select_projects(); - print '
      '; print ''; print ''.$langs->trans("InventoryCode").''.$langs->trans("InventoryCode").'
      '; dol_fiche_end(); - + print '
      '; print ''; print '     '; print ''; print '
      '; - + print ''; ?> diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index ed367742f1c..6d028da5663 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -25,9 +25,9 @@ if ($object->element == 'product') $productref = $object->ref; $langs->load("productbatch"); - + if (empty($id)) $id = $object->id; - + $pdluoid=GETPOST('pdluoid','int'); $pdluo = new Productbatch($db); @@ -48,9 +48,9 @@ print load_fiche_titre($langs->trans("StockTransfer"),'','title_generic.png'); print '
      '."\n"; - + dol_fiche_head(); - + print ''; print ''; print ''; @@ -76,7 +76,7 @@ print $form->select_produits(GETPOST('product_id'),'product_id',(empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':'')); print ''; } - + print ''.$langs->trans("WarehouseTarget").''; print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1); print ''; @@ -84,7 +84,7 @@ print ''; // Serial / Eat-by date - if (! empty($conf->productbatch->enabled) && + if (! empty($conf->productbatch->enabled) && (($object->element == 'product' && $object->hasbatch()) || ($object->element == 'stock')) ) @@ -103,7 +103,7 @@ } print ''; print ''; - + print ''; print ''.$langs->trans("EatByDate").''; print $form->select_date(($d_eatby?$d_eatby:$pdluo->eatby),'eatby','','',1,"", 1, 0, 1, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled @@ -121,13 +121,13 @@ print ''; print ''; print ''; - print ''.$langs->trans("InventoryCode").''; + print ''.$langs->trans("InventoryCode").''; print ''; print ''; dol_fiche_end(); - + print '
      '; print ''; print '     '; diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 40e3060cfee..a1d68394bb0 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -87,11 +87,11 @@ if ($result) print ''; print ""; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "e.label","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LocationSummary"), $_SERVER["PHP_SELF"], "e.lieu","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EstimatedStockValue"), $_SERVER["PHP_SELF"], "e.valo_pmp",'','','align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EstimatedStockValueSell"), $_SERVER["PHP_SELF"], "",'','','align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "e.statut",'','','align="right"',$sortfield,$sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.label","","","",$sortfield,$sortorder); + print_liste_field_titre("LocationSummary", $_SERVER["PHP_SELF"], "e.lieu","","","",$sortfield,$sortorder); + print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "e.valo_pmp",'','','align="right"',$sortfield,$sortorder); + print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "",'','','align="right"',$sortfield,$sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "e.statut",'','','align="right"',$sortfield,$sortorder); print "\n"; if ($num) @@ -120,7 +120,7 @@ if ($result) print "\n"; $total += price2num($objp->estimatedvalue,'MU'); $totalsell += price2num($objp->sellvalue,'MU'); - + $i++; } @@ -134,7 +134,7 @@ if ($result) } $db->free($result); - + print "
      "; print '
      '; diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 7bea4bf3213..8418561aa30 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -29,7 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +$search_project_user = GETPOST('search_project_user','int'); +$mine = GETPOST('mode','aZ09')=='mine' ? 1 : 0; +if ($search_project_user == $user->id) $mine = 1; // Security check $socid=0; @@ -73,7 +75,7 @@ $morehtml=''; $morehtml.=''; $morehtml.=''; $morehtml.=''; @@ -98,7 +100,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele { $listofsearchfields['search_task']=array('text'=>'Task'); } - + if (count($listofsearchfields)) { print ''; @@ -114,7 +116,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; $i++; } - print ''; + print ''; print ''; print '
      '; } @@ -148,7 +150,7 @@ if ( $resql ) while ($row = $db->fetch_object($resql)) { - + print ''; print ''; $projectstatic->id=$row->rowid; @@ -205,7 +207,7 @@ if ( $resql ) while ($row = $db->fetch_object($resql)) { - + print ''; print ''; $projectstatic->id=$row->rowid; @@ -237,14 +239,14 @@ print ""; if ($db->type != 'pgsql') { print '
      '; - + // Affichage de la liste des projets de la semaine print ''; print ''; print ''; print ''; print "\n"; - + $sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " , ".MAIN_DB_PREFIX."projet_task as t"; @@ -256,16 +258,16 @@ if ($db->type != 'pgsql') $sql.= " AND task_date >= '".$db->idate(dol_get_first_day($year, $month)).'" AND ..."; $sql.= " AND p.rowid in (".$projectsListId.")"; $sql.= " GROUP BY p.rowid, p.ref, p.title"; - + $resql = $db->query($sql); if ( $resql ) { $total = 0; $var=true; - + while ($row = $db->fetch_object($resql)) { - + print ''; print '\n"; $total += $row->nb; } - + $db->free($resql); } else @@ -302,7 +304,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) print ''; print ''; print "\n"; - + $sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; @@ -314,12 +316,12 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) $sql.= " AND task_date BETWEEN '".$db->idate(dol_get_first_day($year, $month))."' AND '".$db->idate(dol_get_last_day($year, $month))."'"; $sql.= " AND p.rowid in (".$projectsListId.")"; $sql.= " GROUP BY p.rowid, p.ref, p.title, p.public"; - + $resql = $db->query($sql); if ( $resql ) { $var=false; - + while ($row = $db->fetch_object($resql)) { print ''; @@ -331,7 +333,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) print ''; print ''; print "\n"; - + } $db->free($resql); } @@ -383,7 +385,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR)) print ''; print ''; print "\n"; - + } $db->free($resql); } @@ -430,12 +432,12 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S } else dol_print_error($db); if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0]='0'; // To avoid sql syntax error if not found - + // Tasks for all resources of all opened projects and time spent for each task/resource // This list can be very long, so we don't show it by default on task area. We prefer to use the list page. // Add constant PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA to show this list - + $max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA); $sql = "SELECT p.ref, p.title, p.rowid as projectid, p.fk_statut as status, p.fk_opp_status as opp_status, p.public, p.dateo as projdateo, p.datee as projdatee,"; @@ -489,7 +491,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S while ($i < $num && $i < $max) { $obj = $db->fetch_object($resql); - + $username=''; if ($obj->userid && $userstatic->id != $obj->userid) // We have a user and it is not last loaded user @@ -509,7 +511,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S $projectstatic->public = $obj->public; $projectstatic->dateo = $db->jdate($obj->projdateo); $projectstatic->datee = $db->jdate($obj->projdatee); - + print $projectstatic->getNomUrl(1,'',0,'','
      '); print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) @@ -536,7 +538,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S $taskstatic->datee = $db->jdate($obj->datee); print ''; print ''; print '"; @@ -653,7 +653,7 @@ foreach ($dirmodels as $reldir) else { print ""; } @@ -665,7 +665,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -804,7 +804,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) if (in_array($name, $def)) { print ""; @@ -812,7 +812,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) else { print ""; } @@ -824,7 +824,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -918,6 +918,15 @@ print ''; print ''; print ''; +print ''; +print ''; + +print ''; +print ''; +print ''; + print '
      '.$langs->trans("ActivityOnProjectThisWeek").''.$langs->trans("Time").'
      '; $projectstatic->id=$row->rowid; @@ -278,7 +280,7 @@ if ($db->type != 'pgsql') print "
      '.$langs->trans("ActivityOnProjectThisMonth").': '.dol_print_date($now,"%B %Y").''.$langs->trans("Time").'
      '.convertSecondToTime($row->nb, 'allhourmin').'
      '.convertSecondToTime($row->nb, 'allhourmin').'
      '.dol_print_date($db->jdate($obj->dateo),'day').''.dol_print_date($db->jdate($obj->datee),'day'); - print dol_print_date($obj->date_end,'dayhour'); + print dol_print_date($obj->date_end,'dayhour'); if ($taskstatic->hasDelay()) print img_warning($langs->trans("Late")); print ''; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 9cda69560d5..4dff34ad30b 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -64,6 +64,7 @@ $day=GETPOST('reday')?GETPOST('reday'):(GETPOST("day","int")?GETPOST("day","int" $day = (int) $day; $week=GETPOST("week","int")?GETPOST("week","int"):date("W"); +$search_categ=GETPOST("search_categ",'alpha'); $search_usertoprocessid=GETPOST('search_usertoprocessid', 'int'); $search_task_ref=GETPOST('search_task_ref', 'alpha'); $search_task_label=GETPOST('search_task_label', 'alpha'); @@ -81,13 +82,18 @@ else if ($year && $month && $day) $daytoparse=dol_mktime(0, 0, 0, $month, $day, if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id) { $usertoprocess=$user; + $search_usertoprocessid=$usertoprocess->id; } -else +elseif (search_usertoprocessid > 0) { $usertoprocess=new User($db); $usertoprocess->fetch($search_usertoprocessid); + $search_usertoprocessid=$usertoprocess->id; +} +else +{ + $usertoprocess=new User($db); } -$search_usertoprocessid=$usertoprocess->id; $object=new Task($db); @@ -97,16 +103,17 @@ $object=new Task($db); */ // Purge criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $action = ''; + $search_categ=''; $search_usertoprocessid = ''; $search_task_ref = ''; $search_task_label = ''; $search_project_ref = ''; $search_thirdparty = ''; } -if (GETPOST("button_search_x") || GETPOST("button_search.x") || GETPOST("button_search")) +if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha')) { $action = ''; } @@ -200,22 +207,25 @@ if ($action == 'addtime' && $user->rights->projet->lire) { $timespent_duration=array(); - foreach($_POST as $key => $time) + if (is_array($_POST)) { - if (intval($time) > 0) + foreach($_POST as $key => $time) { - // Hours or minutes of duration - if (preg_match("/([0-9]+)duration(hour|min)/",$key,$matches)) + if (intval($time) > 0) { - $id = $matches[1]; - if ($id > 0) - { - // We store HOURS in seconds - if($matches[2]=='hour') $timespent_duration[$id] += $time*60*60; + // Hours or minutes of duration + if (preg_match("/([0-9]+)duration(hour|min)/",$key,$matches)) + { + $id = $matches[1]; + if ($id > 0) + { + // We store HOURS in seconds + if($matches[2]=='hour') $timespent_duration[$id] += $time*60*60; - // We store MINUTES in seconds - if($matches[2]=='min') $timespent_duration[$id] += $time*60; - } + // We store MINUTES in seconds + if($matches[2]=='min') $timespent_duration[$id] += $time*60; + } + } } } } @@ -300,9 +310,9 @@ $next_month = $next['mon']; $next_day = $next['mday']; $title=$langs->trans("TimeSpent"); -if ($mine) $title=$langs->trans("MyTimeSpent"); +if ($mine || ($usertoprocess->id == $user->id)) $title=$langs->trans("MyTimeSpent"); -$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertoprocess,0,1); // Return all project i have permission on. I want my tasks and some of my task may be on a public projet that is not my project +$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertoprocess,(empty($usertoprocess->id)?2:0),1); // Return all project i have permission on. I want my tasks and some of my task may be on a public projet that is not my project if ($id) { @@ -315,7 +325,7 @@ $morewherefilter=''; if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search("t.label", $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); -$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter); // We want to see all task of opened project i am allowed to see, not only mine. Later only mine will be editable later. +$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. $projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, 0, ($project->id?$project->id:0), 0, $onlyopenedproject); $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($project->id?$project->id:0), 0, $onlyopenedproject); //var_dump($tasksarray); @@ -331,6 +341,9 @@ $param=''; $param.=($mode?'&mode='.$mode:''); $param.=($search_project_ref?'&search_project_ref='.$search_project_ref:''); $param.=($search_userassignedid > 0?'&search_userassignedid='.$search_usertoprocessid:''); +$param.=($search_thirdparty?'&search_thirdparty='.$search_thirdparty:''); +$param.=($search_task_ref?'&search_task_ref='.$search_task_ref:''); +$param.=($search_task_label?'&search_task_label='.$search_task_label:''); // Show navigation bar $nav =''.img_previous($langs->trans("Previous"))."\n"; @@ -357,13 +370,16 @@ dol_fiche_head($head, 'inputperday', '', -1, 'task'); // Show description of content print '
      '; -if ($mine) print $langs->trans("MyTasksDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; +if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; else { - if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; - else print $langs->trans("ProjectsPublicTaskDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; + if (empty($usertoprocess->id) || $usertoprocess->id < 0) + { + if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; + else print $langs->trans("ProjectsPublicTaskDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; + } } -if ($mine) +if ($mine || ($usertoprocess->id == $user->id)) { print $langs->trans("OnlyYourTaskAreVisible").'
      '; } @@ -391,19 +407,45 @@ print '
      '; print '
      '; +$moreforfilter=''; + +// Filter on categories +/*if (! empty($conf->categorie->enabled)) +{ + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
      '; + $moreforfilter.=$langs->trans('ProjectCategories'). ': '; + $moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 1, 'maxwidth300'); + $moreforfilter.='
      '; +}*/ + +// If the user can view user other than himself +$moreforfilter.='
      '; +$moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': '; +$includeonly='hierachyme'; +if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); +$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter.='
      '; + +if (! empty($moreforfilter)) +{ + print '
      '; + print $moreforfilter; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
      '; +} + + print '
      '; print ''."\n"; print ''; -print ''; -print ''; -print ''; print ''; if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) print ''; +print ''; +print ''; print ''; print ''; print ''; @@ -419,14 +461,13 @@ print ''; print "\n"; print ''; -print ''; -print ''; -print ''; print ''; if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) { print ''; } +print ''; +print ''; print ''; print ''; /*print ''; @@ -451,7 +492,7 @@ if (count($tasksarray) > 0) } else { - print ''; + print ''; } print "
      '; -$usersettoshow='hierarchyme'; -if ($user->rights->projet->all->lire) $usersettoshow=''; -print $form->select_dolusers($usertoprocess->id, 'search_usertoprocessid', 0, null, 0, $usersettoshow, 0, 0, 0, 1, '', 0, '', 'maxwidth150'); -print '
      '.$langs->trans("User").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("ProjectRef").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").'
      '.$langs->trans("NoTasks").'
      '.$langs->trans("NoTasks").'
      "; print '
      '; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 4a2156430af..6ea60f3d76f 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -65,6 +65,7 @@ $day=GETPOST('reday')?GETPOST('reday','int'):(GETPOST("day")?GETPOST("day","int" $day = (int) $day; $week=GETPOST("week","int")?GETPOST("week","int"):date("W"); +$search_categ=GETPOST("search_categ",'alpha'); $search_usertoprocessid=GETPOST('search_usertoprocessid', 'int'); $search_task_ref=GETPOST('search_task_ref', 'alpha'); $search_task_label=GETPOST('search_task_label', 'alpha'); @@ -94,13 +95,18 @@ $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd'); if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id) { $usertoprocess=$user; + $search_usertoprocessid=$usertoprocess->id; } -else +elseif (search_usertoprocessid > 0) { $usertoprocess=new User($db); $usertoprocess->fetch($search_usertoprocessid); + $search_usertoprocessid=$usertoprocess->id; +} +else +{ + $usertoprocess=new User($db); } -$search_usertoprocessid=$usertoprocess->id; $object=new Task($db); @@ -110,16 +116,17 @@ $object=new Task($db); */ // Purge criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $action = ''; + $search_categ=''; $search_usertoprocessid = ''; $search_task_ref = ''; $search_task_label = ''; $search_project_ref = ''; $search_thirdparty = ''; } -if (GETPOST("button_search_x") || GETPOST("button_search.x") || GETPOST("button_search")) +if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha')) { $action = ''; } @@ -298,9 +305,9 @@ $taskstatic = new Task($db); $thirdpartystatic = new Societe($db); $title=$langs->trans("TimeSpent"); -if ($mine) $title=$langs->trans("MyTimeSpent"); +if ($mine || $usertoprocess->id == $user->id) $title=$langs->trans("MyTimeSpent"); -$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertoprocess,0,1); // Return all project i have permission on (assigned to me+public). I want my tasks and some of my task may be on a public projet that is not my project +$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertoprocess,(empty($usertoprocess->id)?2:0),1); // Return all project i have permission on (assigned to me+public). I want my tasks and some of my task may be on a public projet that is not my project //var_dump($projectsListId); if ($id) { @@ -313,7 +320,8 @@ $morewherefilter=''; if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search("t.label", $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); -$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter); // We want to see all task of opened project i am allowed to see, not only mine. Later only mine will be editable later. + +$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. $projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, 0, ($project->id?$project->id:0), 0, $onlyopenedproject); $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($project->id?$project->id:0), 0, $onlyopenedproject); //var_dump($tasksarray); @@ -329,6 +337,9 @@ $param=''; $param.=($mode?'&mode='.$mode:''); $param.=($search_project_ref?'&search_project_ref='.$search_project_ref:''); $param.=($search_usertoprocessid > 0?'&search_usertoprocessid='.$search_usertoprocessid:''); +$param.=($search_thirdparty?'&search_thirdparty='.$search_thirdparty:''); +$param.=($search_task_ref?'&search_task_ref='.$search_task_ref:''); +$param.=($search_task_label?'&search_task_label='.$search_task_label:''); // Show navigation bar $nav =''.img_previous($langs->trans("Previous"))."\n"; @@ -353,13 +364,16 @@ dol_fiche_head($head, 'inputperweek', '', -1, 'task'); // Show description of content print '
      '; -if ($mine) print $langs->trans("MyTasksDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; +if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; else { - if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; - else print $langs->trans("ProjectsPublicTaskDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; + if (empty($usertoprocess->id) || $usertoprocess->id < 0) + { + if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; + else print $langs->trans("ProjectsPublicTaskDesc").($onlyopenedproject?' '.$langs->trans("OnlyOpenedProject"):'').'
      '; + } } -if ($mine) +if ($mine || ($usertoprocess->id == $user->id)) { print $langs->trans("OnlyYourTaskAreVisible").'
      '; } @@ -387,19 +401,46 @@ print '
      '; print '
      '; +$moreforfilter=''; + +// Filter on categories +/* +if (! empty($conf->categorie->enabled)) +{ + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
      '; + $moreforfilter.=$langs->trans('ProjectCategories'). ': '; + $moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 1, 'maxwidth300'); + $moreforfilter.='
      '; +}*/ + +// If the user can view user other than himself +$moreforfilter.='
      '; +$moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': '; +$includeonly='hierachyme'; +if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); +$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter.='
      '; + +if (! empty($moreforfilter)) +{ + print '
      '; + print $moreforfilter; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
      '; +} + + print '
      '; print ''."\n"; print ''; -print ''; -print ''; -print ''; print ''; if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) print ''; +print ''; +print ''; print ''; print ''; print ''; @@ -416,14 +457,13 @@ print ''; print "\n"; print ''; -print ''; -print ''; -print ''; print ''; if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) { print ''; } +print ''; +print ''; print ''; print ''; /*print ''; @@ -453,7 +493,7 @@ if (count($tasksarray) > 0) $level=0; projectLinesPerWeek($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask); - $colspan=8; + $colspan=7; if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) $colspan++; print ' @@ -470,7 +510,7 @@ if (count($tasksarray) > 0) } else { - print ''; + print ''; } print "
      '; -$usersettoshow='hierarchyme'; -if ($user->rights->projet->all->lire) $usersettoshow=''; -print $form->select_dolusers($usertoprocess->id, 'search_usertoprocessid', 0, null, 0, $usersettoshow, 0, 0, 0, 1, '', 0, '', 'maxwidth150'); -print '
      '.$langs->trans("User").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("ProjectRef").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").'
      '.$langs->trans("NoTasks").'
      '.$langs->trans("NoTasks").'
      "; print '
      '; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 9e35ea77e0b..0c0da27457e 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -43,7 +43,7 @@ if (!$user->admin) accessforbidden(); $value = GETPOST('value','alpha'); $action = GETPOST('action','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='project'; @@ -645,7 +645,7 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print "
      \n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print " 
      '.$langs->trans("AllowCommentOnTask").''; +echo ajax_constantonoff('PROJECT_ALLOW_COMMENT_ON_TASK'); +print ' 
      '; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 7b0b448ef59..085af055f38 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -339,10 +339,10 @@ if (empty($reshook)) if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); $outputlangs = $langs; - if (GETPOST('lang_id')) + if (GETPOST('lang_id','aZ09')) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang(GETPOST('lang_id')); + $outputlangs->setDefaultLang(GETPOST('lang_id','aZ09')); } $result= $object->generateDocument($object->modelpdf, $outputlangs); if ($result <= 0) @@ -553,7 +553,7 @@ if ($action == 'create' && $user->rights->projet->creer) $array=array(); if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject"); if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject"); - print $form->selectarray('public',$array,GETPOST('public')?GETPOST('public'):(isset($conf->global->PROJECT_DEFAULT_PUBLIC)?$conf->global->PROJECT_DEFAULT_PUBLIC:$object->public)); + print $form->selectarray('public',$array,GETPOST('public')?GETPOST('public'):$object->public); print ''; // Date start @@ -1198,6 +1198,10 @@ elseif ($object->id > 0) print '
      '; + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, 'project', $socid, 1, '', 10); print '
      '; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b22ea32f646..af55063c66a 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -971,6 +971,7 @@ class Project extends CommonObject $label .= ($label?'
      ':'').'' . $langs->trans('DateEnd') . ': ' . dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto if ($moreinpopup) $label.='
      '.$moreinpopup; + $url=''; if ($option != 'nolink') { if (preg_match('/\.php$/',$option)) { @@ -991,7 +992,7 @@ class Project extends CommonObject } $linkclose=''; - if (empty($notooltip) && $user->rights->propal->lire) + if (empty($notooltip) && $user->rights->projet->lire) { if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { @@ -1000,6 +1001,17 @@ class Project extends CommonObject } $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.=' class="classfortooltip"'; + + if (! is_object($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('projectdao')); + $parameters=array('id'=>$this->id); + // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); + if ($reshook > 0) + $linkclose = $hookmanager->resPrint; } $picto = 'projectpub'; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 17d1b5fcf45..10a78e017c8 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -35,7 +35,7 @@ class Task extends CommonObject public $table_element='projet_task'; //!< Name of table without prefix where object is stored public $fk_element='fk_task'; public $picto = 'task'; - protected $childtables=array('projet_task_time'); // To test if we can delete object + protected $childtables=array('projet_task_time','projet_task_comment'); // To test if we can delete object var $fk_task_parent; var $label; @@ -70,6 +70,8 @@ class Task extends CommonObject var $timespent_fk_user; var $timespent_note; + var $comments = array(); + public $oldcopy; @@ -257,8 +259,12 @@ class Task extends CommonObject $this->db->free($resql); - if ($num_rows) return 1; - else return 0; + if ($num_rows) { + $this->fetchComments(); + return 1; + }else { + return 0; + } } else { @@ -295,7 +301,7 @@ class Task extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET"; $sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").","; - $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"'".$this->id."'").","; + $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"'".$this->db->escape($this->id)."'").","; $sql.= " fk_task_parent=".(isset($this->fk_task_parent)?$this->fk_task_parent:"null").","; $sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; @@ -1245,7 +1251,7 @@ class Task extends CommonObject $newDuration = $this->timespent_duration - $this->timespent_old_duration; $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; - $sql.= " SET duration_effective = (SELECT SUM(task_duration) FROM ".MAIN_DB_PREFIX."projet_task_time as ptt where ptt.fk_task = ".$this->id.")"; + $sql.= " SET duration_effective = (SELECT SUM(task_duration) FROM ".MAIN_DB_PREFIX."projet_task_time as ptt where ptt.fk_task = ".$this->db->escape($this->id).")"; $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); @@ -1297,7 +1303,7 @@ class Task extends CommonObject if (! $error) { $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; - $sql.= " SET duration_effective = duration_effective - '".$this->timespent_duration."'"; + $sql.= " SET duration_effective = duration_effective - ".$this->db->escape($this->timespent_duration?$this->timespent_duration:0); $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::delTimeSpent", LOG_DEBUG); @@ -1777,4 +1783,332 @@ class Task extends CommonObject return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay))); } + + /** + * Return nb comments already posted + * + * @return int + */ + public function getNbComments() + { + return count($this->comments); + } + + /** + * Load comments linked with current task + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchComments() + { + $this->comments = array(); + $sql = "SELECT"; + $sql.= " c.rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_comment as c"; + $sql.= " WHERE c.fk_task = ".$this->id; + $sql.= " ORDER BY c.tms DESC"; + + dol_syslog(get_class($this)."::fetchComments", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $num_rows = $this->db->num_rows($resql); + if ($num_rows > 0) + { + while($obj = $this->db->fetch_object($resql)) + { + $comment = new TaskComment($this->db); + $comment->fetch($obj->rowid); + $this->comments[] = $comment; + } + return $num_rows; + }else{ + return 0; + } + } + else + { + $this->error="Error ".$this->db->lasterror(); + return -1; + } + } } + +/** + * Class to manage tasks + */ +class TaskComment extends CommonObject +{ + public $element='project_task_comment'; //!< Id that identify managed objects + public $table_element='projet_task_comment'; //!< Name of table without prefix where object is stored + public $fk_element='fk_task'; + public $picto = 'task'; + + var $fk_task; + + var $description; + + var $tms; + + var $datec; + + var $fk_user; + + var $entity; + + var $import_key; + + public $oldcopy; + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + } + + + /** + * Create into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + function create($user, $notrigger=0) + { + global $conf, $langs; + + $error=0; + + // Insert request + $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_comment ("; + $sql.= "description"; + $sql.= ", datec"; + $sql.= ", fk_task"; + $sql.= ", fk_user"; + $sql.= ", entity"; + $sql.= ", import_key"; + $sql.= ") VALUES ("; + $sql.= "'".$this->db->escape($this->description)."'"; + $sql.= ", ".($this->datec!=''?"'".$this->db->idate($this->datec)."'":'null'); + $sql.= ", '".(isset($this->fk_task)?$this->fk_task:"null")."'"; + $sql.= ", '".(isset($this->fk_user)?$this->fk_user:"null")."'"; + $sql.= ", ".(!empty($this->entity)?$this->entity:'1'); + $sql.= ", ".(!empty($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null"); + $sql.= ")"; + + //var_dump($this->db); + //echo $sql; + + $this->db->begin(); + + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + + if (! $error) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task_comment"); + + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('TASK_COMMENT_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return $this->id; + } + } + + + /** + * Load object in memory from database + * + * @param int $id Id object + * @param int $ref ref object + * @return int <0 if KO, 0 if not found, >0 if OK + */ + function fetch($id, $ref='') + { + global $langs; + + $sql = "SELECT"; + $sql.= " c.rowid,"; + $sql.= " c.description,"; + $sql.= " c.datec,"; + $sql.= " c.tms,"; + $sql.= " c.fk_task,"; + $sql.= " c.fk_user,"; + $sql.= " c.entity,"; + $sql.= " c.import_key"; + $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_comment as c"; + $sql.= " WHERE c.rowid = ".$id; + + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $num_rows = $this->db->num_rows($resql); + + if ($num_rows) + { + $obj = $this->db->fetch_object($resql); + + $this->id = $obj->rowid; + $this->description = $obj->description; + $this->datec = $this->db->jdate($obj->datec); + $this->tms = $obj->tms; + $this->fk_user = $obj->fk_user; + $this->fk_task = $obj->fk_task; + $this->entity = $obj->entity; + $this->import_key = $obj->import_key; + } + + $this->db->free($resql); + + if ($num_rows) return 1; + else return 0; + } + else + { + $this->error="Error ".$this->db->lasterror(); + return -1; + } + } + + + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <=0 if KO, >0 if OK + */ + function update(User $user, $notrigger=0) + { + global $conf, $langs; + $error=0; + + // Clean parameters + if (isset($this->fk_task)) $this->fk_project=(int) trim($this->fk_task); + if (isset($this->fk_user)) $this->fk_user=(int) trim($this->fk_user); + if (isset($this->description)) $this->description=trim($this->description); + + + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_comment SET"; + $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; + $sql.= " datec=".($this->datec!=''?"'".$this->db->idate($this->datec)."'":'null').","; + $sql.= " fk_task=".(isset($this->fk_task)?$this->fk_task:"null").","; + $sql.= " fk_user=".(isset($this->fk_user)?$this->fk_user:"null").","; + $sql.= " entity=".(!empty($this->entity)?$this->entity:'1').","; + $sql.= " import_key=".(!empty($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null"); + $sql.= " WHERE rowid=".$this->id; + + $this->db->begin(); + + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + + if (! $error) + { + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('TASK_COMMENT_MODIFY',$user); + if ($result < 0) { $error++; } + // End call triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } + + + /** + * Delete task from database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + function delete($user, $notrigger=0) + { + global $conf, $langs; + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + + $error=0; + + $this->db->begin(); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_comment"; + $sql.= " WHERE rowid=".$this->id; + + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + + if (! $error) + { + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('TASK_COMMENT_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + }else{ + $this->db->commit(); + return 1; + } + } +} \ No newline at end of file diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 93e15f2fe77..1e4d4132944 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -51,6 +51,7 @@ if (! empty($conf->don->enabled)) require_once DOL_DOCUMENT_ROOT.'/don/class/d if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; $langs->load("projects"); $langs->load("companies"); @@ -336,7 +337,7 @@ $listofreferent=array( 'table'=>'fichinter', 'datefieldname'=>'date_valid', 'disableamount'=>0, - 'margin'=>'minus', + 'margin'=>'minus', 'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid, 'lang'=>'interventions', 'buttonnew'=>'AddIntervention', @@ -417,9 +418,9 @@ $listofreferent=array( 'lang'=>'compta', 'buttonnew'=>'AddSocialContribution', 'testnew'=>$user->rights->tax->charges->lire, - 'test'=>$conf->tax->enabled && $user->rights->tax->charges->lire), + 'test'=>$conf->tax->enabled && $user->rights->tax->charges->lire), 'project_task'=>array( - 'name'=>"TaskTimeValorised", + 'name'=>"TaskTimeSpent", 'title'=>"ListTaskTimeUserProject", 'class'=>'Task', 'margin'=>'minus', @@ -439,6 +440,19 @@ $listofreferent=array( 'datefieldname'=>'datem', 'disableamount'=>0, 'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))), +'variouspayment'=>array( + 'name'=>"VariousPayments", + 'title'=>"ListVariousPaymentsAssociatedProject", + 'class'=>'PaymentVarious', + 'table'=>'payment_various', + 'datefieldname'=>'datev', + 'margin'=>'minus', + 'disableamount'=>0, + 'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'lang'=>'banks', + 'buttonnew'=>'AddVariousPayment', + 'testnew'=>$user->rights->banque->modifier, + 'test'=>$conf->banque->enabled && $user->rights->banque->lire), /* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( 'name'=>"Agenda", @@ -573,7 +587,7 @@ foreach ($listofreferent as $key => $value) if ($tablename != 'expensereport_det' && method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty(); if ($tablename == 'don' || $tablename == 'chargesociales') $total_ht_by_line=$element->amount; elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty); - else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount(); + else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount(); elseif ($tablename == 'projet_task') { if ($idofelementuser) @@ -598,7 +612,7 @@ foreach ($listofreferent as $key => $value) if ($qualifiedfortotal) $total_ht = $total_ht + $total_ht_by_line; if ($tablename == 'don' || $tablename == 'chargesociales') $total_ttc_by_line=$element->amount; - else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount(); + else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty); elseif ($tablename == 'projet_task') { @@ -629,7 +643,7 @@ foreach ($listofreferent as $key => $value) $total_ttc = -$total_ttc; } - switch ($classname) { + /*switch ($classname) { case 'FactureFournisseur': $newclassname = 'SupplierInvoice'; break; @@ -653,12 +667,12 @@ foreach ($listofreferent as $key => $value) break; default: $newclassname = $classname; - } + }*/ $var = ! $var; print ''; // Module - print ''.$langs->trans($newclassname).''; + print ''.$name.''; // Nb print ''.$i.''; // Amount HT @@ -711,13 +725,13 @@ foreach ($listofreferent as $key => $value) $idtofilterthirdparty=0; $array_of_element_linkable_with_different_thirdparty = array('facture_fourn', 'commande_fournisseur'); - if (! in_array($tablename, $array_of_element_linkable_with_different_thirdparty)) + if (! in_array($tablename, $array_of_element_linkable_with_different_thirdparty)) { $idtofilterthirdparty=$object->thirdparty->id; if (! empty($conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS)) $idtofilterthirdparty.=','.$conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS; } - if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty) + if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, array('payment_various'))) { $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300'); if (! $selectList || ($selectList<0)) @@ -769,6 +783,7 @@ foreach ($listofreferent as $key => $value) // Thirdparty or user print ''; if (in_array($tablename, array('projet_task')) && $key == 'project_task') print ''; // if $key == 'project_task', we don't want details per user + elseif (in_array($tablename, array('payment_various'))) print ''; // if $key == 'payment_various', we don't have any thirdparty elseif (in_array($tablename, array('expensereport_det','don','projet_task','stock_mouvement'))) print $langs->trans("User"); else print $langs->trans("ThirdParty"); print ''; @@ -854,7 +869,7 @@ foreach ($listofreferent as $key => $value) print '' . img_picto($langs->trans('Unlink'), 'editdelete') . ''; } print "\n"; - + // Ref print ''; if ($tablename == 'expensereport_det') @@ -898,7 +913,8 @@ foreach ($listofreferent as $key => $value) $date=''; $total_time_by_line = null; if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines elseif ($tablename == 'stock_mouvement') $date = $element->datem; - if ($tablename == 'chargesociales') $date = $element->date_ech; + elseif ($tablename == 'payment_various') $date = $element->datev; + elseif ($tablename == 'chargesociales') $date = $element->date_ech; elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status)) { if ($tablename == 'don') $date = $element->datedon; @@ -909,7 +925,7 @@ foreach ($listofreferent as $key => $value) elseif ($tablename == 'supplier_proposal') $date=$element->date_validation; // There is no other date for this elseif ($tablename == 'fichinter') $date=$element->datev; // There is no other date for this elseif ($tablename == 'projet_task') $date=''; // We show no date. Showing date of beginning of task make user think it is date of time consumed - else + else { $date=$element->date; // invoice, ... if (empty($date)) $date=$element->date_contrat; @@ -922,7 +938,7 @@ foreach ($listofreferent as $key => $value) print dol_print_date($element->datep,'dayhour'); if ($element->datef && $element->datef > $element->datep) print " - ".dol_print_date($element->datef,'dayhour'); } - else if (in_array($tablename, array('projet_task'))) + else if (in_array($tablename, array('projet_task'))) { $tmpprojtime = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty print ''; @@ -963,7 +979,7 @@ foreach ($listofreferent as $key => $value) { $total_ht_by_line=null; $othermessage=''; - if ($tablename == 'don' || $tablename == 'chargesociales') $total_ht_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ht_by_line=$element->amount; else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty); elseif (in_array($tablename, array('projet_task'))) @@ -1004,7 +1020,7 @@ foreach ($listofreferent as $key => $value) if (empty($value['disableamount'])) { $total_ttc_by_line=null; - if ($tablename == 'don' || $tablename == 'chargesociales') $total_ttc_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ttc_by_line=$element->amount; else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty); elseif ($tablename == 'projet_task') @@ -1018,7 +1034,7 @@ foreach ($listofreferent as $key => $value) else { $othermessage=$form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); - } + } } else { @@ -1074,8 +1090,8 @@ foreach ($listofreferent as $key => $value) $total_ht_by_third += $total_ht_by_line; $total_ttc_by_third += $total_ttc_by_line; - - $total_time = $total_time + $total_time_by_line; + + $total_time = $total_time + $total_time_by_line; } if (canApplySubtotalOn($tablename)) @@ -1115,7 +1131,7 @@ foreach ($listofreferent as $key => $value) //if (empty($value['disableamount']) && ! in_array($tablename, array('projet_task'))) print ''.$langs->trans("TotalHT").' : '.price($total_ht).''; //elseif (empty($value['disableamount']) && in_array($tablename, array('projet_task'))) print ''.$langs->trans("Total").' : '.price($total_ht).''; print ''; - if (empty($value['disableamount'])) + if (empty($value['disableamount'])) { if ($tablename != 'projet_task' || ! empty($conf->salaries->enabled)) print ''.$langs->trans("TotalHT").' : '.price($total_ht); } @@ -1123,7 +1139,7 @@ foreach ($listofreferent as $key => $value) //if (empty($value['disableamount']) && ! in_array($tablename, array('projet_task'))) print ''.$langs->trans("TotalTTC").' : '.price($total_ttc).''; //elseif (empty($value['disableamount']) && in_array($tablename, array('projet_task'))) print ''; print ''; - if (empty($value['disableamount'])) + if (empty($value['disableamount'])) { if ($tablename != 'projet_task' || ! empty($conf->salaries->enabled)) print $langs->trans("TotalTTC").' : '.price($total_ttc); } diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 7ec9dcf1a4b..16f719a3a8f 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -98,12 +98,12 @@ if ($id > 0 || ! empty($ref)) $param=($mode=='mine'?'&mode=mine':''); - + // Project card - + $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
      '; // Title $morehtmlref.=$object->title; @@ -113,29 +113,29 @@ if ($id > 0 || ! empty($ref)) $morehtmlref.='
      '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref.='
      '; - + // Define a complementary filter for search of next/prev ref. if (! $user->rights->projet->all->lire) { $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
      '; print '
      '; print '
      '; - + print ''; - + // Visibility print ''; - + // Date start - end print ''; - + // Budget print ''; - + // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - + print '
      '.$langs->trans("Visibility").''; if ($object->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print '
      '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; $start = dol_print_date($object->date_start,'dayhour'); @@ -145,45 +145,45 @@ if ($id > 0 || ! empty($ref)) print ($end?$end:'?'); if ($object->hasDelay()) print img_warning("Late"); print '
      '.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,1,0,0,$conf->currency); print '
      '; - + print '
      '; print '
      '; print '
      '; print '
      '; - + print ''; - + // Description print ''; - + // Categories if($conf->categorie->enabled) { print '"; } - + print '
      '.$langs->trans("Description").''; print nl2br($object->description); print '
      '.$langs->trans("Categories").''; print $form->showCategories($object->id,'project',1); print "
      '; - + print '
      '; print '
      '; print '
      '; - + print '
      '; - + dol_fiche_end(); } @@ -307,9 +307,14 @@ if (count($tasksarray)>0) $dateformatinput2="%m/%d/%Y"; // How the date for data are formated //var_dump($dateformatinput); //var_dump($dateformatinput2); + + print '
      '; + print '
      '."\n"; include_once DOL_DOCUMENT_ROOT.'/projet/ganttchart.inc.php'; print '
      '."\n"; + + print '
      '; } else { diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index c7f0181dbf5..2188d4bd6a4 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -33,8 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->load("projects"); $langs->load("companies"); -$mine = GETPOST('mode','aZ09')=='mine' ? 1 : 0; $search_project_user = GETPOST('search_project_user','int'); +$mine = GETPOST('mode','aZ09')=='mine' ? 1 : 0; +if ($search_project_user == $user->id) $mine = 1; // Security check $socid=0; @@ -122,7 +123,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele { $listofsearchfields['search_project']=array('text'=>'Project'); } - + if (count($listofsearchfields)) { print '
      '; @@ -138,7 +139,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; $i++; } - print ''; + print ''; print '
      '; print '
      '; } @@ -160,8 +161,8 @@ print '
      '; print ''; print ''; -print_liste_field_titre($langs->trans("OpenedProjectsByThirdparties"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("NbOfProjects"),"","","","",'align="right"',$sortfield,$sortorder); +print_liste_field_titre("OpenedProjectsByThirdparties",$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder); +print_liste_field_titre("NbOfProjects","","","","",'align="right"',$sortfield,$sortorder); print "\n"; $sql = "SELECT COUNT(p.rowid) as nb, SUM(p.opp_amount)"; @@ -185,7 +186,7 @@ if ( $resql ) while ($i < $num) { $obj = $db->fetch_object($resql); - + print ''; print ''; if (! empty($arrayfields['p.ref']['checked'])) { print ''; } if (! empty($arrayfields['p.title']['checked'])) { print ''; } if (! empty($arrayfields['s.nom']['checked'])) { print ''; } // Sale representative @@ -511,8 +518,8 @@ if (! empty($arrayfields['commercial']['checked'])) if (! empty($arrayfields['p.dateo']['checked'])) { print ''; } @@ -520,8 +527,8 @@ if (! empty($arrayfields['p.dateo']['checked'])) if (! empty($arrayfields['p.datee']['checked'])) { print ''; } @@ -634,7 +641,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 41ae6d28364..41413645906 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,7 +39,7 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $taskref = GETPOST('taskref', 'alpha'); $backtopage=GETPOST('backtopage','alpha'); -$cancel=GETPOST('cancel'); +$cancel=GETPOST('cancel','alpha'); $search_user_id = GETPOST('search_user_id', 'int'); @@ -70,7 +70,9 @@ $hookmanager->initHooks(array('projecttaskcard','globalcard')); $progress=GETPOST('progress', 'int'); $label=GETPOST('label', 'alpha'); $description=GETPOST('description'); -$planned_workload=GETPOST('planned_workloadhour')*3600+GETPOST('planned_workloadmin')*60; +$planned_workloadhour=(GETPOST('planned_workloadhour','int')?GETPOST('planned_workloadhour','int'):0); +$planned_workloadmin=(GETPOST('planned_workloadmin','int')?GETPOST('planned_workloadmin','int'):0); +$planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60; $userAccess=0; @@ -81,7 +83,7 @@ $userAccess=0; */ // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_user_id=""; $toselect=''; @@ -494,6 +496,7 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } + print '
      '; print '
      '; if ($obj->socid) @@ -217,9 +218,9 @@ if (! empty($conf->global->PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA)) { // This list can be very long, so we don't show it by default on task area. We prefer to use the list page. // Add constant PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA to show this list - + print '
      '; - + print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 1, $listofoppstatus, array()); } diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 05c31287745..3c21d9e0ced 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -78,7 +78,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $actioncode=''; $search_agenda_label=''; @@ -184,7 +184,7 @@ if (!empty($object->id)) // List of actions on element /*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'project',0);*/ + $somethingshown = $formactions->showactions($object,'project',0);*/ // List of todo actions //show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 9c78387f95b..657e6d610d3 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -148,8 +148,8 @@ $object = new Project($db); * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -161,7 +161,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_all=''; $search_categ=''; @@ -261,8 +261,8 @@ if ($search_project_user > 0) } $sql.= " WHERE p.entity IN (".getEntity('project').')'; if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users -// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser -if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; +// No need to check if company is external user, as filtering of projects must be done by getProjectsAuthorizedForUser +if ($socid > 0) $sql.= " AND (p.fk_soc = ".$socid.")"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$db->escape($search_categ); if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_ref) $sql .= natural_search('p.ref', $search_ref); @@ -323,8 +323,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -371,6 +372,7 @@ llxHeader("", $title, $help_url); $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if ($search_all != '') $param.='&search_all='.$search_all; if ($search_sday) $param.='&search_sday='.$search_sday; if ($search_smonth) $param.='&search_smonth='.$search_smonth; if ($search_syear) $param.='&search_syear=' .$search_syear; @@ -378,7 +380,6 @@ if ($search_eday) $param.='&search_eday='.$search_eday; if ($search_emonth) $param.='&search_emonth='.$search_emonth; if ($search_eyear) $param.='&search_eyear=' .$search_eyear; if ($socid) $param.='&socid='.$socid; -if ($search_all != '') $param.='&search_all='.$search_all; if ($search_ref != '') $param.='&search_ref='.$search_ref; if ($search_label != '') $param.='&search_label='.$search_label; if ($search_societe != '') $param.='&search_societe='.$search_societe; @@ -451,7 +452,7 @@ if (! empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter.='
      '; $moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': '; -$includeonly=''; +$includeonly='hierachyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_project_user?$search_project_user:'', 'search_project_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
      '; @@ -487,19 +488,25 @@ print '
      '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + if ($socid > 0) + { + $tmpthirdparty=new Societe($db); + $tmpthirdparty->fetch($socid); + $search_societe=$tmpthirdparty->nom; + } + print ''; print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($search_syear?$search_syear:-1,'search_syear',1, 20, 5); print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($search_eyear?$search_eyear:-1,'search_eyear',1, 20, 5); print '
      '; if (count($tasksarray) > 0) @@ -536,6 +539,7 @@ else if ($id > 0 || ! empty($ref)) } print "
      "; + print '
      '; print ''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php new file mode 100644 index 00000000000..3ee3cf2593b --- /dev/null +++ b/htdocs/projet/tasks/comment.php @@ -0,0 +1,413 @@ + + * Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2010-2012 Regis Houssin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/projet/tasks/task.php + * \ingroup project + * \brief Page of a project task + */ + +require ("../../main.inc.php"); +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + +$langs->load("projects"); +$langs->load("companies"); + +$id=GETPOST('id','int'); +$idcomment=GETPOST('idcomment','int'); +$ref=GETPOST("ref",'alpha',1); // task ref +$taskref=GETPOST("taskref",'alpha'); // task ref +$action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); +$withproject=GETPOST('withproject','int'); +$project_ref=GETPOST('project_ref','alpha'); +$planned_workload=((GETPOST('planned_workloadhour','int')!='' || GETPOST('planned_workloadmin','int')!='') ? (GETPOST('planned_workloadhour','int')>0?GETPOST('planned_workloadhour','int')*3600:0) + (GETPOST('planned_workloadmin','int')>0?GETPOST('planned_workloadmin','int')*60:0) : ''); + +// Security check +$socid=0; +//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement. +if (! $user->rights->projet->lire) accessforbidden(); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('projecttaskcard','globalcard')); + +$task = new Task($db); +$object = new TaskComment($db); +$extrafields = new ExtraFields($db); +$projectstatic = new Project($db); +$userstatic = new User($db); + +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label($task->table_element); + + +/* + * Actions + */ + +if ($action == 'addcomment') +{ + if (!empty($_POST['comment_description'])) + { + $object->description = GETPOST('comment_description'); + $object->datec = time(); + $object->fk_task = $id; + $object->fk_user = $user->id; + $object->entity = $conf->entity; + if ($object->create($user) > 0) + { + setEventMessages($langs->trans("CommentAdded"), null, 'mesgs'); + header('Location: '.DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$id.($withproject?'&withproject=1':'')); + exit; + } + else + { + setEventMessages($task->error,$task->errors,'errors'); + $action=''; + } + } +} +if ($action == 'deletecomment') +{ + if ($object->fetch($idcomment) >= 0) + { + if ($object->delete($user) > 0) + { + setEventMessages($langs->trans("CommentDeleted"), null, 'mesgs'); + header('Location: '.DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$id.($withproject?'&withproject=1':'')); + exit; + } + else + { + setEventMessages($task->error,$task->errors,'errors'); + $action=''; + } + } +} + +// Retreive First Task ID of Project if withprojet is on to allow project prev next to work +if (! empty($project_ref) && ! empty($withproject)) +{ + if ($projectstatic->fetch('',$project_ref) > 0) + { + $tasksarray=$task->getTasksArray(0, 0, $projectstatic->id, $socid, 0); + if (count($tasksarray) > 0) + { + $id=$tasksarray[0]->id; + } + else + { + header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode)?'':'&mode='.$mode)); + } + } +} + +/* + * View +*/ + + +llxHeader('', $langs->trans("TaskComment")); + +$form = new Form($db); +$formother = new FormOther($db); +$formfile = new FormFile($db); + +if ($id > 0 || ! empty($ref)) +{ + if ($task->fetch($id,$ref) > 0) + { + $res=$task->fetch_optionals($task->id,$extralabels); + + $result=$projectstatic->fetch($task->fk_project); + if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); + + $task->project = clone $projectstatic; + + $userWrite = $projectstatic->restrictedProjectArea($user,'write'); + + if (! empty($withproject)) + { + // Tabs for project + $tab='tasks'; + $head=project_prepare_head($projectstatic); + dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public?'projectpub':'project')); + + $param=($mode=='mine'?'&mode=mine':''); + + // Project card + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref='
      '; + // Title + $morehtmlref.=$projectstatic->title; + // Thirdparty + if ($projectstatic->thirdparty->id > 0) + { + $morehtmlref.='
      '.$langs->trans('ThirdParty') . ' : ' . $projectstatic->thirdparty->getNomUrl(1, 'project'); + } + $morehtmlref.='
      '; + + // Define a complementary filter for search of next/prev ref. + if (! $user->rights->projet->all->lire) + { + $tasksListId = $projectstatic->getProjectsAuthorizedForUser($user,0,0); + $projectstatic->next_prev_filter=" rowid in (".(count($tasksListId)?join(',',array_keys($tasksListId)):'0').")"; + } + + dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
      '; + print '
      '; + print '
      '; + + print ''; + + // Visibility + print ''; + + // Date start - end + print ''; + + // Budget + print ''; + + // Other attributes + $cols = 2; + //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
      '.$langs->trans("Visibility").''; + if ($projectstatic->public) print $langs->trans('SharedProject'); + else print $langs->trans('PrivateProject'); + print '
      '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + print dol_print_date($projectstatic->date_start,'day'); + $end=dol_print_date($projectstatic->date_end,'day'); + if ($end) print ' - '.$end; + print '
      '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) print price($projectstatic->budget_amount,'',$langs,1,0,0,$conf->currency); + print '
      '; + + print '
      '; + print '
      '; + print '
      '; + print '
      '; + + print ''; + + // Description + print ''; + + // Categories + if($conf->categorie->enabled) { + print '"; + } + + print '
      '.$langs->trans("Description").''; + print nl2br($projectstatic->description); + print '
      '.$langs->trans("Categories").''; + print $form->showCategories($projectstatic->id,'project',1); + print "
      '; + + print '
      '; + print '
      '; + print '
      '; + + print '
      '; + + dol_fiche_end(); + + print '
      '; + } + + $head=task_prepare_head($task); + + /* + * Fiche tache en mode visu + */ + $param=($withproject?'&withproject=1':''); + $linkback=$withproject?''.$langs->trans("BackToList").'':''; + + dol_fiche_head($head, 'task_comment', $langs->trans("Task"), -1, 'projecttask'); + + if ($action == 'delete') + { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"].'&withproject='.$withproject,$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete"); + } + + if (! GETPOST('withproject') || empty($projectstatic->id)) + { + $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); + $task->next_prev_filter=" fk_projet in (".$projectsListId.")"; + } + else $task->next_prev_filter=" fk_projet = ".$projectstatic->id; + + $morehtmlref=''; + + // Project + if (empty($withproject)) + { + $morehtmlref.='
      '; + $morehtmlref.=$langs->trans("Project").': '; + $morehtmlref.=$projectstatic->getNomUrl(1); + $morehtmlref.='
      '; + + // Third party + $morehtmlref.=$langs->trans("ThirdParty").': '; + if (!empty($projectstatic->thirdparty)) { + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + } + $morehtmlref.='
      '; + } + + dol_banner_tab($task, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); + + print '
      '; + + print '
      '; + print ''; + + // Nb comments + print ''; + + // Other attributes + $cols = 3; + $parameyers=array('socid'=>$socid); + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
      '.$langs->trans("TaskNbComments").''; + print $task->getNbComments(); + print '
      '; + + print '
      '; + + dol_fiche_end(); + + + print '
      '; + print '
      '; + + // Add comment + + print '
      '; + print ''; + print ''; + print ''; + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + print ''; + print ''; + + // Description + print ''; + + print ''; + print '
      '.$langs->trans("Comments").'
      '; + + $desc = ($_POST['comment_description']?$_POST['comment_description']:''); + + $doleditor = new DolEditor('comment_description', $desc, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '100%'); + print $doleditor->Create(1); + + print ''; + print ''; + print '
      '; + + // List of comments + if(!empty($task->comments)) { + // Default color for current user + $TColors = array($user->id => array('bgcolor'=>'efefef','color'=>'555')); + $first = true; + foreach($task->comments as $comment) { + $fk_user = $comment->fk_user; + $userstatic->fetch($fk_user); + if(empty($TColors[$fk_user])) { + $bgcolor = random_color(180,240); + if(!empty($userstatic->color)) { + $bgcolor = $userstatic->color; + } + $color = (colorIsLight($bgcolor))?'555':'fff'; + $TColors[$fk_user] = array('bgcolor'=>$bgcolor,'color'=>$color); + } + print '
      '; + if($comment->fk_user == $user->id) { + print '
       
      '; + } + + print '
      '; + print '
      '; + if (! empty($user->photo)) + { + print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'
      '; + } + print $langs->trans('User').' : '.$userstatic->getNomUrl().'
      '; + print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); + print '
      '; // End comment-info + + print '
      '; + print '
      '; + print '
      '; + print $comment->description; + print '
      '; // End comment-description + if(($first && $fk_user == $user->id) || $user->admin == 1) { + print ''; + print img_picto('', 'delete.png'); + print ''; + } + print '
      '; // End comment-table + print '
      '; // End comment-right + print '
      '; // End comment + + if($comment->fk_user != $user->id) { + print '
       
      '; + } + print '
      '; + print '
      '; // end 100p + + $first = false; + } + } + + print '
      '; + print '
      '; + + } +} + + +llxFooter(); +$db->close(); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 7bff02fa864..c730fd074d5 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -138,8 +138,8 @@ $object = new Task($db); * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -151,7 +151,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_all=""; $search_categ=""; @@ -321,8 +321,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -610,7 +611,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index df89cac3e83..1b43940029f 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -162,10 +162,10 @@ if ($action == 'builddoc' && $user->rights->projet->creer) if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); $outputlangs = $langs; - if (GETPOST('lang_id')) + if (GETPOST('lang_id','aZ09')) { $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang(GETPOST('lang_id')); + $outputlangs->setDefaultLang(GETPOST('lang_id','aZ09')); } $result= $object->generateDocument($object->modelpdf, $outputlangs); if ($result <= 0) @@ -459,7 +459,9 @@ if ($id > 0 || ! empty($ref)) // Third party $morehtmlref.=$langs->trans("ThirdParty").': '; - $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + if (!empty($projectstatic->thirdparty)) { + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + } $morehtmlref.='
      '; } @@ -586,6 +588,11 @@ if ($id > 0 || ! empty($ref)) print '
      '; + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, 'task', $socid, 1, '', 10, 'withproject='.$withproject); + print '
      '; } } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 37331b000ab..8b85c299fdc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -96,7 +96,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_date=''; $search_datehour=''; @@ -442,7 +442,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; $morehtmlref=''; - + // Project if (empty($withproject)) { @@ -450,10 +450,12 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $morehtmlref.=$langs->trans("Project").': '; $morehtmlref.=$projectstatic->getNomUrl(1); $morehtmlref.='
      '; - + // Third party - $morehtmlref.=$langs->trans("ThirdParty").': '; - $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + $morehtmlref.=$langs->trans("ThirdParty").': '; + if (is_object($projectstatic->thirdparty)) { + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + } $morehtmlref.='
      '; } @@ -462,7 +464,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
      '; print '
      '; - print '
      '; + print '
      '; print ''; // Date start - Date end @@ -807,7 +809,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } }*/ @@ -956,7 +958,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) } // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$task_time); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index b3886824485..81a67204fdb 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -65,19 +65,18 @@ if (! isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $conf->global->MAIN_A // Define format, type and filter $format='ical'; $type='event'; -if (! empty($_GET["format"])) $format=$_GET["format"]; -if (! empty($_GET["type"])) $type=$_GET["type"]; +if (GETPOST("format",'alpha')) $format=GETPOST("format",'apha'); +if (GETPOST("type",'apha')) $type=GETPOST("type",'alpha'); $filters=array(); -if (! empty($_GET["year"])) $filters['year']=$_GET["year"]; -if (! empty($_GET["id"])) $filters['id']=$_GET["id"]; -if (! empty($_GET["idfrom"])) $filters['idfrom']=$_GET["idfrom"]; -if (! empty($_GET["idto"])) $filters['idto']=$_GET["idto"]; -if (! empty($_GET["project"])) $filters['project']=$_GET["project"]; -if (! empty($_GET["login"])) $filters['login']=$_GET["login"]; -if (! empty($_GET["logina"])) $filters['logina']=$_GET["logina"]; -if (! empty($_GET["logint"])) $filters['logint']=$_GET["logint"]; -if (GETPOST("notolderthan")) $filters['notolderthan']=GETPOST("notolderthan","int"); +if (GETPOST("year",'int')) $filters['year']=GETPOST("year",'int'); +if (GETPOST("id",'int')) $filters['id']=GETPOST("id",'int'); +if (GETPOST("idfrom",'int')) $filters['idfrom']=GETPOST("idfrom",'int'); +if (GETPOST("idto",'int')) $filters['idto']=GETPOST("idto",'int'); +if (GETPOST("project",'apha')) $filters['project']=GETPOST("project",'apha'); +if (GETPOST("logina",'apha')) $filters['logina']=GETPOST("logina",'apha'); +if (GETPOST("logint",'apha')) $filters['logint']=GETPOST("logint",'apha'); +if (GETPOST("notolderthan",'int')) $filters['notolderthan']=GETPOST("notolderthan","int"); else $filters['notolderthan']=$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY; // Check config @@ -115,7 +114,6 @@ foreach ($filters as $key => $value) if ($key == 'idfrom') $filename.='-idfrom'.$value; if ($key == 'idto') $filename.='-idto'.$value; if ($key == 'project') $filename.='-project'.$value; - if ($key == 'login') $filename.='-login'.$value; if ($key == 'logina') $filename.='-logina'.$value; // Author if ($key == 'logint') $filename.='-logint'.$value; // Assigned to } diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 3ca058acb8a..36b21c514e9 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -1,7 +1,8 @@ - * Copyright (C) 2013-2015 Laurent Destailleur +/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2015 Laurent Destailleur + * Copyright (C) 2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +31,11 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOLOGIN')) define('NOLOGIN','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) define("DOLENTITY", $entity); + // librarie core // Dolibarr environment $res = @include("../../main.inc.php"); // From htdocs directory @@ -119,19 +125,25 @@ if ($result<0) exit; } +$qualifiedjobs = array(); +foreach($object->lines as $val) +{ + if (! verifCond($val->test)) continue; + $qualifiedjobs[] = $val; +} // TODO Duplicate code. This sequence of code must be shared with code into cron_run_jobs.php script. // current date $now=dol_now(); -$nbofjobs=count($object->lines); +$nbofjobs=count($qualifiedjobs); $nbofjobslaunchedok=0; $nbofjobslaunchedko=0; -if (is_array($object->lines) && (count($object->lines)>0)) +if (is_array($qualifiedjobs) && (count($qualifiedjobs)>0)) { // Loop over job - foreach($object->lines as $line) + foreach($qualifiedjobs as $line) { dol_syslog("cron_run_jobs.php cronjobid: ".$line->id, LOG_WARNING); @@ -144,16 +156,16 @@ if (is_array($object->lines) && (count($object->lines)>0)) $result=$cronjob->fetch($line->id); if ($result<0) { - echo "Error:".$cronjob->error."
      \n"; - dol_syslog("cron_run_jobs.php:: fetch Error".$cronjob->error, LOG_ERR); + echo "Error cronjob->fetch: ".$cronjob->error."
      \n"; + dol_syslog("cron_run_jobs.php::fetch Error".$cronjob->error, LOG_ERR); exit; } // Execut job $result=$cronjob->run_jobs($userlogin); if ($result < 0) { - echo "Error:".$cronjob->error."
      \n"; - dol_syslog("cron_run_jobs.php:: run_jobs Error".$cronjob->error, LOG_ERR); + echo "Error cronjob->run_job: ".$cronjob->error."
      \n"; + dol_syslog("cron_run_jobs.php::run_jobs Error".$cronjob->error, LOG_ERR); $nbofjobslaunchedko++; } else @@ -165,8 +177,8 @@ if (is_array($object->lines) && (count($object->lines)>0)) $result=$cronjob->reprogram_jobs($userlogin, $now); if ($result<0) { - echo "Error:".$cronjob->error."
      \n"; - dol_syslog("cron_run_jobs.php:: reprogram_jobs Error".$cronjob->error, LOG_ERR); + echo "Error cronjob->reprogram_job: ".$cronjob->error."
      \n"; + dol_syslog("cron_run_jobs.php::reprogram_jobs Error".$cronjob->error, LOG_ERR); exit; } diff --git a/htdocs/public/error-404.php b/htdocs/public/error-404.php index 951f29b7dde..36547d26704 100644 --- a/htdocs/public/error-404.php +++ b/htdocs/public/error-404.php @@ -18,7 +18,7 @@

      Error


      - You requested a page that does not exists. + You requested a website or a page that does not exists.
      diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index f174c51cc74..2869d2254e7 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -299,11 +299,39 @@ if ($action == 'add') if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') + if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all') + { + $urlback=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); + if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount')); + if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email')); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + $urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2)); + } + else + { + $urlback.='&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } + else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') { $urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount')); if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email')); + if (! empty($conf->global->PAYBOX_SECURITY_TOKEN)) + { + if (! empty($conf->global->PAYBOX_SECURITY_TOKEN_UNIQUE)) + { + $urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYBOX_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2)); + } + else + { + $urlback.='&securekey='.urlencode($conf->global->PAYBOX_SECURITY_TOKEN); + } + } } else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') { @@ -518,13 +546,13 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) print ''; } // EMail -print '
      '."\n"; +print ''."\n"; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; } // Birthday print ''; print ''; print ''."\n"; - //print_liste_field_titre($langs->trans("DateToBirth"), $_SERVER["PHP_SELF"],"birth",'',$param,$sortfield,$sortorder); // est-ce nécessaire ?? - print_liste_field_titre($langs->trans("EMail"), $_SERVER["PHP_SELF"],"email",'',$param,'',$sortfield,$sortorder,'public_'); - print_liste_field_titre($langs->trans("Zip"), $_SERVER["PHP_SELF"],"zip","",$param,'',$sortfield,$sortorder,'public_'); - print_liste_field_titre($langs->trans("Town"), $_SERVER["PHP_SELF"],"town","",$param,'',$sortfield,$sortorder,'public_'); - print_liste_field_titre($langs->trans("Photo"), $_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder,'public_'); + //print_liste_field_titre("DateToBirth", $_SERVER["PHP_SELF"],"birth",'',$param,$sortfield,$sortorder); // est-ce nécessaire ?? + print_liste_field_titre("EMail", $_SERVER["PHP_SELF"],"email",'',$param,'',$sortfield,$sortorder,'public_'); + print_liste_field_titre("Zip", $_SERVER["PHP_SELF"],"zip","",$param,'',$sortfield,$sortorder,'public_'); + print_liste_field_titre("Town", $_SERVER["PHP_SELF"],"town","",$param,'',$sortfield,$sortorder,'public_'); + print_liste_field_titre("Photo", $_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder,'public_'); print "\n"; $var=True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - + print ''; print ''."\n"; print ''."\n"; diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 73d9f41eab0..63617076a1b 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -164,7 +164,7 @@ print ''."\n"; print '
      '.$langs->trans("Email").' *
      '.$langs->trans("Email").' *
      '.$langs->trans("Login").' *
      '.$langs->trans("Password").' *
      '.$langs->trans("PasswordAgain").' *
      '.$langs->trans("Login").' *
      '.$langs->trans("Password").' *
      '.$langs->trans("PasswordAgain").' *
      '.$langs->trans("DateToBirth").''; diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 232c6ef5aa3..ef42b4e8d56 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -132,18 +132,18 @@ if ($result) print '
      '.dolGetFirstLastname($langs->trans("Firstname"),$langs->trans("Lastname")).''.$langs->trans("Company").'
      '.dolGetFirstLastname($objp->firstname, $objp->lastname).''.$objp->societe.'
      '."\n"; -// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo) +// Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo) $width=0; // Define logo and logosmall $logosmall=$mysoc->logo_small; @@ -205,8 +205,8 @@ if (! empty($conf->global->ONLINE_SIGN_NEWFORM_TEXT)) } if (empty($text)) { - $text.=''."\n"; - $text.=''."\n"; + $text.=''."\n"; + $text.=''."\n"; } print $text; diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index 97a4c5452ff..0d8e930c95c 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -162,7 +162,7 @@ if (GETPOST('action','aZ09') == 'dopayment') */ $head=''; -if (! empty($conf->global->PAYBOX_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -171,9 +171,9 @@ llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'online // Common variables $creditor=$mysoc->name; -$paramcreditor='PAYBOX_CREDITOR_'.$suffix; +$paramcreditor='ONLINE_PAYMENT_CREDITOR_'.$suffix; if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor; -else if (! empty($conf->global->PAYBOX_CREDITOR)) $creditor=$conf->global->PAYBOX_CREDITOR; +else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->global->ONLINE_PAYMENT_CREDITOR; // Check link validity if (! empty($SOURCE) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) @@ -194,7 +194,7 @@ print ''; print ''; print "\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; @@ -202,14 +202,14 @@ print "\n"; print '

      '.$langs->trans("WelcomeOnOnlineSignaturePage").'

      '.$langs->trans("ThisScreenAllowsYouToSignDocFrom",$creditor).'


      '.$langs->trans("WelcomeOnOnlineSignaturePage").'
      '.$langs->trans("ThisScreenAllowsYouToSignDocFrom",$creditor).'

      '."\n"; -// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo) +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) $width=0; // Define logo and logosmall $logosmall=$mysoc->logo_small; $logo=$mysoc->logo; -$paramlogo='PAYBOX_LOGO_'.$suffix; +$paramlogo='PAYMENT_LOGO_'.$suffix; if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; -else if (! empty($conf->global->PAYBOX_LOGO)) $logosmall=$conf->global->PAYBOX_LOGO; +else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYMENT_LOGO; //print ''."\n"; // Define urllogo $urllogo=''; @@ -234,17 +234,17 @@ if ($urllogo) // Output introduction text $text=''; -if (! empty($conf->global->PAYBOX_NEWFORM_TEXT)) +if (! empty($conf->global->PAYMENT_NEWFORM_TEXT)) { $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->PAYBOX_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
      \n"; - else $text.=$conf->global->PAYBOX_NEWFORM_TEXT."
      \n"; + if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
      \n"; + else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
      \n"; $text=''."\n"; } if (empty($text)) { - $text.=''."\n"; - $text.=''."\n"; + $text.=''."\n"; + $text.=''."\n"; } print $text; @@ -802,7 +802,7 @@ print ''."\n"; print '
      '; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index f2b209a4add..feb4070c16b 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -82,26 +82,26 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('PAYBOX_PAYMENT_OK',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + // Send an email $sendemail = ''; - if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; - + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; + if ($sendemail) { $sendto=$sendemail; $from=$conf->global->MAILING_EMAIL_FROM; - + // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -114,7 +114,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content=""; @@ -126,7 +126,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $content.="tag=".$fulltag."\npaymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($topic, $sendto, $from, $content); - + $result=$mailfile->sendfile(); if ($result) { @@ -137,12 +137,12 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_paybox'); } } - + unset($_SESSION['ipaddress']); } $head=''; -if (! empty($conf->global->PAYBOX_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -156,12 +156,13 @@ print '
      '."\n"; print $langs->trans("YourPaymentHasNotBeenRecorded")."

      \n"; -if (! empty($conf->global->PAYBOX_MESSAGE_KO)) print $conf->global->PAYBOX_MESSAGE_KO; +$key='ONLINE_PAYMENT_MESSAGE_KO'; +if (! empty($conf->global->$key)) print $conf->global->$key; print "\n
      \n"; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index b1ed6411a1c..e3812c28dc1 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -84,7 +84,7 @@ dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox'); $head=''; -if (! empty($conf->global->PAYBOX_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -105,7 +105,7 @@ $fulltag = $FULLTAG; // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; -$FinalPaymentAmt = $_SESSION["Payment_Amount"]; +$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; @@ -115,7 +115,8 @@ dol_syslog("Call newpaymentok with token=".$onlinetoken." paymentType=".$payment print $langs->trans("YourPaymentHasBeenRecorded")."

      \n"; -if (! empty($conf->global->PAYBOX_MESSAGE_OK)) print $conf->global->PAYBOX_MESSAGE_OK; +$key='ONLINE_PAYMENT_MESSAGE_OK'; +if (! empty($conf->global->$key)) print $conf->global->$key; // Appel des triggers @@ -127,9 +128,9 @@ if ($result < 0) { $error++; $errors=$interface->errors; } // Send an email -if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) +if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) { - $sendto=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; + $sendto=$conf->global->ONLINE_PAYMENT_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -148,7 +149,7 @@ if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $tmptag=dolExplodeIntoArray($fulltag,'.','='); @@ -192,7 +193,7 @@ if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) print "\n\n"; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index cdfaaa2afc6..72ad0390cce 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -16,8 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * For paypal test: https://developer.paypal.com/ - * For paybox test: ??? + * For Paypal test: https://developer.paypal.com/ + * For Paybox test: ??? + * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing */ /** @@ -52,7 +53,7 @@ $langs->load("companies"); $langs->load("errors"); $langs->load("paybox"); // File with generic data -$action=GETPOST('action','alpha'); +$action=GETPOST('action','aZ09'); // Input are: // type ('invoice','order','contractline'), @@ -61,26 +62,27 @@ $action=GETPOST('action','alpha'); // tag (a free text, required if type is empty) // currency (iso code) -$suffix=GETPOST("suffix",'alpha'); -$amount=price2num(GETPOST("amount")); +$suffix=GETPOST("suffix",'aZ09'); +$amount=price2num(GETPOST("amount",'alpha')); if (! GETPOST("currency",'alpha')) $currency=$conf->currency; else $currency=GETPOST("currency",'alpha'); +$source = GETPOST("source",'alpha'); if (! $action) { - if (! GETPOST("amount") && ! GETPOST("source")) + if (! GETPOST("amount",'alpha') && ! GETPOST("source",'alpha')) { - dol_print_error('',$langs->trans('ErrorBadParameters')." - amount or source"); + print $langs->trans('ErrorBadParameters')." - amount or source"; exit; } - if (is_numeric($amount) && ! GETPOST("tag") && ! GETPOST("source")) + if (is_numeric($amount) && ! GETPOST("tag",'alpha') && ! GETPOST("source",'alpha')) { - dol_print_error('',$langs->trans('ErrorBadParameters')." - tag or source"); + print $langs->trans('ErrorBadParameters')." - tag or source"; exit; } - if (GETPOST("source") && ! GETPOST("ref")) + if (GETPOST("source",'alpha') && ! GETPOST("ref",'alpha')) { - dol_print_error('',$langs->trans('ErrorBadParameters')." - ref"); + print $langs->trans('ErrorBadParameters')." - ref"; exit; } } @@ -116,6 +118,11 @@ $FULLTAG=GETPOST("fulltag",'alpha'); // fulltag is tag with more informations $SECUREKEY=GETPOST("securekey"); // Secure key if ($paymentmethod && ! preg_match('/'.preg_quote('PM='.$paymentmethod,'/').'/', $FULLTAG)) $FULLTAG.=($FULLTAG?'.':'').'PM='.$paymentmethod; +if (! empty($suffix)) +{ + $urlok.='suffix='.urlencode($suffix).'&'; + $urlko.='suffix='.urlencode($suffix).'&'; +} if (! empty($SOURCE)) { $urlok.='source='.urlencode($SOURCE).'&'; @@ -160,6 +167,7 @@ if (! empty($conf->paypal->enabled)) require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; + // Check parameters $PAYPAL_API_OK=""; if ($urlok) $PAYPAL_API_OK=$urlok; $PAYPAL_API_KO=""; @@ -180,29 +188,6 @@ if (! empty($conf->paypal->enabled)) return -1; } - // Check security token - $valid=true; - if (! empty($conf->global->PAYPAL_SECURITY_TOKEN)) - { - if (! empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) - { - if ($SOURCE && $REF) $token = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . $SOURCE . $REF, 2); // Use the source in the hash to avoid duplicates if the references are identical - else $token = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); - } - else - { - $token = $conf->global->PAYPAL_SECURITY_TOKEN; - } - if ($SECUREKEY != $token) $valid=false; - - if (! $valid) - { - print '
      Bad value for key.
      '; - //print 'SECUREKEY='.$SECUREKEY.' token='.$token.' valid='.$valid; - exit; - } - } - $validpaymentmethod['paypal']='valid'; } @@ -212,10 +197,24 @@ if (! empty($conf->paybox->enabled)) // TODO - $validpaymentmethod['paybox']='valid'; + $validpaymentmethod['paybox']='valid'; +} + +if (! empty($conf->stripe->enabled)) +{ + $langs->load("stripe"); + + require_once DOL_DOCUMENT_ROOT.'/stripe/config.php'; + /* already included into /stripe/config.php + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/stripe/lib/stripe.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/includes/stripe/init.php'; + */ + + $validpaymentmethod['stripe']='valid'; } -// TODO Add check of other payment mode // Check security token @@ -242,9 +241,18 @@ if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) } +if (empty($validpaymentmethod)) +{ + print 'No active payment module (Paypal, Stripe, Paybox, ...)'; + exit; +} - -if (empty($validpaymentmethod)) accessforbidden('', 0, 0, 1); +// Common variables +$creditor=$mysoc->name; +$paramcreditor='ONLINE_PAYMENT_CREDITOR'; +$paramcreditorlong='ONLINE_PAYMENT_CREDITOR_'.$suffix; +if (! empty($conf->global->$paramcreditorlong)) $creditor=$conf->global->$paramcreditorlong; +else if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor; @@ -252,7 +260,6 @@ if (empty($validpaymentmethod)) accessforbidden('', 0, 0, 1); * Actions */ - if ($action == 'dopayment') { if ($paymentmethod == 'paypal') @@ -312,7 +319,7 @@ if ($action == 'dopayment') dol_syslog("SCRIPT_URI: ".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG); // If defined script uri must match domain of PAYPAL_API_OK and PAYPAL_API_KO //$_SESSION["PaymentType"]=$PAYPAL_PAYMENT_TYPE; //$_SESSION["currencyCodeType"]=$PAYPAL_API_DEVISE; - //$_SESSION["Payment_Amount"]=$PAYPAL_API_PRICE; + //$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE; // A redirect is added if API call successfull print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); @@ -320,6 +327,162 @@ if ($action == 'dopayment') exit; } } + + if ($paymentmethod == 'paybox') + { + $PRICE=price2num(GETPOST("newamount"),'MT'); + $email=GETPOST("email"); + + $origfulltag=GETPOST("fulltag",'alpha'); + + $mesg=''; + if (empty($PRICE) || ! is_numeric($PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); + elseif (empty($email)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); + elseif (! isValidEMail($email)) $mesg=$langs->trans("ErrorBadEMail",$email); + elseif (! $origfulltag) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode")); + elseif (dol_strlen($urlok) > 150) $mesg='Error urlok too long '.$urlok; + elseif (dol_strlen($urlko) > 150) $mesg='Error urlko too long '.$urlko; + + if (empty($mesg)) + { + dol_syslog("newpayment.php call paybox api and do redirect", LOG_DEBUG); + + print_paybox_redirect($PRICE, $conf->currency, $email, $urlok, $urlko, $FULLTAG); + + session_destroy(); + exit; + } + } + + if ($paymentmethod == 'stripe') + { + if (GETPOST('newamount')) $amount = GETPOST('newamount'); + else + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); + $action = ''; + } + } +} + + +if ($action == 'charge') +{ + // Correct the amount according to unit of currency + // See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support + $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); + if (! in_array($currency, $arrayzerounitcurrency)) $amount=$amount * 100; + + dol_syslog("POST keys : ".join(',', array_keys($_POST)), LOG_DEBUG, 0, '_stripe'); + dol_syslog("POST values: ".join(',', $_POST), LOG_DEBUG, 0, '_stripe'); + + $stripeToken = GETPOST("stripeToken",'alpha'); + $email = GETPOST("stripeEmail",'alpha'); + + dol_syslog("stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_stripe'); + dol_syslog("stripeEmail = ".$stripeEmail, LOG_DEBUG, 0, '_stripe'); + + $error = 0; + + try { + dol_syslog("Create customer", LOG_DEBUG, 0, '_stripe'); + $customer = \Stripe\Customer::create(array( + 'email' => $email, + 'description' => ($email?'Customer for '.$email:null), + 'metadata' => array('ipaddress'=>$_SERVER['REMOTE_ADDR']), + 'source' => $stripeToken // source can be a token OR array('object'=>'card', 'exp_month'=>xx, 'exp_year'=>xxxx, 'number'=>xxxxxxx, 'cvc'=>xxx, 'name'=>'Cardholder's full name', zip ?) + )); + // TODO Add 'business_vat_id' ? + + dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe'); + $charge = \Stripe\Charge::create(array( + 'customer' => $customer->id, + 'amount' => price2num($amount, 'MU'), + 'currency' => $currency, + 'description' => 'Stripe payment: '.$FULLTAG, + 'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name), + 'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt + )); + } catch(\Stripe\Error\Card $e) { + // Since it's a decline, \Stripe\Error\Card will be caught + $body = $e->getJsonBody(); + $err = $body['error']; + + print('Status is:' . $e->getHttpStatus() . "\n"); + print('Type is:' . $err['type'] . "\n"); + print('Code is:' . $err['code'] . "\n"); + // param is '' in this case + print('Param is:' . $err['param'] . "\n"); + print('Message is:' . $err['message'] . "\n"); + + $error++; + setEventMessages($e->getMessage(), null, 'errors'); + dol_syslog($e->getMessage(), LOG_WARNING, 0, '_stripe'); + $action=''; + } catch (\Stripe\Error\RateLimit $e) { + // Too many requests made to the API too quickly + $error++; + dol_syslog($e->getMessage(), LOG_WARNING, 0, '_stripe'); + setEventMessages($e->getMessage(), null, 'errors'); + $action=''; + } catch (\Stripe\Error\InvalidRequest $e) { + // Invalid parameters were supplied to Stripe's API + $error++; + dol_syslog($e->getMessage(), LOG_WARNING, 0, '_stripe'); + setEventMessages($e->getMessage(), null, 'errors'); + $action=''; + } catch (\Stripe\Error\Authentication $e) { + // Authentication with Stripe's API failed + // (maybe you changed API keys recently) + $error++; + dol_syslog($e->getMessage(), LOG_WARNING, 0, '_stripe'); + setEventMessages($e->getMessage(), null, 'errors'); + $action=''; + } catch (\Stripe\Error\ApiConnection $e) { + // Network communication with Stripe failed + $error++; + dol_syslog($e->getMessage(), LOG_WARNING, 0, '_stripe'); + setEventMessages($e->getMessage(), null, 'errors'); + $action=''; + } catch (\Stripe\Error\Base $e) { + // Display a very generic error to the user, and maybe send + // yourself an email + $error++; + dol_syslog($e->getMessage(), LOG_WARNING, 0, '_stripe'); + setEventMessages($e->getMessage(), null, 'errors'); + $action=''; + } catch (Exception $e) { + // Something else happened, completely unrelated to Stripe + $error++; + dol_syslog($e->getMessage(), LOG_WARNING, 0, '_stripe'); + setEventMessages($e->getMessage(), null, 'errors'); + $action=''; + } + + $_SESSION["onlinetoken"] = $stripeToken; + $_SESSION["FinalPaymentAmt"] = $amount; + $_SESSION["currencyCodeType"] = $currency; + $_SESSION["paymentType"] = ''; + $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; // Payer ip + $_SESSION['payerID'] = is_object($customer)?$customer->id:''; + $_SESSION['TRANSACTIONID'] = is_object($charge)?$charge->id:''; + + dol_syslog("Action charge stripe result=".$error." ip=".$_SESSION['ipaddress'], LOG_DEBUG, 0, '_stripe'); + dol_syslog("onlinetoken=".$_SESSION["onlinetoken"]." FinalPaymentAmt=".$_SESSION["FinalPaymentAmt"]." currencyCodeType=".$_SESSION["currencyCodeType"]." payerID=".$_SESSION['payerID']." TRANSACTIONID=".$_SESSION['TRANSACTIONID'], LOG_DEBUG, 0, '_stripe'); + dol_syslog("FULLTAG=".$FULLTAG, LOG_DEBUG, 0, '_stripe'); + dol_syslog("Now call the redirect to paymentok or paymentko", LOG_DEBUG, 0, '_stripe'); + + if ($error) + { + header("Location: ".$urlko); + exit; + } + else + { + header("Location: ".$urlok); + exit; + } + } @@ -328,7 +491,7 @@ if ($action == 'dopayment') */ $head=''; -if (! empty($conf->global->PAYMENT_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -345,19 +508,17 @@ if (! empty($SOURCE) && in_array($ref, array('member_ref', 'contractline_ref', ' exit; } -if (! empty($conf->paypal->enabled)) -{ - // Common variables - $creditor=$mysoc->name; - $paramcreditor='PAYPAL_CREDITOR_'.$suffix; - if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor; - else if (! empty($conf->global->PAYPAL_CREDITOR)) $creditor=$conf->global->PAYPAL_CREDITOR; - if (! empty($PAYPAL_API_SANDBOX)) - { - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode'),'','warning'); - } +// Show sandbox warning +if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_API_SANDBOX)) +{ + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Paypal'),'','warning'); } +if (! empty($conf->stripe->enabled) && empty($conf->global->STRIPE_LIVE)) +{ + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning'); +} + print ''."\n"; print '
      '."\n"; @@ -370,43 +531,47 @@ print ''."\n"; print ''; print "\n"; print ''."\n"; +print ''."\n"; // Additionnal information for each payment system if (! empty($conf->paypal->enabled)) { print ''."\n"; print ''."\n"; - print ''."\n"; } if (! empty($conf->paybox->enabled)) { } -// TODO Add others +if (! empty($conf->stripe->enabled)) +{ + print ''."\n"; +} print ''."\n"; print ''."\n"; print "\n"; print '

      '.$text.'

      '.$langs->trans("WelcomeOnPaymentPage").'

      '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'


      '.$langs->trans("WelcomeOnPaymentPage").'
      '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'

      '."\n"; -// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo) +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) $width=0; // Define logo and logosmall $logosmall=$mysoc->logo_small; $logo=$mysoc->logo; -$paramlogo='PAYMENT_LOGO_'.$suffix; +$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix; if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; -else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYBOX_LOGO; +else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO; //print ''."\n"; // Define urllogo $urllogo=''; if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); + $width=150; } elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); - $width=96; + $width=150; } // Output html code for logo if ($urllogo) @@ -420,17 +585,17 @@ if ($urllogo) // Output introduction text $text=''; -if (! empty($conf->global->PAYPAL_NEWFORM_TEXT)) +if (! empty($conf->global->PAYMENT_NEWFORM_TEXT)) { $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->PAYPAL_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
      \n"; - else $text.=$conf->global->PAYPAL_NEWFORM_TEXT."
      \n"; + if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
      \n"; + else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
      \n"; $text=''."\n"; } if (empty($text)) { - $text.=''."\n"; - $text.=''."\n"; + $text.=''."\n"; + $text.=''."\n"; } print $text; @@ -443,8 +608,11 @@ $found=false; $error=0; $var=false; +$object = null; + + // Free payment -if (! GETPOST("source")) +if (! $source) { $found=true; $tag=GETPOST("tag"); @@ -491,7 +659,7 @@ if (! GETPOST("source")) // Payment on customer order -if (GETPOST("source") == 'order') +if ($source == 'order') { $found=true; $langs->load("orders"); @@ -508,6 +676,8 @@ if (GETPOST("source") == 'order') else { $result=$order->fetch_thirdparty($order->socid); + + $object = $order; } if ($action != 'dopayment') // Do not change amount if we just click on first dopayment @@ -601,7 +771,7 @@ if (GETPOST("source") == 'order') // Payment on customer invoice -if (GETPOST("source") == 'invoice') +if ($source == 'invoice') { $found=true; $langs->load("bills"); @@ -618,6 +788,8 @@ if (GETPOST("source") == 'invoice') else { $result=$invoice->fetch_thirdparty($invoice->socid); + + $object = $invoice; } if ($action != 'dopayment') // Do not change amount if we just click on first dopayment @@ -710,7 +882,7 @@ if (GETPOST("source") == 'invoice') } // Payment on contract line -if (GETPOST("source") == 'contractline') +if ($source == 'contractline') { $found=true; $langs->load("contracts"); @@ -718,6 +890,7 @@ if (GETPOST("source") == 'contractline') require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $contractline=new ContratLigne($db); + $result=$contractline->fetch('',$ref); if ($result < 0) { @@ -728,6 +901,8 @@ if (GETPOST("source") == 'contractline') { if ($contractline->fk_contrat > 0) { + $object = $contractline; + $contract=new Contrat($db); $result=$contract->fetch($contractline->fk_contrat); if ($result > 0) @@ -750,7 +925,8 @@ if (GETPOST("source") == 'contractline') if ($action != 'dopayment') // Do not change amount if we just click on first dopayment { $amount=$contractline->total_ttc; - if ($contractline->fk_product) + + if ($contractline->fk_product && ! empty($conf->global->PAYMENT_USE_NEW_PRICE_FOR_CONTRACTLINES)) { $product=new Product($db); $result=$product->fetch($contractline->fk_product); @@ -776,6 +952,7 @@ if (GETPOST("source") == 'contractline') exit; } } + if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); $amount=price2num($amount); } @@ -908,7 +1085,7 @@ if (GETPOST("source") == 'contractline') } // Payment on member subscription -if (GETPOST("source") == 'membersubscription') +if ($source == 'membersubscription') { $found=true; $langs->load("members"); @@ -925,6 +1102,8 @@ if (GETPOST("source") == 'membersubscription') } else { + $object = $member; + $subscription=new Subscription($db); } @@ -985,14 +1164,29 @@ if (GETPOST("source") == 'membersubscription') print ''."\n"; print '

      '.$text.'

      '.$langs->trans("WelcomeOnPaymentPage").'

      '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'


      '.$langs->trans("WelcomeOnPaymentPage").'
      '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'

      '.$langs->trans("Amount"); if (empty($amount)) { - print ' ('.$langs->trans("ToComplete"); + if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) print ' ('.$langs->trans("ToComplete"); if (! empty($conf->global->MEMBER_EXT_URL_SUBSCRIPTION_INFO)) print ' - '.$langs->trans("SeeHere").''; - print ')'; + if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) print ')'; } print ''; if (empty($amount) || ! is_numeric($amount)) { - $valtoshow=GETPOST("newamount",'int'); + $valtoshow=GETPOST("newamount",'int'); + // force default subscription amount to value defined into constant... + if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { + if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { + $valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT; + } + } + else { + if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { + $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; + } + } + } + if (empty($amount) || ! is_numeric($amount)) + { + //$valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; print ''; @@ -1061,31 +1255,35 @@ if ($action != 'dopayment') { // Buttons for all payments registration methods - if (! empty($conf->paypal->enabled)) + if (! empty($conf->paybox->enabled)) + { + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of paybox + print '
      '; + } + + if (! empty($conf->stripe->enabled)) + { + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe + print '
      '; + } + + if (! empty($conf->paypal->enabled)) { if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) $conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY='integral'; if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'integral') { - print '
      '; + print '
      '; } if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'paypalonly') { - print '
      '; + print '
      '; } } - - if (! empty($conf->paybox->enabled)) - { - - - } - - // TODO Other methods } else { - dol_print_error_email('ERRORNEWPAYMENTPAYPAL'); + dol_print_error_email('ERRORNEWPAYMENT'); } } else @@ -1096,12 +1294,189 @@ else print '
      '."\n"; + print ''."\n"; print '
      '."\n"; print '
      '; -htmlPrintOnlinePaymentFooter($mysoc,$langs); + +// Add more content on page for some services +if (preg_match('/^dopayment/',$action)) +{ + + // Strip + if (GETPOST('dopayment_stripe','alpha')) + { + // Simple checkout + /* + print ''; + */ + + // Personalized checkout + print ''; + + print ' + +
      +
      '; + + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''; + print ''."\n"; + print ''."\n"; + + print ' + +
      + +
      + +
      + +
      + + + +
      +
      + + +
      + +
      + + + + + + '; + } +} + + +htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix,$object); llxFooter('', 'public'); diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 9abcfcf2c58..cbea7db650f 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -51,6 +51,7 @@ $langs->load("bills"); $langs->load("companies"); $langs->load("paybox"); $langs->load("paypal"); +$langs->load("stripe"); if (! empty($conf->paypal->enabled)) { @@ -59,11 +60,18 @@ if (! empty($conf->paypal->enabled)) $PAYPALPAYERID=GETPOST('PAYERID'); if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID'); } -// TODO Other payment method +if (! empty($conf->paybox->enabled)) +{ +} +if (! empty($conf->stripe->enabled)) +{ +} $FULLTAG=GETPOST('FULLTAG'); if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); +$suffix=GETPOST("suffix",'aZ09'); + // Detect $paymentmethod $paymentmethod=''; @@ -106,7 +114,7 @@ $object = new stdClass(); // For triggers * View */ -dol_syslog("Callback url when a PayPal payment was canceled. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_payment'); +dol_syslog("Callback url when an online payment is canceled. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_payment'); $tracepost = ""; foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; @@ -122,48 +130,29 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION['FinalPaymentAmt']; // From env $ipaddress = $_SESSION['ipaddress']; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('PAYMENTONLINE_PAYMENT_KO',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + // Send an email $sendemail = ''; - if (! empty($conf->paypal->enabled)) - { - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) - { - $sendemail = $conf->global->PAYPAL_PAYONLINE_SENDEMAIL; - } + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) + { + $sendemail = $conf->global->ONLINE_PAYMENT_SENDEMAIL; } - // Send an email - if (! empty($conf->paybox->enabled)) - { - if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) - { - $sendemail = $conf->global->PAYBOX_PAYONLINE_SENDEMAIL; - } - } - // Send an email - if (! empty($conf->stripe->enabled)) - { - if (! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) - { - $sendemail = $conf->global->STRIPE_PAYONLINE_SENDEMAIL; - } - } - + if ($sendemail) { $from=$conf->global->MAILING_EMAIL_FROM; $sendto=$sendemail; - + // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -176,7 +165,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content=""; @@ -188,7 +177,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($topic, $sendto, $from, $content); - + $result=$mailfile->sendfile(); if ($result) { @@ -199,12 +188,12 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } - + unset($_SESSION['ipaddress']); } $head=''; -if (! empty($conf->global->PAYMENT_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -215,13 +204,47 @@ llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'online // Show ko message print ''."\n"; print '
      '."\n"; + + +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +$width=0; +// Define logo and logosmall +$logosmall=$mysoc->logo_small; +$logo=$mysoc->logo; +$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix; +if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; +else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO; +//print ''."\n"; +// Define urllogo +$urllogo=''; +if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); + $width=150; +} +elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); + $width=150; +} +// Output html code for logo +if ($urllogo) +{ + print '
      '; + print '
      '; +} + print $langs->trans("YourPaymentHasNotBeenRecorded")."

      "; -if (! empty($conf->global->PAYMENT_MESSAGE_KO)) print $conf->global->PAYMENT_MESSAGE_KO; +$key='ONLINE_PAYMENT_MESSAGE_KO'; +if (! empty($conf->global->$key)) print $conf->global->$key; + print "\n
      \n"; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 26022dcd4f8..29d2b78d142 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -67,21 +67,6 @@ if (! empty($conf->paypal->enabled)) if ($urlok) $PAYPAL_API_OK=$urlok; $PAYPAL_API_KO=""; if ($urlko) $PAYPAL_API_KO=$urlko; - if (empty($PAYPAL_API_USER)) - { - dol_print_error('',"Paypal setup param PAYPAL_API_USER not defined"); - return -1; - } - if (empty($PAYPAL_API_PASSWORD)) - { - dol_print_error('',"Paypal setup param PAYPAL_API_PASSWORD not defined"); - return -1; - } - if (empty($PAYPAL_API_SIGNATURE)) - { - dol_print_error('',"Paypal setup param PAYPAL_API_SIGNATURE not defined"); - return -1; - } $PAYPALTOKEN=GETPOST('TOKEN'); if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); @@ -94,6 +79,8 @@ if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); $source=GETPOST('source'); $ref=GETPOST('ref'); +$suffix=GETPOST("suffix",'aZ09'); + // Detect $paymentmethod $paymentmethod=''; @@ -143,14 +130,14 @@ $object = new stdClass(); // For triggers * View */ -dol_syslog("Callback url when a payment was done. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_payment'); +dol_syslog("Callback url when a payment was done. query_string=".(dol_escape_htmltag($_SERVER["QUERY_STRING"])?dol_escape_htmltag($_SERVER["QUERY_STRING"]):'')." script_uri=".(dol_escape_htmltag($_SERVER["SCRIPT_URI"])?dol_escape_htmltag($_SERVER["SCRIPT_URI"]):''), LOG_DEBUG, 0, '_payment'); $tracepost = ""; foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); $head=''; -if (! empty($conf->global->PAYMENT_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -164,72 +151,115 @@ print ''."\n"; print '
      '."\n"; -if (! empty($conf->paypal->enabled)) +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +$width=0; +// Define logo and logosmall +$logosmall=$mysoc->logo_small; +$logo=$mysoc->logo; +$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix; +if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; +else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO; +//print ''."\n"; +// Define urllogo +$urllogo=''; +if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - if ($PAYPALTOKEN) - { - // Get on url call - $onlinetoken = $PAYPALTOKEN; - $fulltag = $FULLTAG; - $payerID = $PAYPALPAYERID; - // Set by newpayment.php - $paymentType = $_SESSION['PaymentType']; - $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; - // From env - $ipaddress = $_SESSION['ipaddress']; - - dol_syslog("Call paymentok with token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_paypal'); - - // Validate record - if (! empty($paymentType)) - { - dol_syslog("We call GetExpressCheckoutDetails", LOG_DEBUG, 0, '_payment'); - $resArray=getDetails($onlinetoken); - //var_dump($resarray); - - dol_syslog("We call DoExpressCheckoutPayment token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment'); - $resArray=confirmPayment($onlinetoken, $paymentType, $currencyCodeType, $payerID, $ipaddress, $FinalPaymentAmt, $fulltag); - - $ack = strtoupper($resArray["ACK"]); - if ($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING") - { - $object->source = $source; - $object->ref = $ref; - $object->payerID = $payerID; - $object->fulltag = $fulltag; - $object->resArray = $resArray; - - // resArray was built from a string like that - // TOKEN=EC%2d1NJ057703V9359028&TIMESTAMP=2010%2d11%2d01T11%3a40%3a13Z&CORRELATIONID=1efa8c6a36bd8&ACK=Success&VERSION=56&BUILD=1553277&TRANSACTIONID=9B994597K9921420R&TRANSACTIONTYPE=expresscheckout&PAYMENTTYPE=instant&ORDERTIME=2010%2d11%2d01T11%3a40%3a12Z&AMT=155%2e57&FEEAMT=5%2e54&TAXAMT=0%2e00&CURRENCYCODE=EUR&PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None - $PAYMENTSTATUS=urldecode($resArray["PAYMENTSTATUS"]); // Should contains 'Completed' - $TRANSACTIONID=urldecode($resArray["TRANSACTIONID"]); - $TAXAMT=urldecode($resArray["TAXAMT"]); - $NOTE=urldecode($resArray["NOTE"]); - - $ispaymentok=True; - } - else - { - //Display a user friendly Error on the page using any of the following error information returned by PayPal - $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); - $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); - $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); - $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); - } - } - else - { - dol_print_error('','Session expired'); - } - } - else - { - dol_print_error('','$PAYPALTOKEN not defined'); - } + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); + $width=150; +} +elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); + $width=150; +} +// Output html code for logo +if ($urllogo) +{ + print '
      '; + print '
      '; } +if (! empty($conf->paypal->enabled)) +{ + if ($paymentmethod == 'paypal') + { + if ($PAYPALTOKEN) + { + // Get on url call + $onlinetoken = $PAYPALTOKEN; + $fulltag = $FULLTAG; + $payerID = $PAYPALPAYERID; + // Set by newpayment.php + $paymentType = $_SESSION['PaymentType']; + $currencyCodeType = $_SESSION['currencyCodeType']; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; + // From env + $ipaddress = $_SESSION['ipaddress']; + + dol_syslog("Call paymentok with token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_paypal'); + + // Validate record + if (! empty($paymentType)) + { + dol_syslog("We call GetExpressCheckoutDetails", LOG_DEBUG, 0, '_payment'); + $resArray=getDetails($onlinetoken); + //var_dump($resarray); + + dol_syslog("We call DoExpressCheckoutPayment token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment'); + $resArray=confirmPayment($onlinetoken, $paymentType, $currencyCodeType, $payerID, $ipaddress, $FinalPaymentAmt, $fulltag); + + $ack = strtoupper($resArray["ACK"]); + if ($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING") + { + $object->source = $source; + $object->ref = $ref; + $object->payerID = $payerID; + $object->fulltag = $fulltag; + $object->resArray = $resArray; + + // resArray was built from a string like that + // TOKEN=EC%2d1NJ057703V9359028&TIMESTAMP=2010%2d11%2d01T11%3a40%3a13Z&CORRELATIONID=1efa8c6a36bd8&ACK=Success&VERSION=56&BUILD=1553277&TRANSACTIONID=9B994597K9921420R&TRANSACTIONTYPE=expresscheckout&PAYMENTTYPE=instant&ORDERTIME=2010%2d11%2d01T11%3a40%3a12Z&AMT=155%2e57&FEEAMT=5%2e54&TAXAMT=0%2e00&CURRENCYCODE=EUR&PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None + $PAYMENTSTATUS=urldecode($resArray["PAYMENTSTATUS"]); // Should contains 'Completed' + $TRANSACTIONID=urldecode($resArray["TRANSACTIONID"]); + $TAXAMT=urldecode($resArray["TAXAMT"]); + $NOTE=urldecode($resArray["NOTE"]); + + $ispaymentok=True; + } + else + { + //Display a user friendly Error on the page using any of the following error information returned by PayPal + $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); + $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); + $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); + $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); + } + } + else + { + dol_print_error('','Session expired'); + } + } + else + { + dol_print_error('','$PAYPALTOKEN not defined'); + } + } +} + +if (! empty($conf->paybox->enabled)) +{ + if ($paymentmethod == 'paybox') $ispaymentok = true; // We call this page only if payment is ok +} + +if (! empty($conf->stripe->enabled)) +{ + if ($paymentmethod == 'stripe') $ispaymentok = true; // We call this page only if payment is ok +} + if ($ispaymentok) { @@ -240,10 +270,11 @@ if ($ispaymentok) // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; - + $TRANSACTIONID = $_SESSION['TRANSACTIONID']; + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); @@ -251,18 +282,16 @@ if ($ispaymentok) if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + print $langs->trans("YourPaymentHasBeenRecorded")."
      \n"; print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."

      \n"; - if (! empty($conf->global->PAYMENT_MESSAGE_OK)) print $conf->global->PAYMENT_MESSAGE_OK; - + + $key='ONLINE_PAYMENT_MESSAGE_OK'; + if (! empty($conf->global->$key)) print $conf->global->$key; + $sendemail = ''; - if (! empty($conf->global->PAYMENTONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYMENTONLINE_SENDEMAIL; - // TODO Remove local option to keep only the generic one ? - if ($paymentmethod == 'paypal' && ! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; - if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; - if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL; - + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; + // Send an email if ($sendemail) { @@ -285,7 +314,7 @@ if ($ispaymentok) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $tmptag=dolExplodeIntoArray($fulltag,'.','='); @@ -333,33 +362,33 @@ else // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('PAYMENTONLINE_PAYMENT_KO',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + print $langs->trans('DoExpressCheckoutPaymentAPICallFailed') . "
      \n"; print $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg."
      \n"; print $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg."
      \n"; print $langs->trans('ErrorCode') . ": " . $ErrorCode."
      \n"; print $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode."
      \n"; - + if ($mysoc->email) print "\nPlease, send a screenshot of this page to ".$mysoc->email."
      \n"; - + $sendemail = ''; if (! empty($conf->global->PAYMENTONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYMENTONLINE_SENDEMAIL; // TODO Remove local option to keep only the generic one ? if ($paymentmethod == 'paypal' && ! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL; - + // Send an email if ($sendemail) { @@ -369,7 +398,7 @@ else $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - + // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -382,7 +411,7 @@ else else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content=""; @@ -392,12 +421,12 @@ else $content.=$langs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."\n"; $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n"; $content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; - + $ishtml=dol_textishtml($content); // May contain urls - + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); - + $result=$mailfile->sendfile(); if ($result) { @@ -414,7 +443,7 @@ else print "\n
      \n"; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 65fbfbd38a7..310f553269b 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -3,9 +3,9 @@ * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * - * This program is free software: you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -16,7 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * For test: https://developer.paypal.com/ + * For paypal test: https://developer.paypal.com/ + * For paybox test: ??? */ /** @@ -242,7 +243,7 @@ if (GETPOST('action','aZ09') == 'dopayment') dol_syslog("SCRIPT_URI: ".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG); // If defined script uri must match domain of PAYPAL_API_OK and PAYPAL_API_KO //$_SESSION["PaymentType"]=$PAYPAL_PAYMENT_TYPE; //$_SESSION["currencyCodeType"]=$PAYPAL_API_DEVISE; - //$_SESSION["Payment_Amount"]=$PAYPAL_API_PRICE; + //$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE; // A redirect is added if API call successfull print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); @@ -258,7 +259,7 @@ if (GETPOST('action','aZ09') == 'dopayment') */ $head=''; -if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -267,9 +268,9 @@ llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'online // Common variables $creditor=$mysoc->name; -$paramcreditor='PAYPAL_CREDITOR_'.$suffix; +$paramcreditor='ONLINE_PAYMENT_CREDITOR_'.$suffix; if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor; -else if (! empty($conf->global->PAYPAL_CREDITOR)) $creditor=$conf->global->PAYPAL_CREDITOR; +else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->global->ONLINE_PAYMENT_CREDITOR; // Check link validity if (! empty($SOURCE) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) @@ -306,14 +307,14 @@ print "\n"; print ''."\n"; -// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo) +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) $width=0; // Define logo and logosmall $logosmall=$mysoc->logo_small; $logo=$mysoc->logo; -$paramlogo='PAYBOX_LOGO_'.$suffix; +$paramlogo='PAYMENT_LOGO_'.$suffix; if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; -else if (! empty($conf->global->PAYBOX_LOGO)) $logosmall=$conf->global->PAYBOX_LOGO; +else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYMENT_LOGO; //print ''."\n"; // Define urllogo $urllogo=''; @@ -338,17 +339,17 @@ if ($urllogo) // Output introduction text $text=''; -if (! empty($conf->global->PAYPAL_NEWFORM_TEXT)) +if (! empty($conf->global->PAYMENT_NEWFORM_TEXT)) { $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->PAYPAL_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
      \n"; - else $text.=$conf->global->PAYPAL_NEWFORM_TEXT."
      \n"; + if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
      \n"; + else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
      \n"; $text=''."\n"; } if (empty($text)) { - $text.=''."\n"; - $text.=''."\n"; + $text.=''."\n"; + $text.=''."\n"; } print $text; @@ -1014,7 +1015,7 @@ print '
      '; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index f7dd0cf6eeb..3e555379849 100644 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -91,7 +91,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; @@ -104,7 +104,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice // Send an email $sendemail = ''; - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; if ($sendemail) { @@ -153,7 +153,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $head=''; -if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -166,11 +166,13 @@ print ''."\n"; print '
      '."\n"; print $langs->trans("YourPaymentHasNotBeenRecorded")."

      "; -if (! empty($conf->global->PAYPAL_MESSAGE_KO)) print $conf->global->PAYPAL_MESSAGE_KO; +$key='ONLINE_PAYMENT_MESSAGE_KO'; +if (! empty($conf->global->$key)) print $conf->global->$key; + print "\n
      \n"; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index e52a79057f4..9ae2e90795e 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -114,7 +114,7 @@ dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal'); $head=''; -if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -135,7 +135,7 @@ if ($PAYPALTOKEN) // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; @@ -170,7 +170,9 @@ if ($PAYPALTOKEN) print $langs->trans("YourPaymentHasBeenRecorded")."
      \n"; print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."

      \n"; - if (! empty($conf->global->PAYPAL_MESSAGE_OK)) print $conf->global->PAYPAL_MESSAGE_OK; + + $key='ONLINE_PAYMENT_MESSAGE_OK'; + if (! empty($conf->global->$key)) print $conf->global->$key; // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; @@ -180,9 +182,9 @@ if ($PAYPALTOKEN) // Fin appel triggers // Send an email - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) { - $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; + $sendto=$conf->global->ONLINE_PAYMENT_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -201,7 +203,7 @@ if ($PAYPALTOKEN) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $tmptag=dolExplodeIntoArray($fulltag,'.','='); @@ -248,7 +250,7 @@ if ($PAYPALTOKEN) $result=$interface->run_triggers('PAYPAL_PAYMENT_KO',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + //Display a user friendly Error on the page using any of the following error information returned by PayPal $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); @@ -264,9 +266,9 @@ if ($PAYPALTOKEN) if ($mysoc->email) echo "\nPlease, send a screenshot of this page to ".$mysoc->email."
      \n"; // Send an email - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) { - $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; + $sendto=$conf->global->ONLINE_PAYMENT_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -285,7 +287,7 @@ if ($PAYPALTOKEN) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content=""; @@ -326,7 +328,7 @@ else print "\n\n"; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index af0c880d3c8..f74e7bd0295 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Saasprov * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2017 Ferran Marcet * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -183,9 +184,9 @@ if (! empty($conf->global->STRIPE_SECURITY_TOKEN)) // Common variables $creditor=$mysoc->name; -$paramcreditor='STRIPE_CREDITOR_'.$suffix; +$paramcreditor='ONLINE_PAYMENT_CREDITOR_'.$suffix; if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor; -else if (! empty($conf->global->STRIPE_CREDITOR)) $creditor=$conf->global->STRIPE_CREDITOR; +else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->global->ONLINE_PAYMENT_CREDITOR; @@ -328,7 +329,7 @@ if ($action == 'charge') */ $head=''; -if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -369,14 +370,14 @@ print "\n"; print '

      '.$text.'

      '.$langs->trans("WelcomeOnPaymentPage").'

      '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'


      '.$langs->trans("WelcomeOnPaymentPage").'
      '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'

      '."\n"; -// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo) +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) $width=0; // Define logo and logosmall $logosmall=$mysoc->logo_small; $logo=$mysoc->logo; -$paramlogo='STRIPE_LOGO_'.$suffix; +$paramlogo='PAYMENT_LOGO_'.$suffix; if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; -else if (! empty($conf->global->STRIPE_LOGO)) $logosmall=$conf->global->STRIPE_LOGO; +else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYMENT_LOGO; //print ''."\n"; // Define urllogo $urllogo=''; @@ -401,17 +402,17 @@ if ($urllogo) // Output introduction text $text=''; -if (! empty($conf->global->STRIPE_NEWFORM_TEXT)) +if (! empty($conf->global->PAYMENT_NEWFORM_TEXT)) { $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->STRIPE_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
      \n"; - else $text.=$conf->global->STRIPE_NEWFORM_TEXT."
      \n"; + if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
      \n"; + else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
      \n"; $text=''."\n"; } if (empty($text)) { - $text.=''."\n"; - $text.=''."\n"; + $text.=''."\n"; + $text.=''."\n"; } print $text; @@ -1084,6 +1085,7 @@ if (preg_match('/^dopayment/',$action)) box-shadow: 0 1px 3px 0 #e6ebf1; -webkit-transition: box-shadow 150ms ease; transition: box-shadow 150ms ease; + width: 350px; } .StripeElement--focus { @@ -1227,7 +1229,7 @@ if (preg_match('/^dopayment/',$action)) -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/stripe/paymentko.php b/htdocs/public/stripe/paymentko.php index 01000939b37..a2462904b07 100644 --- a/htdocs/public/stripe/paymentko.php +++ b/htdocs/public/stripe/paymentko.php @@ -82,24 +82,24 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $paymentType = $_SESSION['paymentType']; $FinalPaymentAmt = $_SESSION['FinalPaymentAmt']; $ipaddress = $_SESSION['ipaddress']; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('STRIPE_PAYMENT_KO',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + // Send an email $sendemail = ''; - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; - + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; + if ($sendemail) { // Get on url call $sendto=$sendemail; $from=$conf->global->MAILING_EMAIL_FROM; - + // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -112,7 +112,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content=""; @@ -124,7 +124,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($topic, $sendto, $from, $content); - + $result=$mailfile->sendfile(); if ($result) { @@ -140,7 +140,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice } $head=''; -if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -153,11 +153,13 @@ print ''."\n"; print '
      '."\n"; print $langs->trans("YourPaymentHasNotBeenRecorded")."

      "; -if (! empty($conf->global->STRIPE_MESSAGE_KO)) print $conf->global->STRIPE_MESSAGE_KO; +$key='ONLINE_PAYMENT_MESSAGE_KO'; +if (! empty($conf->global->$key)) print $conf->global->$key; + print "\n
      \n"; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/stripe/paymentok.php b/htdocs/public/stripe/paymentok.php index 4eede2e9544..f018bc98b7a 100644 --- a/htdocs/public/stripe/paymentok.php +++ b/htdocs/public/stripe/paymentok.php @@ -82,7 +82,7 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_stripe'); $head=''; -if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -105,7 +105,7 @@ if ($ispaymentok) // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; $TRANSACTIONID = $_SESSION['TRANSACTIONID']; @@ -117,14 +117,16 @@ if ($ispaymentok) if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + print $langs->trans("YourPaymentHasBeenRecorded")."
      \n"; print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."

      \n"; - if (! empty($conf->global->STRIPE_MESSAGE_OK)) print $conf->global->STRIPE_MESSAGE_OK; - + + $key='ONLINE_PAYMENT_MESSAGE_OK'; + if (! empty($conf->global->$key)) print $conf->global->$key; + $sendemail = ''; - if (! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL; - + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; + // Send an email if ($sendemail) { @@ -147,7 +149,7 @@ if ($ispaymentok) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $tmptag=dolExplodeIntoArray($fulltag,'.','='); @@ -191,7 +193,7 @@ if ($ispaymentok) print "\n\n"; -htmlPrintOnlinePaymentFooter($mysoc,$langs); +htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); llxFooter('', 'public'); diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 0776c36f74a..ce3faa4bf20 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -32,9 +32,6 @@ if (empty($usedolheader)) - - - " /> @@ -43,9 +40,6 @@ if (empty($usedolheader)) - - - @@ -74,7 +68,7 @@ else '/includes/pdfmake/vfs_fonts.js' ); */ - + llxHeader('','','','',0,0,$arrayjs,$arraycss); } @@ -92,7 +86,7 @@ This page is a sample of page using tables. It is designed to make test with
      - tablednd
      - +


      Example 0a : Table with div+div+div containg a select that should be overflowed and truncated => Use this to align text or form
      @@ -139,7 +133,7 @@ This page is a sample of page using tables. It is designed to make test with



      Example 1 : Standard table/thead/tbody/tr/th-td (no class pair/impair on td) => Use this if you need the drag and drop for lines or for long result tables
      - + - + - +

      '.$text.'

      '.$langs->trans("WelcomeOnPaymentPage").'

      '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'


      '.$langs->trans("WelcomeOnPaymentPage").'
      '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'

      " id="tablelines3"> @@ -243,7 +237,7 @@ if (! empty($moreforfilter))
      -'."\n"; +print ''."\n"; include_once $original_file_osencoded; diff --git a/htdocs/public/websites/styles.css.php b/htdocs/public/websites/styles.css.php index 5a736affc25..7fe80f9b66e 100644 --- a/htdocs/public/websites/styles.css.php +++ b/htdocs/public/websites/styles.css.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2016-2017 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +18,7 @@ /** * \file htdocs/public/websites/styles.css.php * \ingroup website - * \brief Page to output style page - * \author Laurent Destailleur + * \brief Page to output style page. Called with */ define('NOTOKENRENEWAL',1); // Disables token renewal @@ -48,6 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $error=0; $website=GETPOST('website', 'alpha'); +$websiteid=GETPOST('websiteid', 'int'); $pageid=GETPOST('page', 'alpha')?GETPOST('page', 'alpha'):GETPOST('pageid', 'alpha'); $accessallowed = 1; @@ -67,13 +67,20 @@ if (empty($pageid)) { require_once DOL_DOCUMENT_ROOT.'/websites/class/website.class.php'; require_once DOL_DOCUMENT_ROOT.'/websites/class/websitepage.class.php'; - + $object=new Website($db); - $object->fetch(0, $website); - + if ($websiteid) + { + $object->fetch($websiteid); + $website=$object->ref; + } + else + { + $object->fetch(0, $website); + } $objectpage=new WebsitePage($db); $array=$objectpage->fetchAll($object->id); - + if (count($array) > 0) { $firstrep=reset($array); @@ -132,6 +139,8 @@ if (! file_exists($original_file_osencoded)) // Output page content +define('USEDOLIBARRSERVER', 1); +print '/* Page content '.$original_file.' : CSS content that was saved into tpl dir */'."\n"; require_once $original_file_osencoded; diff --git a/htdocs/resource/add.php b/htdocs/resource/add.php index a294dfb94db..a6cd75cccf8 100644 --- a/htdocs/resource/add.php +++ b/htdocs/resource/add.php @@ -66,64 +66,72 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); -if ($action == 'confirm_add_resource') +$hookmanager->initHooks(array('resource_card_add','globalcard')); +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) { - if (! $cancel) - { - $error=''; - $ref=GETPOST('ref','alpha'); - $description=GETPOST('description','alpha'); - $fk_code_type_resource=GETPOST('fk_code_type_resource','alpha'); - - if (empty($ref)) - { - $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")); - setEventMessages($mesg, null, 'errors'); - $error++; - } - - if (! $error) - { - $object=new Dolresource($db); - $object->ref=$ref; - $object->description=$description; - $object->fk_code_type_resource=$fk_code_type_resource; - - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels, $object); - if ($ret < 0) { - $error ++; - } - - $result=$object->create($user); - if ($result > 0) - { - // Creation OK - $db->commit(); - setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs'); - Header("Location: card.php?id=" . $object->id); - return; - } - else - { - // Creation KO - setEventMessages($object->error, $object->errors, 'errors'); - $action = ''; - } - } - else - { - $action = ''; - } - } - else - { - Header("Location: list.php"); - } + if ($action == 'confirm_add_resource') + { + if (! $cancel) + { + $error=''; + + $ref=GETPOST('ref','alpha'); + $description=GETPOST('description','alpha'); + $fk_code_type_resource=GETPOST('fk_code_type_resource','alpha'); + + if (empty($ref)) + { + $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")); + setEventMessages($mesg, null, 'errors'); + $error++; + } + + if (! $error) + { + $object=new Dolresource($db); + $object->ref=$ref; + $object->description=$description; + $object->fk_code_type_resource=$fk_code_type_resource; + + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); + if ($ret < 0) { + $error ++; + } + + $result=$object->create($user); + if ($result > 0) + { + // Creation OK + $db->commit(); + setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs'); + Header("Location: card.php?id=" . $object->id); + return; + } + else + { + // Creation KO + setEventMessages($object->error, $object->errors, 'errors'); + $action = ''; + } + } + else + { + $action = ''; + } + } + else + { + Header("Location: list.php"); + } + } } - /* * View */ diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 02d38c2b924..db6eed63b3b 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -54,10 +54,13 @@ if ($user->societe_id > 0) accessforbidden(); } -if( ! $user->rights->resource->read) +if (! $user->rights->resource->read) accessforbidden(); $object = new Dolresource($db); +$objectFetchRes = $object->fetch($id); +if (! ($objectFetchRes > 0)) dol_print_error($db, $object->error); + $extrafields = new ExtraFields($db); @@ -162,7 +165,7 @@ llxHeader('',$pagetitle,''); $form = new Form($db); $formresource = new FormResource($db); -if ( $object->fetch($id) > 0 ) +if ( $objectFetchRes > 0 ) { $head=resource_prepare_head($object); diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 4fbb8dde70d..6dc093f6142 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -33,7 +33,7 @@ class Dolresource extends CommonObject public $element='dolresource'; //!< Id that identify managed objects public $table_element='resource'; //!< Name of table without prefix where object is stored public $picto = 'resource'; - + public $resource_id; public $resource_type; public $element_id; @@ -44,6 +44,8 @@ class Dolresource extends CommonObject public $type_label; public $tms=''; + var $oldcopy; + /** * Constructor * @@ -231,85 +233,108 @@ class Dolresource extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) - { - global $conf, $langs, $hookmanager; - $error=0; + function update($user=null, $notrigger=0) + { + global $conf, $langs, $hookmanager; + $error=0; - // Clean parameters - if (isset($this->ref)) $this->ref=trim($this->ref); - if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource); - if (isset($this->description)) $this->description=trim($this->description); + // Clean parameters + if (isset($this->ref)) $this->ref=trim($this->ref); + if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource); + if (isset($this->description)) $this->description=trim($this->description); - // Update request - $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; - $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; - $sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").","; - $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').""; - $sql.= " WHERE rowid=".$this->id; + if (empty($this->oldcopy)) + { + $org=new self($this->db); + $org->fetch($this->id); + $this->oldcopy=$org; + } - $this->db->begin(); + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; + $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; + $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; + $sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").","; + $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').""; + $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + $this->db->begin(); - if (! $error) - { - if (! $notrigger) - { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - //// Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('RESOURCE_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - //// End call triggers - } - } - if (! $error) - { - $action='update'; + if (! $error) + { + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('RESOURCE_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + } + } - // Actions on extra fields (by external module or standard code) - // TODO le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('actioncommdao')); - $parameters=array('actcomm'=>$this->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; - } + if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) + { + // We remove directory + if (! empty($conf->resource->dir_output)) + { + $olddir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->oldcopy->ref); + $newdir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref); + if (file_exists($olddir)) + { + $res = @rename($olddir, $newdir); + if (! $res) + { + $langs->load("errors"); + $this->error=$langs->trans('ErrorFailToRenameDir',$olddir,$newdir); + $error++; + } + } + } + } - // Commit or rollback - if ($error) - { - foreach($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); - $this->error.=($this->error?', '.$errmsg:$errmsg); - } - $this->db->rollback(); - return -1*$error; - } - else - { - $this->db->commit(); - return 1; - } - } + if (! $error) + { + $action='update'; + + // Actions on extra fields (by external module or standard code) + // TODO le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('actioncommdao')); + $parameters=array('actcomm'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } /** * Load object in memory from database @@ -376,65 +401,84 @@ class Dolresource extends CommonObject * @param int $notrigger Disable all triggers * @return int >0 if OK, <0 if KO */ - function delete($rowid, $notrigger=0) - { - global $user,$langs,$conf; + function delete($rowid, $notrigger=0) + { + global $user,$langs,$conf; - $error=0; + $error=0; - $this->db->begin(); + $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element; - $sql.= " WHERE rowid =".$rowid; + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element; + $sql.= " WHERE rowid =".$rowid; - dol_syslog(get_class($this), LOG_DEBUG); - if ($this->db->query($sql)) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; - $sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid); - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql=$this->db->query($sql); - if (!$resql) - { - $this->error=$this->db->lasterror(); - $error++; - } - } - else - { - $this->error=$this->db->lasterror(); - $error++; - } + dol_syslog(get_class($this), LOG_DEBUG); + if ($this->db->query($sql)) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; + $sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql=$this->db->query($sql); + if (!$resql) + { + $this->error=$this->db->lasterror(); + $error++; + } + } + else + { + $this->error=$this->db->lasterror(); + $error++; + } - // Removed extrafields - if (! $error) { - $result=$this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); - } - } + // Removed extrafields + if (! $error) { + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); + } + } - if (! $notrigger) - { - // Call trigger - $result=$this->call_trigger('RESOURCE_DELETE',$user); - if ($result < 0) $error++; - // End call triggers - } + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('RESOURCE_DELETE',$user); + if ($result < 0) $error++; + // End call triggers + } - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } + if (! $error) + { + // We remove directory + $ref = dol_sanitizeFileName($this->ref); + if (! empty($conf->resource->dir_output)) + { + $dir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref); + if (file_exists($dir)) + { + $res=@dol_delete_dir_recursive($dir); + if (! $res) + { + $this->errors[] = 'ErrorFailToDeleteDir'; + $error++; + } + } + } + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } /** * Load resource objects into $this->lines @@ -799,7 +843,7 @@ class Dolresource extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."element_resources SET"; $sql.= " resource_id=".(isset($this->resource_id)?"'".$this->db->escape($this->resource_id)."'":"null").","; - $sql.= " resource_type=".(isset($this->resource_type)?"'".$this->resource_type."'":"null").","; + $sql.= " resource_type=".(isset($this->resource_type)?"'".$this->db->escape($this->resource_type)."'":"null").","; $sql.= " element_id=".(isset($this->element_id)?$this->element_id:"null").","; $sql.= " element_type=".(isset($this->element_type)?"'".$this->db->escape($this->element_type)."'":"null").","; $sql.= " busy=".(isset($this->busy)?$this->busy:"null").","; @@ -975,8 +1019,8 @@ class Dolresource extends CommonObject $result.=$link.$this->ref.$linkend; return $result; } - - + + /** * Retourne le libelle du status d'un user (actif, inactif) * @@ -987,7 +1031,7 @@ class Dolresource extends CommonObject { return $this->LibStatut($this->status,$mode); } - + /** * Return the status * @@ -998,7 +1042,7 @@ class Dolresource extends CommonObject static function LibStatut($status,$mode=0) { global $langs; - + return ''; - } + } } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index a886dcf475b..9c89b516eff 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -108,7 +108,7 @@ if ($action == 'add_element_resource' && ! $cancel) } // Update ressource -if ($action == 'update_linked_resource' && $user->rights->resource->write && !GETPOST('cancel') ) +if ($action == 'update_linked_resource' && $user->rights->resource->write && !GETPOST('cancel','alpha') ) { $res = $object->fetch_element_resource($lineid); if($res) diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 11405d15acc..c4d783739c0 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -76,8 +76,9 @@ foreach ($search_array_options as $key => $val) $param.='&search_options_'.$tmpkey.'='.urlencode($val); } $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $filter['ef.'.$tmpkey]=natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -130,7 +131,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { $search_ref=""; $search_label=""; @@ -247,7 +248,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -311,7 +312,9 @@ if ($ret) } else { - print ''; + $colspan=1; + foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } + print ''; } print '
      '.$langs->trans('NoResourceInDatabase').'
      '.$langs->trans("NoRecordFound").'
      '; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 5c84be25521..ed4704471d0 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -108,7 +108,7 @@ if ($action == 'updateoptions') if ($action == 'set') { $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); + $scandir = GETPOST('scan_dir','alpha'); $type='company'; $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; @@ -135,7 +135,7 @@ if ($action== 'del') if ($action == 'setdoc') { $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); + $scandir = GETPOST('scan_dir','alpha'); $db->begin(); @@ -167,23 +167,6 @@ if ($action == 'setdoc') } } -//Activate ProfId -if ($action == 'setprofid') -{ - $status = GETPOST('status','alpha'); - - $idprof="SOCIETE_IDPROF".$value."_UNIQUE"; - if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } -} - //Activate Set ref in list if ($action=="setaddrefinlist") { $setaddrefinlist = GETPOST('value','int'); @@ -214,16 +197,33 @@ if ($action=="setaskforshippingmet") { } } +//Activate ProfId unique +if ($action == 'setprofid') +{ + $status = GETPOST('status','alpha'); + + $idprof="SOCIETE_".$value."_UNIQUE"; + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) + { + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; + } + else + { + dol_print_error($db); + } +} + //Activate ProfId mandatory if ($action == 'setprofidmandatory') { $status = GETPOST('status','alpha'); - $idprof="SOCIETE_IDPROF".$value."_MANDATORY"; - if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0) + $idprof="SOCIETE_".$value."_MANDATORY"; + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; } else { @@ -236,11 +236,11 @@ if ($action == 'setprofidinvoicemandatory') { $status = GETPOST('status','alpha'); - $idprof="SOCIETE_IDPROF".$value."_INVOICE_MANDATORY"; - if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0) + $idprof="SOCIETE_".$value."_INVOICE_MANDATORY"; + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; } else { @@ -298,7 +298,6 @@ print ' '.$langs->trans("Status").''; print ' '.$langs->trans("ShortInfo").''; print "\n"; -$var = true; foreach ($dirsociete as $dirroot) { $dir = dol_buildpath($dirroot,0); @@ -327,7 +326,6 @@ foreach ($dirsociete as $dirroot) if ($modCodeTiers->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($modCodeTiers->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var = !$var; print ''."\n"; print ''.$modCodeTiers->name.''."\n"; print ''.$modCodeTiers->info($langs).''."\n"; @@ -380,7 +378,6 @@ print ''.$langs->trans("Status").''; print ''.$langs->trans("ShortInfo").''; print "\n"; -$var=true; foreach ($dirsociete as $dirroot) { $dir = dol_buildpath($dirroot,0); @@ -403,7 +400,6 @@ foreach ($dirsociete as $dirroot) } $modCodeCompta = new $file; - $var = !$var; print ''; print ''.$modCodeCompta->name."\n"; @@ -474,7 +470,6 @@ print ''.$langs->trans("ShortInfo").''; print ''.$langs->trans("Preview").''; print "\n"; -$var=true; foreach ($dirsociete as $dirroot) { $dir = dol_buildpath($dirroot.'doc/',0); @@ -507,7 +502,6 @@ foreach ($dirsociete as $dirroot) if ($modulequalified) { - $var = !$var; print ''; print $module->name; print "\n"; @@ -521,7 +515,7 @@ foreach ($dirsociete as $dirroot) print "\n"; //if ($conf->global->COMPANY_ADDON_PDF != "$name") //{ - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; //} @@ -542,7 +536,7 @@ foreach ($dirsociete as $dirroot) else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } } @@ -597,76 +591,74 @@ print ''.$langs->trans("MustBeMandatory").''; print ''.$langs->trans("MustBeInvoiceMandatory").''; print "\n"; -$profid[0][0]=$langs->trans("ProfId1"); -$profid[0][1]=$langs->transcountry('ProfId1', $mysoc->country_code); -$profid[1][0]=$langs->trans("ProfId2"); -$profid[1][1]=$langs->transcountry('ProfId2', $mysoc->country_code); -$profid[2][0]=$langs->trans("ProfId3"); -$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code); -$profid[3][0]=$langs->trans("ProfId4"); -$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code); -$profid[4][0]=$langs->trans("ProfId5"); -$profid[4][1]=$langs->transcountry('ProfId5', $mysoc->country_code); -$profid[5][0]=$langs->trans("ProfId6"); -$profid[5][1]=$langs->transcountry('ProfId6', $mysoc->country_code); - -$var = true; -$i=0; +$profid['IDPROF1'][0]=$langs->trans("ProfId1"); +$profid['IDPROF1'][1]=$langs->transcountry('ProfId1', $mysoc->country_code); +$profid['IDPROF2'][0]=$langs->trans("ProfId2"); +$profid['IDPROF2'][1]=$langs->transcountry('ProfId2', $mysoc->country_code); +$profid['IDPROF3'][0]=$langs->trans("ProfId3"); +$profid['IDPROF3'][1]=$langs->transcountry('ProfId3', $mysoc->country_code); +$profid['IDPROF4'][0]=$langs->trans("ProfId4"); +$profid['IDPROF4'][1]=$langs->transcountry('ProfId4', $mysoc->country_code); +$profid['IDPROF5'][0]=$langs->trans("ProfId5"); +$profid['IDPROF5'][1]=$langs->transcountry('ProfId5', $mysoc->country_code); +$profid['IDPROF6'][0]=$langs->trans("ProfId6"); +$profid['IDPROF6'][1]=$langs->transcountry('ProfId6', $mysoc->country_code); +$profid['EMAIL'][0]=$langs->trans("EMail"); +$profid['EMAIL'][1]=$langs->trans('Email'); $nbofloop=count($profid); -while ($i < $nbofloop) +foreach($profid as $key => $val) { - if ($profid[$i][1]!='-') + if ($profid[$key][1]!='-') { - $var = !$var; - print ''; - print ''.$profid[$i][0]."\n"; - print $profid[$i][1]; + print ''.$profid[$key][0]."\n"; + print $profid[$key][1]; print ''; - $idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE'; - $idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY'; - $idprof_invoice_mandatory ='SOCIETE_IDPROF'.($i+1).'_INVOICE_MANDATORY'; + $idprof_unique ='SOCIETE_'.$key.'_UNIQUE'; + $idprof_mandatory ='SOCIETE_'.$key.'_MANDATORY'; + $idprof_invoice_mandatory ='SOCIETE_'.$key.'_INVOICE_MANDATORY'; + $verif=(empty($conf->global->$idprof_unique)?false:true); $mandatory=(empty($conf->global->$idprof_mandatory)?false:true); $invoice_mandatory=(empty($conf->global->$idprof_invoice_mandatory)?false:true); if ($verif) { - print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } if ($mandatory) { - print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } if ($invoice_mandatory) { - print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } @@ -683,7 +675,6 @@ print load_fiche_titre($langs->trans("Other"),'',''); // Autres options $form=new Form($db); -$var=true; print '
      '; print ''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 4d1ce4da9c7..0dea66946ec 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -76,14 +76,14 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { // Cancel - if (GETPOST("cancel") && ! empty($backtopage)) + if (GETPOST('cancel','alpha') && ! empty($backtopage)) { header("Location: ".$backtopage); exit; } // Purge search criteria - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $actioncode=''; $search_agenda_label=''; @@ -120,28 +120,28 @@ if ($socid > 0) dol_fiche_head($head, 'agenda', $langs->trans("ThirdParty"), -1, 'company'); - $linkback = ''.$langs->trans("BackToList").''; - + $linkback = ''.$langs->trans("BackToList").''; + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); - + print '
      '; - + print '
      '; - + $object->info($socid); print dol_print_object_info($object, 1); - + print '
      '; dol_fiche_end(); - + // Actions buttons - + $objthirdparty=$object; $objcon=new stdClass(); - + $out=''; $permok=$user->rights->agenda->myactions->create; if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) @@ -154,7 +154,7 @@ if ($socid > 0) //$out.=""; } - + print '
      '; if (! empty($conf->agenda->enabled)) @@ -177,9 +177,9 @@ if ($socid > 0) if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); - + // List of all actions $filters=array(); $filters['search_agenda_label']=$search_agenda_label; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 689771ad223..452a9cc6a61 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -335,7 +335,7 @@ abstract class ActionsCardCommon // Define output language $outputlangs = $langs; $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$this->object->default_lang; if (! empty($newlang)) { diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index d542f0553ba..45b5e76fcda 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -133,7 +133,7 @@ - trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':''); ?> + trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY?'*':''); ?> trans('Web'); ?> diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 1f6201ec829..951d17c5b63 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -148,7 +148,7 @@ if ($this->control->tpl['fournisseur']) { - trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':''); ?> + trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY?'*':''); ?> trans('Web'); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index 1be20214c35..44bf9dadf58 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -143,7 +143,7 @@ - trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':''); ?> + trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY?'*':''); ?> trans('Web'); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 90543958902..81e0b66c103 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -145,7 +145,7 @@ if ($this->control->tpl['fournisseur']) { - trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':''); ?> + trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY?'*':''); ?> trans('Web'); ?> diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 46e6366bba1..45101a79d45 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -56,7 +56,7 @@ if (! empty($conf->notification->enabled)) $langs->load("mails"); $mesg=''; $error=0; $errors=array(); $action = (GETPOST('action','aZ09') ? GETPOST('action','aZ09') : 'view'); -$cancel = GETPOST('cancel'); +$cancel = GETPOST('cancel','alpha'); $backtopage = GETPOST('backtopage','alpha'); $confirm = GETPOST('confirm'); $socid = GETPOST('socid','int'); @@ -95,6 +95,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'ro + /* * Actions */ @@ -168,19 +169,23 @@ if (empty($reshook)) } // Merge extrafields - foreach ($soc_origin->array_options as $key => $val) + if (is_array($soc_origin->array_options)) { - if (empty($object->array_options[$key])) $object->array_options[$key] = $val; + foreach ($soc_origin->array_options as $key => $val) + { + if (empty($object->array_options[$key])) $object->array_options[$key] = $val; + } } // TODO Merge categories + + $object->update($object->id, $user); // Move links $objects = array( 'Adherent' => '/adherents/class/adherent.class.php', 'Societe' => '/societe/class/societe.class.php', - 'Bookmark' => '/bookmarks/class/bookmark.class.php', 'Categorie' => '/categories/class/categorie.class.php', 'ActionComm' => '/comm/action/class/actioncomm.class.php', 'Propal' => '/comm/propal/class/propal.class.php', @@ -305,22 +310,21 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdPartyName")), null, 'errors'); $error++; - $action='create'; + $action=($action=='add'?'create':'edit'); } if (GETPOST('client') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProspectCustomer")), null, 'errors'); $error++; - $action='create'; + $action=($action=='add'?'create':'edit'); } if (GETPOST('fournisseur') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors'); $error++; - $action='create'; + $action=($action=='add'?'create':'edit'); } - if ($action == 'update') { $ret=$object->fetch($socid); @@ -328,7 +332,7 @@ if (empty($reshook)) } else $object->canvas=$canvas; - if (GETPOST("private") == 1) + if (GETPOST("private") == 1) // Ask to create a contact { $object->particulier = GETPOST("private"); @@ -351,14 +355,14 @@ if (empty($reshook)) $object->skype = GETPOST('skype', 'alpha'); $object->phone = GETPOST('phone', 'alpha'); $object->fax = GETPOST('fax','alpha'); - $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); - $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->idprof1 = GETPOST('idprof1', 'alpha'); - $object->idprof2 = GETPOST('idprof2', 'alpha'); - $object->idprof3 = GETPOST('idprof3', 'alpha'); - $object->idprof4 = GETPOST('idprof4', 'alpha'); - $object->idprof5 = GETPOST('idprof5', 'alpha'); - $object->idprof6 = GETPOST('idprof6', 'alpha'); + $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); + $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); + $object->idprof1 = trim(GETPOST('idprof1', 'alpha')); + $object->idprof2 = trim(GETPOST('idprof2', 'alpha')); + $object->idprof3 = trim(GETPOST('idprof3', 'alpha')); + $object->idprof4 = trim(GETPOST('idprof4', 'alpha')); + $object->idprof5 = trim(GETPOST('idprof5', 'alpha')); + $object->idprof6 = trim(GETPOST('idprof6', 'alpha')); $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); $object->code_client = GETPOST('code_client', 'alpha'); $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); @@ -378,7 +382,9 @@ if (empty($reshook)) $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); - $object->typent_id = GETPOST('typent_id'); + $object->typent_id = GETPOST('typent_id','int'); + + $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type $object->client = GETPOST('client', 'int'); $object->fournisseur = GETPOST('fournisseur', 'int'); @@ -415,24 +421,25 @@ if (empty($reshook)) else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']); // Check parameters - if (! GETPOST("cancel")) + if (! GETPOST('cancel','alpha')) { if (! empty($object->email) && ! isValidEMail($object->email)) { $langs->load("errors"); - $error++; $errors[] = $langs->trans("ErrorBadEMail",$object->email); + $error++; + setEventMessages('', $langs->trans("ErrorBadEMail",$object->email), 'errors'); $action = ($action=='add'?'create':'edit'); } if (! empty($object->url) && ! isValidUrl($object->url)) { $langs->load("errors"); - $error++; $errors[] = $langs->trans("ErrorBadUrl",$object->url); + setEventMessages('', $langs->trans("ErrorBadUrl",$object->url), 'errors'); $action = ($action=='add'?'create':'edit'); } if ($object->fournisseur && ! $conf->fournisseur->enabled) { $langs->load("errors"); - $error++; $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled"); + setEventMessages('', $langs->trans("ErrorSupplierModuleNotEnabled"), 'errors'); $action = ($action=='add'?'create':'edit'); } if (! empty($object->webservices_url)) { @@ -456,40 +463,6 @@ if (empty($reshook)) $object->country_code=$tmparray['code']; $object->country=$tmparray['label']; } - - // Check for duplicate or mandatory prof id - // Only for companies - if (!($object->particulier || $private)) - { - for ($i = 1; $i <= 6; $i++) - { - $slabel="idprof".$i; - $_POST[$slabel]=trim($_POST[$slabel]); - $vallabel=$_POST[$slabel]; - if ($vallabel && $object->id_prof_verifiable($i)) - { - if($object->id_prof_exists($i,$vallabel,$object->id)) - { - $langs->load("errors"); - $error++; $errors[] = $langs->transcountry('ProfId'.$i, $object->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel); - $action = (($action=='add'||$action=='create')?'create':'edit'); - } - } - - // Check for mandatory prof id (but only if country is than than ours) - if ($mysoc->country_id > 0 && $object->country_id == $mysoc->country_id) - { - $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - if (! $vallabel && ! empty($conf->global->$idprof_mandatory)) - { - $langs->load("errors"); - $error++; - $errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code)); - $action = (($action=='add'||$action=='create')?'create':'edit'); - } - } - } - } } if (! $error) @@ -507,11 +480,12 @@ if (empty($reshook)) { if ($object->particulier) { - dol_syslog("This thirdparty is a personal people",LOG_DEBUG); + dol_syslog("We ask to create a contact/address too", LOG_DEBUG); $result=$object->create_individual($user); - if (! $result >= 0) + if ($result < 0) { - $error=$object->error; $errors=$object->errors; + setEventMessages($object->error, $object->errors, 'errors'); + $error++; } } @@ -573,7 +547,8 @@ if (empty($reshook)) $object->code_client = null; } - $error=$object->error; $errors=$object->errors; + setEventMessages($object->error, $object->errors, 'errors'); + $error++; } if ($result >= 0) @@ -605,7 +580,7 @@ if (empty($reshook)) if ($action == 'update') { - if (GETPOST("cancel")) + if (GETPOST('cancel','alpha')) { if (! empty($backtopage)) { @@ -627,7 +602,8 @@ if (empty($reshook)) $result = $object->update($socid, $user, 1, $object->oldcopy->codeclient_modifiable(), $object->oldcopy->codefournisseur_modifiable(), 'update', 0); if ($result <= 0) { - $error = $object->error; $errors = $object->errors; + setEventMessages($object->error, $object->errors, 'errors'); + $error++; } // Customer categories association @@ -681,7 +657,7 @@ if (empty($reshook)) } } else - { + { switch($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -711,7 +687,7 @@ if (empty($reshook)) if (! $error && ! count($errors)) { - if (! empty($backtopage)) + if (! empty($backtopage)) { header("Location: ".$backtopage); exit; @@ -729,6 +705,10 @@ if (empty($reshook)) } } } + else + { + $action = ($action=='add'?'create':'edit'); + } } // Delete third party @@ -745,7 +725,8 @@ if (empty($reshook)) else { $langs->load("errors"); - $error=$langs->trans($object->error); $errors = $object->errors; + setEventMessages($object->error, $object->errors, 'errors'); + $error++; $action=''; } } @@ -780,7 +761,6 @@ if (empty($reshook)) } - /* * View */ @@ -1064,7 +1044,7 @@ else // Prospect/Customer print ''.fieldLabel('ProspectCustomer','customerprospect',1).''; print ''; - $selected=isset($_POST['client'])?GETPOST('client'):$object->client; + $selected=GETPOST('client','int')!=''?GETPOST('client','int'):$object->client; print ''; print ''.fieldLabel('Web','url').''; print ''; @@ -1380,11 +1360,12 @@ else * Edition */ + //print load_fiche_titre($langs->trans("EditCompany")); if ($socid) { - $res=$object->fetch_optionals($object->id,$extralabels); + $res=$object->fetch_optionals($object->id,$extralabels); //if ($res < 0) { dol_print_error($db); exit; } $head = societe_prepare_head($object); @@ -1490,8 +1471,6 @@ else } } - dol_htmloutput_errors($error,$errors); - if($object->localtax1_assuj==0){ $sub=0; }else{$sub=1;} @@ -1499,7 +1478,6 @@ else $sub2=0; }else{$sub2=1;} - print "\n".''; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index b4d93feb511..fda4eea65ea 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -173,7 +173,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -200,7 +200,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -401,7 +401,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -434,7 +434,7 @@ if (empty($reshook)) } // Reopen proposal - else if ($action == 'confirm_reopen' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel')) { + else if ($action == 'confirm_reopen' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) { // prevent browser refresh from reopening proposal several times if ($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) { $object->reopen($user, SupplierProposal::STATUS_VALIDATED); @@ -442,7 +442,7 @@ if (empty($reshook)) } // Close proposal - else if ($action == 'close' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel')) { + else if ($action == 'close' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) { // prevent browser refresh from reopening proposal several times if ($object->statut == SupplierProposal::STATUS_SIGNED) { $object->setStatut(SupplierProposal::STATUS_CLOSE); @@ -450,7 +450,7 @@ if (empty($reshook)) } // Set accepted/refused - else if ($action == 'setstatut' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel')) { + else if ($action == 'setstatut' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) { if (! GETPOST('statut')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), null, 'errors'); $action = 'statut'; @@ -485,7 +485,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -511,7 +511,8 @@ if (empty($reshook)) $error = 0; // Set if we used free entry or predefined product - $predef=''; + $predef=''; + $ref_fourn = GETPOST('fourn_ref'); $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); @@ -573,7 +574,7 @@ if (empty($reshook)) { $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) // TODO this test seems useless { $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) @@ -588,8 +589,9 @@ if (empty($reshook)) } elseif (GETPOST('idprodfournprice') > 0) { - //$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), -1); // We force qty to -1 to be sure to find if a supplier price exist + //$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); $res=$productsupplier->fetch($idprod); } @@ -693,7 +695,7 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -828,7 +830,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -869,7 +871,7 @@ if (empty($reshook)) } } - else if ($action == 'updateligne' && $user->rights->supplier_proposal->creer && GETPOST('cancel') == $langs->trans('Cancel')) { + else if ($action == 'updateligne' && $user->rights->supplier_proposal->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) { header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -884,7 +886,7 @@ if (empty($reshook)) $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $newlang = (GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -983,7 +985,9 @@ $now = dol_now(); // Add new askprice if ($action == 'create') { - print load_fiche_titre($langs->trans("NewAskPrice")); + $currency_code = $conf->currency; + + print load_fiche_titre($langs->trans("NewAskPrice")); $soc = new Societe($db); if ($socid > 0) @@ -1059,6 +1063,7 @@ if ($action == 'create') } else { print ''; print $form->select_company('', 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print ' '.$langs->trans("AddThirdParty").''; print ''; } print '' . "\n"; @@ -1801,7 +1806,7 @@ if ($action == 'create') // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'supplier_proposal', $socid); + $somethingshown = $formactions->showactions($object, 'supplier_proposal', $socid, 1); print '
      '; } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index b14e4a40ff9..53c2d4215df 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -506,7 +506,7 @@ class SupplierProposal extends CommonObject if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); // Mise a jour informations denormalisees au niveau de la propale meme - $result=$this->update_price(1,'auto'); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. + $result=$this->update_price(1,'auto',0,$this->thirdparty); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. if ($result > 0) { $this->db->commit(); @@ -1661,7 +1661,7 @@ class SupplierProposal extends CommonObject if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->thirdparty->default_lang); + $newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } //$ret=$object->fetch($id); // Reload to get new records @@ -2563,10 +2563,9 @@ class SupplierProposal extends CommonObject /** - * \class SupplierProposalLine - * \brief Class to manage supplier_proposal lines + * Class to manage supplier_proposal lines */ -class SupplierProposalLine extends CommonObjectLine +class SupplierProposalLine extends CommonObjectLine { var $db; var $error; @@ -2798,6 +2797,7 @@ class SupplierProposalLine extends CommonObjectLine if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0; if (empty($this->fk_unit)) $this->fk_unit=0; + if (empty($this->subprice)) $this->subprice=0; if (empty($this->pa_ht)) $this->pa_ht=0; @@ -2829,27 +2829,27 @@ class SupplierProposalLine extends CommonObjectLine $sql.= ' ref_fourn,'; $sql.= ' fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc, fk_unit)'; $sql.= " VALUES (".$this->fk_supplier_proposal.","; - $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; + $sql.= " ".($this->fk_parent_line>0?"'".$this->db->escape($this->fk_parent_line)."'":"null").","; $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " '".$this->db->escape($this->desc)."',"; - $sql.= " ".($this->fk_product?"'".$this->fk_product."'":"null").","; - $sql.= " '".$this->product_type."',"; - $sql.= " ".($this->fk_remise_except?"'".$this->fk_remise_except."'":"null").","; + $sql.= " ".($this->fk_product?"'".$this->db->escape($this->fk_product)."'":"null").","; + $sql.= " '".$this->db->escape($this->product_type)."',"; + $sql.= " ".($this->fk_remise_except?"'".$this->db->escape($this->fk_remise_except)."'":"null").","; $sql.= " ".price2num($this->qty).","; $sql.= " ".price2num($this->tva_tx).","; $sql.= " ".price2num($this->localtax1_tx).","; $sql.= " ".price2num($this->localtax2_tx).","; - $sql.= " '".$this->localtax1_type."',"; - $sql.= " '".$this->localtax2_type."',"; - $sql.= " ".price2num($this->subprice).","; + $sql.= " '".$this->db->escape($this->localtax1_type)."',"; + $sql.= " '".$this->db->escape($this->localtax2_type)."',"; + $sql.= " ".(!empty($this->subprice)?price2num($this->subprice):"null").","; $sql.= " ".price2num($this->remise_percent).","; - $sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").","; + $sql.= " ".(isset($this->info_bits)?"'".$this->db->escape($this->info_bits)."'":"null").","; $sql.= " ".price2num($this->total_ht).","; $sql.= " ".price2num($this->total_tva).","; $sql.= " ".price2num($this->total_localtax1).","; $sql.= " ".price2num($this->total_localtax2).","; $sql.= " ".price2num($this->total_ttc).","; - $sql.= " ".(!empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").","; + $sql.= " ".(!empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null").","; $sql.= " ".(isset($this->pa_ht)?"'".price2num($this->pa_ht)."'":"null").","; $sql.= ' '.$this->special_code.','; $sql.= ' '.$this->rang.','; @@ -2982,6 +2982,7 @@ class SupplierProposalLine extends CommonObjectLine if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0; if (empty($this->fk_unit)) $this->fk_unit=0; + if (empty($this->subprice)) $this->subprice=0; if (empty($this->pa_ht)) $this->pa_ht=0; @@ -3024,7 +3025,7 @@ class SupplierProposalLine extends CommonObjectLine $sql.= " , total_localtax1=".price2num($this->total_localtax1).""; $sql.= " , total_localtax2=".price2num($this->total_localtax2).""; } - $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null"); + $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null"); $sql.= " , buy_price_ht=".price2num($this->pa_ht); if (strlen($this->special_code)) $sql.= " , special_code=".$this->special_code; $sql.= " , fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index cec276a6064..4985fd34629 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -44,7 +44,6 @@ $ref = GETPOST('ref','alpha'); $socid=''; if (! empty($user->societe_id)) { - $action=''; $socid = $user->societe_id; } $result = restrictedArea($user, 'supplier_proposal', $id); @@ -96,8 +95,8 @@ if ($object->id > 0) // Supplier proposal card $linkback = '' . $langs->trans("BackToList") . ''; - - + + $morehtmlref='
      '; // Ref supplier //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); @@ -138,14 +137,14 @@ if ($object->id > 0) } } $morehtmlref.='
      '; - - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
      '; print '
      '; - + print ''; print ''; @@ -154,9 +153,9 @@ if ($object->id > 0) print '
      '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
      '; print '
      '; - + dol_fiche_end(); - + $modulepart = 'supplier_proposal'; $permission = $user->rights->supplier_proposal->creer; $permtoedit = $user->rights->supplier_proposal->creer; diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index 718b79ce4ae..8cee304e3bb 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/info.php @@ -43,6 +43,8 @@ $result = restrictedArea($user, 'supplier_proposal', $id); * View */ +$form = new Form($db); + llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur'); $object = new SupplierProposal($db); @@ -57,8 +59,8 @@ dol_fiche_head($head, 'info', $langs->trans('CommRequest'), -1, 'supplier_propos // Supplier proposal card $linkback = '' . $langs->trans("BackToList") . ''; - - + + $morehtmlref='
      '; // Ref supplier //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); @@ -99,11 +101,11 @@ if (! empty($conf->projet->enabled)) } } $morehtmlref.='
      '; - - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - + print '
      '; print '
      '; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index f6d9c9510a0..96d1079b92a 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -43,6 +43,7 @@ if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('companies'); +$langs->load('propal'); $langs->load('supplier_proposal'); $langs->load('compta'); $langs->load('bills'); @@ -167,8 +168,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -177,7 +178,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_categ=''; $search_user=''; @@ -284,7 +285,7 @@ if ($search_montant_vat != '') $sql.= natural_search("sp.tva", $search_montant_v if ($search_montant_ttc != '') $sql.= natural_search("sp.total", $search_montant_ttc, 1); if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($socid) $sql.= ' AND s.rowid = '.$socid; -if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$search_status.')'; +if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$db->escape($search_status).')'; if ($month > 0) { if ($year > 0 && empty($day)) @@ -323,8 +324,9 @@ foreach ($search_array_options as $key => $val) $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; - if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -418,7 +420,7 @@ if ($resql) { $langs->load("mails"); - if (! GETPOST('cancel')) + if (! GETPOST('cancel','alpha')) { $objecttmp=new SupplierProposal($db); $listofselectedid=array(); @@ -734,7 +736,7 @@ if ($resql) $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -1023,6 +1025,7 @@ if ($resql) $urlsource.=str_replace('&','&',$param); $filedir=$diroutputmassaction; + $genallowed=$user->rights->supplier_proposal->lire; $delallowed=$user->rights->supplier_proposal->lire; diff --git a/htdocs/support/index.php b/htdocs/support/index.php index 0e27107ef54..ab5d62df39e 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -70,12 +70,12 @@ print ''; print ''; print '